Teacup_Firmware/config.h.dist

289 lines
9.3 KiB
Plaintext

#ifndef _CONFIG_H
#define _CONFIG_H
/*
Values reflecting the gearing of your machine.
All numbers are fixed point integers, so no more than 3 digits to the right of the decimal point, please :-)
*/
// calculate these values appropriate for your machine
// for threaded rods, this is (steps motor per turn) / (pitch of the thread)
// for belts, this is (steps per motor turn) / (number of gear teeth) / (belt module)
// half-stepping doubles the number, quarter stepping requires * 4, etc.
#define STEPS_PER_MM_X 320.000
#define STEPS_PER_MM_Y 320.000
#define STEPS_PER_MM_Z 320.000
// http://blog.arcol.hu/?p=157 may help with this next one
#define STEPS_PER_MM_E 320.000
/*
Values depending on the capabilities of your stepper motors and other mechanics.
All numbers are integers, no decimals allowed.
*/
// used for G0 rapid moves and as a cap for all other feedrates
#define MAXIMUM_FEEDRATE_X 200
#define MAXIMUM_FEEDRATE_Y 200
#define MAXIMUM_FEEDRATE_Z 100
#define MAXIMUM_FEEDRATE_E 200
// used when searching endstops and as default feedrate
#define SEARCH_FEEDRATE_X 50
#define SEARCH_FEEDRATE_Y 50
#define SEARCH_FEEDRATE_Z 50
#define SEARCH_FEEDRATE_E 50
// extruder settings
#define TEMP_HYSTERESIS 20
#define TEMP_RESIDENCY_TIME 60
// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 20
/*
acceleration, reprap style.
Each movement starts at the speed of the previous command and accelerates or decelerates linearly to reach target speed at the end of the movement.
Can also be set in Makefile
*/
// #define ACCELERATION_REPRAP
/*
acceleration and deceleration ramping.
Each movement starts at (almost) no speed, linearly accelerates to target speed and decelerates just in time to smoothly stop at the target. alternative to ACCELERATION_REPRAP
Can also be set in Makefile
*/
#define ACCELERATION_RAMPING
// how fast to accelerate when using ACCELERATION_RAMPING
// smaller values give quicker acceleration
// valid range = 1 to 8,000,000; 500,000 is a good starting point
#define ACCELERATION_STEEPNESS 500000
#ifdef ACCELERATION_REPRAP
#ifdef ACCELERATION_RAMPING
#error Cant use ACCELERATION_REPRAP and ACCELERATION_RAMPING together.
#endif
#endif
// which temperature sensor are you using?
// #define TEMP_MAX6675
// #define TEMP_THERMISTOR
// #define TEMP_AD595
#define NUM_TEMP_SENSORS 1
#ifdef TEMP_C
/***************************************************************************\
* *
* Fill in the following struct according to your hardware *
* *
* If your temperature sensor has no associated heater, enter '255' as the *
* heater index. *
* *
* for GEN3 set temp_type to TT_INTERCOM, temp_pin to 0 and heater index to *
* 255 *
* *
\***************************************************************************/
struct {
uint8_t temp_type;
uint8_t temp_pin;
uint8_t heater_index;
} temp_sensors[NUM_TEMP_SENSORS] =
{
{
TT_INTERCOM,
0,
0
}
};
#endif
#define NUM_HEATERS 0
#ifdef HEATER_C
/***************************************************************************\
* *
* Fill in the following struct according to your hardware *
* *
* For the atmega168/328, timer/pin mappings are as follows *
* *
* OCR0A - PD6 *
* OCR0B - PD5 *
* OCR2A - PB3 *
* OCR2B - PD3 *
* *
\***************************************************************************/
struct {
volatile uint8_t *heater_port;
uint8_t heater_pin;
volatile uint8_t *heater_pwm;
} heaters[NUM_HEATERS]/* =
{
{
&PORTD,
PIND6,
&OCR0A
}
}*/;
#endif
// temperature history count. higher values make PID derivative term more stable at the expense of reaction time
#define TH_COUNT 8
// if you selected thermistor or AD595, what pin is it on?
#define TEMP_PIN_CHANNEL AIO0_PIN
#define ANALOG_MASK MASK(TEMP_PIN_CHANNEL)
/*
Firmware build options
*/
/*
RepRap Host changes it's communications protocol from time to time and intentionally avoids backwards compatibility. Set this to the date the source code of your Host was fetched from RepRap's repository, which is likely also the build date.
See the discussion on the reprap-dev mailing list from 11 Oct. 2010.
Undefine it for best human readability, set it to an old date for compatibility with hosts before August 2010
*/
// #define REPRAP_HOST_COMPATIBILITY 19750101
#define REPRAP_HOST_COMPATIBILITY 20100806
// #define REPRAP_HOST_COMPATIBILITY <date of next RepRap Host compatibility break>
// this option makes the step interrupt interruptible.
// this should help immensely with dropped serial characters, but may also make debugging infuriating due to the complexities arising from nested interrupts
#define STEP_INTERRUPT_INTERRUPTIBLE 1
/*
Xon/Xoff flow control.
Redundant when using RepRap Host for sending GCode, but mandatory when sending GCode files with a plain terminal emulator, like GtkTerm (Linux), CoolTerm (Mac) or HyperTerminal (Windows).
Can also be set in Makefile
*/
// #define XONXOFF
/*
move buffer size, in number of moves
note that each move takes a fair chunk of ram (69 bytes as of this writing) so don't make the buffer too big - a bigger serial readbuffer may help more than increasing this unless your gcodes are more than 70 characters long on average.
however, a larger movebuffer will probably help with lots of short consecutive moves, as each move takes a bunch of math (hence time) to set up so a longer buffer allows more of the math to be done during preceding longer moves
*/
#define MOVEBUFFER_SIZE 8
/*
FiveD on Arduino implements a watchdog, which has to be reset every 250ms or it will reboot the controller. As rebooting (and letting the GCode sending application trying to continue the build with a then different Home point) is probably even worse than just hanging, and there is no better restore code in place, this is disabled for now.
*/
// #define USE_WATCHDOG
/*
analog subsystem stuff
REFERENCE - which analog reference to use. see analog.h for choices
ANALOG_MASK - which analog inputs we will be using, bitmask. eg; #define ANALOG_MASK MASK(AIO0_PIN) | MASK(3) for AIN0 and AIN3
*/
#define REFERENCE REFERENCE_AVCC
#ifndef ANALOG_MASK
#define ANALOG_MASK 0
#endif
/*
Machine Pin Definitions
- make sure to avoid duplicate usage of a pin
- comment out pins not in use, as this drops the corresponding code and makes operations faster
*/
#include "arduino.h"
#ifdef GEN3
// this is official reprap motherboard pinout
#define TX_ENABLE_PIN DIO12
#define RX_ENABLE_PIN DIO13
#define X_STEP_PIN DIO15
#define X_DIR_PIN DIO18
#define X_MIN_PIN DIO20
#define X_MAX_PIN DIO21
#define X_ENABLE_PIN DIO19
#define Y_STEP_PIN DIO23
#define Y_DIR_PIN DIO22
#define Y_MIN_PIN AIO6
#define Y_MAX_PIN AIO5
#define Y_ENABLE_PIN DIO7
#define Z_STEP_PIN AIO4
#define Z_DIR_PIN AIO3
#define Z_MIN_PIN AIO1
#define Z_MAX_PIN AIO0
#define Z_ENABLE_PIN AIO2
#define E_STEP_PIN DIO16
#define E_DIR_PIN DIO17
#define SD_CARD_DETECT DIO2
#define SD_WRITE_PROTECT DIO3
#else
/*
user defined pins
adjust to suit your electronics,
or adjust your electronics to suit this
*/
#define X_STEP_PIN AIO0
#define X_DIR_PIN AIO1
#define X_MIN_PIN AIO2
#define Y_STEP_PIN AIO3
#define Y_DIR_PIN AIO4
#define Y_MIN_PIN AIO5
#define Z_STEP_PIN DIO2
#define Z_DIR_PIN DIO3
#define Z_MIN_PIN DIO4
#define E_STEP_PIN DIO7
#define E_DIR_PIN DIO8
#define PS_ON_PIN DIO9
#endif
/**
* list of PWM-able pins and corresponding timers
* timer1 is used for step timing so don't use OC1A/OC1B
*
* For Arduino Diecimila/Duemilanove/UNO
* Don't use OC1A/OC1B (DIO9/DIO10)
*
* OC0A DIO6
* OC0B DIO5
* OC1A DIO9
* OC1B DIO10
* OC2A DIO11
* OC2B DIO3
*
* For Arduino Mega
* Don't use OC1A/OC1B (DIO11/DIO12)
*
* OC0A DIO13
* OC0B DIO4
* OC1A DIO11
* OC1B DIO12
* OC2A DIO10
* OC2B DIO9
* OC3A DIO5
* OC3B DIO2
* OC3C DIO3
* OC4A DIO6
* OC4B DIO7
* OC4C DIO8
* OC5A DIO46
* OC5B DIO45
* OC5C DIO44
*
*/
// this is the scaling of internally stored PID values. 1024L is a good value
#define PID_SCALE 1024L
#endif /* _CONFIG_H */