Prusa3d Marlin fork
Configuration_prusa.h
1 #ifndef CONFIGURATION_PRUSA_H
2 #define CONFIGURATION_PRUSA_H
3 
4 #include <limits.h>
5 #include "printers.h"
6 /*------------------------------------
7  GENERAL SETTINGS
8  *------------------------------------*/
9 
10 // Printer revision
11 #define PRINTER_TYPE PRINTER_MK3S
12 #define PRINTER_NAME PRINTER_MK3S_NAME
13 #define PRINTER_NAME_ALTERNATE PRINTER_MK3_NAME //the other similar printer to this.
14 #define PRINTER_MMU_TYPE PRINTER_MK3S_MMU3
15 #define PRINTER_MMU_NAME PRINTER_MK3S_MMU3_NAME
16 #define FILAMENT_SIZE "1_75mm_MK3S"
17 #define NOZZLE_TYPE "E3Dv6full"
18 
19 // Printer name
20 #define CUSTOM_MENDEL_NAME "Prusa i3 MK3S"
21 
22 // Electronics
23 #define MOTHERBOARD BOARD_EINSY_1_0a
24 #define STEEL_SHEET
25 #define HAS_SECOND_SERIAL_PORT
26 
27 // PSU
28 // #define PSU_Delta // uncomment if DeltaElectronics PSU installed
29 
30 
31 // Uncomment the below for the E3D PT100 temperature sensor (with or without PT100 Amplifier)
32 //#define E3D_PT100_EXTRUDER_WITH_AMP
33 //#define E3D_PT100_EXTRUDER_NO_AMP
34 //#define E3D_PT100_BED_WITH_AMP
35 //#define E3D_PT100_BED_NO_AMP
36 
37 
38 /*------------------------------------
39  AXIS SETTINGS
40  *------------------------------------*/
41 
42 // Steps per unit {X,Y,Z,E}
43 #define DEFAULT_AXIS_STEPS_PER_UNIT {100,100,3200/8,280}
44 
45 // Endstop inverting
46 #define X_MIN_ENDSTOP_INVERTING 0 // set to 1 to invert the logic of the endstop.
47 #define Y_MIN_ENDSTOP_INVERTING 0 // set to 1 to invert the logic of the endstop.
48 #define Z_MIN_ENDSTOP_INVERTING 0 // set to 1 to invert the logic of the endstop.
49 
50 // Direction inverting
51 #define INVERT_X_DIR 1 // for Mendel set to 0, for Orca set to 1
52 #define INVERT_Y_DIR 0 // for Mendel set to 1, for Orca set to 0
53 #define INVERT_Z_DIR 1 // for Mendel set to 0, for Orca set to 1
54 #define INVERT_E0_DIR 0 // for direct drive extruder v9 set to 1, for geared extruder set to 0
55 
56 // Home position
57 #define MANUAL_X_HOME_POS 0
58 #define MANUAL_Y_HOME_POS -2.2
59 #define MANUAL_Z_HOME_POS 0.2
60 
61 // Travel limits after homing
62 #define X_MAX_POS 255
63 #define X_MIN_POS 0
64 #define Y_MAX_POS 212.5
65 #define Y_MIN_POS -4 //orig -4
66 #define Z_MAX_POS 210
67 #define Z_MIN_POS 0.15
68 
69 // Canceled home position
70 #define X_CANCEL_POS 50
71 #define Y_CANCEL_POS 190
72 #define Z_CANCEL_LIFT 50
73 
74 //Pause print position
75 #define X_PAUSE_POS 50
76 #define Y_PAUSE_POS 190
77 #define Z_PAUSE_LIFT 20
78 
79 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
80 #define HOMING_FEEDRATE {3000, 3000, 800, 0} // set the homing speeds (mm/min) // 3000 is also valid for stallGuard homing. Valid range: 2200 - 3000
81 
82 //#define DEFAULT_Y_OFFSET 4.f // Default distance of Y_MIN_POS point from endstop, when the printer is not calibrated.
86 #define SHEET_PRINT_ZERO_REF_X 0.f
90 #define SHEET_PRINT_ZERO_REF_Y -2.f
91 
92 #define DEFAULT_MAX_FEEDRATE {200, 200, 12, 120} // (mm/sec) max feedrate (M203)
93 #define DEFAULT_MAX_FEEDRATE_SILENT {100, 100, 12, 120} // (mm/sec) max feedrate (M203), silent mode
94 
95 #define DEFAULT_MAX_ACCELERATION {1000, 1000, 200, 5000} // (mm/sec^2) max acceleration (M201)
96 #define DEFAULT_MAX_ACCELERATION_SILENT {960, 960, 200, 5000} // (mm/sec^2) max acceleration (M201), silent mode
97 
98 
99 #define DEFAULT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for printing moves (M204P)
100 #define DEFAULT_RETRACT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for retracts (M204R)
101 #define DEFAULT_TRAVEL_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for travels (M204T)
102 
103 #define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
104 
105 //Silent mode limits
106 #define SILENT_MAX_ACCEL_XY 960ul // max acceleration in silent mode in mm/s^2
107 #define SILENT_MAX_FEEDRATE_XY 100 // max feedrate in mm/s
108 
109 //Normal mode limits
110 #define NORMAL_MAX_ACCEL_XY 2500ul // max acceleration in normal mode in mm/s^2
111 #define NORMAL_MAX_FEEDRATE_XY 200 // max feedrate in mm/s
112 
113 //number of bytes from end of the file to start check
114 #define END_FILE_SECTION 30720
115 
116 #define Z_AXIS_ALWAYS_ON 1
117 
118 //Crash detection
119 #define CRASHDET_TIMER 45 //seconds
120 #define CRASHDET_COUNTER_MAX 3
121 
122 // New XYZ calibration
123 #define NEW_XYZCAL
124 
125 // Watchdog support
126 #define WATCHDOG
127 
128 // Power panic
129 #define UVLO_SUPPORT
130 
131 // Fan check
132 #define FANCHECK
133 
134 // Safety timer
135 #define SAFETYTIMER
136 #define DEFAULT_SAFETYTIMER_TIME_MINS 5
137 
138 // Offline crash dumper
139 #define XFLASH_DUMP // enable dump functionality (including D20/D21/D22)
140 #define MENU_DUMP // enable "Memory dump" in Settings menu
141 #define EMERGENCY_DUMP // trigger crash on stack corruption and WDR
142 
143 // Online crash dumper
144 //#define EMERGENCY_SERIAL_DUMP // Request dump via serial on stack corruption and WDR
145 //#define MENU_SERIAL_DUMP // Enable "Memory dump" in Settings menu
146 
147 // Filament sensor
148 #define FILAMENT_SENSOR
149 #define FILAMENT_SENSOR_TYPE FSENSOR_IR_ANALOG
150 #define FSENSOR_PROBING
151 
152 // Backlash -
153 //#define BACKLASH_X
154 //#define BACKLASH_Y
155 
156 
157 // Minimum ambient temperature limit to start triggering MINTEMP errors [C]
158 // this value is litlebit higher that real limit, because ambient termistor is on the board and is temperated from it,
159 // temperature inside the case is around 31C for ambient temperature 25C, when the printer is powered on long time and idle
160 // the real limit is 15C (same as MINTEMP limit), this is because 15C is end of scale for both used thermistors (bed, heater)
161 #define MINTEMP_MINAMBIENT 10
162 #define MINTEMP_MINAMBIENT_RAW 1002
163 
164 #define DEBUG_DCODE2
165 #define DEBUG_DCODE3
166 #define DEBUG_DCODE6
167 
168 //#define DEBUG_PULLUP_CRASH //Test Pullup crash
169 //#define DEBUG_PRINTER_STATES
170 
171 //#define DEBUG_EEPROM_CHANGES //Uses +1188 bytes Flash +6 bytes SRAM
172 //#define DEBUG_BUILD
173 //#define DEBUG_SEC_LANG //secondary language debug output at startup
174 //#define DEBUG_XFLASH //debug external spi flash
175 #ifdef DEBUG_BUILD
176 //#define _NO_ASM
177 #define DEBUG_DCODES //D codes
178 #define DEBUG_STACK_MONITOR //Stack monitor in stepper ISR
179 //#define DEBUG_CRASHDET_COUNTERS //Display crash-detection counters on LCD
180 //#define DEBUG_RESUME_PRINT //Resume/save print debug enable
181 //#define DEBUG_UVLO_AUTOMATIC_RECOVER // Power panic automatic recovery debug output
182 //#define DEBUG_DISABLE_XMINLIMIT //x min limit ignored
183 //#define DEBUG_DISABLE_XMAXLIMIT //x max limit ignored
184 //#define DEBUG_DISABLE_YMINLIMIT //y min limit ignored
185 //#define DEBUG_DISABLE_YMAXLIMIT //y max limit ignored
186 //#define DEBUG_DISABLE_ZMINLIMIT //z min limit ignored
187 //#define DEBUG_DISABLE_ZMAXLIMIT //z max limit ignored
188 #define DEBUG_DISABLE_STARTMSGS //no startup messages
189 //#define DEBUG_DISABLE_MINTEMP //mintemp error ignored
190 //#define DEBUG_DISABLE_SWLIMITS //sw limits ignored
191 //#define DEBUG_DISABLE_LCD_STATUS_LINE //empty four lcd line
192 //#define DEBUG_DISABLE_PREVENT_EXTRUDER //cold extrusion and long extrusion allowed
193 //#define DEBUG_DISABLE_FORCE_SELFTEST //disable force selftest
194 //#define DEBUG_XSTEP_DUP_PIN 21 //duplicate x-step output to pin 21 (SCL on P3)
195 //#define DEBUG_YSTEP_DUP_PIN 21 //duplicate y-step output to pin 21 (SCL on P3)
196 //#define DEBUG_DISABLE_FANCHECK //disable fan check (no ISR INT7, check disabled)
197 //#define DEBUG_DISABLE_FSENSORCHECK //disable fsensor check (no ISR INT7, check disabled)
198 #define DEBUG_DUMP_TO_2ND_SERIAL //dump received characters to 2nd serial line
199 #define DEBUG_STEPPER_TIMER_MISSED // Stop on stepper timer overflow, beep and display a message.
200 #define PLANNER_DIAGNOSTICS // Show the planner queue status on printer display.
201 #define CMD_DIAGNOSTICS //Show cmd queue length on printer display
202 #endif /* DEBUG_BUILD */
203 
204 
205 #define LINEARITY_CORRECTION
206 #define TMC2130_LINEARITY_CORRECTION
207 #define TMC2130_LINEARITY_CORRECTION_XYZ
208 #define TMC2130_VARIABLE_RESOLUTION
209 
210 
211 
212 /*------------------------------------
213  TMC2130 default settings
214  *------------------------------------*/
215 
216 #define TMC2130_FCLK 12000000 // fclk = 12MHz
217 
218 #define TMC2130_USTEPS_XY 16 // microstep resolution for XY axes
219 #define TMC2130_USTEPS_Z 16 // microstep resolution for Z axis
220 #define TMC2130_USTEPS_E 32 // microstep resolution for E axis
221 #define TMC2130_INTPOL_XY 1 // extrapolate 256 for XY axes
222 #define TMC2130_INTPOL_Z 1 // extrapolate 256 for Z axis
223 #define TMC2130_INTPOL_E 1 // extrapolate 256 for E axis
224 // #define ALLOW_ALL_MRES
225 
226 #define TMC2130_PWM_GRAD_X 2 // PWMCONF
227 #define TMC2130_PWM_AMPL_X 230 // PWMCONF
228 #define TMC2130_PWM_AUTO_X 1 // PWMCONF
229 #define TMC2130_PWM_FREQ_X 2 // PWMCONF
230 
231 #define TMC2130_PWM_GRAD_Y 2 // PWMCONF
232 #define TMC2130_PWM_AMPL_Y 235 // PWMCONF
233 #define TMC2130_PWM_AUTO_Y 1 // PWMCONF
234 #define TMC2130_PWM_FREQ_Y 2 // PWMCONF
235 
236 #define TMC2130_PWM_GRAD_Z 4 // PWMCONF
237 #define TMC2130_PWM_AMPL_Z 200 // PWMCONF
238 #define TMC2130_PWM_AUTO_Z 1 // PWMCONF
239 #define TMC2130_PWM_FREQ_Z 2 // PWMCONF
240 
241 #define TMC2130_PWM_GRAD_E 4 // PWMCONF
242 #define TMC2130_PWM_AMPL_E 240 // PWMCONF
243 #define TMC2130_PWM_AUTO_E 1 // PWMCONF
244 #define TMC2130_PWM_FREQ_E 2 // PWMCONF
245 
246 // experimental setting for E-motor cooler operation
247 #define TMC2130_PWM_GRAD_Ecool 84 // PWMCONF 730mA @ 375mm/min 970mA phase peak at feedrate 900mm/min
248 #define TMC2130_PWM_AMPL_Ecool 43 // PWMCONF 500mA phase peak at feedrate 10 mm/min
249 #define TMC2130_PWM_AUTO_Ecool 0 // PWMCONF
250 
251 #define TMC2130_TOFF_XYZ 3 // CHOPCONF // fchop = 27.778kHz
252 #define TMC2130_TOFF_E 3 // CHOPCONF // fchop = 27.778kHz
253 //#define TMC2130_TOFF_E 4 // CHOPCONF // fchop = 21.429kHz
254 //#define TMC2130_TOFF_E 5 // CHOPCONF // fchop = 17.442kHz
255 
256 //#define TMC2130_STEALTH_E // Extruder stealthChop mode
257 //#define TMC2130_CNSTOFF_E // Extruder constant-off-time mode (similar to MK2)
258 
259 //#define TMC2130_PWM_DIV 683 // PWM frequency divider (1024, 683, 512, 410)
260 #define TMC2130_PWM_DIV 512 // PWM frequency divider (1024, 683, 512, 410)
261 #define TMC2130_PWM_CLK (2 * TMC2130_FCLK / TMC2130_PWM_DIV) // PWM frequency (23.4kHz, 35.1kHz, 46.9kHz, 58.5kHz for 12MHz fclk)
262 
263 #define TMC2130_TPWMTHRS 0 // TPWMTHRS - Sets the switching speed threshold based on TSTEP from stealthChop to spreadCycle mode
264 #define TMC2130_TPWMTHRS_E 403 // Switch extruder from StealthChop to SpreadCycle at around 900mm/min
265 #define TMC2130_THIGH 0 // THIGH - unused
266 
267 //#define TMC2130_TCOOLTHRS_X 450 // TCOOLTHRS - coolstep treshold
268 //#define TMC2130_TCOOLTHRS_Y 450 // TCOOLTHRS - coolstep treshold
269 #define TMC2130_TCOOLTHRS_X 430 // TCOOLTHRS - coolstep treshold
270 #define TMC2130_TCOOLTHRS_Y 430 // TCOOLTHRS - coolstep treshold
271 #define TMC2130_TCOOLTHRS_Z 500 // TCOOLTHRS - coolstep treshold
272 #define TMC2130_TCOOLTHRS_E 500 // TCOOLTHRS - coolstep treshold
273 
274 #define TMC2130_SG_HOMING 1 // stallguard homing
275 #define TMC2130_SG_THRS_X 3 // stallguard sensitivity for X axis
276 #define TMC2130_SG_THRS_Y 3 // stallguard sensitivity for Y axis
277 #define TMC2130_SG_THRS_Z 4 // stallguard sensitivity for Z axis
278 #define TMC2130_SG_THRS_E 3 // stallguard sensitivity for E axis
279 #define TMC2130_SG_THRS_HOME {3, 3, TMC2130_SG_THRS_Z, TMC2130_SG_THRS_E}
280 
281 //new settings is possible for vsense = 1, running current value > 31 set vsense to zero and shift both currents by 1 bit right (Z axis only)
282 #define TMC2130_CURRENTS_H {16, 20, 35, 30} // default holding currents for all axes
283 #define TMC2130_CURRENTS_FARM 36 // E 805 mA peak for ECool/farm mode
284 #define TMC2130_CURRENTS_R {16, 20, 35, 30} // default running currents for all axes
285 #define TMC2130_CURRENTS_R_HOME {8, 10, 20, 18} // homing running currents for all axes
286 
287 #define TMC2130_STEALTH_Z
288 #define TMC2130_DEDGE_STEPPING
289 
290 //#define TMC2130_SERVICE_CODES_M910_M918
291 
292 //#define TMC2130_DEBUG
293 //#define TMC2130_DEBUG_WR
294 //#define TMC2130_DEBUG_RD
295 
296 
297 /*------------------------------------
298  EXTRUDER SETTINGS
299  *------------------------------------*/
300 
301 // Mintemps
302 #define HEATER_0_MINTEMP 10
303 #define HEATER_MINTEMP_DELAY 15000 // [ms] ! if changed, check maximal allowed value @ ShortTimer
304 #if HEATER_MINTEMP_DELAY>USHRT_MAX
305 #error "Check maximal allowed value @ ShortTimer (see HEATER_MINTEMP_DELAY definition)"
306 #endif
307 #define BED_MINTEMP 10
308 #define BED_MINTEMP_DELAY 50000 // [ms] ! if changed, check maximal allowed value @ ShortTimer
309 #if BED_MINTEMP_DELAY>USHRT_MAX
310 #error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
311 #endif
312 #define SUPERPINDA_SUPPORT
313 #define PINDA_MINTEMP 10
314 //#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
315 #define AMBIENT_MINTEMP -30
316 
317 // Maxtemps
318 #if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)
319 #define HEATER_0_MAXTEMP 410
320 #else
321 #define HEATER_0_MAXTEMP 305
322 #endif
323 #define BED_MAXTEMP 125
324 #define AMBIENT_MAXTEMP 80
325 
326 #if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)
327 // Define PID constants for extruder with PT100
328 #define DEFAULT_Kp 21.70
329 #define DEFAULT_Ki 1.60
330 #define DEFAULT_Kd 73.76
331 #else
332 // Define PID constants for extruder
333 //#define DEFAULT_Kp 40.925
334 //#define DEFAULT_Ki 4.875
335 //#define DEFAULT_Kd 86.085
336 #define DEFAULT_Kp 16.13
337 #define DEFAULT_Ki 1.1625
338 #define DEFAULT_Kd 56.23
339 #endif
340 
341 // Extrude mintemp
342 #define EXTRUDE_MINTEMP 175
343 
344 // Quick nozzle change supported
345 //#define QUICK_NOZZLE_CHANGE
346 
347 // Extruder cooling fans
348 #define EXTRUDER_0_AUTO_FAN_PIN 8
349 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
350 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
351 #define EXTRUDER_ALTFAN_DETECT
352 #define EXTRUDER_ALTFAN_SPEED_SILENT 128
353 
354 #define FANCHECK_AUTO_PRINT_FAN_THRS 70 //[RPS] - Used during selftest to identify swapped fans automatically
355 #define FANCHECK_AUTO_FAIL_THRS 20 //[RPS] - Used during selftest to identify a faulty fan
356 
357 /*------------------------------------
358  CHANGE FILAMENT SETTINGS
359  *------------------------------------*/
360 
361 // Filament change configuration
362 #define FILAMENTCHANGEENABLE
363 #ifdef FILAMENTCHANGEENABLE
364 #define FILAMENTCHANGE_XPOS 211
365 #define FILAMENTCHANGE_YPOS 0
366 #define FILAMENTCHANGE_ZADD 2
367 #define FILAMENTCHANGE_FIRSTRETRACT -2
368 #define FILAMENTCHANGE_FINALRETRACT 0
369 
370 #define FILAMENTCHANGE_FIRSTFEED 70 //E distance in mm for fast filament loading sequence used used in filament change (M600)
371 #define FILAMENTCHANGE_FINALFEED 25 //E distance in mm for slow filament loading sequence used used in filament change (M600) and filament load (M701)
372 #define FILAMENTCHANGE_RECFEED 5
373 
374 #define FILAMENTCHANGE_XYFEED 50
375 #define FILAMENTCHANGE_EFEED_FIRST 20 // feedrate in mm/s for fast filament loading sequence used in filament change (M600)
376 #define FILAMENTCHANGE_EFEED_FINAL 3.3f // feedrate in mm/s for slow filament loading sequence used in filament change (M600) and filament load (M701)
377 //#define FILAMENTCHANGE_RFEED 400
378 #define FILAMENTCHANGE_RFEED 7000 / 60
379 #define FILAMENTCHANGE_EXFEED 2
380 #define FILAMENTCHANGE_ZFEED 15
381 
382 //Retract and then extrude some filament to prevent oozing.
383 //After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
384 //Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
385 //#define COMMUNITY_PREVENT_OOZE
386 #ifdef COMMUNITY_PREVENT_OOZE
387 #define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
388 #define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
389 #endif //End COMMUNITY_PREVENT_OOZE
390 
391 #endif
392 
393 /*------------------------------------
394  ADDITIONAL FEATURES SETTINGS
395  *------------------------------------*/
396 
397 // temperature runaway
398 #define TEMP_RUNAWAY_BED_HYSTERESIS 5
399 #define TEMP_RUNAWAY_BED_TIMEOUT 360
400 
401 #define TEMP_RUNAWAY_EXTRUDER_HYSTERESIS 15
402 #define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45
403 
404 // model-based temperature check
405 #define THERMAL_MODEL 1 // enable model-based temperature checks
406 #define THERMAL_MODEL_DEBUG 1 // extended runtime logging
407 
408 #define THERMAL_MODEL_CAL_C_low 5 // C estimation lower limit
409 #define THERMAL_MODEL_CAL_C_high 20 // C estimation upper limit
410 #define THERMAL_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
411 #define THERMAL_MODEL_CAL_C_itr 30 // C estimation iteration limit
412 
413 #define THERMAL_MODEL_CAL_R_low 5 // R estimation lower limit
414 #define THERMAL_MODEL_CAL_R_high 50 // R estimation upper limit
415 #define THERMAL_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
416 #define THERMAL_MODEL_CAL_R_itr 30 // R estimation iteration limit
417 
418 #define THERMAL_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
419 #define THERMAL_MODEL_CAL_T_high 230 // Default calibration working temperature (C)
420 
421 #define THERMAL_MODEL_Ta_corr -7 // Default ambient temperature correction
422 
423 #include "thermal_model/e3d_v6.h"
424 #define THERMAL_MODEL_DEFAULT E3D_V6 // Default model parameters
425 
426 /*------------------------------------
427  HOST FEATURES
428  *------------------------------------*/
429 
430 //#define HOST_SHUTDOWN //Host supports "//action:shutdown" feature
431 
432 /*------------------------------------
433  MOTOR CURRENT SETTINGS
434  *------------------------------------*/
435 
436 // Motor Current settings for Einsy/tmc = 0..63
437 #define MOTOR_CURRENT_PWM_RANGE 63
438 
439 /*------------------------------------
440  BED SETTINGS
441  *------------------------------------*/
442 
443 // Define Mesh Bed Leveling system to enable it
444 #define MESH_BED_LEVELING
445 #ifdef MESH_BED_LEVELING
446 
447 #define MBL_Z_STEP 0.01
448 
449 // Mesh upsample definition
450 #define MESH_NUM_X_POINTS 7
451 #define MESH_NUM_Y_POINTS 7
452 // Mesh measure definition
453 #define MESH_MEAS_NUM_X_POINTS 3
454 #define MESH_MEAS_NUM_Y_POINTS 3
455 
456 // Maximum bed level correction value
457 #define BED_ADJUSTMENT_UM_MAX 100
458 
459 #define MESH_HOME_Z_CALIB 0.2
460 #define MESH_HOME_Z_SEARCH 5.0f // Z lift for homing, mesh bed leveling etc.
461 
462 #define X_PROBE_OFFSET_FROM_EXTRUDER 23 // Z probe to nozzle X offset: -left +right
463 #define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Z probe to nozzle Y offset: -front +behind
464 #define Z_PROBE_OFFSET_FROM_EXTRUDER -0.4 // Z probe to nozzle Z offset: -below (always!)
465 #endif
466 
467 // Bed Temperature Control
468 // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
469 //
470 // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
471 // If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
472 // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
473 // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
474 // If your configuration is significantly different than this and you don't understand the issues involved, you probably
475 // shouldn't use bed PID until someone else verifies your hardware works.
476 // If this is enabled, find your own PID constants below.
477 #define PIDTEMPBED
478 //
479 //#define BED_LIMIT_SWITCHING
480 
481 // This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
482 // all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
483 // setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
484 // so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
485 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
486 
487 // Bed temperature compensation settings
488 #define BED_OFFSET 10
489 #define BED_OFFSET_START 40
490 #define BED_OFFSET_CENTER 50
491 
492 
493 #ifdef PIDTEMPBED
494 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
495 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
496 #if defined(E3D_PT100_BED_WITH_AMP) || defined(E3D_PT100_BED_NO_AMP)
497 // Define PID constants for extruder with PT100
498 #define DEFAULT_bedKp 21.70
499 #define DEFAULT_bedKi 1.60
500 #define DEFAULT_bedKd 73.76
501 #else
502 #define DEFAULT_bedKp 126.13
503 #define DEFAULT_bedKi 4.30
504 #define DEFAULT_bedKd 924.76
505 #endif
506 
507 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
508 //from pidautotune
509 // #define DEFAULT_bedKp 97.1
510 // #define DEFAULT_bedKi 1.41
511 // #define DEFAULT_bedKd 1675.16
512 
513 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
514 #endif // PIDTEMPBED
515 
516 /*-----------------------------------
517  PREHEAT SETTINGS
518  *------------------------------------*/
519 
520 #define PLA_PREHEAT_HOTEND_TEMP 215
521 #define PLA_PREHEAT_HPB_TEMP 60
522 
523 #define PVB_PREHEAT_HOTEND_TEMP 215
524 #define PVB_PREHEAT_HPB_TEMP 75
525 
526 #define ASA_PREHEAT_HOTEND_TEMP 260
527 #define ASA_PREHEAT_HPB_TEMP 105
528 
529 #define PC_PREHEAT_HOTEND_TEMP 275
530 #define PC_PREHEAT_HPB_TEMP 110
531 
532 #define PA_PREHEAT_HOTEND_TEMP 275
533 #define PA_PREHEAT_HPB_TEMP 90
534 
535 #define ABS_PREHEAT_HOTEND_TEMP 255
536 #define ABS_PREHEAT_HPB_TEMP 100
537 
538 #define HIPS_PREHEAT_HOTEND_TEMP 220
539 #define HIPS_PREHEAT_HPB_TEMP 100
540 
541 #define PP_PREHEAT_HOTEND_TEMP 254
542 #define PP_PREHEAT_HPB_TEMP 100
543 
544 #define PET_PREHEAT_HOTEND_TEMP 230
545 #define PET_PREHEAT_HPB_TEMP 85
546 
547 #define FLEX_PREHEAT_HOTEND_TEMP 240
548 #define FLEX_PREHEAT_HPB_TEMP 50
549 
550 #define LCD_JUMP_HOTEND_TEMP 200
551 #define LCD_JUMP_BED_TEMP 50
552 #define LCD_JUMP_FAN_SPEED 127
553 
554 /*------------------------------------
555  THERMISTORS SETTINGS
556  *------------------------------------*/
557 
558 //
559 //--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
560 //
562 // -2 is thermocouple with MAX6675 (only for sensor 0)
563 // -1 is thermocouple with AD595
564 // 0 is not used
565 // 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
566 // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
567 // 3 is Mendel-parts thermistor (4.7k pullup)
568 // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
569 // 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
570 // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
571 // 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
572 // 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
573 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
574 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
575 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
576 // 11 is 100k beta 3950 1% thermistor (4.7k pullup)
577 // 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
578 // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
579 // 20 is the PT100 circuit found in the Ultimainboard V2.x
580 // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
581 //
582 // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
583 // (but gives greater accuracy and more stable PID)
584 // 51 is 100k thermistor - EPCOS (1k pullup)
585 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
586 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
587 //
588 // 1047 is Pt1000 with 4k7 pullup
589 // 1010 is Pt1000 with 1k pullup (non standard)
590 // 147 is Pt100 with 4k7 pullup
591 // 148 is E3D Pt100 with 4k7 pullup and no PT100 Amplifier on a MiniRambo 1.3a
592 // 247 is Pt100 with 4k7 pullup and PT100 Amplifier
593 // 110 is Pt100 with 1k pullup (non standard)
594 
595 #if defined(E3D_PT100_EXTRUDER_WITH_AMP)
596 #define TEMP_SENSOR_0 247
597 #elif defined(E3D_PT100_EXTRUDER_NO_AMP)
598 #define TEMP_SENSOR_0 148
599 #else
600 #define TEMP_SENSOR_0 5
601 #endif
602 #if defined(E3D_PT100_BED_WITH_AMP)
603 #define TEMP_SENSOR_BED 247
604 #elif defined(E3D_PT100_BED_NO_AMP)
605 #define TEMP_SENSOR_BED 148
606 #else
607 #define TEMP_SENSOR_BED 1
608 #endif
609 #define TEMP_SENSOR_PINDA 1
610 #define TEMP_SENSOR_AMBIENT 2000
611 
612 #define STACK_GUARD_TEST_VALUE 0xA2A2
613 #define STACK_GUARD_MARGIN 32
614 
615 #define MAX_BED_TEMP_CALIBRATION 50
616 #define MAX_HOTEND_TEMP_CALIBRATION 50
617 
618 #define Z_BABYSTEP_MIN -3999
619 #define Z_BABYSTEP_MAX 0
620 
621 #define PINDA_PREHEAT_X 20
622 #define PINDA_PREHEAT_Y 60
623 #define PINDA_PREHEAT_Z 0.15
624 /*
625 #define PINDA_PREHEAT_X 70
626 #define PINDA_PREHEAT_Y -3
627 #define PINDA_PREHEAT_Z 1*/
628 #define PINDA_HEAT_T 120 //time in s
629 
630 #define PINDA_MIN_T 50
631 #define PINDA_STEP_T 10
632 #define PINDA_MAX_T 100
633 
634 #define LONG_PRESS_TIME 1000 //time in ms for button long press
635 #define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
636 
637 #define DEFAULT_PID_TEMP 210
638 
639 #define MIN_PRINT_FAN_SPEED 75
640 
641 
642 // How much shall the print head be lifted on power panic?
643 // Ideally the Z axis will reach a zero phase of the stepper driver on power outage. To simplify this,
644 // UVLO_Z_AXIS_SHIFT shall be an integer multiply of the stepper driver cycle, that is 4x full step.
645 // For example, the Prusa i3 MK2 with 16 microsteps per full step has Z stepping of 400 microsteps per mm.
646 // At 400 microsteps per mm, a full step lifts the Z axis by 0.04mm, and a stepper driver cycle is 0.16mm.
647 // The following example, 12 * (4 * 16 / 400) = 12 * 0.16mm = 1.92mm.
648 //#define UVLO_Z_AXIS_SHIFT 1.92
649 #define UVLO_Z_AXIS_SHIFT 0.64
650 // When powered off during PP recovery, the Z axis position can still be re-adjusted. In this case
651 // we just need to shift to the nearest fullstep, but we need a move which is at least
652 // "dropsegments" steps long. All the above rules still need to apply.
653 #define UVLO_TINY_Z_AXIS_SHIFT 0.16
654 // If power panic occured, and the current temperature is higher then target temperature before interrupt minus this offset, print will be recovered automatically.
655 #define AUTOMATIC_UVLO_BED_TEMP_OFFSET 5
656 
657 #define HEATBED_V2
658 
659 #define M600_TIMEOUT 600 //seconds
660 
661 //#define SUPPORT_VERBOSITY
662 
663 #define MMU_CONFIG_FILE "mmu2/variants/config_MMU2S.h"
664 #define MMU_FILAMENT_COUNT 5
665 //#define MMU_FORCE_STEALTH_MODE
666 #define MMU_HWRESET
667 #define MMU_DEBUG //print communication between MMU and printer on serial
668 #define MMU_HAS_CUTTER
669 
670 // This is experimental feature requested by our test department.
671 // There is no known use for ordinary user. If enabled by this macro
672 // and enabled from printer menu (not enabled by default). It cuts filament
673 // every time when switching filament from gcode. MMU_HAS_CUTTER needs to be
674 // defined.
675 
676 //#define MMU_ALWAYS_CUT
677 
678 // MMU Error pause position
679 #define MMU_ERR_X_PAUSE_POS 125
680 #define MMU_ERR_Y_PAUSE_POS 0
681 #define MMU_ERR_Z_PAUSE_LIFT 20
682 
683 // Default Arc Interpolation Settings (Now configurable via M214)
684 #define DEFAULT_N_ARC_CORRECTION 25 // Number of interpolated segments between corrections.
685 /* A value of 1 or less for N_ARC_CORRECTION will trigger the use of Sin and Cos for every arc, which will improve accuracy at the
686  cost of performance*/
687 #define DEFAULT_MM_PER_ARC_SEGMENT 1.0f // REQUIRED - The enforced maximum length of an arc segment
688 #define DEFAULT_MIN_MM_PER_ARC_SEGMENT 0.5f //the enforced minimum length of an interpolated segment
689  /* MIN_MM_PER_ARC_SEGMENT Must be smaller than MM_PER_ARC_SEGMENT. Only has an effect if MIN_ARC_SEGMENTS > 0
690  or ARC_SEGMENTS_PER_SEC > 0 . If both MIN_ARC_SEGMENTS and ARC_SEGMENTS_PER_SEC is defined, the minimum
691  calculated segment length is used. */
692 #define DEFAULT_MIN_ARC_SEGMENTS 20 // The enforced minimum segments in a full circle of the same radius. Set to 0 to disable
693 #define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // Use feedrate to choose segment length. Set to 0 to disable
694 
695 #endif //__CONFIGURATION_PRUSA_H