Fri, 17 Nov 2017 10:13:31 +0100
proper configuration, homing and planner optimization
0 | 1 | #ifndef CONFIGURATION_H |
2 | #define CONFIGURATION_H | |
3 | ||
4 | // ============================================================================== | |
5 | ||
6 | // For instructions on setting these constants, see: | |
7 | // Mendel: http://reprap.org/wiki/RepRapPro_Mendel_maintenance | |
8 | // Huxley: http://reprap.org/wiki/RepRapPro_Huxley_maintenance | |
9 | ||
10 | // Uncomment ONE of the next three lines - the one for your RepRap machine | |
11 | //#define REPRAPPRO_HUXLEY | |
12 | //#define REPRAPPRO_MENDEL //Legacy Mendel | |
3 | 13 | //#define REPRAPPRO_MENDEL2 // Mono Mendel |
14 | #define NEOSOFT_MENDEL | |
0 | 15 | |
16 | // Uncomment ONE of the next two lines - the one for your master controller electronics | |
17 | #define REPRAPPRO_MELZI | |
18 | //#define REPRAPPRO_SANGUINOLOLU | |
19 | ||
20 | // Uncomment ONE of the next two lines - the one for the series resistors on your controller | |
21 | #define SERIAL_R 4700 | |
22 | //#define SERIAL_R 10000 | |
23 | ||
24 | ||
25 | // ------------------------------------------------------------------------------- | |
26 | ||
27 | #ifndef REPRAPPRO_HUXLEY | |
3 | 28 | #ifndef REPRAPPRO_MENDEL |
29 | #ifndef REPRAPPRO_MENDEL2 | |
30 | #ifndef NEOSOFT_MENDEL | |
31 | #error Uncomment one of #define REPRAPPRO_HUXLEY, REPRAPPRO_MENDEL, or REPRAPPRO_MENDEL2 at the start of the file Configuration.h | |
32 | #endif | |
33 | #endif | |
34 | #endif | |
0 | 35 | #endif |
36 | ||
37 | #ifndef REPRAPPRO_MELZI | |
3 | 38 | #ifndef REPRAPPRO_SANGUINOLOLU |
39 | #error Uncomment one of #define REPRAPPRO_MELZI or REPRAPPRO_SANGUINOLOLU at the start of the file Configuration.h | |
40 | #endif | |
0 | 41 | #endif |
42 | ||
43 | #ifndef SERIAL_R | |
3 | 44 | #error Uncomment one of #define SERIAL_R 10000 or 4700 at the start of the file Configuration.h |
0 | 45 | #endif |
46 | ||
47 | // ============================================================================== | |
48 | ||
49 | // Uncomment this if you are experimenting, know what you are doing, and want to switch off some safety | |
50 | // features, e.g. allow extrude at low temperature etc. | |
51 | //#define DEVELOPING | |
52 | ||
53 | // This configurtion file contains the basic settings. | |
54 | // Advanced settings can be found in Configuration_adv.h | |
55 | // BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration | |
56 | ||
57 | //User specified version info of THIS file to display in [Pronterface, etc] terminal window during startup. | |
58 | //Implementation of an idea by Prof Braino to inform user that any changes made | |
59 | //to THIS file by the user have been successfully uploaded into firmware. | |
3 | 60 | #define STRING_VERSION_CONFIG_H "2017-11-18" //Personal revision number for changes to THIS file. |
61 | #define STRING_CONFIG_H_AUTHOR "NeoSoft, Malte Di Donato" //Who made the changes. | |
0 | 62 | |
63 | // This determines the communication speed of the printer | |
3 | 64 | #define BAUDRATE 250000 |
65 | //#define BAUDRATE 115200 | |
0 | 66 | |
67 | //// The following define selects which electronics board you have. Please choose the one that matches your setup | |
68 | // Sanguinololu 1.2 and above = 62 | |
69 | // Melzi 63 | |
70 | ||
71 | #ifdef REPRAPPRO_SANGUINOLOLU | |
3 | 72 | #define MOTHERBOARD 62 |
0 | 73 | #endif |
74 | ||
75 | #ifdef REPRAPPRO_MELZI | |
3 | 76 | #define MOTHERBOARD 63 |
0 | 77 | #endif |
78 | ||
79 | ||
80 | ||
81 | //=========================================================================== | |
82 | //=============================Thermal Settings ============================ | |
83 | //=========================================================================== | |
84 | ||
85 | // Set this if you want to define the constants in the thermistor circuit | |
86 | // and work out temperatures algebraically - added by AB. | |
87 | ||
88 | // See http://en.wikipedia.org/wiki/Thermistor#B_or_.CE.B2_parameter_equation | |
89 | ||
90 | // BETA is the B value | |
91 | // RS is the value of the series resistor in ohms | |
92 | // R_INF is R0.exp(-BETA/T0), where R0 is the thermistor resistance at T0 (T0 is in kelvin) | |
93 | // Normally T0 is 298.15K (25 C). If you write that expression in brackets in the #define the compiler | |
94 | // should compute it for you (i.e. it won't need to be calculated at run time). | |
95 | ||
96 | // If the A->D converter has a range of 0..1023 and the measured voltage is V (between 0 and 1023) | |
97 | // then the thermistor resistance, R = V.RS/(1023 - V) | |
98 | // and the temperature, T = BETA/ln(R/R_INF) | |
99 | // To get degrees celsius (instead of kelvin) add -273.15 to T | |
100 | ||
101 | // This DOES assume that all extruders use the same thermistor type. | |
102 | ||
103 | ||
104 | #define ABS_ZERO -273.15 | |
105 | #define AD_RANGE 16383 | |
106 | ||
107 | ||
108 | #ifdef REPRAPPRO_HUXLEY | |
3 | 109 | #include "Configuration_huxley.h" |
0 | 110 | #endif |
111 | #ifdef REPRAPPRO_MENDEL | |
3 | 112 | #include "Configuration_mendel.h" |
0 | 113 | #endif |
114 | #ifdef REPRAPPRO_MENDEL2 | |
3 | 115 | #include "Configuration_mendel2.h" |
116 | #endif | |
117 | #ifdef NEOSOFT_MENDEL | |
118 | #include "Configuration_neosoft_mendel.h" | |
0 | 119 | #endif |
120 | ||
121 | ||
122 | #define E_RS SERIAL_R | |
123 | #define E_R_INF ( E_NTC*exp(-E_BETA/298.15) ) | |
124 | ||
125 | #define BED_RS SERIAL_R | |
126 | #define BED_R_INF ( BED_NTC*exp(-BED_BETA/298.15) ) | |
127 | ||
128 | #define BED_USES_THERMISTOR | |
129 | #define HEATER_0_USES_THERMISTOR | |
130 | #define HEATER_1_USES_THERMISTOR | |
131 | #define HEATER_2_USES_THERMISTOR | |
132 | ||
133 | // Actual temperature must be close to target for this long before M109 returns success | |
134 | #define TEMP_RESIDENCY_TIME 5 // (seconds) | |
135 | #define TEMP_HYSTERESIS 5 // (C°) range of +/- temperatures considered "close" to the target one | |
136 | #define TEMP_WINDOW 2 // (degC) Window around target to start the recidency timer x degC early. | |
137 | ||
138 | // The minimal temperature defines the temperature below which the heater will not be enabled It is used | |
139 | // to check that the wiring to the thermistor is not broken. | |
140 | // Otherwise this would lead to the heater being powered on all the time. | |
141 | #define HEATER_0_MINTEMP 1 | |
142 | #ifdef REPRAPPRO_MULTIMATERIALS | |
3 | 143 | #define HEATER_1_MINTEMP 1 |
144 | #define HEATER_2_MINTEMP 1 | |
0 | 145 | #endif |
146 | #define BED_MINTEMP 1 | |
147 | ||
148 | // When temperature exceeds max temp, your heater will be switched off. | |
149 | // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! | |
150 | // You should use MINTEMP for thermistor short/failure protection. | |
151 | #define HEATER_0_MAXTEMP 399 | |
152 | #ifdef REPRAPPRO_MULTIMATERIALS | |
3 | 153 | #define HEATER_1_MAXTEMP 275 |
154 | #define HEATER_2_MAXTEMP 275 | |
0 | 155 | #endif |
156 | #define BED_MAXTEMP 150 | |
157 | ||
158 | ||
159 | // PID settings: | |
160 | // Comment the following line to disable PID and enable bang-bang. | |
161 | #define PIDTEMP | |
162 | #define PID_MAX 255 // limits current to nozzle; 255=full current | |
163 | #define FULL_PID_BAND 150 // Full power is applied when pid_error[e] > FULL_PID_BAND | |
164 | #ifdef PIDTEMP | |
165 | //#define PID_DEBUG // Sends debug data to the serial port. | |
166 | #define PID_INTEGRAL_DRIVE_MAX 125 //limit for the integral term | |
167 | #define K1 0.95 //smoothing factor withing the PID | |
168 | #define PID_dT 0.122 //sampling period of the PID | |
169 | ||
3 | 170 | // RepRapPro Huxley + Mendel |
171 | #define DEFAULT_Kp 12.0 | |
172 | #define DEFAULT_Ki (2.2*PID_dT) | |
173 | #define DEFAULT_Kd (80/PID_dT) | |
0 | 174 | #endif // PIDTEMP |
175 | ||
176 | #ifndef DEVELOPING | |
3 | 177 | //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit |
178 | //can be software-disabled for whatever purposes by | |
179 | #define PREVENT_DANGEROUS_EXTRUDE | |
180 | #define EXTRUDE_MINTEMP 170 | |
181 | #define EXTRUDE_MAXLENGTH (999) //prevent extrusion of very large distances. | |
0 | 182 | #else |
3 | 183 | #define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE |
0 | 184 | #endif |
185 | ||
186 | //=========================================================================== | |
187 | //=============================Mechanical Settings=========================== | |
188 | //=========================================================================== | |
189 | ||
190 | // Endstop Settings | |
191 | #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors | |
192 | ||
193 | // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. | |
194 | const bool X_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. | |
195 | const bool Y_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. | |
196 | const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops. | |
197 | ||
198 | // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 | |
199 | #define X_ENABLE_ON 0 | |
200 | #define Y_ENABLE_ON 0 | |
201 | #define Z_ENABLE_ON 0 | |
202 | #define E_ENABLE_ON 0 // For all extruders | |
203 | ||
204 | // Disables axis when it's not being used. | |
205 | #define DISABLE_X false | |
206 | #define DISABLE_Y false | |
207 | #define DISABLE_Z true | |
208 | #define DISABLE_E false // For all extruders | |
209 | ||
210 | // ENDSTOP SETTINGS: | |
211 | // Sets direction of endstops when homing; 1=MAX, -1=MIN | |
212 | #define X_HOME_DIR -1 | |
213 | #define Y_HOME_DIR -1 | |
214 | #define Z_HOME_DIR -1 | |
215 | ||
216 | #define min_software_endstops true //If true, axis won't move to coordinates less than zero. | |
217 | #define max_software_endstops true //If true, axis won't move to coordinates greater than the defined lengths below. | |
218 | ||
219 | // The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0 | |
220 | #define X_HOME_POS 0 | |
221 | #define Y_HOME_POS 0 | |
222 | #define Z_HOME_POS 0 | |
223 | ||
224 | //// MOVEMENT SETTINGS | |
225 | #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E | |
226 | ||
227 | // Defaults changed by the G10 command | |
228 | #define X_EXTRUDER_OFFSET 0 | |
229 | #define Y_EXTRUDER_OFFSET 0 | |
230 | #define Z_EXTRUDER_OFFSET 0 | |
231 | #define STANDBY_TEMP 140 | |
232 | #define PLA_TEMP 210 | |
233 | #define ABS_TEMP 250 | |
234 | #define DEFAULT_TEMP PLA_TEMP | |
235 | ||
236 | #define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves | |
237 | #define DEFAULT_RETRACT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for r retracts | |
238 | ||
239 | // | |
240 | #define DEFAULT_XYJERK 15.0 // (mm/sec) | |
241 | #define DEFAULT_ZJERK 0.4 // (mm/sec) | |
242 | #define DEFAULT_EJERK 15.0 // (mm/sec) | |
243 | ||
244 | //=========================================================================== | |
245 | //=============================Additional Features=========================== | |
246 | //=========================================================================== | |
247 | ||
248 | // EEPROM | |
249 | // the microcontroller can store settings in the EEPROM, e.g. max velocity... | |
250 | // M500 - stores paramters in EEPROM | |
251 | // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). | |
252 | // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. | |
253 | //define this to enable eeprom support | |
254 | #define EEPROM_SETTINGS | |
255 | //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: | |
256 | // please keep turned on if you can. | |
257 | #define EEPROM_CHITCHAT | |
258 | ||
259 | //LCD and SD support | |
260 | //#define ULTRA_LCD //general lcd support, also 16x2 | |
261 | #define SDSUPPORT // Enable SD Card Support in Hardware Console | |
262 | ||
263 | //#define ULTIPANEL | |
264 | #ifdef ULTIPANEL | |
265 | //#define NEWPANEL //enable this if you have a click-encoder panel | |
266 | #define SDSUPPORT | |
267 | #define ULTRA_LCD | |
268 | #define LCD_WIDTH 20 | |
269 | #define LCD_HEIGHT 4 | |
270 | ||
271 | // Preheat Constants | |
272 | #define PLA_PREHEAT_HOTEND_TEMP 180 | |
273 | #define PLA_PREHEAT_HPB_TEMP 70 | |
274 | #define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 | |
275 | ||
276 | #define ABS_PREHEAT_HOTEND_TEMP 240 | |
277 | #define ABS_PREHEAT_HPB_TEMP 100 | |
278 | #define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 | |
279 | ||
280 | #else //no panel but just lcd | |
281 | #ifdef ULTRA_LCD | |
282 | #define LCD_WIDTH 16 | |
283 | #define LCD_HEIGHT 2 | |
284 | #endif | |
285 | #endif | |
286 | ||
287 | // Enable uM-FPU support: | |
288 | #define UMFPUSUPPORT 1 | |
289 | ||
290 | // M240 Triggers a camera by emulating a Canon RC-1 Remote | |
291 | // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ | |
292 | // #define PHOTOGRAPH_PIN 23 | |
293 | ||
294 | #include "Configuration_adv.h" | |
295 | ||
296 | ||
297 | #endif //__CONFIGURATION_H |