1 #ifndef __CONFIGURATION_H
2 #define __CONFIGURATION_H
6 // This determines the communication speed of the printer
7 #define BAUDRATE 250000
8 //#define BAUDRATE 115200
9 //#define BAUDRATE 230400
14 // See nophead's blog for more info
16 //#define XY_FREQUENCY_LIMIT 15
18 // Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
19 // of the buffer and all stops. This should not be much greater than zero and should only be changed
20 // if unwanted behavior is observed on a user's machine when running at very slow speeds.
21 #define MINIMUM_PLANNER_SPEED 2.0 // (mm/sec)
23 // If defined the movements slow down when the look ahead buffer is only half full
26 // BASIC SETTINGS: select your board type, thermistor type, axis scaling, and endstop configuration
28 //// The following define selects which electronics board you have. Please choose the one that matches your setup
29 // MEGA/RAMPS up to 1.2 = 3,
32 // Sanguinololu 1.2 and above = 62
37 //===========================================================================
38 //=============================Thermal Settings ============================
39 //===========================================================================
41 //// Thermistor settings:
42 // 1 is 100k thermistor
43 // 2 is 200k thermistor
44 // 3 is mendel-parts thermistor
45 // 4 is 10k thermistor
46 // 5 is ParCan supplied 104GT-2 100K
48 // 7 is 100k Honeywell thermistor 135-104LAG-J01
49 //#define THERMISTORHEATER_0 3
50 //#define THERMISTORHEATER_1 3
51 //#define THERMISTORBED 3
53 //#define HEATER_0_USES_THERMISTOR
54 //#define HEATER_1_USES_THERMISTOR
55 #define HEATER_0_USES_AD595
56 //#define HEATER_1_USES_AD595
58 // Select one of these only to define how the bed temp is read.
59 //#define BED_USES_THERMISTOR
60 //#define BED_USES_AD595
62 #define BED_CHECK_INTERVAL 5000 //ms
64 //// Experimental watchdog and minimal temp
65 // The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
66 // If the temperature has not increased at the end of that period, the target temperature is set to zero. It can be reset with another M104/M109
67 /// CURRENTLY NOT IMPLEMENTED AND UNUSEABLE
68 //#define WATCHPERIOD 5000 //5 seconds
70 // Actual temperature must be close to target for this long before M109 returns success
71 //#define TEMP_RESIDENCY_TIME 20 // (seconds)
72 //#define TEMP_HYSTERESIS 5 // (C°) range of +/- temperatures considered "close" to the target one
74 //// The minimal temperature defines the temperature below which the heater will not be enabled
75 #define HEATER_0_MINTEMP 5
76 //#define HEATER_1_MINTEMP 5
77 //#define BED_MINTEMP 5
80 // When temperature exceeds max temp, your heater will be switched off.
81 // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
82 // You should use MINTEMP for thermistor short/failure protection.
83 #define HEATER_0_MAXTEMP 275
84 //#define HEATER_1_MAXTEMP 275
85 //#define BED_MAXTEMP 150
89 // This defines if the M109 call should not block if it is cooling down.
90 // example: From a current temp of 220, you set M109 S200.
91 // if CooldownNoWait is defined M109 will not wait for the cooldown to finish
92 #define CooldownNoWait true
94 // Heating is finished if a temperature close to this degree shift is reached
95 #define HEATING_EARLY_FINISH_DEG_OFFSET 1 //Degree
97 // Uncomment the following line to enable PID support.
101 #if MOTHERBOARD == 62
102 #error Sanguinololu does not support PID, sorry. Please disable it.
104 //#define PID_DEBUG // Sends debug data to the serial port.
105 //#define PID_OPENLOOP 1 // Puts PID in open loop. M104 sets the output power in %
107 #define PID_MAX 255 // limits current to nozzle; 255=full current
108 #define PID_INTEGRAL_DRIVE_MAX 255 //limit for the integral term
109 #define K1 0.95 //smoothing factor withing the PID
110 #define PID_dT 0.1 //sampling period of the PID
112 //To develop some PID settings for your machine, you can initiall follow
113 // the Ziegler-Nichols method.
114 // set Ki and Kd to zero.
115 // heat with a defined Kp and see if the temperature stabilizes
116 // ideally you do this graphically with repg.
117 // the PID_CRITIAL_GAIN should be the Kp at which temperature oscillatins are not dampned out/decreas in amplitutde
118 // PID_SWING_AT_CRITIAL is the time for a full period of the oscillations at the critical Gain
119 // usually further manual tunine is necessary.
121 #define PID_CRITIAL_GAIN 50
122 #define PID_SWING_AT_CRITIAL 47 //seconds
124 //#define PID_PI //no differentail term
125 #define PID_PID //normal PID
128 //PID according to Ziegler-Nichols method
129 // #define DEFAULT_Kp (0.6*PID_CRITIAL_GAIN)
130 // #define DEFAULT_Ki (2*Kp/PID_SWING_AT_CRITIAL*PID_dT)
131 // #define DEFAULT_Kd (PID_SWING_AT_CRITIAL/8./PID_dT)
134 #define DEFAULT_Kp 22.2
135 #define DEFAULT_Ki (1.25*PID_dT)
136 #define DEFAULT_Kd (99/PID_dT)
138 // Mendel Parts V9 on 12V
139 // #define DEFAULT_Kp 63.0
140 // #define DEFAULT_Ki (2.25*PID_dT)
141 // #define DEFAULT_Kd (440/PID_dT)
145 //PI according to Ziegler-Nichols method
146 #define DEFAULT_Kp (PID_CRITIAL_GAIN/2.2)
147 #define DEFAULT_Ki (1.2*Kp/PID_SWING_AT_CRITIAL*PID_dT)
148 #define DEFAULT_Kd (0)
151 // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
152 // if Kc is choosen well, the additional required power due to increased melting should be compensated.
153 #define PID_ADD_EXTRUSION_RATE
154 #ifdef PID_ADD_EXTRUSION_RATE
155 #define DEFAULT_Kc (3) //heatingpower=Kc*(e_speed)
160 //===========================================================================
161 //=============================Mechanical Settings===========================
162 //===========================================================================
166 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
167 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
168 const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
169 const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
170 const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
171 // For optos H21LOB set to true, for Mendel-Parts newer optos TCST2103 set to false
173 //#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
175 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
176 #define X_ENABLE_ON 0
177 #define Y_ENABLE_ON 0
178 #define Z_ENABLE_ON 0
179 #define E_ENABLE_ON 0
181 // Disables axis when it's not being used.
182 #define DISABLE_X false
183 #define DISABLE_Y false
184 #define DISABLE_Z false
185 #define DISABLE_E false
187 // Inverting axis direction
188 //#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true
189 //#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false
190 //#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true
191 //#define INVERT_E_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
193 #define INVERT_X_DIR true // for Mendel set to false, for Orca set to true
194 #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false
195 #define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true
196 #define INVERT_E_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
198 //// ENDSTOP SETTINGS:
199 // Sets direction of endstops when homing; 1=MAX, -1=MIN
200 #define X_HOME_DIR -1
201 #define Y_HOME_DIR -1
202 #define Z_HOME_DIR -1
204 #define min_software_endstops false //If true, axis won't move to coordinates less than zero.
205 #define max_software_endstops false //If true, axis won't move to coordinates greater than the defined lengths below.
206 #define X_MAX_LENGTH 210
207 #define Y_MAX_LENGTH 210
208 #define Z_MAX_LENGTH 210
210 //// MOVEMENT SETTINGS
211 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
212 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
214 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
215 #define X_HOME_RETRACT_MM 5
216 #define Y_HOME_RETRACT_MM 5
217 #define Z_HOME_RETRACT_MM 1
218 #define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
220 #define AXIS_RELATIVE_MODES {false, false, false, false}
222 #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
226 #define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200*8/3,760*1.1} // default steps per unit for ultimaker
227 //#define DEFAULT_AXIS_STEPS_PER_UNIT {40, 40, 3333.92, 67} //sells mendel with v9 extruder
228 #define DEFAULT_MAX_FEEDRATE {500, 500, 5, 45} // (mm/sec)
229 #define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
231 #define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
232 #define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for r retracts
234 #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
235 #define DEFAULT_MINTRAVELFEEDRATE 0.0
237 // minimum time in microseconds that a movement needs to take if the buffer is emptied. Increase this number if you see blobs while printing high speed & high detail. It will slowdown on the detailed stuff.
238 #define DEFAULT_MINSEGMENTTIME 20000 // Obsolete delete this
239 #define DEFAULT_XYJERK 20.0 // (mm/sec)
240 #define DEFAULT_ZJERK 0.4 // (mm/sec)
245 //===========================================================================
246 //=============================Additional Features===========================
247 //===========================================================================
250 // the microcontroller can store settings in the EEPROM, e.g. max velocity...
251 // M500 - stores paramters in EEPROM
252 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
253 // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
254 //define this to enable eeprom support
255 #define EEPROM_SETTINGS
256 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
257 // please keep turned on if you can.
258 #define EEPROM_CHITCHAT
261 // The hardware watchdog should halt the Microcontroller, in case the firmware gets stuck somewhere. However:
262 // the Watchdog is not working well, so please only enable this for testing
263 // this enables the watchdog interrupt.
264 //#define USE_WATCHDOG
265 //#ifdef USE_WATCHDOG
266 // you cannot reboot on a mega2560 due to a bug in he bootloader. Hence, you have to reset manually, and this is done hereby:
267 //#define RESET_MANUAL
268 //#define WATCHDOG_TIMEOUT 4 //seconds
271 // extruder advance constant (s2/mm3)
273 // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2
275 // hooke's law says: force = k * distance
276 // bernoulli's priniciple says: v ^ 2 / 2 + g . h + pressure / density = constant
277 // so: v ^ 2 is proportional to number of steps we advance the extruder
281 #define EXTRUDER_ADVANCE_K .3
283 #define D_FILAMENT 2.85
284 #define STEPS_MM_E 836
285 #define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
286 #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA)
292 //#define ULTRA_LCD //general lcd support, also 16x2
293 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
294 #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
295 #define SD_FINISHED_RELEASECOMMAND "M84 X Y E" // no z because of layer shift.
299 //#define NEWPANEL //enable this if you have a click-encoder panel
304 #else //no panel but just lcd
311 // A debugging feature to compare calculated vs performed steps, to see if steps are lost by the software.
312 //#define DEBUG_STEPS
315 // Arc interpretation settings:
316 #define MM_PER_ARC_SEGMENT 1
317 #define N_ARC_CORRECTION 25
320 //automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode.
321 //The maximum buffered steps/sec of the extruder motor are called "se".
322 //You enter the autotemp mode by a M109 S<mintemp> T<maxtemp> F<factor>
323 // the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp
324 // you exit the value by any M109 without F*
325 // Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
326 // on an ultimaker, some initial testing worked with M109 S215 T260 F0.1 in the start.gcode
329 #define AUTOTEMP_OLDWEIGHT 0.98
333 const int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
335 //===========================================================================
336 //=============================Buffers ============================
337 //===========================================================================
341 // The number of linear motions that can be in the plan at any give time.
342 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering.
343 #if defined SDSUPPORT
344 #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
346 #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
350 //The ASCII buffer for recieving from the serial:
351 #define MAX_CMD_SIZE 96
355 #include "thermistortables.h"
357 #endif //__CONFIGURATION_H