From 840e13f664f6c326c0c07fc9ce0154feab1298b5 Mon Sep 17 00:00:00 2001 From: gralco Date: Mon, 25 Apr 2016 08:33:33 -0600 Subject: [PATCH 001/580] Introduce M108 cancel heatup for the hotend and bed This G-code is asynchronously handled in the get_serial_commands() parser. --- Marlin/Marlin_main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6b0f52b6a..1f79e21cb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -149,6 +149,7 @@ * M105 - Read current temp * M106 - Fan on * M107 - Fan off + * M108 - Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling * IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F @@ -1018,6 +1019,7 @@ inline void get_serial_commands() { // If command was e-stop process now if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); + if (strcmp(command, "M108") == 0) cancel_heatup = true; #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 last_command_time = ms; @@ -4405,6 +4407,13 @@ inline void gcode_M105() { #endif // FAN_COUNT > 0 +/** + * M108: Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser + */ +inline void gcode_M108() { + cancel_heatup = true; +} + /** * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. * Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling. @@ -6667,6 +6676,10 @@ void process_next_command() { KEEPALIVE_STATE(NOT_BUSY); return; // "ok" already printed + case 108: + gcode_M108(); + break; + case 109: // M109: Wait for temperature gcode_M109(); break; From 3aefa043861388c2e21500cf7b016ae6641a84e0 Mon Sep 17 00:00:00 2001 From: lrpirlet Date: Wed, 1 Jun 2016 20:41:49 +0200 Subject: [PATCH 002/580] Raise the servo probe before stow outside ABL context --- Marlin/Marlin_main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6ddd0d2ea..dcc7af09e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2327,6 +2327,17 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_ENDSTOPS > Stow with servo.move()"); #endif + // Raise the servo probe before stow outside ABL context... This is a workaround that allows the use of a Servo Probe without ABL until a more global probe handling is implemented. + #if DISABLED(AUTO_BED_LEVELING_FEATURE) + #ifndef Z_RAISE_AFTER_PROBING + #define Z_RAISE_AFTER_PROBING 15 // default height + #endif + current_position[Z_AXIS] = Z_RAISE_AFTER_PROBING; + feedrate = homing_feedrate[Z_AXIS]; + line_to_current_position(); + stepper.synchronize(); + #endif + servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]); if (_Z_PROBE_SUBTEST) endstops.enable_z_probe(false); } From b703fa95387731fa6246815993152587c83362ac Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Jun 2016 14:35:14 -0700 Subject: [PATCH 003/580] Add sanity check for SAV_3DGLCD display types --- Marlin/SanityCheck.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 3fa6788a7..f92961a21 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -367,7 +367,14 @@ #endif #if ENCODER_PULSES_PER_STEP < 0 - #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead" + #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead." +#endif + +/** + * SAV_3DGLCD display options + */ +#if ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106) + #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." #endif /** From efa7209acf77d669ee9057e3c28154e3d379d187 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Jun 2016 14:34:51 -0700 Subject: [PATCH 004/580] Improved LCD contrast handling Based on MarlinFirmware/MarlinDev#200 from @eboston --- Marlin/Conditionals.h | 16 ++++++++++++++-- Marlin/Marlin_main.cpp | 2 +- Marlin/ultralcd.cpp | 25 ++++++++++--------------- Marlin/ultralcd.h | 2 +- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 599a1bf24..6a46ce471 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -61,10 +61,14 @@ #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. #if ENABLED(miniVIKI) + #define LCD_CONTRAST_MIN 75 + #define LCD_CONTRAST_MAX 115 #define DEFAULT_LCD_CONTRAST 95 #elif ENABLED(VIKI2) #define DEFAULT_LCD_CONTRAST 40 #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + #define LCD_CONTRAST_MIN 90 + #define LCD_CONTRAST_MAX 130 #define DEFAULT_LCD_CONTRAST 110 #define U8GLIB_LM6059_AF #define SD_DETECT_INVERTED @@ -246,8 +250,16 @@ */ #if ENABLED(DOGLCD) #define HAS_LCD_CONTRAST (DISABLED(U8GLIB_ST7920) && DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106)) - #if HAS_LCD_CONTRAST && !defined(DEFAULT_LCD_CONTRAST) - #define DEFAULT_LCD_CONTRAST 32 + #if HAS_LCD_CONTRAST + #ifndef LCD_CONTRAST_MIN + #define LCD_CONTRAST_MIN 0 + #endif + #ifndef LCD_CONTRAST_MAX + #define LCD_CONTRAST_MAX 63 + #endif + #ifndef DEFAULT_LCD_CONTRAST + #define DEFAULT_LCD_CONTRAST 32 + #endif #endif #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6ddd0d2ea..c097030ca 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5636,7 +5636,7 @@ inline void gcode_M226() { * M250: Read and optionally set the LCD contrast */ inline void gcode_M250() { - if (code_seen('C')) lcd_setcontrast(code_value_short() & 0x3F); + if (code_seen('C')) set_lcd_contrast(code_value_short()); SERIAL_PROTOCOLPGM("lcd contrast value: "); SERIAL_PROTOCOL(lcd_contrast); SERIAL_EOL; diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 98b5fa665..605bdf830 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1716,23 +1716,18 @@ static void lcd_control_volumetric_menu() { static void lcd_set_contrast() { ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { - #if ENABLED(U8GLIB_LM6059_AF) - lcd_contrast += encoderPosition; - lcd_contrast &= 0xFF; - #else - lcd_contrast -= encoderPosition; - lcd_contrast &= 0x3F; - #endif + set_lcd_contrast(lcd_contrast + encoderPosition); encoderPosition = 0; lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - u8g.setContrast(lcd_contrast); } if (lcdDrawUpdate) { - #if ENABLED(U8GLIB_LM6059_AF) - lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr3(lcd_contrast)); - #else - lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast)); - #endif + lcd_implementation_drawedit(PSTR(MSG_CONTRAST), + #if LCD_CONTRAST_MAX >= 100 + itostr3(lcd_contrast) + #else + itostr2(lcd_contrast) + #endif + ); } if (LCD_CLICKED) lcd_goto_previous_menu(true); } @@ -2384,8 +2379,8 @@ void lcd_setalertstatuspgm(const char* message) { void lcd_reset_alert_level() { lcd_status_message_level = 0; } #if HAS_LCD_CONTRAST - void lcd_setcontrast(uint8_t value) { - lcd_contrast = value & 0x3F; + void set_lcd_contrast(int value) { + lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); u8g.setContrast(lcd_contrast); } #endif diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index e20f5cc33..b1e97bf49 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -53,7 +53,7 @@ #if ENABLED(DOGLCD) extern int lcd_contrast; - void lcd_setcontrast(uint8_t value); + void set_lcd_contrast(int value); #endif #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x)) From 5390c846a545e05e37708100af14c1da893a9597 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Jun 2016 14:45:52 -0700 Subject: [PATCH 005/580] Positive conditions for HAS_LCD_CONTRAST --- Marlin/Conditionals.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 6a46ce471..edaf371b8 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -249,7 +249,14 @@ * Default LCD contrast for dogm-like LCD displays */ #if ENABLED(DOGLCD) - #define HAS_LCD_CONTRAST (DISABLED(U8GLIB_ST7920) && DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106)) + + #define HAS_LCD_CONTRAST ( \ + ENABLED(MAKRPANEL) \ + || ENABLED(VIKI2) \ + || ENABLED(miniVIKI) \ + || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ + ) + #if HAS_LCD_CONTRAST #ifndef LCD_CONTRAST_MIN #define LCD_CONTRAST_MIN 0 From b3a37b493df59f0883c2e03fc987c48253206c3d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 1 Jun 2016 19:48:17 -0700 Subject: [PATCH 006/580] Patch G28 servo stow to use Conditionals, raise_z_after_probing --- Marlin/Conditionals.h | 6 ++- Marlin/Marlin_main.cpp | 106 ++++++++++++++++++++++------------------- Marlin/SanityCheck.h | 2 +- 3 files changed, 63 insertions(+), 51 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 599a1bf24..45665f2d4 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -349,6 +349,10 @@ #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + #else + #ifndef Z_RAISE_AFTER_PROBING + #define Z_RAISE_AFTER_PROBING 15 + #endif #endif #define HAS_Z_ENDSTOP_SERVO (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) @@ -732,7 +736,7 @@ #define Z_ENDSTOP_SERVO_NR -1 #endif #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || HAS_Z_ENDSTOP_SERVO - #define HAS_SERVO_ENDSTOPS true + #define HAS_SERVO_ENDSTOPS #define SERVO_ENDSTOP_IDS { X_ENDSTOP_SERVO_NR, Y_ENDSTOP_SERVO_NR, Z_ENDSTOP_SERVO_NR } #endif #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index dcc7af09e..38d7e70a8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -372,7 +372,7 @@ static uint8_t target_extruder; }; #endif -#if HAS_SERVO_ENDSTOPS +#if ENABLED(HAS_SERVO_ENDSTOPS) const int servo_endstop_id[] = SERVO_ENDSTOP_IDS; const int servo_endstop_angle[][2] = SERVO_ENDSTOP_ANGLES; #endif @@ -719,7 +719,7 @@ void servo_init() { servo[3].detach(); #endif - #if HAS_SERVO_ENDSTOPS + #if ENABLED(HAS_SERVO_ENDSTOPS) endstops.enable_z_probe(false); @@ -1719,7 +1719,7 @@ static void setup_for_endstop_move() { if (endstops.z_probe_enabled) return; - #if HAS_SERVO_ENDSTOPS + #if ENABLED(HAS_SERVO_ENDSTOPS) // Engage Z Servo endstop if enabled if (servo_endstop_id[Z_AXIS] >= 0) servo[servo_endstop_id[Z_AXIS]].move(servo_endstop_angle[Z_AXIS][0]); @@ -1806,7 +1806,7 @@ static void setup_for_endstop_move() { } static void stow_z_probe(bool doRaise = true) { - #if !(HAS_SERVO_ENDSTOPS && (Z_RAISE_AFTER_PROBING > 0)) + #if !(ENABLED(HAS_SERVO_ENDSTOPS) && (Z_RAISE_AFTER_PROBING > 0)) UNUSED(doRaise); #endif #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1815,7 +1815,7 @@ static void setup_for_endstop_move() { if (!endstops.z_probe_enabled) return; - #if HAS_SERVO_ENDSTOPS + #if ENABLED(HAS_SERVO_ENDSTOPS) // Retract Z Servo endstop if enabled if (servo_endstop_id[Z_AXIS] >= 0) { @@ -2057,7 +2057,7 @@ static void setup_for_endstop_move() { #endif // DELTA - #if HAS_SERVO_ENDSTOPS && DISABLED(Z_PROBE_SLED) + #if ENABLED(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_SLED) void raise_z_for_servo() { float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_PROBING; @@ -2168,33 +2168,36 @@ static void homeaxis(AxisEnum axis) { sync_plan_position(); #if ENABLED(Z_PROBE_SLED) - #define _Z_SERVO_TEST (axis != Z_AXIS) // deploy Z, servo.move XY - #define _Z_PROBE_SUBTEST false // Z will never be invoked + #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z + #define _Z_SERVO_SUBTEST false // Z will never be invoked #define _Z_DEPLOY (dock_sled(false)) #define _Z_STOW (dock_sled(true)) #elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) - #define _Z_SERVO_TEST (axis != Z_AXIS) // servo.move XY - #define _Z_PROBE_SUBTEST false // Z will never be invoked + #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z + #define _Z_SERVO_SUBTEST false // Z will never be invoked #define _Z_DEPLOY (deploy_z_probe()) #define _Z_STOW (stow_z_probe()) - #elif HAS_SERVO_ENDSTOPS - #define _Z_SERVO_TEST true // servo.move X, Y, Z - #define _Z_PROBE_SUBTEST (axis == Z_AXIS) // Z is a probe + #elif ENABLED(HAS_SERVO_ENDSTOPS) + #define _Z_SERVO_TEST true // Z not deployed yet + #define _Z_SERVO_SUBTEST (axis == Z_AXIS) // Z is a probe #endif - if (axis == Z_AXIS) { - // If there's a Z probe that needs deployment... - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) - // ...and homing Z towards the bed? Deploy it. - if (axis_home_dir < 0) _Z_DEPLOY; - #endif - } + // If there's a Z probe that needs deployment... + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) + // ...and homing Z towards the bed? Deploy it. + if (axis == Z_AXIS && axis_home_dir < 0) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_DEPLOY)); + #endif + _Z_DEPLOY; + } + #endif - #if HAS_SERVO_ENDSTOPS - // Engage an X or Y Servo endstop if enabled + #if ENABLED(HAS_SERVO_ENDSTOPS) + // Engage an X, Y (or Z) Servo endstop if enabled if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) { servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][0]); - if (_Z_PROBE_SUBTEST) endstops.z_probe_enabled = true; + if (_Z_SERVO_SUBTEST) endstops.z_probe_enabled = true; } #endif @@ -2311,7 +2314,7 @@ static void homeaxis(AxisEnum axis) { axis_known_position[axis] = true; axis_homed[axis] = true; - // Put away the Z probe + // Put away the Z probe with a function #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2321,27 +2324,32 @@ static void homeaxis(AxisEnum axis) { } #endif - // Retract Servo endstop if enabled - #if HAS_SERVO_ENDSTOPS + // Retract X, Y (or Z) Servo endstop if enabled + #if ENABLED(HAS_SERVO_ENDSTOPS) if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) { + // Raise the servo probe before stow outside ABL context. + // This is a workaround to allow use of a Servo Probe without + // ABL until more global probe handling is implemented. + #if Z_RAISE_AFTER_PROBING > 0 + if (axis == Z_AXIS) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Raise Z (after) by ", Z_RAISE_AFTER_PROBING); + #endif + current_position[Z_AXIS] = Z_RAISE_AFTER_PROBING; + feedrate = homing_feedrate[Z_AXIS]; + line_to_current_position(); + stepper.synchronize(); + } + #endif + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_ENDSTOPS > Stow with servo.move()"); #endif - // Raise the servo probe before stow outside ABL context... This is a workaround that allows the use of a Servo Probe without ABL until a more global probe handling is implemented. - #if DISABLED(AUTO_BED_LEVELING_FEATURE) - #ifndef Z_RAISE_AFTER_PROBING - #define Z_RAISE_AFTER_PROBING 15 // default height - #endif - current_position[Z_AXIS] = Z_RAISE_AFTER_PROBING; - feedrate = homing_feedrate[Z_AXIS]; - line_to_current_position(); - stepper.synchronize(); - #endif - servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]); - if (_Z_PROBE_SUBTEST) endstops.enable_z_probe(false); + if (_Z_SERVO_SUBTEST) endstops.enable_z_probe(false); } - #endif + + #endif // HAS_SERVO_ENDSTOPS } @@ -3630,7 +3638,7 @@ inline void gcode_G28() { #endif current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z) - #if HAS_SERVO_ENDSTOPS || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + #if ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + Z_RAISE_AFTER_PROBING #endif ; @@ -3647,7 +3655,7 @@ inline void gcode_G28() { dock_sled(true); // dock the sled #elif Z_RAISE_AFTER_PROBING > 0 // Raise Z axis for non-delta and non servo based probes - #if !defined(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) + #if DISABLED(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) raise_z_after_probing(); #endif #endif @@ -3691,7 +3699,7 @@ inline void gcode_G28() { * G30: Do a single Z probe at the current XY */ inline void gcode_G30() { - #if HAS_SERVO_ENDSTOPS + #if ENABLED(HAS_SERVO_ENDSTOPS) raise_z_for_servo(); #endif deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -3713,7 +3721,7 @@ inline void gcode_G28() { clean_up_after_endstop_move(); // Too early. must be done after the stowing. - #if HAS_SERVO_ENDSTOPS + #if ENABLED(HAS_SERVO_ENDSTOPS) raise_z_for_servo(); #endif stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -5822,13 +5830,13 @@ inline void gcode_M303() { */ inline void gcode_M400() { stepper.synchronize(); } -#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_SERVO_ENDSTOPS || ENABLED(Z_PROBE_ALLEN_KEY)) +#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY)) /** * M401: Engage Z Servo endstop if available */ inline void gcode_M401() { - #if HAS_SERVO_ENDSTOPS + #if ENABLED(HAS_SERVO_ENDSTOPS) raise_z_for_servo(); #endif deploy_z_probe(); @@ -5838,13 +5846,13 @@ inline void gcode_M400() { stepper.synchronize(); } * M402: Retract Z Servo endstop if enabled */ inline void gcode_M402() { - #if HAS_SERVO_ENDSTOPS + #if ENABLED(HAS_SERVO_ENDSTOPS) raise_z_for_servo(); #endif stow_z_probe(false); } -#endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED +#endif // AUTO_BED_LEVELING_FEATURE && (ENABLED(HAS_SERVO_ENDSTOPS) || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -7038,14 +7046,14 @@ void process_next_command() { gcode_M400(); break; - #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_SERVO_ENDSTOPS || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) + #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) case 401: gcode_M401(); break; case 402: gcode_M402(); break; - #endif // AUTO_BED_LEVELING_FEATURE && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED + #endif // AUTO_BED_LEVELING_FEATURE && (ENABLED(HAS_SERVO_ENDSTOPS) || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 3fa6788a7..d2c53be14 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -174,7 +174,7 @@ /** * Servo deactivation depends on servo endstops */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_SERVO_ENDSTOPS +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && DISABLED(HAS_SERVO_ENDSTOPS) #error "At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." #endif From 28fb1f8994c7f12f234bc56d647571d3bb8d2a25 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Jun 2016 15:20:10 -0700 Subject: [PATCH 007/580] Tweak #endif comment for ABL GRID --- Marlin/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/DUAL/Configuration.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/Hephestos_2/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- Marlin/example_configurations/RigidBot/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/TAZ4/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b67d0a02f..bcf08703a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -585,7 +585,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 39e5ce4e3..d7b439b21 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -567,7 +567,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 107f8386c..4987de471 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -565,7 +565,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 5b41fb397..15425328b 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -577,7 +577,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 3f6f4b644..e1e0da344 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -579,7 +579,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X ((X_MIN_POS + X_MAX_POS) / 2) #define ABL_PROBE_PT_3_Y Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 4b74fe505..4ef5fbccf 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -602,7 +602,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index d9c8b9be4..915838697 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -585,7 +585,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 967927d86..8cfc2b900 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -579,7 +579,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index a801823ee..96423e6d2 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -593,7 +593,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index b2bd2ce8a..7397cc023 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -606,7 +606,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index f32e071d1..4d1be67d2 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -577,7 +577,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 151e16bc8..d4caf657d 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -585,7 +585,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 026a72733..ff86e04bf 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -631,7 +631,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index dea1dfe83..5a07a2fa0 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -631,7 +631,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index b26298913..85350ec7d 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -631,7 +631,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index d87239d1a..09add216e 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -620,7 +620,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index fa4e96d58..d65464ff0 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -629,7 +629,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 1991ee620..12547572c 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -588,7 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index c380ee2a0..2175973a5 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -575,7 +575,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 - #endif // AUTO_BED_LEVELING_GRID + #endif // !AUTO_BED_LEVELING_GRID // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. From 9eecb4404b4cb41b0fd46199f91d647f5dd98900 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Jun 2016 16:01:42 -0700 Subject: [PATCH 008/580] Make raise_z_after_probing null sometimes --- Marlin/Marlin_main.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 38d7e70a8..0e736a64d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1696,7 +1696,12 @@ static void setup_for_endstop_move() { } inline void raise_z_after_probing() { - do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); + #if Z_RAISE_AFTER_PROBING > 0 + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("raise_z_after_probing()"); + #endif + do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); + #endif } static void clean_up_after_endstop_move() { @@ -1822,14 +1827,6 @@ static void setup_for_endstop_move() { #if Z_RAISE_AFTER_PROBING > 0 if (doRaise) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise Z (after) by ", Z_RAISE_AFTER_PROBING); - SERIAL_EOL; - SERIAL_ECHO("> SERVO_ENDSTOPS > raise_z_after_probing()"); - SERIAL_EOL; - } - #endif raise_z_after_probing(); // this also updates current_position stepper.synchronize(); } @@ -2117,9 +2114,7 @@ static void setup_for_endstop_move() { float oldXpos = current_position[X_AXIS]; // save x position if (dock) { - #if Z_RAISE_AFTER_PROBING > 0 - raise_z_after_probing(); // raise Z - #endif + raise_z_after_probing(); // raise Z // Dock sled a bit closer to ensure proper capturing do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); digitalWrite(SLED_PIN, LOW); // turn off magnet @@ -3578,7 +3573,7 @@ inline void gcode_G28() { // Allen Key Probe for Delta #if ENABLED(Z_PROBE_ALLEN_KEY) || SERVO_LEVELING stow_z_probe(); - #elif Z_RAISE_AFTER_PROBING > 0 + #else raise_z_after_probing(); // for non Allen Key probes, such as simple mechanical probe #endif #else // !DELTA @@ -3653,7 +3648,7 @@ inline void gcode_G28() { // Sled assembly for Cartesian bots #if ENABLED(Z_PROBE_SLED) dock_sled(true); // dock the sled - #elif Z_RAISE_AFTER_PROBING > 0 + #else // Raise Z axis for non-delta and non servo based probes #if DISABLED(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) raise_z_after_probing(); From db0fd021d0b351413656a29e1a477a3d4475c5e1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Jun 2016 16:02:43 -0700 Subject: [PATCH 009/580] Z raise options independent of ABL so G28 can use them --- Marlin/Conditionals.h | 4 ---- Marlin/Configuration.h | 8 ++++++-- Marlin/example_configurations/Felix/Configuration.h | 8 ++++++-- Marlin/example_configurations/Felix/DUAL/Configuration.h | 8 ++++++-- Marlin/example_configurations/Hephestos/Configuration.h | 8 ++++++-- Marlin/example_configurations/Hephestos_2/Configuration.h | 8 ++++++-- Marlin/example_configurations/K8200/Configuration.h | 8 ++++++-- .../RepRapWorld/Megatronics/Configuration.h | 8 ++++++-- Marlin/example_configurations/RigidBot/Configuration.h | 8 ++++++-- Marlin/example_configurations/SCARA/Configuration.h | 8 ++++++-- Marlin/example_configurations/TAZ4/Configuration.h | 8 ++++++-- Marlin/example_configurations/WITBOX/Configuration.h | 8 ++++++-- .../adafruit/ST7565/Configuration.h | 8 ++++++-- .../example_configurations/delta/biv2.5/Configuration.h | 8 ++++++-- .../example_configurations/delta/generic/Configuration.h | 8 ++++++-- .../delta/kossel_mini/Configuration.h | 8 ++++++-- .../delta/kossel_pro/Configuration.h | 8 ++++++-- .../delta/kossel_xl/Configuration.h | 8 ++++++-- Marlin/example_configurations/makibox/Configuration.h | 8 ++++++-- .../example_configurations/tvrrug/Round2/Configuration.h | 8 ++++++-- 20 files changed, 114 insertions(+), 42 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 45665f2d4..2e6e55e44 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -349,10 +349,6 @@ #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - #else - #ifndef Z_RAISE_AFTER_PROBING - #define Z_RAISE_AFTER_PROBING 15 - #endif #endif #define HAS_Z_ENDSTOP_SERVO (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bcf08703a..968fca659 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -440,6 +440,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -610,9 +616,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index d7b439b21..55b806140 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -422,6 +422,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -592,9 +598,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 4987de471..cebc6794f 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -420,6 +420,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -590,9 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 15425328b..e2dd327e0 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -432,6 +432,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -602,9 +608,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index e1e0da344..1ea120af9 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -434,6 +434,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 5 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 5 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -604,9 +610,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 5 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 2 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 5 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 4ef5fbccf..ada26986f 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -457,6 +457,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -627,9 +633,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 915838697..3df2b7bd0 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -440,6 +440,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -610,9 +616,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 8cfc2b900..d153fa9dd 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -434,6 +434,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -604,9 +610,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 96423e6d2..1b28aae80 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -448,6 +448,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -618,9 +624,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 7397cc023..a0197907b 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -461,6 +461,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -631,9 +637,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 4d1be67d2..cdd075c83 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -432,6 +432,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -602,9 +608,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index d4caf657d..7a5d012d6 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -440,6 +440,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -610,9 +616,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index ff86e04bf..739af6ece 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -482,6 +482,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -656,9 +662,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 50 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 5a07a2fa0..714152c72 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -482,6 +482,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -656,9 +662,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points - #define Z_RAISE_AFTER_PROBING 50 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 85350ec7d..e9e5c428a 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -482,6 +482,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -656,9 +662,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points - #define Z_RAISE_AFTER_PROBING 50 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 09add216e..406edd16a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -471,6 +471,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 100 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -647,9 +653,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 100 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index d65464ff0..ab5403574 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -480,6 +480,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 20 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 20 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -654,9 +660,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 20 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 10 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 20 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 12547572c..55696956d 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -443,6 +443,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -613,9 +619,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 2175973a5..fc52ac4cb 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -430,6 +430,12 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 1 @@ -600,9 +606,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BEFORE_PROBING 15 // How much the Z axis will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. From 81384dfd365fef5de63ccdaffc8e486ca2e3575f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 Jun 2016 17:57:56 -0700 Subject: [PATCH 010/580] Apply static to remaining stepper methods --- Marlin/stepper.h | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 30223b55b..ce4c1c148 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -148,7 +148,7 @@ class Stepper { // // Initialize stepper hardware // - void init(); + static void init(); // // Interrupt Service Routines @@ -163,13 +163,13 @@ class Stepper { // // Block until all buffered steps are executed // - void synchronize(); + static void synchronize(); // // Set the current position in steps // - void set_position(const long& x, const long& y, const long& z, const long& e); - void set_e_position(const long& e); + static void set_position(const long& x, const long& y, const long& z, const long& e); + static void set_e_position(const long& e); // // Set direction bits for all steppers @@ -179,33 +179,33 @@ class Stepper { // // Get the position of a stepper, in steps // - long position(AxisEnum axis); + static long position(AxisEnum axis); // // Report the positions of the steppers, in steps // - void report_positions(); + static void report_positions(); // // Get the position (mm) of an axis based on stepper position(s) // - float get_axis_position_mm(AxisEnum axis); + static float get_axis_position_mm(AxisEnum axis); // // The stepper subsystem goes to sleep when it runs out of things to execute. Call this // to notify the subsystem that it is time to go to work. // - void wake_up(); + static void wake_up(); // // Wait for moves to finish and disable all steppers // - void finish_and_disable(); + static void finish_and_disable(); // // Quickly stop all steppers and clear the blocks queue // - void quick_stop(); + static void quick_stop(); // // The direction of a single motor @@ -213,36 +213,36 @@ class Stepper { static FORCE_INLINE bool motor_direction(AxisEnum axis) { return TEST(last_direction_bits, axis); } #if HAS_DIGIPOTSS - void digitalPotWrite(int address, int value); + static void digitalPotWrite(int address, int value); #endif - void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2); - void digipot_current(uint8_t driver, int current); - void microstep_mode(uint8_t driver, uint8_t stepping); - void microstep_readings(); + static void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2); + static void digipot_current(uint8_t driver, int current); + static void microstep_mode(uint8_t driver, uint8_t stepping); + static void microstep_readings(); #if ENABLED(Z_DUAL_ENDSTOPS) - FORCE_INLINE void set_homing_flag(bool state) { performing_homing = state; } - FORCE_INLINE void set_z_lock(bool state) { locked_z_motor = state; } - FORCE_INLINE void set_z2_lock(bool state) { locked_z2_motor = state; } + static FORCE_INLINE void set_homing_flag(bool state) { performing_homing = state; } + static FORCE_INLINE void set_z_lock(bool state) { locked_z_motor = state; } + static FORCE_INLINE void set_z2_lock(bool state) { locked_z2_motor = state; } #endif #if ENABLED(BABYSTEPPING) - void babystep(const uint8_t axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention + static void babystep(const uint8_t axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention #endif - inline void kill_current_block() { + static inline void kill_current_block() { step_events_completed = current_block->step_event_count; } // // Handle a triggered endstop // - void endstop_triggered(AxisEnum axis); + static void endstop_triggered(AxisEnum axis); // // Triggered position of an axis in mm (not core-savvy) // - FORCE_INLINE float triggered_position_mm(AxisEnum axis) { + static FORCE_INLINE float triggered_position_mm(AxisEnum axis) { return endstops_trigsteps[axis] / planner.axis_steps_per_unit[axis]; } @@ -327,8 +327,8 @@ class Stepper { // SERIAL_ECHOLN(current_block->final_advance/256.0); } - void digipot_init(); - void microstep_init(); + static void digipot_init(); + static void microstep_init(); }; From 8532bf408770ee44f3678ed9514406520d1b020f Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Fri, 3 Jun 2016 11:20:46 +0200 Subject: [PATCH 011/580] last of missing defines added need to check line 101-103 --- Marlin/language_da.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/language_da.h b/Marlin/language_da.h index a66ceb50b..6610edf70 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -172,6 +172,7 @@ #define MSG_CNG_SDCARD "Skift SD kort" #define MSG_ZPROBE_OUT "Probe udenfor plade" #define MSG_YX_UNHOMED "Home X/Y før Z" +#define MSG_XYZ_UNHOMED "Home XYZ first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" @@ -182,8 +183,8 @@ #define MSG_THERMAL_RUNAWAY "Temp løber løbsk" #define MSG_ERR_MAXTEMP "Fejl: Maks temp" #define MSG_ERR_MINTEMP "Fejl: Min temp" -#define MSG_ERR_MAXTEMP_BED "Fejl: Maks P temp" -#define MSG_ERR_MINTEMP_BED "Fejl: Min P temp" +#define MSG_ERR_MAXTEMP_BED "Fejl: Maks Plsde temp" +#define MSG_ERR_MINTEMP_BED "Fejl: Min Plade temp" #define MSG_END_HOUR "Timer" #define MSG_END_MINUTE "Minutter" #define MSG_HEATING "Opvarmer..." From f499be084ac6722131ab95c16a626f19f6365686 Mon Sep 17 00:00:00 2001 From: MagoKimbra Date: Fri, 3 Jun 2016 23:23:23 +0200 Subject: [PATCH 012/580] Fix M428 width DELTA & SCARA --- Marlin/Marlin_main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1feb42d7a..5f2608301 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6005,7 +6005,11 @@ inline void gcode_M428() { } if (!err) { - sync_plan_position(); + #if ENABLED(DELTA) && ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif report_current_position(); LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); #if HAS_BUZZER From cd441ce652579f0d24c36c4ff3dd9b6b5afa5858 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 May 2016 17:43:20 -0700 Subject: [PATCH 013/580] SINGLENOZZLE: EXTRUDERS versus HOTENDS --- Marlin/Conditionals.h | 38 +++- Marlin/Configuration.h | 12 +- Marlin/Configuration_adv.h | 2 +- Marlin/Marlin_main.cpp | 92 ++++----- Marlin/SanityCheck.h | 91 +++++---- Marlin/boards.h | 16 +- Marlin/configuration_store.cpp | 18 +- Marlin/dogm_bitmaps.h | 8 +- Marlin/dogm_lcd_implementation.h | 4 +- .../Felix/Configuration.h | 12 +- .../Felix/Configuration_adv.h | 2 +- .../Felix/DUAL/Configuration.h | 12 +- .../Hephestos/Configuration.h | 12 +- .../Hephestos/Configuration_adv.h | 2 +- .../Hephestos_2/Configuration.h | 12 +- .../Hephestos_2/Configuration_adv.h | 2 +- .../K8200/Configuration.h | 12 +- .../K8200/Configuration_adv.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 12 +- .../RigidBot/Configuration.h | 12 +- .../RigidBot/Configuration_adv.h | 2 +- .../SCARA/Configuration.h | 12 +- .../SCARA/Configuration_adv.h | 2 +- .../TAZ4/Configuration.h | 12 +- .../TAZ4/Configuration_adv.h | 2 +- .../WITBOX/Configuration.h | 12 +- .../WITBOX/Configuration_adv.h | 2 +- .../adafruit/ST7565/Configuration.h | 12 +- .../delta/biv2.5/Configuration.h | 12 +- .../delta/biv2.5/Configuration_adv.h | 2 +- .../delta/generic/Configuration.h | 12 +- .../delta/generic/Configuration_adv.h | 2 +- .../delta/kossel_mini/Configuration.h | 12 +- .../delta/kossel_mini/Configuration_adv.h | 2 +- .../delta/kossel_pro/Configuration.h | 12 +- .../delta/kossel_pro/Configuration_adv.h | 2 +- .../delta/kossel_xl/Configuration.h | 12 +- .../delta/kossel_xl/Configuration_adv.h | 2 +- .../makibox/Configuration.h | 12 +- .../makibox/Configuration_adv.h | 2 +- .../tvrrug/Round2/Configuration.h | 12 +- .../tvrrug/Round2/Configuration_adv.h | 2 +- Marlin/pins.h | 27 ++- Marlin/pins_MEGACONTROLLER.h | 2 +- Marlin/pins_RAMPS_14.h | 16 +- Marlin/pins_RUMBA.h | 2 +- Marlin/temperature.cpp | 188 +++++++++--------- Marlin/temperature.h | 106 ++++++---- Marlin/ultralcd.cpp | 122 ++++++------ .../ultralcd_implementation_hitachi_HD44780.h | 18 +- 50 files changed, 550 insertions(+), 458 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 7ec8fe571..54b111bb6 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -535,6 +535,21 @@ #define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)) #define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED)) + /** + * SINGLENOZZLE needs to differentiate EXTRUDERS and HOTENDS + * And all "extruders" are in the same place. + */ + #if ENABLED(SINGLENOZZLE) + #define HOTENDS 1 + #undef TEMP_SENSOR_1_AS_REDUNDANT + #undef HOTEND_OFFSET_X + #undef HOTEND_OFFSET_Y + #define HOTEND_OFFSET_X { 0 } + #define HOTEND_OFFSET_Y { 0 } + #else + #define HOTENDS EXTRUDERS + #endif + /** * ARRAY_BY_EXTRUDERS based on EXTRUDERS */ @@ -551,15 +566,20 @@ #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1) /** - * With SINGLENOZZLE all "extruders" are in the same place + * ARRAY_BY_HOTENDS based on HOTENDS */ - #if ENABLED(SINGLENOZZLE) - #undef EXTRUDER_OFFSET_X - #undef EXTRUDER_OFFSET_Y - #define EXTRUDER_OFFSET_X { 0 } - #define EXTRUDER_OFFSET_Y { 0 } + #if HOTENDS > 3 + #define ARRAY_BY_HOTENDS(v1, v2, v3, v4) { v1, v2, v3, v4 } + #elif HOTENDS > 2 + #define ARRAY_BY_HOTENDS(v1, v2, v3, v4) { v1, v2, v3 } + #elif HOTENDS > 1 + #define ARRAY_BY_HOTENDS(v1, v2, v3, v4) { v1, v2 } + #else + #define ARRAY_BY_HOTENDS(v1, v2, v3, v4) { v1 } #endif + #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1) + /** * Z_DUAL_ENDSTOPS endstop reassignment */ @@ -695,11 +715,11 @@ * Helper Macros for heaters and extruder fan */ #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v) - #if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL) + #if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL) #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v) - #if EXTRUDERS > 2 + #if HOTENDS > 2 #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v) - #if EXTRUDERS > 3 + #if HOTENDS > 3 #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v) #endif #endif diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 968fca659..4c1727102 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 61cdef140..952da0fa7 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d109055e7..9e40335c0 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -356,16 +356,16 @@ static uint8_t target_extruder; #endif // Extruder offsets -#if EXTRUDERS > 1 - #ifndef EXTRUDER_OFFSET_X - #define EXTRUDER_OFFSET_X { 0 } // X offsets for each extruder +#if HOTENDS > 1 + #ifndef HOTEND_OFFSET_X + #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder #endif - #ifndef EXTRUDER_OFFSET_Y - #define EXTRUDER_OFFSET_Y { 0 } // Y offsets for each extruder + #ifndef HOTEND_OFFSET_Y + #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder #endif - float extruder_offset[][EXTRUDERS] = { - EXTRUDER_OFFSET_X, - EXTRUDER_OFFSET_Y + float hotend_offset[][HOTENDS] = { + HOTEND_OFFSET_X, + HOTEND_OFFSET_Y #if ENABLED(DUAL_X_CARRIAGE) , { 0 } // Z offsets for each extruder #endif @@ -1249,7 +1249,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); * This allow soft recalibration of the second extruder offset position * without firmware reflash (through the M218 command). */ - return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS; + return (hotend_offset[X_AXIS][1] > 0) ? hotend_offset[X_AXIS][1] : X2_HOME_POS; } static int x_home_dir(int extruder) { @@ -1280,7 +1280,7 @@ static void update_software_endstops(AxisEnum axis) { #if ENABLED(DUAL_X_CARRIAGE) if (axis == X_AXIS) { - float dual_max_x = max(extruder_offset[X_AXIS][1], X2_MAX_POS); + float dual_max_x = max(hotend_offset[X_AXIS][1], X2_MAX_POS); if (active_extruder != 0) { sw_endstop_min[X_AXIS] = X2_MIN_POS + offs; sw_endstop_max[X_AXIS] = dual_max_x + offs; @@ -4407,8 +4407,8 @@ inline void gcode_M104() { SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(thermalManager.degTargetBed(), 1); #endif - #if EXTRUDERS > 1 - for (int8_t e = 0; e < EXTRUDERS; ++e) { + #if HOTENDS > 1 + for (int8_t e = 0; e < HOTENDS; ++e) { SERIAL_PROTOCOLPGM(" T"); SERIAL_PROTOCOL(e); SERIAL_PROTOCOLCHAR(':'); @@ -4433,8 +4433,8 @@ inline void gcode_M104() { #else SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder)); #endif - #if EXTRUDERS > 1 - for (int8_t e = 0; e < EXTRUDERS; ++e) { + #if HOTENDS > 1 + for (int8_t e = 0; e < HOTENDS; ++e) { SERIAL_PROTOCOLPGM(" @"); SERIAL_PROTOCOL(e); SERIAL_PROTOCOLCHAR(':'); @@ -4453,13 +4453,13 @@ inline void gcode_M104() { SERIAL_PROTOCOLPGM("C->"); SERIAL_PROTOCOL_F(thermalManager.rawBedTemp() / OVERSAMPLENR, 0); #endif - for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { + for (int8_t cur_hotend = 0; cur_hotend < HOTENDS; ++cur_hotend) { SERIAL_PROTOCOLPGM(" T"); - SERIAL_PROTOCOL(cur_extruder); + SERIAL_PROTOCOL(cur_hotend); SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL_F(thermalManager.degHotend(cur_extruder), 1); + SERIAL_PROTOCOL_F(thermalManager.degHotend(cur_hotend), 1); SERIAL_PROTOCOLPGM("C->"); - SERIAL_PROTOCOL_F(thermalManager.rawHotendTemp(cur_extruder) / OVERSAMPLENR, 0); + SERIAL_PROTOCOL_F(thermalManager.rawHotendTemp(cur_hotend) / OVERSAMPLENR, 0); } #endif } @@ -5391,7 +5391,7 @@ inline void gcode_M206() { #endif // FWRETRACT -#if EXTRUDERS > 1 +#if HOTENDS > 1 /** * M218 - set hotend offset (in mm) @@ -5404,29 +5404,29 @@ inline void gcode_M206() { inline void gcode_M218() { if (get_target_extruder_from_command(218)) return; - if (code_seen('X')) extruder_offset[X_AXIS][target_extruder] = code_value(); - if (code_seen('Y')) extruder_offset[Y_AXIS][target_extruder] = code_value(); + if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value(); + if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value(); #if ENABLED(DUAL_X_CARRIAGE) - if (code_seen('Z')) extruder_offset[Z_AXIS][target_extruder] = code_value(); + if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value(); #endif SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - for (int e = 0; e < EXTRUDERS; e++) { + for (int e = 0; e < HOTENDS; e++) { SERIAL_CHAR(' '); - SERIAL_ECHO(extruder_offset[X_AXIS][e]); + SERIAL_ECHO(hotend_offset[X_AXIS][e]); SERIAL_CHAR(','); - SERIAL_ECHO(extruder_offset[Y_AXIS][e]); + SERIAL_ECHO(hotend_offset[Y_AXIS][e]); #if ENABLED(DUAL_X_CARRIAGE) SERIAL_CHAR(','); - SERIAL_ECHO(extruder_offset[Z_AXIS][e]); + SERIAL_ECHO(hotend_offset[Z_AXIS][e]); #endif } SERIAL_EOL; } -#endif // EXTRUDERS > 1 +#endif // HOTENDS > 1 /** * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) @@ -5556,7 +5556,7 @@ inline void gcode_M226() { // default behaviour (omitting E parameter) is to update for extruder 0 only int e = code_seen('E') ? code_value() : 0; // extruder being updated - if (e < EXTRUDERS) { // catch bad input value + if (e < HOTENDS) { // catch bad input value if (code_seen('P')) PID_PARAM(Kp, e) = code_value(); if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value()); if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value()); @@ -5568,10 +5568,10 @@ inline void gcode_M226() { thermalManager.updatePID(); SERIAL_ECHO_START; - #if ENABLED(PID_PARAMS_PER_EXTRUDER) + #if ENABLED(PID_PARAMS_PER_HOTEND) SERIAL_ECHO(" e:"); // specify extruder in serial output SERIAL_ECHO(e); - #endif // PID_PARAMS_PER_EXTRUDER + #endif // PID_PARAMS_PER_HOTEND SERIAL_ECHO(" p:"); SERIAL_ECHO(PID_PARAM(Kp, e)); SERIAL_ECHO(" i:"); @@ -5690,7 +5690,7 @@ inline void gcode_M303() { float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0); - if (e >= 0 && e < EXTRUDERS) + if (e >= 0 && e < HOTENDS) target_extruder = e; KEEPALIVE_STATE(NOT_BUSY); // don't send "busy: processing" messages during autotune output @@ -6272,13 +6272,13 @@ inline void gcode_M503() { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); SERIAL_CHAR(' '); - SERIAL_ECHO(extruder_offset[X_AXIS][0]); + SERIAL_ECHO(hotend_offset[X_AXIS][0]); SERIAL_CHAR(','); - SERIAL_ECHO(extruder_offset[Y_AXIS][0]); + SERIAL_ECHO(hotend_offset[Y_AXIS][0]); SERIAL_CHAR(' '); SERIAL_ECHO(duplicate_extruder_x_offset); SERIAL_CHAR(','); - SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]); + SERIAL_ECHOLN(hotend_offset[Y_AXIS][1]); break; case DXC_FULL_CONTROL_MODE: case DXC_AUTO_PARK_MODE: @@ -6436,7 +6436,7 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif } - #if EXTRUDERS > 1 + #if HOTENDS > 1 if (tmp_extruder != active_extruder) { // Save current position to return to after applying extruder offset set_destination_to_current(); @@ -6454,8 +6454,8 @@ inline void gcode_T(uint8_t tmp_extruder) { } // apply Y & Z extruder offset (x offset is already used in determining home pos) - current_position[Y_AXIS] -= extruder_offset[Y_AXIS][active_extruder] - extruder_offset[Y_AXIS][tmp_extruder]; - current_position[Z_AXIS] -= extruder_offset[Z_AXIS][active_extruder] - extruder_offset[Z_AXIS][tmp_extruder]; + current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder]; + current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; active_extruder = tmp_extruder; // This function resets the max/min values - the current position may be overwritten below. @@ -6485,11 +6485,11 @@ inline void gcode_T(uint8_t tmp_extruder) { #else // !DUAL_X_CARRIAGE #if ENABLED(AUTO_BED_LEVELING_FEATURE) // Offset extruder, make sure to apply the bed level rotation matrix - vector_3 tmp_offset_vec = vector_3(extruder_offset[X_AXIS][tmp_extruder], - extruder_offset[Y_AXIS][tmp_extruder], + vector_3 tmp_offset_vec = vector_3(hotend_offset[X_AXIS][tmp_extruder], + hotend_offset[Y_AXIS][tmp_extruder], 0), - act_offset_vec = vector_3(extruder_offset[X_AXIS][active_extruder], - extruder_offset[Y_AXIS][active_extruder], + act_offset_vec = vector_3(hotend_offset[X_AXIS][active_extruder], + hotend_offset[Y_AXIS][active_extruder], 0), offset_vec = tmp_offset_vec - act_offset_vec; @@ -6521,7 +6521,7 @@ inline void gcode_T(uint8_t tmp_extruder) { // The newly-selected extruder is actually at... for (int i=X_AXIS; i<=Y_AXIS; i++) { - float diff = extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder]; + float diff = hotend_offset[i][tmp_extruder] - hotend_offset[i][active_extruder]; current_position[i] += diff; position_shift[i] += diff; // Offset the coordinate space update_software_endstops((AxisEnum)i); @@ -6552,7 +6552,7 @@ inline void gcode_T(uint8_t tmp_extruder) { enable_solenoid_on_active_extruder(); #endif // EXT_SOLENOID - #endif // EXTRUDERS > 1 + #endif // HOTENDS > 1 feedrate = stored_feedrate; @@ -6983,7 +6983,7 @@ void process_next_command() { break; #endif // FWRETRACT - #if EXTRUDERS > 1 + #if HOTENDS > 1 case 218: // M218 - set hotend offset (in mm), T X Y gcode_M218(); break; @@ -7853,8 +7853,8 @@ void prepare_move() { float max_temp = 0.0; if (ELAPSED(millis(), next_status_led_update_ms)) { next_status_led_update_ms += 500; // Update every 0.5s - for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) - max_temp = max(max(max_temp, thermalManager.degHotend(cur_extruder)), thermalManager.degTargetHotend(cur_extruder)); + for (int8_t cur_hotend = 0; cur_hotend < HOTENDS; ++cur_hotend) + max_temp = max(max(max_temp, thermalManager.degHotend(cur_hotend)), thermalManager.degTargetHotend(cur_hotend)); #if HAS_TEMP_BED max_temp = max(max(max_temp, thermalManager.degTargetBed()), thermalManager.degBed()); #endif diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 19edb7598..a913cb1b0 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -468,39 +468,45 @@ /** * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. */ -#if EXTRUDERS > 3 - #if TEMP_SENSOR_3 == 0 - #error "TEMP_SENSOR_3 is required with 4 EXTRUDERS." - #elif !HAS_HEATER_3 - #error "HEATER_3_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_3) - #error "TEMP_3_PIN not defined for this board." - #elif !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE) - #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." - #endif -#elif EXTRUDERS > 2 - #if TEMP_SENSOR_2 == 0 - #error "TEMP_SENSOR_2 is required with 3 or more EXTRUDERS." - #elif !HAS_HEATER_2 - #error "HEATER_2_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_2) - #error "TEMP_2_PIN not defined for this board." - #elif !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE) - #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." +#if !HAS_HEATER_0 + #error "HEATER_0_PIN not defined for this board." +#elif !PIN_EXISTS(TEMP_0) + #error "TEMP_0_PIN not defined for this board." +#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE) + #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." +#elif TEMP_SENSOR_0 == 0 + #error "TEMP_SENSOR_0 is required." +#endif + +#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL) + #if !HAS_HEATER_1 + #error "HEATER_1_PIN not defined for this board." #endif -#elif EXTRUDERS > 1 +#endif + +#if HOTENDS > 1 #if TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with 2 or more EXTRUDERS." + #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." #elif !PIN_EXISTS(TEMP_1) #error "TEMP_1_PIN not defined for this board." - #elif !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE) - #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." #endif -#endif - -#if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL) - #if !HAS_HEATER_1 - #error "HEATER_1_PIN not defined for this board." + #if HOTENDS > 2 + #if TEMP_SENSOR_2 == 0 + #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." + #elif !HAS_HEATER_2 + #error "HEATER_2_PIN not defined for this board." + #elif !PIN_EXISTS(TEMP_2) + #error "TEMP_2_PIN not defined for this board." + #endif + #if HOTENDS > 3 + #if TEMP_SENSOR_3 == 0 + #error "TEMP_SENSOR_3 is required with 4 HOTENDS." + #elif !HAS_HEATER_3 + #error "HEATER_3_PIN not defined for this board." + #elif !PIN_EXISTS(TEMP_3) + #error "TEMP_3_PIN not defined for this board." + #endif + #endif #endif #endif @@ -508,14 +514,21 @@ #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." #endif -#if !HAS_HEATER_0 - #error "HEATER_0_PIN not defined for this board." -#elif !PIN_EXISTS(TEMP_0) - #error "TEMP_0_PIN not defined for this board." -#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE) - #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." -#elif TEMP_SENSOR_0 == 0 - #error "TEMP_SENSOR_0 is required." +/** + * Test Extruder Pins + */ +#if EXTRUDERS > 3 + #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE) + #error E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board. + #endif +#elif EXTRUDERS > 2 + #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE) + #error E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board. + #endif +#elif EXTRUDERS > 1 + #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE) + #error E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board. + #endif #endif /** @@ -574,6 +587,12 @@ #error "Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2" #elif defined(LANGUAGE_INCLUDE) #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration." +#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y) + #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." +#elif defined(PID_PARAMS_PER_EXTRUDER) + #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." +#elif defined(EXTRUDER_WATTS) + #error "EXTRUDER_WATTS is deprecated. Use HOTEND_WATTS instead." #endif #endif //SANITYCHECK_H diff --git a/Marlin/boards.h b/Marlin/boards.h index b06534c98..3602e6e87 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -32,17 +32,17 @@ #define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0 #define BOARD_SETHI 20 // Sethi 3D_1 #define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2 -#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 (Power outputs: Extruder, Fan, Bed) -#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 (Power outputs: Extruder0, Extruder1, Bed) -#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 (Power outputs: Extruder, Fan, Fan) -#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 (Power outputs: Extruder0, Extruder1, Fan) +#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 (Power outputs: Hotend, Fan, Bed) +#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed) +#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1) +#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan) #define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 (Power outputs: Spindle, Controller Fan) #define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) #define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard -#define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Extruder, Fan, Bed) -#define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Extruder0, Extruder1, Bed) -#define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Extruder, Fan, Fan) -#define BOARD_RAMPS_14_EEF 46 // RAMPS 1.4 (Power outputs: Extruder0, Extruder1, Fan) +#define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) +#define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) +#define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) +#define BOARD_RAMPS_14_EEF 46 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) #define BOARD_RAMPS_14_SF 48 // RAMPS 1.4 (Power outputs: Spindle, Controller Fan) #define BOARD_GEN6 5 // Gen6 #define BOARD_GEN6_DELUXE 51 // Gen6 deluxe diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 001955f6e..755ef9508 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -246,7 +246,7 @@ void Config_StoreSettings() { for (uint8_t e = 0; e < 4; e++) { #if ENABLED(PIDTEMP) - if (e < EXTRUDERS) { + if (e < HOTENDS) { EEPROM_WRITE_VAR(i, PID_PARAM(Kp, e)); EEPROM_WRITE_VAR(i, PID_PARAM(Ki, e)); EEPROM_WRITE_VAR(i, PID_PARAM(Kd, e)); @@ -266,7 +266,7 @@ void Config_StoreSettings() { for (uint8_t q = 3; q--;) EEPROM_WRITE_VAR(i, dummy); // Ki, Kd, Kc } - } // Extruders Loop + } // Hotends Loop #if DISABLED(PID_ADD_EXTRUSION_RATE) int lpq_len = 20; @@ -426,7 +426,7 @@ void Config_RetrieveSettings() { #if ENABLED(PIDTEMP) for (uint8_t e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin EEPROM_READ_VAR(i, dummy); // Kp - if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) { + if (e < HOTENDS && dummy != DUMMY_PID_VALUE) { // do not need to scale PID values as the values in EEPROM are already scaled PID_PARAM(Kp, e) = dummy; EEPROM_READ_VAR(i, PID_PARAM(Ki, e)); @@ -584,8 +584,8 @@ void Config_ResetDefault() { #endif #if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_EXTRUDER) - for (uint8_t e = 0; e < EXTRUDERS; e++) + #if ENABLED(PID_PARAMS_PER_HOTEND) + for (uint8_t e = 0; e < HOTENDS; e++) #else int e = 0; UNUSED(e); // only need to write once #endif @@ -801,9 +801,9 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("PID settings:"); } #if ENABLED(PIDTEMP) - #if EXTRUDERS > 1 + #if HOTENDS > 1 if (forReplay) { - for (uint8_t i = 0; i < EXTRUDERS; i++) { + for (uint8_t i = 0; i < HOTENDS; i++) { CONFIG_ECHO_START; SERIAL_ECHOPAIR(" M301 E", i); SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, i)); @@ -817,8 +817,8 @@ void Config_PrintSettings(bool forReplay) { } } else - #endif // EXTRUDERS > 1 - // !forReplay || EXTRUDERS == 1 + #endif // HOTENDS > 1 + // !forReplay || HOTENDS == 1 { CONFIG_ECHO_START; SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0 diff --git a/Marlin/dogm_bitmaps.h b/Marlin/dogm_bitmaps.h index 546cfd6f0..6b6541bb3 100644 --- a/Marlin/dogm_bitmaps.h +++ b/Marlin/dogm_bitmaps.h @@ -110,7 +110,7 @@ // be displayed. #if HAS_TEMP_BED - #if EXTRUDERS == 1 + #if HOTENDS == 1 #define STATUS_SCREENWIDTH 115 //Width in pixels #define STATUS_SCREENHEIGHT 19 //Height in pixels #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes @@ -160,7 +160,7 @@ 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 }; - #elif EXTRUDERS == 2 + #elif HOTENDS == 2 #define STATUS_SCREENWIDTH 115 //Width in pixels #define STATUS_SCREENHEIGHT 19 //Height in pixels #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes @@ -262,7 +262,7 @@ }; #endif // Extruders #else - #if EXTRUDERS == 1 + #if HOTENDS == 1 #define STATUS_SCREENWIDTH 115 //Width in pixels #define STATUS_SCREENHEIGHT 19 //Height in pixels #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes @@ -312,7 +312,7 @@ 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - #elif EXTRUDERS == 2 + #elif HOTENDS == 2 #define STATUS_SCREENWIDTH 115 //Width in pixels #define STATUS_SCREENHEIGHT 19 //Height in pixels #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index fda1f53ab..3399f78bf 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -370,10 +370,10 @@ static void lcd_implementation_status_screen() { #endif // Extruders - for (int i = 0; i < EXTRUDERS; i++) _draw_heater_status(5 + i * 25, i); + for (int i = 0; i < HOTENDS; i++) _draw_heater_status(5 + i * 25, i); // Heated bed - #if EXTRUDERS < 4 && HAS_TEMP_BED + #if HOTENDS < 4 && HAS_TEMP_BED _draw_heater_status(81, -1); #endif diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 55b806140..2cfe41a9d 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 36c6fcd71..b22bf9591 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index cebc6794f..0fbcb652d 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index e2dd327e0..989d6ae27 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -129,8 +129,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -227,8 +227,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -244,8 +244,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 50e8ba28f..9a89097d9 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 1ea120af9..4f2c1fab0 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 250 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 2fe4d660c..bebd94b89 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index ada26986f..c4c0572c6 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -133,8 +133,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -231,8 +231,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -248,8 +248,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 296ecd2d6..c5e9249c4 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -243,7 +243,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 3df2b7bd0..27c70aa97 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index d153fa9dd..40910c8cb 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -#define EXTRUDER_OFFSET_X {0.0, 36.00} // (in mm) for each extruder, offset of the hotend on the X axis -#define EXTRUDER_OFFSET_Y {0.0, 0.00} // (in mm) for each extruder, offset of the hotend on the Y axis +#define HOTEND_OFFSET_X {0.0, 36.00} // (in mm) for each extruder, offset of the hotend on the X axis +#define HOTEND_OFFSET_Y {0.0, 0.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index c8a56e4bd..50d8cb51d 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 1b28aae80..736b835a4 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -151,8 +151,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -249,8 +249,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -#define EXTRUDER_WATTS (2*2/5.9) // P=U^2/R -#define BED_WATTS (5.45*5.45/2.2) // P=U^2/R +#define HOTEND_WATTS (2*2/5.9) // P=U^2/R +#define BED_WATTS (5.45*5.45/2.2) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -266,8 +266,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 20 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 257142419..f3ba7282b 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index a0197907b..4586e843f 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 16 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 7dfb96e44..5aa9487e9 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -245,7 +245,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index cdd075c83..58bb250ab 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -129,8 +129,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -227,8 +227,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -244,8 +244,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 50e8ba28f..9a89097d9 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 7a5d012d6..5cec85584 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 739af6ece..94565f1aa 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index ecfe11c39..627188d92 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 714152c72..c04ba9942 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 145c3cdee..d64dfd5f3 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index e9e5c428a..7e9d06d84 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 4e629b43e..f99318ea3 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 406edd16a..8e21082dd 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -132,8 +132,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -230,8 +230,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -247,8 +247,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 50 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index cc7d88b72..3250e88ff 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -242,7 +242,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index ab5403574..0c5efa12e 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -119,8 +119,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -217,8 +217,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -234,8 +234,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 3d90e5a65..f0ccba6a4 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 55696956d..615fec082 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 1621cbd31..d8ef5d30c 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index fc52ac4cb..4c9cbe352 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -126,8 +126,8 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. -//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis -//#define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX @@ -224,8 +224,8 @@ #define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R //=========================================================================== //============================= PID Settings ================================ @@ -241,8 +241,8 @@ //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay - //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 81db41194..af2d22f9c 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -237,7 +237,7 @@ #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position - // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. diff --git a/Marlin/pins.h b/Marlin/pins.h index 8447db61e..a9baf198c 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -243,20 +243,38 @@ #define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : (p) + 0xA0) // List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those! -#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, HEATER_0_PIN, EXTRUDER_0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN), +#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, #define _E1_PINS #define _E2_PINS #define _E3_PINS #if EXTRUDERS > 1 #undef _E1_PINS - #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN, E1_MS1_PIN, E1_MS2_PIN, EXTRUDER_1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN), + #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, #if EXTRUDERS > 2 #undef _E2_PINS - #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN, EXTRUDER_2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN), + #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, #if EXTRUDERS > 3 #undef _E3_PINS - #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, HEATER_3_PIN, EXTRUDER_3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN), + #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, + #endif + #endif +#endif + +#define _H0_PINS HEATER_0_PIN, EXTRUDER_0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN), +#define _H1_PINS +#define _H2_PINS +#define _H3_PINS + +#if HOTENDS > 1 + #undef _H1_PINS + #define _H1_PINS HEATER_1_PIN, EXTRUDER_1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN), + #if HOTENDS > 2 + #undef _H2_PINS + #define _H2_PINS HEATER_2_PIN, EXTRUDER_2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN), + #if HOTENDS > 3 + #undef _H3_PINS + #define _H3_PINS HEATER_3_PIN, EXTRUDER_3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN), #endif #endif #endif @@ -383,6 +401,7 @@ Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \ PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLERFAN_PIN, \ _E0_PINS _E1_PINS _E2_PINS _E3_PINS BED_PINS \ + _H0_PINS _H1_PINS _H2_PINS _H3_PINS \ _X2_PINS _Y2_PINS _Z2_PINS \ X_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \ } diff --git a/Marlin/pins_MEGACONTROLLER.h b/Marlin/pins_MEGACONTROLLER.h index d7d5418d3..8e423a3bc 100644 --- a/Marlin/pins_MEGACONTROLLER.h +++ b/Marlin/pins_MEGACONTROLLER.h @@ -28,7 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if EXTRUDERS > 2 +#if EXTRUDERS > 2 || HOTENDS > 2 #error "Mega Controller supports up to 2 extruders. Comment this line to keep going." #endif diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 612e8ec31..9c8caa27c 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -25,16 +25,16 @@ * * Applies to the following boards: * - * RAMPS_14_EFB (Extruder, Fan, Bed) - * RAMPS_14_EEB (Extruder, Extruder, Bed) - * RAMPS_14_EFF (Extruder, Fan, Fan) - * RAMPS_14_EEF (Extruder, Extruder, Fan) + * RAMPS_14_EFB (Hotend, Fan, Bed) + * RAMPS_14_EEB (Hotend0, Hotend1, Bed) + * RAMPS_14_EFF (Hotend, Fan0, Fan1) + * RAMPS_14_EEF (Hotend0, Hotend1, Fan) * RAMPS_14_SF (Spindle, Controller Fan) * - * RAMPS_13_EFB (Extruder, Fan, Bed) - * RAMPS_13_EEB (Extruder, Extruder, Bed) - * RAMPS_13_EFF (Extruder, Fan, Fan) - * RAMPS_13_EEF (Extruder, Extruder, Fan) + * RAMPS_13_EFB (Hotend, Fan, Bed) + * RAMPS_13_EEB (Hotend0, Hotend1, Bed) + * RAMPS_13_EFF (Hotend, Fan0, Fan1) + * RAMPS_13_EEF (Hotend0, Hotend1, Fan) * RAMPS_13_SF (Spindle, Controller Fan) * * Other pins_MYBOARD.h files may override these defaults diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h index d92f3a835..e086ec446 100644 --- a/Marlin/pins_RUMBA.h +++ b/Marlin/pins_RUMBA.h @@ -28,7 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if EXTRUDERS > 3 +#if EXTRUDERS > 3 || HOTENDS > 3 #error "RUMBA supports up to 3 extruders. Comment this line to keep going." #endif diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 02766f8be..61d9fe2e2 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -42,17 +42,17 @@ static void* heater_ttbl_map[2] = {(void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; #else - static void* heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE); - static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN); + static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE); + static uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN); #endif Temperature thermalManager; // public: -int Temperature::current_temperature_raw[EXTRUDERS] = { 0 }; -float Temperature::current_temperature[EXTRUDERS] = { 0.0 }; -int Temperature::target_temperature[EXTRUDERS] = { 0 }; +int Temperature::current_temperature_raw[HOTENDS] = { 0 }; +float Temperature::current_temperature[HOTENDS] = { 0.0 }; +int Temperature::target_temperature[HOTENDS] = { 0 }; int Temperature::current_temperature_bed_raw = 0; float Temperature::current_temperature_bed = 0.0; @@ -69,12 +69,12 @@ unsigned char Temperature::soft_pwm_bed; #endif #if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_EXTRUDER) - float Temperature::Kp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kp), - Temperature::Ki[EXTRUDERS] = ARRAY_BY_EXTRUDERS1((DEFAULT_Ki) * (PID_dT)), - Temperature::Kd[EXTRUDERS] = ARRAY_BY_EXTRUDERS1((DEFAULT_Kd) / (PID_dT)); + #if ENABLED(PID_PARAMS_PER_HOTEND) + float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp), + Temperature::Ki[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Ki) * (PID_dT)), + Temperature::Kd[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Kd) / (PID_dT)); #if ENABLED(PID_ADD_EXTRUSION_RATE) - float Temperature::Kc[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_Kc); + float Temperature::Kc[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kc); #endif #else float Temperature::Kp = DEFAULT_Kp, @@ -97,8 +97,8 @@ unsigned char Temperature::soft_pwm_bed; #endif #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 - int Temperature::watch_target_temp[EXTRUDERS] = { 0 }; - millis_t Temperature::watch_heater_next_ms[EXTRUDERS] = { 0 }; + int Temperature::watch_target_temp[HOTENDS] = { 0 }; + millis_t Temperature::watch_heater_next_ms[HOTENDS] = { 0 }; #endif #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_BED_TEMP_PERIOD > 0 @@ -120,23 +120,23 @@ unsigned char Temperature::soft_pwm_bed; volatile bool Temperature::temp_meas_ready = false; #if ENABLED(PIDTEMP) - float Temperature::temp_iState[EXTRUDERS] = { 0 }; - float Temperature::temp_dState[EXTRUDERS] = { 0 }; - float Temperature::pTerm[EXTRUDERS]; - float Temperature::iTerm[EXTRUDERS]; - float Temperature::dTerm[EXTRUDERS]; + float Temperature::temp_iState[HOTENDS] = { 0 }; + float Temperature::temp_dState[HOTENDS] = { 0 }; + float Temperature::pTerm[HOTENDS]; + float Temperature::iTerm[HOTENDS]; + float Temperature::dTerm[HOTENDS]; #if ENABLED(PID_ADD_EXTRUSION_RATE) - float Temperature::cTerm[EXTRUDERS]; - long Temperature::last_position[EXTRUDERS]; + float Temperature::cTerm[HOTENDS]; + long Temperature::last_position[HOTENDS]; long Temperature::lpq[LPQ_MAX_LEN]; int Temperature::lpq_ptr = 0; #endif - float Temperature::pid_error[EXTRUDERS]; - float Temperature::temp_iState_min[EXTRUDERS]; - float Temperature::temp_iState_max[EXTRUDERS]; - bool Temperature::pid_reset[EXTRUDERS]; + float Temperature::pid_error[HOTENDS]; + float Temperature::temp_iState_min[HOTENDS]; + float Temperature::temp_iState_max[HOTENDS]; + bool Temperature::pid_reset[HOTENDS]; #endif #if ENABLED(PIDTEMPBED) @@ -156,10 +156,10 @@ unsigned long Temperature::raw_temp_value[4] = { 0 }; unsigned long Temperature::raw_temp_bed_value = 0; // Init min and max temp with extreme values to prevent false errors during startup -int Temperature::minttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP); -int Temperature::maxttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP); -int Temperature::minttemp[EXTRUDERS] = { 0 }; -int Temperature::maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(16383); +int Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP); +int Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP); +int Temperature::minttemp[HOTENDS] = { 0 }; +int Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383); #ifdef BED_MINTEMP int Temperature::bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; @@ -177,7 +177,7 @@ int Temperature::maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(16383); millis_t Temperature::next_auto_fan_check_ms; #endif -unsigned char Temperature::soft_pwm[EXTRUDERS]; +unsigned char Temperature::soft_pwm[HOTENDS]; #if ENABLED(FAN_SOFT_PWM) unsigned char Temperature::soft_pwm_fan[FAN_COUNT]; @@ -189,7 +189,7 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; #if HAS_PID_HEATING - void Temperature::PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false*/) { + void Temperature::PID_autotune(float temp, int hotend, int ncycles, bool set_result/*=false*/) { float input = 0.0; int cycles = 0; bool heating = true; @@ -208,12 +208,12 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; if (false #if ENABLED(PIDTEMP) - || extruder >= EXTRUDERS + || hotend >= HOTENDS #else - || extruder >= 0 + || hotend >= 0 #endif #if DISABLED(PIDTEMPBED) - || extruder < 0 + || hotend < 0 #endif ) { SERIAL_ECHOLN(MSG_PID_BAD_EXTRUDER_NUM); @@ -225,12 +225,12 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; disable_all_heaters(); // switch off all heaters. #if HAS_PID_FOR_BOTH - if (extruder < 0) + if (hotend < 0) soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2; else - soft_pwm[extruder] = bias = d = (PID_MAX) / 2; + soft_pwm[hotend] = bias = d = (PID_MAX) / 2; #elif ENABLED(PIDTEMP) - soft_pwm[extruder] = bias = d = (PID_MAX) / 2; + soft_pwm[hotend] = bias = d = (PID_MAX) / 2; #else soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2; #endif @@ -245,9 +245,9 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; input = #if HAS_PID_FOR_BOTH - extruder < 0 ? current_temperature_bed : current_temperature[extruder] + hotend < 0 ? current_temperature_bed : current_temperature[hotend] #elif ENABLED(PIDTEMP) - current_temperature[extruder] + current_temperature[hotend] #else current_temperature_bed #endif @@ -267,12 +267,12 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; if (ELAPSED(ms, t2 + 5000UL)) { heating = false; #if HAS_PID_FOR_BOTH - if (extruder < 0) + if (hotend < 0) soft_pwm_bed = (bias - d) >> 1; else - soft_pwm[extruder] = (bias - d) >> 1; + soft_pwm[hotend] = (bias - d) >> 1; #elif ENABLED(PIDTEMP) - soft_pwm[extruder] = (bias - d) >> 1; + soft_pwm[hotend] = (bias - d) >> 1; #elif ENABLED(PIDTEMPBED) soft_pwm_bed = (bias - d) >> 1; #endif @@ -290,7 +290,7 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; if (cycles > 0) { long max_pow = #if HAS_PID_FOR_BOTH - extruder < 0 ? MAX_BED_POWER : PID_MAX + hotend < 0 ? MAX_BED_POWER : PID_MAX #elif ENABLED(PIDTEMP) PID_MAX #else @@ -336,12 +336,12 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; } } #if HAS_PID_FOR_BOTH - if (extruder < 0) + if (hotend < 0) soft_pwm_bed = (bias + d) >> 1; else - soft_pwm[extruder] = (bias + d) >> 1; + soft_pwm[hotend] = (bias + d) >> 1; #elif ENABLED(PIDTEMP) - soft_pwm[extruder] = (bias + d) >> 1; + soft_pwm[hotend] = (bias + d) >> 1; #else soft_pwm_bed = (bias + d) >> 1; #endif @@ -373,7 +373,7 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED); #if HAS_PID_FOR_BOTH - const char* estring = extruder < 0 ? "bed" : ""; + const char* estring = hotend < 0 ? "bed" : ""; SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kp "); SERIAL_PROTOCOLLN(workKp); SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Ki "); SERIAL_PROTOCOLLN(workKi); SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kd "); SERIAL_PROTOCOLLN(workKd); @@ -394,15 +394,15 @@ unsigned char Temperature::soft_pwm[EXTRUDERS]; updatePID() #define _SET_EXTRUDER_PID() \ - PID_PARAM(Kp, extruder) = workKp; \ - PID_PARAM(Ki, extruder) = scalePID_i(workKi); \ - PID_PARAM(Kd, extruder) = scalePID_d(workKd); \ + PID_PARAM(Kp, hotend) = workKp; \ + PID_PARAM(Ki, hotend) = scalePID_i(workKi); \ + PID_PARAM(Kd, hotend) = scalePID_d(workKd); \ updatePID() // Use the result? (As with "M303 U1") if (set_result) { #if HAS_PID_FOR_BOTH - if (extruder < 0) { + if (hotend < 0) { _SET_BED_PID(); } else { @@ -430,7 +430,7 @@ Temperature::Temperature() { } void Temperature::updatePID() { #if ENABLED(PIDTEMP) - for (int e = 0; e < EXTRUDERS; e++) { + for (int e = 0; e < HOTENDS; e++) { temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e); #if ENABLED(PID_ADD_EXTRUSION_RATE) last_position[e] = 0; @@ -459,7 +459,7 @@ int Temperature::getHeaterPower(int heater) { EXTRUDER_3_AUTO_FAN_PIN == EXTRUDER_2_AUTO_FAN_PIN ? 2 : 3 }; uint8_t fanState = 0; - for (int f = 0; f <= EXTRUDERS; f++) { + for (int f = 0; f <= HOTENDS; f++) { if (current_temperature[f] > EXTRUDER_AUTO_FAN_TEMPERATURE) SBI(fanState, fanBit[f]); } @@ -665,8 +665,8 @@ void Temperature::manage_heater() { millis_t ms = millis(); #endif - // Loop through all extruders - for (int e = 0; e < EXTRUDERS; e++) { + // Loop through all hotends + for (int e = 0; e < HOTENDS; e++) { #if ENABLED(THERMAL_PROTECTION_HOTENDS) thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); @@ -719,7 +719,7 @@ void Temperature::manage_heater() { } #endif - } // Extruders Loop + } // Hotends Loop #if HAS_AUTO_FAN if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently @@ -790,9 +790,9 @@ void Temperature::manage_heater() { // For hot end temperature measurement. float Temperature::analog2temp(int raw, uint8_t e) { #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - if (e > EXTRUDERS) + if (e > HOTENDS) #else - if (e >= EXTRUDERS) + if (e >= HOTENDS) #endif { SERIAL_ERROR_START; @@ -873,7 +873,7 @@ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(HEATER_0_USES_MAX6675) current_temperature_raw[0] = read_max6675(); #endif - for (uint8_t e = 0; e < EXTRUDERS; e++) { + for (uint8_t e = 0; e < HOTENDS; e++) { current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e); } current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw); @@ -926,8 +926,8 @@ void Temperature::init() { MCUCR = _BV(JTD); #endif - // Finish init of mult extruder arrays - for (int e = 0; e < EXTRUDERS; e++) { + // Finish init of mult hotend arrays + for (int e = 0; e < HOTENDS; e++) { // populate with the first value maxttemp[e] = maxttemp[0]; #if ENABLED(PIDTEMP) @@ -1083,30 +1083,30 @@ void Temperature::init() { #ifdef HEATER_0_MAXTEMP TEMP_MAX_ROUTINE(0); #endif - #if EXTRUDERS > 1 + #if HOTENDS > 1 #ifdef HEATER_1_MINTEMP TEMP_MIN_ROUTINE(1); #endif #ifdef HEATER_1_MAXTEMP TEMP_MAX_ROUTINE(1); #endif - #if EXTRUDERS > 2 + #if HOTENDS > 2 #ifdef HEATER_2_MINTEMP TEMP_MIN_ROUTINE(2); #endif #ifdef HEATER_2_MAXTEMP TEMP_MAX_ROUTINE(2); #endif - #if EXTRUDERS > 3 + #if HOTENDS > 3 #ifdef HEATER_3_MINTEMP TEMP_MIN_ROUTINE(3); #endif #ifdef HEATER_3_MAXTEMP TEMP_MAX_ROUTINE(3); #endif - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { @@ -1163,8 +1163,8 @@ void Temperature::init() { #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED #if ENABLED(THERMAL_PROTECTION_HOTENDS) - Temperature::TRState Temperature::thermal_runaway_state_machine[EXTRUDERS] = { TRInactive }; - millis_t Temperature::thermal_runaway_timer[EXTRUDERS] = { 0 }; + Temperature::TRState Temperature::thermal_runaway_state_machine[HOTENDS] = { TRInactive }; + millis_t Temperature::thermal_runaway_timer[HOTENDS] = { 0 }; #endif #if HAS_THERMALLY_PROTECTED_BED @@ -1174,7 +1174,7 @@ void Temperature::init() { void Temperature::thermal_runaway_protection(Temperature::TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { - static float tr_target_temperature[EXTRUDERS + 1] = { 0.0 }; + static float tr_target_temperature[HOTENDS + 1] = { 0.0 }; /** SERIAL_ECHO_START; @@ -1187,7 +1187,7 @@ void Temperature::init() { SERIAL_EOL; */ - int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS; + int heater_index = heater_id >= 0 ? heater_id : HOTENDS; // If the target temperature changes, restart if (tr_target_temperature[heater_index] != target_temperature) { @@ -1218,7 +1218,7 @@ void Temperature::init() { #endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED void Temperature::disable_all_heaters() { - for (int i = 0; i < EXTRUDERS; i++) setTargetHotend(0, i); + for (int i = 0; i < HOTENDS; i++) setTargetHotend(0, i); setTargetBed(0); // If all heaters go down then for sure our print job has stopped @@ -1236,15 +1236,15 @@ void Temperature::disable_all_heaters() { WRITE_HEATER_0P(LOW); // Should HEATERS_PARALLEL apply here? Then change to DISABLE_HEATER(0) #endif - #if EXTRUDERS > 1 && HAS_TEMP_1 + #if HOTENDS > 1 && HAS_TEMP_1 DISABLE_HEATER(1); #endif - #if EXTRUDERS > 2 && HAS_TEMP_2 + #if HOTENDS > 2 && HAS_TEMP_2 DISABLE_HEATER(2); #endif - #if EXTRUDERS > 3 && HAS_TEMP_3 + #if HOTENDS > 3 && HAS_TEMP_3 DISABLE_HEATER(3); #endif @@ -1390,11 +1390,11 @@ void Temperature::isr() { // Statics per heater ISR_STATICS(0); - #if (EXTRUDERS > 1) || ENABLED(HEATERS_PARALLEL) + #if (HOTENDS > 1) || ENABLED(HEATERS_PARALLEL) ISR_STATICS(1); - #if EXTRUDERS > 2 + #if HOTENDS > 2 ISR_STATICS(2); - #if EXTRUDERS > 3 + #if HOTENDS > 3 ISR_STATICS(3); #endif #endif @@ -1418,13 +1418,13 @@ void Temperature::isr() { } else WRITE_HEATER_0P(0); // If HEATERS_PARALLEL should apply, change to WRITE_HEATER_0 - #if EXTRUDERS > 1 + #if HOTENDS > 1 soft_pwm_1 = soft_pwm[1]; WRITE_HEATER_1(soft_pwm_1 > 0 ? 1 : 0); - #if EXTRUDERS > 2 + #if HOTENDS > 2 soft_pwm_2 = soft_pwm[2]; WRITE_HEATER_2(soft_pwm_2 > 0 ? 1 : 0); - #if EXTRUDERS > 3 + #if HOTENDS > 3 soft_pwm_3 = soft_pwm[3]; WRITE_HEATER_3(soft_pwm_3 > 0 ? 1 : 0); #endif @@ -1453,11 +1453,11 @@ void Temperature::isr() { } if (soft_pwm_0 < pwm_count) WRITE_HEATER_0(0); - #if EXTRUDERS > 1 + #if HOTENDS > 1 if (soft_pwm_1 < pwm_count) WRITE_HEATER_1(0); - #if EXTRUDERS > 2 + #if HOTENDS > 2 if (soft_pwm_2 < pwm_count) WRITE_HEATER_2(0); - #if EXTRUDERS > 3 + #if HOTENDS > 3 if (soft_pwm_3 < pwm_count) WRITE_HEATER_3(0); #endif #endif @@ -1524,11 +1524,11 @@ void Temperature::isr() { if (slow_pwm_count == 0) { SLOW_PWM_ROUTINE(0); // EXTRUDER 0 - #if EXTRUDERS > 1 + #if HOTENDS > 1 SLOW_PWM_ROUTINE(1); // EXTRUDER 1 - #if EXTRUDERS > 2 + #if HOTENDS > 2 SLOW_PWM_ROUTINE(2); // EXTRUDER 2 - #if EXTRUDERS > 3 + #if HOTENDS > 3 SLOW_PWM_ROUTINE(3); // EXTRUDER 3 #endif #endif @@ -1540,11 +1540,11 @@ void Temperature::isr() { } // slow_pwm_count == 0 PWM_OFF_ROUTINE(0); // EXTRUDER 0 - #if EXTRUDERS > 1 + #if HOTENDS > 1 PWM_OFF_ROUTINE(1); // EXTRUDER 1 - #if EXTRUDERS > 2 + #if HOTENDS > 2 PWM_OFF_ROUTINE(2); // EXTRUDER 2 - #if EXTRUDERS > 3 + #if HOTENDS > 3 PWM_OFF_ROUTINE(3); // EXTRUDER 3 #endif #endif @@ -1589,11 +1589,11 @@ void Temperature::isr() { // EXTRUDER 0 if (state_timer_heater_0 > 0) state_timer_heater_0--; - #if EXTRUDERS > 1 // EXTRUDER 1 + #if HOTENDS > 1 // EXTRUDER 1 if (state_timer_heater_1 > 0) state_timer_heater_1--; - #if EXTRUDERS > 2 // EXTRUDER 2 + #if HOTENDS > 2 // EXTRUDER 2 if (state_timer_heater_2 > 0) state_timer_heater_2--; - #if EXTRUDERS > 3 // EXTRUDER 3 + #if HOTENDS > 3 // EXTRUDER 3 if (state_timer_heater_3 > 0) state_timer_heater_3--; #endif #endif @@ -1736,7 +1736,7 @@ void Temperature::isr() { if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); #endif - #if HAS_TEMP_1 && EXTRUDERS > 1 + #if HAS_TEMP_1 && HOTENDS > 1 #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP #define GE1 <= #else @@ -1746,7 +1746,7 @@ void Temperature::isr() { if (minttemp_raw[1] GE1 current_temperature_raw[1]) min_temp_error(1); #endif // TEMP_SENSOR_1 - #if HAS_TEMP_2 && EXTRUDERS > 2 + #if HAS_TEMP_2 && HOTENDS > 2 #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP #define GE2 <= #else @@ -1756,7 +1756,7 @@ void Temperature::isr() { if (minttemp_raw[2] GE2 current_temperature_raw[2]) min_temp_error(2); #endif // TEMP_SENSOR_2 - #if HAS_TEMP_3 && EXTRUDERS > 3 + #if HAS_TEMP_3 && HOTENDS > 3 #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP #define GE3 <= #else diff --git a/Marlin/temperature.h b/Marlin/temperature.h index cb5710757..9cb990988 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -42,9 +42,9 @@ class Temperature { public: - static int current_temperature_raw[EXTRUDERS]; - static float current_temperature[EXTRUDERS]; - static int target_temperature[EXTRUDERS]; + static int current_temperature_raw[HOTENDS]; + static float current_temperature[HOTENDS]; + static int target_temperature[HOTENDS]; static int current_temperature_bed_raw; static float current_temperature_bed; @@ -66,11 +66,11 @@ class Temperature { #if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_EXTRUDER) + #if ENABLED(PID_PARAMS_PER_HOTEND) - static float Kp[EXTRUDERS], Ki[EXTRUDERS], Kd[EXTRUDERS]; + static float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS]; #if ENABLED(PID_ADD_EXTRUSION_RATE) - static float Kc[EXTRUDERS]; + static float Kc[HOTENDS]; #endif #define PID_PARAM(param, e) Temperature::param[e] @@ -82,7 +82,7 @@ class Temperature { #endif #define PID_PARAM(param, e) Temperature::param - #endif // PID_PARAMS_PER_EXTRUDER + #endif // PID_PARAMS_PER_HOTEND // Apply the scale factors to the PID values #define scalePID_i(i) ( (i) * PID_dT ) @@ -101,8 +101,8 @@ class Temperature { #endif #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 - static int watch_target_temp[EXTRUDERS]; - static millis_t watch_heater_next_ms[EXTRUDERS]; + static int watch_target_temp[HOTENDS]; + static millis_t watch_heater_next_ms[HOTENDS]; #endif #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_BED_TEMP_PERIOD > 0 @@ -127,23 +127,23 @@ class Temperature { static volatile bool temp_meas_ready; #if ENABLED(PIDTEMP) - static float temp_iState[EXTRUDERS]; - static float temp_dState[EXTRUDERS]; - static float pTerm[EXTRUDERS]; - static float iTerm[EXTRUDERS]; - static float dTerm[EXTRUDERS]; + static float temp_iState[HOTENDS]; + static float temp_dState[HOTENDS]; + static float pTerm[HOTENDS]; + static float iTerm[HOTENDS]; + static float dTerm[HOTENDS]; #if ENABLED(PID_ADD_EXTRUSION_RATE) - static float cTerm[EXTRUDERS]; - static long last_position[EXTRUDERS]; + static float cTerm[HOTENDS]; + static long last_position[HOTENDS]; static long lpq[LPQ_MAX_LEN]; static int lpq_ptr; #endif - static float pid_error[EXTRUDERS]; - static float temp_iState_min[EXTRUDERS]; - static float temp_iState_max[EXTRUDERS]; - static bool pid_reset[EXTRUDERS]; + static float pid_error[HOTENDS]; + static float temp_iState_min[HOTENDS]; + static float temp_iState_max[HOTENDS]; + static bool pid_reset[HOTENDS]; #endif #if ENABLED(PIDTEMPBED) @@ -163,10 +163,10 @@ class Temperature { static unsigned long raw_temp_bed_value; // Init min and max temp with extreme values to prevent false errors during startup - static int minttemp_raw[EXTRUDERS]; - static int maxttemp_raw[EXTRUDERS]; - static int minttemp[EXTRUDERS]; - static int maxttemp[EXTRUDERS]; + static int minttemp_raw[HOTENDS]; + static int maxttemp_raw[HOTENDS]; + static int minttemp[HOTENDS]; + static int maxttemp[HOTENDS]; #ifdef BED_MINTEMP static int bed_minttemp_raw; @@ -184,7 +184,7 @@ class Temperature { static millis_t next_auto_fan_check_ms; #endif - static unsigned char soft_pwm[EXTRUDERS]; + static unsigned char soft_pwm[HOTENDS]; #if ENABLED(FAN_SOFT_PWM) static unsigned char soft_pwm_fan[FAN_COUNT]; @@ -230,15 +230,36 @@ class Temperature { //inline so that there is no performance decrease. //deg=degreeCelsius - static float degHotend(uint8_t extruder) { return current_temperature[extruder]; } + #if HOTENDS == 1 + #define HOTEND_ARG 0 + #else + #define HOTEND_ARG hotend + #endif + + static float degHotend(uint8_t hotend) { + #if HOTENDS == 1 + UNUSED(hotend); + #endif + return current_temperature[HOTEND_ARG]; + } static float degBed() { return current_temperature_bed; } #if ENABLED(SHOW_TEMP_ADC_VALUES) - static float rawHotendTemp(uint8_t extruder) { return current_temperature_raw[extruder]; } + static float rawHotendTemp(uint8_t hotend) { + #if HOTENDS == 1 + UNUSED(hotend); + #endif + return current_temperature_raw[HOTEND_ARG]; + } static float rawBedTemp() { return current_temperature_bed_raw; } #endif - static float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; } + static float degTargetHotend(uint8_t hotend) { + #if HOTENDS == 1 + UNUSED(hotend); + #endif + return target_temperature[HOTEND_ARG]; + } static float degTargetBed() { return target_temperature_bed; } #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 @@ -249,10 +270,13 @@ class Temperature { static void start_watching_bed(); #endif - static void setTargetHotend(const float& celsius, uint8_t extruder) { - target_temperature[extruder] = celsius; + static void setTargetHotend(const float& celsius, uint8_t hotend) { + #if HOTENDS == 1 + UNUSED(hotend); + #endif + target_temperature[HOTEND_ARG] = celsius; #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 - start_watching_heater(extruder); + start_watching_heater(HOTEND_ARG); #endif } @@ -263,10 +287,20 @@ class Temperature { #endif } - static bool isHeatingHotend(uint8_t extruder) { return target_temperature[extruder] > current_temperature[extruder]; } + static bool isHeatingHotend(uint8_t hotend) { + #if HOTENDS == 1 + UNUSED(hotend); + #endif + return target_temperature[HOTEND_ARG] > current_temperature[HOTEND_ARG]; + } static bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; } - static bool isCoolingHotend(uint8_t extruder) { return target_temperature[extruder] < current_temperature[extruder]; } + static bool isCoolingHotend(uint8_t hotend) { + #if HOTENDS == 1 + UNUSED(hotend); + #endif + return target_temperature[HOTEND_ARG] < current_temperature[HOTEND_ARG]; + } static bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } /** @@ -283,7 +317,7 @@ class Temperature { * Perform auto-tuning for hotend or bed in response to M303 */ #if HAS_PID_HEATING - static void PID_autotune(float temp, int extruder, int ncycles, bool set_result=false); + static void PID_autotune(float temp, int hotend, int ncycles, bool set_result=false); #endif /** @@ -362,8 +396,8 @@ class Temperature { static void thermal_runaway_protection(TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc); #if ENABLED(THERMAL_PROTECTION_HOTENDS) - static TRState thermal_runaway_state_machine[EXTRUDERS]; - static millis_t thermal_runaway_timer[EXTRUDERS]; + static TRState thermal_runaway_state_machine[HOTENDS]; + static millis_t thermal_runaway_timer[HOTENDS]; #endif #if HAS_THERMALLY_PROTECTED_BED diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 94a1e3f75..cb5f6d68a 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -593,28 +593,28 @@ void lcd_set_home_offsets() { #if TEMP_SENSOR_0 != 0 void watch_temp_callback_E0() { thermalManager.start_watching_heater(0); } #endif - #if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0 + #if HOTENDS > 1 && TEMP_SENSOR_1 != 0 void watch_temp_callback_E1() { thermalManager.start_watching_heater(1); } - #endif // EXTRUDERS > 1 - #if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0 + #endif // HOTENDS > 1 + #if HOTENDS > 2 && TEMP_SENSOR_2 != 0 void watch_temp_callback_E2() { thermalManager.start_watching_heater(2); } - #endif // EXTRUDERS > 2 - #if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0 + #endif // HOTENDS > 2 + #if HOTENDS > 3 && TEMP_SENSOR_3 != 0 void watch_temp_callback_E3() { thermalManager.start_watching_heater(3); } - #endif // EXTRUDERS > 3 + #endif // HOTENDS > 3 #else #if TEMP_SENSOR_0 != 0 void watch_temp_callback_E0() {} #endif - #if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0 + #if HOTENDS > 1 && TEMP_SENSOR_1 != 0 void watch_temp_callback_E1() {} - #endif // EXTRUDERS > 1 - #if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0 + #endif // HOTENDS > 1 + #if HOTENDS > 2 && TEMP_SENSOR_2 != 0 void watch_temp_callback_E2() {} - #endif // EXTRUDERS > 2 - #if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0 + #endif // HOTENDS > 2 + #if HOTENDS > 3 && TEMP_SENSOR_3 != 0 void watch_temp_callback_E3() {} - #endif // EXTRUDERS > 3 + #endif // HOTENDS > 3 #endif #if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0 @@ -654,28 +654,28 @@ static void lcd_tune_menu() { // Nozzle: // Nozzle [1-4]: // - #if EXTRUDERS == 1 + #if HOTENDS == 1 #if TEMP_SENSOR_0 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); #endif - #else //EXTRUDERS > 1 + #else //HOTENDS > 1 #if TEMP_SENSOR_0 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); #endif #if TEMP_SENSOR_1 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); #endif - #if EXTRUDERS > 2 + #if HOTENDS > 2 #if TEMP_SENSOR_2 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); #endif - #if EXTRUDERS > 3 + #if HOTENDS > 3 #if TEMP_SENSOR_3 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); #endif - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 // // Bed: @@ -777,24 +777,24 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } #endif -#if EXTRUDERS > 1 +#if HOTENDS > 1 void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } - #if EXTRUDERS > 2 + #if HOTENDS > 2 void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } - #if EXTRUDERS > 3 + #if HOTENDS > 3 void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } #endif #endif void lcd_preheat_pla0123() { - #if EXTRUDERS > 1 + #if HOTENDS > 1 thermalManager.setTargetHotend(plaPreheatHotendTemp, 1); - #if EXTRUDERS > 2 + #if HOTENDS > 2 thermalManager.setTargetHotend(plaPreheatHotendTemp, 2); - #if EXTRUDERS > 3 + #if HOTENDS > 3 thermalManager.setTargetHotend(plaPreheatHotendTemp, 3); #endif #endif @@ -802,11 +802,11 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa lcd_preheat_pla0(); } void lcd_preheat_abs0123() { - #if EXTRUDERS > 1 + #if HOTENDS > 1 thermalManager.setTargetHotend(absPreheatHotendTemp, 1); - #if EXTRUDERS > 2 + #if HOTENDS > 2 thermalManager.setTargetHotend(absPreheatHotendTemp, 2); - #if EXTRUDERS > 3 + #if HOTENDS > 3 thermalManager.setTargetHotend(absPreheatHotendTemp, 3); #endif #endif @@ -814,7 +814,7 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa lcd_preheat_abs0(); } -#endif // EXTRUDERS > 1 +#endif // HOTENDS > 1 #if TEMP_SENSOR_BED != 0 void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); } @@ -826,14 +826,14 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa static void lcd_preheat_pla_menu() { START_MENU(); MENU_ITEM(back, MSG_PREPARE); - #if EXTRUDERS == 1 + #if HOTENDS == 1 MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0); #else MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0); MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1); - #if EXTRUDERS > 2 + #if HOTENDS > 2 MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2); - #if EXTRUDERS > 3 + #if HOTENDS > 3 MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3); #endif #endif @@ -848,14 +848,14 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa static void lcd_preheat_abs_menu() { START_MENU(); MENU_ITEM(back, MSG_PREPARE); - #if EXTRUDERS == 1 + #if HOTENDS == 1 MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0); #else MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0); MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1); - #if EXTRUDERS > 2 + #if HOTENDS > 2 MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2); - #if EXTRUDERS > 3 + #if HOTENDS > 3 MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3); #endif #endif @@ -1380,8 +1380,8 @@ static void lcd_control_menu() { #if ENABLED(PID_AUTOTUNE_MENU) #if ENABLED(PIDTEMP) - int autotune_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(150); - const int heater_maxtemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP); + int autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); + const int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP); #endif #if ENABLED(PIDTEMPBED) @@ -1409,14 +1409,14 @@ static void lcd_control_menu() { // Helpers for editing PID Ki & Kd values // grab the PID value out of the temp variable; scale it; then update the PID driver void copy_and_scalePID_i(int e) { - #if DISABLED(PID_PARAMS_PER_EXTRUDER) + #if DISABLED(PID_PARAMS_PER_HOTEND) UNUSED(e); #endif PID_PARAM(Ki, e) = scalePID_i(raw_Ki); thermalManager.updatePID(); } void copy_and_scalePID_d(int e) { - #if DISABLED(PID_PARAMS_PER_EXTRUDER) + #if DISABLED(PID_PARAMS_PER_HOTEND) UNUSED(e); #endif PID_PARAM(Kd, e) = scalePID_d(raw_Kd); @@ -1435,17 +1435,17 @@ static void lcd_control_menu() { #endif _PIDTEMP_FUNCTIONS(0); - #if ENABLED(PID_PARAMS_PER_EXTRUDER) - #if EXTRUDERS > 1 + #if ENABLED(PID_PARAMS_PER_HOTEND) + #if HOTENDS > 1 _PIDTEMP_FUNCTIONS(1); - #if EXTRUDERS > 2 + #if HOTENDS > 2 _PIDTEMP_FUNCTIONS(2); - #if EXTRUDERS > 3 + #if HOTENDS > 3 _PIDTEMP_FUNCTIONS(3); - #endif //EXTRUDERS > 3 - #endif //EXTRUDERS > 2 - #endif //EXTRUDERS > 1 - #endif //PID_PARAMS_PER_EXTRUDER + #endif //HOTENDS > 3 + #endif //HOTENDS > 2 + #endif //HOTENDS > 1 + #endif //PID_PARAMS_PER_HOTEND #endif //PIDTEMP @@ -1466,28 +1466,28 @@ static void lcd_control_temperature_menu() { // Nozzle: // Nozzle [1-4]: // - #if EXTRUDERS == 1 + #if HOTENDS == 1 #if TEMP_SENSOR_0 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); #endif - #else //EXTRUDERS > 1 + #else //HOTENDS > 1 #if TEMP_SENSOR_0 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); #endif #if TEMP_SENSOR_1 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); #endif - #if EXTRUDERS > 2 + #if HOTENDS > 2 #if TEMP_SENSOR_2 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); #endif - #if EXTRUDERS > 3 + #if HOTENDS > 3 #if TEMP_SENSOR_3 != 0 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); #endif - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 // // Bed: @@ -1558,18 +1558,18 @@ static void lcd_control_temperature_menu() { #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex) #endif - #if ENABLED(PID_PARAMS_PER_EXTRUDER) && EXTRUDERS > 1 + #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 PID_MENU_ITEMS(MSG_E1, 0); PID_MENU_ITEMS(MSG_E2, 1); - #if EXTRUDERS > 2 + #if HOTENDS > 2 PID_MENU_ITEMS(MSG_E3, 2); - #if EXTRUDERS > 3 + #if HOTENDS > 3 PID_MENU_ITEMS(MSG_E4, 3); - #endif //EXTRUDERS > 3 - #endif //EXTRUDERS > 2 - #else //!PID_PARAMS_PER_EXTRUDER || EXTRUDERS == 1 + #endif //HOTENDS > 3 + #endif //HOTENDS > 2 + #else //!PID_PARAMS_PER_HOTEND || HOTENDS == 1 PID_MENU_ITEMS("", 0); - #endif //!PID_PARAMS_PER_EXTRUDER || EXTRUDERS == 1 + #endif //!PID_PARAMS_PER_HOTEND || HOTENDS == 1 #endif //PIDTEMP diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 05afe59a3..61e9a62ee 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -638,10 +638,10 @@ static void lcd_implementation_status_screen() { // // Hotend 1 or Bed Temperature // - #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + #if HOTENDS > 1 || TEMP_SENSOR_BED != 0 lcd.setCursor(8, 0); - #if EXTRUDERS > 1 + #if HOTENDS > 1 lcd.print(LCD_STR_THERMOMETER[0]); LCD_TEMP_ONLY(thermalManager.degHotend(1), thermalManager.degTargetHotend(1)); #else @@ -649,7 +649,7 @@ static void lcd_implementation_status_screen() { LCD_TEMP_ONLY(thermalManager.degBed(), thermalManager.degTargetBed()); #endif - #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0 #else // LCD_WIDTH >= 20 @@ -661,15 +661,15 @@ static void lcd_implementation_status_screen() { // // Hotend 1 or Bed Temperature // - #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + #if HOTENDS > 1 || TEMP_SENSOR_BED != 0 lcd.setCursor(10, 0); - #if EXTRUDERS > 1 + #if HOTENDS > 1 LCD_TEMP(thermalManager.degHotend(1), thermalManager.degTargetHotend(1), LCD_STR_THERMOMETER[0]); #else LCD_TEMP(thermalManager.degBed(), thermalManager.degTargetBed(), LCD_STR_BEDTEMP[0]); #endif - #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0 #endif // LCD_WIDTH >= 20 @@ -697,7 +697,7 @@ static void lcd_implementation_status_screen() { lcd.setCursor(0, 1); - #if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0 + #if HOTENDS > 1 && TEMP_SENSOR_BED != 0 // If we both have a 2nd extruder and a heated bed, // show the heated bed temp on the left, @@ -717,7 +717,7 @@ static void lcd_implementation_status_screen() { _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink); lcd.print(ftostr4sign(current_position[Y_AXIS])); - #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 + #endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0 #endif // LCD_WIDTH >= 20 @@ -943,7 +943,7 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) { ) leds |= LED_C; #endif // FAN_COUNT > 0 - #if EXTRUDERS > 1 + #if HOTENDS > 1 if (thermalManager.degTargetHotend(1) > 0) leds |= LED_C; #endif From f2fb66c00dc187cba5f1bc44d90d41f473fad0c8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 May 2016 00:42:26 -0700 Subject: [PATCH 014/580] With SINGLENOZZLE only set temperature for the active tool --- Marlin/Marlin_main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9e40335c0..f3ccbbe26 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4362,6 +4362,10 @@ inline void gcode_M104() { if (get_target_extruder_from_command(104)) return; if (DEBUGGING(DRYRUN)) return; + #if ENABLED(SINGLENOZZLE) + if (target_extruder != active_extruder) return; + #endif + if (code_seen('S')) { float temp = code_value(); thermalManager.setTargetHotend(temp, target_extruder); @@ -4516,6 +4520,10 @@ inline void gcode_M109() { if (get_target_extruder_from_command(109)) return; if (DEBUGGING(DRYRUN)) return; + #if ENABLED(SINGLENOZZLE) + if (target_extruder != active_extruder) return; + #endif + bool no_wait_for_cooling = code_seen('S'); if (no_wait_for_cooling || code_seen('R')) { float temp = code_value(); From c06de0f0977a6455ef25d7d3e48ab16eff5b0cdb Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Tue, 24 May 2016 22:53:15 +0200 Subject: [PATCH 015/580] MBL: Added keeping MBL active when homing single axises for #3750 --- Marlin/Marlin_main.cpp | 86 ++++++++++++++++++++++++---------- Marlin/configuration_store.cpp | 13 ++--- Marlin/mesh_bed_leveling.cpp | 2 +- Marlin/mesh_bed_leveling.h | 7 ++- Marlin/planner.cpp | 6 ++- Marlin/ultralcd.cpp | 2 +- 6 files changed, 81 insertions(+), 35 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d109055e7..5c1769a37 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2644,8 +2644,16 @@ inline void gcode_G28() { * on again when homing all axis */ #if ENABLED(MESH_BED_LEVELING) - uint8_t mbl_was_active = mbl.active; - mbl.active = false; + float pre_home_z = MESH_HOME_SEARCH_Z; + if (mbl.is_active()) { + // Save known Z position if already homed + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) { + pre_home_z = current_position[Z_AXIS]; + pre_home_z += mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], + current_position[Y_AXIS] - home_offset[Y_AXIS]); + } + mbl.is_active(false); + } #endif setup_for_endstop_move(); @@ -2945,20 +2953,31 @@ inline void gcode_G28() { // Enable mesh leveling again #if ENABLED(MESH_BED_LEVELING) - if (mbl_was_active && home_all_axis) { - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - sync_plan_position(); - mbl.active = 1; - #if ENABLED(MESH_G28_REST_ORIGIN) - current_position[Z_AXIS] = 0.0; - set_destination_to_current(); - feedrate = homing_feedrate[Z_AXIS]; - line_to_destination(); - stepper.synchronize(); - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("mbl_was_active", current_position); - #endif + if (mbl.has_mesh()) { + if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) { + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + sync_plan_position(); + mbl.is_active(true); + #if ENABLED(MESH_G28_REST_ORIGIN) + current_position[Z_AXIS] = 0.0; + set_destination_to_current(); + feedrate = homing_feedrate[Z_AXIS]; + line_to_destination(); + stepper.synchronize(); + #else + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - + mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], + current_position[Y_AXIS] - home_offset[Y_AXIS]); + #endif + } + else if ((axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) && (homeX || homeY)) { + current_position[Z_AXIS] = pre_home_z; + sync_plan_position(); + mbl.is_active(true); + current_position[Z_AXIS] = pre_home_z - + mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], + current_position[Y_AXIS] - home_offset[Y_AXIS]); + } } #endif @@ -2978,7 +2997,7 @@ inline void gcode_G28() { #if ENABLED(MESH_BED_LEVELING) - enum MeshLevelingState { MeshReport, MeshStart, MeshNext, MeshSet, MeshSetZOffset }; + enum MeshLevelingState { MeshReport, MeshStart, MeshNext, MeshSet, MeshSetZOffset, MeshReset }; inline void _mbl_goto_xy(float x, float y) { saved_feedrate = feedrate; @@ -3015,6 +3034,7 @@ inline void gcode_G28() { * S2 Probe the next mesh point * S3 Xn Yn Zn.nn Manually modify a single point * S4 Zn.nn Set z offset. Positive away from bed, negative closer to bed. + * S5 Reset and disable mesh * * The S0 report the points as below * @@ -3028,8 +3048,8 @@ inline void gcode_G28() { static int probe_point = -1; MeshLevelingState state = code_seen('S') ? (MeshLevelingState)code_value_short() : MeshReport; - if (state < 0 || state > 4) { - SERIAL_PROTOCOLLNPGM("S out of range (0-4)."); + if (state < 0 || state > 5) { + SERIAL_PROTOCOLLNPGM("S out of range (0-5)."); return; } @@ -3038,8 +3058,13 @@ inline void gcode_G28() { switch (state) { case MeshReport: - if (mbl.active) { - SERIAL_PROTOCOLPGM("Num X,Y: "); + if (mbl.has_mesh()) { + SERIAL_PROTOCOLPGM("State: "); + if (mbl.is_active()) + SERIAL_PROTOCOLPGM("On"); + else + SERIAL_PROTOCOLPGM("Off"); + SERIAL_PROTOCOLPGM("\nNum X,Y: "); SERIAL_PROTOCOL(MESH_NUM_X_POINTS); SERIAL_PROTOCOLCHAR(','); SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); @@ -3100,7 +3125,7 @@ inline void gcode_G28() { // After recording the last point, activate the mbl and home SERIAL_PROTOCOLLNPGM("Mesh probing done."); probe_point = -1; - mbl.active = true; + mbl.has_mesh(true); enqueue_and_echo_commands_P(PSTR("G28")); } break; @@ -3147,6 +3172,19 @@ inline void gcode_G28() { return; } mbl.z_offset = z; + break; + + case MeshReset: + if (mbl.is_active()) { + current_position[Z_AXIS] += + mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], + current_position[Y_AXIS] - home_offset[Y_AXIS]) - MESH_HOME_SEARCH_Z; + mbl.reset(); + sync_plan_position(); + } + else + mbl.reset(); + } // switch(state) report_current_position(); @@ -5944,7 +5982,7 @@ inline void gcode_M410() { /** * M420: Enable/Disable Mesh Bed Leveling */ - inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.active = !!code_value_short(); } + inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.has_mesh(!!code_value_short()); } /** * M421: Set a single Mesh Bed Leveling Z coordinate @@ -7335,7 +7373,7 @@ void clamp_to_software_endstops(float target[3]) { // This function is used to split lines on mesh borders so each segment is only part of one mesh area void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { - if (!mbl.active) { + if (!mbl.is_active()) { planner.buffer_line(x, y, z, e, feed_rate, extruder); set_current_to_destination(); return; diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 001955f6e..fa5e14810 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -58,7 +58,7 @@ * 188 M206 XYZ home_offset (float x3) * * Mesh bed leveling: - * 200 M420 S active (bool) + * 200 M420 S status (0 = empty, 1 = has mesh numbers) * 201 z_offset (float) (added in V23) * 205 mesh_num_x (uint8 as set in firmware) * 206 mesh_num_y (uint8 as set in firmware) @@ -187,6 +187,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, planner.max_e_jerk); EEPROM_WRITE_VAR(i, home_offset); + uint8_t dummy_uint8 = 0; uint8_t mesh_num_x = 3; uint8_t mesh_num_y = 3; #if ENABLED(MESH_BED_LEVELING) @@ -194,13 +195,13 @@ void Config_StoreSettings() { typedef char c_assert[(sizeof(mbl.z_values) == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) * sizeof(dummy)) ? 1 : -1]; mesh_num_x = MESH_NUM_X_POINTS; mesh_num_y = MESH_NUM_Y_POINTS; - EEPROM_WRITE_VAR(i, mbl.active); + dummy_uint8 = mbl.status & 0x01; // Do not save 'is active' + EEPROM_WRITE_VAR(i, dummy_uint8); EEPROM_WRITE_VAR(i, mbl.z_offset); EEPROM_WRITE_VAR(i, mesh_num_x); EEPROM_WRITE_VAR(i, mesh_num_y); EEPROM_WRITE_VAR(i, mbl.z_values); #else - uint8_t dummy_uint8 = 0; dummy = 0.0f; EEPROM_WRITE_VAR(i, dummy_uint8); EEPROM_WRITE_VAR(i, dummy); @@ -376,7 +377,7 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, mesh_num_x); EEPROM_READ_VAR(i, mesh_num_y); #if ENABLED(MESH_BED_LEVELING) - mbl.active = dummy_uint8; + mbl.status = dummy_uint8; mbl.z_offset = dummy; if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) { EEPROM_READ_VAR(i, mbl.z_values); @@ -550,7 +551,7 @@ void Config_ResetDefault() { home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0; #if ENABLED(MESH_BED_LEVELING) - mbl.active = false; + mbl.reset(); #endif #if ENABLED(AUTO_BED_LEVELING_FEATURE) @@ -729,7 +730,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Mesh bed leveling:"); CONFIG_ECHO_START; } - SERIAL_ECHOPAIR(" M420 S", mbl.active); + SERIAL_ECHOPAIR(" M420 S", mbl.has_mesh() ? 1 : 0); SERIAL_ECHOPAIR(" X", MESH_NUM_X_POINTS); SERIAL_ECHOPAIR(" Y", MESH_NUM_Y_POINTS); SERIAL_EOL; diff --git a/Marlin/mesh_bed_leveling.cpp b/Marlin/mesh_bed_leveling.cpp index ee70068a1..44db8bc47 100644 --- a/Marlin/mesh_bed_leveling.cpp +++ b/Marlin/mesh_bed_leveling.cpp @@ -29,7 +29,7 @@ mesh_bed_leveling::mesh_bed_leveling() { reset(); } void mesh_bed_leveling::reset() { - active = 0; + status = 0; z_offset = 0; for (int8_t y = MESH_NUM_Y_POINTS; y--;) for (int8_t x = MESH_NUM_X_POINTS; x--;) diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h index 7b2201fb9..267ce700f 100644 --- a/Marlin/mesh_bed_leveling.h +++ b/Marlin/mesh_bed_leveling.h @@ -29,7 +29,7 @@ class mesh_bed_leveling { public: - bool active; + uint8_t status; // Bit 0 = has mesh numbers, Bit 1 = compensation active float z_offset; float z_values[MESH_NUM_Y_POINTS][MESH_NUM_X_POINTS]; @@ -41,6 +41,11 @@ static FORCE_INLINE float get_probe_y(int8_t i) { return MESH_MIN_Y + (MESH_Y_DIST) * i; } void set_z(const int8_t px, const int8_t py, const float z) { z_values[py][px] = z; } + bool has_mesh() { return TEST(status, 0); } + void has_mesh(bool onOff) { if (onOff) SBI(status, 0); else CBI(status, 0); } + bool is_active() { return TEST(status, 1); } + void is_active(bool onOff) { if (onOff) SBI(status, 1); else CBI(status, 1); } + inline void zigzag(int8_t index, int8_t &px, int8_t &py) { px = index % (MESH_NUM_X_POINTS); py = index / (MESH_NUM_X_POINTS); diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d38f2d367..87145b50a 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -539,7 +539,8 @@ void Planner::check_axes_activity() { while (block_buffer_tail == next_buffer_head) idle(); #if ENABLED(MESH_BED_LEVELING) - if (mbl.active) z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]); + if (mbl.is_active()) + z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]); #elif ENABLED(AUTO_BED_LEVELING_FEATURE) apply_rotation_xyz(bed_level_matrix, x, y, z); #endif @@ -1120,7 +1121,8 @@ void Planner::check_axes_activity() { #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING { #if ENABLED(MESH_BED_LEVELING) - if (mbl.active) z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]); + if (mbl.is_active()) + z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]); #elif ENABLED(AUTO_BED_LEVELING_FEATURE) apply_rotation_xyz(bed_level_matrix, x, y, z); #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 94a1e3f75..4a36b6f8e 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -970,7 +970,7 @@ void lcd_cooldown() { line_to_current(Z_AXIS); stepper.synchronize(); - mbl.active = true; + mbl.has_mesh(true); enqueue_and_echo_commands_P(PSTR("G28")); lcd_return_to_status(); //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE); From c2362c1b3cd1a9ec1be35ae75ba9a470740a06b1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Jun 2016 21:31:38 -0700 Subject: [PATCH 016/580] Apply Marlin coding standards to MBL class --- Marlin/Marlin_main.cpp | 18 +++++++++--------- Marlin/configuration_store.cpp | 16 ++++++++-------- Marlin/mesh_bed_leveling.cpp | 2 +- Marlin/mesh_bed_leveling.h | 12 +++++++----- Marlin/planner.cpp | 4 ++-- Marlin/ultralcd.cpp | 2 +- 6 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5c1769a37..c90fa0a7f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2645,14 +2645,14 @@ inline void gcode_G28() { */ #if ENABLED(MESH_BED_LEVELING) float pre_home_z = MESH_HOME_SEARCH_Z; - if (mbl.is_active()) { + if (mbl.active()) { // Save known Z position if already homed if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) { pre_home_z = current_position[Z_AXIS]; pre_home_z += mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], current_position[Y_AXIS] - home_offset[Y_AXIS]); } - mbl.is_active(false); + mbl.set_active(false); } #endif @@ -2957,7 +2957,7 @@ inline void gcode_G28() { if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) { current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; sync_plan_position(); - mbl.is_active(true); + mbl.set_active(true); #if ENABLED(MESH_G28_REST_ORIGIN) current_position[Z_AXIS] = 0.0; set_destination_to_current(); @@ -2973,7 +2973,7 @@ inline void gcode_G28() { else if ((axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) && (homeX || homeY)) { current_position[Z_AXIS] = pre_home_z; sync_plan_position(); - mbl.is_active(true); + mbl.set_active(true); current_position[Z_AXIS] = pre_home_z - mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], current_position[Y_AXIS] - home_offset[Y_AXIS]); @@ -3060,7 +3060,7 @@ inline void gcode_G28() { case MeshReport: if (mbl.has_mesh()) { SERIAL_PROTOCOLPGM("State: "); - if (mbl.is_active()) + if (mbl.active()) SERIAL_PROTOCOLPGM("On"); else SERIAL_PROTOCOLPGM("Off"); @@ -3125,7 +3125,7 @@ inline void gcode_G28() { // After recording the last point, activate the mbl and home SERIAL_PROTOCOLLNPGM("Mesh probing done."); probe_point = -1; - mbl.has_mesh(true); + mbl.set_has_mesh(true); enqueue_and_echo_commands_P(PSTR("G28")); } break; @@ -3175,7 +3175,7 @@ inline void gcode_G28() { break; case MeshReset: - if (mbl.is_active()) { + if (mbl.active()) { current_position[Z_AXIS] += mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], current_position[Y_AXIS] - home_offset[Y_AXIS]) - MESH_HOME_SEARCH_Z; @@ -5982,7 +5982,7 @@ inline void gcode_M410() { /** * M420: Enable/Disable Mesh Bed Leveling */ - inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.has_mesh(!!code_value_short()); } + inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.set_has_mesh(!!code_value_short()); } /** * M421: Set a single Mesh Bed Leveling Z coordinate @@ -7373,7 +7373,7 @@ void clamp_to_software_endstops(float target[3]) { // This function is used to split lines on mesh borders so each segment is only part of one mesh area void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { - if (!mbl.is_active()) { + if (!mbl.active()) { planner.buffer_line(x, y, z, e, feed_rate, extruder); set_current_to_destination(); return; diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index fa5e14810..d3dbe2aad 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -58,8 +58,8 @@ * 188 M206 XYZ home_offset (float x3) * * Mesh bed leveling: - * 200 M420 S status (0 = empty, 1 = has mesh numbers) - * 201 z_offset (float) (added in V23) + * 200 M420 S status (uint8) + * 201 z_offset (float) * 205 mesh_num_x (uint8 as set in firmware) * 206 mesh_num_y (uint8 as set in firmware) * 207 G29 S3 XYZ z_values[][] (float x9, by default) @@ -187,21 +187,21 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, planner.max_e_jerk); EEPROM_WRITE_VAR(i, home_offset); - uint8_t dummy_uint8 = 0; - uint8_t mesh_num_x = 3; - uint8_t mesh_num_y = 3; #if ENABLED(MESH_BED_LEVELING) // Compile time test that sizeof(mbl.z_values) is as expected typedef char c_assert[(sizeof(mbl.z_values) == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) * sizeof(dummy)) ? 1 : -1]; - mesh_num_x = MESH_NUM_X_POINTS; - mesh_num_y = MESH_NUM_Y_POINTS; - dummy_uint8 = mbl.status & 0x01; // Do not save 'is active' + uint8_t mesh_num_x = MESH_NUM_X_POINTS, + mesh_num_y = MESH_NUM_Y_POINTS, + dummy_uint8 = mbl.status & _BV(MBL_STATUS_HAS_MESH_BIT); EEPROM_WRITE_VAR(i, dummy_uint8); EEPROM_WRITE_VAR(i, mbl.z_offset); EEPROM_WRITE_VAR(i, mesh_num_x); EEPROM_WRITE_VAR(i, mesh_num_y); EEPROM_WRITE_VAR(i, mbl.z_values); #else + uint8_t mesh_num_x = 3, + mesh_num_y = 3, + dummy_uint8 = 0; dummy = 0.0f; EEPROM_WRITE_VAR(i, dummy_uint8); EEPROM_WRITE_VAR(i, dummy); diff --git a/Marlin/mesh_bed_leveling.cpp b/Marlin/mesh_bed_leveling.cpp index 44db8bc47..82d9fedf5 100644 --- a/Marlin/mesh_bed_leveling.cpp +++ b/Marlin/mesh_bed_leveling.cpp @@ -29,7 +29,7 @@ mesh_bed_leveling::mesh_bed_leveling() { reset(); } void mesh_bed_leveling::reset() { - status = 0; + status = MBL_STATUS_NONE; z_offset = 0; for (int8_t y = MESH_NUM_Y_POINTS; y--;) for (int8_t x = MESH_NUM_X_POINTS; x--;) diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h index 267ce700f..69b0b0dbe 100644 --- a/Marlin/mesh_bed_leveling.h +++ b/Marlin/mesh_bed_leveling.h @@ -24,12 +24,14 @@ #if ENABLED(MESH_BED_LEVELING) + enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_ACTIVE_BIT = 1 }; + #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X))/(MESH_NUM_X_POINTS - 1)) #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y))/(MESH_NUM_Y_POINTS - 1)) class mesh_bed_leveling { public: - uint8_t status; // Bit 0 = has mesh numbers, Bit 1 = compensation active + uint8_t status; // Has Mesh and Is Active bits float z_offset; float z_values[MESH_NUM_Y_POINTS][MESH_NUM_X_POINTS]; @@ -41,10 +43,10 @@ static FORCE_INLINE float get_probe_y(int8_t i) { return MESH_MIN_Y + (MESH_Y_DIST) * i; } void set_z(const int8_t px, const int8_t py, const float z) { z_values[py][px] = z; } - bool has_mesh() { return TEST(status, 0); } - void has_mesh(bool onOff) { if (onOff) SBI(status, 0); else CBI(status, 0); } - bool is_active() { return TEST(status, 1); } - void is_active(bool onOff) { if (onOff) SBI(status, 1); else CBI(status, 1); } + bool active() { return TEST(status, MBL_STATUS_ACTIVE_BIT); } + void set_active(bool onOff) { if (onOff) SBI(status, MBL_STATUS_ACTIVE_BIT); else CBI(status, MBL_STATUS_ACTIVE_BIT); } + bool has_mesh() { return TEST(status, MBL_STATUS_HAS_MESH_BIT); } + void set_has_mesh(bool onOff) { if (onOff) SBI(status, MBL_STATUS_HAS_MESH_BIT); else CBI(status, MBL_STATUS_HAS_MESH_BIT); } inline void zigzag(int8_t index, int8_t &px, int8_t &py) { px = index % (MESH_NUM_X_POINTS); diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 87145b50a..85d7f34dc 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -539,7 +539,7 @@ void Planner::check_axes_activity() { while (block_buffer_tail == next_buffer_head) idle(); #if ENABLED(MESH_BED_LEVELING) - if (mbl.is_active()) + if (mbl.active()) z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]); #elif ENABLED(AUTO_BED_LEVELING_FEATURE) apply_rotation_xyz(bed_level_matrix, x, y, z); @@ -1121,7 +1121,7 @@ void Planner::check_axes_activity() { #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING { #if ENABLED(MESH_BED_LEVELING) - if (mbl.is_active()) + if (mbl.active()) z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]); #elif ENABLED(AUTO_BED_LEVELING_FEATURE) apply_rotation_xyz(bed_level_matrix, x, y, z); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 4a36b6f8e..fdd1545d1 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -970,7 +970,7 @@ void lcd_cooldown() { line_to_current(Z_AXIS); stepper.synchronize(); - mbl.has_mesh(true); + mbl.set_has_mesh(true); enqueue_and_echo_commands_P(PSTR("G28")); lcd_return_to_status(); //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE); From d7e4e8e9be9931bfdf23a721d274952e5195c477 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Jun 2016 02:09:58 -0700 Subject: [PATCH 017/580] Fix a typo in #3955 --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c90fa0a7f..5094b9460 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6057,7 +6057,7 @@ inline void gcode_M428() { } if (!err) { - #if ENABLED(DELTA) && ENABLED(SCARA) + #if ENABLED(DELTA) || ENABLED(SCARA) sync_plan_position_delta(); #else sync_plan_position(); From e2a89616351ea288191b1798045c202765b29af1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Jun 2016 01:44:53 -0700 Subject: [PATCH 018/580] Use e_steps[EXTRUDERS] instead of e_steps[4] --- Marlin/stepper.cpp | 4 ++-- Marlin/stepper.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 3df97cd52..7695e3c57 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -93,7 +93,7 @@ volatile unsigned long Stepper::step_events_completed = 0; // The number of step unsigned char Stepper::old_OCR0A; long Stepper::final_advance = 0, Stepper::old_advance = 0, - Stepper::e_steps[4], + Stepper::e_steps[EXTRUDERS], Stepper::advance_rate, Stepper::advance; #endif @@ -661,7 +661,7 @@ void Stepper::init() { CBI(TCCR0A, WGM01); CBI(TCCR0A, WGM00); #endif - e_steps[0] = e_steps[1] = e_steps[2] = e_steps[3] = 0; + for (uint8_t i = 0; i < EXTRUDERS; i++) e_steps[i] = 0; SBI(TIMSK0, OCIE0A); #endif //ADVANCE diff --git a/Marlin/stepper.h b/Marlin/stepper.h index ce4c1c148..13c753fbc 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -91,7 +91,7 @@ class Stepper { #endif #if ENABLED(ADVANCE) - static long e_steps[4]; + static long e_steps[EXTRUDERS]; #endif private: From a3e25a0fcad09cc042718407bb2ffad2b6b78f65 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Mar 2016 20:11:56 -0800 Subject: [PATCH 019/580] Instead of trying to move now, set a flag to move asap --- Marlin/Marlin.h | 2 +- Marlin/ultralcd.cpp | 46 +++++++++++++++++++++++++++++++++++++-------- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index ab85ab592..1268308f1 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -213,7 +213,7 @@ void manage_inactivity(bool ignore_stepper_queue = false); * A_AXIS and B_AXIS are used by COREXY printers * X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots. */ -enum AxisEnum {X_AXIS = 0, A_AXIS = 0, Y_AXIS = 1, B_AXIS = 1, Z_AXIS = 2, C_AXIS = 2, E_AXIS = 3, X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 5}; +enum AxisEnum {NO_AXIS = -1, X_AXIS = 0, A_AXIS = 0, Y_AXIS = 1, B_AXIS = 1, Z_AXIS = 2, C_AXIS = 2, E_AXIS = 3, X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 5}; #define _AXIS(AXIS) AXIS ##_AXIS diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 63fe56b66..815d4cee2 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -50,6 +50,8 @@ int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update +int8_t manual_move_axis = (int8_t)NO_AXIS; + bool encoderRateMultiplierEnabled; int32_t lastEncoderMovementMillis; @@ -938,7 +940,7 @@ void lcd_cooldown() { ENCODER_DIRECTION_NORMAL(); // Encoder wheel adjusts the Z position - if (encoderPosition && planner.movesplanned() <= 3) { + if (encoderPosition) { refresh_cmd_timeout(); current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP); NOLESS(current_position[Z_AXIS], 0); @@ -951,8 +953,8 @@ void lcd_cooldown() { LCDVIEW_REDRAW_NOW #endif ; + encoderPosition = 0; } - encoderPosition = 0; static bool debounce_click = false; if (LCD_CLICKED) { @@ -1190,6 +1192,32 @@ static void lcd_prepare_menu() { #endif // DELTA_CALIBRATION_MENU +/** + * If the manual move hasn't been fed to the planner yet, + * and the planner can accept one, send immediately + */ +inline void manage_manual_move() { + if (manual_move_axis != (int8_t)NO_AXIS && !planner.planner_is_full()) { + #if ENABLED(DELTA) + calculate_delta(current_position); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); + #else + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); + #endif + manual_move_axis = (int8_t)NO_AXIS; + } +} + +/** + * Set a flag that lcd_update() should send a move + * to "current_position" at the next opportunity, + * and try to send one now. + */ +inline void manual_move_to_current(AxisEnum axis) { + manual_move_axis = (int8_t)axis; + manage_manual_move(); +} + /** * * "Prepare" > "Move Axis" submenu @@ -1200,15 +1228,15 @@ float move_menu_scale; static void _lcd_move(const char* name, AxisEnum axis, float min, float max) { ENCODER_DIRECTION_NORMAL(); - if (encoderPosition && planner.movesplanned() <= 3) { + if (encoderPosition) { refresh_cmd_timeout(); current_position[axis] += float((int32_t)encoderPosition) * move_menu_scale; if (min_software_endstops) NOLESS(current_position[axis], min); if (max_software_endstops) NOMORE(current_position[axis], max); - line_to_current(axis); + encoderPosition = 0; + manual_move_to_current(axis); lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } - encoderPosition = 0; if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis])); if (LCD_CLICKED) lcd_goto_previous_menu(true); } @@ -1232,12 +1260,12 @@ static void lcd_move_e( unsigned short original_active_extruder = active_extruder; active_extruder = e; #endif - if (encoderPosition && planner.movesplanned() <= 3) { + if (encoderPosition) { current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale; - line_to_current(E_AXIS); + encoderPosition = 0; + manual_move_to_current(E_AXIS); lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } - encoderPosition = 0; if (lcdDrawUpdate) { PGM_P pos_label; #if EXTRUDERS == 1 @@ -2149,6 +2177,8 @@ void lcd_update() { static millis_t return_to_status_ms = 0; #endif + manage_manual_move(); + lcd_buttons_update(); #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) From 47b5c55c292d95e03455b54591bef500e9bcd625 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Apr 2016 18:06:17 -0700 Subject: [PATCH 020/580] Implement the delayed-move technique --- Marlin/planner.h | 2 ++ Marlin/ultralcd.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Marlin/planner.h b/Marlin/planner.h index 96e580db9..7a9f96e66 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -189,6 +189,8 @@ class Planner { */ static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); } + static bool is_full() { return (block_buffer_tail == BLOCK_MOD(block_buffer_head + 1)); } + #if ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(MESH_BED_LEVELING) #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 815d4cee2..cf9c9ac4c 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -51,6 +51,7 @@ int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update int8_t manual_move_axis = (int8_t)NO_AXIS; +millis_t manual_move_start_time = 0; bool encoderRateMultiplierEnabled; int32_t lastEncoderMovementMillis; @@ -1193,11 +1194,11 @@ static void lcd_prepare_menu() { #endif // DELTA_CALIBRATION_MENU /** - * If the manual move hasn't been fed to the planner yet, + * If the most recent manual move hasn't been fed to the planner yet, * and the planner can accept one, send immediately */ inline void manage_manual_move() { - if (manual_move_axis != (int8_t)NO_AXIS && !planner.planner_is_full()) { + if (manual_move_axis != (int8_t)NO_AXIS && millis() >= manual_move_start_time && !planner.is_full()) { #if ENABLED(DELTA) calculate_delta(current_position); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); @@ -1209,13 +1210,12 @@ inline void manage_manual_move() { } /** - * Set a flag that lcd_update() should send a move - * to "current_position" at the next opportunity, - * and try to send one now. + * Set a flag that lcd_update() should start a move + * to "current_position" after a short delay. */ inline void manual_move_to_current(AxisEnum axis) { + manual_move_start_time = millis() + 500UL; // 1/2 second delay manual_move_axis = (int8_t)axis; - manage_manual_move(); } /** From 9171a3d94f45a4a83476f6846d58cf5948b9f1cc Mon Sep 17 00:00:00 2001 From: petrzjunior Date: Tue, 7 Jun 2016 18:59:13 +0200 Subject: [PATCH 021/580] Update Czech language 2016/06/07 --- Marlin/language_cz.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index da277a2a2..9c4afe8d5 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -68,6 +68,10 @@ #define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " Vse" #define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Podloz" #define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " Nast" +#define MSG_H1 "1" +#define MSG_H2 "2" +#define MSG_H3 "3" +#define MSG_H4 "4" #define MSG_COOLDOWN "Zchladit" #define MSG_SWITCH_PS_ON "Zapnout napajeni" #define MSG_SWITCH_PS_OFF "Vypnout napajeni" @@ -79,12 +83,20 @@ #define MSG_MOVE_Y "Posunout Y" #define MSG_MOVE_Z "Posunout Z" #define MSG_MOVE_E "Extruder" +#define MSG_MOVE_E1 "1" +#define MSG_MOVE_E2 "2" +#define MSG_MOVE_E3 "3" +#define MSG_MOVE_E4 "4" #define MSG_MOVE_01MM "Posunout o 0,1mm" #define MSG_MOVE_1MM "Posunout o 1mm" #define MSG_MOVE_10MM "Posunout o 10mm" #define MSG_SPEED "Rychlost" #define MSG_BED_Z "Vyska podl." #define MSG_NOZZLE "Tryska" +#define MSG_N1 " 1" +#define MSG_N2 " 2" +#define MSG_N3 " 3" +#define MSG_N4 " 4" #define MSG_BED "Podlozka" #define MSG_FAN_SPEED "Rychlost vent." #define MSG_FLOW "Prutok" @@ -99,6 +111,10 @@ #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" +#define MSG_E1 " E1" +#define MSG_E2 " E2" +#define MSG_E3 " E3" +#define MSG_E4 " E4" #define MSG_ACC "Zrychl" #define MSG_VXY_JERK "Vxy-jerk" #define MSG_VZ_JERK "Vz-jerk" @@ -122,6 +138,10 @@ #define MSG_VOLUMETRIC "Filament" #define MSG_VOLUMETRIC_ENABLED "E na mm3" #define MSG_FILAMENT_DIAM "Fil. Prum." +#define MSG_DIAM_E1 " 1" +#define MSG_DIAM_E2 " 2" +#define MSG_DIAM_E3 " 3" +#define MSG_DIAM_E4 " 4" #define MSG_CONTRAST "Kontrast LCD" #define MSG_STORE_EPROM "Ulozit nastaveni" #define MSG_LOAD_EPROM "Nacist nastaveni" @@ -155,6 +175,7 @@ #define MSG_CNG_SDCARD "Vymenit SD kartu" #define MSG_ZPROBE_OUT "Sonda Z mimo podl" #define MSG_YX_UNHOMED "Domu X/Y pred Z" +#define MSG_XYZ_UNHOMED "Domu XYZ prvni" #define MSG_ZPROBE_ZOFFSET "Z ofset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" From 49ecaf774d783e7164bfc63735d6dc7b4365dd36 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Jun 2016 15:38:45 -0700 Subject: [PATCH 022/580] Rename some auto/locals to avoid name conflict --- Marlin/planner.cpp | 10 +++++----- Marlin/planner.h | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 85d7f34dc..c4c551f01 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -155,18 +155,18 @@ void Planner::calculate_trapezoid_for_block(block_t* block, float entry_factor, NOLESS(initial_rate, 120); NOLESS(final_rate, 120); - long acceleration = block->acceleration_st; - int32_t accelerate_steps = ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, acceleration)); - int32_t decelerate_steps = floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -acceleration)); + long accel = block->acceleration_st; + int32_t accelerate_steps = ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)); + int32_t decelerate_steps = floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)); // Calculate the size of Plateau of Nominal Rate. int32_t plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps; // Is the Plateau of Nominal Rate smaller than nothing? That means no cruising, and we will - // have to use intersection_distance() to calculate when to abort acceleration and start braking + // have to use intersection_distance() to calculate when to abort accel and start braking // in order to reach the final_rate exactly at the end of this block. if (plateau_steps < 0) { - accelerate_steps = ceil(intersection_distance(initial_rate, final_rate, acceleration, block->step_event_count)); + accelerate_steps = ceil(intersection_distance(initial_rate, final_rate, accel, block->step_event_count)); accelerate_steps = max(accelerate_steps, 0); // Check limits due to numerical round-off accelerate_steps = min((uint32_t)accelerate_steps, block->step_event_count);//(We can cast here to unsigned, because the above line ensures that we are above zero) plateau_steps = 0; diff --git a/Marlin/planner.h b/Marlin/planner.h index 7a9f96e66..48773c510 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -281,9 +281,9 @@ class Planner { * Calculate the distance (not time) it takes to accelerate * from initial_rate to target_rate using the given acceleration: */ - static float estimate_acceleration_distance(float initial_rate, float target_rate, float acceleration) { - if (acceleration == 0) return 0; // acceleration was 0, set acceleration distance to 0 - return (target_rate * target_rate - initial_rate * initial_rate) / (acceleration * 2); + static float estimate_acceleration_distance(float initial_rate, float target_rate, float accel) { + if (accel == 0) return 0; // accel was 0, set acceleration distance to 0 + return (target_rate * target_rate - initial_rate * initial_rate) / (accel * 2); } /** @@ -294,9 +294,9 @@ class Planner { * This is used to compute the intersection point between acceleration and deceleration * in cases where the "trapezoid" has no plateau (i.e., never reaches maximum speed) */ - static float intersection_distance(float initial_rate, float final_rate, float acceleration, float distance) { - if (acceleration == 0) return 0; // acceleration was 0, set intersection distance to 0 - return (acceleration * 2 * distance - initial_rate * initial_rate + final_rate * final_rate) / (acceleration * 4); + static float intersection_distance(float initial_rate, float final_rate, float accel, float distance) { + if (accel == 0) return 0; // accel was 0, set intersection distance to 0 + return (accel * 2 * distance - initial_rate * initial_rate + final_rate * final_rate) / (accel * 4); } /** @@ -304,8 +304,8 @@ class Planner { * to reach 'target_velocity' using 'acceleration' within a given * 'distance'. */ - static float max_allowable_speed(float acceleration, float target_velocity, float distance) { - return sqrt(target_velocity * target_velocity - 2 * acceleration * distance); + static float max_allowable_speed(float accel, float target_velocity, float distance) { + return sqrt(target_velocity * target_velocity - 2 * accel * distance); } static void calculate_trapezoid_for_block(block_t* block, float entry_factor, float exit_factor); From cca047424d6eabf8faca6f8d464f2eb177ae923b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Jun 2016 19:10:39 -0700 Subject: [PATCH 023/580] MBL: cel => cell --- Marlin/Marlin_main.cpp | 8 ++++---- Marlin/mesh_bed_leveling.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b033b3799..75c766118 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7386,10 +7386,10 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, set_current_to_destination(); return; } - int pcx = mbl.cel_index_x(current_position[X_AXIS] - home_offset[X_AXIS]); - int pcy = mbl.cel_index_y(current_position[Y_AXIS] - home_offset[Y_AXIS]); - int cx = mbl.cel_index_x(x - home_offset[X_AXIS]); - int cy = mbl.cel_index_y(y - home_offset[Y_AXIS]); + int pcx = mbl.cell_index_x(current_position[X_AXIS] - home_offset[X_AXIS]); + int pcy = mbl.cell_index_y(current_position[Y_AXIS] - home_offset[Y_AXIS]); + int cx = mbl.cell_index_x(x - home_offset[X_AXIS]); + int cy = mbl.cell_index_y(y - home_offset[Y_AXIS]); NOMORE(pcx, MESH_NUM_X_POINTS - 2); NOMORE(pcy, MESH_NUM_Y_POINTS - 2); NOMORE(cx, MESH_NUM_X_POINTS - 2); diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h index 69b0b0dbe..3aa2e4ace 100644 --- a/Marlin/mesh_bed_leveling.h +++ b/Marlin/mesh_bed_leveling.h @@ -60,12 +60,12 @@ set_z(px, py, z); } - int8_t cel_index_x(float x) { + int8_t cell_index_x(float x) { int8_t cx = int(x - (MESH_MIN_X)) / (MESH_X_DIST); return constrain(cx, 0, (MESH_NUM_X_POINTS) - 2); } - int8_t cel_index_y(float y) { + int8_t cell_index_y(float y) { int8_t cy = int(y - (MESH_MIN_Y)) / (MESH_Y_DIST); return constrain(cy, 0, (MESH_NUM_Y_POINTS) - 2); } @@ -87,8 +87,8 @@ } float get_z(float x0, float y0) { - int8_t cx = cel_index_x(x0), - cy = cel_index_y(y0); + int8_t cx = cell_index_x(x0), + cy = cell_index_y(y0); if (cx < 0 || cy < 0) return z_offset; float z1 = calc_z0(x0, get_probe_x(cx), z_values[cy][cx], From b23f7100344f0a3a0e5a33c375c7fa83deb1750b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Jun 2016 12:50:12 -0700 Subject: [PATCH 024/580] Cleanup and naming for num-to-string functions --- Marlin/dogm_lcd_implementation.h | 22 +- Marlin/ultralcd.cpp | 285 ++++++++---------- Marlin/ultralcd.h | 14 +- .../ultralcd_implementation_hitachi_HD44780.h | 22 +- 4 files changed, 161 insertions(+), 182 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 3399f78bf..51ee6e442 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -413,7 +413,7 @@ static void lcd_implementation_status_screen() { u8g.setPrintPos(83, XYZ_BASELINE); _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink); u8g.setPrintPos(91, XYZ_BASELINE); - lcd_print(ftostr32sp(current_position[Z_AXIS] + 0.00001)); + lcd_print(ftostr52sp(current_position[Z_AXIS] + 0.00001)); u8g.setColorIndex(1); // black on white @@ -500,22 +500,22 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c #define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data))) #define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data))) #define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data))) -#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43(*(data))) -#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data))) -#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52(*(data))) -#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51(*(data))) -#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data))) +#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data))) +#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data))) #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) //Add version for callback functions #define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data))) #define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data))) #define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data))) #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) { diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index cf9c9ac4c..c59bffb6b 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -995,7 +995,7 @@ void lcd_cooldown() { // Show message above on clicks instead if (lcdDrawUpdate) { float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z; - lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43(v + (v < 0 ? -0.0001 : 0.0001), '+')); + lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+')); } } @@ -1237,7 +1237,7 @@ static void _lcd_move(const char* name, AxisEnum axis, float min, float max) { manual_move_to_current(axis); lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } - if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis])); + if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr41sign(current_position[axis])); if (LCD_CLICKED) lcd_goto_previous_menu(true); } #if ENABLED(DELTA) @@ -1282,7 +1282,7 @@ static void lcd_move_e( #endif //EXTRUDERS > 2 } #endif //EXTRUDERS > 1 - lcd_implementation_drawedit(pos_label, ftostr31(current_position[E_AXIS])); + lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS])); } if (LCD_CLICKED) lcd_goto_previous_menu(true); #if EXTRUDERS > 1 @@ -1913,11 +1913,11 @@ static void lcd_control_volumetric_menu() { menu_edit_type(int, int3, itostr3, 1); menu_edit_type(float, float3, ftostr3, 1); menu_edit_type(float, float32, ftostr32, 100); -menu_edit_type(float, float43, ftostr43, 1000); -menu_edit_type(float, float5, ftostr5, 0.01); -menu_edit_type(float, float51, ftostr51, 10); -menu_edit_type(float, float52, ftostr52, 100); -menu_edit_type(unsigned long, long5, ftostr5, 0.01); +menu_edit_type(float, float43, ftostr43sign, 1000); +menu_edit_type(float, float5, ftostr5rj, 0.01); +menu_edit_type(float, float51, ftostr51sign, 10); +menu_edit_type(float, float52, ftostr52sign, 100); +menu_edit_type(unsigned long, long5, ftostr5rj, 0.01); /** * @@ -2382,7 +2382,7 @@ void set_utf_strlen(char* s, uint8_t n) { i++; } while (j++ < n) s[i++] = ' '; - s[i] = 0; + s[i] = '\0'; } bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); } @@ -2556,6 +2556,9 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } /** Number to string conversion **/ /*********************************/ +#define DIGIT(n) ('0' + (n)) +#define DIGIMOD(n) DIGIT((n) % 10) + char conv[8]; // Convert float to rj string with 123 or -12 format @@ -2568,52 +2571,40 @@ char *ftostr4sign(const float& x) { return itostr4sign((int)x); } char* itostr2(const uint8_t& x) { //sprintf(conv,"%5.1f",x); int xx = x; - conv[0] = (xx / 10) % 10 + '0'; - conv[1] = xx % 10 + '0'; - conv[2] = 0; + conv[0] = DIGIMOD(xx / 10); + conv[1] = DIGIMOD(xx); + conv[2] = '\0'; return conv; } // Convert float to string with +123.4 / -123.4 format -char* ftostr31(const float& x) { - int xx = abs(x * 10); - conv[0] = (x >= 0) ? '+' : '-'; - conv[1] = (xx / 1000) % 10 + '0'; - conv[2] = (xx / 100) % 10 + '0'; - conv[3] = (xx / 10) % 10 + '0'; +char* ftostr41sign(const float& x) { + int xx = int(abs(x * 10)) % 10000; + conv[0] = x >= 0 ? '+' : '-'; + conv[1] = DIGIMOD(xx / 1000); + conv[2] = DIGIMOD(xx / 100); + conv[3] = DIGIMOD(xx / 10); conv[4] = '.'; - conv[5] = xx % 10 + '0'; - conv[6] = 0; - return conv; -} - -// Convert unsigned float to string with 123.4 format, dropping sign -char* ftostr31ns(const float& x) { - int xx = abs(x * 10); - conv[0] = (xx / 1000) % 10 + '0'; - conv[1] = (xx / 100) % 10 + '0'; - conv[2] = (xx / 10) % 10 + '0'; - conv[3] = '.'; - conv[4] = xx % 10 + '0'; - conv[5] = 0; + conv[5] = DIGIMOD(xx); + conv[6] = '\0'; return conv; } // Convert signed float to string with 023.45 / -23.45 format char *ftostr32(const float& x) { long xx = abs(x * 100); - conv[0] = x >= 0 ? (xx / 10000) % 10 + '0' : '-'; - conv[1] = (xx / 1000) % 10 + '0'; - conv[2] = (xx / 100) % 10 + '0'; + conv[0] = x >= 0 ? DIGIMOD(xx / 10000) : '-'; + conv[1] = DIGIMOD(xx / 1000); + conv[2] = DIGIMOD(xx / 100); conv[3] = '.'; - conv[4] = (xx / 10) % 10 + '0'; - conv[5] = xx % 10 + '0'; - conv[6] = 0; + conv[4] = DIGIMOD(xx / 10); + conv[5] = DIGIMOD(xx); + conv[6] = '\0'; return conv; } // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format -char* ftostr43(const float& x, char plus/*=' '*/) { +char* ftostr43sign(const float& x, char plus/*=' '*/) { long xx = x * 1000; if (xx == 0) conv[0] = ' '; @@ -2623,12 +2614,12 @@ char* ftostr43(const float& x, char plus/*=' '*/) { xx = -xx; conv[0] = '-'; } - conv[1] = (xx / 1000) % 10 + '0'; + conv[1] = DIGIMOD(xx / 1000); conv[2] = '.'; - conv[3] = (xx / 100) % 10 + '0'; - conv[4] = (xx / 10) % 10 + '0'; - conv[5] = (xx) % 10 + '0'; - conv[6] = 0; + conv[3] = DIGIMOD(xx / 100); + conv[4] = DIGIMOD(xx / 10); + conv[5] = DIGIMOD(xx); + conv[6] = '\0'; return conv; } @@ -2636,57 +2627,11 @@ char* ftostr43(const float& x, char plus/*=' '*/) { char* ftostr12ns(const float& x) { long xx = x * 100; xx = abs(xx); - conv[0] = (xx / 100) % 10 + '0'; + conv[0] = DIGIMOD(xx / 100); conv[1] = '.'; - conv[2] = (xx / 10) % 10 + '0'; - conv[3] = (xx) % 10 + '0'; - conv[4] = 0; - return conv; -} - -// Convert signed float to space-padded string with -_23.4_ format -char* ftostr32sp(const float& x) { - long xx = x * 100; - uint8_t dig; - if (xx < 0) { // negative val = -_0 - xx = -xx; - conv[0] = '-'; - dig = (xx / 1000) % 10; - conv[1] = dig ? '0' + dig : ' '; - } - else { // positive val = __0 - dig = (xx / 10000) % 10; - if (dig) { - conv[0] = '0' + dig; - conv[1] = '0' + (xx / 1000) % 10; - } - else { - conv[0] = ' '; - dig = (xx / 1000) % 10; - conv[1] = dig ? '0' + dig : ' '; - } - } - - conv[2] = '0' + (xx / 100) % 10; // lsd always - - dig = xx % 10; - if (dig) { // 2 decimal places - conv[5] = '0' + dig; - conv[4] = '0' + (xx / 10) % 10; - conv[3] = '.'; - } - else { // 1 or 0 decimal place - dig = (xx / 10) % 10; - if (dig) { - conv[4] = '0' + dig; - conv[3] = '.'; - } - else { - conv[3] = conv[4] = ' '; - } - conv[5] = ' '; - } - conv[6] = '\0'; + conv[2] = DIGIMOD(xx / 10); + conv[3] = DIGIMOD(xx); + conv[4] = '\0'; return conv; } @@ -2701,12 +2646,12 @@ char* itostr3sign(const int& x) { conv[0] = '-'; xx = -x; } - conv[1] = (xx / 100) % 10 + '0'; - conv[2] = (xx / 10) % 10 + '0'; - conv[3] = xx % 10 + '0'; + conv[1] = DIGIMOD(xx / 100); + conv[2] = DIGIMOD(xx / 10); + conv[3] = DIGIMOD(xx); conv[4] = '.'; conv[5] = '0'; - conv[6] = 0; + conv[6] = '\0'; return conv; } @@ -2718,56 +2663,46 @@ char* itostr3(const int& x) { xx = -xx; } else - conv[0] = xx >= 100 ? (xx / 100) % 10 + '0' : ' '; + conv[0] = xx >= 100 ? DIGIMOD(xx / 100) : ' '; - conv[1] = xx >= 10 ? (xx / 10) % 10 + '0' : ' '; - conv[2] = xx % 10 + '0'; - conv[3] = 0; + conv[1] = xx >= 10 ? DIGIMOD(xx / 10) : ' '; + conv[2] = DIGIMOD(xx); + conv[3] = '\0'; return conv; } // Convert unsigned int to lj string with 123 format -char* itostr3left(const int& x) { - if (x >= 100) { - conv[0] = (x / 100) % 10 + '0'; - conv[1] = (x / 10) % 10 + '0'; - conv[2] = x % 10 + '0'; - conv[3] = 0; - } - else if (x >= 10) { - conv[0] = (x / 10) % 10 + '0'; - conv[1] = x % 10 + '0'; - conv[2] = 0; +char* itostr3left(const int& xx) { + if (xx >= 100) { + conv[0] = DIGIMOD(xx / 100); + conv[1] = DIGIMOD(xx / 10); + conv[2] = DIGIMOD(xx); + conv[3] = '\0'; + } + else if (xx >= 10) { + conv[0] = DIGIMOD(xx / 10); + conv[1] = DIGIMOD(xx); + conv[2] = '\0'; } else { - conv[0] = x % 10 + '0'; - conv[1] = 0; + conv[0] = DIGIMOD(xx); + conv[1] = '\0'; } return conv; } -// Convert unsigned int to rj string with 1234 format -char* itostr4(const int& x) { - conv[0] = x >= 1000 ? (x / 1000) % 10 + '0' : ' '; - conv[1] = x >= 100 ? (x / 100) % 10 + '0' : ' '; - conv[2] = x >= 10 ? (x / 10) % 10 + '0' : ' '; - conv[3] = x % 10 + '0'; - conv[4] = 0; - return conv; -} - // Convert signed int to rj string with _123, -123, _-12, or __-1 format char *itostr4sign(const int& x) { int xx = abs(x); int sign = 0; if (xx >= 100) { - conv[1] = (xx / 100) % 10 + '0'; - conv[2] = (xx / 10) % 10 + '0'; + conv[1] = DIGIMOD(xx / 100); + conv[2] = DIGIMOD(xx / 10); } else if (xx >= 10) { conv[0] = ' '; sign = 1; - conv[2] = (xx / 10) % 10 + '0'; + conv[2] = DIGIMOD(xx / 10); } else { conv[0] = ' '; @@ -2775,48 +2710,94 @@ char *itostr4sign(const int& x) { sign = 2; } conv[sign] = x < 0 ? '-' : ' '; - conv[3] = xx % 10 + '0'; - conv[4] = 0; + conv[3] = DIGIMOD(xx); + conv[4] = '\0'; return conv; } // Convert unsigned float to rj string with 12345 format -char* ftostr5(const float& x) { +char* ftostr5rj(const float& x) { long xx = abs(x); - conv[0] = xx >= 10000 ? (xx / 10000) % 10 + '0' : ' '; - conv[1] = xx >= 1000 ? (xx / 1000) % 10 + '0' : ' '; - conv[2] = xx >= 100 ? (xx / 100) % 10 + '0' : ' '; - conv[3] = xx >= 10 ? (xx / 10) % 10 + '0' : ' '; - conv[4] = xx % 10 + '0'; - conv[5] = 0; + conv[0] = xx >= 10000 ? DIGIMOD(xx / 10000) : ' '; + conv[1] = xx >= 1000 ? DIGIMOD(xx / 1000) : ' '; + conv[2] = xx >= 100 ? DIGIMOD(xx / 100) : ' '; + conv[3] = xx >= 10 ? DIGIMOD(xx / 10) : ' '; + conv[4] = DIGIMOD(xx); + conv[5] = '\0'; return conv; } // Convert signed float to string with +1234.5 format -char* ftostr51(const float& x) { +char* ftostr51sign(const float& x) { long xx = abs(x * 10); conv[0] = (x >= 0) ? '+' : '-'; - conv[1] = (xx / 10000) % 10 + '0'; - conv[2] = (xx / 1000) % 10 + '0'; - conv[3] = (xx / 100) % 10 + '0'; - conv[4] = (xx / 10) % 10 + '0'; + conv[1] = DIGIMOD(xx / 10000); + conv[2] = DIGIMOD(xx / 1000); + conv[3] = DIGIMOD(xx / 100); + conv[4] = DIGIMOD(xx / 10); conv[5] = '.'; - conv[6] = xx % 10 + '0'; - conv[7] = 0; + conv[6] = DIGIMOD(xx); + conv[7] = '\0'; return conv; } // Convert signed float to string with +123.45 format -char* ftostr52(const float& x) { - conv[0] = (x >= 0) ? '+' : '-'; +char* ftostr52sign(const float& x) { long xx = abs(x * 100); - conv[1] = (xx / 10000) % 10 + '0'; - conv[2] = (xx / 1000) % 10 + '0'; - conv[3] = (xx / 100) % 10 + '0'; + conv[0] = (x >= 0) ? '+' : '-'; + conv[1] = DIGIMOD(xx / 10000); + conv[2] = DIGIMOD(xx / 1000); + conv[3] = DIGIMOD(xx / 100); conv[4] = '.'; - conv[5] = (xx / 10) % 10 + '0'; - conv[6] = xx % 10 + '0'; - conv[7] = 0; + conv[5] = DIGIMOD(xx / 10); + conv[6] = DIGIMOD(xx); + conv[7] = '\0'; + return conv; +} + +// Convert signed float to space-padded string with -_23.4_ format +char* ftostr52sp(const float& x) { + long xx = x * 100; + uint8_t dig; + if (xx < 0) { // negative val = -_0 + xx = -xx; + conv[0] = '-'; + dig = (xx / 1000) % 10; + conv[1] = dig ? DIGIT(dig) : ' '; + } + else { // positive val = __0 + dig = (xx / 10000) % 10; + if (dig) { + conv[0] = DIGIT(dig); + conv[1] = DIGIMOD(xx / 1000); + } + else { + conv[0] = ' '; + dig = (xx / 1000) % 10; + conv[1] = dig ? DIGIT(dig) : ' '; + } + } + + conv[2] = DIGIMOD(xx / 100); // lsd always + + dig = xx % 10; + if (dig) { // 2 decimal places + conv[5] = DIGIT(dig); + conv[4] = DIGIMOD(xx / 10); + conv[3] = '.'; + } + else { // 1 or 0 decimal place + dig = (xx / 10) % 10; + if (dig) { + conv[4] = DIGIT(dig); + conv[3] = '.'; + } + else { + conv[3] = conv[4] = ' '; + } + conv[5] = ' '; + } + conv[6] = '\0'; return conv; } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index b1e97bf49..5cb1ecc57 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -165,19 +165,17 @@ char* itostr2(const uint8_t& x); char* itostr3sign(const int& x); char* itostr3(const int& x); char* itostr3left(const int& x); -char* itostr4(const int& x); char* itostr4sign(const int& x); char* ftostr3(const float& x); char* ftostr4sign(const float& x); -char* ftostr31ns(const float& x); // float to string without sign character -char* ftostr31(const float& x); +char* ftostr41sign(const float& x); char* ftostr32(const float& x); -char* ftostr43(const float& x, char plus=' '); +char* ftostr43sign(const float& x, char plus=' '); char* ftostr12ns(const float& x); -char* ftostr32sp(const float& x); // remove zero-padding from ftostr32 -char* ftostr5(const float& x); -char* ftostr51(const float& x); -char* ftostr52(const float& x); +char* ftostr5rj(const float& x); +char* ftostr51sign(const float& x); +char* ftostr52sign(const float& x); +char* ftostr52sp(const float& x); // remove zero-padding from ftostr32 #endif //ULTRALCD_H diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 61e9a62ee..d682bfa54 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -723,7 +723,7 @@ static void lcd_implementation_status_screen() { lcd.setCursor(LCD_WIDTH - 8, 1); _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink); - lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001)); + lcd.print(ftostr52sp(current_position[Z_AXIS] + 0.00001)); #endif // LCD_HEIGHT > 2 @@ -855,22 +855,22 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t #define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', itostr3(*(data))) #define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr3(*(data))) #define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr32(*(data))) -#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43(*(data))) -#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5(*(data))) -#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52(*(data))) -#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51(*(data))) -#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5(*(data))) +#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data))) +#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data))) #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) //Add version for callback functions #define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', itostr3(*(data))) #define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr3(*(data))) #define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr32(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51(*(data))) -#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51sign(*(data))) +#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data))) #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) { From 2d55862499cb6071e4ef40cd51ce5e2980503a04 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Jun 2016 16:05:18 -0700 Subject: [PATCH 025/580] Use memset in mbl.reset to save 58 bytes --- Marlin/mesh_bed_leveling.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Marlin/mesh_bed_leveling.cpp b/Marlin/mesh_bed_leveling.cpp index 82d9fedf5..babad8aaa 100644 --- a/Marlin/mesh_bed_leveling.cpp +++ b/Marlin/mesh_bed_leveling.cpp @@ -31,9 +31,7 @@ void mesh_bed_leveling::reset() { status = MBL_STATUS_NONE; z_offset = 0; - for (int8_t y = MESH_NUM_Y_POINTS; y--;) - for (int8_t x = MESH_NUM_X_POINTS; x--;) - z_values[y][x] = 0; + memset(z_values, 0, sizeof(z_values)); } #endif // MESH_BED_LEVELING From 16212432c9152a6e9f678ad7e21cfc7dfc8d7e7e Mon Sep 17 00:00:00 2001 From: Reid Rankin Date: Tue, 31 May 2016 10:26:08 -0500 Subject: [PATCH 026/580] G20/21 and M149 support, and code_value() refactor This is an update of MarlinDev PR #196. G20/21: support for switching input units between millimeters and inches. M149: support for changing input temperature units. In support of these changes, code_value() and code_value_short() are replaced with an array of functions which handle converting to the proper types and/or units. --- Marlin/Configuration.h | 10 + Marlin/M100_Free_Mem_Chk.cpp | 5 +- Marlin/Marlin.h | 18 +- Marlin/Marlin_main.cpp | 493 ++++++++++++------ .../Felix/Configuration.h | 10 + .../Felix/DUAL/Configuration.h | 10 + .../Hephestos/Configuration.h | 10 + .../Hephestos_2/Configuration.h | 10 + .../K8200/Configuration.h | 10 + .../RepRapWorld/Megatronics/Configuration.h | 10 + .../RigidBot/Configuration.h | 10 + .../SCARA/Configuration.h | 10 + .../TAZ4/Configuration.h | 10 + .../WITBOX/Configuration.h | 10 + .../adafruit/ST7565/Configuration.h | 10 + .../delta/biv2.5/Configuration.h | 10 + .../delta/generic/Configuration.h | 10 + .../delta/kossel_mini/Configuration.h | 10 + .../delta/kossel_pro/Configuration.h | 10 + .../delta/kossel_xl/Configuration.h | 10 + .../makibox/Configuration.h | 10 + .../tvrrug/Round2/Configuration.h | 10 + Marlin/planner.cpp | 6 +- 23 files changed, 531 insertions(+), 181 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4c1727102..502690ada 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -749,6 +749,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/M100_Free_Mem_Chk.cpp b/Marlin/M100_Free_Mem_Chk.cpp index 276df98eb..36e01ae6c 100644 --- a/Marlin/M100_Free_Mem_Chk.cpp +++ b/Marlin/M100_Free_Mem_Chk.cpp @@ -51,8 +51,7 @@ extern size_t __heap_start, __heap_end, __flp; // Declare all the functions we need from Marlin_Main.cpp to do the work! // -float code_value(); -long code_value_long(); +int code_value_int(); bool code_seen(char); void serial_echopair_P(const char*, float); void serial_echopair_P(const char*, double); @@ -177,7 +176,7 @@ void gcode_M100() { #if ENABLED(M100_FREE_MEMORY_CORRUPTOR) if (code_seen('C')) { int x; // x gets the # of locations to corrupt within the memory pool - x = code_value(); + x = code_value_int(); SERIAL_ECHOLNPGM("Corrupting free memory block.\n"); ptr = (unsigned char*) __brkval; SERIAL_ECHOPAIR("\n__brkval : ", ptr); diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 1268308f1..5e0b6bfb9 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -217,6 +217,9 @@ enum AxisEnum {NO_AXIS = -1, X_AXIS = 0, A_AXIS = 0, Y_AXIS = 1, B_AXIS = 1, Z_A #define _AXIS(AXIS) AXIS ##_AXIS +typedef enum { LINEARUNIT_MM = 0, LINEARUNIT_INCH = 1 } LinearUnit; +typedef enum { TEMPUNIT_C = 0, TEMPUNIT_K = 1, TEMPUNIT_F = 2 } TempUnit; + void enable_all_steppers(); void disable_all_steppers(); @@ -288,9 +291,20 @@ extern bool axis_homed[3]; // axis[n].is_homed // GCode support for external objects bool code_seen(char); -float code_value(); +float code_value_float(); +unsigned long code_value_ulong(); long code_value_long(); -int16_t code_value_short(); +int code_value_int(); +uint16_t code_value_ushort(); +uint8_t code_value_byte(); +bool code_value_bool(); +float code_value_linear_units(); +float code_value_per_axis_unit(int axis); +float code_value_axis_units(int axis); +float code_value_temp_abs(); +float code_value_temp_diff(); +millis_t code_value_millis(); +millis_t code_value_millis_from_seconds(); #if ENABLED(DELTA) extern float delta[3]; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 75c766118..cb14abe39 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -109,6 +109,8 @@ * G5 - Cubic B-spline with XYZE destination and IJPQ offsets * G10 - retract filament according to settings of M207 * G11 - retract recover filament according to settings of M208 + * G20 - Set input units to inches + * G21 - Set input units to millimeters * G28 - Home one or more axes * G29 - Detailed Z probe, probes the bed at 3 or more points. Will fail if you haven't homed yet. * G30 - Single Z probe, probes bed at current XY location. @@ -178,6 +180,7 @@ * M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) * M140 - Set bed target temp * M145 - Set the heatup state H B F for S (0=PLA, 1=ABS) + * M149 - Set temperature units * M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. * M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling @@ -285,6 +288,14 @@ static int cmd_queue_index_w = 0; static int commands_in_queue = 0; static char command_queue[BUFSIZE][MAX_CMD_SIZE]; +#if ENABLED(INCH_MODE_SUPPORT) + float linear_unit_factor = 1.0; + float volumetric_unit_factor = 1.0; +#endif +#if ENABLED(TEMPERATURE_UNITS_SUPPORT) + TempUnit input_temp_units = TEMPUNIT_C; +#endif + const float homing_feedrate[] = HOMING_FEEDRATE; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedrate_multiplier = 100; //100->1 200->2 @@ -1165,7 +1176,7 @@ bool code_has_value() { return NUMERIC(c); } -float code_value() { +float code_value_float() { float ret; char* e = strchr(seen_pointer, 'E'); if (e) { @@ -1178,9 +1189,96 @@ float code_value() { return ret; } +unsigned long code_value_ulong() { return strtoul(seen_pointer + 1, NULL, 10); } + long code_value_long() { return strtol(seen_pointer + 1, NULL, 10); } -int16_t code_value_short() { return (int16_t)strtol(seen_pointer + 1, NULL, 10); } +int code_value_int() { return (int)strtol(seen_pointer + 1, NULL, 10); } + +uint16_t code_value_ushort() { return (uint16_t)strtoul(seen_pointer + 1, NULL, 10); } + +uint8_t code_value_byte() { return (uint8_t)(constrain(strtol(seen_pointer + 1, NULL, 10), 0, 255)); } + +bool code_value_bool() { return code_value_byte() > 0; } + +#if ENABLED(INCH_MODE_SUPPORT) + void set_input_linear_units(LinearUnit units) { + switch (units) { + case LINEARUNIT_INCH: + linear_unit_factor = 25.4; + break; + case LINEARUNIT_MM: + default: + linear_unit_factor = 1.0; + break; + } + volumetric_unit_factor = pow(linear_unit_factor, 3.0); + } + + float axis_unit_factor(int axis) { + return (axis == E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); + } + + float code_value_linear_units() { + return code_value_float() * linear_unit_factor; + } + + float code_value_per_axis_unit(int axis) { + return code_value_float() / axis_unit_factor(axis); + } + + float code_value_axis_units(int axis) { + return code_value_float() * axis_unit_factor(axis); + } +#else + float code_value_linear_units() { return code_value_float(); } + + float code_value_per_axis_unit(int axis) { return code_value_float(); } + + float code_value_axis_units(int axis) { return code_value_float(); } +#endif + +#if ENABLED(TEMPERATURE_UNITS_SUPPORT) + void set_input_temp_units(TempUnit units) { + input_temp_units = units; + } + + float code_value_temp_abs() { + switch (input_temp_units) { + case TEMPUNIT_C: + return code_value_float(); + case TEMPUNIT_F: + return (code_value_float() - 32) / 1.8; + case TEMPUNIT_K: + return code_value_float() - 272.15; + default: + return code_value_float(); + } + } + + float code_value_temp_diff() { + switch (input_temp_units) { + case TEMPUNIT_C: + case TEMPUNIT_K: + return code_value_float(); + case TEMPUNIT_F: + return code_value_float() / 1.8; + default: + return code_value_float(); + } + } +#else + float code_value_temp_abs() { return code_value_float(); } + float code_value_temp_diff() { return code_value_float(); } +#endif + +millis_t code_value_millis() { + return code_value_ulong(); +} + +millis_t code_value_millis_from_seconds() { + return code_value_float() * 1000; +} bool code_seen(char code) { seen_pointer = strchr(current_command_args, code); @@ -1194,7 +1292,7 @@ bool code_seen(char code) { */ bool get_target_extruder_from_command(int code) { if (code_seen('T')) { - short t = code_value_short(); + uint8_t t = code_value_byte(); if (t >= EXTRUDERS) { SERIAL_ECHO_START; SERIAL_CHAR('M'); @@ -2429,12 +2527,12 @@ static void homeaxis(AxisEnum axis) { void gcode_get_destination() { for (int i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) - destination[i] = code_value() + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0); + destination[i] = code_value_axis_units(i) + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0); else destination[i] = current_position[i]; } if (code_seen('F')) { - float next_feedrate = code_value(); + float next_feedrate = code_value_linear_units(); if (next_feedrate > 0.0) feedrate = next_feedrate; } } @@ -2526,8 +2624,8 @@ inline void gcode_G0_G1() { // Center of arc as offset from current_position float arc_offset[2] = { - code_seen('I') ? code_value() : 0, - code_seen('J') ? code_value() : 0 + code_seen('I') ? code_value_axis_units(X_AXIS) : 0, + code_seen('J') ? code_value_axis_units(Y_AXIS) : 0 }; // Send an arc to the planner @@ -2544,8 +2642,8 @@ inline void gcode_G0_G1() { inline void gcode_G4() { millis_t codenum = 0; - if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait - if (code_seen('S')) codenum = code_value() * 1000UL; // seconds to wait + if (code_seen('P')) codenum = code_value_millis(); // milliseconds to wait + if (code_seen('S')) codenum = code_value_millis_from_seconds(); // seconds to wait stepper.synchronize(); refresh_cmd_timeout(); @@ -2574,10 +2672,10 @@ inline void gcode_G4() { gcode_get_destination(); float offset[] = { - code_seen('I') ? code_value() : 0.0, - code_seen('J') ? code_value() : 0.0, - code_seen('P') ? code_value() : 0.0, - code_seen('Q') ? code_value() : 0.0 + code_seen('I') ? code_value_axis_units(X_AXIS) : 0.0, + code_seen('J') ? code_value_axis_units(Y_AXIS) : 0.0, + code_seen('P') ? code_value_axis_units(X_AXIS) : 0.0, + code_seen('Q') ? code_value_axis_units(Y_AXIS) : 0.0 }; plan_cubic_move(offset); @@ -2595,7 +2693,7 @@ inline void gcode_G4() { inline void gcode_G10_G11(bool doRetract=false) { #if EXTRUDERS > 1 if (doRetract) { - retracted_swap[active_extruder] = (code_seen('S') && code_value_short() == 1); // checks for swap retract argument + retracted_swap[active_extruder] = (code_seen('S') && code_value_bool()); // checks for swap retract argument } #endif retract(doRetract @@ -2607,6 +2705,22 @@ inline void gcode_G4() { #endif //FWRETRACT +#if ENABLED(INCH_MODE_SUPPORT) + /** + * G20: Set input mode to inches + */ + inline void gcode_G20() { + set_input_linear_units(LINEARUNIT_INCH); + } + + /** + * G21: Set input mode to millimeters + */ + inline void gcode_G21() { + set_input_linear_units(LINEARUNIT_MM); + } +#endif + /** * G28: Home all axes according to settings * @@ -3047,7 +3161,7 @@ inline void gcode_G28() { inline void gcode_G29() { static int probe_point = -1; - MeshLevelingState state = code_seen('S') ? (MeshLevelingState)code_value_short() : MeshReport; + MeshLevelingState state = code_seen('S') ? (MeshLevelingState)code_value_byte() : MeshReport; if (state < 0 || state > 5) { SERIAL_PROTOCOLLNPGM("S out of range (0-5)."); return; @@ -3132,7 +3246,7 @@ inline void gcode_G28() { case MeshSet: if (code_seen('X')) { - px = code_value_long() - 1; + px = code_value_int() - 1; if (px < 0 || px >= MESH_NUM_X_POINTS) { SERIAL_PROTOCOLPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").\n"); return; @@ -3143,7 +3257,7 @@ inline void gcode_G28() { return; } if (code_seen('Y')) { - py = code_value_long() - 1; + py = code_value_int() - 1; if (py < 0 || py >= MESH_NUM_Y_POINTS) { SERIAL_PROTOCOLPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").\n"); return; @@ -3154,7 +3268,7 @@ inline void gcode_G28() { return; } if (code_seen('Z')) { - z = code_value(); + z = code_value_axis_units(Z_AXIS); } else { SERIAL_PROTOCOLPGM("Z not entered.\n"); @@ -3165,7 +3279,7 @@ inline void gcode_G28() { case MeshSetZOffset: if (code_seen('Z')) { - z = code_value(); + z = code_value_axis_units(Z_AXIS); } else { SERIAL_PROTOCOLPGM("Z not entered.\n"); @@ -3251,7 +3365,7 @@ inline void gcode_G28() { return; } - int verbose_level = code_seen('V') ? code_value_short() : 1; + int verbose_level = code_seen('V') ? code_value_int() : 1; if (verbose_level < 0 || verbose_level > 4) { SERIAL_ECHOLNPGM("?(V)erbose Level is implausible (0-4)."); return; @@ -3274,19 +3388,19 @@ inline void gcode_G28() { int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS; #if DISABLED(DELTA) - if (code_seen('P')) auto_bed_leveling_grid_points = code_value_short(); + if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int(); if (auto_bed_leveling_grid_points < 2) { SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n"); return; } #endif - xy_travel_speed = code_seen('S') ? code_value_short() : XY_TRAVEL_SPEED; + xy_travel_speed = code_seen('S') ? (int)code_value_linear_units() : XY_TRAVEL_SPEED; - int left_probe_bed_position = code_seen('L') ? code_value_short() : LEFT_PROBE_BED_POSITION, - right_probe_bed_position = code_seen('R') ? code_value_short() : RIGHT_PROBE_BED_POSITION, - front_probe_bed_position = code_seen('F') ? code_value_short() : FRONT_PROBE_BED_POSITION, - back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION; + int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LEFT_PROBE_BED_POSITION, + right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : RIGHT_PROBE_BED_POSITION, + front_probe_bed_position = code_seen('F') ? (int)code_value_axis_units(Y_AXIS) : FRONT_PROBE_BED_POSITION, + back_probe_bed_position = code_seen('B') ? (int)code_value_axis_units(Y_AXIS) : BACK_PROBE_BED_POSITION; bool left_out_l = left_probe_bed_position < MIN_PROBE_X, left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - (MIN_PROBE_EDGE), @@ -3377,7 +3491,7 @@ inline void gcode_G28() { delta_grid_spacing[0] = xGridSpacing; delta_grid_spacing[1] = yGridSpacing; float zoffset = zprobe_zoffset; - if (code_seen(axis_codes[Z_AXIS])) zoffset += code_value(); + if (code_seen(axis_codes[Z_AXIS])) zoffset += code_value_axis_units(Z_AXIS); #else // !DELTA /** * solve the plane equation ax + by + d = z @@ -3783,7 +3897,7 @@ inline void gcode_G92() { for (int i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) { float p = current_position[i], - v = code_value(); + v = code_value_axis_units(i); current_position[i] = v; @@ -3821,11 +3935,11 @@ inline void gcode_G92() { millis_t codenum = 0; bool hasP = false, hasS = false; if (code_seen('P')) { - codenum = code_value_short(); // milliseconds to wait + codenum = code_value_millis(); // milliseconds to wait hasP = codenum > 0; } if (code_seen('S')) { - codenum = code_value() * 1000UL; // seconds to wait + codenum = code_value_millis_from_seconds(); // seconds to wait hasS = codenum > 0; } @@ -4040,10 +4154,10 @@ inline void gcode_M31() { */ inline void gcode_M42() { if (code_seen('S')) { - int pin_status = code_value_short(); + int pin_status = code_value_int(); if (pin_status < 0 || pin_status > 255) return; - int pin_number = code_seen('P') ? code_value_short() : LED_PIN; + int pin_number = code_seen('P') ? code_value_int() : LED_PIN; if (pin_number < 0) return; for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) @@ -4113,7 +4227,7 @@ inline void gcode_M42() { int8_t verbose_level = 1, n_samples = 10, n_legs = 0, schizoid_flag = 0; if (code_seen('V')) { - verbose_level = code_value_short(); + verbose_level = code_value_byte(); if (verbose_level < 0 || verbose_level > 4) { SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n"); return; @@ -4124,7 +4238,7 @@ inline void gcode_M42() { SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n"); if (code_seen('P')) { - n_samples = code_value_short(); + n_samples = code_value_byte(); if (n_samples < 4 || n_samples > 50) { SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n"); return; @@ -4140,7 +4254,7 @@ inline void gcode_M42() { bool deploy_probe_for_each_reading = code_seen('E'); if (code_seen('X')) { - X_probe_location = code_value(); + X_probe_location = code_value_axis_units(X_AXIS); #if DISABLED(DELTA) if (X_probe_location < MIN_PROBE_X || X_probe_location > MAX_PROBE_X) { out_of_range_error(PSTR("X")); @@ -4150,7 +4264,7 @@ inline void gcode_M42() { } if (code_seen('Y')) { - Y_probe_location = code_value(); + Y_probe_location = code_value_axis_units(Y_AXIS); #if DISABLED(DELTA) if (Y_probe_location < MIN_PROBE_Y || Y_probe_location > MAX_PROBE_Y) { out_of_range_error(PSTR("Y")); @@ -4169,7 +4283,7 @@ inline void gcode_M42() { bool seen_L = code_seen('L'); if (seen_L) { - n_legs = code_value_short(); + n_legs = code_value_byte(); if (n_legs < 0 || n_legs > 15) { SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); return; @@ -4387,7 +4501,7 @@ inline void gcode_M77() { print_job_timer.stop(); } */ inline void gcode_M78() { // "M78 S78" will reset the statistics - if (code_seen('S') && code_value_short() == 78) + if (code_seen('S') && code_value_int() == 78) print_job_timer.initStats(); else print_job_timer.showStats(); } @@ -4405,7 +4519,7 @@ inline void gcode_M104() { #endif if (code_seen('S')) { - float temp = code_value(); + float temp = code_value_temp_abs(); thermalManager.setTargetHotend(temp, target_extruder); #if ENABLED(DUAL_X_CARRIAGE) if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) @@ -4533,8 +4647,8 @@ inline void gcode_M105() { * P Fan index, if more than one fan */ inline void gcode_M106() { - uint16_t s = code_seen('S') ? code_value_short() : 255, - p = code_seen('P') ? code_value_short() : 0; + uint16_t s = code_seen('S') ? code_value_ushort() : 255, + p = code_seen('P') ? code_value_ushort() : 0; NOMORE(s, 255); if (p < FAN_COUNT) fanSpeeds[p] = s; } @@ -4543,7 +4657,7 @@ inline void gcode_M105() { * M107: Fan Off */ inline void gcode_M107() { - uint16_t p = code_seen('P') ? code_value_short() : 0; + uint16_t p = code_seen('P') ? code_value_ushort() : 0; if (p < FAN_COUNT) fanSpeeds[p] = 0; } @@ -4564,7 +4678,7 @@ inline void gcode_M109() { bool no_wait_for_cooling = code_seen('S'); if (no_wait_for_cooling || code_seen('R')) { - float temp = code_value(); + float temp = code_value_temp_abs(); thermalManager.setTargetHotend(temp, target_extruder); #if ENABLED(DUAL_X_CARRIAGE) if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) @@ -4681,7 +4795,7 @@ inline void gcode_M109() { LCD_MESSAGEPGM(MSG_BED_HEATING); bool no_wait_for_cooling = code_seen('S'); - if (no_wait_for_cooling || code_seen('R')) thermalManager.setTargetBed(code_value()); + if (no_wait_for_cooling || code_seen('R')) thermalManager.setTargetBed(code_value_temp_abs()); #if TEMP_BED_RESIDENCY_TIME > 0 millis_t residency_start_ms = 0; @@ -4767,7 +4881,7 @@ inline void gcode_M110() { * M111: Set the debug level */ inline void gcode_M111() { - marlin_debug_flags = code_seen('S') ? code_value_short() : DEBUG_NONE; + marlin_debug_flags = code_seen('S') ? code_value_byte() : DEBUG_NONE; const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO; const static char str_debug_2[] PROGMEM = MSG_DEBUG_INFO; @@ -4816,7 +4930,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } */ inline void gcode_M113() { if (code_seen('S')) { - host_keepalive_interval = (uint8_t)code_value_short(); + host_keepalive_interval = code_value_byte(); NOMORE(host_keepalive_interval, 60); } else { @@ -4834,7 +4948,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } /** * M126: Heater 1 valve open */ - inline void gcode_M126() { baricuda_valve_pressure = code_seen('S') ? constrain(code_value(), 0, 255) : 255; } + inline void gcode_M126() { baricuda_valve_pressure = code_seen('S') ? code_value_byte() : 255; } /** * M127: Heater 1 valve close */ @@ -4845,7 +4959,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } /** * M128: Heater 2 valve open */ - inline void gcode_M128() { baricuda_e_to_p_pressure = code_seen('S') ? constrain(code_value(), 0, 255) : 255; } + inline void gcode_M128() { baricuda_e_to_p_pressure = code_seen('S') ? code_value_byte() : 255; } /** * M129: Heater 2 valve close */ @@ -4859,7 +4973,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } */ inline void gcode_M140() { if (DEBUGGING(DRYRUN)) return; - if (code_seen('S')) thermalManager.setTargetBed(code_value()); + if (code_seen('S')) thermalManager.setTargetBed(code_value_temp_abs()); } #if ENABLED(ULTIPANEL) @@ -4872,7 +4986,7 @@ inline void gcode_M140() { * F */ inline void gcode_M145() { - int8_t material = code_seen('S') ? code_value_short() : 0; + int8_t material = code_seen('S') ? (int8_t)code_value_int() : 0; if (material < 0 || material > 1) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_MATERIAL_INDEX); @@ -4882,32 +4996,32 @@ inline void gcode_M140() { switch (material) { case 0: if (code_seen('H')) { - v = code_value_short(); + v = code_value_int(); plaPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); } if (code_seen('F')) { - v = code_value_short(); + v = code_value_int(); plaPreheatFanSpeed = constrain(v, 0, 255); } #if TEMP_SENSOR_BED != 0 if (code_seen('B')) { - v = code_value_short(); + v = code_value_int(); plaPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); } #endif break; case 1: if (code_seen('H')) { - v = code_value_short(); + v = code_value_int(); absPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); } if (code_seen('F')) { - v = code_value_short(); + v = code_value_int(); absPreheatFanSpeed = constrain(v, 0, 255); } #if TEMP_SENSOR_BED != 0 if (code_seen('B')) { - v = code_value_short(); + v = code_value_int(); absPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); } #endif @@ -4918,6 +5032,21 @@ inline void gcode_M140() { #endif +#if ENABLED(TEMPERATURE_UNITS_SUPPORT) + /** + * M149: Set temperature units + */ + inline void gcode_M149() { + if (code_seen('C')) { + set_input_temp_units(TEMPUNIT_C); + } else if (code_seen('K')) { + set_input_temp_units(TEMPUNIT_K); + } else if (code_seen('F')) { + set_input_temp_units(TEMPUNIT_F); + } + } +#endif + #if HAS_POWER_SWITCH /** @@ -4991,7 +5120,7 @@ inline void gcode_M83() { axis_relative_modes[E_AXIS] = true; } */ inline void gcode_M18_M84() { if (code_seen('S')) { - stepper_inactive_time = code_value() * 1000UL; + stepper_inactive_time = code_value_millis_from_seconds(); } else { bool all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])) || (code_seen(axis_codes[E_AXIS]))); @@ -5019,7 +5148,7 @@ inline void gcode_M18_M84() { * M85: Set inactivity shutdown timer with parameter S. To disable set zero (default) */ inline void gcode_M85() { - if (code_seen('S')) max_inactive_time = code_value() * 1000UL; + if (code_seen('S')) max_inactive_time = code_value_millis_from_seconds(); } /** @@ -5030,7 +5159,7 @@ inline void gcode_M92() { for (int8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) { if (i == E_AXIS) { - float value = code_value(); + float value = code_value_per_axis_unit(i); if (value < 20.0) { float factor = planner.axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab. planner.max_e_jerk *= factor; @@ -5040,7 +5169,7 @@ inline void gcode_M92() { planner.axis_steps_per_unit[i] = value; } else { - planner.axis_steps_per_unit[i] = code_value(); + planner.axis_steps_per_unit[i] = code_value_per_axis_unit(i); } } } @@ -5123,9 +5252,9 @@ inline void gcode_M121() { endstops.enable_globally(false); } */ inline void gcode_M150() { SendColors( - code_seen('R') ? (byte)code_value_short() : 0, - code_seen('U') ? (byte)code_value_short() : 0, - code_seen('B') ? (byte)code_value_short() : 0 + code_seen('R') ? code_value_byte() : 0, + code_seen('U') ? code_value_byte() : 0, + code_seen('B') ? code_value_byte() : 0 ); } @@ -5152,11 +5281,11 @@ inline void gcode_M121() { endstops.enable_globally(false); } inline void gcode_M155() { // Set the target address if (code_seen('A')) - i2c.address((uint8_t) code_value_short()); + i2c.address(code_value_byte()); // Add a new byte to the buffer else if (code_seen('B')) - i2c.addbyte((int) code_value_short()); + i2c.addbyte(code_value_int()); // Flush the buffer to the bus else if (code_seen('S')) i2c.send(); @@ -5171,8 +5300,8 @@ inline void gcode_M121() { endstops.enable_globally(false); } * Usage: M156 A B */ inline void gcode_M156() { - uint8_t addr = code_seen('A') ? code_value_short() : 0; - int bytes = code_seen('B') ? code_value_short() : 1; + uint8_t addr = code_seen('A') ? code_value_byte() : 0; + int bytes = code_seen('B') ? code_value_int() : 1; if (addr && bytes > 0 && bytes <= 32) { i2c.address(addr); @@ -5187,17 +5316,17 @@ inline void gcode_M121() { endstops.enable_globally(false); } #endif //EXPERIMENTAL_I2CBUS /** - * M200: Set filament diameter and set E axis units to cubic millimeters + * M200: Set filament diameter and set E axis units to cubic units * * T - Optional extruder number. Current extruder if omitted. - * D - Diameter of the filament. Use "D0" to set units back to millimeters. + * D - Diameter of the filament. Use "D0" to switch back to linear units on the E axis. */ inline void gcode_M200() { if (get_target_extruder_from_command(200)) return; if (code_seen('D')) { - float diameter = code_value(); + float diameter = code_value_linear_units(); // setting any extruder filament size disables volumetric on the assumption that // slicers either generate in extruder values as cubic mm or as as filament feeds // for all extruders @@ -5222,7 +5351,7 @@ inline void gcode_M200() { inline void gcode_M201() { for (int8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) { - planner.max_acceleration_units_per_sq_second[i] = code_value(); + planner.max_acceleration_units_per_sq_second[i] = code_value_axis_units(i); } } // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner) @@ -5232,7 +5361,7 @@ inline void gcode_M201() { #if 0 // Not used for Sprinter/grbl gen6 inline void gcode_M202() { for (int8_t i = 0; i < NUM_AXIS; i++) { - if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value() * planner.axis_steps_per_unit[i]; + if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units(i) * planner.axis_steps_per_unit[i]; } } #endif @@ -5244,7 +5373,7 @@ inline void gcode_M201() { inline void gcode_M203() { for (int8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) { - planner.max_feedrate[i] = code_value(); + planner.max_feedrate[i] = code_value_axis_units(i); } } } @@ -5260,22 +5389,22 @@ inline void gcode_M203() { */ inline void gcode_M204() { if (code_seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. - planner.travel_acceleration = planner.acceleration = code_value(); + planner.travel_acceleration = planner.acceleration = code_value_linear_units(); SERIAL_ECHOPAIR("Setting Print and Travel Acceleration: ", planner.acceleration); SERIAL_EOL; } if (code_seen('P')) { - planner.acceleration = code_value(); + planner.acceleration = code_value_linear_units(); SERIAL_ECHOPAIR("Setting Print Acceleration: ", planner.acceleration); SERIAL_EOL; } if (code_seen('R')) { - planner.retract_acceleration = code_value(); + planner.retract_acceleration = code_value_linear_units(); SERIAL_ECHOPAIR("Setting Retract Acceleration: ", planner.retract_acceleration); SERIAL_EOL; } if (code_seen('T')) { - planner.travel_acceleration = code_value(); + planner.travel_acceleration = code_value_linear_units(); SERIAL_ECHOPAIR("Setting Travel Acceleration: ", planner.travel_acceleration); SERIAL_EOL; } @@ -5292,12 +5421,12 @@ inline void gcode_M204() { * E = Max E Jerk (mm/s/s) */ inline void gcode_M205() { - if (code_seen('S')) planner.min_feedrate = code_value(); - if (code_seen('T')) planner.min_travel_feedrate = code_value(); - if (code_seen('B')) planner.min_segment_time = code_value(); - if (code_seen('X')) planner.max_xy_jerk = code_value(); - if (code_seen('Z')) planner.max_z_jerk = code_value(); - if (code_seen('E')) planner.max_e_jerk = code_value(); + if (code_seen('S')) planner.min_feedrate = code_value_linear_units(); + if (code_seen('T')) planner.min_travel_feedrate = code_value_linear_units(); + if (code_seen('B')) planner.min_segment_time = code_value_millis(); + if (code_seen('X')) planner.max_xy_jerk = code_value_linear_units(); + if (code_seen('Z')) planner.max_z_jerk = code_value_axis_units(Z_AXIS); + if (code_seen('E')) planner.max_e_jerk = code_value_axis_units(E_AXIS); } /** @@ -5306,11 +5435,11 @@ inline void gcode_M205() { inline void gcode_M206() { for (int8_t i = X_AXIS; i <= Z_AXIS; i++) if (code_seen(axis_codes[i])) - set_home_offset((AxisEnum)i, code_value()); + set_home_offset((AxisEnum)i, code_value_axis_units(i)); #if ENABLED(SCARA) - if (code_seen('T')) set_home_offset(X_AXIS, code_value()); // Theta - if (code_seen('P')) set_home_offset(Y_AXIS, code_value()); // Psi + if (code_seen('T')) set_home_offset(X_AXIS, code_value_axis_units(X_AXIS)); // Theta + if (code_seen('P')) set_home_offset(Y_AXIS, code_value_axis_units(Y_AXIS)); // Psi #endif sync_plan_position(); @@ -5329,12 +5458,12 @@ inline void gcode_M206() { * C = Gamma (Tower 3) diagonal rod trim */ inline void gcode_M665() { - if (code_seen('L')) delta_diagonal_rod = code_value(); - if (code_seen('R')) delta_radius = code_value(); - if (code_seen('S')) delta_segments_per_second = code_value(); - if (code_seen('A')) delta_diagonal_rod_trim_tower_1 = code_value(); - if (code_seen('B')) delta_diagonal_rod_trim_tower_2 = code_value(); - if (code_seen('C')) delta_diagonal_rod_trim_tower_3 = code_value(); + if (code_seen('L')) delta_diagonal_rod = code_value_linear_units(); + if (code_seen('R')) delta_radius = code_value_linear_units(); + if (code_seen('S')) delta_segments_per_second = code_value_float(); + if (code_seen('A')) delta_diagonal_rod_trim_tower_1 = code_value_linear_units(); + if (code_seen('B')) delta_diagonal_rod_trim_tower_2 = code_value_linear_units(); + if (code_seen('C')) delta_diagonal_rod_trim_tower_3 = code_value_linear_units(); recalc_delta_settings(delta_radius, delta_diagonal_rod); } /** @@ -5348,7 +5477,7 @@ inline void gcode_M206() { #endif for (int8_t i = X_AXIS; i <= Z_AXIS; i++) { if (code_seen(axis_codes[i])) { - endstop_adj[i] = code_value(); + endstop_adj[i] = code_value_axis_units(i); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPGM("endstop_adj["); @@ -5372,7 +5501,7 @@ inline void gcode_M206() { * M666: For Z Dual Endstop setup, set z axis offset to the z2 axis. */ inline void gcode_M666() { - if (code_seen('Z')) z_endstop_adj = code_value(); + if (code_seen('Z')) z_endstop_adj = code_value_axis_units(Z_AXIS); SERIAL_ECHOPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj); SERIAL_EOL; } @@ -5390,11 +5519,11 @@ inline void gcode_M206() { * Z[mm] retract_zlift */ inline void gcode_M207() { - if (code_seen('S')) retract_length = code_value(); - if (code_seen('F')) retract_feedrate = code_value() / 60; - if (code_seen('Z')) retract_zlift = code_value(); + if (code_seen('S')) retract_length = code_value_axis_units(E_AXIS); + if (code_seen('F')) retract_feedrate = code_value_axis_units(E_AXIS) / 60; + if (code_seen('Z')) retract_zlift = code_value_axis_units(Z_AXIS); #if EXTRUDERS > 1 - if (code_seen('W')) retract_length_swap = code_value(); + if (code_seen('W')) retract_length_swap = code_value_axis_units(E_AXIS); #endif } @@ -5406,10 +5535,10 @@ inline void gcode_M206() { * F[mm/min] retract_recover_feedrate */ inline void gcode_M208() { - if (code_seen('S')) retract_recover_length = code_value(); - if (code_seen('F')) retract_recover_feedrate = code_value() / 60; + if (code_seen('S')) retract_recover_length = code_value_axis_units(E_AXIS); + if (code_seen('F')) retract_recover_feedrate = code_value_axis_units(E_AXIS) / 60; #if EXTRUDERS > 1 - if (code_seen('W')) retract_recover_length_swap = code_value(); + if (code_seen('W')) retract_recover_length_swap = code_value_axis_units(E_AXIS); #endif } @@ -5419,7 +5548,7 @@ inline void gcode_M206() { */ inline void gcode_M209() { if (code_seen('S')) { - int t = code_value_short(); + int t = code_value_int(); switch (t) { case 0: autoretract_enabled = false; @@ -5450,11 +5579,11 @@ inline void gcode_M206() { inline void gcode_M218() { if (get_target_extruder_from_command(218)) return; - if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value(); - if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value(); + if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value_axis_units(X_AXIS); + if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value_axis_units(Y_AXIS); #if ENABLED(DUAL_X_CARRIAGE) - if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value(); + if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value_axis_units(Z_AXIS); #endif SERIAL_ECHO_START; @@ -5478,7 +5607,7 @@ inline void gcode_M206() { * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) */ inline void gcode_M220() { - if (code_seen('S')) feedrate_multiplier = code_value(); + if (code_seen('S')) feedrate_multiplier = code_value_int(); } /** @@ -5486,7 +5615,7 @@ inline void gcode_M220() { */ inline void gcode_M221() { if (code_seen('S')) { - int sval = code_value(); + int sval = code_value_int(); if (get_target_extruder_from_command(221)) return; extruder_multiplier[target_extruder] = sval; } @@ -5497,9 +5626,9 @@ inline void gcode_M221() { */ inline void gcode_M226() { if (code_seen('P')) { - int pin_number = code_value(); + int pin_number = code_value_int(); - int pin_state = code_seen('S') ? code_value() : -1; // required pin state - default is inverted + int pin_state = code_seen('S') ? code_value_int() : -1; // required pin state - default is inverted if (pin_state >= -1 && pin_state <= 1) { @@ -5544,10 +5673,10 @@ inline void gcode_M226() { * M280: Get or set servo position. P S */ inline void gcode_M280() { - int servo_index = code_seen('P') ? code_value_short() : -1; + int servo_index = code_seen('P') ? code_value_int() : -1; int servo_position = 0; if (code_seen('S')) { - servo_position = code_value_short(); + servo_position = code_value_int(); if (servo_index >= 0 && servo_index < NUM_SERVOS) servo[servo_index].move(servo_position); else { @@ -5574,8 +5703,8 @@ inline void gcode_M226() { * M300: Play beep sound S P */ inline void gcode_M300() { - uint16_t beepS = code_seen('S') ? code_value_short() : 110; - uint32_t beepP = code_seen('P') ? code_value_long() : 1000; + uint16_t beepS = code_seen('S') ? code_value_ushort() : 110; + uint32_t beepP = code_seen('P') ? code_value_ulong() : 1000; if (beepP > 5000) beepP = 5000; // limit to 5 seconds buzz(beepP, beepS); } @@ -5600,15 +5729,15 @@ inline void gcode_M226() { // multi-extruder PID patch: M301 updates or prints a single extruder's PID values // default behaviour (omitting E parameter) is to update for extruder 0 only - int e = code_seen('E') ? code_value() : 0; // extruder being updated + int e = code_seen('E') ? code_value_int() : 0; // extruder being updated if (e < HOTENDS) { // catch bad input value - if (code_seen('P')) PID_PARAM(Kp, e) = code_value(); - if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value()); - if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value()); + if (code_seen('P')) PID_PARAM(Kp, e) = code_value_float(); + if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value_float()); + if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value_float()); #if ENABLED(PID_ADD_EXTRUSION_RATE) - if (code_seen('C')) PID_PARAM(Kc, e) = code_value(); - if (code_seen('L')) lpq_len = code_value(); + if (code_seen('C')) PID_PARAM(Kc, e) = code_value_float(); + if (code_seen('L')) lpq_len = code_value_float(); NOMORE(lpq_len, LPQ_MAX_LEN); #endif @@ -5642,9 +5771,9 @@ inline void gcode_M226() { #if ENABLED(PIDTEMPBED) inline void gcode_M304() { - if (code_seen('P')) thermalManager.bedKp = code_value(); - if (code_seen('I')) thermalManager.bedKi = scalePID_i(code_value()); - if (code_seen('D')) thermalManager.bedKd = scalePID_d(code_value()); + if (code_seen('P')) thermalManager.bedKp = code_value_float(); + if (code_seen('I')) thermalManager.bedKi = scalePID_i(code_value_float()); + if (code_seen('D')) thermalManager.bedKd = scalePID_d(code_value_float()); thermalManager.updatePID(); @@ -5701,7 +5830,7 @@ inline void gcode_M226() { * M250: Read and optionally set the LCD contrast */ inline void gcode_M250() { - if (code_seen('C')) set_lcd_contrast(code_value_short()); + if (code_seen('C')) set_lcd_contrast(code_value_int()); SERIAL_PROTOCOLPGM("lcd contrast value: "); SERIAL_PROTOCOL(lcd_contrast); SERIAL_EOL; @@ -5715,7 +5844,7 @@ inline void gcode_M226() { * M302: Allow cold extrudes, or set the minimum extrude S. */ inline void gcode_M302() { - thermalManager.extrude_min_temp = code_seen('S') ? code_value() : 0; + thermalManager.extrude_min_temp = code_seen('S') ? code_value_temp_abs() : 0; } #endif // PREVENT_DANGEROUS_EXTRUDE @@ -5730,11 +5859,11 @@ inline void gcode_M226() { */ inline void gcode_M303() { #if HAS_PID_HEATING - int e = code_seen('E') ? code_value_short() : 0; - int c = code_seen('C') ? code_value_short() : 5; - bool u = code_seen('U') && code_value_short() != 0; + int e = code_seen('E') ? code_value_int() : 0; + int c = code_seen('C') ? code_value_int() : 5; + bool u = code_seen('U') && code_value_bool(); - float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0); + float temp = code_seen('S') ? code_value_temp_abs() : (e < 0 ? 70.0 : 150.0); if (e >= 0 && e < HOTENDS) target_extruder = e; @@ -5814,7 +5943,7 @@ inline void gcode_M303() { inline void gcode_M365() { for (int8_t i = X_AXIS; i <= Z_AXIS; i++) { if (code_seen(axis_codes[i])) { - axis_scaling[i] = code_value(); + axis_scaling[i] = code_value_float(); } } } @@ -5907,7 +6036,7 @@ inline void gcode_M400() { stepper.synchronize(); } */ inline void gcode_M404() { if (code_seen('W')) { - filament_width_nominal = code_value(); + filament_width_nominal = code_value_linear_units(); } else { SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); @@ -5919,7 +6048,9 @@ inline void gcode_M400() { stepper.synchronize(); } * M405: Turn on filament sensor for control */ inline void gcode_M405() { - if (code_seen('D')) meas_delay_cm = code_value(); + // This is technically a linear measurement, but since it's quantized to centimeters and is a different unit than + // everything else, it uses code_value_int() instead of code_value_linear_units(). + if (code_seen('D')) meas_delay_cm = code_value_int(); NOMORE(meas_delay_cm, MAX_MEASUREMENT_DELAY); if (filwidth_delay_index2 == -1) { // Initialize the ring buffer if not done since startup @@ -5990,7 +6121,7 @@ inline void gcode_M410() { /** * M420: Enable/Disable Mesh Bed Leveling */ - inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.set_has_mesh(!!code_value_short()); } + inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.set_has_mesh(code_value_bool()); } /** * M421: Set a single Mesh Bed Leveling Z coordinate @@ -6000,11 +6131,11 @@ inline void gcode_M410() { int8_t px, py; float z = 0; bool hasX, hasY, hasZ, hasI, hasJ; - if ((hasX = code_seen('X'))) px = mbl.probe_index_x(code_value()); - if ((hasY = code_seen('Y'))) py = mbl.probe_index_y(code_value()); - if ((hasI = code_seen('I'))) px = code_value(); - if ((hasJ = code_seen('J'))) py = code_value(); - if ((hasZ = code_seen('Z'))) z = code_value(); + if ((hasX = code_seen('X'))) px = mbl.probe_index_x(code_value_axis_units(X_AXIS)); + if ((hasY = code_seen('Y'))) py = mbl.probe_index_y(code_value_axis_units(Y_AXIS)); + if ((hasI = code_seen('I'))) px = code_value_axis_units(X_AXIS); + if ((hasJ = code_seen('J'))) py = code_value_axis_units(Y_AXIS); + if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS); if (hasX && hasY && hasZ) { @@ -6104,7 +6235,7 @@ inline void gcode_M502() { * M503: print settings currently in memory */ inline void gcode_M503() { - Config_PrintSettings(code_seen('S') && code_value() == 0); + Config_PrintSettings(code_seen('S') && !code_value_bool()); } #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) @@ -6113,7 +6244,7 @@ inline void gcode_M503() { * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>) */ inline void gcode_M540() { - if (code_seen('S')) stepper.abort_on_endstop_hit = (code_value() > 0); + if (code_seen('S')) stepper.abort_on_endstop_hit = code_value_bool(); } #endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED @@ -6127,7 +6258,7 @@ inline void gcode_M503() { SERIAL_CHAR(' '); if (code_seen('Z')) { - float value = code_value(); + float value = code_value_axis_units(Z_AXIS); if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) { zprobe_zoffset = value; SERIAL_ECHO(zprobe_zoffset); @@ -6186,7 +6317,7 @@ inline void gcode_M503() { #endif //retract by E - if (code_seen('E')) destination[E_AXIS] += code_value(); + if (code_seen('E')) destination[E_AXIS] += code_value_axis_units(E_AXIS); #ifdef FILAMENTCHANGE_FIRSTRETRACT else destination[E_AXIS] += FILAMENTCHANGE_FIRSTRETRACT; #endif @@ -6194,7 +6325,7 @@ inline void gcode_M503() { RUNPLAN; //lift Z - if (code_seen('Z')) destination[Z_AXIS] += code_value(); + if (code_seen('Z')) destination[Z_AXIS] += code_value_axis_units(Z_AXIS); #ifdef FILAMENTCHANGE_ZADD else destination[Z_AXIS] += FILAMENTCHANGE_ZADD; #endif @@ -6202,19 +6333,19 @@ inline void gcode_M503() { RUNPLAN; //move xy - if (code_seen('X')) destination[X_AXIS] = code_value(); + if (code_seen('X')) destination[X_AXIS] = code_value_axis_units(X_AXIS); #ifdef FILAMENTCHANGE_XPOS else destination[X_AXIS] = FILAMENTCHANGE_XPOS; #endif - if (code_seen('Y')) destination[Y_AXIS] = code_value(); + if (code_seen('Y')) destination[Y_AXIS] = code_value_axis_units(Y_AXIS); #ifdef FILAMENTCHANGE_YPOS else destination[Y_AXIS] = FILAMENTCHANGE_YPOS; #endif RUNPLAN; - if (code_seen('L')) destination[E_AXIS] += code_value(); + if (code_seen('L')) destination[E_AXIS] += code_value_axis_units(E_AXIS); #ifdef FILAMENTCHANGE_FINALRETRACT else destination[E_AXIS] += FILAMENTCHANGE_FINALRETRACT; #endif @@ -6258,7 +6389,7 @@ inline void gcode_M503() { #endif //return to normal - if (code_seen('L')) destination[E_AXIS] -= code_value(); + if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS); #ifdef FILAMENTCHANGE_FINALRETRACT else destination[E_AXIS] -= FILAMENTCHANGE_FINALRETRACT; #endif @@ -6310,11 +6441,11 @@ inline void gcode_M503() { */ inline void gcode_M605() { stepper.synchronize(); - if (code_seen('S')) dual_x_carriage_mode = code_value(); + if (code_seen('S')) dual_x_carriage_mode = code_value_byte(); switch (dual_x_carriage_mode) { case DXC_DUPLICATION_MODE: - if (code_seen('X')) duplicate_extruder_x_offset = max(code_value(), X2_MIN_POS - x_home_pos(0)); - if (code_seen('R')) duplicate_extruder_temp_offset = code_value(); + if (code_seen('X')) duplicate_extruder_x_offset = max(code_value_axis_units(X_AXIS), X2_MIN_POS - x_home_pos(0)); + if (code_seen('R')) duplicate_extruder_temp_offset = code_value_temp_diff(); SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); SERIAL_CHAR(' '); @@ -6346,31 +6477,31 @@ inline void gcode_M503() { inline void gcode_M907() { #if HAS_DIGIPOTSS for (int i = 0; i < NUM_AXIS; i++) - if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value()); - if (code_seen('B')) stepper.digipot_current(4, code_value()); - if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value()); + if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int()); + if (code_seen('B')) stepper.digipot_current(4, code_value_int()); + if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value_int()); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - if (code_seen('X')) stepper.digipot_current(0, code_value()); + if (code_seen('X')) stepper.digipot_current(0, code_value_int()); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - if (code_seen('Z')) stepper.digipot_current(1, code_value()); + if (code_seen('Z')) stepper.digipot_current(1, code_value_int()); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - if (code_seen('E')) stepper.digipot_current(2, code_value()); + if (code_seen('E')) stepper.digipot_current(2, code_value_int()); #endif #if ENABLED(DIGIPOT_I2C) // this one uses actual amps in floating point - for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value()); + for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value_float()); // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...) - for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value()); + for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value_float()); #endif #if ENABLED(DAC_STEPPER_CURRENT) if (code_seen('S')) { - float dac_percent = code_value(); + float dac_percent = code_value_float(); for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent); } - for (uint8_t i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) dac_current_percent(i, code_value()); + for (uint8_t i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) dac_current_percent(i, code_value_float()); #endif } @@ -6382,14 +6513,14 @@ inline void gcode_M907() { inline void gcode_M908() { #if HAS_DIGIPOTSS stepper.digitalPotWrite( - code_seen('P') ? code_value() : 0, - code_seen('S') ? code_value() : 0 + code_seen('P') ? code_value_int() : 0, + code_seen('S') ? code_value_int() : 0 ); #endif #ifdef DAC_STEPPER_CURRENT dac_current_raw( - code_seen('P') ? code_value_long() : -1, - code_seen('S') ? code_value_short() : 0 + code_seen('P') ? code_value_byte() : -1, + code_seen('S') ? code_value_ushort() : 0 ); #endif } @@ -6408,9 +6539,9 @@ inline void gcode_M907() { // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. inline void gcode_M350() { - if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.microstep_mode(i, code_value()); - for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_mode(i, (uint8_t)code_value()); - if (code_seen('B')) stepper.microstep_mode(4, code_value()); + if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.microstep_mode(i, code_value_byte()); + for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_mode(i, code_value_byte()); + if (code_seen('B')) stepper.microstep_mode(4, code_value_byte()); stepper.microstep_readings(); } @@ -6419,14 +6550,14 @@ inline void gcode_M907() { * S# determines MS1 or MS2, X# sets the pin high/low. */ inline void gcode_M351() { - if (code_seen('S')) switch (code_value_short()) { + if (code_seen('S')) switch (code_value_byte()) { case 1: - for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, code_value(), -1); - if (code_seen('B')) stepper.microstep_ms(4, code_value(), -1); + for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, code_value_byte(), -1); + if (code_seen('B')) stepper.microstep_ms(4, code_value_byte(), -1); break; case 2: - for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, -1, code_value()); - if (code_seen('B')) stepper.microstep_ms(4, -1, code_value()); + for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, -1, code_value_byte()); + if (code_seen('B')) stepper.microstep_ms(4, -1, code_value_byte()); break; } stepper.microstep_readings(); @@ -6448,7 +6579,7 @@ inline void gcode_M999() { Running = true; lcd_reset_alert_level(); - if (code_seen('S') && code_value_short() == 1) return; + if (code_seen('S') && code_value_bool()) return; // gcode_LastN = Stopped_gcode_LastN; FlushSerialRequestResend(); @@ -6471,7 +6602,7 @@ inline void gcode_T(uint8_t tmp_extruder) { float stored_feedrate = feedrate; if (code_seen('F')) { - float next_feedrate = code_value(); + float next_feedrate = code_value_axis_units(E_AXIS); if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate; } else { @@ -6703,6 +6834,16 @@ void process_next_command() { #endif // FWRETRACT + #if ENABLED(INCH_MODE_SUPPORT) + case 20: //G20: Inch Mode + gcode_G20(); + break; + + case 21: //G21: MM Mode + gcode_G21(); + break; + #endif + case 28: // G28: Home all axes, one at a time gcode_G28(); break; @@ -6961,6 +7102,12 @@ void process_next_command() { #endif + #if ENABLED(TEMPERATURE_UNITS_SUPPORT) + case 149: + gcode_M149(); + break; + #endif + #if ENABLED(BLINKM) case 150: // M150 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 2cfe41a9d..d0e6a2453 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -732,6 +732,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 0fbcb652d..fad973957 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -730,6 +730,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 989d6ae27..e8285598f 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -741,6 +741,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 4f2c1fab0..efb8f5bfd 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -743,6 +743,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index c4c0572c6..c0530274c 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -766,6 +766,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 27c70aa97..098c813ec 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -749,6 +749,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 40910c8cb..0ea247551 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -744,6 +744,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 736b835a4..77c1105b9 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -757,6 +757,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 4586e843f..af2ca3faf 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -770,6 +770,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 58bb250ab..dc0debd76 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -741,6 +741,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 5cec85584..70bf487ea 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -749,6 +749,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 94565f1aa..76d7046a9 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -838,6 +838,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index c04ba9942..e3e0988ca 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -832,6 +832,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 7e9d06d84..b0811e3ed 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -835,6 +835,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 8e21082dd..8d6aed2f0 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -835,6 +835,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 0c5efa12e..812af17ca 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -837,6 +837,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 615fec082..4434c68c0 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -752,6 +752,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 4c9cbe352..5ec43116f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -743,6 +743,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + // @section temperature // Preheat Constants diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index c4c551f01..d5e8312ed 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1155,9 +1155,9 @@ void Planner::reset_acceleration_rates() { void Planner::autotemp_M109() { autotemp_enabled = code_seen('F'); - if (autotemp_enabled) autotemp_factor = code_value(); - if (code_seen('S')) autotemp_min = code_value(); - if (code_seen('B')) autotemp_max = code_value(); + if (autotemp_enabled) autotemp_factor = code_value_temp_diff(); + if (code_seen('S')) autotemp_min = code_value_temp_abs(); + if (code_seen('B')) autotemp_max = code_value_temp_abs(); } #endif From 4980ecc1f76d8e8952ec5acfae33854f6f81acdf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Jun 2016 17:03:28 -0700 Subject: [PATCH 027/580] Smaller binary using inline gcode argument getters --- Marlin/Marlin.h | 11 --------- Marlin/Marlin_main.cpp | 52 +++++++++++++++--------------------------- 2 files changed, 19 insertions(+), 44 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 5e0b6bfb9..7b275b0cb 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -291,20 +291,9 @@ extern bool axis_homed[3]; // axis[n].is_homed // GCode support for external objects bool code_seen(char); -float code_value_float(); -unsigned long code_value_ulong(); -long code_value_long(); int code_value_int(); -uint16_t code_value_ushort(); -uint8_t code_value_byte(); -bool code_value_bool(); -float code_value_linear_units(); -float code_value_per_axis_unit(int axis); -float code_value_axis_units(int axis); float code_value_temp_abs(); float code_value_temp_diff(); -millis_t code_value_millis(); -millis_t code_value_millis_from_seconds(); #if ENABLED(DELTA) extern float delta[3]; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cb14abe39..475dea4aa 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1167,7 +1167,7 @@ void get_available_commands() { #endif } -bool code_has_value() { +inline bool code_has_value() { int i = 1; char c = seen_pointer[i]; while (c == ' ') c = seen_pointer[++i]; @@ -1176,7 +1176,7 @@ bool code_has_value() { return NUMERIC(c); } -float code_value_float() { +inline float code_value_float() { float ret; char* e = strchr(seen_pointer, 'E'); if (e) { @@ -1189,20 +1189,20 @@ float code_value_float() { return ret; } -unsigned long code_value_ulong() { return strtoul(seen_pointer + 1, NULL, 10); } +inline unsigned long code_value_ulong() { return strtoul(seen_pointer + 1, NULL, 10); } -long code_value_long() { return strtol(seen_pointer + 1, NULL, 10); } +inline long code_value_long() { return strtol(seen_pointer + 1, NULL, 10); } -int code_value_int() { return (int)strtol(seen_pointer + 1, NULL, 10); } +inline int code_value_int() { return (int)strtol(seen_pointer + 1, NULL, 10); } -uint16_t code_value_ushort() { return (uint16_t)strtoul(seen_pointer + 1, NULL, 10); } +inline uint16_t code_value_ushort() { return (uint16_t)strtoul(seen_pointer + 1, NULL, 10); } -uint8_t code_value_byte() { return (uint8_t)(constrain(strtol(seen_pointer + 1, NULL, 10), 0, 255)); } +inline uint8_t code_value_byte() { return (uint8_t)(constrain(strtol(seen_pointer + 1, NULL, 10), 0, 255)); } -bool code_value_bool() { return code_value_byte() > 0; } +inline bool code_value_bool() { return code_value_byte() > 0; } #if ENABLED(INCH_MODE_SUPPORT) - void set_input_linear_units(LinearUnit units) { + inline void set_input_linear_units(LinearUnit units) { switch (units) { case LINEARUNIT_INCH: linear_unit_factor = 25.4; @@ -1215,33 +1215,24 @@ bool code_value_bool() { return code_value_byte() > 0; } volumetric_unit_factor = pow(linear_unit_factor, 3.0); } - float axis_unit_factor(int axis) { + inline float axis_unit_factor(int axis) { return (axis == E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } - float code_value_linear_units() { - return code_value_float() * linear_unit_factor; - } - - float code_value_per_axis_unit(int axis) { - return code_value_float() / axis_unit_factor(axis); - } + inline float code_value_linear_units() { return code_value_float() * linear_unit_factor; } + inline float code_value_per_axis_unit(int axis) { return code_value_float() / axis_unit_factor(axis); } + inline float code_value_axis_units(int axis) { return code_value_float() * axis_unit_factor(axis); } - float code_value_axis_units(int axis) { - return code_value_float() * axis_unit_factor(axis); - } #else - float code_value_linear_units() { return code_value_float(); } - float code_value_per_axis_unit(int axis) { return code_value_float(); } + inline float code_value_linear_units() { return code_value_float(); } + inline float code_value_per_axis_unit(int axis) { return code_value_float(); } + inline float code_value_axis_units(int axis) { return code_value_float(); } - float code_value_axis_units(int axis) { return code_value_float(); } #endif #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - void set_input_temp_units(TempUnit units) { - input_temp_units = units; - } + inline void set_input_temp_units(TempUnit units) { input_temp_units = units; } float code_value_temp_abs() { switch (input_temp_units) { @@ -1272,13 +1263,8 @@ bool code_value_bool() { return code_value_byte() > 0; } float code_value_temp_diff() { return code_value_float(); } #endif -millis_t code_value_millis() { - return code_value_ulong(); -} - -millis_t code_value_millis_from_seconds() { - return code_value_float() * 1000; -} +inline millis_t code_value_millis() { return code_value_ulong(); } +inline millis_t code_value_millis_from_seconds() { return code_value_float() * 1000; } bool code_seen(char code) { seen_pointer = strchr(current_command_args, code); From 0b3142b45b2862e4bd3f35dcf7fd07941086aa7e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Jun 2016 17:03:45 -0700 Subject: [PATCH 028/580] Remove redundant declarations from M100 code --- Marlin/M100_Free_Mem_Chk.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Marlin/M100_Free_Mem_Chk.cpp b/Marlin/M100_Free_Mem_Chk.cpp index 36e01ae6c..521b759e3 100644 --- a/Marlin/M100_Free_Mem_Chk.cpp +++ b/Marlin/M100_Free_Mem_Chk.cpp @@ -47,21 +47,6 @@ extern void* __brkval; extern size_t __heap_start, __heap_end, __flp; -// -// Declare all the functions we need from Marlin_Main.cpp to do the work! -// - -int code_value_int(); -bool code_seen(char); -void serial_echopair_P(const char*, float); -void serial_echopair_P(const char*, double); -void serial_echopair_P(const char*, unsigned long); -void serial_echopair_P(const char*, int); -void serial_echopair_P(const char*, long); - - - - // // Utility functions used by M100 to get its work done. // @@ -175,8 +160,7 @@ void gcode_M100() { // #if ENABLED(M100_FREE_MEMORY_CORRUPTOR) if (code_seen('C')) { - int x; // x gets the # of locations to corrupt within the memory pool - x = code_value_int(); + int x = code_value_int(); // x gets the # of locations to corrupt within the memory pool SERIAL_ECHOLNPGM("Corrupting free memory block.\n"); ptr = (unsigned char*) __brkval; SERIAL_ECHOPAIR("\n__brkval : ", ptr); From 38279a02b2a1f05bfe3917272c517b0efc5fb40c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Jun 2016 17:12:54 -0700 Subject: [PATCH 029/580] Travis tests for Inch, Fahrenheit, Kelvin, M100 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c11220292..088f1c56c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -105,10 +105,10 @@ script: - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR SERVO_ENDSTOP_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - build_marlin # - # Test EEPROM_SETTINGS & EEPROM_CHITCHAT + # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT # - restore_configs - - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT + - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT - build_marlin # # Test DUAL_X_CARRIAGE From 3c68be79dc139788fb976a150088e4ea5946708b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2016 16:41:53 -0700 Subject: [PATCH 030/580] Throw an error in PID_autotune for E < -1 --- Marlin/temperature.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 61d9fe2e2..bb6e1e6af 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -206,15 +206,18 @@ unsigned char Temperature::soft_pwm[HOTENDS]; next_auto_fan_check_ms = temp_ms + 2500UL; #endif - if (false - #if ENABLED(PIDTEMP) - || hotend >= HOTENDS - #else - || hotend >= 0 - #endif - #if DISABLED(PIDTEMPBED) - || hotend < 0 - #endif + if (hotend >= + #if ENABLED(PIDTEMP) + HOTENDS + #else + 0 + #endif + || hotend < + #if ENABLED(PIDTEMPBED) + -1 + #else + 0 + #endif ) { SERIAL_ECHOLN(MSG_PID_BAD_EXTRUDER_NUM); return; From cb4704e07a52290e12f6aa96debb966298ddd38d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2016 15:20:44 -0700 Subject: [PATCH 031/580] Rename some planner acceleration vars - `per_sq_second` => `per_s2` - `per_sqr_second` => `per_s2` - `axis_steps_per_sqr_second` => `max_acceleration_steps_per_s2` --- Marlin/Marlin_main.cpp | 4 ++-- Marlin/configuration_store.cpp | 16 ++++++++-------- Marlin/planner.cpp | 14 +++++++------- Marlin/planner.h | 4 ++-- Marlin/ultralcd.cpp | 8 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 475dea4aa..2a2a4ef07 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5150,7 +5150,7 @@ inline void gcode_M92() { float factor = planner.axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab. planner.max_e_jerk *= factor; planner.max_feedrate[i] *= factor; - planner.axis_steps_per_sqr_second[i] *= factor; + planner.max_acceleration_steps_per_s2[i] *= factor; } planner.axis_steps_per_unit[i] = value; } @@ -5337,7 +5337,7 @@ inline void gcode_M200() { inline void gcode_M201() { for (int8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) { - planner.max_acceleration_units_per_sq_second[i] = code_value_axis_units(i); + planner.max_acceleration_mm_per_s2[i] = code_value_axis_units(i); } } // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 977fd317d..579c9868e 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -45,7 +45,7 @@ * * 104 M92 XYZE planner.axis_steps_per_unit (float x4) * 120 M203 XYZE planner.max_feedrate (float x4) - * 136 M201 XYZE planner.max_acceleration_units_per_sq_second (uint32_t x4) + * 136 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4) * 152 M204 P planner.acceleration (float) * 156 M204 R planner.retract_acceleration (float) * 160 M204 T planner.travel_acceleration (float) @@ -175,7 +175,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, ver); // invalidate data first EEPROM_WRITE_VAR(i, planner.axis_steps_per_unit); EEPROM_WRITE_VAR(i, planner.max_feedrate); - EEPROM_WRITE_VAR(i, planner.max_acceleration_units_per_sq_second); + EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2); EEPROM_WRITE_VAR(i, planner.acceleration); EEPROM_WRITE_VAR(i, planner.retract_acceleration); EEPROM_WRITE_VAR(i, planner.travel_acceleration); @@ -355,7 +355,7 @@ void Config_RetrieveSettings() { // version number match EEPROM_READ_VAR(i, planner.axis_steps_per_unit); EEPROM_READ_VAR(i, planner.max_feedrate); - EEPROM_READ_VAR(i, planner.max_acceleration_units_per_sq_second); + EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2); // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner) planner.reset_acceleration_rates(); @@ -529,7 +529,7 @@ void Config_ResetDefault() { for (uint8_t i = 0; i < NUM_AXIS; i++) { planner.axis_steps_per_unit[i] = tmp1[i]; planner.max_feedrate[i] = tmp2[i]; - planner.max_acceleration_units_per_sq_second[i] = tmp3[i]; + planner.max_acceleration_mm_per_s2[i] = tmp3[i]; #if ENABLED(SCARA) if (i < COUNT(axis_scaling)) axis_scaling[i] = 1; @@ -687,10 +687,10 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):"); CONFIG_ECHO_START; } - SERIAL_ECHOPAIR(" M201 X", planner.max_acceleration_units_per_sq_second[X_AXIS]); - SERIAL_ECHOPAIR(" Y", planner.max_acceleration_units_per_sq_second[Y_AXIS]); - SERIAL_ECHOPAIR(" Z", planner.max_acceleration_units_per_sq_second[Z_AXIS]); - SERIAL_ECHOPAIR(" E", planner.max_acceleration_units_per_sq_second[E_AXIS]); + SERIAL_ECHOPAIR(" M201 X", planner.max_acceleration_mm_per_s2[X_AXIS]); + SERIAL_ECHOPAIR(" Y", planner.max_acceleration_mm_per_s2[Y_AXIS]); + SERIAL_ECHOPAIR(" Z", planner.max_acceleration_mm_per_s2[Z_AXIS]); + SERIAL_ECHOPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS]); SERIAL_EOL; CONFIG_ECHO_START; if (!forReplay) { diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d5e8312ed..186ff90a0 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -82,8 +82,8 @@ volatile uint8_t Planner::block_buffer_tail = 0; float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per minute float Planner::axis_steps_per_unit[NUM_AXIS]; -unsigned long Planner::axis_steps_per_sqr_second[NUM_AXIS]; -unsigned long Planner::max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software +unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS]; +unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software millis_t Planner::min_segment_time; float Planner::min_feedrate; @@ -946,10 +946,10 @@ void Planner::check_axes_activity() { } // Limit acceleration per axis unsigned long acc_st = block->acceleration_st, - xsteps = axis_steps_per_sqr_second[X_AXIS], - ysteps = axis_steps_per_sqr_second[Y_AXIS], - zsteps = axis_steps_per_sqr_second[Z_AXIS], - esteps = axis_steps_per_sqr_second[E_AXIS], + xsteps = max_acceleration_steps_per_s2[X_AXIS], + ysteps = max_acceleration_steps_per_s2[Y_AXIS], + zsteps = max_acceleration_steps_per_s2[Z_AXIS], + esteps = max_acceleration_steps_per_s2[E_AXIS], allsteps = block->step_event_count; if (xsteps < (acc_st * bsx) / allsteps) acc_st = (xsteps * allsteps) / bsx; if (ysteps < (acc_st * bsy) / allsteps) acc_st = (ysteps * allsteps) / bsy; @@ -1148,7 +1148,7 @@ void Planner::set_e_position_mm(const float& e) { // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 void Planner::reset_acceleration_rates() { for (int i = 0; i < NUM_AXIS; i++) - axis_steps_per_sqr_second[i] = max_acceleration_units_per_sq_second[i] * axis_steps_per_unit[i]; + max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_unit[i]; } #if ENABLED(AUTOTEMP) diff --git a/Marlin/planner.h b/Marlin/planner.h index 48773c510..9cfb14530 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -114,8 +114,8 @@ class Planner { static float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute static float axis_steps_per_unit[NUM_AXIS]; - static unsigned long axis_steps_per_sqr_second[NUM_AXIS]; - static unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software + static unsigned long max_acceleration_steps_per_s2[NUM_AXIS]; + static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software static millis_t min_segment_time; static float min_feedrate; diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index c59bffb6b..804fce37c 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1686,10 +1686,10 @@ static void lcd_control_motion_menu() { MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate[E_AXIS], 1, 999); MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate, 0, 999); MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate, 0, 999); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_units_per_sq_second[X_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_units_per_sq_second[Y_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_units_per_sq_second[Z_AXIS], 10, 99000, _reset_acceleration_rates); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); MENU_ITEM_EDIT(float52, MSG_XSTEPS, &planner.axis_steps_per_unit[X_AXIS], 5, 9999); From 3b08eb1eeb6e31979cc97b60c26205f482e6b993 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2016 15:26:45 -0700 Subject: [PATCH 032/580] `acceleration_st` => `acceleration_steps_per_s2` --- Marlin/planner.cpp | 14 +++++++------- Marlin/planner.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 186ff90a0..146677aeb 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -155,7 +155,7 @@ void Planner::calculate_trapezoid_for_block(block_t* block, float entry_factor, NOLESS(initial_rate, 120); NOLESS(final_rate, 120); - long accel = block->acceleration_st; + long accel = block->acceleration_steps_per_s2; int32_t accelerate_steps = ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)); int32_t decelerate_steps = floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)); @@ -936,27 +936,27 @@ void Planner::check_axes_activity() { float steps_per_mm = block->step_event_count / block->millimeters; long bsx = block->steps[X_AXIS], bsy = block->steps[Y_AXIS], bsz = block->steps[Z_AXIS], bse = block->steps[E_AXIS]; if (bsx == 0 && bsy == 0 && bsz == 0) { - block->acceleration_st = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 + block->acceleration_steps_per_s2 = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 } else if (bse == 0) { - block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 + block->acceleration_steps_per_s2 = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 } else { - block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 + block->acceleration_steps_per_s2 = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 } // Limit acceleration per axis - unsigned long acc_st = block->acceleration_st, xsteps = max_acceleration_steps_per_s2[X_AXIS], ysteps = max_acceleration_steps_per_s2[Y_AXIS], zsteps = max_acceleration_steps_per_s2[Z_AXIS], esteps = max_acceleration_steps_per_s2[E_AXIS], + unsigned long acc_st = block->acceleration_steps_per_s2, allsteps = block->step_event_count; if (xsteps < (acc_st * bsx) / allsteps) acc_st = (xsteps * allsteps) / bsx; if (ysteps < (acc_st * bsy) / allsteps) acc_st = (ysteps * allsteps) / bsy; if (zsteps < (acc_st * bsz) / allsteps) acc_st = (zsteps * allsteps) / bsz; if (esteps < (acc_st * bse) / allsteps) acc_st = (esteps * allsteps) / bse; - block->acceleration_st = acc_st; + block->acceleration_steps_per_s2 = acc_st; block->acceleration = acc_st / steps_per_mm; block->acceleration_rate = (long)(acc_st * 16777216.0 / (F_CPU / 8.0)); @@ -1057,7 +1057,7 @@ void Planner::check_axes_activity() { block->advance = 0; } else { - long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_st); + long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_steps_per_s2); float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * (cse * cse * (EXTRUSION_AREA) * (EXTRUSION_AREA)) * 256; block->advance = advance; block->advance_rate = acc_dist ? advance / (float)acc_dist : 0; diff --git a/Marlin/planner.h b/Marlin/planner.h index 9cfb14530..0a035d3e8 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -84,7 +84,7 @@ typedef struct { unsigned long nominal_rate; // The nominal step rate for this block in step_events/sec unsigned long initial_rate; // The jerk-adjusted step rate at start of block unsigned long final_rate; // The minimal rate at exit - unsigned long acceleration_st; // acceleration steps/sec^2 + unsigned long acceleration_steps_per_s2; // acceleration steps/sec^2 #if FAN_COUNT > 0 unsigned long fan_speed[FAN_COUNT]; From 80ab7495637e3dffadce9e446324b13dd573cc09 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2016 15:30:28 -0700 Subject: [PATCH 033/580] Rename acceleration locals for clarity --- Marlin/planner.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 146677aeb..29d3838ad 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -945,16 +945,16 @@ void Planner::check_axes_activity() { block->acceleration_steps_per_s2 = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 } // Limit acceleration per axis - xsteps = max_acceleration_steps_per_s2[X_AXIS], - ysteps = max_acceleration_steps_per_s2[Y_AXIS], - zsteps = max_acceleration_steps_per_s2[Z_AXIS], - esteps = max_acceleration_steps_per_s2[E_AXIS], unsigned long acc_st = block->acceleration_steps_per_s2, + x_acc_st = max_acceleration_steps_per_s2[X_AXIS], + y_acc_st = max_acceleration_steps_per_s2[Y_AXIS], + z_acc_st = max_acceleration_steps_per_s2[Z_AXIS], + e_acc_st = max_acceleration_steps_per_s2[E_AXIS], allsteps = block->step_event_count; - if (xsteps < (acc_st * bsx) / allsteps) acc_st = (xsteps * allsteps) / bsx; - if (ysteps < (acc_st * bsy) / allsteps) acc_st = (ysteps * allsteps) / bsy; - if (zsteps < (acc_st * bsz) / allsteps) acc_st = (zsteps * allsteps) / bsz; - if (esteps < (acc_st * bse) / allsteps) acc_st = (esteps * allsteps) / bse; + if (x_acc_st < (acc_st * bsx) / allsteps) acc_st = (x_acc_st * allsteps) / bsx; + if (y_acc_st < (acc_st * bsy) / allsteps) acc_st = (y_acc_st * allsteps) / bsy; + if (z_acc_st < (acc_st * bsz) / allsteps) acc_st = (z_acc_st * allsteps) / bsz; + if (e_acc_st < (acc_st * bse) / allsteps) acc_st = (e_acc_st * allsteps) / bse; block->acceleration_steps_per_s2 = acc_st; block->acceleration = acc_st / steps_per_mm; From 446515ab79c9f09176ebd4ed9deb21bb33d62ad3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2016 15:31:08 -0700 Subject: [PATCH 034/580] Adjust spacing in block_t --- Marlin/planner.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Marlin/planner.h b/Marlin/planner.h index 0a035d3e8..ee8c4ed27 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -58,9 +58,9 @@ typedef struct { long steps[NUM_AXIS]; // Step count along each axis unsigned long step_event_count; // The number of step events required to complete this block - long accelerate_until; // The index of the step event on which to stop acceleration - long decelerate_after; // The index of the step event on which to start decelerating - long acceleration_rate; // The acceleration rate used for acceleration calculation + long accelerate_until, // The index of the step event on which to stop acceleration + decelerate_after, // The index of the step event on which to start decelerating + acceleration_rate; // The acceleration rate used for acceleration calculation unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) @@ -72,27 +72,26 @@ typedef struct { #endif // Fields used by the motion planner to manage acceleration - float nominal_speed; // The nominal speed for this block in mm/sec - float entry_speed; // Entry speed at previous-current junction in mm/sec - float max_entry_speed; // Maximum allowable junction entry speed in mm/sec - float millimeters; // The total travel of this block in mm - float acceleration; // acceleration mm/sec^2 - unsigned char recalculate_flag; // Planner flag to recalculate trapezoids on entry junction - unsigned char nominal_length_flag; // Planner flag for nominal speed always reached + float nominal_speed, // The nominal speed for this block in mm/sec + entry_speed, // Entry speed at previous-current junction in mm/sec + max_entry_speed, // Maximum allowable junction entry speed in mm/sec + millimeters, // The total travel of this block in mm + acceleration; // acceleration mm/sec^2 + unsigned char recalculate_flag, // Planner flag to recalculate trapezoids on entry junction + nominal_length_flag; // Planner flag for nominal speed always reached // Settings for the trapezoid generator - unsigned long nominal_rate; // The nominal step rate for this block in step_events/sec - unsigned long initial_rate; // The jerk-adjusted step rate at start of block - unsigned long final_rate; // The minimal rate at exit - unsigned long acceleration_steps_per_s2; // acceleration steps/sec^2 + unsigned long nominal_rate, // The nominal step rate for this block in step_events/sec + initial_rate, // The jerk-adjusted step rate at start of block + final_rate, // The minimal rate at exit + acceleration_steps_per_s2; // acceleration steps/sec^2 #if FAN_COUNT > 0 unsigned long fan_speed[FAN_COUNT]; #endif #if ENABLED(BARICUDA) - unsigned long valve_pressure; - unsigned long e_to_p_pressure; + unsigned long valve_pressure, e_to_p_pressure; #endif volatile char busy; From 72c6f2923f6495ca59d3c4431838200b038042f2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2016 16:53:21 -0700 Subject: [PATCH 035/580] axis_steps_per_unit => axis_steps_per_mm --- Marlin/Conditionals.h | 2 +- Marlin/Marlin_main.cpp | 20 +++++------ Marlin/configuration_store.cpp | 16 ++++----- Marlin/planner.cpp | 62 +++++++++++++++++----------------- Marlin/planner.h | 6 ++-- Marlin/stepper.cpp | 2 +- Marlin/stepper.h | 2 +- Marlin/temperature.cpp | 2 +- Marlin/ultralcd.cpp | 10 +++--- 9 files changed, 61 insertions(+), 61 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 54b111bb6..fa780f298 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -426,7 +426,7 @@ */ #if ENABLED(ADVANCE) #define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI) - #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / (EXTRUSION_AREA)) + #define STEPS_PER_CUBIC_MM_E (axis_steps_per_mm[E_AXIS] / (EXTRUSION_AREA)) #endif #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2a2a4ef07..ccfe67250 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -156,7 +156,7 @@ * M84 - Disable steppers until next move, * or use S to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. * M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) - * M92 - Set planner.axis_steps_per_unit - same syntax as G92 + * M92 - Set planner.axis_steps_per_mm - same syntax as G92 * M104 - Set extruder target temp * M105 - Read current temp * M106 - Fan on @@ -1675,7 +1675,7 @@ static void setup_for_endstop_move() { * is not where we said to go. */ long stop_steps = stepper.position(Z_AXIS); - float mm = start_z - float(start_steps - stop_steps) / planner.axis_steps_per_unit[Z_AXIS]; + float mm = start_z - float(start_steps - stop_steps) / planner.axis_steps_per_mm[Z_AXIS]; current_position[Z_AXIS] = mm; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -5147,15 +5147,15 @@ inline void gcode_M92() { if (i == E_AXIS) { float value = code_value_per_axis_unit(i); if (value < 20.0) { - float factor = planner.axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab. + float factor = planner.axis_steps_per_mm[i] / value; // increase e constants if M92 E14 is given for netfab. planner.max_e_jerk *= factor; planner.max_feedrate[i] *= factor; planner.max_acceleration_steps_per_s2[i] *= factor; } - planner.axis_steps_per_unit[i] = value; + planner.axis_steps_per_mm[i] = value; } else { - planner.axis_steps_per_unit[i] = code_value_per_axis_unit(i); + planner.axis_steps_per_mm[i] = code_value_per_axis_unit(i); } } } @@ -5190,9 +5190,9 @@ static void report_current_position() { SERIAL_EOL; SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:"); - SERIAL_PROTOCOL(delta[X_AXIS] / 90 * planner.axis_steps_per_unit[X_AXIS]); + SERIAL_PROTOCOL(delta[X_AXIS] / 90 * planner.axis_steps_per_mm[X_AXIS]); SERIAL_PROTOCOLPGM(" Psi+Theta:"); - SERIAL_PROTOCOL((delta[Y_AXIS] - delta[X_AXIS]) / 90 * planner.axis_steps_per_unit[Y_AXIS]); + SERIAL_PROTOCOL((delta[Y_AXIS] - delta[X_AXIS]) / 90 * planner.axis_steps_per_mm[Y_AXIS]); SERIAL_EOL; SERIAL_EOL; #endif } @@ -5347,7 +5347,7 @@ inline void gcode_M201() { #if 0 // Not used for Sprinter/grbl gen6 inline void gcode_M202() { for (int8_t i = 0; i < NUM_AXIS; i++) { - if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units(i) * planner.axis_steps_per_unit[i]; + if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units(i) * planner.axis_steps_per_mm[i]; } } #endif @@ -8209,8 +8209,8 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { } float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS]; planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], - destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_unit[E_AXIS], - (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_unit[E_AXIS], active_extruder); + destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], + (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder); current_position[E_AXIS] = oldepos; destination[E_AXIS] = oldedes; planner.set_e_position_mm(oldepos); diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 579c9868e..130763123 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -43,7 +43,7 @@ * * 100 Version (char x4) * - * 104 M92 XYZE planner.axis_steps_per_unit (float x4) + * 104 M92 XYZE planner.axis_steps_per_mm (float x4) * 120 M203 XYZE planner.max_feedrate (float x4) * 136 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4) * 152 M204 P planner.acceleration (float) @@ -173,7 +173,7 @@ void Config_StoreSettings() { char ver[4] = "000"; int i = EEPROM_OFFSET; EEPROM_WRITE_VAR(i, ver); // invalidate data first - EEPROM_WRITE_VAR(i, planner.axis_steps_per_unit); + EEPROM_WRITE_VAR(i, planner.axis_steps_per_mm); EEPROM_WRITE_VAR(i, planner.max_feedrate); EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2); EEPROM_WRITE_VAR(i, planner.acceleration); @@ -353,7 +353,7 @@ void Config_RetrieveSettings() { float dummy = 0; // version number match - EEPROM_READ_VAR(i, planner.axis_steps_per_unit); + EEPROM_READ_VAR(i, planner.axis_steps_per_mm); EEPROM_READ_VAR(i, planner.max_feedrate); EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2); @@ -527,7 +527,7 @@ void Config_ResetDefault() { float tmp2[] = DEFAULT_MAX_FEEDRATE; long tmp3[] = DEFAULT_MAX_ACCELERATION; for (uint8_t i = 0; i < NUM_AXIS; i++) { - planner.axis_steps_per_unit[i] = tmp1[i]; + planner.axis_steps_per_mm[i] = tmp1[i]; planner.max_feedrate[i] = tmp2[i]; planner.max_acceleration_mm_per_s2[i] = tmp3[i]; #if ENABLED(SCARA) @@ -652,10 +652,10 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Steps per unit:"); CONFIG_ECHO_START; } - SERIAL_ECHOPAIR(" M92 X", planner.axis_steps_per_unit[X_AXIS]); - SERIAL_ECHOPAIR(" Y", planner.axis_steps_per_unit[Y_AXIS]); - SERIAL_ECHOPAIR(" Z", planner.axis_steps_per_unit[Z_AXIS]); - SERIAL_ECHOPAIR(" E", planner.axis_steps_per_unit[E_AXIS]); + SERIAL_ECHOPAIR(" M92 X", planner.axis_steps_per_mm[X_AXIS]); + SERIAL_ECHOPAIR(" Y", planner.axis_steps_per_mm[Y_AXIS]); + SERIAL_ECHOPAIR(" Z", planner.axis_steps_per_mm[Z_AXIS]); + SERIAL_ECHOPAIR(" E", planner.axis_steps_per_mm[E_AXIS]); SERIAL_EOL; CONFIG_ECHO_START; diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 29d3838ad..bd60d75a1 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -81,7 +81,7 @@ volatile uint8_t Planner::block_buffer_head = 0; // Index of the next volatile uint8_t Planner::block_buffer_tail = 0; float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per minute -float Planner::axis_steps_per_unit[NUM_AXIS]; +float Planner::axis_steps_per_mm[NUM_AXIS]; unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS]; unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software @@ -549,10 +549,10 @@ void Planner::check_axes_activity() { // Calculate target position in absolute steps //this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow long target[NUM_AXIS] = { - lround(x * axis_steps_per_unit[X_AXIS]), - lround(y * axis_steps_per_unit[Y_AXIS]), - lround(z * axis_steps_per_unit[Z_AXIS]), - lround(e * axis_steps_per_unit[E_AXIS]) + lround(x * axis_steps_per_mm[X_AXIS]), + lround(y * axis_steps_per_mm[Y_AXIS]), + lround(z * axis_steps_per_mm[Z_AXIS]), + lround(e * axis_steps_per_mm[E_AXIS]) }; long dx = target[X_AXIS] - position[X_AXIS], @@ -574,7 +574,7 @@ void Planner::check_axes_activity() { SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); } #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (labs(de) > axis_steps_per_unit[E_AXIS] * (EXTRUDE_MAXLENGTH)) { + if (labs(de) > axis_steps_per_mm[E_AXIS] * (EXTRUDE_MAXLENGTH)) { position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part de = 0; // no difference SERIAL_ECHO_START; @@ -771,31 +771,31 @@ void Planner::check_axes_activity() { #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ) float delta_mm[6]; #if ENABLED(COREXY) - delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS]; - delta_mm[Y_HEAD] = dy / axis_steps_per_unit[B_AXIS]; - delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; - delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_unit[A_AXIS]; - delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_unit[B_AXIS]; + delta_mm[X_HEAD] = dx / axis_steps_per_mm[A_AXIS]; + delta_mm[Y_HEAD] = dy / axis_steps_per_mm[B_AXIS]; + delta_mm[Z_AXIS] = dz / axis_steps_per_mm[Z_AXIS]; + delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_mm[A_AXIS]; + delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_mm[B_AXIS]; #elif ENABLED(COREXZ) - delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS]; - delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; - delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS]; - delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_unit[A_AXIS]; - delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_unit[C_AXIS]; + delta_mm[X_HEAD] = dx / axis_steps_per_mm[A_AXIS]; + delta_mm[Y_AXIS] = dy / axis_steps_per_mm[Y_AXIS]; + delta_mm[Z_HEAD] = dz / axis_steps_per_mm[C_AXIS]; + delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_mm[A_AXIS]; + delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_mm[C_AXIS]; #elif ENABLED(COREYZ) - delta_mm[X_AXIS] = dx / axis_steps_per_unit[A_AXIS]; - delta_mm[Y_HEAD] = dy / axis_steps_per_unit[Y_AXIS]; - delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS]; - delta_mm[B_AXIS] = (dy + dz) / axis_steps_per_unit[B_AXIS]; - delta_mm[C_AXIS] = (dy - dz) / axis_steps_per_unit[C_AXIS]; + delta_mm[X_AXIS] = dx / axis_steps_per_mm[A_AXIS]; + delta_mm[Y_HEAD] = dy / axis_steps_per_mm[Y_AXIS]; + delta_mm[Z_HEAD] = dz / axis_steps_per_mm[C_AXIS]; + delta_mm[B_AXIS] = (dy + dz) / axis_steps_per_mm[B_AXIS]; + delta_mm[C_AXIS] = (dy - dz) / axis_steps_per_mm[C_AXIS]; #endif #else float delta_mm[4]; - delta_mm[X_AXIS] = dx / axis_steps_per_unit[X_AXIS]; - delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; - delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; + delta_mm[X_AXIS] = dx / axis_steps_per_mm[X_AXIS]; + delta_mm[Y_AXIS] = dy / axis_steps_per_mm[Y_AXIS]; + delta_mm[Z_AXIS] = dz / axis_steps_per_mm[Z_AXIS]; #endif - delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0; + delta_mm[E_AXIS] = (de / axis_steps_per_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0; if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { block->millimeters = fabs(delta_mm[E_AXIS]); @@ -1127,10 +1127,10 @@ void Planner::check_axes_activity() { apply_rotation_xyz(bed_level_matrix, x, y, z); #endif - long nx = position[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]), - ny = position[Y_AXIS] = lround(y * axis_steps_per_unit[Y_AXIS]), - nz = position[Z_AXIS] = lround(z * axis_steps_per_unit[Z_AXIS]), - ne = position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]); + long nx = position[X_AXIS] = lround(x * axis_steps_per_mm[X_AXIS]), + ny = position[Y_AXIS] = lround(y * axis_steps_per_mm[Y_AXIS]), + nz = position[Z_AXIS] = lround(z * axis_steps_per_mm[Z_AXIS]), + ne = position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]); stepper.set_position(nx, ny, nz, ne); previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. @@ -1141,14 +1141,14 @@ void Planner::check_axes_activity() { * Directly set the planner E position (hence the stepper E position). */ void Planner::set_e_position_mm(const float& e) { - position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]); + position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]); stepper.set_e_position(position[E_AXIS]); } // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 void Planner::reset_acceleration_rates() { for (int i = 0; i < NUM_AXIS; i++) - max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_unit[i]; + max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i]; } #if ENABLED(AUTOTEMP) diff --git a/Marlin/planner.h b/Marlin/planner.h index ee8c4ed27..07de37134 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -112,7 +112,7 @@ class Planner { static volatile uint8_t block_buffer_tail; static float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute - static float axis_steps_per_unit[NUM_AXIS]; + static float axis_steps_per_mm[NUM_AXIS]; static unsigned long max_acceleration_steps_per_s2[NUM_AXIS]; static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software @@ -134,7 +134,7 @@ class Planner { /** * The current position of the tool in absolute steps - * Reclculated if any axis_steps_per_unit are changed by gcode + * Reclculated if any axis_steps_per_mm are changed by gcode */ static long position[NUM_AXIS]; @@ -212,7 +212,7 @@ class Planner { * Set the planner.position and individual stepper positions. * Used by G92, G28, G29, and other procedures. * - * Multiplies by axis_steps_per_unit[] and does necessary conversion + * Multiplies by axis_steps_per_mm[] and does necessary conversion * for COREXY / COREXZ / COREYZ to set the corresponding stepper positions. * * Clears previous speed values. diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 7695e3c57..f8e8a853c 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -754,7 +754,7 @@ float Stepper::get_axis_position_mm(AxisEnum axis) { #else axis_steps = position(axis); #endif - return axis_steps / planner.axis_steps_per_unit[axis]; + return axis_steps / planner.axis_steps_per_mm[axis]; } void Stepper::finish_and_disable() { diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 13c753fbc..1aebe366c 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -243,7 +243,7 @@ class Stepper { // Triggered position of an axis in mm (not core-savvy) // static FORCE_INLINE float triggered_position_mm(AxisEnum axis) { - return endstops_trigsteps[axis] / planner.axis_steps_per_unit[axis]; + return endstops_trigsteps[axis] / planner.axis_steps_per_mm[axis]; } private: diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 61d9fe2e2..c92353504 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -556,7 +556,7 @@ float Temperature::get_pid_output(int e) { lpq[lpq_ptr++] = 0; } if (lpq_ptr >= lpq_len) lpq_ptr = 0; - cTerm[_CTERM_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_unit[E_AXIS]) * PID_PARAM(Kc, e); + cTerm[_CTERM_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_mm[E_AXIS]) * PID_PARAM(Kc, e); pid_output += cTerm[e]; } #endif //PID_ADD_EXTRUSION_RATE diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 804fce37c..a891f907d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1692,14 +1692,14 @@ static void lcd_control_motion_menu() { MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); - MENU_ITEM_EDIT(float52, MSG_XSTEPS, &planner.axis_steps_per_unit[X_AXIS], 5, 9999); - MENU_ITEM_EDIT(float52, MSG_YSTEPS, &planner.axis_steps_per_unit[Y_AXIS], 5, 9999); + MENU_ITEM_EDIT(float52, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999); + MENU_ITEM_EDIT(float52, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999); #if ENABLED(DELTA) - MENU_ITEM_EDIT(float52, MSG_ZSTEPS, &planner.axis_steps_per_unit[Z_AXIS], 5, 9999); + MENU_ITEM_EDIT(float52, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999); #else - MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &planner.axis_steps_per_unit[Z_AXIS], 5, 9999); + MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999); #endif - MENU_ITEM_EDIT(float51, MSG_ESTEPS, &planner.axis_steps_per_unit[E_AXIS], 5, 9999); + MENU_ITEM_EDIT(float51, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999); #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit); #endif From 24e70c915d96d9e73d0e870e9ff1bc9d2db9fc4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 10 Jun 2016 02:25:37 +0100 Subject: [PATCH 036/580] Update travis to test for ULTRA and DOG LCD options --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.travis.yml b/.travis.yml index 088f1c56c..9296cacb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -123,6 +123,17 @@ script: # ### LCDS ### # + # ULTRA_LCD + # + - restore_configs + - opt_enable ULTRA_LCD + - build_marlin + # + # DOGLCD + # + - restore_configs + - opt_enable DOGLCD + - build_marlin # # ULTIMAKERCONTROLLER # From 5b5aa1572b087f9643c71348afba7df7eba42b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 4 Jun 2016 20:29:01 +0100 Subject: [PATCH 037/580] Non-blocking buzzer --- Marlin/Conditionals.h | 30 +++++-- Marlin/Marlin.h | 11 +++ Marlin/Marlin_main.cpp | 41 +++++++--- Marlin/buzzer.cpp | 57 ------------- Marlin/buzzer.h | 115 ++++++++++++++++++++++++-- Marlin/circularqueue.h | 146 ++++++++++++++++++++++++++++++++++ Marlin/pins_MEGATRONICS.h | 3 +- Marlin/pins_MINIRAMBO.h | 4 +- Marlin/pins_PRINTRBOARD.h | 3 +- Marlin/pins_RAMBO.h | 6 +- Marlin/pins_RAMPS_14.h | 6 +- Marlin/pins_SANGUINOLOLU_11.h | 5 +- Marlin/speaker.h | 92 +++++++++++++++++++++ Marlin/ultralcd.cpp | 21 +---- 14 files changed, 432 insertions(+), 108 deletions(-) delete mode 100644 Marlin/buzzer.cpp create mode 100644 Marlin/circularqueue.h create mode 100644 Marlin/speaker.h diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 54b111bb6..74e0d1c3d 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -43,8 +43,7 @@ #endif #ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first - - #define CONFIGURATION_LCD +#define CONFIGURATION_LCD #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)) @@ -154,11 +153,6 @@ #define ENCODER_STEPS_PER_MENU_ITEM 1 #endif - #if ENABLED(LCD_USE_I2C_BUZZER) - #define LCD_FEEDBACK_FREQUENCY_HZ 1000 - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 - #endif - #define ULTIPANEL #define NEWPANEL #endif @@ -806,5 +800,27 @@ #endif #endif + /** + * Buzzer/Speaker + */ + #if ENABLED(LCD_USE_I2C_BUZZER) + #ifndef LCD_FEEDBACK_FREQUENCY_HZ + #define LCD_FEEDBACK_FREQUENCY_HZ 1000 + #endif + #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS + #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 + #endif + #elif PIN_EXISTS(BEEPER) + #ifndef LCD_FEEDBACK_FREQUENCY_HZ + #define LCD_FEEDBACK_FREQUENCY_HZ 5000 + #endif + #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS + #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 + #endif + #else + #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS + #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 + #endif + #endif #endif //CONFIGURATION_LCD #endif //CONDITIONALS_H diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 7b275b0cb..1a3a170c7 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -373,4 +373,15 @@ extern uint8_t active_extruder; void calculate_volumetric_multipliers(); +// Buzzer +#if HAS_BUZZER + #if ENABLED(SPEAKER) + #include "speaker.h" + extern Speaker buzzer; + #else + #include "buzzer.h" + extern Buzzer buzzer; + #endif +#endif + #endif //MARLIN_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 475dea4aa..7142d9682 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -59,7 +59,6 @@ #include "language.h" #include "pins_arduino.h" #include "math.h" -#include "buzzer.h" #if ENABLED(USE_WATCHDOG) #include "watchdog.h" @@ -354,6 +353,15 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL Stopwatch print_job_timer = Stopwatch(); #endif +// Buzzer +#if HAS_BUZZER + #if ENABLED(SPEAKER) + Speaker buzzer; + #else + Buzzer buzzer; + #endif +#endif + static uint8_t target_extruder; #if ENABLED(AUTO_BED_LEVELING_FEATURE) @@ -1233,7 +1241,7 @@ inline bool code_value_bool() { return code_value_byte() > 0; } #if ENABLED(TEMPERATURE_UNITS_SUPPORT) inline void set_input_temp_units(TempUnit units) { input_temp_units = units; } - + float code_value_temp_abs() { switch (input_temp_units) { case TEMPUNIT_C: @@ -5689,10 +5697,13 @@ inline void gcode_M226() { * M300: Play beep sound S P */ inline void gcode_M300() { - uint16_t beepS = code_seen('S') ? code_value_ushort() : 110; - uint32_t beepP = code_seen('P') ? code_value_ulong() : 1000; - if (beepP > 5000) beepP = 5000; // limit to 5 seconds - buzz(beepP, beepS); + uint16_t const frequency = code_seen('S') ? code_value_ushort() : 260; + uint16_t duration = code_seen('P') ? code_value_ushort() : 1000; + + // Limits the tone duration to 0-5 seconds. + NOMORE(duration, 5000); + + buzzer.tone(duration, frequency); } #endif // HAS_BUZZER @@ -6173,7 +6184,7 @@ inline void gcode_M428() { SERIAL_ERRORLNPGM(MSG_ERR_M428_TOO_FAR); LCD_ALERTMESSAGEPGM("Err: Too far!"); #if HAS_BUZZER - buzz(200, 40); + buzzer.tone(200, 40); #endif err = true; break; @@ -6190,8 +6201,8 @@ inline void gcode_M428() { report_current_position(); LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); #if HAS_BUZZER - buzz(200, 659); - buzz(200, 698); + buzzer.tone(200, 659); + buzzer.tone(200, 698); #endif } } @@ -8076,17 +8087,23 @@ void idle( bool no_stepper_sleep/*=false*/ #endif ) { - thermalManager.manage_heater(); + lcd_update(); + host_keepalive(); manage_inactivity( #if ENABLED(FILAMENTCHANGEENABLE) no_stepper_sleep #endif ); - host_keepalive(); - lcd_update(); + + thermalManager.manage_heater(); + #if ENABLED(PRINTCOUNTER) print_job_timer.tick(); #endif + + #if HAS_BUZZER + buzzer.tick(); + #endif } /** diff --git a/Marlin/buzzer.cpp b/Marlin/buzzer.cpp deleted file mode 100644 index 776ea4dfa..000000000 --- a/Marlin/buzzer.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "Marlin.h" -#if HAS_BUZZER - #include "buzzer.h" - #include "ultralcd.h" - - void buzz(long duration, uint16_t freq) { - if (freq > 0) { - #if ENABLED(LCD_USE_I2C_BUZZER) - lcd_buzz(duration, freq); - #elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition - SET_OUTPUT(BEEPER_PIN); - #if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC - //tone(BEEPER_PIN, freq, duration); // needs a PWMable pin - unsigned int delay = 1000000 / freq / 2; - int i = duration * freq / 1000; - while (i--) { - WRITE(BEEPER_PIN, HIGH); - delayMicroseconds(delay); - WRITE(BEEPER_PIN, LOW); - delayMicroseconds(delay); - } - #else // buzzer has its own resonator - needs a DC - WRITE(BEEPER_PIN, HIGH); - delay(duration); - WRITE(BEEPER_PIN, LOW); - #endif - #else - delay(duration); - #endif - } - else { - delay(duration); - } - } -#endif diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index ec568ecd8..2e436259e 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -20,11 +20,114 @@ * */ -#ifndef BUZZER_H - #define BUZZER_H +#ifndef __BUZZER_H__ +#define __BUZZER_H__ - #if HAS_BUZZER - void buzz(long duration, uint16_t freq); - #endif +#include "fastio.h" +#include "watchdog.h" +#include "circularqueue.h" -#endif //BUZZER_H +#define TONE_QUEUE_LENGTH 4 + +/** + * @brief Tone structure + * @details Simple abstration of a tone based on a duration and a frequency. + * + */ +struct tone_t { + uint16_t duration; + uint16_t frequency; +}; + +/** + * @brief Buzzer class + */ +class Buzzer { + private: + struct state_t { + tone_t tone; + uint32_t timestamp; + } state; + + protected: + CircularQueue buffer; + + /** + * @brief Inverts the sate of a digital PIN + * @details This will invert the current state of an digital IO pin. + */ + void invert() { + WRITE(BEEPER_PIN, !READ(BEEPER_PIN)); + } + + /** + * @brief Turn off a digital PIN + * @details Alias of digitalWrite(PIN, LOW) using FastIO + */ + void off() { + WRITE(BEEPER_PIN, LOW); + } + + /** + * @brief Turn on a digital PIN + * @details Alias of digitalWrite(PIN, HIGH) using FastIO + */ + void on() { + WRITE(BEEPER_PIN, HIGH); + } + + /** + * @brief Resets the state of the class + * @details Brings the class state to a known one. + */ + void reset() { + this->off(); + this->state.timestamp = 0; + } + + public: + /** + * @brief Class constructor + */ + Buzzer() { + SET_OUTPUT(BEEPER_PIN); + this->reset(); + } + + /** + * @brief Add a tone to the queue + * @details Adds a tone_t structure to the ring buffer, will block IO if the + * queue is full waiting for one slot to get available. + * + * @param duration Duration of the tone in milliseconds + * @param frequency Frequency of the tone in hertz + */ + void tone(uint16_t const &duration, uint16_t const &frequency = 0) { + while (buffer.isFull()) { + delay(5); + this->tick(); + #if ENABLED(USE_WATCHDOG) + watchdog_reset(); + #endif + } + this->buffer.enqueue((tone_t) { duration, frequency }); + } + + /** + * @brief Loop function + * @details This function should be called at loop, it will take care of + * playing the tones in the queue. + */ + virtual void tick() { + if (!this->state.timestamp) { + if (this->buffer.isEmpty()) return; + + this->state.tone = this->buffer.dequeue(); + this->state.timestamp = millis() + this->state.tone.duration; + if (this->state.tone.frequency > 0) this->on(); + } + else if (millis() >= this->state.timestamp) this->reset(); + } +}; + +#endif diff --git a/Marlin/circularqueue.h b/Marlin/circularqueue.h new file mode 100644 index 000000000..99efd244e --- /dev/null +++ b/Marlin/circularqueue.h @@ -0,0 +1,146 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef __CIRCULARQUEUE_H__ +#define __CIRCULARQUEUE_H__ + +#include + +/** + * @brief Circular Queue class + * @details Implementation of the classic ring buffer data structure + */ +template +class CircularQueue { + private: + + /** + * @brief Buffer structure + * @details This structure consolidates all the overhead required to handle + * a circular queue such as the pointers and the buffer vector. + */ + struct buffer_t { + uint8_t head; + uint8_t tail; + uint8_t size; + uint8_t length; + T queue[N]; + } buffer; + + public: + /** + * @brief Class constructor + * @details This class requires two template parameters, T defines the type + * of the items this queue will handle and N defines the maximum number of + * items that can be stored on the queue. + */ + CircularQueue() { + this->buffer.length = N; + this->buffer.size = this->buffer.head = this->buffer.tail = 0; + } + + /** + * @brief Removes and returns a item from the queue + * @details Removes the oldest item on the queue which is pointed by the + * buffer_t head variable, this item is then returned to the caller. + * @return type T item + */ + T dequeue() { + if (this->isEmpty()) return T(); + + T const item = this->buffer.queue[this->buffer.head++]; + --this->buffer.size; + + if (this->buffer.head == this->buffer.length) + this->buffer.head = 0; + + return item; + } + + /** + * @brief Adds an item to the queue + * @details Adds a item to the queue on the location pointed by the buffer_t + * tail vairable, will return false if there is no queue space available. + * + * @param item Item to be added to the queue + * @return true if the operation was successfull + */ + bool enqueue(T const &item) { + if (this->isFull()) return false; + + this->buffer.queue[this->buffer.tail++] = item; + ++this->buffer.size; + + if (this->buffer.tail == this->buffer.length) + this->buffer.tail = 0; + + return true; + } + + /** + * @brief Checks if the queue has no items + * @details Returns true if there are no items on the queue, false otherwise. + * @return true if queue is empty + */ + bool isEmpty() { + return this->buffer.size == 0; + } + + /** + * @brief Checks if the queue is full + * @details Returns true if the queue is full, false otherwise. + * @return true if queue is full + */ + bool isFull() { + return this->buffer.size == this->buffer.length; + } + + /** + * @brief Gets the queue size + * @details Returns the maximum number of items a queue can have. + * @return the queue lenght + */ + uint8_t length() { + return this->buffer.length; + } + + /** + * @brief Gets the next item from the queue without removing it + * @details Returns the next item on the queue but the item is not removed + * from the queue nor the pointers updated. + * @return the queue size + */ + uint8_t peek() { + return this->buffer.queue[this->buffer.head]; + } + + /** + * @brief Gets the number of items on the queue + * @details Returns the current number of items stored on the queue. + * @return type T item + */ + uint8_t size() { + return this->buffer.size; + } +}; + +#endif diff --git a/Marlin/pins_MEGATRONICS.h b/Marlin/pins_MEGATRONICS.h index 3cd467db8..b8022e642 100644 --- a/Marlin/pins_MEGATRONICS.h +++ b/Marlin/pins_MEGATRONICS.h @@ -74,7 +74,8 @@ #define TEMP_1_PIN 15 // ANALOG NUMBERING #define TEMP_BED_PIN 14 // ANALOG NUMBERING -#define BEEPER_PIN 33 // AUX-4 +// AUX-4 +#define BEEPER_PIN 33 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) diff --git a/Marlin/pins_MINIRAMBO.h b/Marlin/pins_MINIRAMBO.h index 1485c72bc..29bc9dfb5 100644 --- a/Marlin/pins_MINIRAMBO.h +++ b/Marlin/pins_MINIRAMBO.h @@ -94,7 +94,9 @@ #if ENABLED(NEWPANEL) - #define BEEPER_PIN 84 // Beeper on AUX-4 + // Beeper on AUX-4 + #define BEEPER_PIN 84 + #define LCD_PINS_RS 82 #define LCD_PINS_ENABLE 18 #define LCD_PINS_D4 19 diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h index 5534589cb..91455a615 100644 --- a/Marlin/pins_PRINTRBOARD.h +++ b/Marlin/pins_PRINTRBOARD.h @@ -121,7 +121,8 @@ #endif // ULTRA_LCD && NEWPANEL #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 32 //FastIO + //FastIO + #define BEEPER_PIN 32 // Pins for DOGM SPI LCD Support #define DOGLCD_A0 42 //Non-FastIO #define DOGLCD_CS 43 //Non-FastIO diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index a42731a1a..0e7c7aade 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -112,7 +112,8 @@ #if ENABLED(NEWPANEL) - #define BEEPER_PIN 79 // Beeper on AUX-4 + // Beeper on AUX-4 + #define BEEPER_PIN 79 #define LCD_PINS_RS 70 #define LCD_PINS_ENABLE 71 @@ -134,7 +135,8 @@ #else //!NEWPANEL - old style panel with shift register - #define BEEPER_PIN 33 // No Beeper added + // No Beeper added + #define BEEPER_PIN 33 //buttons are attached to a shift register // Not wired yet diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 9c8caa27c..a524289b8 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -218,7 +218,8 @@ #else - #define BEEPER_PIN 33 // Beeper on AUX-4 + // Beeper on AUX-4 + #define BEEPER_PIN 33 // buttons are directly attached using AUX-2 #if ENABLED(REPRAPWORLD_KEYPAD) @@ -247,7 +248,8 @@ #endif #else // !NEWPANEL (Old-style panel with shift register) - #define BEEPER_PIN 33 // No Beeper added + // No Beeper added + #define BEEPER_PIN 33 // Buttons are attached to a shift register // Not wired yet diff --git a/Marlin/pins_SANGUINOLOLU_11.h b/Marlin/pins_SANGUINOLOLU_11.h index bd7722640..9b00788c3 100644 --- a/Marlin/pins_SANGUINOLOLU_11.h +++ b/Marlin/pins_SANGUINOLOLU_11.h @@ -105,7 +105,10 @@ #define LCD_PINS_RS 30 //CS chip select /SS chip slave select #define LCD_PINS_ENABLE 29 //SID (MOSI) #define LCD_PINS_D4 17 //SCK (CLK) clock - #define BEEPER_PIN 27 // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with Marlin so this can be used for BEEPER_PIN. You can use this pin with M42 instead of BEEPER_PIN. + // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with + // Marlin so this can be used for BEEPER_PIN. You can use this pin + // with M42 instead of BEEPER_PIN. + #define BEEPER_PIN 27 #else // Sanguinololu 1.3 #define LCD_PINS_RS 4 #define LCD_PINS_ENABLE 17 diff --git a/Marlin/speaker.h b/Marlin/speaker.h new file mode 100644 index 000000000..93aa6f736 --- /dev/null +++ b/Marlin/speaker.h @@ -0,0 +1,92 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef __SPEAKER_H__ +#define __SPEAKER_H__ + +#include "buzzer.h" + +class Speaker: public Buzzer { + private: + typedef Buzzer super; + + struct state_t { + tone_t tone; + uint16_t period; + uint16_t cycles; + } state; + + protected: + /** + * @brief Resets the state of the class + * @details Brings the class state to a known one. + */ + void reset() { + super::reset(); + this->state.period = 0; + this->state.cycles = 0; + } + + public: + /** + * @brief Class constructor + */ + Speaker() { + this->reset(); + } + + /** + * @brief Loop function + * @details This function should be called at loop, it will take care of + * playing the tones in the queue. + */ + virtual void tick() { + if (!this->state.cycles) { + if (this->buffer.isEmpty()) return; + + this->reset(); + this->state.tone = this->buffer.dequeue(); + + // Period is uint16, min frequency will be ~16Hz + this->state.period = 1000000UL / this->state.tone.frequency; + + this->state.cycles = + (this->state.tone.duration * 1000L) / this->state.period; + + this->state.period >>= 1; + this->state.cycles <<= 1; + + } + else { + uint32_t const us = micros(); + static uint32_t next = us + this->state.period; + + if (us >= next) { + --this->state.cycles; + next = us + this->state.period; + if (this->state.tone.frequency > 0) this->invert(); + } + } + } +}; + +#endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index c59bffb6b..0838c7604 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -978,8 +978,8 @@ void lcd_cooldown() { lcd_return_to_status(); //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE); #if HAS_BUZZER - buzz(200, 659); - buzz(200, 698); + buzzer.tone(200, 659); + buzzer.tone(200, 698); #endif } else { @@ -1978,25 +1978,10 @@ void lcd_quick_feedback() { next_button_update_ms = millis() + 500; #if ENABLED(LCD_USE_I2C_BUZZER) - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 100 - #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS (1000/6) - #endif lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); #elif PIN_EXISTS(BEEPER) - #ifndef LCD_FEEDBACK_FREQUENCY_HZ - #define LCD_FEEDBACK_FREQUENCY_HZ 5000 - #endif - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 - #endif - buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + buzzer.tone(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); #else - #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS - #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 - #endif delay(LCD_FEEDBACK_FREQUENCY_DURATION_MS); #endif } From a82c755a35c39578be059fcdb7b94819c79ecdc9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2016 20:31:47 -0700 Subject: [PATCH 038/580] Fix BQ_LCD_SMART_CONTROLLER pin compiler warnings --- Marlin/pins_BQ_ZUM_MEGA_3D.h | 17 ----------------- Marlin/pins_RAMPS_14.h | 15 +++++++-------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/Marlin/pins_BQ_ZUM_MEGA_3D.h b/Marlin/pins_BQ_ZUM_MEGA_3D.h index c6b53d870..13f81a9ce 100644 --- a/Marlin/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/pins_BQ_ZUM_MEGA_3D.h @@ -59,23 +59,6 @@ #undef PS_ON_PIN // 12 #define PS_ON_PIN 81 // External Power Supply -#if ENABLED(BQ_LCD_SMART_CONTROLLER) // Most similar to REPRAP_DISCOUNT_SMART_CONTROLLER - #define KILL_PIN 41 - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define LCD_PIN_BL 39 - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - - #define SD_DETECT_PIN 49 -#endif - #if ENABLED(AUTO_BED_LEVELING_FEATURE) #undef Z_MIN_PIN #undef Z_MAX_PIN diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index a524289b8..32232af4b 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -116,10 +116,6 @@ #define PS_ON_PIN 12 -#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL) - #define KILL_PIN 41 -#endif - #if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) #define HEATER_0_PIN 8 #else @@ -168,6 +164,12 @@ #define BTN_ENC 35 #define SD_DETECT_PIN 49 + #define KILL_PIN 41 + + #if ENABLED(BQ_LCD_SMART_CONTROLLER) + #define LCD_PIN_BL 39 + #endif + #elif ENABLED(LCD_I2C_PANELOLU2) #define BTN_EN1 47 // reverse if the encoder turns the wrong way. #define BTN_EN2 43 @@ -241,6 +243,7 @@ #if ENABLED(G3D_PANEL) #define SD_DETECT_PIN 49 + #define KILL_PIN 41 #else // #define SD_DETECT_PIN -1 // Ramps doesn't use this #endif @@ -282,7 +285,3 @@ #define MISO_PIN 50 #define MOSI_PIN 51 #endif - -#ifndef KILL_PIN - // #define KILL_PIN -1 -#endif From d13c86f6f64bfd1a48648c2594644f779340af0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 9 Jun 2016 15:48:46 +0100 Subject: [PATCH 039/580] Adds travis test for SPEAKER --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 088f1c56c..a493d9c23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,6 +121,15 @@ script: - opt_enable_adv DUAL_X_CARRIAGE - build_marlin # + # Test SPEAKER with BOARD_BQ_ZUM_MEGA_3D and BQ_LCD_SMART_CONTROLLER + # + - restore_configs + - opt_set MOTHERBOARD BOARD_BQ_ZUM_MEGA_3D + - opt_set LCD_FEEDBACK_FREQUENCY_DURATION_MS 10 + - opt_set LCD_FEEDBACK_FREQUENCY_HZ 100 + - opt_enable BQ_LCD_SMART_CONTROLLER SPEAKER + - build_marlin + # ### LCDS ### # # From fb8e880734bb099b80b031ee2b876e628a50135e Mon Sep 17 00:00:00 2001 From: Sebastianv650 Date: Wed, 4 May 2016 18:53:17 +0200 Subject: [PATCH 040/580] Add LIN_ADVANCE --- Marlin/Configuration_adv.h | 9 +++ Marlin/Marlin_main.cpp | 16 ++++++ Marlin/planner.cpp | 12 ++++ Marlin/planner.h | 4 ++ Marlin/stepper.cpp | 113 ++++++++++++++++++++++++++++++++++++- Marlin/stepper.h | 27 ++++++++- 6 files changed, 178 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 952da0fa7..b90a2ee7e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -457,6 +457,15 @@ #define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET)) #endif +//Implementation of a linear pressure control +//Assumption: advance = k * (delta velocity) +//K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_K 75 +#endif + // @section extras // Arc interpretation settings: diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 73c747837..e48ef2e59 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6468,6 +6468,16 @@ inline void gcode_M503() { #endif // DUAL_X_CARRIAGE +#if ENABLED(LIN_ADVANCE) +/** + * M905: Set advance factor + */ +inline void gcode_M905() { + stepper.synchronize(); + stepper.advance_M905(); +} +#endif + /** * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S */ @@ -7339,6 +7349,12 @@ void process_next_command() { gcode_M605(); break; #endif // DUAL_X_CARRIAGE + + #if ENABLED(LIN_ADVANCE) + case 905: // M905 Set advance factor. + gcode_M905(); + break; + #endif case 907: // M907 Set digital trimpot motor current using axis codes. gcode_M907(); diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index bd60d75a1..a0489c99f 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1045,6 +1045,18 @@ void Planner::check_axes_activity() { // the maximum junction speed and may always be ignored for any speed reduction checks. block->nominal_length_flag = (block->nominal_speed <= v_allowable); block->recalculate_flag = true; // Always calculate trapezoid for new block + + #ifdef LIN_ADVANCE + //bse = allsteps: A problem occures if there is a very tiny move before a retract. + //In this case, the retract and the move will be executed together. This leads to an enormus amount advance steps due to a hughe e_acceleration. + //The math is correct, but you don't want a retract move done with advance! This situation has to be filtered out. + if ((!bse || (!bsx && !bsy && !bsz)) || (stepper.get_advance_k() == 0) || (bse == allsteps)) { + block->use_advance_lead = false; + } else { + block->use_advance_lead = true; + block->e_speed_multiplier8 = (block->steps[E_AXIS] << 8) / block->step_event_count; + } + #endif // Update previous path unit_vector and nominal speed for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = current_speed[i]; diff --git a/Marlin/planner.h b/Marlin/planner.h index 07de37134..5c0d5e12a 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -70,6 +70,10 @@ typedef struct { volatile long final_advance; float advance; #endif + #ifdef LIN_ADVANCE + bool use_advance_lead; + int e_speed_multiplier8; //factorised by 2^8 to avoid float + #endif // Fields used by the motion planner to manage acceleration float nominal_speed, // The nominal speed for this block in mm/sec diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index f8e8a853c..46d0f21e9 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -351,6 +351,22 @@ void Stepper::isr() { e_steps[current_block->active_extruder] += motor_direction(E_AXIS) ? -1 : 1; } #endif //ADVANCE + + #if ENABLED(LIN_ADVANCE) + counter_E += current_block->steps[E_AXIS]; + if (counter_E > 0) { + counter_E -= current_block->step_event_count; + count_position[_AXIS(E)] += count_direction[_AXIS(E)]; + e_steps[current_block->active_extruder] += motor_direction(E_AXIS) ? -1 : 1; + } + + if (current_block->use_advance_lead){ + int delta_adv_steps; //Maybe a char would be enough? + delta_adv_steps = (((long)extruder_advance_k * current_estep_rate[current_block->active_extruder]) >> 9) - current_adv_steps[current_block->active_extruder]; + e_steps[current_block->active_extruder] += delta_adv_steps; + current_adv_steps[current_block->active_extruder] += delta_adv_steps; + } + #endif //LIN_ADVANCE #define _COUNTER(AXIS) counter_## AXIS #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP @@ -363,7 +379,7 @@ void Stepper::isr() { STEP_ADD(X); STEP_ADD(Y); STEP_ADD(Z); - #if DISABLED(ADVANCE) + #if (DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)) STEP_ADD(E); #endif @@ -377,7 +393,7 @@ void Stepper::isr() { STEP_IF_COUNTER(X); STEP_IF_COUNTER(Y); STEP_IF_COUNTER(Z); - #if DISABLED(ADVANCE) + #if (DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)) STEP_IF_COUNTER(E); #endif @@ -398,6 +414,12 @@ void Stepper::isr() { timer = calc_timer(acc_step_rate); OCR1A = timer; acceleration_time += timer; + + #if ENABLED(LIN_ADVANCE) + if (current_block->use_advance_lead){ + current_estep_rate[current_block->active_extruder] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8; + } + #endif #if ENABLED(ADVANCE) @@ -424,6 +446,12 @@ void Stepper::isr() { timer = calc_timer(step_rate); OCR1A = timer; deceleration_time += timer; + + #if ENABLED(LIN_ADVANCE) + if (current_block->use_advance_lead){ + current_estep_rate[current_block->active_extruder] = ((unsigned long)step_rate * current_block->e_speed_multiplier8) >> 8; + } + #endif #if ENABLED(ADVANCE) advance -= advance_rate * step_loops; @@ -436,6 +464,12 @@ void Stepper::isr() { #endif //ADVANCE } else { + #ifdef LIN_ADVANCE + if (current_block->use_advance_lead){ + current_estep_rate[current_block->active_extruder] = final_estep_rate; + } + #endif + OCR1A = OCR1A_nominal; // ensure we're running at the correct step rate, even if we just came off an acceleration step_loops = step_loops_nominal; @@ -491,6 +525,55 @@ void Stepper::isr() { #endif // ADVANCE +#if ENABLED(LIN_ADVANCE) +unsigned char old_OCR0A; +// Timer interrupt for E. e_steps is set in the main routine; +// Timer 0 is shared with millies +ISR(TIMER0_COMPA_vect) { stepper.advance_isr(); } + +void Stepper::advance_isr() { + old_OCR0A += 52; // ~10kHz interrupt (250000 / 26 = 9615kHz) war 52 + OCR0A = old_OCR0A; + +#define STEP_E_ONCE(INDEX) \ + if (e_steps[INDEX] != 0) { \ + E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \ + if (e_steps[INDEX] < 0) { \ + E## INDEX ##_DIR_WRITE(INVERT_E## INDEX ##_DIR); \ + e_steps[INDEX]++; \ + } \ + else if (e_steps[INDEX] > 0) { \ + E## INDEX ##_DIR_WRITE(!INVERT_E## INDEX ##_DIR); \ + e_steps[INDEX]--; \ + } \ + E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \ + } + + // Step all E steppers that have steps, up to 4 steps per interrupt + for (unsigned char i = 0; i < 4; i++) { + #if EXTRUDERS > 3 + switch(current_block->active_extruder){case 3:STEP_E_ONCE(3);break;case 2:STEP_E_ONCE(2);break;case 1:STEP_E_ONCE(1);break;default:STEP_E_ONCE(0);} + #elif EXTRUDERS > 2 + switch(current_block->active_extruder){case 2:STEP_E_ONCE(2);break;case 1:STEP_E_ONCE(1);break;default:STEP_E_ONCE(0);} + #elif EXTRUDERS > 1 + #if DISABLED(DUAL_X_CARRIAGE) + if(current_block->active_extruder == 1){STEP_E_ONCE(1)}else{STEP_E_ONCE(0);} + #else + extern bool extruder_duplication_enabled; + if(extruder_duplication_enabled){ + STEP_E_ONCE(0); + STEP_E_ONCE(1); + }else { + if(current_block->active_extruder == 1){STEP_E_ONCE(1)}else{STEP_E_ONCE(0);} + } + #endif + #else + STEP_E_ONCE(0); + #endif + } +} +#endif // LIN_ADVANCE + void Stepper::init() { digipot_init(); //Initialize Digipot Motor Current @@ -655,6 +738,18 @@ void Stepper::init() { OCR1A = 0x4000; TCNT1 = 0; ENABLE_STEPPER_DRIVER_INTERRUPT(); + + #if ENABLED(LIN_ADVANCE) + for (int i = 0; i < EXTRUDERS; i++){ + e_steps[i] = 0; + current_adv_steps[i] = 0; + } + #if defined(TCCR0A) && defined(WGM01) + CBI(TCCR0A, WGM01); + CBI(TCCR0A, WGM00); + #endif + SBI(TIMSK0, OCIE0A); + #endif //LIN_ADVANCE #if ENABLED(ADVANCE) #if defined(TCCR0A) && defined(WGM01) @@ -1040,3 +1135,17 @@ void Stepper::microstep_readings() { SERIAL_PROTOCOLLN(digitalRead(E1_MS2_PIN)); #endif } + +#if ENABLED(LIN_ADVANCE) + void Stepper::advance_M905() { + if (code_seen('K')) extruder_advance_k = code_value(); + SERIAL_ECHO_START; + SERIAL_ECHOPGM("Advance factor:"); + SERIAL_CHAR(' '); + SERIAL_ECHOLN(extruder_advance_k); + } + + int Stepper::get_advance_k(){ + return extruder_advance_k; + } +#endif diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 1aebe366c..e9d1191bc 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -93,6 +93,10 @@ class Stepper { #if ENABLED(ADVANCE) static long e_steps[EXTRUDERS]; #endif + + #if ENABLED(LIN_ADVANCE) + int extruder_advance_k = LIN_K; + #endif private: @@ -111,6 +115,14 @@ class Stepper { static unsigned char old_OCR0A; static long advance_rate, advance, old_advance, final_advance; #endif + + #if ENABLED(LIN_ADVANCE) + unsigned char old_OCR0A; + volatile int e_steps[EXTRUDERS]; + int final_estep_rate; + int current_estep_rate[EXTRUDERS]; //Actual extruder speed [steps/s] + int current_adv_steps[EXTRUDERS]; //The amount of current added esteps due to advance. Think of it as the current amount of pressure applied to the spring (=filament). + #endif static long acceleration_time, deceleration_time; //unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate; @@ -159,6 +171,12 @@ class Stepper { #if ENABLED(ADVANCE) static void advance_isr(); #endif + + #if ENABLED(LIN_ADVANCE) + void advance_isr(); + void advance_M905(); + int get_advance_k(); + #endif // // Block until all buffered steps are executed @@ -315,6 +333,13 @@ class Stepper { acc_step_rate = current_block->initial_rate; acceleration_time = calc_timer(acc_step_rate); OCR1A = acceleration_time; + + #if ENABLED(LIN_ADVANCE) + if (current_block->use_advance_lead){ + current_estep_rate[current_block->active_extruder] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8; + final_estep_rate = (current_block->nominal_rate * current_block->e_speed_multiplier8) >> 8; + } + #endif // SERIAL_ECHO_START; // SERIAL_ECHOPGM("advance :"); @@ -332,4 +357,4 @@ class Stepper { }; -#endif // STEPPER_H \ No newline at end of file +#endif // STEPPER_H From 6d62a4ffc8010ca56f5f438a9da96e781ee65099 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 4 May 2016 12:10:42 -0700 Subject: [PATCH 041/580] Patch LIN_ADVANCE for style and forward-compatibility --- Marlin/Configuration_adv.h | 18 ++-- Marlin/Marlin_main.cpp | 14 +-- Marlin/SanityCheck.h | 8 +- Marlin/planner.cpp | 31 ++++--- Marlin/planner.h | 10 +-- Marlin/stepper.cpp | 176 +++++++++++++++---------------------- Marlin/stepper.h | 52 +++++------ 7 files changed, 141 insertions(+), 168 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index b90a2ee7e..43b51115e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. @@ -457,15 +466,6 @@ #define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET)) #endif -//Implementation of a linear pressure control -//Assumption: advance = k * (delta velocity) -//K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 -#define LIN_ADVANCE - -#if ENABLED(LIN_ADVANCE) - #define LIN_K 75 -#endif - // @section extras // Arc interpretation settings: diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e48ef2e59..b41ea10ee 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6469,13 +6469,13 @@ inline void gcode_M503() { #endif // DUAL_X_CARRIAGE #if ENABLED(LIN_ADVANCE) -/** - * M905: Set advance factor - */ -inline void gcode_M905() { - stepper.synchronize(); - stepper.advance_M905(); -} + /** + * M905: Set advance factor + */ + inline void gcode_M905() { + stepper.synchronize(); + stepper.advance_M905(); + } #endif /** diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index a913cb1b0..4110d6705 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -351,6 +351,13 @@ #endif // AUTO_BED_LEVELING_FEATURE +/** + * Advance Extrusion + */ +#if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE) + #error You can enable ADVANCE or LIN_ADVANCE, but not both. +#endif + /** * Filament Width Sensor */ @@ -358,7 +365,6 @@ #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined." #endif - /** * ULTIPANEL encoder */ diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index a0489c99f..699987f15 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1045,24 +1045,28 @@ void Planner::check_axes_activity() { // the maximum junction speed and may always be ignored for any speed reduction checks. block->nominal_length_flag = (block->nominal_speed <= v_allowable); block->recalculate_flag = true; // Always calculate trapezoid for new block - - #ifdef LIN_ADVANCE - //bse = allsteps: A problem occures if there is a very tiny move before a retract. - //In this case, the retract and the move will be executed together. This leads to an enormus amount advance steps due to a hughe e_acceleration. - //The math is correct, but you don't want a retract move done with advance! This situation has to be filtered out. - if ((!bse || (!bsx && !bsy && !bsz)) || (stepper.get_advance_k() == 0) || (bse == allsteps)) { + + // Update previous path unit_vector and nominal speed + for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = current_speed[i]; + previous_nominal_speed = block->nominal_speed; + + #if ENABLED(LIN_ADVANCE) + + // bse == allsteps: A problem occurs when there's a very tiny move before a retract. + // In this case, the retract and the move will be executed together. + // This leads to an enormous number of advance steps due to a huge e_acceleration. + // The math is correct, but you don't want a retract move done with advance! + // So this situation is filtered out here. + if (!bse || (!bsx && !bsy && !bsz) || stepper.get_advance_k() == 0 || bse == allsteps) { block->use_advance_lead = false; - } else { + } + else { block->use_advance_lead = true; block->e_speed_multiplier8 = (block->steps[E_AXIS] << 8) / block->step_event_count; } - #endif - // Update previous path unit_vector and nominal speed - for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = current_speed[i]; - previous_nominal_speed = block->nominal_speed; + #elif ENABLED(ADVANCE) - #if ENABLED(ADVANCE) // Calculate advance rate if (!bse || (!bsx && !bsy && !bsz)) { block->advance_rate = 0; @@ -1081,7 +1085,8 @@ void Planner::check_axes_activity() { SERIAL_ECHOPGM("advance rate :"); SERIAL_ECHOLN(block->advance_rate/256.0); */ - #endif // ADVANCE + + #endif // ADVANCE or LIN_ADVANCE calculate_trapezoid_for_block(block, block->entry_speed / block->nominal_speed, safe_speed / block->nominal_speed); diff --git a/Marlin/planner.h b/Marlin/planner.h index 5c0d5e12a..51219743e 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -64,16 +64,16 @@ typedef struct { unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) - #if ENABLED(ADVANCE) + // Advance extrusion + #if ENABLED(LIN_ADVANCE) + bool use_advance_lead; + int e_speed_multiplier8; // Factorised by 2^8 to avoid float + #elif ENABLED(ADVANCE) long advance_rate; volatile long initial_advance; volatile long final_advance; float advance; #endif - #ifdef LIN_ADVANCE - bool use_advance_lead; - int e_speed_multiplier8; //factorised by 2^8 to avoid float - #endif // Fields used by the motion planner to manage acceleration float nominal_speed, // The nominal speed for this block in mm/sec diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 46d0f21e9..0ede6d3b7 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -89,13 +89,24 @@ long Stepper::counter_X = 0, volatile unsigned long Stepper::step_events_completed = 0; // The number of step events executed in the current block -#if ENABLED(ADVANCE) +#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + unsigned char Stepper::old_OCR0A; - long Stepper::final_advance = 0, - Stepper::old_advance = 0, - Stepper::e_steps[EXTRUDERS], - Stepper::advance_rate, - Stepper::advance; + volatile unsigned char Stepper::eISR_Rate = 200; // Keep the ISR at a low rate until needed + + #if ENABLED(LIN_ADVANCE) + volatile int Stepper::e_steps[EXTRUDERS]; + int Stepper::extruder_advance_k = LIN_ADVANCE_K, + Stepper::final_estep_rate, + Stepper::current_estep_rate[EXTRUDERS], + Stepper::current_adv_steps[EXTRUDERS]; + #else + long Stepper::e_steps[EXTRUDERS], + Stepper::final_advance = 0, + Stepper::old_advance = 0, + Stepper::advance_rate, + Stepper::advance; + #endif #endif long Stepper::acceleration_time, Stepper::deceleration_time; @@ -344,30 +355,32 @@ void Stepper::isr() { customizedSerial.checkRx(); // Check for serial chars. #endif - #if ENABLED(ADVANCE) - counter_E += current_block->steps[E_AXIS]; - if (counter_E > 0) { - counter_E -= current_block->step_event_count; - e_steps[current_block->active_extruder] += motor_direction(E_AXIS) ? -1 : 1; - } - #endif //ADVANCE - #if ENABLED(LIN_ADVANCE) + counter_E += current_block->steps[E_AXIS]; if (counter_E > 0) { counter_E -= current_block->step_event_count; - count_position[_AXIS(E)] += count_direction[_AXIS(E)]; + count_position[E_AXIS] += count_direction[E_AXIS]; e_steps[current_block->active_extruder] += motor_direction(E_AXIS) ? -1 : 1; } - - if (current_block->use_advance_lead){ + + if (current_block->use_advance_lead) { int delta_adv_steps; //Maybe a char would be enough? delta_adv_steps = (((long)extruder_advance_k * current_estep_rate[current_block->active_extruder]) >> 9) - current_adv_steps[current_block->active_extruder]; e_steps[current_block->active_extruder] += delta_adv_steps; current_adv_steps[current_block->active_extruder] += delta_adv_steps; } - #endif //LIN_ADVANCE + #elif ENABLED(ADVANCE) + + counter_E += current_block->steps[E_AXIS]; + if (counter_E > 0) { + counter_E -= current_block->step_event_count; + e_steps[current_block->active_extruder] += motor_direction(E_AXIS) ? -1 : 1; + } + + #endif // ADVANCE or LIN_ADVANCE + #define _COUNTER(AXIS) counter_## AXIS #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN @@ -379,7 +392,7 @@ void Stepper::isr() { STEP_ADD(X); STEP_ADD(Y); STEP_ADD(Z); - #if (DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)) + #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) STEP_ADD(E); #endif @@ -393,7 +406,7 @@ void Stepper::isr() { STEP_IF_COUNTER(X); STEP_IF_COUNTER(Y); STEP_IF_COUNTER(Z); - #if (DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)) + #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) STEP_IF_COUNTER(E); #endif @@ -416,12 +429,11 @@ void Stepper::isr() { acceleration_time += timer; #if ENABLED(LIN_ADVANCE) - if (current_block->use_advance_lead){ + + if (current_block->use_advance_lead) current_estep_rate[current_block->active_extruder] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8; - } - #endif - #if ENABLED(ADVANCE) + #elif ENABLED(ADVANCE) advance += advance_rate * step_loops; //NOLESS(advance, current_block->advance); @@ -430,7 +442,8 @@ void Stepper::isr() { e_steps[current_block->active_extruder] += ((advance >> 8) - old_advance); old_advance = advance >> 8; - #endif //ADVANCE + #endif // ADVANCE or LIN_ADVANCE + } else if (step_events_completed > (unsigned long)current_block->decelerate_after) { MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate); @@ -448,12 +461,12 @@ void Stepper::isr() { deceleration_time += timer; #if ENABLED(LIN_ADVANCE) - if (current_block->use_advance_lead){ + + if (current_block->use_advance_lead) current_estep_rate[current_block->active_extruder] = ((unsigned long)step_rate * current_block->e_speed_multiplier8) >> 8; - } - #endif - #if ENABLED(ADVANCE) + #elif ENABLED(ADVANCE) + advance -= advance_rate * step_loops; NOLESS(advance, final_advance); @@ -461,15 +474,15 @@ void Stepper::isr() { uint32_t advance_whole = advance >> 8; e_steps[current_block->active_extruder] += advance_whole - old_advance; old_advance = advance_whole; - #endif //ADVANCE + + #endif // ADVANCE or LIN_ADVANCE } else { - #ifdef LIN_ADVANCE - if (current_block->use_advance_lead){ + #if ENABLED(LIN_ADVANCE) + if (current_block->use_advance_lead) current_estep_rate[current_block->active_extruder] = final_estep_rate; - } #endif - + OCR1A = OCR1A_nominal; // ensure we're running at the correct step rate, even if we just came off an acceleration step_loops = step_loops_nominal; @@ -485,12 +498,14 @@ void Stepper::isr() { } } -#if ENABLED(ADVANCE) +#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + // Timer interrupt for E. e_steps is set in the main routine; // Timer 0 is shared with millies ISR(TIMER0_COMPA_vect) { Stepper::advance_isr(); } void Stepper::advance_isr() { + old_OCR0A += 52; // ~10kHz interrupt (250000 / 26 = 9615kHz) OCR0A = old_OCR0A; @@ -521,58 +536,10 @@ void Stepper::isr() { #endif #endif } - } -#endif // ADVANCE - -#if ENABLED(LIN_ADVANCE) -unsigned char old_OCR0A; -// Timer interrupt for E. e_steps is set in the main routine; -// Timer 0 is shared with millies -ISR(TIMER0_COMPA_vect) { stepper.advance_isr(); } - -void Stepper::advance_isr() { - old_OCR0A += 52; // ~10kHz interrupt (250000 / 26 = 9615kHz) war 52 - OCR0A = old_OCR0A; - -#define STEP_E_ONCE(INDEX) \ - if (e_steps[INDEX] != 0) { \ - E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \ - if (e_steps[INDEX] < 0) { \ - E## INDEX ##_DIR_WRITE(INVERT_E## INDEX ##_DIR); \ - e_steps[INDEX]++; \ - } \ - else if (e_steps[INDEX] > 0) { \ - E## INDEX ##_DIR_WRITE(!INVERT_E## INDEX ##_DIR); \ - e_steps[INDEX]--; \ - } \ - E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \ } - // Step all E steppers that have steps, up to 4 steps per interrupt - for (unsigned char i = 0; i < 4; i++) { - #if EXTRUDERS > 3 - switch(current_block->active_extruder){case 3:STEP_E_ONCE(3);break;case 2:STEP_E_ONCE(2);break;case 1:STEP_E_ONCE(1);break;default:STEP_E_ONCE(0);} - #elif EXTRUDERS > 2 - switch(current_block->active_extruder){case 2:STEP_E_ONCE(2);break;case 1:STEP_E_ONCE(1);break;default:STEP_E_ONCE(0);} - #elif EXTRUDERS > 1 - #if DISABLED(DUAL_X_CARRIAGE) - if(current_block->active_extruder == 1){STEP_E_ONCE(1)}else{STEP_E_ONCE(0);} - #else - extern bool extruder_duplication_enabled; - if(extruder_duplication_enabled){ - STEP_E_ONCE(0); - STEP_E_ONCE(1); - }else { - if(current_block->active_extruder == 1){STEP_E_ONCE(1)}else{STEP_E_ONCE(0);} - } - #endif - #else - STEP_E_ONCE(0); - #endif - } -} -#endif // LIN_ADVANCE +#endif // ADVANCE or LIN_ADVANCE void Stepper::init() { @@ -738,27 +705,29 @@ void Stepper::init() { OCR1A = 0x4000; TCNT1 = 0; ENABLE_STEPPER_DRIVER_INTERRUPT(); - - #if ENABLED(LIN_ADVANCE) - for (int i = 0; i < EXTRUDERS; i++){ - e_steps[i] = 0; - current_adv_steps[i] = 0; - } - #if defined(TCCR0A) && defined(WGM01) - CBI(TCCR0A, WGM01); - CBI(TCCR0A, WGM00); + + #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + + #if ENABLED(LIN_ADVANCE) + + for (int i = 0; i < EXTRUDERS; i++) { + e_steps[i] = 0; + current_adv_steps[i] = 0; + } + + #elif ENABLED(ADVANCE) + + for (uint8_t i = 0; i < EXTRUDERS; i++) e_steps[i] = 0; + #endif - SBI(TIMSK0, OCIE0A); - #endif //LIN_ADVANCE - #if ENABLED(ADVANCE) #if defined(TCCR0A) && defined(WGM01) CBI(TCCR0A, WGM01); CBI(TCCR0A, WGM00); #endif - for (uint8_t i = 0; i < EXTRUDERS; i++) e_steps[i] = 0; SBI(TIMSK0, OCIE0A); - #endif //ADVANCE + + #endif // ADVANCE or LIN_ADVANCE endstops.enable(true); // Start with endstops active. After homing they can be disabled sei(); @@ -1137,15 +1106,12 @@ void Stepper::microstep_readings() { } #if ENABLED(LIN_ADVANCE) + void Stepper::advance_M905() { if (code_seen('K')) extruder_advance_k = code_value(); SERIAL_ECHO_START; - SERIAL_ECHOPGM("Advance factor:"); - SERIAL_CHAR(' '); - SERIAL_ECHOLN(extruder_advance_k); + SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k); + SERIAL_EOL; } - int Stepper::get_advance_k(){ - return extruder_advance_k; - } -#endif +#endif // LIN_ADVANCE diff --git a/Marlin/stepper.h b/Marlin/stepper.h index e9d1191bc..684ec21bc 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -90,14 +90,6 @@ class Stepper { static bool performing_homing; #endif - #if ENABLED(ADVANCE) - static long e_steps[EXTRUDERS]; - #endif - - #if ENABLED(LIN_ADVANCE) - int extruder_advance_k = LIN_K; - #endif - private: static unsigned char last_direction_bits; // The next stepping-bits to be output @@ -111,18 +103,23 @@ class Stepper { static long counter_X, counter_Y, counter_Z, counter_E; static volatile unsigned long step_events_completed; // The number of step events executed in the current block - #if ENABLED(ADVANCE) + #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) static unsigned char old_OCR0A; - static long advance_rate, advance, old_advance, final_advance; - #endif - - #if ENABLED(LIN_ADVANCE) - unsigned char old_OCR0A; - volatile int e_steps[EXTRUDERS]; - int final_estep_rate; - int current_estep_rate[EXTRUDERS]; //Actual extruder speed [steps/s] - int current_adv_steps[EXTRUDERS]; //The amount of current added esteps due to advance. Think of it as the current amount of pressure applied to the spring (=filament). - #endif + static volatile unsigned char eISR_Rate; + #if ENABLED(LIN_ADVANCE) + static volatile int e_steps[EXTRUDERS]; + static int extruder_advance_k; + static int final_estep_rate; + static int current_estep_rate[EXTRUDERS]; // Actual extruder speed [steps/s] + static int current_adv_steps[EXTRUDERS]; // The amount of current added esteps due to advance. + // i.e., the current amount of pressure applied + // to the spring (=filament). + #else + static long e_steps[EXTRUDERS]; + static long advance_rate, advance, final_advance; + static long old_advance; + #endif + #endif // ADVANCE or LIN_ADVANCE static long acceleration_time, deceleration_time; //unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate; @@ -168,15 +165,9 @@ class Stepper { static void isr(); - #if ENABLED(ADVANCE) + #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) static void advance_isr(); #endif - - #if ENABLED(LIN_ADVANCE) - void advance_isr(); - void advance_M905(); - int get_advance_k(); - #endif // // Block until all buffered steps are executed @@ -264,6 +255,11 @@ class Stepper { return endstops_trigsteps[axis] / planner.axis_steps_per_mm[axis]; } + #if ENABLED(LIN_ADVANCE) + void advance_M905(); + FORCE_INLINE int get_advance_k() { return extruder_advance_k; } + #endif + private: static FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) { @@ -335,7 +331,7 @@ class Stepper { OCR1A = acceleration_time; #if ENABLED(LIN_ADVANCE) - if (current_block->use_advance_lead){ + if (current_block->use_advance_lead) { current_estep_rate[current_block->active_extruder] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8; final_estep_rate = (current_block->nominal_rate * current_block->e_speed_multiplier8) >> 8; } @@ -357,4 +353,4 @@ class Stepper { }; -#endif // STEPPER_H +#endif // STEPPER_H \ No newline at end of file From 506d78b2f89bb8e50b9e54fbe51266653299abba Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 May 2016 11:03:56 -0700 Subject: [PATCH 042/580] Run the advance_isr faster instead of doing multiple e-steps per interrupt --- Marlin/stepper.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 0ede6d3b7..bc070178e 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -506,7 +506,19 @@ void Stepper::isr() { void Stepper::advance_isr() { - old_OCR0A += 52; // ~10kHz interrupt (250000 / 26 = 9615kHz) + byte maxesteps = 0; + for (uint8_t i = 0; i < EXTRUDERS; i++) + if (abs(e_steps[i]) > maxesteps) maxesteps = abs(e_steps[i]); + + if (maxesteps > 3) + old_OCR0A += 13; // ~19kHz (250000/13 = 19230 Hz) + else if (maxesteps > 2) + old_OCR0A += 17; // ~15kHz (250000/17 = 14705 Hz) + else if (maxesteps > 1) + old_OCR0A += 26; // ~10kHz (250000/26 = 9615 Hz) + else + old_OCR0A += 52; // ~5kHz (250000/26 = 4807 Hz) + OCR0A = old_OCR0A; #define STEP_E_ONCE(INDEX) \ @@ -523,19 +535,17 @@ void Stepper::isr() { E## INDEX ##_STEP_WRITE(!INVERT_E_STEP_PIN); \ } - // Step all E steppers that have steps, up to 4 steps per interrupt - for (unsigned char i = 0; i < 4; i++) { - STEP_E_ONCE(0); - #if EXTRUDERS > 1 - STEP_E_ONCE(1); - #if EXTRUDERS > 2 - STEP_E_ONCE(2); - #if EXTRUDERS > 3 - STEP_E_ONCE(3); - #endif + // Step all E steppers that have steps + STEP_E_ONCE(0); + #if EXTRUDERS > 1 + STEP_E_ONCE(1); + #if EXTRUDERS > 2 + STEP_E_ONCE(2); + #if EXTRUDERS > 3 + STEP_E_ONCE(3); #endif #endif - } + #endif } From aad9c0ed8d6cb61c701aae4cd94da8d9619c4dd9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 8 May 2016 12:16:26 -0700 Subject: [PATCH 043/580] Apply updated ISR timing code --- Marlin/stepper.cpp | 34 ++++++++++++++++++++-------------- Marlin/stepper.h | 2 +- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index bc070178e..c9d49cd12 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -413,6 +413,12 @@ void Stepper::isr() { step_events_completed++; if (step_events_completed >= current_block->step_event_count) break; } + + #if ENABLED(LIN_ADVANCE) + // If we have esteps to execute, fire the next ISR "now" + if (e_steps[current_block->active_extruder]) OCR0A = TCNT0 + 2; + #endif + // Calculate new timer value unsigned short timer, step_rate; if (step_events_completed <= (unsigned long)current_block->accelerate_until) { @@ -427,7 +433,7 @@ void Stepper::isr() { timer = calc_timer(acc_step_rate); OCR1A = timer; acceleration_time += timer; - + #if ENABLED(LIN_ADVANCE) if (current_block->use_advance_lead) @@ -444,6 +450,9 @@ void Stepper::isr() { #endif // ADVANCE or LIN_ADVANCE + #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + eISR_Rate = (timer >> 2) / abs(e_steps[current_block->active_extruder]); + #endif } else if (step_events_completed > (unsigned long)current_block->decelerate_after) { MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate); @@ -476,11 +485,20 @@ void Stepper::isr() { old_advance = advance_whole; #endif // ADVANCE or LIN_ADVANCE + + #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) + eISR_Rate = (timer >> 2) / abs(e_steps[current_block->active_extruder]); + #endif } else { + #if ENABLED(LIN_ADVANCE) + if (current_block->use_advance_lead) current_estep_rate[current_block->active_extruder] = final_estep_rate; + + eISR_Rate = (OCR1A_nominal >> 2) / abs(e_steps[current_block->active_extruder]); + #endif OCR1A = OCR1A_nominal; @@ -506,19 +524,7 @@ void Stepper::isr() { void Stepper::advance_isr() { - byte maxesteps = 0; - for (uint8_t i = 0; i < EXTRUDERS; i++) - if (abs(e_steps[i]) > maxesteps) maxesteps = abs(e_steps[i]); - - if (maxesteps > 3) - old_OCR0A += 13; // ~19kHz (250000/13 = 19230 Hz) - else if (maxesteps > 2) - old_OCR0A += 17; // ~15kHz (250000/17 = 14705 Hz) - else if (maxesteps > 1) - old_OCR0A += 26; // ~10kHz (250000/26 = 9615 Hz) - else - old_OCR0A += 52; // ~5kHz (250000/26 = 4807 Hz) - + old_OCR0A += eISR_Rate; OCR0A = old_OCR0A; #define STEP_E_ONCE(INDEX) \ diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 684ec21bc..279db1807 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -22,7 +22,7 @@ /** * stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors - * Part of Grbl + * Derived from Grbl * * Copyright (c) 2009-2011 Simen Svale Skogsrud * From 45b701d38c02892b5d1f233c22142aa578df7c3d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 May 2016 19:29:47 -0700 Subject: [PATCH 044/580] Travis test for LIN_ADVANCE --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 24640918a..2edc974eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,10 +76,12 @@ script: - build_marlin # # Test 3 extruders on RUMBA (can use any board with >=3 extruders defined) + # Include a test for LIN_ADVANCE here also # - opt_set MOTHERBOARD BOARD_RUMBA - opt_set EXTRUDERS 3 - opt_set TEMP_SENSOR_2 1 + - opt_enable_adv LIN_ADVANCE - build_marlin # # Test PIDTEMPBED From 378ff92e98fa552cf712a7286b8f5d729d880d43 Mon Sep 17 00:00:00 2001 From: Blue-Marlin Date: Fri, 10 Jun 2016 23:36:57 +0200 Subject: [PATCH 045/580] manage_manual_move(); -> ULTIPANEL Makr the call of `manage_manual_move() ` depandent of `ULTIPANEL` --- Marlin/ultralcd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 6f19ce56a..2af63572e 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2160,9 +2160,10 @@ bool lcd_blink() { void lcd_update() { #if ENABLED(ULTIPANEL) static millis_t return_to_status_ms = 0; + + manage_manual_move(); #endif - manage_manual_move(); lcd_buttons_update(); From 2c34ec2bac502dd56ee2ba4e558b47763b19729c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 11 Jun 2016 00:12:49 +0100 Subject: [PATCH 046/580] Closes #3999: Compilation error with BEEPER_PIN -1 --- Marlin/ultralcd.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 5cb1ecc57..e85583536 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -27,8 +27,6 @@ #if ENABLED(ULTRA_LCD) - #include "buzzer.h" - #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) #define BUTTON_PRESSED(BN) !READ(BTN_## BN) From 0e2bfd0769e2c5ffb8f47ad10b0ba6b00fb206d7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Jun 2016 18:27:01 -0700 Subject: [PATCH 047/580] Use linear feedrate in gcode_T, not volumetric --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 73c747837..e8d693902 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6599,7 +6599,7 @@ inline void gcode_T(uint8_t tmp_extruder) { float stored_feedrate = feedrate; if (code_seen('F')) { - float next_feedrate = code_value_axis_units(E_AXIS); + float next_feedrate = code_value_axis_units(X_AXIS); if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate; } else { From 280af07b4c1258e4e455697ef3dfd4aa78e2af5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 10 Jun 2016 15:25:00 +0100 Subject: [PATCH 048/580] Improves travis buildroot regexp --- buildroot/bin/opt_disable | 2 +- buildroot/bin/opt_disable_adv | 5 +++++ buildroot/bin/opt_enable | 2 +- buildroot/bin/opt_enable_adv | 2 +- buildroot/bin/opt_set | 2 +- buildroot/bin/opt_set_adv | 2 +- buildroot/bin/pins_set | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 buildroot/bin/opt_disable_adv diff --git a/buildroot/bin/opt_disable b/buildroot/bin/opt_disable index 4e2d853fb..35ad1aad4 100755 --- a/buildroot/bin/opt_disable +++ b/buildroot/bin/opt_disable @@ -1,5 +1,5 @@ #!/usr/bin/env bash for opt in "$@" ; do - eval "sed -i 's/\(\/\/ *\)*\(\#define +$opt[^a-zA-Z0-9_]\)/\/\/\2/g' Marlin/Configuration.h" + eval "sed -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration.h" done diff --git a/buildroot/bin/opt_disable_adv b/buildroot/bin/opt_disable_adv new file mode 100644 index 000000000..80d83183e --- /dev/null +++ b/buildroot/bin/opt_disable_adv @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +for opt in "$@" ; do + eval "sed -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h" +done diff --git a/buildroot/bin/opt_enable b/buildroot/bin/opt_enable index cc9a3e007..7b119fa15 100755 --- a/buildroot/bin/opt_enable +++ b/buildroot/bin/opt_enable @@ -1,5 +1,5 @@ #!/usr/bin/env bash for opt in "$@" ; do - eval "sed -i 's/\/\/ *\(#define +$opt[^a-zA-Z0-9_]\)/\1/g' Marlin/Configuration.h" + eval "sed -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration.h" done diff --git a/buildroot/bin/opt_enable_adv b/buildroot/bin/opt_enable_adv index a557dc3f7..a34e56f12 100755 --- a/buildroot/bin/opt_enable_adv +++ b/buildroot/bin/opt_enable_adv @@ -1,5 +1,5 @@ #!/usr/bin/env bash for opt in "$@" ; do - eval "sed -i 's/\/\/ *\(#define +$opt[^a-zA-Z0-9_]\)/\1/g' Marlin/Configuration_adv.h" + eval "sed -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration_adv.h" done diff --git a/buildroot/bin/opt_set b/buildroot/bin/opt_set index 2646bc103..cf8c0d850 100755 --- a/buildroot/bin/opt_set +++ b/buildroot/bin/opt_set @@ -1,3 +1,3 @@ #!/usr/bin/env bash -eval "sed -i 's/\(#define +$1 +\)[^ ]*$/\1 $2/g' Marlin/Configuration.h" +eval "sed -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration.h" diff --git a/buildroot/bin/opt_set_adv b/buildroot/bin/opt_set_adv index 63a18d436..54076a0bc 100755 --- a/buildroot/bin/opt_set_adv +++ b/buildroot/bin/opt_set_adv @@ -1,3 +1,3 @@ #!/usr/bin/env bash -eval "sed -i 's/\(#define +$1 +\)[^ ]*$/\1 $2/g' Marlin/Configuration_adv.h" +eval "sed -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration_adv.h" diff --git a/buildroot/bin/pins_set b/buildroot/bin/pins_set index bd14586be..ae6549fb3 100755 --- a/buildroot/bin/pins_set +++ b/buildroot/bin/pins_set @@ -1,3 +1,3 @@ #!/usr/bin/env bash -eval "sed -i 's/\(#define +$2 +\)[^ ]*$/\1 $3/g' Marlin/pins_$1.h" +eval "sed -i 's/\(#define \b${2}\b\).*$/\1 ${3}/g' Marlin/pins_${1}.h" From 9b3a0895fdcde5fdec33643e828a0832a413f5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 10 Jun 2016 16:04:01 +0100 Subject: [PATCH 049/580] Upgrades travis Arduino IDE version to 1.6.9 --- .travis.yml | 132 +++++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 63 deletions(-) diff --git a/.travis.yml b/.travis.yml index 24640918a..ed31e34e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,10 +17,10 @@ before_install: # install: # - # Install arduino 1.6.8 - - wget http://downloads-02.arduino.cc/arduino-1.6.8-linux64.tar.xz - - tar xf arduino-1.6.8-linux64.tar.xz - - sudo mv arduino-1.6.8 /usr/local/share/arduino + # Install arduino 1.6.9 + - wget http://downloads-02.arduino.cc/arduino-1.6.9-linux64.tar.xz + - tar xf arduino-1.6.9-linux64.tar.xz + - sudo mv arduino-1.6.9 /usr/local/share/arduino - ln -s /usr/local/share/arduino/arduino ${TRAVIS_BUILD_DIR}/buildroot/bin/arduino # # Install: LiquidCrystal_I2C library @@ -105,7 +105,8 @@ script: - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR SERVO_ENDSTOP_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - build_marlin # - # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT + # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, + # INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT # - restore_configs - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT @@ -130,7 +131,57 @@ script: - opt_enable BQ_LCD_SMART_CONTROLLER SPEAKER - build_marlin # - ### LCDS ### + # Enable FILAMENTCHANGEENABLE + # + - restore_configs + - opt_enable FILAMENTCHANGEENABLE ULTIMAKERCONTROLLER + - build_marlin + # + # Enable filament sensor + # + - restore_configs + - opt_enable FILAMENT_WIDTH_SENSOR + - build_marlin + # + # Enable filament sensor with LCD display + # + - opt_enable ULTIMAKERCONTROLLER FILAMENT_LCD_DISPLAY + - build_marlin + # + # Enable BEZIER_CURVE_SUPPORT + # + - restore_configs + - opt_enable_adv BEZIER_CURVE_SUPPORT + - build_marlin + # + # Enable COREXY + # + - restore_configs + - opt_enable COREXY + - build_marlin + # + # Enable COREXZ + # + - restore_configs + - opt_enable COREXZ + - build_marlin + # + # Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS + # + - restore_configs + - opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS + - pins_set RAMPS_14 X_MAX_PIN -1 + - opt_set_adv Z2_MAX_PIN 2 + - build_marlin + # + # Test PRINTCOUNTER + # + - restore_configs + - opt_enable PRINTCOUNTER + - build_marlin + # + # + ######## STANDARD LCD/PANELS ############## # # ULTRA_LCD # @@ -188,25 +239,29 @@ script: - opt_enable RA_CONTROL_PANEL - build_marlin # - ### I2C PANELS ### + ######## I2C LCD/PANELS ############## + # + # !!!ATTENTION!!! + # Most I2C configurations are failing at the moment because they require + # a different Liquid Crystal library "LiquidTWI2". # # LCD_I2C_SAINSMART_YWROBOT - # Failing at the moment needs different library + # #- restore_configs #- opt_enable LCD_I2C_SAINSMART_YWROBOT #- build_marlin # # LCD_I2C_PANELOLU2 # - - restore_configs - - opt_enable LCD_I2C_PANELOLU2 - - build_marlin + #- restore_configs + #- opt_enable LCD_I2C_PANELOLU2 + #- build_marlin # # LCD_I2C_VIKI # - - restore_configs - - opt_enable LCD_I2C_VIKI - - build_marlin + #- restore_configs + #- opt_enable LCD_I2C_VIKI + #- build_marlin # # LCM1602 # @@ -214,55 +269,6 @@ script: - opt_enable LCM1602 - build_marlin # - # Enable FILAMENTCHANGEENABLE - # - - restore_configs - - opt_enable FILAMENTCHANGEENABLE ULTIMAKERCONTROLLER - - build_marlin - # - # Enable filament sensor - # - - restore_configs - - opt_enable FILAMENT_WIDTH_SENSOR - - build_marlin - # - # Enable filament sensor with LCD display - # - - opt_enable ULTIMAKERCONTROLLER FILAMENT_LCD_DISPLAY - - build_marlin - # - # Enable BEZIER_CURVE_SUPPORT - # - - restore_configs - - opt_enable_adv BEZIER_CURVE_SUPPORT - - build_marlin - # - # Enable COREXY - # - - restore_configs - - opt_enable COREXY - - build_marlin - # - # Enable COREXZ - # - - restore_configs - - opt_enable COREXZ - - build_marlin - # - # Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS - # - - restore_configs - - opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS - - pins_set RAMPS_14 X_MAX_PIN -1 - - opt_set_adv Z2_MAX_PIN 2 - - build_marlin - # - # Test PRINTCOUNTER - # - - restore_configs - - opt_enable PRINTCOUNTER - - build_marlin - # # ######## Example Configurations ############## # From 45ea8749d39d1337ec88295dea4423ae86b536f8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Jun 2016 14:12:00 -0700 Subject: [PATCH 050/580] Wrap all items depending on ULTIPANEL --- Marlin/ultralcd.cpp | 2933 ++++++++++++++++++++++--------------------- Marlin/ultralcd.h | 13 +- 2 files changed, 1480 insertions(+), 1466 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 2af63572e..aafbf572b 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -29,33 +29,6 @@ #include "stepper.h" #include "configuration_store.h" -/** - * REVERSE_MENU_DIRECTION - * - * To reverse the menu direction we need a general way to reverse - * the direction of the encoder everywhere. So encoderDirection is - * added to allow the encoder to go the other way. - * - * This behavior is limited to scrolling Menus and SD card listings, - * and is disabled in other contexts. - */ -#if ENABLED(REVERSE_MENU_DIRECTION) - int8_t encoderDirection = 1; - #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1) - #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1) -#else - #define ENCODER_DIRECTION_NORMAL() ; - #define ENCODER_DIRECTION_MENUS() ; -#endif - -int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update - -int8_t manual_move_axis = (int8_t)NO_AXIS; -millis_t manual_move_start_time = 0; - -bool encoderRateMultiplierEnabled; -int32_t lastEncoderMovementMillis; - int plaPreheatHotendTemp; int plaPreheatHPBTemp; int plaPreheatFanSpeed; @@ -68,9 +41,6 @@ int absPreheatFanSpeed; millis_t previous_lcd_status_ms = 0; #endif -// Function pointer to menu functions. -typedef void (*menuFunc_t)(); - uint8_t lcd_status_message_level; char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1 @@ -83,8 +53,50 @@ char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kan // The main status screen static void lcd_status_screen(); +millis_t next_lcd_update_ms; + +enum LCDViewAction { + LCDVIEW_NONE, + LCDVIEW_REDRAW_NOW, + LCDVIEW_CALL_REDRAW_NEXT, + LCDVIEW_CLEAR_CALL_REDRAW, + LCDVIEW_CALL_NO_REDRAW +}; + +uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) + #if ENABLED(ULTIPANEL) + // place-holders for Ki and Kd edits + float raw_Ki, raw_Kd; + + /** + * REVERSE_MENU_DIRECTION + * + * To reverse the menu direction we need a general way to reverse + * the direction of the encoder everywhere. So encoderDirection is + * added to allow the encoder to go the other way. + * + * This behavior is limited to scrolling Menus and SD card listings, + * and is disabled in other contexts. + */ + #if ENABLED(REVERSE_MENU_DIRECTION) + int8_t encoderDirection = 1; + #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1) + #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1) + #else + #define ENCODER_DIRECTION_NORMAL() ; + #define ENCODER_DIRECTION_MENUS() ; + #endif + + int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update + + int8_t manual_move_axis = (int8_t)NO_AXIS; + millis_t manual_move_start_time = 0; + + bool encoderRateMultiplierEnabled; + int32_t lastEncoderMovementMillis; + #if HAS_POWER_SWITCH extern bool powersupply; #endif @@ -116,7 +128,10 @@ static void lcd_status_screen(); #include "mesh_bed_leveling.h" #endif - /* Different types of actions that can be used in menu items. */ + // Function pointer to menu functions. + typedef void (*menuFunc_t)(); + + // Different types of actions that can be used in menu items. static void menu_action_back(); static void menu_action_submenu(menuFunc_t data); static void menu_action_gcode(const char* pgcode); @@ -270,91 +285,80 @@ static void lcd_status_screen(); uint8_t lcd_sd_status; #endif -#endif // ULTIPANEL - -typedef struct { - menuFunc_t menu_function; - #if ENABLED(ULTIPANEL) + typedef struct { + menuFunc_t menu_function; uint32_t encoder_position; - #endif -} menuPosition; - -menuFunc_t currentMenu = lcd_status_screen; // pointer to the currently active menu handler + } menuPosition; -menuPosition menu_history[10]; -uint8_t menu_history_depth = 0; + menuFunc_t currentMenu = lcd_status_screen; // pointer to the currently active menu handler -millis_t next_lcd_update_ms; -bool ignore_click = false; -bool wait_for_unclick; -bool defer_return_to_status = false; + menuPosition menu_history[10]; + uint8_t menu_history_depth = 0; -enum LCDViewAction { - LCDVIEW_NONE, - LCDVIEW_REDRAW_NOW, - LCDVIEW_CALL_REDRAW_NEXT, - LCDVIEW_CLEAR_CALL_REDRAW, - LCDVIEW_CALL_NO_REDRAW -}; + bool ignore_click = false; + bool wait_for_unclick; + bool defer_return_to_status = false; -uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) + // Variables used when editing values. + const char* editLabel; + void* editValue; + int32_t minEditValue, maxEditValue; + menuFunc_t callbackFunc; // call this after editing -// Variables used when editing values. -const char* editLabel; -void* editValue; -int32_t minEditValue, maxEditValue; -menuFunc_t callbackFunc; // call this after editing + /** + * General function to go directly to a menu + * Remembers the previous position + */ + static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const uint32_t encoder = 0) { + if (currentMenu != menu) { + currentMenu = menu; + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; + #if ENABLED(NEWPANEL) + encoderPosition = encoder; + if (feedback) lcd_quick_feedback(); + #endif + if (menu == lcd_status_screen) { + defer_return_to_status = false; + menu_history_depth = 0; + } + #if ENABLED(LCD_PROGRESS_BAR) + // For LCD_PROGRESS_BAR re-initialize custom characters + lcd_set_custom_characters(menu == lcd_status_screen); + #endif + } + } -// place-holders for Ki and Kd edits -float raw_Ki, raw_Kd; + static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); } -/** - * General function to go directly to a menu - * Remembers the previous position - */ -static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const uint32_t encoder = 0) { - if (currentMenu != menu) { - currentMenu = menu; - lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; - #if ENABLED(NEWPANEL) - encoderPosition = encoder; - if (feedback) lcd_quick_feedback(); - #endif - if (menu == lcd_status_screen) { - defer_return_to_status = false; - menu_history_depth = 0; + inline void lcd_save_previous_menu() { + if (menu_history_depth < COUNT(menu_history)) { + menu_history[menu_history_depth].menu_function = currentMenu; + #if ENABLED(ULTIPANEL) + menu_history[menu_history_depth].encoder_position = encoderPosition; + #endif + ++menu_history_depth; } - #if ENABLED(LCD_PROGRESS_BAR) - // For LCD_PROGRESS_BAR re-initialize custom characters - lcd_set_custom_characters(menu == lcd_status_screen); - #endif } -} -static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); } - -inline void lcd_save_previous_menu() { - if (menu_history_depth < COUNT(menu_history)) { - menu_history[menu_history_depth].menu_function = currentMenu; - #if ENABLED(ULTIPANEL) - menu_history[menu_history_depth].encoder_position = encoderPosition; - #endif - ++menu_history_depth; + static void lcd_goto_previous_menu(bool feedback=false) { + if (menu_history_depth > 0) { + --menu_history_depth; + lcd_goto_menu(menu_history[menu_history_depth].menu_function, feedback + #if ENABLED(ULTIPANEL) + , menu_history[menu_history_depth].encoder_position + #endif + ); + } + else + lcd_return_to_status(); } -} -static void lcd_goto_previous_menu(bool feedback=false) { - if (menu_history_depth > 0) { - --menu_history_depth; - lcd_goto_menu(menu_history[menu_history_depth].menu_function, feedback - #if ENABLED(ULTIPANEL) - , menu_history[menu_history_depth].encoder_position - #endif - ); + void lcd_ignore_click(bool b) { + ignore_click = b; + wait_for_unclick = false; } - else - lcd_return_to_status(); -} + +#endif // ULTIPANEL /** * @@ -364,8 +368,11 @@ static void lcd_goto_previous_menu(bool feedback=false) { */ static void lcd_status_screen() { - ENCODER_DIRECTION_NORMAL(); - encoderRateMultiplierEnabled = false; + + #if ENABLED(ULTIPANEL) + ENCODER_DIRECTION_NORMAL(); + encoderRateMultiplierEnabled = false; + #endif #if ENABLED(LCD_PROGRESS_BAR) millis_t ms = millis(); @@ -423,7 +430,7 @@ static void lcd_status_screen() { if (current_click) { lcd_goto_menu(lcd_main_menu, true); lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if ENABLED(LCD_PROGRESS_BAR) + #if ENABLED(LCD_PROGRESS_BAR) && ENABLED(ULTIPANEL) currentMenu == lcd_status_screen #endif ); @@ -462,1561 +469,1561 @@ static void lcd_status_screen() { #if ENABLED(ULTIPANEL) -inline void line_to_current(AxisEnum axis) { - #if ENABLED(DELTA) - calculate_delta(current_position); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); - #else - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); - #endif -} - -#if ENABLED(SDSUPPORT) - - static void lcd_sdcard_pause() { - card.pauseSDPrint(); - print_job_timer.pause(); + inline void line_to_current(AxisEnum axis) { + #if ENABLED(DELTA) + calculate_delta(current_position); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); + #else // !DELTA + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); + #endif // !DELTA } - static void lcd_sdcard_resume() { - card.startFileprint(); - print_job_timer.start(); - } + #if ENABLED(SDSUPPORT) - static void lcd_sdcard_stop() { - stepper.quick_stop(); - #if DISABLED(DELTA) && DISABLED(SCARA) - set_current_position_from_planner(); - #endif - clear_command_queue(); - card.sdprinting = false; - card.closefile(); - print_job_timer.stop(); - thermalManager.autotempShutdown(); - cancel_heatup = true; - lcd_setstatus(MSG_PRINT_ABORTED, true); - } + static void lcd_sdcard_pause() { + card.pauseSDPrint(); + print_job_timer.pause(); + } -#endif //SDSUPPORT + static void lcd_sdcard_resume() { + card.startFileprint(); + print_job_timer.start(); + } -/** - * - * "Main" menu - * - */ + static void lcd_sdcard_stop() { + stepper.quick_stop(); + #if DISABLED(DELTA) && DISABLED(SCARA) + set_current_position_from_planner(); + #endif // !DELTA && !SCARA + clear_command_queue(); + card.sdprinting = false; + card.closefile(); + print_job_timer.stop(); + thermalManager.autotempShutdown(); + cancel_heatup = true; + lcd_setstatus(MSG_PRINT_ABORTED, true); + } -static void lcd_main_menu() { - START_MENU(); - MENU_ITEM(back, MSG_WATCH); - if (planner.movesplanned() || IS_SD_PRINTING) { - MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); - } - else { - MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); - #if ENABLED(DELTA_CALIBRATION_MENU) - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); - #endif - } - MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); + #endif //SDSUPPORT - #if ENABLED(SDSUPPORT) - if (card.cardOK) { - if (card.isFileOpen()) { - if (card.sdprinting) - MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); - else - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); + /** + * + * "Main" menu + * + */ + + static void lcd_main_menu() { + START_MENU(); + MENU_ITEM(back, MSG_WATCH); + if (planner.movesplanned() || IS_SD_PRINTING) { + MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); + } + else { + MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); + #if ENABLED(DELTA_CALIBRATION_MENU) + MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); + #endif + } + MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); + + #if ENABLED(SDSUPPORT) + if (card.cardOK) { + if (card.isFileOpen()) { + if (card.sdprinting) + MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); + else + MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); + MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); + } + else { + MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu); + #if !PIN_EXISTS(SD_DETECT) + MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user + #endif + } } else { - MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu); + MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu); #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user + MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface #endif } - } - else { - MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu); - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface - #endif - } - #endif //SDSUPPORT - - END_MENU(); -} - -/** - * - * "Tune" submenu items - * - */ - -/** - * Set the home offset based on the current_position - */ -void lcd_set_home_offsets() { - // M428 Command - enqueue_and_echo_commands_P(PSTR("M428")); - lcd_return_to_status(); -} - -#if ENABLED(BABYSTEPPING) + #endif //SDSUPPORT - int babysteps_done = 0; - - static void _lcd_babystep(const AxisEnum axis, const char* msg) { - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - int distance = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR; - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - thermalManager.babystep_axis(axis, distance); - babysteps_done += distance; - } - if (lcdDrawUpdate) lcd_implementation_drawedit(msg, itostr3sign(babysteps_done)); - if (LCD_CLICKED) lcd_goto_previous_menu(true); + END_MENU(); } - #if ENABLED(BABYSTEP_XY) - static void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); } - static void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); } - static void lcd_babystep_x() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_x); } - static void lcd_babystep_y() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_y); } - #endif - static void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); } - static void lcd_babystep_z() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_z); } - -#endif //BABYSTEPPING + /** + * + * "Tune" submenu items + * + */ -/** - * Watch temperature callbacks - */ -#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 - #if TEMP_SENSOR_0 != 0 - void watch_temp_callback_E0() { thermalManager.start_watching_heater(0); } - #endif - #if HOTENDS > 1 && TEMP_SENSOR_1 != 0 - void watch_temp_callback_E1() { thermalManager.start_watching_heater(1); } - #endif // HOTENDS > 1 - #if HOTENDS > 2 && TEMP_SENSOR_2 != 0 - void watch_temp_callback_E2() { thermalManager.start_watching_heater(2); } - #endif // HOTENDS > 2 - #if HOTENDS > 3 && TEMP_SENSOR_3 != 0 - void watch_temp_callback_E3() { thermalManager.start_watching_heater(3); } - #endif // HOTENDS > 3 -#else - #if TEMP_SENSOR_0 != 0 - void watch_temp_callback_E0() {} - #endif - #if HOTENDS > 1 && TEMP_SENSOR_1 != 0 - void watch_temp_callback_E1() {} - #endif // HOTENDS > 1 - #if HOTENDS > 2 && TEMP_SENSOR_2 != 0 - void watch_temp_callback_E2() {} - #endif // HOTENDS > 2 - #if HOTENDS > 3 && TEMP_SENSOR_3 != 0 - void watch_temp_callback_E3() {} - #endif // HOTENDS > 3 -#endif + /** + * Set the home offset based on the current_position + */ + void lcd_set_home_offsets() { + // M428 Command + enqueue_and_echo_commands_P(PSTR("M428")); + lcd_return_to_status(); + } -#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0 - #if TEMP_SENSOR_BED != 0 - void watch_temp_callback_bed() { thermalManager.start_watching_bed(); } - #endif -#else - #if TEMP_SENSOR_BED != 0 - void watch_temp_callback_bed() {} - #endif -#endif + #if ENABLED(BABYSTEPPING) -/** - * - * "Tune" submenu - * - */ -static void lcd_tune_menu() { - START_MENU(); + int babysteps_done = 0; - // - // ^ Main - // - MENU_ITEM(back, MSG_MAIN); + static void _lcd_babystep(const AxisEnum axis, const char* msg) { + ENCODER_DIRECTION_NORMAL(); + if (encoderPosition) { + int distance = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR; + encoderPosition = 0; + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + thermalManager.babystep_axis(axis, distance); + babysteps_done += distance; + } + if (lcdDrawUpdate) lcd_implementation_drawedit(msg, itostr3sign(babysteps_done)); + if (LCD_CLICKED) lcd_goto_previous_menu(true); + } - // - // Speed: - // - MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999); + #if ENABLED(BABYSTEP_XY) + static void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); } + static void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); } + static void lcd_babystep_x() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_x); } + static void lcd_babystep_y() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_y); } + #endif + static void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); } + static void lcd_babystep_z() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_z); } - // Manual bed leveling, Bed Z: - #if ENABLED(MANUAL_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif + #endif //BABYSTEPPING - // - // Nozzle: - // Nozzle [1-4]: - // - #if HOTENDS == 1 + /** + * Watch temperature callbacks + */ + #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 #if TEMP_SENSOR_0 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + void watch_temp_callback_E0() { thermalManager.start_watching_heater(0); } #endif - #else //HOTENDS > 1 + #if HOTENDS > 1 && TEMP_SENSOR_1 != 0 + void watch_temp_callback_E1() { thermalManager.start_watching_heater(1); } + #endif // HOTENDS > 1 + #if HOTENDS > 2 && TEMP_SENSOR_2 != 0 + void watch_temp_callback_E2() { thermalManager.start_watching_heater(2); } + #endif // HOTENDS > 2 + #if HOTENDS > 3 && TEMP_SENSOR_3 != 0 + void watch_temp_callback_E3() { thermalManager.start_watching_heater(3); } + #endif // HOTENDS > 3 + #else #if TEMP_SENSOR_0 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #endif - #if TEMP_SENSOR_1 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); + void watch_temp_callback_E0() {} #endif - #if HOTENDS > 2 - #if TEMP_SENSOR_2 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #endif - #if HOTENDS > 3 - #if TEMP_SENSOR_3 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #endif - #endif // HOTENDS > 3 + #if HOTENDS > 1 && TEMP_SENSOR_1 != 0 + void watch_temp_callback_E1() {} + #endif // HOTENDS > 1 + #if HOTENDS > 2 && TEMP_SENSOR_2 != 0 + void watch_temp_callback_E2() {} #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - // - // Bed: - // - #if TEMP_SENSOR_BED != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); + #if HOTENDS > 3 && TEMP_SENSOR_3 != 0 + void watch_temp_callback_E3() {} + #endif // HOTENDS > 3 #endif - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if HAS_FAN0 - #if FAN_COUNT > 1 - #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED " 1" - #else - #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED - #endif - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_1ST_FAN_SPEED, &fanSpeeds[0], 0, 255); - #endif - #if HAS_FAN1 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255); + #if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0 + #if TEMP_SENSOR_BED != 0 + void watch_temp_callback_bed() { thermalManager.start_watching_bed(); } #endif - #if HAS_FAN2 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255); + #else + #if TEMP_SENSOR_BED != 0 + void watch_temp_callback_bed() {} #endif - #endif // FAN_COUNT > 0 - - // - // Flow: - // Flow 1: - // Flow 2: - // Flow 3: - // Flow 4: - // - #if EXTRUDERS == 1 - MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[0], 10, 999); - #else // EXTRUDERS > 1 - MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[active_extruder], 10, 999); - MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N1, &extruder_multiplier[0], 10, 999); - MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N2, &extruder_multiplier[1], 10, 999); - #if EXTRUDERS > 2 - MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N3, &extruder_multiplier[2], 10, 999); - #if EXTRUDERS > 3 - MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N4, &extruder_multiplier[3], 10, 999); - #endif //EXTRUDERS > 3 - #endif //EXTRUDERS > 2 - #endif //EXTRUDERS > 1 - - // - // Babystep X: - // Babystep Y: - // Babystep Z: - // - #if ENABLED(BABYSTEPPING) - #if ENABLED(BABYSTEP_XY) - MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); - MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y); - #endif //BABYSTEP_XY - MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z); #endif - // - // Change filament - // - #if ENABLED(FILAMENTCHANGEENABLE) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600")); - #endif - - END_MENU(); -} + /** + * + * "Tune" submenu + * + */ + static void lcd_tune_menu() { + START_MENU(); -/** - * - * "Prepare" submenu items - * - */ -void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) { - if (temph > 0) thermalManager.setTargetHotend(temph, endnum); - #if TEMP_SENSOR_BED != 0 - thermalManager.setTargetBed(tempb); - #else - UNUSED(tempb); - #endif - #if FAN_COUNT > 0 - #if FAN_COUNT > 1 - fanSpeeds[active_extruder < FAN_COUNT ? active_extruder : 0] = fan; - #else - fanSpeeds[0] = fan; - #endif - #else - UNUSED(fan); - #endif - lcd_return_to_status(); -} + // + // ^ Main + // + MENU_ITEM(back, MSG_MAIN); -#if TEMP_SENSOR_0 != 0 - void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } -#endif + // + // Speed: + // + MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999); -#if HOTENDS > 1 - void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } - #if HOTENDS > 2 - void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } - #if HOTENDS > 3 - void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + // Manual bed leveling, Bed Z: + #if ENABLED(MANUAL_BED_LEVELING) + MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); #endif - #endif - void lcd_preheat_pla0123() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(plaPreheatHotendTemp, 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(plaPreheatHotendTemp, 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(plaPreheatHotendTemp, 3); - #endif + // + // Nozzle: + // Nozzle [1-4]: + // + #if HOTENDS == 1 + #if TEMP_SENSOR_0 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + #endif + #else //HOTENDS > 1 + #if TEMP_SENSOR_0 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + #endif + #if TEMP_SENSOR_1 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); #endif - #endif - lcd_preheat_pla0(); - } - void lcd_preheat_abs0123() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(absPreheatHotendTemp, 1); #if HOTENDS > 2 - thermalManager.setTargetHotend(absPreheatHotendTemp, 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(absPreheatHotendTemp, 3); + #if TEMP_SENSOR_2 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); #endif - #endif - #endif - lcd_preheat_abs0(); - } - -#endif // HOTENDS > 1 - -#if TEMP_SENSOR_BED != 0 - void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, absPreheatHPBTemp, absPreheatFanSpeed); } -#endif + #if HOTENDS > 3 + #if TEMP_SENSOR_3 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); + #endif + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 -#if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0) + // + // Bed: + // + #if TEMP_SENSOR_BED != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); + #endif - static void lcd_preheat_pla_menu() { - START_MENU(); - MENU_ITEM(back, MSG_PREPARE); - #if HOTENDS == 1 - MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0); - #else - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0); - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1); - #if HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2); - #if HOTENDS > 3 - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3); + // + // Fan Speed: + // + #if FAN_COUNT > 0 + #if HAS_FAN0 + #if FAN_COUNT > 1 + #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED " 1" + #else + #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED #endif + MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_1ST_FAN_SPEED, &fanSpeeds[0], 0, 255); + #endif + #if HAS_FAN1 + MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255); #endif - MENU_ITEM(function, MSG_PREHEAT_PLA_ALL, lcd_preheat_pla0123); + #if HAS_FAN2 + MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255); + #endif + #endif // FAN_COUNT > 0 + + // + // Flow: + // Flow 1: + // Flow 2: + // Flow 3: + // Flow 4: + // + #if EXTRUDERS == 1 + MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[0], 10, 999); + #else // EXTRUDERS > 1 + MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiplier[active_extruder], 10, 999); + MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N1, &extruder_multiplier[0], 10, 999); + MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N2, &extruder_multiplier[1], 10, 999); + #if EXTRUDERS > 2 + MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N3, &extruder_multiplier[2], 10, 999); + #if EXTRUDERS > 3 + MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N4, &extruder_multiplier[3], 10, 999); + #endif //EXTRUDERS > 3 + #endif //EXTRUDERS > 2 + #endif //EXTRUDERS > 1 + + // + // Babystep X: + // Babystep Y: + // Babystep Z: + // + #if ENABLED(BABYSTEPPING) + #if ENABLED(BABYSTEP_XY) + MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); + MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y); + #endif //BABYSTEP_XY + MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z); #endif - #if TEMP_SENSOR_BED != 0 - MENU_ITEM(function, MSG_PREHEAT_PLA_BEDONLY, lcd_preheat_pla_bedonly); + + // + // Change filament + // + #if ENABLED(FILAMENTCHANGEENABLE) + MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600")); #endif + END_MENU(); } - static void lcd_preheat_abs_menu() { - START_MENU(); - MENU_ITEM(back, MSG_PREPARE); - #if HOTENDS == 1 - MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0); + /** + * + * "Prepare" submenu items + * + */ + void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) { + if (temph > 0) thermalManager.setTargetHotend(temph, endnum); + #if TEMP_SENSOR_BED != 0 + thermalManager.setTargetBed(tempb); #else - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0); - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1); - #if HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2); - #if HOTENDS > 3 - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3); - #endif - #endif - MENU_ITEM(function, MSG_PREHEAT_ABS_ALL, lcd_preheat_abs0123); + UNUSED(tempb); #endif - #if TEMP_SENSOR_BED != 0 - MENU_ITEM(function, MSG_PREHEAT_ABS_BEDONLY, lcd_preheat_abs_bedonly); + #if FAN_COUNT > 0 + #if FAN_COUNT > 1 + fanSpeeds[active_extruder < FAN_COUNT ? active_extruder : 0] = fan; + #else + fanSpeeds[0] = fan; + #endif + #else + UNUSED(fan); #endif - END_MENU(); + lcd_return_to_status(); } -#endif // TEMP_SENSOR_0 && (TEMP_SENSOR_1 || TEMP_SENSOR_2 || TEMP_SENSOR_3 || TEMP_SENSOR_BED) - -void lcd_cooldown() { - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; + #if TEMP_SENSOR_0 != 0 + void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } #endif - thermalManager.disable_all_heaters(); - lcd_return_to_status(); -} -#if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) + #if HOTENDS > 1 + void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + #if HOTENDS > 2 + void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + #if HOTENDS > 3 + void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + #endif + #endif - static void lcd_autostart_sd() { - card.autostart_index = 0; - card.setroot(); - card.checkautostart(true); - } + void lcd_preheat_pla0123() { + #if HOTENDS > 1 + thermalManager.setTargetHotend(plaPreheatHotendTemp, 1); + #if HOTENDS > 2 + thermalManager.setTargetHotend(plaPreheatHotendTemp, 2); + #if HOTENDS > 3 + thermalManager.setTargetHotend(plaPreheatHotendTemp, 3); + #endif + #endif + #endif + lcd_preheat_pla0(); + } + void lcd_preheat_abs0123() { + #if HOTENDS > 1 + thermalManager.setTargetHotend(absPreheatHotendTemp, 1); + #if HOTENDS > 2 + thermalManager.setTargetHotend(absPreheatHotendTemp, 2); + #if HOTENDS > 3 + thermalManager.setTargetHotend(absPreheatHotendTemp, 3); + #endif + #endif + #endif + lcd_preheat_abs0(); + } -#endif + #endif // HOTENDS > 1 -#if ENABLED(MANUAL_BED_LEVELING) + #if TEMP_SENSOR_BED != 0 + void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); } + void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, absPreheatHPBTemp, absPreheatFanSpeed); } + #endif - /** - * - * "Prepare" > "Bed Leveling" handlers - * - */ + #if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0) - static uint8_t _lcd_level_bed_position; + static void lcd_preheat_pla_menu() { + START_MENU(); + MENU_ITEM(back, MSG_PREPARE); + #if HOTENDS == 1 + MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0); + #else + MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0); + MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1); + #if HOTENDS > 2 + MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2); + #if HOTENDS > 3 + MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3); + #endif + #endif + MENU_ITEM(function, MSG_PREHEAT_PLA_ALL, lcd_preheat_pla0123); + #endif + #if TEMP_SENSOR_BED != 0 + MENU_ITEM(function, MSG_PREHEAT_PLA_BEDONLY, lcd_preheat_pla_bedonly); + #endif + END_MENU(); + } - // Utility to go to the next mesh point - // A raise is added between points if MIN_Z_HEIGHT_FOR_HOMING is in use - // Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z - // Z position will be restored with the final action, a G28 - inline void _mbl_goto_xy(float x, float y) { - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - #if MIN_Z_HEIGHT_FOR_HOMING > 0 - + MIN_Z_HEIGHT_FOR_HOMING + static void lcd_preheat_abs_menu() { + START_MENU(); + MENU_ITEM(back, MSG_PREPARE); + #if HOTENDS == 1 + MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0); + #else + MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0); + MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1); + #if HOTENDS > 2 + MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2); + #if HOTENDS > 3 + MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3); + #endif + #endif + MENU_ITEM(function, MSG_PREHEAT_ABS_ALL, lcd_preheat_abs0123); #endif - ; - line_to_current(Z_AXIS); - current_position[X_AXIS] = x + home_offset[X_AXIS]; - current_position[Y_AXIS] = y + home_offset[Y_AXIS]; - line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS); - #if MIN_Z_HEIGHT_FOR_HOMING > 0 - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - line_to_current(Z_AXIS); + #if TEMP_SENSOR_BED != 0 + MENU_ITEM(function, MSG_PREHEAT_ABS_BEDONLY, lcd_preheat_abs_bedonly); + #endif + END_MENU(); + } + + #endif // TEMP_SENSOR_0 && (TEMP_SENSOR_1 || TEMP_SENSOR_2 || TEMP_SENSOR_3 || TEMP_SENSOR_BED) + + void lcd_cooldown() { + #if FAN_COUNT > 0 + for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; #endif - stepper.synchronize(); + thermalManager.disable_all_heaters(); + lcd_return_to_status(); } - static void _lcd_level_goto_next_point(); + #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - static void _lcd_level_bed_done() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE)); - lcdDrawUpdate = - #if ENABLED(DOGLCD) - LCDVIEW_CALL_REDRAW_NEXT - #else - LCDVIEW_CALL_NO_REDRAW - #endif - ; - } + static void lcd_autostart_sd() { + card.autostart_index = 0; + card.setroot(); + card.checkautostart(true); + } - /** - * Step 7: Get the Z coordinate, then goto next point or exit - */ - static void _lcd_level_bed_get_z() { - ENCODER_DIRECTION_NORMAL(); + #endif - // Encoder wheel adjusts the Z position - if (encoderPosition) { - refresh_cmd_timeout(); - current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP); - NOLESS(current_position[Z_AXIS], 0); - NOMORE(current_position[Z_AXIS], MESH_HOME_SEARCH_Z * 2); + #if ENABLED(MANUAL_BED_LEVELING) + + /** + * + * "Prepare" > "Bed Leveling" handlers + * + */ + + static uint8_t _lcd_level_bed_position; + + // Utility to go to the next mesh point + // A raise is added between points if MIN_Z_HEIGHT_FOR_HOMING is in use + // Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z + // Z position will be restored with the final action, a G28 + inline void _mbl_goto_xy(float x, float y) { + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + #if MIN_Z_HEIGHT_FOR_HOMING > 0 + + MIN_Z_HEIGHT_FOR_HOMING + #endif + ; line_to_current(Z_AXIS); + current_position[X_AXIS] = x + home_offset[X_AXIS]; + current_position[Y_AXIS] = y + home_offset[Y_AXIS]; + line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS); + #if MIN_Z_HEIGHT_FOR_HOMING > 0 + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + line_to_current(Z_AXIS); + #endif + stepper.synchronize(); + } + + static void _lcd_level_goto_next_point(); + + static void _lcd_level_bed_done() { + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE)); lcdDrawUpdate = #if ENABLED(DOGLCD) LCDVIEW_CALL_REDRAW_NEXT #else - LCDVIEW_REDRAW_NOW + LCDVIEW_CALL_NO_REDRAW #endif ; - encoderPosition = 0; } - static bool debounce_click = false; - if (LCD_CLICKED) { - if (!debounce_click) { - debounce_click = true; // ignore multiple "clicks" in a row - mbl.set_zigzag_z(_lcd_level_bed_position++, current_position[Z_AXIS]); - if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) { - lcd_goto_menu(_lcd_level_bed_done, true); - - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - #if MIN_Z_HEIGHT_FOR_HOMING > 0 - + MIN_Z_HEIGHT_FOR_HOMING - #endif - ; - line_to_current(Z_AXIS); - stepper.synchronize(); - - mbl.set_has_mesh(true); - enqueue_and_echo_commands_P(PSTR("G28")); - lcd_return_to_status(); - //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE); - #if HAS_BUZZER - buzzer.tone(200, 659); - buzzer.tone(200, 698); + /** + * Step 7: Get the Z coordinate, then goto next point or exit + */ + static void _lcd_level_bed_get_z() { + ENCODER_DIRECTION_NORMAL(); + + // Encoder wheel adjusts the Z position + if (encoderPosition) { + refresh_cmd_timeout(); + current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP); + NOLESS(current_position[Z_AXIS], 0); + NOMORE(current_position[Z_AXIS], MESH_HOME_SEARCH_Z * 2); + line_to_current(Z_AXIS); + lcdDrawUpdate = + #if ENABLED(DOGLCD) + LCDVIEW_CALL_REDRAW_NEXT + #else + LCDVIEW_REDRAW_NOW #endif - } - else { - lcd_goto_menu(_lcd_level_goto_next_point, true); + ; + encoderPosition = 0; + } + + static bool debounce_click = false; + if (LCD_CLICKED) { + if (!debounce_click) { + debounce_click = true; // ignore multiple "clicks" in a row + mbl.set_zigzag_z(_lcd_level_bed_position++, current_position[Z_AXIS]); + if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) { + lcd_goto_menu(_lcd_level_bed_done, true); + + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + #if MIN_Z_HEIGHT_FOR_HOMING > 0 + + MIN_Z_HEIGHT_FOR_HOMING + #endif + ; + line_to_current(Z_AXIS); + stepper.synchronize(); + + mbl.set_has_mesh(true); + enqueue_and_echo_commands_P(PSTR("G28")); + lcd_return_to_status(); + //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE); + #if HAS_BUZZER + buzzer.tone(200, 659); + buzzer.tone(200, 698); + #endif + } + else { + lcd_goto_menu(_lcd_level_goto_next_point, true); + } } } - } - else { - debounce_click = false; - } + else { + debounce_click = false; + } + + // Update on first display, then only on updates to Z position + // Show message above on clicks instead + if (lcdDrawUpdate) { + float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z; + lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+')); + } - // Update on first display, then only on updates to Z position - // Show message above on clicks instead - if (lcdDrawUpdate) { - float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z; - lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+')); } - } + /** + * Step 6: Display "Next point: 1 / 9" while waiting for move to finish + */ + static void _lcd_level_bed_moving() { + if (lcdDrawUpdate) { + char msg[10]; + sprintf_P(msg, PSTR("%i / %u"), (int)(_lcd_level_bed_position + 1), (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)); + lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg); + } - /** - * Step 6: Display "Next point: 1 / 9" while waiting for move to finish - */ - static void _lcd_level_bed_moving() { - if (lcdDrawUpdate) { - char msg[10]; - sprintf_P(msg, PSTR("%i / %u"), (int)(_lcd_level_bed_position + 1), (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)); - lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg); + lcdDrawUpdate = + #if ENABLED(DOGLCD) + LCDVIEW_CALL_REDRAW_NEXT + #else + LCDVIEW_CALL_NO_REDRAW + #endif + ; } - lcdDrawUpdate = - #if ENABLED(DOGLCD) - LCDVIEW_CALL_REDRAW_NEXT - #else - LCDVIEW_CALL_NO_REDRAW - #endif - ; - } + /** + * Step 5: Initiate a move to the next point + */ + static void _lcd_level_goto_next_point() { + // Set the menu to display ahead of blocking call + lcd_goto_menu(_lcd_level_bed_moving); - /** - * Step 5: Initiate a move to the next point - */ - static void _lcd_level_goto_next_point() { - // Set the menu to display ahead of blocking call - lcd_goto_menu(_lcd_level_bed_moving); + // _mbl_goto_xy runs the menu loop until the move is done + int8_t px, py; + mbl.zigzag(_lcd_level_bed_position, px, py); + _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py)); - // _mbl_goto_xy runs the menu loop until the move is done - int8_t px, py; - mbl.zigzag(_lcd_level_bed_position, px, py); - _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py)); + // After the blocking function returns, change menus + lcd_goto_menu(_lcd_level_bed_get_z); + } - // After the blocking function returns, change menus - lcd_goto_menu(_lcd_level_bed_get_z); - } + /** + * Step 4: Display "Click to Begin", wait for click + * Move to the first probe position + */ + static void _lcd_level_bed_homing_done() { + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING)); + if (LCD_CLICKED) { + _lcd_level_bed_position = 0; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + lcd_goto_menu(_lcd_level_goto_next_point, true); + } + } - /** - * Step 4: Display "Click to Begin", wait for click - * Move to the first probe position - */ - static void _lcd_level_bed_homing_done() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING)); - if (LCD_CLICKED) { - _lcd_level_bed_position = 0; - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - lcd_goto_menu(_lcd_level_goto_next_point, true); + /** + * Step 3: Display "Homing XYZ" - Wait for homing to finish + */ + static void _lcd_level_bed_homing() { + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL); + lcdDrawUpdate = + #if ENABLED(DOGLCD) + LCDVIEW_CALL_REDRAW_NEXT + #else + LCDVIEW_CALL_NO_REDRAW + #endif + ; + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) + lcd_goto_menu(_lcd_level_bed_homing_done); } - } - /** - * Step 3: Display "Homing XYZ" - Wait for homing to finish - */ - static void _lcd_level_bed_homing() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL); - lcdDrawUpdate = - #if ENABLED(DOGLCD) - LCDVIEW_CALL_REDRAW_NEXT - #else - LCDVIEW_CALL_NO_REDRAW - #endif - ; - if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) - lcd_goto_menu(_lcd_level_bed_homing_done); - } + /** + * Step 2: Continue Bed Leveling... + */ + static void _lcd_level_bed_continue() { + defer_return_to_status = true; + axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false; + mbl.reset(); + enqueue_and_echo_commands_P(PSTR("G28")); + lcd_goto_menu(_lcd_level_bed_homing); + } - /** - * Step 2: Continue Bed Leveling... - */ - static void _lcd_level_bed_continue() { - defer_return_to_status = true; - axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false; - mbl.reset(); - enqueue_and_echo_commands_P(PSTR("G28")); - lcd_goto_menu(_lcd_level_bed_homing); - } + /** + * Step 1: MBL entry-point: "Cancel" or "Level Bed" + */ + static void lcd_level_bed() { + START_MENU(); + MENU_ITEM(back, MSG_LEVEL_BED_CANCEL); + MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); + END_MENU(); + } + + #endif // MANUAL_BED_LEVELING /** - * Step 1: MBL entry-point: "Cancel" or "Level Bed" + * + * "Prepare" submenu + * */ - static void lcd_level_bed() { + + static void lcd_prepare_menu() { START_MENU(); - MENU_ITEM(back, MSG_LEVEL_BED_CANCEL); - MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); - END_MENU(); - } -#endif // MANUAL_BED_LEVELING + // + // ^ Main + // + MENU_ITEM(back, MSG_MAIN); -/** - * - * "Prepare" submenu - * - */ + // + // Auto Home + // + MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) + MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X")); + MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y")); + MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); + #endif -static void lcd_prepare_menu() { - START_MENU(); - - // - // ^ Main - // - MENU_ITEM(back, MSG_MAIN); - - // - // Auto Home - // - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); - #endif + // + // Set Home Offsets + // + MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets); + //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0")); + + // + // Level Bed + // + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + MENU_ITEM(gcode, MSG_LEVEL_BED, + axis_homed[X_AXIS] && axis_homed[Y_AXIS] ? PSTR("G29") : PSTR("G28\nG29") + ); + #elif ENABLED(MANUAL_BED_LEVELING) + MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed); + #endif - // - // Set Home Offsets - // - MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets); - //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0")); - - // - // Level Bed - // - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - MENU_ITEM(gcode, MSG_LEVEL_BED, - axis_homed[X_AXIS] && axis_homed[Y_AXIS] ? PSTR("G29") : PSTR("G28\nG29") - ); - #elif ENABLED(MANUAL_BED_LEVELING) - MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed); - #endif + // + // Move Axis + // + MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); - // - // Move Axis - // - MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); + // + // Disable Steppers + // + MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); - // - // Disable Steppers - // - MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); + // + // Preheat PLA + // Preheat ABS + // + #if TEMP_SENSOR_0 != 0 + #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0 + MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu); + MENU_ITEM(submenu, MSG_PREHEAT_ABS, lcd_preheat_abs_menu); + #else + MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0); + MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0); + #endif + #endif - // - // Preheat PLA - // Preheat ABS - // - #if TEMP_SENSOR_0 != 0 - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0 - MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu); - MENU_ITEM(submenu, MSG_PREHEAT_ABS, lcd_preheat_abs_menu); - #else - MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0); - MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0); + // + // Cooldown + // + MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); + + // + // Switch power on/off + // + #if HAS_POWER_SWITCH + if (powersupply) + MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); + else + MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); #endif - #endif - // - // Cooldown - // - MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); + // + // Autostart + // + #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) + MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); + #endif - // - // Switch power on/off - // - #if HAS_POWER_SWITCH - if (powersupply) - MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); - else - MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); - #endif + END_MENU(); + } - // - // Autostart - // - #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); - #endif + #if ENABLED(DELTA_CALIBRATION_MENU) - END_MENU(); -} + static void lcd_delta_calibrate_menu() { + START_MENU(); + MENU_ITEM(back, MSG_MAIN); + MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_X, PSTR("G0 F8000 X-77.94 Y-45 Z0")); + MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Y, PSTR("G0 F8000 X77.94 Y-45 Z0")); + MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Z, PSTR("G0 F8000 X0 Y90 Z0")); + MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G0 F8000 X0 Y0 Z0")); + END_MENU(); + } -#if ENABLED(DELTA_CALIBRATION_MENU) + #endif // DELTA_CALIBRATION_MENU - static void lcd_delta_calibrate_menu() { - START_MENU(); - MENU_ITEM(back, MSG_MAIN); - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_X, PSTR("G0 F8000 X-77.94 Y-45 Z0")); - MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Y, PSTR("G0 F8000 X77.94 Y-45 Z0")); - MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Z, PSTR("G0 F8000 X0 Y90 Z0")); - MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G0 F8000 X0 Y0 Z0")); - END_MENU(); + /** + * If the most recent manual move hasn't been fed to the planner yet, + * and the planner can accept one, send immediately + */ + inline void manage_manual_move() { + if (manual_move_axis != (int8_t)NO_AXIS && millis() >= manual_move_start_time && !planner.is_full()) { + #if ENABLED(DELTA) + calculate_delta(current_position); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); + #else + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); + #endif + manual_move_axis = (int8_t)NO_AXIS; + } } -#endif // DELTA_CALIBRATION_MENU - -/** - * If the most recent manual move hasn't been fed to the planner yet, - * and the planner can accept one, send immediately - */ -inline void manage_manual_move() { - if (manual_move_axis != (int8_t)NO_AXIS && millis() >= manual_move_start_time && !planner.is_full()) { - #if ENABLED(DELTA) - calculate_delta(current_position); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); - #else - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); - #endif - manual_move_axis = (int8_t)NO_AXIS; + /** + * Set a flag that lcd_update() should start a move + * to "current_position" after a short delay. + */ + inline void manual_move_to_current(AxisEnum axis) { + manual_move_start_time = millis() + 500UL; // 1/2 second delay + manual_move_axis = (int8_t)axis; } -} -/** - * Set a flag that lcd_update() should start a move - * to "current_position" after a short delay. - */ -inline void manual_move_to_current(AxisEnum axis) { - manual_move_start_time = millis() + 500UL; // 1/2 second delay - manual_move_axis = (int8_t)axis; -} + /** + * + * "Prepare" > "Move Axis" submenu + * + */ -/** - * - * "Prepare" > "Move Axis" submenu - * - */ + float move_menu_scale; -float move_menu_scale; - -static void _lcd_move(const char* name, AxisEnum axis, float min, float max) { - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - refresh_cmd_timeout(); - current_position[axis] += float((int32_t)encoderPosition) * move_menu_scale; - if (min_software_endstops) NOLESS(current_position[axis], min); - if (max_software_endstops) NOMORE(current_position[axis], max); - encoderPosition = 0; - manual_move_to_current(axis); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + static void _lcd_move(const char* name, AxisEnum axis, float min, float max) { + ENCODER_DIRECTION_NORMAL(); + if (encoderPosition) { + refresh_cmd_timeout(); + current_position[axis] += float((int32_t)encoderPosition) * move_menu_scale; + if (min_software_endstops) NOLESS(current_position[axis], min); + if (max_software_endstops) NOMORE(current_position[axis], max); + encoderPosition = 0; + manual_move_to_current(axis); + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + } + if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr41sign(current_position[axis])); + if (LCD_CLICKED) lcd_goto_previous_menu(true); } - if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr41sign(current_position[axis])); - if (LCD_CLICKED) lcd_goto_previous_menu(true); -} -#if ENABLED(DELTA) - static float delta_clip_radius_2 = (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS); - static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); } - static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(sw_endstop_min[X_AXIS], -clip), min(sw_endstop_max[X_AXIS], clip)); } - static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, max(sw_endstop_min[Y_AXIS], -clip), min(sw_endstop_max[Y_AXIS], clip)); } -#else - static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, sw_endstop_min[X_AXIS], sw_endstop_max[X_AXIS]); } - static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, sw_endstop_min[Y_AXIS], sw_endstop_max[Y_AXIS]); } -#endif -static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); } -static void lcd_move_e( - #if EXTRUDERS > 1 - uint8_t e - #endif -) { - ENCODER_DIRECTION_NORMAL(); - #if EXTRUDERS > 1 - unsigned short original_active_extruder = active_extruder; - active_extruder = e; + #if ENABLED(DELTA) + static float delta_clip_radius_2 = (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS); + static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); } + static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(sw_endstop_min[X_AXIS], -clip), min(sw_endstop_max[X_AXIS], clip)); } + static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, max(sw_endstop_min[Y_AXIS], -clip), min(sw_endstop_max[Y_AXIS], clip)); } + #else + static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, sw_endstop_min[X_AXIS], sw_endstop_max[X_AXIS]); } + static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, sw_endstop_min[Y_AXIS], sw_endstop_max[Y_AXIS]); } #endif - if (encoderPosition) { - current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale; - encoderPosition = 0; - manual_move_to_current(E_AXIS); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - if (lcdDrawUpdate) { - PGM_P pos_label; - #if EXTRUDERS == 1 - pos_label = PSTR(MSG_MOVE_E); - #else - switch (e) { - case 0: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; - case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; - #if EXTRUDERS > 2 - case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; - #if EXTRUDERS > 3 - case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; - #endif //EXTRUDERS > 3 - #endif //EXTRUDERS > 2 - } - #endif //EXTRUDERS > 1 - lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS])); + static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); } + static void lcd_move_e( + #if EXTRUDERS > 1 + uint8_t e + #endif + ) { + ENCODER_DIRECTION_NORMAL(); + #if EXTRUDERS > 1 + unsigned short original_active_extruder = active_extruder; + active_extruder = e; + #endif + if (encoderPosition) { + current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale; + encoderPosition = 0; + manual_move_to_current(E_AXIS); + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + } + if (lcdDrawUpdate) { + PGM_P pos_label; + #if EXTRUDERS == 1 + pos_label = PSTR(MSG_MOVE_E); + #else + switch (e) { + case 0: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; + case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; + #if EXTRUDERS > 2 + case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; + #if EXTRUDERS > 3 + case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; + #endif //EXTRUDERS > 3 + #endif //EXTRUDERS > 2 + } + #endif //EXTRUDERS > 1 + lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS])); + } + if (LCD_CLICKED) lcd_goto_previous_menu(true); + #if EXTRUDERS > 1 + active_extruder = original_active_extruder; + #endif } - if (LCD_CLICKED) lcd_goto_previous_menu(true); - #if EXTRUDERS > 1 - active_extruder = original_active_extruder; - #endif -} -#if EXTRUDERS > 1 - static void lcd_move_e0() { lcd_move_e(0); } - static void lcd_move_e1() { lcd_move_e(1); } - #if EXTRUDERS > 2 - static void lcd_move_e2() { lcd_move_e(2); } - #if EXTRUDERS > 3 - static void lcd_move_e3() { lcd_move_e(3); } + #if EXTRUDERS > 1 + static void lcd_move_e0() { lcd_move_e(0); } + static void lcd_move_e1() { lcd_move_e(1); } + #if EXTRUDERS > 2 + static void lcd_move_e2() { lcd_move_e(2); } + #if EXTRUDERS > 3 + static void lcd_move_e3() { lcd_move_e(3); } + #endif #endif - #endif -#endif // EXTRUDERS > 1 + #endif // EXTRUDERS > 1 -/** - * - * "Prepare" > "Move Xmm" > "Move XYZ" submenu - * - */ + /** + * + * "Prepare" > "Move Xmm" > "Move XYZ" submenu + * + */ -#if ENABLED(DELTA) || ENABLED(SCARA) - #define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) -#else - #define _MOVE_XYZ_ALLOWED true -#endif + #if ENABLED(DELTA) || ENABLED(SCARA) + #define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) + #else + #define _MOVE_XYZ_ALLOWED true + #endif -static void _lcd_move_menu_axis() { - START_MENU(); - MENU_ITEM(back, MSG_MOVE_AXIS); + static void _lcd_move_menu_axis() { + START_MENU(); + MENU_ITEM(back, MSG_MOVE_AXIS); - if (_MOVE_XYZ_ALLOWED) { - MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); - MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); - } - if (move_menu_scale < 10.0) { - if (_MOVE_XYZ_ALLOWED) MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z); - #if EXTRUDERS == 1 - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); - #else - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0); - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1); - #if EXTRUDERS > 2 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_e2); - #if EXTRUDERS > 3 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_e3); + if (_MOVE_XYZ_ALLOWED) { + MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); + MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); + } + if (move_menu_scale < 10.0) { + if (_MOVE_XYZ_ALLOWED) MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z); + #if EXTRUDERS == 1 + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); + #else + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0); + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1); + #if EXTRUDERS > 2 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_e2); + #if EXTRUDERS > 3 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_e3); + #endif #endif - #endif - #endif // EXTRUDERS > 1 + #endif // EXTRUDERS > 1 + } + END_MENU(); } - END_MENU(); -} - -static void lcd_move_menu_10mm() { - move_menu_scale = 10.0; - _lcd_move_menu_axis(); -} -static void lcd_move_menu_1mm() { - move_menu_scale = 1.0; - _lcd_move_menu_axis(); -} -static void lcd_move_menu_01mm() { - move_menu_scale = 0.1; - _lcd_move_menu_axis(); -} - -/** - * - * "Prepare" > "Move Axis" submenu - * - */ - -static void lcd_move_menu() { - START_MENU(); - MENU_ITEM(back, MSG_PREPARE); - - if (_MOVE_XYZ_ALLOWED) - MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); - - MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm); - MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm); - //TODO:X,Y,Z,E - END_MENU(); -} - -/** - * - * "Control" submenu - * - */ - -static void lcd_control_menu() { - START_MENU(); - MENU_ITEM(back, MSG_MAIN); - MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu); - MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); - MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu); - - #if HAS_LCD_CONTRAST - //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63); - MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); - #endif - #if ENABLED(FWRETRACT) - MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); - MENU_ITEM(function, MSG_LOAD_EPROM, Config_RetrieveSettings); - #endif - MENU_ITEM(function, MSG_RESTORE_FAILSAFE, Config_ResetDefault); - END_MENU(); -} -/** - * - * "Temperature" submenu - * - */ + static void lcd_move_menu_10mm() { + move_menu_scale = 10.0; + _lcd_move_menu_axis(); + } + static void lcd_move_menu_1mm() { + move_menu_scale = 1.0; + _lcd_move_menu_axis(); + } + static void lcd_move_menu_01mm() { + move_menu_scale = 0.1; + _lcd_move_menu_axis(); + } -#if ENABLED(PID_AUTOTUNE_MENU) + /** + * + * "Prepare" > "Move Axis" submenu + * + */ - #if ENABLED(PIDTEMP) - int autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); - const int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP); - #endif + static void lcd_move_menu() { + START_MENU(); + MENU_ITEM(back, MSG_PREPARE); - #if ENABLED(PIDTEMPBED) - int autotune_temp_bed = 70; - #endif + if (_MOVE_XYZ_ALLOWED) + MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); - static void _lcd_autotune(int e) { - char cmd[30]; - sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e, - #if HAS_PID_FOR_BOTH - e < 0 ? autotune_temp_bed : autotune_temp[e] - #elif ENABLED(PIDTEMPBED) - autotune_temp_bed - #else - autotune_temp[e] - #endif - ); - enqueue_and_echo_command(cmd); + MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm); + MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm); + //TODO:X,Y,Z,E + END_MENU(); } -#endif //PID_AUTOTUNE_MENU + /** + * + * "Control" submenu + * + */ -#if ENABLED(PIDTEMP) + static void lcd_control_menu() { + START_MENU(); + MENU_ITEM(back, MSG_MAIN); + MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu); + MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); + MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu); - // Helpers for editing PID Ki & Kd values - // grab the PID value out of the temp variable; scale it; then update the PID driver - void copy_and_scalePID_i(int e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) - UNUSED(e); + #if HAS_LCD_CONTRAST + //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63); + MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); #endif - PID_PARAM(Ki, e) = scalePID_i(raw_Ki); - thermalManager.updatePID(); - } - void copy_and_scalePID_d(int e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) - UNUSED(e); + #if ENABLED(FWRETRACT) + MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); + MENU_ITEM(function, MSG_LOAD_EPROM, Config_RetrieveSettings); #endif - PID_PARAM(Kd, e) = scalePID_d(raw_Kd); - thermalManager.updatePID(); + MENU_ITEM(function, MSG_RESTORE_FAILSAFE, Config_ResetDefault); + END_MENU(); } - #define _PIDTEMP_BASE_FUNCTIONS(eindex) \ - void copy_and_scalePID_i_E ## eindex() { copy_and_scalePID_i(eindex); } \ - void copy_and_scalePID_d_E ## eindex() { copy_and_scalePID_d(eindex); } - #if ENABLED(PID_AUTOTUNE_MENU) - #define _PIDTEMP_FUNCTIONS(eindex) \ - _PIDTEMP_BASE_FUNCTIONS(eindex); \ - void lcd_autotune_callback_E ## eindex() { _lcd_autotune(eindex); } - #else - #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex) - #endif - - _PIDTEMP_FUNCTIONS(0); - #if ENABLED(PID_PARAMS_PER_HOTEND) - #if HOTENDS > 1 - _PIDTEMP_FUNCTIONS(1); - #if HOTENDS > 2 - _PIDTEMP_FUNCTIONS(2); - #if HOTENDS > 3 - _PIDTEMP_FUNCTIONS(3); - #endif //HOTENDS > 3 - #endif //HOTENDS > 2 - #endif //HOTENDS > 1 - #endif //PID_PARAMS_PER_HOTEND + /** + * + * "Temperature" submenu + * + */ -#endif //PIDTEMP + #if ENABLED(PID_AUTOTUNE_MENU) -/** - * - * "Control" > "Temperature" submenu - * - */ -static void lcd_control_temperature_menu() { - START_MENU(); - - // - // ^ Control - // - MENU_ITEM(back, MSG_CONTROL); - - // - // Nozzle: - // Nozzle [1-4]: - // - #if HOTENDS == 1 - #if TEMP_SENSOR_0 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + #if ENABLED(PIDTEMP) + int autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); + const int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP); #endif - #else //HOTENDS > 1 - #if TEMP_SENSOR_0 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #endif - #if TEMP_SENSOR_1 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); + + #if ENABLED(PIDTEMPBED) + int autotune_temp_bed = 70; #endif - #if HOTENDS > 2 - #if TEMP_SENSOR_2 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #endif - #if HOTENDS > 3 - #if TEMP_SENSOR_3 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #endif - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - // - // Bed: - // - #if TEMP_SENSOR_BED != 0 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15); - #endif + static void _lcd_autotune(int e) { + char cmd[30]; + sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e, + #if HAS_PID_FOR_BOTH + e < 0 ? autotune_temp_bed : autotune_temp[e] + #elif ENABLED(PIDTEMPBED) + autotune_temp_bed + #else + autotune_temp[e] + #endif + ); + enqueue_and_echo_command(cmd); + } - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if HAS_FAN0 - #if FAN_COUNT > 1 - #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED " 1" - #else - #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED - #endif - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_1ST_FAN_SPEED, &fanSpeeds[0], 0, 255); - #endif - #if HAS_FAN1 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255); - #endif - #if HAS_FAN2 - MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255); - #endif - #endif // FAN_COUNT > 0 - - // - // Autotemp, Min, Max, Fact - // - #if ENABLED(AUTOTEMP) && (TEMP_SENSOR_0 != 0) - MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); - MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15); - MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, HEATER_0_MAXTEMP - 15); - MENU_ITEM_EDIT(float32, MSG_FACTOR, &planner.autotemp_factor, 0.0, 1.0); - #endif + #endif //PID_AUTOTUNE_MENU - // - // PID-P, PID-I, PID-D, PID-C, PID Autotune - // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1 - // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2 - // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3 - // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4 - // #if ENABLED(PIDTEMP) - #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \ - raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \ - raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \ - MENU_ITEM_EDIT(float52, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \ - MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \ - MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex) - - #if ENABLED(PID_ADD_EXTRUSION_RATE) - #define _PID_MENU_ITEMS(ELABEL, eindex) \ - _PID_BASE_MENU_ITEMS(ELABEL, eindex); \ - MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990) - #else - #define _PID_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex) - #endif + // Helpers for editing PID Ki & Kd values + // grab the PID value out of the temp variable; scale it; then update the PID driver + void copy_and_scalePID_i(int e) { + #if DISABLED(PID_PARAMS_PER_HOTEND) + UNUSED(e); + #endif + PID_PARAM(Ki, e) = scalePID_i(raw_Ki); + thermalManager.updatePID(); + } + void copy_and_scalePID_d(int e) { + #if DISABLED(PID_PARAMS_PER_HOTEND) + UNUSED(e); + #endif + PID_PARAM(Kd, e) = scalePID_d(raw_Kd); + thermalManager.updatePID(); + } + #define _PIDTEMP_BASE_FUNCTIONS(eindex) \ + void copy_and_scalePID_i_E ## eindex() { copy_and_scalePID_i(eindex); } \ + void copy_and_scalePID_d_E ## eindex() { copy_and_scalePID_d(eindex); } #if ENABLED(PID_AUTOTUNE_MENU) - #define PID_MENU_ITEMS(ELABEL, eindex) \ - _PID_MENU_ITEMS(ELABEL, eindex); \ - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex) + #define _PIDTEMP_FUNCTIONS(eindex) \ + _PIDTEMP_BASE_FUNCTIONS(eindex); \ + void lcd_autotune_callback_E ## eindex() { _lcd_autotune(eindex); } #else - #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex) + #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex) #endif - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - PID_MENU_ITEMS(MSG_E1, 0); - PID_MENU_ITEMS(MSG_E2, 1); - #if HOTENDS > 2 - PID_MENU_ITEMS(MSG_E3, 2); - #if HOTENDS > 3 - PID_MENU_ITEMS(MSG_E4, 3); - #endif //HOTENDS > 3 - #endif //HOTENDS > 2 - #else //!PID_PARAMS_PER_HOTEND || HOTENDS == 1 - PID_MENU_ITEMS("", 0); - #endif //!PID_PARAMS_PER_HOTEND || HOTENDS == 1 + _PIDTEMP_FUNCTIONS(0); + #if ENABLED(PID_PARAMS_PER_HOTEND) + #if HOTENDS > 1 + _PIDTEMP_FUNCTIONS(1); + #if HOTENDS > 2 + _PIDTEMP_FUNCTIONS(2); + #if HOTENDS > 3 + _PIDTEMP_FUNCTIONS(3); + #endif //HOTENDS > 3 + #endif //HOTENDS > 2 + #endif //HOTENDS > 1 + #endif //PID_PARAMS_PER_HOTEND #endif //PIDTEMP - // - // Preheat PLA conf - // - MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); - - // - // Preheat ABS conf - // - MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu); - END_MENU(); -} + /** + * + * "Control" > "Temperature" submenu + * + */ + static void lcd_control_temperature_menu() { + START_MENU(); -/** - * - * "Temperature" > "Preheat PLA conf" submenu - * - */ -static void lcd_control_temperature_preheat_pla_settings_menu() { - START_MENU(); - MENU_ITEM(back, MSG_TEMPERATURE); - MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255); - #if TEMP_SENSOR_0 != 0 - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15); - #endif - #if TEMP_SENSOR_BED != 0 - MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); - #endif - END_MENU(); -} + // + // ^ Control + // + MENU_ITEM(back, MSG_CONTROL); -/** - * - * "Temperature" > "Preheat ABS conf" submenu - * - */ -static void lcd_control_temperature_preheat_abs_settings_menu() { - START_MENU(); - MENU_ITEM(back, MSG_TEMPERATURE); - MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255); - #if TEMP_SENSOR_0 != 0 - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15); - #endif - #if TEMP_SENSOR_BED != 0 - MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); - #endif - END_MENU(); -} + // + // Nozzle: + // Nozzle [1-4]: + // + #if HOTENDS == 1 + #if TEMP_SENSOR_0 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + #endif + #else //HOTENDS > 1 + #if TEMP_SENSOR_0 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + #endif + #if TEMP_SENSOR_1 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); + #endif + #if HOTENDS > 2 + #if TEMP_SENSOR_2 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); + #endif + #if HOTENDS > 3 + #if TEMP_SENSOR_3 != 0 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); + #endif + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 -static void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } + // + // Bed: + // + #if TEMP_SENSOR_BED != 0 + MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15); + #endif -/** - * - * "Control" > "Motion" submenu - * - */ -static void lcd_control_motion_menu() { - START_MENU(); - MENU_ITEM(back, MSG_CONTROL); - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); - #endif - // Manual bed leveling, Bed Z: - #if ENABLED(MANUAL_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - MENU_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000); - MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &planner.max_xy_jerk, 1, 990); - #if ENABLED(DELTA) - MENU_ITEM_EDIT(float3, MSG_VZ_JERK, &planner.max_z_jerk, 1, 990); - #else - MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990); - #endif - MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990); - MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate[X_AXIS], 1, 999); - MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate[Y_AXIS], 1, 999); - MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate[Z_AXIS], 1, 999); - MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate[E_AXIS], 1, 999); - MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate, 0, 999); - MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate, 0, 999); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); - MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); - MENU_ITEM_EDIT(float52, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999); - MENU_ITEM_EDIT(float52, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999); - #if ENABLED(DELTA) - MENU_ITEM_EDIT(float52, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999); - #else - MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999); - #endif - MENU_ITEM_EDIT(float51, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999); - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit); - #endif - #if ENABLED(SCARA) - MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS], 0.5, 2); - MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS], 0.5, 2); - #endif - END_MENU(); -} + // + // Fan Speed: + // + #if FAN_COUNT > 0 + #if HAS_FAN0 + #if FAN_COUNT > 1 + #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED " 1" + #else + #define MSG_1ST_FAN_SPEED MSG_FAN_SPEED + #endif + MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_1ST_FAN_SPEED, &fanSpeeds[0], 0, 255); + #endif + #if HAS_FAN1 + MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255); + #endif + #if HAS_FAN2 + MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 3", &fanSpeeds[2], 0, 255); + #endif + #endif // FAN_COUNT > 0 + + // + // Autotemp, Min, Max, Fact + // + #if ENABLED(AUTOTEMP) && (TEMP_SENSOR_0 != 0) + MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); + MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15); + MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, HEATER_0_MAXTEMP - 15); + MENU_ITEM_EDIT(float32, MSG_FACTOR, &planner.autotemp_factor, 0.0, 1.0); + #endif -/** - * - * "Control" > "Filament" submenu - * - */ -static void lcd_control_volumetric_menu() { - START_MENU(); - MENU_ITEM(back, MSG_CONTROL); + // + // PID-P, PID-I, PID-D, PID-C, PID Autotune + // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1 + // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2 + // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3 + // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4 + // + #if ENABLED(PIDTEMP) + + #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \ + raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \ + raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \ + MENU_ITEM_EDIT(float52, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \ + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \ + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex) + + #if ENABLED(PID_ADD_EXTRUSION_RATE) + #define _PID_MENU_ITEMS(ELABEL, eindex) \ + _PID_BASE_MENU_ITEMS(ELABEL, eindex); \ + MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990) + #else + #define _PID_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex) + #endif - MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers); + #if ENABLED(PID_AUTOTUNE_MENU) + #define PID_MENU_ITEMS(ELABEL, eindex) \ + _PID_MENU_ITEMS(ELABEL, eindex); \ + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex) + #else + #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex) + #endif - if (volumetric_enabled) { - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers); - #else //EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers); - #endif //EXTRUDERS > 3 - #endif //EXTRUDERS > 2 - #endif //EXTRUDERS > 1 + #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 + PID_MENU_ITEMS(MSG_E1, 0); + PID_MENU_ITEMS(MSG_E2, 1); + #if HOTENDS > 2 + PID_MENU_ITEMS(MSG_E3, 2); + #if HOTENDS > 3 + PID_MENU_ITEMS(MSG_E4, 3); + #endif //HOTENDS > 3 + #endif //HOTENDS > 2 + #else //!PID_PARAMS_PER_HOTEND || HOTENDS == 1 + PID_MENU_ITEMS("", 0); + #endif //!PID_PARAMS_PER_HOTEND || HOTENDS == 1 + + #endif //PIDTEMP + + // + // Preheat PLA conf + // + MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); + + // + // Preheat ABS conf + // + MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu); + END_MENU(); } - END_MENU(); -} + /** + * + * "Temperature" > "Preheat PLA conf" submenu + * + */ + static void lcd_control_temperature_preheat_pla_settings_menu() { + START_MENU(); + MENU_ITEM(back, MSG_TEMPERATURE); + MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255); + #if TEMP_SENSOR_0 != 0 + MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15); + #endif + #if TEMP_SENSOR_BED != 0 + MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); + #endif + END_MENU(); + } -/** - * - * "Control" > "Contrast" submenu - * - */ -#if HAS_LCD_CONTRAST - static void lcd_set_contrast() { - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - set_lcd_contrast(lcd_contrast + encoderPosition); - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - if (lcdDrawUpdate) { - lcd_implementation_drawedit(PSTR(MSG_CONTRAST), - #if LCD_CONTRAST_MAX >= 100 - itostr3(lcd_contrast) - #else - itostr2(lcd_contrast) - #endif - ); - } - if (LCD_CLICKED) lcd_goto_previous_menu(true); + /** + * + * "Temperature" > "Preheat ABS conf" submenu + * + */ + static void lcd_control_temperature_preheat_abs_settings_menu() { + START_MENU(); + MENU_ITEM(back, MSG_TEMPERATURE); + MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255); + #if TEMP_SENSOR_0 != 0 + MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15); + #endif + #if TEMP_SENSOR_BED != 0 + MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); + #endif + END_MENU(); } -#endif // HAS_LCD_CONTRAST -/** - * - * "Control" > "Retract" submenu - * - */ -#if ENABLED(FWRETRACT) - static void lcd_control_retract_menu() { + static void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } + + /** + * + * "Control" > "Motion" submenu + * + */ + static void lcd_control_motion_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL); - MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled); - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100); + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999); - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999); - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100); + // Manual bed leveling, Bed Z: + #if ENABLED(MANUAL_BED_LEVELING) + MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); + #endif + MENU_ITEM_EDIT(float5, MSG_ACC, &planner.acceleration, 10, 99000); + MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &planner.max_xy_jerk, 1, 990); + #if ENABLED(DELTA) + MENU_ITEM_EDIT(float3, MSG_VZ_JERK, &planner.max_z_jerk, 1, 990); + #else + MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990); + #endif + MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate[X_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate[Y_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate[Z_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate[E_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate, 0, 999); + MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate, 0, 999); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); + MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); + MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); + MENU_ITEM_EDIT(float52, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999); + MENU_ITEM_EDIT(float52, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999); + #if ENABLED(DELTA) + MENU_ITEM_EDIT(float52, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999); + #else + MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999); + #endif + MENU_ITEM_EDIT(float51, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999); + #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) + MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit); + #endif + #if ENABLED(SCARA) + MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS], 0.5, 2); + MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS], 0.5, 2); #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999); END_MENU(); } -#endif // FWRETRACT -#if ENABLED(SDSUPPORT) + /** + * + * "Control" > "Filament" submenu + * + */ + static void lcd_control_volumetric_menu() { + START_MENU(); + MENU_ITEM(back, MSG_CONTROL); - #if !PIN_EXISTS(SD_DETECT) - static void lcd_sd_refresh() { - card.initsd(); - currentMenuViewOffset = 0; + MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers); + + if (volumetric_enabled) { + #if EXTRUDERS == 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers); + #else //EXTRUDERS > 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers); + #if EXTRUDERS > 2 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers); + #if EXTRUDERS > 3 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers); + #endif //EXTRUDERS > 3 + #endif //EXTRUDERS > 2 + #endif //EXTRUDERS > 1 } - #endif - static void lcd_sd_updir() { - card.updir(); - currentMenuViewOffset = 0; + END_MENU(); } /** * - * "Print from SD" submenu + * "Control" > "Contrast" submenu * */ - void lcd_sdcard_menu() { - ENCODER_DIRECTION_MENUS(); - if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card) - uint16_t fileCnt = card.getnrfilenames(); - START_MENU(); - MENU_ITEM(back, MSG_MAIN); - card.getWorkDirName(); - if (card.filename[0] == '/') { - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); - #endif + #if HAS_LCD_CONTRAST + static void lcd_set_contrast() { + ENCODER_DIRECTION_NORMAL(); + if (encoderPosition) { + set_lcd_contrast(lcd_contrast + encoderPosition); + encoderPosition = 0; + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + } + if (lcdDrawUpdate) { + lcd_implementation_drawedit(PSTR(MSG_CONTRAST), + #if LCD_CONTRAST_MAX >= 100 + itostr3(lcd_contrast) + #else + itostr2(lcd_contrast) + #endif + ); + } + if (LCD_CLICKED) lcd_goto_previous_menu(true); } - else { - MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); + #endif // HAS_LCD_CONTRAST + + /** + * + * "Control" > "Retract" submenu + * + */ + #if ENABLED(FWRETRACT) + static void lcd_control_retract_menu() { + START_MENU(); + MENU_ITEM(back, MSG_CONTROL); + MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled); + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100); + #if EXTRUDERS > 1 + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100); + #endif + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999); + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999); + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100); + #if EXTRUDERS > 1 + MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100); + #endif + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999); + END_MENU(); } + #endif // FWRETRACT - for (uint16_t i = 0; i < fileCnt; i++) { - if (_menuItemNr == _lineNr) { - card.getfilename( - #if ENABLED(SDCARD_RATHERRECENTFIRST) - fileCnt-1 - - #endif - i - ); + #if ENABLED(SDSUPPORT) - if (card.filenameIsDir) - MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); - else - MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename); + #if !PIN_EXISTS(SD_DETECT) + static void lcd_sd_refresh() { + card.initsd(); + currentMenuViewOffset = 0; + } + #endif + + static void lcd_sd_updir() { + card.updir(); + currentMenuViewOffset = 0; + } + + /** + * + * "Print from SD" submenu + * + */ + void lcd_sdcard_menu() { + ENCODER_DIRECTION_MENUS(); + if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card) + uint16_t fileCnt = card.getnrfilenames(); + START_MENU(); + MENU_ITEM(back, MSG_MAIN); + card.getWorkDirName(); + if (card.filename[0] == '/') { + #if !PIN_EXISTS(SD_DETECT) + MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); + #endif } else { - MENU_ITEM_DUMMY(); + MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); } + + for (uint16_t i = 0; i < fileCnt; i++) { + if (_menuItemNr == _lineNr) { + card.getfilename( + #if ENABLED(SDCARD_RATHERRECENTFIRST) + fileCnt-1 - + #endif + i + ); + + if (card.filenameIsDir) + MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); + else + MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename); + } + else { + MENU_ITEM_DUMMY(); + } + } + END_MENU(); } - END_MENU(); - } -#endif //SDSUPPORT + #endif //SDSUPPORT -/** - * - * Functions for editing single values - * - * The "menu_edit_type" macro generates the functions needed to edit a numerical value. - * - * For example, menu_edit_type(int, int3, itostr3, 1) expands into these functions: - * - * bool _menu_edit_int3(); - * void menu_edit_int3(); // edit int (interactively) - * void menu_edit_callback_int3(); // edit int (interactively) with callback on completion - * static void _menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); - * static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); - * static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callback); // edit int with callback - * - * You can then use one of the menu macros to present the edit interface: - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999) - * - * This expands into a more primitive menu item: - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) - * - * - * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK - * - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) - */ -#define menu_edit_type(_type, _name, _strFunc, scale) \ - bool _menu_edit_ ## _name () { \ - ENCODER_DIRECTION_NORMAL(); \ - bool isClicked = LCD_CLICKED; \ - if ((int32_t)encoderPosition < 0) encoderPosition = 0; \ - if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \ - if (lcdDrawUpdate) \ - lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \ - if (isClicked) { \ - *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \ - lcd_goto_previous_menu(true); \ + /** + * + * Functions for editing single values + * + * The "menu_edit_type" macro generates the functions needed to edit a numerical value. + * + * For example, menu_edit_type(int, int3, itostr3, 1) expands into these functions: + * + * bool _menu_edit_int3(); + * void menu_edit_int3(); // edit int (interactively) + * void menu_edit_callback_int3(); // edit int (interactively) with callback on completion + * static void _menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); + * static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); + * static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callback); // edit int with callback + * + * You can then use one of the menu macros to present the edit interface: + * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999) + * + * This expands into a more primitive menu item: + * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) + * + * + * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK + * + * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) + */ + #define menu_edit_type(_type, _name, _strFunc, scale) \ + bool _menu_edit_ ## _name () { \ + ENCODER_DIRECTION_NORMAL(); \ + bool isClicked = LCD_CLICKED; \ + if ((int32_t)encoderPosition < 0) encoderPosition = 0; \ + if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \ + if (lcdDrawUpdate) \ + lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \ + if (isClicked) { \ + *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \ + lcd_goto_previous_menu(true); \ + } \ + return isClicked; \ } \ - return isClicked; \ - } \ - void menu_edit_ ## _name () { _menu_edit_ ## _name(); } \ - void menu_edit_callback_ ## _name () { if (_menu_edit_ ## _name ()) (*callbackFunc)(); } \ - static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \ - lcd_save_previous_menu(); \ - \ - lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; \ - \ - editLabel = pstr; \ - editValue = ptr; \ - minEditValue = minValue * scale; \ - maxEditValue = maxValue * scale - minEditValue; \ - encoderPosition = (*ptr) * scale - minEditValue; \ - } \ - static void menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \ - _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ - currentMenu = menu_edit_ ## _name; \ - }\ - static void menu_action_setting_edit_callback_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue, menuFunc_t callback) { \ - _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ - currentMenu = menu_edit_callback_ ## _name; \ - callbackFunc = callback; \ - } -menu_edit_type(int, int3, itostr3, 1); -menu_edit_type(float, float3, ftostr3, 1); -menu_edit_type(float, float32, ftostr32, 100); -menu_edit_type(float, float43, ftostr43sign, 1000); -menu_edit_type(float, float5, ftostr5rj, 0.01); -menu_edit_type(float, float51, ftostr51sign, 10); -menu_edit_type(float, float52, ftostr52sign, 100); -menu_edit_type(unsigned long, long5, ftostr5rj, 0.01); - -/** - * - * Handlers for RepRap World Keypad input - * - */ -#if ENABLED(REPRAPWORLD_KEYPAD) - static void reprapworld_keypad_move_z_up() { - encoderPosition = 1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_z(); - } - static void reprapworld_keypad_move_z_down() { - encoderPosition = -1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_z(); - } - static void reprapworld_keypad_move_x_left() { - encoderPosition = -1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_x(); - } - static void reprapworld_keypad_move_x_right() { - encoderPosition = 1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_x(); - } - static void reprapworld_keypad_move_y_down() { - encoderPosition = 1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_y(); - } - static void reprapworld_keypad_move_y_up() { - encoderPosition = -1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_y(); - } - static void reprapworld_keypad_move_home() { - enqueue_and_echo_commands_P(PSTR("G28")); // move all axes home - } -#endif // REPRAPWORLD_KEYPAD - + void menu_edit_ ## _name () { _menu_edit_ ## _name(); } \ + void menu_edit_callback_ ## _name () { if (_menu_edit_ ## _name ()) (*callbackFunc)(); } \ + static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \ + lcd_save_previous_menu(); \ + \ + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; \ + \ + editLabel = pstr; \ + editValue = ptr; \ + minEditValue = minValue * scale; \ + maxEditValue = maxValue * scale - minEditValue; \ + encoderPosition = (*ptr) * scale - minEditValue; \ + } \ + static void menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \ + _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ + currentMenu = menu_edit_ ## _name; \ + }\ + static void menu_action_setting_edit_callback_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue, menuFunc_t callback) { \ + _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ + currentMenu = menu_edit_callback_ ## _name; \ + callbackFunc = callback; \ + } + menu_edit_type(int, int3, itostr3, 1); + menu_edit_type(float, float3, ftostr3, 1); + menu_edit_type(float, float32, ftostr32, 100); + menu_edit_type(float, float43, ftostr43sign, 1000); + menu_edit_type(float, float5, ftostr5rj, 0.01); + menu_edit_type(float, float51, ftostr51sign, 10); + menu_edit_type(float, float52, ftostr52sign, 100); + menu_edit_type(unsigned long, long5, ftostr5rj, 0.01); -/** - * - * Audio feedback for controller clicks - * - */ + /** + * + * Handlers for RepRap World Keypad input + * + */ + #if ENABLED(REPRAPWORLD_KEYPAD) + static void reprapworld_keypad_move_z_up() { + encoderPosition = 1; + move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; + lcd_move_z(); + } + static void reprapworld_keypad_move_z_down() { + encoderPosition = -1; + move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; + lcd_move_z(); + } + static void reprapworld_keypad_move_x_left() { + encoderPosition = -1; + move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; + lcd_move_x(); + } + static void reprapworld_keypad_move_x_right() { + encoderPosition = 1; + move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; + lcd_move_x(); + } + static void reprapworld_keypad_move_y_down() { + encoderPosition = 1; + move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; + lcd_move_y(); + } + static void reprapworld_keypad_move_y_up() { + encoderPosition = -1; + move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; + lcd_move_y(); + } + static void reprapworld_keypad_move_home() { + enqueue_and_echo_commands_P(PSTR("G28")); // move all axes home + } + #endif // REPRAPWORLD_KEYPAD -#if ENABLED(LCD_USE_I2C_BUZZER) - void lcd_buzz(long duration, uint16_t freq) { // called from buzz() in Marlin_main.cpp where lcd is unknown - lcd.buzz(duration, freq); - } -#endif -void lcd_quick_feedback() { - lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; - next_button_update_ms = millis() + 500; + /** + * + * Audio feedback for controller clicks + * + */ #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #elif PIN_EXISTS(BEEPER) - buzzer.tone(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #else - delay(LCD_FEEDBACK_FREQUENCY_DURATION_MS); + void lcd_buzz(long duration, uint16_t freq) { // called from buzz() in Marlin_main.cpp where lcd is unknown + lcd.buzz(duration, freq); + } #endif -} - -/** - * - * Menu actions - * - */ -static void menu_action_back() { lcd_goto_previous_menu(); } -static void menu_action_submenu(menuFunc_t func) { lcd_save_previous_menu(); lcd_goto_menu(func); } -static void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); } -static void menu_action_function(menuFunc_t func) { (*func)(); } -#if ENABLED(SDSUPPORT) + void lcd_quick_feedback() { + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; + next_button_update_ms = millis() + 500; - static void menu_action_sdfile(const char* filename, char* longFilename) { - UNUSED(longFilename); - card.openAndPrintFile(filename); - lcd_return_to_status(); + #if ENABLED(LCD_USE_I2C_BUZZER) + lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + #elif PIN_EXISTS(BEEPER) + buzzer.tone(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + #else + delay(LCD_FEEDBACK_FREQUENCY_DURATION_MS); + #endif } - static void menu_action_sddirectory(const char* filename, char* longFilename) { - UNUSED(longFilename); - card.chdir(filename); - encoderPosition = 0; - } + /** + * + * Menu actions + * + */ + static void menu_action_back() { lcd_goto_previous_menu(); } + static void menu_action_submenu(menuFunc_t func) { lcd_save_previous_menu(); lcd_goto_menu(func); } + static void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); } + static void menu_action_function(menuFunc_t func) { (*func)(); } -#endif //SDSUPPORT + #if ENABLED(SDSUPPORT) -static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); } -static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) { - menu_action_setting_edit_bool(pstr, ptr); - (*callback)(); -} + static void menu_action_sdfile(const char* filename, char* longFilename) { + UNUSED(longFilename); + card.openAndPrintFile(filename); + lcd_return_to_status(); + } + + static void menu_action_sddirectory(const char* filename, char* longFilename) { + UNUSED(longFilename); + card.chdir(filename); + encoderPosition = 0; + } + + #endif //SDSUPPORT + + static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); } + static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) { + menu_action_setting_edit_bool(pstr, ptr); + (*callback)(); + } #endif //ULTIPANEL @@ -2158,13 +2165,12 @@ bool lcd_blink() { * No worries. This function is only called from the main thread. */ void lcd_update() { + #if ENABLED(ULTIPANEL) static millis_t return_to_status_ms = 0; - manage_manual_move(); #endif - lcd_buttons_update(); #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) @@ -2173,7 +2179,7 @@ void lcd_update() { if (sd_status != lcd_sd_status && lcd_detected()) { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if ENABLED(LCD_PROGRESS_BAR) + #if ENABLED(LCD_PROGRESS_BAR) && ENABLED(ULTIPANEL) currentMenu == lcd_status_screen #endif ); @@ -2272,7 +2278,11 @@ void lcd_update() { // We arrive here every ~100ms when idling often enough. // Instead of tracking the changes simply redraw the Info Screen ~1 time a second. static int8_t lcd_status_update_delay = 1; // first update one loop delayed - if (currentMenu == lcd_status_screen && !lcd_status_update_delay--) { + if ( + #if ENABLED(ULTIPANEL) + currentMenu == lcd_status_screen && + #endif + !lcd_status_update_delay--) { lcd_status_update_delay = 9; lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } @@ -2301,10 +2311,18 @@ void lcd_update() { u8g.setColorIndex(dot_color); // Set color for the alive dot u8g.drawPixel(127, 63); // draw alive dot u8g.setColorIndex(1); // black on white - (*currentMenu)(); + #if ENABLED(ULTIPANEL) + (*currentMenu)(); + #else + lcd_status_screen(); + #endif } while (u8g.nextPage()); #else - (*currentMenu)(); + #if ENABLED(ULTIPANEL) + (*currentMenu)(); + #else + lcd_status_screen(); + #endif #endif } @@ -2334,11 +2352,6 @@ void lcd_update() { } } -void lcd_ignore_click(bool b) { - ignore_click = b; - wait_for_unclick = false; -} - void lcd_finishstatus(bool persist=false) { #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) UNUSED(persist); diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index e85583536..707ba8f8c 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -61,8 +61,11 @@ #define LCD_TIMEOUT_TO_STATUS 15000 #if ENABLED(ULTIPANEL) - void lcd_buttons_update(); extern volatile uint8_t buttons; //the last checked buttons in a bit array. + void lcd_buttons_update(); + void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual + bool lcd_clicked(); + void lcd_ignore_click(bool b=true); #else FORCE_INLINE void lcd_buttons_update() {} #endif @@ -79,12 +82,10 @@ #if ENABLED(FILAMENT_LCD_DISPLAY) extern millis_t previous_lcd_status_ms; #endif - void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual - bool lcd_clicked(); - void lcd_ignore_click(bool b=true); + bool lcd_blink(); - #if ENABLED(ULTIPANEL) && ENABLED(REPRAPWORLD_KEYPAD) + #if ENABLED(REPRAPWORLD_KEYPAD) #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values @@ -114,7 +115,7 @@ #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) - #endif //ULTIPANEL && REPRAPWORLD_KEYPAD + #endif // REPRAPWORLD_KEYPAD #if ENABLED(NEWPANEL) From ae9b09fe94ae23f83edf78bd074470a31b93b634 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Jun 2016 14:19:17 -0700 Subject: [PATCH 051/580] menu => screen --- Marlin/ultralcd.cpp | 112 ++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index aafbf572b..1f58183e6 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -129,13 +129,13 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to #endif // Function pointer to menu functions. - typedef void (*menuFunc_t)(); + typedef void (*screenFunc_t)(); // Different types of actions that can be used in menu items. static void menu_action_back(); - static void menu_action_submenu(menuFunc_t data); + static void menu_action_submenu(screenFunc_t data); static void menu_action_gcode(const char* pgcode); - static void menu_action_function(menuFunc_t data); + static void menu_action_function(screenFunc_t data); static void menu_action_setting_edit_bool(const char* pstr, bool* ptr); static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); static void menu_action_setting_edit_float3(const char* pstr, float* ptr, float minValue, float maxValue); @@ -145,15 +145,15 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to static void menu_action_setting_edit_float51(const char* pstr, float* ptr, float minValue, float maxValue); static void menu_action_setting_edit_float52(const char* pstr, float* ptr, float minValue, float maxValue); static void menu_action_setting_edit_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue); - static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callbackFunc); - static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callbackFunc); - static void menu_action_setting_edit_callback_float3(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); - static void menu_action_setting_edit_callback_float32(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); - static void menu_action_setting_edit_callback_float43(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); - static void menu_action_setting_edit_callback_float5(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); - static void menu_action_setting_edit_callback_float51(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); - static void menu_action_setting_edit_callback_float52(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); - static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, menuFunc_t callbackFunc); + static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callbackFunc); + static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, screenFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float3(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float32(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float43(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float5(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float51(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc); + static void menu_action_setting_edit_callback_float52(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc); + static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, screenFunc_t callbackFunc); #if ENABLED(SDSUPPORT) static void lcd_sdcard_menu(); @@ -286,14 +286,14 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to #endif typedef struct { - menuFunc_t menu_function; + screenFunc_t menu_function; uint32_t encoder_position; } menuPosition; - menuFunc_t currentMenu = lcd_status_screen; // pointer to the currently active menu handler + screenFunc_t currentScreen = lcd_status_screen; // pointer to the currently active menu handler - menuPosition menu_history[10]; - uint8_t menu_history_depth = 0; + menuPosition screen_history[10]; + uint8_t screen_history_depth = 0; bool ignore_click = false; bool wait_for_unclick; @@ -303,49 +303,49 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to const char* editLabel; void* editValue; int32_t minEditValue, maxEditValue; - menuFunc_t callbackFunc; // call this after editing + screenFunc_t callbackFunc; // call this after editing /** * General function to go directly to a menu * Remembers the previous position */ - static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const uint32_t encoder = 0) { - if (currentMenu != menu) { - currentMenu = menu; + static void lcd_goto_screen(screenFunc_t screen, const bool feedback = false, const uint32_t encoder = 0) { + if (currentScreen != screen) { + currentScreen = screen; lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; #if ENABLED(NEWPANEL) encoderPosition = encoder; if (feedback) lcd_quick_feedback(); #endif - if (menu == lcd_status_screen) { + if (screen == lcd_status_screen) { defer_return_to_status = false; - menu_history_depth = 0; + screen_history_depth = 0; } #if ENABLED(LCD_PROGRESS_BAR) // For LCD_PROGRESS_BAR re-initialize custom characters - lcd_set_custom_characters(menu == lcd_status_screen); + lcd_set_custom_characters(screen == lcd_status_screen); #endif } } - static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); } + static void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); } inline void lcd_save_previous_menu() { - if (menu_history_depth < COUNT(menu_history)) { - menu_history[menu_history_depth].menu_function = currentMenu; + if (screen_history_depth < COUNT(screen_history)) { + screen_history[screen_history_depth].menu_function = currentScreen; #if ENABLED(ULTIPANEL) - menu_history[menu_history_depth].encoder_position = encoderPosition; + screen_history[screen_history_depth].encoder_position = encoderPosition; #endif - ++menu_history_depth; + ++screen_history_depth; } } static void lcd_goto_previous_menu(bool feedback=false) { - if (menu_history_depth > 0) { - --menu_history_depth; - lcd_goto_menu(menu_history[menu_history_depth].menu_function, feedback + if (screen_history_depth > 0) { + --screen_history_depth; + lcd_goto_screen(screen_history[screen_history_depth].menu_function, feedback #if ENABLED(ULTIPANEL) - , menu_history[menu_history_depth].encoder_position + , screen_history[screen_history_depth].encoder_position #endif ); } @@ -428,10 +428,10 @@ static void lcd_status_screen() { } if (current_click) { - lcd_goto_menu(lcd_main_menu, true); + lcd_goto_screen(lcd_main_menu, true); lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. #if ENABLED(LCD_PROGRESS_BAR) && ENABLED(ULTIPANEL) - currentMenu == lcd_status_screen + currentScreen == lcd_status_screen #endif ); #if ENABLED(FILAMENT_LCD_DISPLAY) @@ -588,11 +588,11 @@ static void lcd_status_screen() { #if ENABLED(BABYSTEP_XY) static void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); } static void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); } - static void lcd_babystep_x() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_x); } - static void lcd_babystep_y() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_y); } + static void lcd_babystep_x() { babysteps_done = 0; lcd_goto_screen(_lcd_babystep_x); } + static void lcd_babystep_y() { babysteps_done = 0; lcd_goto_screen(_lcd_babystep_y); } #endif static void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); } - static void lcd_babystep_z() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_z); } + static void lcd_babystep_z() { babysteps_done = 0; lcd_goto_screen(_lcd_babystep_z); } #endif //BABYSTEPPING @@ -970,7 +970,7 @@ static void lcd_status_screen() { debounce_click = true; // ignore multiple "clicks" in a row mbl.set_zigzag_z(_lcd_level_bed_position++, current_position[Z_AXIS]); if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) { - lcd_goto_menu(_lcd_level_bed_done, true); + lcd_goto_screen(_lcd_level_bed_done, true); current_position[Z_AXIS] = MESH_HOME_SEARCH_Z #if MIN_Z_HEIGHT_FOR_HOMING > 0 @@ -990,7 +990,7 @@ static void lcd_status_screen() { #endif } else { - lcd_goto_menu(_lcd_level_goto_next_point, true); + lcd_goto_screen(_lcd_level_goto_next_point, true); } } } @@ -1031,7 +1031,7 @@ static void lcd_status_screen() { */ static void _lcd_level_goto_next_point() { // Set the menu to display ahead of blocking call - lcd_goto_menu(_lcd_level_bed_moving); + lcd_goto_screen(_lcd_level_bed_moving); // _mbl_goto_xy runs the menu loop until the move is done int8_t px, py; @@ -1039,7 +1039,7 @@ static void lcd_status_screen() { _mbl_goto_xy(mbl.get_probe_x(px), mbl.get_probe_y(py)); // After the blocking function returns, change menus - lcd_goto_menu(_lcd_level_bed_get_z); + lcd_goto_screen(_lcd_level_bed_get_z); } /** @@ -1052,7 +1052,7 @@ static void lcd_status_screen() { _lcd_level_bed_position = 0; current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - lcd_goto_menu(_lcd_level_goto_next_point, true); + lcd_goto_screen(_lcd_level_goto_next_point, true); } } @@ -1069,7 +1069,7 @@ static void lcd_status_screen() { #endif ; if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) - lcd_goto_menu(_lcd_level_bed_homing_done); + lcd_goto_screen(_lcd_level_bed_homing_done); } /** @@ -1080,7 +1080,7 @@ static void lcd_status_screen() { axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false; mbl.reset(); enqueue_and_echo_commands_P(PSTR("G28")); - lcd_goto_menu(_lcd_level_bed_homing); + lcd_goto_screen(_lcd_level_bed_homing); } /** @@ -1868,7 +1868,7 @@ static void lcd_status_screen() { * void menu_edit_callback_int3(); // edit int (interactively) with callback on completion * static void _menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); * static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue); - * static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callback); // edit int with callback + * static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, screenFunc_t callback); // edit int with callback * * You can then use one of the menu macros to present the edit interface: * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999) @@ -1910,11 +1910,11 @@ static void lcd_status_screen() { } \ static void menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \ _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ - currentMenu = menu_edit_ ## _name; \ + currentScreen = menu_edit_ ## _name; \ }\ - static void menu_action_setting_edit_callback_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue, menuFunc_t callback) { \ + static void menu_action_setting_edit_callback_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue, screenFunc_t callback) { \ _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ - currentMenu = menu_edit_callback_ ## _name; \ + currentScreen = menu_edit_callback_ ## _name; \ callbackFunc = callback; \ } menu_edit_type(int, int3, itostr3, 1); @@ -1999,9 +1999,9 @@ static void lcd_status_screen() { * */ static void menu_action_back() { lcd_goto_previous_menu(); } - static void menu_action_submenu(menuFunc_t func) { lcd_save_previous_menu(); lcd_goto_menu(func); } + static void menu_action_submenu(screenFunc_t func) { lcd_save_previous_menu(); lcd_goto_screen(func); } static void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); } - static void menu_action_function(menuFunc_t func) { (*func)(); } + static void menu_action_function(screenFunc_t func) { (*func)(); } #if ENABLED(SDSUPPORT) @@ -2020,7 +2020,7 @@ static void lcd_status_screen() { #endif //SDSUPPORT static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); } - static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) { + static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callback) { menu_action_setting_edit_bool(pstr, ptr); (*callback)(); } @@ -2180,7 +2180,7 @@ void lcd_update() { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. #if ENABLED(LCD_PROGRESS_BAR) && ENABLED(ULTIPANEL) - currentMenu == lcd_status_screen + currentScreen == lcd_status_screen #endif ); @@ -2280,7 +2280,7 @@ void lcd_update() { static int8_t lcd_status_update_delay = 1; // first update one loop delayed if ( #if ENABLED(ULTIPANEL) - currentMenu == lcd_status_screen && + currentScreen == lcd_status_screen && #endif !lcd_status_update_delay--) { lcd_status_update_delay = 9; @@ -2312,14 +2312,14 @@ void lcd_update() { u8g.drawPixel(127, 63); // draw alive dot u8g.setColorIndex(1); // black on white #if ENABLED(ULTIPANEL) - (*currentMenu)(); + (*currentScreen)(); #else lcd_status_screen(); #endif } while (u8g.nextPage()); #else #if ENABLED(ULTIPANEL) - (*currentMenu)(); + (*currentScreen)(); #else lcd_status_screen(); #endif @@ -2329,7 +2329,7 @@ void lcd_update() { #if ENABLED(ULTIPANEL) // Return to Status Screen after a timeout - if (currentMenu == lcd_status_screen || defer_return_to_status) + if (currentScreen == lcd_status_screen || defer_return_to_status) return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; else if (ELAPSED(ms, return_to_status_ms)) lcd_return_to_status(); From b75e648f2c849ebc2a7d23c54d4b99755ae9c3e1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Jun 2016 19:23:41 -0700 Subject: [PATCH 052/580] Clarify names of prepare_move functions --- Marlin/Marlin.h | 1 - Marlin/Marlin_main.cpp | 107 +++++++++++++++++++++-------------------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 1a3a170c7..f7c51e252 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -227,7 +227,6 @@ void FlushSerialRequestResend(); void ok_to_send(); void reset_bed_level(); -void prepare_move(); void kill(const char*); #if DISABLED(DELTA) && DISABLED(SCARA) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 73c747837..4f018c0a8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -529,6 +529,7 @@ void stop(); void get_available_commands(); void process_next_command(); +void prepare_move_to_destination(); #if ENABLED(ARC_SUPPORT) void plan_arc(float target[NUM_AXIS], float* offset, uint8_t clockwise); @@ -1568,9 +1569,9 @@ static void setup_for_endstop_move() { /** * Calculate delta, start a line, and set current_position to destination */ - void prepare_move_raw() { + void prepare_move_to_destination_raw() { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_raw", destination); + if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination); #endif refresh_cmd_timeout(); calculate_delta(destination); @@ -1674,7 +1675,7 @@ static void setup_for_endstop_move() { // move down slowly until you find the bed feedrate = homing_feedrate[Z_AXIS] / 4; destination[Z_AXIS] = -10; - prepare_move_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // this will also set_current_to_destination stepper.synchronize(); endstops.hit_on_purpose(); // clear endstop hit flags @@ -1754,9 +1755,9 @@ static void setup_for_endstop_move() { destination[Z_AXIS] = z; if (x == current_position[X_AXIS] && y == current_position[Y_AXIS]) - prepare_move_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // this will also set_current_to_destination else - prepare_move(); // this will also set_current_to_destination + prepare_move_to_destination(); // this will also set_current_to_destination stepper.synchronize(); @@ -1843,7 +1844,7 @@ static void setup_for_endstop_move() { destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X; destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z; - prepare_move_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // this will also set_current_to_destination // Move to engage deployment if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE) @@ -1854,7 +1855,7 @@ static void setup_for_endstop_move() { destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y; if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z; - prepare_move_raw(); + prepare_move_to_destination_raw(); #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) @@ -1870,14 +1871,14 @@ static void setup_for_endstop_move() { if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z; - prepare_move_raw(); + prepare_move_to_destination_raw(); #endif } // Partially Home X,Y for safety destination[X_AXIS] = destination[X_AXIS] * 0.75; destination[Y_AXIS] = destination[Y_AXIS] * 0.75; - prepare_move_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // this will also set_current_to_destination stepper.synchronize(); @@ -1940,14 +1941,14 @@ static void setup_for_endstop_move() { #if Z_RAISE_AFTER_PROBING > 0 destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; - prepare_move_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // this will also set_current_to_destination #endif // Move to the start position to initiate retraction destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X; destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z; - prepare_move_raw(); + prepare_move_to_destination_raw(); // Move the nozzle down to push the Z probe into retracted position if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE) @@ -1957,7 +1958,7 @@ static void setup_for_endstop_move() { if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y) destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z; - prepare_move_raw(); + prepare_move_to_destination_raw(); // Move up for safety if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE) @@ -1967,13 +1968,13 @@ static void setup_for_endstop_move() { if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y) destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z; - prepare_move_raw(); + prepare_move_to_destination_raw(); // Home XY for safety feedrate = homing_feedrate[X_AXIS] / 2; destination[X_AXIS] = 0; destination[Y_AXIS] = 0; - prepare_move_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // this will also set_current_to_destination stepper.synchronize(); @@ -2468,7 +2469,7 @@ static void homeaxis(AxisEnum axis) { feedrate = retract_feedrate * 60; current_position[E_AXIS] += (swapping ? retract_length_swap : retract_length) / volumetric_multiplier[active_extruder]; sync_plan_position_e(); - prepare_move(); + prepare_move_to_destination(); if (retract_zlift > 0.01) { current_position[Z_AXIS] -= retract_zlift; @@ -2477,7 +2478,7 @@ static void homeaxis(AxisEnum axis) { #else sync_plan_position(); #endif - prepare_move(); + prepare_move_to_destination(); } } else { @@ -2495,7 +2496,7 @@ static void homeaxis(AxisEnum axis) { float move_e = swapping ? retract_length_swap + retract_recover_length_swap : retract_length + retract_recover_length; current_position[E_AXIS] -= move_e / volumetric_multiplier[active_extruder]; sync_plan_position_e(); - prepare_move(); + prepare_move_to_destination(); } feedrate = oldFeedrate; @@ -2593,7 +2594,7 @@ inline void gcode_G0_G1() { #endif //FWRETRACT - prepare_move(); + prepare_move_to_destination(); } } @@ -5887,7 +5888,7 @@ inline void gcode_M303() { calculate_SCARA_forward_Transform(delta); destination[X_AXIS] = delta[X_AXIS] / axis_scaling[X_AXIS]; destination[Y_AXIS] = delta[Y_AXIS] / axis_scaling[Y_AXIS]; - prepare_move(); + prepare_move_to_destination(); //ok_to_send(); return true; } @@ -6716,7 +6717,7 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif // Move to the "old position" (move the extruder into place) - if (IsRunning()) prepare_move(); + if (IsRunning()) prepare_move_to_destination(); } // (tmp_extruder != active_extruder) @@ -7597,32 +7598,9 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, } #endif // MESH_BED_LEVELING -#if ENABLED(PREVENT_DANGEROUS_EXTRUDE) - - inline void prevent_dangerous_extrude(float& curr_e, float& dest_e) { - if (DEBUGGING(DRYRUN)) return; - float de = dest_e - curr_e; - if (de) { - if (thermalManager.tooColdToExtrude(active_extruder)) { - curr_e = dest_e; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); - } - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - if (labs(de) > EXTRUDE_MAXLENGTH) { - curr_e = dest_e; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); - } - #endif - } - } - -#endif // PREVENT_DANGEROUS_EXTRUDE - #if ENABLED(DELTA) || ENABLED(SCARA) - inline bool prepare_move_delta(float target[NUM_AXIS]) { + inline bool prepare_delta_move_to(float target[NUM_AXIS]) { float difference[NUM_AXIS]; for (int8_t i = 0; i < NUM_AXIS; i++) difference[i] = target[i] - current_position[i]; @@ -7651,8 +7629,8 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, if (!bed_leveling_in_progress) adjust_delta(target); #endif - //DEBUG_POS("prepare_move_delta", target); - //DEBUG_POS("prepare_move_delta", delta); + //DEBUG_POS("prepare_delta_move_to", target); + //DEBUG_POS("prepare_delta_move_to", delta); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], _feedrate, active_extruder); } @@ -7662,7 +7640,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, #endif // DELTA || SCARA #if ENABLED(SCARA) - inline bool prepare_move_scara(float target[NUM_AXIS]) { return prepare_move_delta(target); } + inline bool prepare_scara_move_to(float target[NUM_AXIS]) { return prepare_delta_move_to(target); } #endif #if ENABLED(DUAL_X_CARRIAGE) @@ -7706,7 +7684,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, #if DISABLED(DELTA) && DISABLED(SCARA) - inline bool prepare_move_cartesian() { + inline bool prepare_cartesian_move_to_destination() { // Do not use feedrate_multiplier for E or Z only moves if (current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS]) { line_to_destination(); @@ -7724,13 +7702,36 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, #endif // !DELTA && !SCARA +#if ENABLED(PREVENT_DANGEROUS_EXTRUDE) + + inline void prevent_dangerous_extrude(float& curr_e, float& dest_e) { + if (DEBUGGING(DRYRUN)) return; + float de = dest_e - curr_e; + if (de) { + if (thermalManager.tooColdToExtrude(active_extruder)) { + curr_e = dest_e; // Behave as if the move really took place, but ignore E part + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); + } + #if ENABLED(PREVENT_LENGTHY_EXTRUDE) + if (labs(de) > EXTRUDE_MAXLENGTH) { + curr_e = dest_e; // Behave as if the move really took place, but ignore E part + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); + } + #endif + } + } + +#endif // PREVENT_DANGEROUS_EXTRUDE + /** * Prepare a single move and get ready for the next one * * (This may call planner.buffer_line several times to put * smaller moves into the planner for DELTA or SCARA.) */ -void prepare_move() { +void prepare_move_to_destination() { clamp_to_software_endstops(destination); refresh_cmd_timeout(); @@ -7739,14 +7740,14 @@ void prepare_move() { #endif #if ENABLED(SCARA) - if (!prepare_move_scara(destination)) return; + if (!prepare_scara_move_to(destination)) return; #elif ENABLED(DELTA) - if (!prepare_move_delta(destination)) return; + if (!prepare_delta_move_to(destination)) return; #else #if ENABLED(DUAL_X_CARRIAGE) if (!prepare_move_dual_x_carriage()) return; #endif - if (!prepare_move_cartesian()) return; + if (!prepare_cartesian_move_to_destination()) return; #endif set_current_to_destination(); @@ -8262,7 +8263,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { // travel moves have been received so enact them delayed_move_time = 0xFFFFFFFFUL; // force moves to be done set_destination_to_current(); - prepare_move(); + prepare_move_to_destination(); } #endif From efe719f8989b534b3158b776f11ee361b2b9372f Mon Sep 17 00:00:00 2001 From: Blue-Marlin Date: Sun, 12 Jun 2016 00:34:31 +0200 Subject: [PATCH 053/580] Heal the watchgog --- Marlin/buzzer.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index 2e436259e..c87fe849d 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -24,8 +24,8 @@ #define __BUZZER_H__ #include "fastio.h" -#include "watchdog.h" #include "circularqueue.h" +#include "temperature.h" #define TONE_QUEUE_LENGTH 4 @@ -106,9 +106,7 @@ class Buzzer { while (buffer.isFull()) { delay(5); this->tick(); - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif + thermalManager.manage_heater(); } this->buffer.enqueue((tone_t) { duration, frequency }); } From de8108648f487c284a10d66f8e16475790f01876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 22 Apr 2016 17:33:00 +0100 Subject: [PATCH 054/580] Added a versioning system to the config files --- Marlin/Configuration.h | 13 +++++++++++++ Marlin/Configuration_adv.h | 13 +++++++++++++ Marlin/SanityCheck.h | 14 ++++++++++++++ Marlin/Version.h | 10 ++++++++++ 4 files changed, 50 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 502690ada..1c34d5976 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Default_Version.h ! + */ +#define CONFIGURATION_H_VERSION 1 + #include "boards.h" #include "macros.h" diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 952da0fa7..328df8eef 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -33,6 +33,19 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Default_Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 1 + #include "Conditionals.h" // @section temperature diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index a913cb1b0..8d90554e5 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -38,6 +38,20 @@ #error "Versions of Arduino IDE prior to 1.6.0 are no longer supported, please update your toolkit." #endif +/** + * We try our best to include sanity checks for all the changes configuration + * directives because people have a tendency to use outdated config files with + * the bleding edge source code, but sometimes this is not enough. This check + * will force a minimum config file revision, otherwise Marlin will not build. + */ +#if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION + #error You are using an old Configuration.h file, updated it before building Marlin. +#endif + +#if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION + #error You are using an old Configuration_adv.h file, updated it before building Marlin. +#endif + /** * Marlin release, version and default string */ diff --git a/Marlin/Version.h b/Marlin/Version.h index 68f3f7604..edf1a9999 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -44,6 +44,16 @@ */ #define STRING_DISTRIBUTION_DATE "2016-04-27 12:00" +/** + * Required minimum Configuration.h and Configuration_adv.h file versions. + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on + * the configuration files. + */ +#define REQUIRED_CONFIGURATION_H_VERSION 1 +#define REQUIRED_CONFIGURATION_ADV_H_VERSION 1 + /** * @todo: Missing documentation block */ From 7fb69e24fbb41b71403c9169ab22b511c1e10797 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Jun 2016 15:35:25 -0700 Subject: [PATCH 055/580] Use "Tn S1" to change tools without moving --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4f018c0a8..a9af2c4d9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6587,6 +6587,7 @@ inline void gcode_M999() { * T0-T3: Switch tool, usually switching extruders * * F[mm/min] Set the movement feedrate + * S1 Don't move the tool in XY after change */ inline void gcode_T(uint8_t tmp_extruder) { if (tmp_extruder >= EXTRUDERS) { @@ -6613,8 +6614,9 @@ inline void gcode_T(uint8_t tmp_extruder) { #if HOTENDS > 1 if (tmp_extruder != active_extruder) { + bool no_move = code_seen('S') && code_value_bool(); // Save current position to return to after applying extruder offset - set_destination_to_current(); + if (!no_move) set_destination_to_current(); #if ENABLED(DUAL_X_CARRIAGE) if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() && (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder))) { @@ -6717,7 +6719,7 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif // Move to the "old position" (move the extruder into place) - if (IsRunning()) prepare_move_to_destination(); + if (!no_move && IsRunning()) prepare_move_to_destination(); } // (tmp_extruder != active_extruder) From 8ccd97e7ccff5b91ad4a8c5da484cd66087266d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 22 Apr 2016 17:42:26 +0100 Subject: [PATCH 056/580] Updated all example configuration files --- Marlin/Configuration.h | 4 ++-- Marlin/Configuration_adv.h | 4 ++-- Marlin/SanityCheck.h | 4 ++-- Marlin/Version.h | 4 ++-- .../Felix/.Configuration.h.swp | Bin 0 -> 1024 bytes .../example_configurations/Felix/Configuration.h | 13 +++++++++++++ .../Felix/Configuration_adv.h | 13 +++++++++++++ .../Felix/DUAL/.Configuration.h.swp | Bin 0 -> 1024 bytes .../Felix/DUAL/Configuration.h | 13 +++++++++++++ .../Hephestos/.Configuration.h.swp | Bin 0 -> 1024 bytes .../Hephestos/Configuration.h | 13 +++++++++++++ .../Hephestos/Configuration_adv.h | 13 +++++++++++++ .../Hephestos_2/.Configuration.h.swp | Bin 0 -> 1024 bytes .../Hephestos_2/Configuration.h | 13 +++++++++++++ .../Hephestos_2/Configuration_adv.h | 13 +++++++++++++ .../K8200/.Configuration.h.swp | Bin 0 -> 1024 bytes .../example_configurations/K8200/Configuration.h | 13 +++++++++++++ .../K8200/Configuration_adv.h | 13 +++++++++++++ .../RepRapWorld/Megatronics/.Configuration.h.swp | Bin 0 -> 1024 bytes .../RepRapWorld/Megatronics/Configuration.h | 13 +++++++++++++ .../RigidBot/.Configuration.h.swp | Bin 0 -> 1024 bytes .../RigidBot/Configuration.h | 13 +++++++++++++ .../RigidBot/Configuration_adv.h | 13 +++++++++++++ .../SCARA/.Configuration.h.swp | Bin 0 -> 1024 bytes .../example_configurations/SCARA/Configuration.h | 13 +++++++++++++ .../SCARA/Configuration_adv.h | 13 +++++++++++++ .../TAZ4/.Configuration.h.swp | Bin 0 -> 1024 bytes .../example_configurations/TAZ4/Configuration.h | 13 +++++++++++++ .../TAZ4/Configuration_adv.h | 13 +++++++++++++ .../WITBOX/.Configuration.h.swp | Bin 0 -> 1024 bytes .../WITBOX/Configuration.h | 13 +++++++++++++ .../WITBOX/Configuration_adv.h | 13 +++++++++++++ .../adafruit/ST7565/.Configuration.h.swp | Bin 0 -> 1024 bytes .../adafruit/ST7565/Configuration.h | 13 +++++++++++++ .../delta/biv2.5/.Configuration.h.swp | Bin 0 -> 1024 bytes .../delta/biv2.5/Configuration.h | 13 +++++++++++++ .../delta/biv2.5/Configuration_adv.h | 13 +++++++++++++ .../delta/generic/.Configuration.h.swp | Bin 0 -> 1024 bytes .../delta/generic/Configuration.h | 13 +++++++++++++ .../delta/generic/Configuration_adv.h | 13 +++++++++++++ .../delta/kossel_mini/.Configuration.h.swp | Bin 0 -> 1024 bytes .../delta/kossel_mini/Configuration.h | 13 +++++++++++++ .../delta/kossel_mini/Configuration_adv.h | 13 +++++++++++++ .../delta/kossel_pro/.Configuration.h.swp | Bin 0 -> 1024 bytes .../delta/kossel_pro/Configuration.h | 13 +++++++++++++ .../delta/kossel_pro/Configuration_adv.h | 13 +++++++++++++ .../delta/kossel_xl/.Configuration.h.swp | Bin 0 -> 1024 bytes .../delta/kossel_xl/Configuration.h | 13 +++++++++++++ .../delta/kossel_xl/Configuration_adv.h | 13 +++++++++++++ .../makibox/.Configuration.h.swp | Bin 0 -> 1024 bytes .../makibox/Configuration.h | 13 +++++++++++++ .../makibox/Configuration_adv.h | 13 +++++++++++++ .../tvrrug/Round2/.Configuration.h.swp | Bin 0 -> 1024 bytes .../tvrrug/Round2/Configuration.h | 13 +++++++++++++ .../tvrrug/Round2/Configuration_adv.h | 13 +++++++++++++ 55 files changed, 437 insertions(+), 8 deletions(-) create mode 100644 Marlin/example_configurations/Felix/.Configuration.h.swp create mode 100644 Marlin/example_configurations/Felix/DUAL/.Configuration.h.swp create mode 100644 Marlin/example_configurations/Hephestos/.Configuration.h.swp create mode 100644 Marlin/example_configurations/Hephestos_2/.Configuration.h.swp create mode 100644 Marlin/example_configurations/K8200/.Configuration.h.swp create mode 100644 Marlin/example_configurations/RepRapWorld/Megatronics/.Configuration.h.swp create mode 100644 Marlin/example_configurations/RigidBot/.Configuration.h.swp create mode 100644 Marlin/example_configurations/SCARA/.Configuration.h.swp create mode 100644 Marlin/example_configurations/TAZ4/.Configuration.h.swp create mode 100644 Marlin/example_configurations/WITBOX/.Configuration.h.swp create mode 100644 Marlin/example_configurations/adafruit/ST7565/.Configuration.h.swp create mode 100644 Marlin/example_configurations/delta/biv2.5/.Configuration.h.swp create mode 100644 Marlin/example_configurations/delta/generic/.Configuration.h.swp create mode 100644 Marlin/example_configurations/delta/kossel_mini/.Configuration.h.swp create mode 100644 Marlin/example_configurations/delta/kossel_pro/.Configuration.h.swp create mode 100644 Marlin/example_configurations/delta/kossel_xl/.Configuration.h.swp create mode 100644 Marlin/example_configurations/makibox/.Configuration.h.swp create mode 100644 Marlin/example_configurations/tvrrug/Round2/.Configuration.h.swp diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 1c34d5976..afd024933 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -47,9 +47,9 @@ * You must increment this version number for every significant change such as, * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. * - * Note: Update also Default_Version.h ! + * Note: Update also Version.h ! */ -#define CONFIGURATION_H_VERSION 1 +#define CONFIGURATION_H_VERSION 010100 #include "boards.h" #include "macros.h" diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 328df8eef..306aeb761 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -42,9 +42,9 @@ * You must increment this version number for every significant change such as, * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. * - * Note: Update also Default_Version.h ! + * Note: Update also Version.h ! */ -#define CONFIGURATION_ADV_H_VERSION 1 +#define CONFIGURATION_ADV_H_VERSION 010100 #include "Conditionals.h" diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 8d90554e5..5daf3dc2d 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -45,11 +45,11 @@ * will force a minimum config file revision, otherwise Marlin will not build. */ #if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION - #error You are using an old Configuration.h file, updated it before building Marlin. + #error You are using an old Configuration.h file, update it before building Marlin. #endif #if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION - #error You are using an old Configuration_adv.h file, updated it before building Marlin. + #error You are using an old Configuration_adv.h file, update it before building Marlin. #endif /** diff --git a/Marlin/Version.h b/Marlin/Version.h index edf1a9999..d17564b42 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -51,8 +51,8 @@ * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on * the configuration files. */ -#define REQUIRED_CONFIGURATION_H_VERSION 1 -#define REQUIRED_CONFIGURATION_ADV_H_VERSION 1 +#define REQUIRED_CONFIGURATION_H_VERSION 010100 +#define REQUIRED_CONFIGURATION_ADV_H_VERSION 010100 /** * @todo: Missing documentation block diff --git a/Marlin/example_configurations/Felix/.Configuration.h.swp b/Marlin/example_configurations/Felix/.Configuration.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..c3fc82b940236222c1e57b69864a173602799cdc GIT binary patch literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y`~@u2#kgR=^+3B%^4kg literal 0 HcmV?d00001 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index e8285598f..716e48ef5 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + #include "boards.h" #include "macros.h" diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 9a89097d9..846a30183 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -33,6 +33,19 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 010100 + #include "Conditionals.h" // @section temperature diff --git a/Marlin/example_configurations/Hephestos_2/.Configuration.h.swp b/Marlin/example_configurations/Hephestos_2/.Configuration.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..a956da759364f0551e91f992c6b6ce939476c2d6 GIT binary patch literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*YzH47wbDCE7K!vJd#bL%+U}S J4FO_8005Q*BE7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y@45 literal 0 HcmV?d00001 diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 0ea247551..297b17915 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + #include "boards.h" #include "macros.h" diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 50d8cb51d..d4db5ad46 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -33,6 +33,19 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 010100 + #include "Conditionals.h" // @section temperature diff --git a/Marlin/example_configurations/SCARA/.Configuration.h.swp b/Marlin/example_configurations/SCARA/.Configuration.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..681613a905ee69a3da8cb4f2f7756cfe31423d5b GIT binary patch literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*YJc^#$>34uXb6mk09hdb0D_hqr2qf` literal 0 HcmV?d00001 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index dc0debd76..b8c94b588 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + #include "boards.h" #include "macros.h" diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 9a89097d9..846a30183 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -33,6 +33,19 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 010100 + #include "Conditionals.h" // @section temperature diff --git a/Marlin/example_configurations/adafruit/ST7565/.Configuration.h.swp b/Marlin/example_configurations/adafruit/ST7565/.Configuration.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..d7e98c4d740694e97ddc58dac77aebf44866370e GIT binary patch literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Yo9v literal 0 HcmV?d00001 diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 70bf487ea..d3485e2db 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + #include "boards.h" #include "macros.h" diff --git a/Marlin/example_configurations/delta/biv2.5/.Configuration.h.swp b/Marlin/example_configurations/delta/biv2.5/.Configuration.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..bf731ea1828bb3d4b57ff46840ffcfd9f508dd7a GIT binary patch literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y17_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*YEwn7G);uJ0nZ#5jGUb{88p;2#kgRX(0drd?Oy- literal 0 HcmV?d00001 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index e3e0988ca..74c0ff8db 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + #include "boards.h" #include "macros.h" diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index d64dfd5f3..ff23eb152 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -33,6 +33,19 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 010100 + #include "Conditionals.h" // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_mini/.Configuration.h.swp b/Marlin/example_configurations/delta/kossel_mini/.Configuration.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..0277ddf09e6064c1f3834b4f5ea2ca2a280c82a5 GIT binary patch literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Yo literal 0 HcmV?d00001 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index b0811e3ed..07041494f 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + #include "boards.h" #include "macros.h" diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index f99318ea3..040c39681 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -33,6 +33,19 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 010100 + #include "Conditionals.h" // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_pro/.Configuration.h.swp b/Marlin/example_configurations/delta/kossel_pro/.Configuration.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..08b8098505b6b220dc4b144ad6af31d85c30f949 GIT binary patch literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Yj&kR=A{_vJ0nZ#5jGUb{88p;2#kgRX(0drbQK=k literal 0 HcmV?d00001 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 5ec43116f..2e1282f16 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + #include "boards.h" #include "macros.h" diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index af2d22f9c..336f93884 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -33,6 +33,19 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 010100 + #include "Conditionals.h" // @section temperature From b322ac4417cc43a0669e64e390462604aa3eabcd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Jun 2016 16:50:06 -0700 Subject: [PATCH 057/580] No need to check ULTIPANEL with DOGLCD --- Marlin/ultralcd.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 1f58183e6..0fe780919 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2311,18 +2311,12 @@ void lcd_update() { u8g.setColorIndex(dot_color); // Set color for the alive dot u8g.drawPixel(127, 63); // draw alive dot u8g.setColorIndex(1); // black on white - #if ENABLED(ULTIPANEL) - (*currentScreen)(); - #else - lcd_status_screen(); - #endif + (*currentScreen)(); } while (u8g.nextPage()); + #elif ENABLED(ULTIPANEL) + (*currentScreen)(); #else - #if ENABLED(ULTIPANEL) - (*currentScreen)(); - #else - lcd_status_screen(); - #endif + lcd_status_screen(); #endif } From 9a1dfd0f5f38bce495af27d2e160d91718b799ea Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Jun 2016 14:24:56 -0700 Subject: [PATCH 058/580] Fix Travis test for FILAMENTCHANGEENABLE --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ed31e34e0..15b6991ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -134,7 +134,8 @@ script: # Enable FILAMENTCHANGEENABLE # - restore_configs - - opt_enable FILAMENTCHANGEENABLE ULTIMAKERCONTROLLER + - opt_enable ULTIMAKERCONTROLLER + - opt_enable_adv FILAMENTCHANGEENABLE - build_marlin # # Enable filament sensor From 4fbe8181630f66c7c59fb5966ac57ac78e500de9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Jun 2016 15:35:01 -0700 Subject: [PATCH 059/580] Add macros to move servos --- Marlin/Marlin_main.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4f018c0a8..4fe165e4b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -487,6 +487,11 @@ static bool send_ok[BUFSIZE]; #if HAS_SERVOS Servo servo[NUM_SERVOS]; + #define MOVE_SERVO(I, P) servo[I].move(P) + #define SERVO_ENDSTOP_EXISTS(I) (servo_endstop_id[I] >= 0) + #define MOVE_SERVO_ENDSTOP(I, J) MOVE_SERVO(servo_endstop_id[I], servo_endstop_angle[I][J]) + #define DEPLOY_SERVO_ENDSTOP(I) MOVE_SERVO_ENDSTOP(I, 0) + #define STOW_SERVO_ENDSTOP(I) MOVE_SERVO_ENDSTOP(I, 1) #endif #ifdef CHDK @@ -760,8 +765,8 @@ void servo_init() { * */ for (int i = 0; i < 3; i++) - if (servo_endstop_id[i] >= 0) - servo[servo_endstop_id[i]].move(servo_endstop_angle[i][1]); + if (SERVO_ENDSTOP_EXISTS(i)) + STOW_SERVO_ENDSTOP(i); #endif // HAS_SERVO_ENDSTOPS @@ -1825,7 +1830,8 @@ static void setup_for_endstop_move() { #if ENABLED(HAS_SERVO_ENDSTOPS) // Engage Z Servo endstop if enabled - if (servo_endstop_id[Z_AXIS] >= 0) servo[servo_endstop_id[Z_AXIS]].move(servo_endstop_angle[Z_AXIS][0]); + if (SERVO_ENDSTOP_EXISTS(Z_AXIS) + DEPLOY_SERVO_ENDSTOP(Z_AXIS); #elif ENABLED(Z_PROBE_ALLEN_KEY) feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE; @@ -1921,7 +1927,7 @@ static void setup_for_endstop_move() { #if ENABLED(HAS_SERVO_ENDSTOPS) // Retract Z Servo endstop if enabled - if (servo_endstop_id[Z_AXIS] >= 0) { + if (SERVO_ENDSTOP_EXISTS(Z_AXIS)) { #if Z_RAISE_AFTER_PROBING > 0 if (doRaise) { @@ -1931,7 +1937,7 @@ static void setup_for_endstop_move() { #endif // Change the Z servo angle - servo[servo_endstop_id[Z_AXIS]].move(servo_endstop_angle[Z_AXIS][1]); + STOW_SERVO_ENDSTOP(Z_AXIS); } #elif ENABLED(Z_PROBE_ALLEN_KEY) @@ -2288,8 +2294,8 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(HAS_SERVO_ENDSTOPS) // Engage an X, Y (or Z) Servo endstop if enabled - if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) { - servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][0]); + if (_Z_SERVO_TEST && SERVO_ENDSTOP_EXISTS(axis)) { + DEPLOY_SERVO_ENDSTOP(axis); if (_Z_SERVO_SUBTEST) endstops.z_probe_enabled = true; } #endif @@ -2419,7 +2425,7 @@ static void homeaxis(AxisEnum axis) { // Retract X, Y (or Z) Servo endstop if enabled #if ENABLED(HAS_SERVO_ENDSTOPS) - if (_Z_SERVO_TEST && servo_endstop_id[axis] >= 0) { + if (_Z_SERVO_TEST && SERVO_ENDSTOP_EXISTS(axis)) { // Raise the servo probe before stow outside ABL context. // This is a workaround to allow use of a Servo Probe without // ABL until more global probe handling is implemented. @@ -2438,7 +2444,7 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_ENDSTOPS > Stow with servo.move()"); #endif - servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]); + STOW_SERVO_ENDSTOP(axis); if (_Z_SERVO_SUBTEST) endstops.enable_z_probe(false); } @@ -5673,7 +5679,7 @@ inline void gcode_M226() { if (code_seen('S')) { servo_position = code_value_int(); if (servo_index >= 0 && servo_index < NUM_SERVOS) - servo[servo_index].move(servo_position); + MOVE_SERVO(servo_index, servo_position); else { SERIAL_ERROR_START; SERIAL_ERROR("Servo "); @@ -6680,6 +6686,7 @@ inline void gcode_T(uint8_t tmp_extruder) { offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix)); + // Adjust the current position current_position[X_AXIS] += offset_vec.x; current_position[Y_AXIS] += offset_vec.y; current_position[Z_AXIS] += offset_vec.z; From 811967923ab7c9f1cd3a35c3cccba0903e7e61c4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Jun 2016 16:51:28 -0700 Subject: [PATCH 060/580] Fix manual_move to move the correct E stepper --- Marlin/ultralcd.cpp | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 0fe780919..5d89ed94b 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -91,8 +91,13 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update - int8_t manual_move_axis = (int8_t)NO_AXIS; millis_t manual_move_start_time = 0; + int8_t manual_move_axis = (int8_t)NO_AXIS; + #if EXTRUDERS > 1 + int8_t manual_move_e_index = 0; + #else + #define manual_move_e_index 0 + #endif bool encoderRateMultiplierEnabled; int32_t lastEncoderMovementMillis; @@ -1208,9 +1213,9 @@ static void lcd_status_screen() { if (manual_move_axis != (int8_t)NO_AXIS && millis() >= manual_move_start_time && !planner.is_full()) { #if ENABLED(DELTA) calculate_delta(current_position); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index); #else - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, active_extruder); + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index); #endif manual_move_axis = (int8_t)NO_AXIS; } @@ -1220,7 +1225,14 @@ static void lcd_status_screen() { * Set a flag that lcd_update() should start a move * to "current_position" after a short delay. */ - inline void manual_move_to_current(AxisEnum axis) { + inline void manual_move_to_current(AxisEnum axis + #if EXTRUDERS > 1 + , int8_t eindex=-1 + #endif + ) { + #if EXTRUDERS > 1 + if (axis == E_AXIS) manual_move_e_index = eindex >= 0 ? eindex : active_extruder; + #endif manual_move_start_time = millis() + 500UL; // 1/2 second delay manual_move_axis = (int8_t)axis; } @@ -1259,18 +1271,18 @@ static void lcd_status_screen() { static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); } static void lcd_move_e( #if EXTRUDERS > 1 - uint8_t e + int8_t eindex = -1 #endif ) { ENCODER_DIRECTION_NORMAL(); - #if EXTRUDERS > 1 - unsigned short original_active_extruder = active_extruder; - active_extruder = e; - #endif if (encoderPosition) { current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale; encoderPosition = 0; - manual_move_to_current(E_AXIS); + manual_move_to_current(E_AXIS + #if EXTRUDERS > 1 + , eindex + #endif + ); lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } if (lcdDrawUpdate) { @@ -1292,9 +1304,6 @@ static void lcd_status_screen() { lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS])); } if (LCD_CLICKED) lcd_goto_previous_menu(true); - #if EXTRUDERS > 1 - active_extruder = original_active_extruder; - #endif } #if EXTRUDERS > 1 From 4d2119f83a9578492467d4d7c58707510cd48576 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Jun 2016 16:51:39 -0700 Subject: [PATCH 061/580] _lcd_move => _lcd_move_xyz --- Marlin/ultralcd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 5d89ed94b..0c8ccc07d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1245,7 +1245,7 @@ static void lcd_status_screen() { float move_menu_scale; - static void _lcd_move(const char* name, AxisEnum axis, float min, float max) { + static void _lcd_move_xyz(const char* name, AxisEnum axis, float min, float max) { ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { refresh_cmd_timeout(); @@ -1262,13 +1262,13 @@ static void lcd_status_screen() { #if ENABLED(DELTA) static float delta_clip_radius_2 = (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS); static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); } - static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(sw_endstop_min[X_AXIS], -clip), min(sw_endstop_max[X_AXIS], clip)); } - static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, max(sw_endstop_min[Y_AXIS], -clip), min(sw_endstop_max[Y_AXIS], clip)); } + static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS, max(sw_endstop_min[X_AXIS], -clip), min(sw_endstop_max[X_AXIS], clip)); } + static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS, max(sw_endstop_min[Y_AXIS], -clip), min(sw_endstop_max[Y_AXIS], clip)); } #else - static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, sw_endstop_min[X_AXIS], sw_endstop_max[X_AXIS]); } - static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, sw_endstop_min[Y_AXIS], sw_endstop_max[Y_AXIS]); } + static void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS, sw_endstop_min[X_AXIS], sw_endstop_max[X_AXIS]); } + static void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS, sw_endstop_min[Y_AXIS], sw_endstop_max[Y_AXIS]); } #endif - static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); } + static void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); } static void lcd_move_e( #if EXTRUDERS > 1 int8_t eindex = -1 From 08e2c5a6ea833c90cf563e29fd4a981527ece34b Mon Sep 17 00:00:00 2001 From: Silvio Didonna Date: Mon, 13 Jun 2016 13:04:09 +0200 Subject: [PATCH 062/580] Added and translated some strings from language_en --- Marlin/language_it.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 7fb0bdcf5..a0f78ad67 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -38,12 +38,17 @@ #define WELCOME_MSG MACHINE_NAME " pronto." #define MSG_SD_INSERTED "SD Card inserita" #define MSG_SD_REMOVED "SD Card rimossa" +#define MSG_LCD_ENDSTOPS "Endstop" #define MSG_MAIN "Menu principale" #define MSG_AUTOSTART "Autostart" #define MSG_DISABLE_STEPPERS "Disabilita Motori" #define MSG_AUTO_HOME "Auto Home" +#define MSG_AUTO_HOME_X "Home asse X" +#define MSG_AUTO_HOME_Y "Home asse Y" +#define MSG_AUTO_HOME_Z "Home asse Z" #define MSG_LEVEL_BED_HOMING "Home assi XYZ" #define MSG_LEVEL_BED_WAITING "Premi per Iniziare" +#define MSG_LEVEL_BED_NEXT_POINT "Punto successivo" #define MSG_LEVEL_BED_DONE "Livel. terminato!" #define MSG_LEVEL_BED_CANCEL "Annulla" #define MSG_SET_HOME_OFFSETS "Imp. offset home" @@ -146,6 +151,7 @@ #define MSG_CNG_SDCARD "Cambia SD-Card" #define MSG_ZPROBE_OUT "Z probe out. bed" #define MSG_YX_UNHOMED "Home X/Y prima di Z" +#define MSG_XYZ_UNHOMED "Home XYZ prima" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" From b4fedec0d17e26b5585e55cd1442844872bb3b9f Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 14 Jun 2016 01:59:50 +0200 Subject: [PATCH 063/580] Show bootscreen later Init display and show bootscreen later, but init display in `kill()` to init outputs before the bootscreen delays but being able to display kill errors. --- Marlin/Marlin_main.cpp | 15 +++++++++++++-- Marlin/dogm_lcd_implementation.h | 6 ++---- Marlin/ultralcd.h | 3 +++ Marlin/ultralcd_implementation_hitachi_HD44780.h | 12 +----------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4fe165e4b..dc8cde836 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -857,8 +857,6 @@ void setup() { // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) Config_RetrieveSettings(); - lcd_init(); - thermalManager.init(); // Initialize temperature loop #if ENABLED(DELTA) || ENABLED(SCARA) @@ -906,6 +904,18 @@ void setup() { pinMode(STAT_LED_BLUE, OUTPUT); digitalWrite(STAT_LED_BLUE, LOW); // turn it off #endif + + lcd_init(); + #if ENABLED(SHOW_BOOTSCREEN) + #if ENABLED(DOGLCD) + delay(1000); + #elif ENABLED(ULTRA_LCD) + bootscreen(); + lcd_init(); + #endif + #endif + + } /** @@ -8283,6 +8293,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { void kill(const char* lcd_msg) { #if ENABLED(ULTRA_LCD) + lcd_init(); lcd_setalertstatuspgm(lcd_msg); #else UNUSED(lcd_msg); diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 51ee6e442..5290f8ffd 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -271,10 +271,8 @@ static void lcd_implementation_init() { } } while (u8g.nextPage()); - if (show_bootscreen) { - delay(1000); - show_bootscreen = false; - } + show_bootscreen = false; + #endif } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 707ba8f8c..8e7e2ee5f 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -52,8 +52,11 @@ #if ENABLED(DOGLCD) extern int lcd_contrast; void set_lcd_contrast(int value); + #elif ENABLED(SHOW_BOOTSCREEN) + void bootscreen(); #endif + #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x)) #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x)) diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index d682bfa54..9ca75731c 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -201,11 +201,6 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt #include "utf_mapper.h" -#if ENABLED(SHOW_BOOTSCREEN) - static void bootscreen(); - static bool show_bootscreen = true; -#endif - #if ENABLED(LCD_PROGRESS_BAR) static millis_t progress_bar_ms = 0; #if PROGRESS_MSG_EXPIRE > 0 @@ -394,10 +389,6 @@ static void lcd_implementation_init( lcd.begin(LCD_WIDTH, LCD_HEIGHT); #endif - #if ENABLED(SHOW_BOOTSCREEN) - if (show_bootscreen) bootscreen(); - #endif - lcd_set_custom_characters( #if ENABLED(LCD_PROGRESS_BAR) progress_bar_set @@ -452,8 +443,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); } lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" )); lcd.print('\x03'); } - static void bootscreen() { - show_bootscreen = false; + void bootscreen() { byte top_left[8] = { B00000, B00000, From 2b340f5acb605c9c54c880067742f6a34dec7136 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Jun 2016 18:54:25 -0700 Subject: [PATCH 064/580] patch LIN_ADVANCE to use code_value_float --- Marlin/Marlin_main.cpp | 2 +- Marlin/stepper.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7d7e3cde3..6cd9f863e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -333,7 +333,7 @@ const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'}; static int serial_count = 0; -// GCode parameter pointer used by code_seen(), code_value(), etc. +// GCode parameter pointer used by code_seen(), code_value_float(), etc. static char* seen_pointer; // Next Immediate GCode Command pointer. NULL if none. diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index c9d49cd12..32d0cddad 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1124,7 +1124,7 @@ void Stepper::microstep_readings() { #if ENABLED(LIN_ADVANCE) void Stepper::advance_M905() { - if (code_seen('K')) extruder_advance_k = code_value(); + if (code_seen('K')) extruder_advance_k = code_value_float(); SERIAL_ECHO_START; SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k); SERIAL_EOL; From 8d8180e028825db4f57ceefa46621ea28140fc99 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Jun 2016 19:25:05 -0700 Subject: [PATCH 065/580] Parse M905 args in Marlin_main.cpp --- Marlin/Marlin_main.cpp | 2 +- Marlin/stepper.cpp | 4 ++-- Marlin/stepper.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6cd9f863e..ca1132954 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6491,7 +6491,7 @@ inline void gcode_M503() { */ inline void gcode_M905() { stepper.synchronize(); - stepper.advance_M905(); + stepper.advance_M905(code_seen('K') ? code_value_float() : -1.0); } #endif diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 32d0cddad..8d1fe031e 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1123,8 +1123,8 @@ void Stepper::microstep_readings() { #if ENABLED(LIN_ADVANCE) - void Stepper::advance_M905() { - if (code_seen('K')) extruder_advance_k = code_value_float(); + void Stepper::advance_M905(const float &k) { + if (k >= 0) extruder_advance_k = k; SERIAL_ECHO_START; SERIAL_ECHOPAIR("Advance factor: ", extruder_advance_k); SERIAL_EOL; diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 279db1807..7612e6058 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -256,7 +256,7 @@ class Stepper { } #if ENABLED(LIN_ADVANCE) - void advance_M905(); + void advance_M905(const float &k); FORCE_INLINE int get_advance_k() { return extruder_advance_k; } #endif From ee5be9220698802695b1533b0775c86a18cf1f9e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Jun 2016 20:57:58 -0700 Subject: [PATCH 066/580] Fix broken DISABLE_HEATER macro --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 1d6db5cd4..b80950ffb 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1228,7 +1228,7 @@ void Temperature::disable_all_heaters() { print_job_timer.stop(); #define DISABLE_HEATER(NR) { \ - setTargetHotend(NR, 0); \ + setTargetHotend(0, NR); \ soft_pwm[NR] = 0; \ WRITE_HEATER_ ## NR (LOW); \ } From 02b3d6b8d3d8683a73376ef9f73a7d5e9e7702a7 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 14 Jun 2016 04:02:55 +0200 Subject: [PATCH 067/580] Custom Splash Screen Custom Splash Screen for full graphic displays. Too complicated for the hitachis without knowing what exactly to display. On top of #4032 Realisation of an idea from #3996 --- Marlin/dogm_custom_bitmaps.h | 77 ++++++++++++++++++++++++++++++++ Marlin/dogm_lcd_implementation.h | 11 +++++ 2 files changed, 88 insertions(+) create mode 100644 Marlin/dogm_custom_bitmaps.h diff --git a/Marlin/dogm_custom_bitmaps.h b/Marlin/dogm_custom_bitmaps.h new file mode 100644 index 000000000..4f3030599 --- /dev/null +++ b/Marlin/dogm_custom_bitmaps.h @@ -0,0 +1,77 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * BitMap for custom splashscreen + * Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php + */ + +//#define CUSTOM_START_BMP + +#if ENABLED(CUSTOM_START_BMP) + + #define CUSTOM_START_BMP_DELAY 2000 + #define CUSTOM_START_BMPWIDTH 112 + #define CUSTOM_START_BMPHEIGHT 38 + #define CUSTOM_START_BMPBYTEWIDTH 14 + #define CUSTOM_START_BMPBYTES 532 // CUSTOM_START_BMPWIDTH * CUSTOM_START_BMPHEIGHT / 8 + + const unsigned char custom_start_bmp[CUSTOM_START_BMPBYTES] PROGMEM = { + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x3F, 0xFF, + 0xC0, 0x0F, 0xC0, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x18, 0x00, 0x1F, 0xFF, + 0xC0, 0x3F, 0xE1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x0F, 0xFF, + 0xC0, 0x7F, 0xF3, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x07, 0xFF, + 0xC0, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x03, 0xFF, + 0xC1, 0xF8, 0x7F, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x01, 0xFF, + 0xC1, 0xF0, 0x3F, 0x03, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xFF, + 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x1F, 0x00, 0x03, 0xE0, 0x78, 0x3C, 0x03, 0xF0, 0x7F, + 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x7F, 0xC0, 0x0F, 0xF8, 0x78, 0x3C, 0x07, 0xFC, 0x3F, + 0xC1, 0xE0, 0x1E, 0x01, 0xE1, 0xFF, 0xE0, 0x1F, 0xFC, 0x78, 0x3C, 0x0F, 0xFE, 0x1F, + 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xFF, 0xF0, 0x3F, 0xFE, 0x78, 0x3C, 0x1F, 0xFE, 0x0F, + 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xF3, 0xF8, 0x3F, 0x3E, 0x78, 0x3C, 0x3F, 0x3F, 0x07, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xE0, 0xFC, 0x7C, 0x1F, 0x78, 0x3C, 0x3E, 0x1F, 0x07, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xC0, 0x7C, 0x7C, 0x0F, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x7C, 0x78, 0x0F, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xC0, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xE0, 0x3C, 0x78, 0x00, 0x7C, 0x3C, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xFF, 0x3F, 0xF8, 0x00, 0x7F, 0xBC, 0x3C, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE1, 0xFF, 0x3F, 0xF8, 0x00, 0x3F, 0xBF, 0xFC, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0xFF, 0x3F, 0xF8, 0x00, 0x1F, 0xBF, 0xFC, 0x0F, 0x03, + 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x7F, 0x3F, 0xF8, 0x00, 0x0F, 0xBF, 0xFC, 0x0F, 0x03, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, + 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80 }; +#endif diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 5290f8ffd..08518b69e 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -53,6 +53,8 @@ #include #include "dogm_bitmaps.h" +#include "dogm_custom_bitmaps.h" + #include "ultralcd.h" #include "ultralcd_st7920_u8glib_rrd.h" @@ -247,6 +249,15 @@ static void lcd_implementation_init() { #endif #if ENABLED(SHOW_BOOTSCREEN) + #if ENABLED(CUSTOM_START_BMP) + if (show_bootscreen) { + u8g.firstPage(); + do { + u8g.drawBitmapP((128-(CUSTOM_START_BMPWIDTH))/2, (64 - (CUSTOM_START_BMPHEIGHT))/2, CUSTOM_START_BMPBYTEWIDTH, CUSTOM_START_BMPHEIGHT, custom_start_bmp); + } while (u8g.nextPage()); + delay(CUSTOM_START_BMP_DELAY); + } + #endif int offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2; #if ENABLED(START_BMPHIGH) int offy = 0; From 741cda0e476823f07c88153e30eb536568327083 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Wed, 15 Jun 2016 00:10:15 +0900 Subject: [PATCH 068/580] =?UTF-8?q?Follow-up=20the=20PR=20#3676(Advance=20?= =?UTF-8?q?extrusion=20algorithm=20=E2=80=93=20LIN=5FADVANCE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update forgotten example configurations --- Marlin/example_configurations/Felix/Configuration_adv.h | 9 +++++++++ .../example_configurations/Hephestos/Configuration_adv.h | 9 +++++++++ .../Hephestos_2/Configuration_adv.h | 9 +++++++++ Marlin/example_configurations/K8200/Configuration_adv.h | 9 +++++++++ .../example_configurations/RigidBot/Configuration_adv.h | 9 +++++++++ Marlin/example_configurations/SCARA/Configuration_adv.h | 9 +++++++++ Marlin/example_configurations/TAZ4/Configuration_adv.h | 9 +++++++++ Marlin/example_configurations/WITBOX/Configuration_adv.h | 9 +++++++++ .../delta/biv2.5/Configuration_adv.h | 9 +++++++++ .../delta/generic/Configuration_adv.h | 9 +++++++++ .../delta/kossel_mini/Configuration_adv.h | 9 +++++++++ .../delta/kossel_pro/Configuration_adv.h | 9 +++++++++ .../delta/kossel_xl/Configuration_adv.h | 9 +++++++++ .../example_configurations/makibox/Configuration_adv.h | 9 +++++++++ .../tvrrug/Round2/Configuration_adv.h | 9 +++++++++ 15 files changed, 135 insertions(+) diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index b22bf9591..59254668e 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 9a89097d9..bf7e007d3 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 1.75 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index bebd94b89..37d00e46f 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index c5e9249c4..17a88f083 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -451,6 +451,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 50d8cb51d..1ab7d61a8 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 1.75 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index f3ba7282b..18afdbeb4 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 1.75 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 5aa9487e9..58b64c65c 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -453,6 +453,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 9a89097d9..bf7e007d3 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 1.75 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 627188d92..2d0ec2467 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -447,6 +447,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index d64dfd5f3..b96525162 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -447,6 +447,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index f99318ea3..73d422919 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -446,6 +446,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 3250e88ff..c91795475 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -451,6 +451,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index f0ccba6a4..0fd30c19e 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -447,6 +447,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index d8ef5d30c..2cca1a4a0 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index af2d22f9c..589fc19ff 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -445,6 +445,15 @@ #define D_FILAMENT 2.85 #endif +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + // @section leveling // Default mesh area is an area with an inset margin on the print area. From c2b7ef1e7ed3152edfd8a23b198b06922bbbe38c Mon Sep 17 00:00:00 2001 From: Alexander Leisentritt Date: Wed, 15 Jun 2016 11:11:16 +0200 Subject: [PATCH 069/580] "e" was renamed to "eindex" in a previous commit --- Marlin/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 0c8ccc07d..a9f8aaa58 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1290,7 +1290,7 @@ static void lcd_status_screen() { #if EXTRUDERS == 1 pos_label = PSTR(MSG_MOVE_E); #else - switch (e) { + switch (eindex) { case 0: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; #if EXTRUDERS > 2 From 44f091a41360bb6c2aeeee0c09eff488c1f33e16 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Wed, 15 Jun 2016 22:34:21 +0900 Subject: [PATCH 070/580] Fix for the PR #4023(Add macros to move servos) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Add missing ')' --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7ae1a6831..0f9ebe2a5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1840,7 +1840,7 @@ static void setup_for_endstop_move() { #if ENABLED(HAS_SERVO_ENDSTOPS) // Engage Z Servo endstop if enabled - if (SERVO_ENDSTOP_EXISTS(Z_AXIS) + if (SERVO_ENDSTOP_EXISTS(Z_AXIS)) DEPLOY_SERVO_ENDSTOP(Z_AXIS); #elif ENABLED(Z_PROBE_ALLEN_KEY) From 121931062219467cada6ed2470644b799ff7db2d Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 15 Jun 2016 18:11:55 +0200 Subject: [PATCH 071/580] Introduce save_delay() Introduce save_delay() for long delays what otherwise would cause watchdog resets Explizit lcd_set_custom_characters(false) at the end of bootscreen(). Else the charset is not proper set in case of LCD_PROGRESS_BAR. --- .../ultralcd_implementation_hitachi_HD44780.h | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 9ca75731c..24b68830d 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -443,6 +443,15 @@ unsigned lcd_print(char c) { return charset_mapper(c); } lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" )); lcd.print('\x03'); } + void safe_delay(uint16_t del){ + while (del > 50) { + del -= 50; + delay(50); + thermalManager.manage_heater(); + } + delay(del); + } + void bootscreen() { byte top_left[8] = { B00000, @@ -498,7 +507,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); } if (strlen(STRING) <= LCD_WIDTH) { \ lcd.setCursor((LCD_WIDTH - lcd_strlen_P(PSTR(STRING))) / 2, 3); \ lcd_printPGM(PSTR(STRING)); \ - delay(DELAY); \ + safe_delay(DELAY); \ } \ else { \ lcd_scroll(0, 3, PSTR(STRING), LCD_WIDTH, DELAY); \ @@ -516,7 +525,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); } #ifdef STRING_SPLASH_LINE2 CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000); #else - delay(2000); + safe_delay(2000); #endif } else { @@ -541,7 +550,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); } // if (LCD_EXTRA_SPACE >= strlen(STRING_SPLASH_LINE2) + 1) { logo_lines(PSTR(" " STRING_SPLASH_LINE2)); - delay(2000); + safe_delay(2000); } else { logo_lines(PSTR("")); @@ -552,9 +561,13 @@ unsigned lcd_print(char c) { return charset_mapper(c); } // Show only the Marlin logo // logo_lines(PSTR("")); - delay(2000); + safe_delay(2000); #endif - + lcd_set_custom_characters( + #if ENABLED(LCD_PROGRESS_BAR) + false + #endif + ); } #endif // SHOW_BOOTSCREEN From 9c800d1f8c01ba3a2ddbe38ba01f99875ab2234f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Jun 2016 12:59:44 -0700 Subject: [PATCH 072/580] Position adjustment for bed leveling --- Marlin/Marlin_main.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ca1132954..0dc8d2a6c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6684,6 +6684,35 @@ inline void gcode_T(uint8_t tmp_extruder) { } // No extra case for AUTO_BED_LEVELING_FEATURE in DUAL_X_CARRIAGE. Does that mean they don't work together? #else // !DUAL_X_CARRIAGE + + // + // Set current_position to the position of the new nozzle. + // Offsets are based on linear distance, so we need to get + // the resulting position in coordinate space. + // + // - With grid or 3-point leveling, offset XYZ by a tilted vector + // - With mesh leveling, update Z for the new position + // - Otherwise, just use the raw linear distance + // + // Software endstops are altered here too. Consider a case where: + // E0 at X=0 ... E1 at X=10 + // When we switch to E1 now X=10, but E1 can't move left. + // To express this we apply the change in XY to the software endstops. + // E1 can move farther right than E0, so the right limit is extended. + // + // Note that we don't adjust the Z software endstops. Why not? + // Consider a case where Z=0 (here) and switching to E1 makes Z=1 + // because the bed is 1mm lower at the new position. As long as + // the first nozzle is out of the way, the carriage should be + // allowed to move 1mm lower. This technically "breaks" the + // Z software endstop. But this is technically correct (and + // there is no viable alternative). + // + float xydiff[2] = { + hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], + hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder] + }; + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // Offset extruder, make sure to apply the bed level rotation matrix vector_3 tmp_offset_vec = vector_3(hotend_offset[X_AXIS][tmp_extruder], @@ -6731,6 +6760,17 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif // !AUTO_BED_LEVELING_FEATURE + // The newly-selected extruder XY is actually at... + current_position[X_AXIS] += xydiff[X_AXIS]; + current_position[Y_AXIS] += xydiff[Y_AXIS]; + + #endif // no bed leveling + + for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) { + position_shift[i] += xydiff[i]; + update_software_endstops((AxisEnum)i); + } + // Set the new active extruder active_extruder = tmp_extruder; From 4b93989a77f78dd049377cb362f7c4ef22f6b2e4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Jun 2016 13:00:30 -0700 Subject: [PATCH 073/580] MBL Z adjustment on toolchange --- Marlin/Marlin_main.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0dc8d2a6c..300a69e1a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6748,17 +6748,15 @@ inline void gcode_T(uint8_t tmp_extruder) { } #endif - #else // !AUTO_BED_LEVELING_FEATURE - - // The newly-selected extruder is actually at... - for (int i=X_AXIS; i<=Y_AXIS; i++) { - float diff = hotend_offset[i][tmp_extruder] - hotend_offset[i][active_extruder]; - current_position[i] += diff; - position_shift[i] += diff; // Offset the coordinate space - update_software_endstops((AxisEnum)i); + #elif ENABLED(MESH_BED_LEVELING) + + if (mbl.active()) { + float xpos = current_position[X_AXIS] - home_offset[X_AXIS], + ypos = current_position[Y_AXIS] - home_offset[Y_AXIS]; + current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos); } - #endif // !AUTO_BED_LEVELING_FEATURE + #else // no bed leveling // The newly-selected extruder XY is actually at... current_position[X_AXIS] += xydiff[X_AXIS]; From 4d2cb70152df07912374fdeba3c83862f90e71e4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 15 Jun 2016 21:38:52 -0700 Subject: [PATCH 074/580] Cartesio UI Support --- Marlin/Conditionals.h | 9 + Marlin/boards.h | 1 + Marlin/dogm_lcd_implementation.h | 3 + .../Cartesio/Configuration.h | 1205 +++++++++++++++++ .../Cartesio/Configuration_adv.h | 719 ++++++++++ Marlin/pins.h | 2 + Marlin/pins_CNCONTROLS_12.h | 108 ++ 7 files changed, 2047 insertions(+) create mode 100644 Marlin/example_configurations/Cartesio/Configuration.h create mode 100644 Marlin/example_configurations/Cartesio/Configuration_adv.h create mode 100644 Marlin/pins_CNCONTROLS_12.h diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index ac15968b4..3ccfe57f7 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -47,6 +47,15 @@ #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)) + #if ENABLED(CARTESIO_UI) + #define DOGLCD + #define ULTIPANEL + #define NEWPANEL + #define DEFAULT_LCD_CONTRAST 90 + #define LCD_CONTRAST_MIN 60 + #define LCD_CONTRAST_MAX 140 + #endif + #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL) #define DOGLCD #define ULTIPANEL diff --git a/Marlin/boards.h b/Marlin/boards.h index 3602e6e87..e85e68284 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -29,6 +29,7 @@ #define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2 #define BOARD_GEN7_13 12 // Gen7 v1.3 #define BOARD_GEN7_14 13 // Gen7 v1.4 +#define BOARD_CNCONTROLS_12 112 // Cartesio CN Controls V12 #define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0 #define BOARD_SETHI 20 // Sethi 3D_1 #define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2 diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 08518b69e..a992eb848 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -141,6 +141,9 @@ #if ENABLED(U8GLIB_ST7920) //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); U8GLIB_ST7920_128X64_RRD u8g(0); +#elif defined(CARTESIO_UI) + // The CartesioUI display with SW-SPI + U8GLIB_DOGM128 u8g(DOGLCD_sck, DOGLCD_mosi, DOGLCD_cs, DOGLCD_a0); #elif ENABLED(U8GLIB_LM6059_AF) // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0); diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h new file mode 100644 index 000000000..0830692f4 --- /dev/null +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -0,0 +1,1205 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration.h + * + * Basic settings such as: + * + * - Type of electronics + * - Type of temperature sensor + * - Printer geometry + * - Endstop configuration + * - LCD controller + * - Extra features + * + * Advanced settings can be found in Configuration_adv.h + * + */ +#ifndef CONFIGURATION_H +#define CONFIGURATION_H + +#include "boards.h" +#include "macros.h" + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer replace the configuration files with the files in the +// example_configurations/delta directory. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a Scara printer replace the configuration files with the files in the +// example_configurations/SCARA directory. +// + +// @section info + +#if ENABLED(USE_AUTOMATIC_VERSIONING) + #include "_Version.h" +#else + #include "Version.h" +#endif + +// User-specified version info of this build to display in [Pronterface, etc] terminal window during +// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this +// build by the user have been successfully uploaded into firmware. +#define STRING_CONFIG_H_AUTHOR "(MaukCC, CartesioE)" // Who made the changes. +#define SHOW_BOOTSCREEN +#define STRING_SPLASH_LINE1 "Cartesio" // will be shown during bootup in line1 +#define STRING_SPLASH_LINE2 "Marlin " SHORT_BUILD_VERSION // will be shown during bootup in line 2 + +// @section machine + +// SERIAL_PORT selects which serial port should be used for communication with the host. +// This allows the connection of wireless adapters (for instance) to non-default port pins. +// Serial port 0 is still used by the Arduino bootloader regardless of this setting. +// :[0,1,2,3,4,5,6,7] +#define SERIAL_PORT 0 + +// This determines the communication speed of the printer +// :[2400,9600,19200,38400,57600,115200,250000] +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// The following define selects which electronics board you have. +// Please choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_CNCONTROLS_12 +#endif + +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +#define CUSTOM_MACHINE_NAME "CartesioE" + +// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) +// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// This defines the number of extruders +// :[1,2,3,4] +#define EXTRUDERS 3 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis + +//// The following define selects which power supply you have. Please choose the one that matches your setup +// 1 = ATX +// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) +// :{1:'ATX',2:'X-Box 360'} + +#define POWER_SUPPLY 1 + +// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. +//#define PS_DEFAULT_OFF + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== +// +//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table +// +//// Temperature sensor settings: +// -3 is thermocouple with MAX31855 (only for sensor 0) +// -2 is thermocouple with MAX6675 (only for sensor 0) +// -1 is thermocouple with AD595 +// 0 is not used +// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup) +// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) +// 3 is Mendel-parts thermistor (4.7k pullup) +// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! +// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) +// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) +// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) +// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) +// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) +// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) +// 10 is 100k RS thermistor 198-961 (4.7k pullup) +// 11 is 100k beta 3950 1% thermistor (4.7k pullup) +// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 20 is the PT100 circuit found in the Ultimainboard V2.x +// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 70 is the 100K thermistor found in the bq Hephestos 2 +// +// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k +// (but gives greater accuracy and more stable PID) +// 51 is 100k thermistor - EPCOS (1k pullup) +// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup) +// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) +// +// 1047 is Pt1000 with 4k7 pullup +// 1010 is Pt1000 with 1k pullup (non standard) +// 147 is Pt100 with 4k7 pullup +// 110 is Pt100 with 1k pullup (non standard) +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// Use it for Testing or Development purposes. NEVER for production machine. +//#define DUMMY_THERMISTOR_998_VALUE 25 +//#define DUMMY_THERMISTOR_999_VALUE 100 +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +#define TEMP_SENSOR_0 -1 +#define TEMP_SENSOR_1 -1 +#define TEMP_SENSOR_2 1 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_BED 1 + +// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +// Extruder temperature must be close to target for this long before M109 returns success +#define TEMP_RESIDENCY_TIME 4 // (seconds) +#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// Bed temperature must be close to target for this long before M190 returns success +#define TEMP_BED_RESIDENCY_TIME 1 // (seconds) +#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// The minimal temperature defines the temperature below which the heater will not be enabled It is used +// to check that the wiring to the thermistor is not broken. +// Otherwise this would lead to the heater being powered on all the time. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define BED_MINTEMP 5 + +// When temperature exceeds max temp, your heater will be switched off. +// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +// You should use MINTEMP for thermistor short/failure protection. +#define HEATER_0_MAXTEMP 415 +#define HEATER_1_MAXTEMP 415 +#define HEATER_2_MAXTEMP 415 +#define HEATER_3_MAXTEMP 415 +#define BED_MAXTEMP 165 + +// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#if ENABLED(PIDTEMP) + //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term + #define K1 0.95 //smoothing factor within the PID + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Cartesio extruderV6 40W Normal + #define DEFAULT_Kp 18 + #define DEFAULT_Ki 1 + #define DEFAULT_Kd 100 + + // Cartesio extruderV6 40W Volcano + //#define DEFAULT_Kp 50 + //#define DEFAULT_Ki 9 + //#define DEFAULT_Kd 70 + + // Cartesio extruderV6 40W Cyclops + //#define DEFAULT_Kp 18 + //#define DEFAULT_Ki 1 + //#define DEFAULT_Kd 100 + +#endif // PIDTEMP + +//=========================================================================== +//============================= PID > Bed Temperature Control =============== +//=========================================================================== +// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis +// +// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, +// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. +// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. +// If your configuration is significantly different than this and you don't understand the issues involved, you probably +// shouldn't use bed PID until someone else verifies your hardware works. +// If this is enabled, find your own PID constants below. +#define PIDTEMPBED + +//#define BED_LIMIT_SWITCHING + +// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option. +// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis) +// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did, +// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED) +#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current + +#if ENABLED(PIDTEMPBED) + + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term + + //24V 500W silicone heater on to 4mm glass CartesioW + #define DEFAULT_bedKp 390 + #define DEFAULT_bedKi 70 + #define DEFAULT_bedKd 546 + + //24V 250W silicone heater on to 4mm glass CartesioM + //#define DEFAULT_bedKp 303 + //#define DEFAULT_bedKi 42 + //#define DEFAULT_bedKd 539 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit +//can be software-disabled for whatever purposes by +#define PREVENT_DANGEROUS_EXTRUDE +//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately. +#define PREVENT_LENGTHY_EXTRUDE + +#define EXTRUDE_MINTEMP 18 +#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances. + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection protects your printer from damage and fire if a + * thermistor falls out or temperature sensors fail in any way. + * + * The issue: If a thermistor falls out or a temperature sensor fails, + * Marlin can no longer sense the actual temperature. Since a disconnected + * thermistor reads as a low temperature, the firmware will keep the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +//#define COREXY +//#define COREXZ +//#define COREYZ + +// Enable this option for Toshiba steppers +//#define CONFIG_STEPPERS_TOSHIBA + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + +#if DISABLED(ENDSTOPPULLUPS) + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. + +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== + +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + +// Probe Raise options provide clearance for the probe to deploy and stow. +// For G28 these apply when the probe deploys and stows. +// For G29 these apply before and after the full procedure. +#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). +#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{0:'Low',1:'High'} +#define X_ENABLE_ON 1 +#define Y_ENABLE_ON 1 +#define Z_ENABLE_ON 1 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false + +// @section homing +//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure you have this distance over your Z_MAX_POS in case. + +// ENDSTOP SETTINGS: +// Sets direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. +#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. + +// @section machine + +// Travel limits after homing (units are in mm) +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS 435 +#define Y_MAX_POS 270 +#define Z_MAX_POS 400 + +//=========================================================================== +//========================= Filament Runout Sensor ========================== +//=========================================================================== +//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament + // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. + // It is assumed that when logic high = filament available + // when logic low = filament ran out +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + +//=========================================================================== +//============================ Mesh Bed Leveling ============================ +//=========================================================================== + +//#define MESH_BED_LEVELING // Enable mesh bed leveling. + +#if ENABLED(MESH_BED_LEVELING) + #define MESH_INSET 10 // Mesh inset margin on print area + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_Y_POINTS 3 + #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0] + + //#define MANUAL_BED_LEVELING // Add display menu option for bed leveling. + + #if ENABLED(MANUAL_BED_LEVELING) + #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. + #endif // MANUAL_BED_LEVELING + +#endif // MESH_BED_LEVELING + +//=========================================================================== +//============================ Bed Auto Leveling ============================ +//=========================================================================== + +// @section bedlevel + +//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) +//#define DEBUG_LEVELING_FEATURE +#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. + +#if ENABLED(AUTO_BED_LEVELING_FEATURE) + + // There are 2 different ways to specify probing locations: + // + // - "grid" mode + // Probe several points in a rectangular grid. + // You specify the rectangle and the density of sample points. + // This mode is preferred because there are more measurements. + // + // - "3-point" mode + // Probe 3 arbitrary points on the bed (that aren't collinear) + // You specify the XY coordinates of all 3 points. + + // Enable this to sample the bed in a grid (least squares solution). + // Note: this feature generates 10KB extra code size. + #define AUTO_BED_LEVELING_GRID + + #if ENABLED(AUTO_BED_LEVELING_GRID) + + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this. + + // Set the number of grid points per dimension. + // You probably don't need more than 3 (squared=9). + #define AUTO_BED_LEVELING_GRID_POINTS 2 + + #else // !AUTO_BED_LEVELING_GRID + + // Arbitrary points to probe. + // A simple cross-product is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 15 + #define ABL_PROBE_PT_1_Y 180 + #define ABL_PROBE_PT_2_X 15 + #define ABL_PROBE_PT_2_Y 20 + #define ABL_PROBE_PT_3_X 170 + #define ABL_PROBE_PT_3_Y 20 + + #endif // !AUTO_BED_LEVELING_GRID + + // Z Probe to nozzle (X,Y) offset, relative to (0, 0). + // X and Y offsets must be integers. + // + // In the following example the X and Y offsets are both positive: + // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + // + // +-- BACK ---+ + // | | + // L | (+) P | R <-- probe (20,20) + // E | | I + // F | (-) N (+) | G <-- nozzle (10,10) + // T | | H + // | (-) | T + // | | + // O-- FRONT --+ + // (0,0) + #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + + #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + + #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. + + //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. + // Useful to retract a deployable Z probe. + + // Probes are sensors/switches that need to be activated before they can be used + // and deactivated after their use. + // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE + + // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER + // when the hardware endstops are active. + //#define FIX_MOUNTED_PROBE + + // A Servo Probe can be defined in the servo section below. + + // An Allen Key Probe is currently predefined only in the delta example configurations. + + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. + //#define Z_PROBE_SLED + //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + + // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment + // For example any setup that uses the nozzle itself as a probe. + //#define MECHANICAL_PROBE + + // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, + // it is highly recommended you also enable Z_SAFE_HOMING below! + +#endif // AUTO_BED_LEVELING_FEATURE + + +// @section homing + +// The position of the homing switches +//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used +//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) + +// Manual homing switch locations: +// For deltabots this means top and center of the Cartesian print volume. +#if ENABLED(MANUAL_HOME_POSITIONS) + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). +#endif + + +// @section movement + +/** + * MOVEMENT SETTINGS + */ + +#define HOMING_FEEDRATE {3000, 3000, 600, 20} // set the homing speeds (mm/min) + +// default settings + +#define DEFAULT_AXIS_STEPS_PER_UNIT {71.128,71.128,640,152} +#define DEFAULT_MAX_FEEDRATE {200,200,20,20} // (mm/sec) +#define DEFAULT_MAX_ACCELERATION {1000,1000,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. + +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 10000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + +// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) +#define DEFAULT_XYJERK 10.0 // (mm/sec) +#define DEFAULT_ZJERK 0.4 // (mm/sec) +#define DEFAULT_EJERK 5.0 // (mm/sec) + + +//============================================================================= +//============================= Additional Features =========================== +//============================================================================= + +// @section more + +// Custom M code points +#define CUSTOM_M_CODES +#if ENABLED(CUSTOM_M_CODES) + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #define Z_PROBE_OFFSET_RANGE_MAX 20 + #endif +#endif + +// @section extras + +// +// EEPROM +// +// The microcontroller can store settings in the EEPROM, e.g. max velocity... +// M500 - stores parameters in EEPROM +// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). +// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. +//define this to enable EEPROM support +//#define EEPROM_SETTINGS + +#if ENABLED(EEPROM_SETTINGS) + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // Please keep turned on if you can. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PLA_PREHEAT_HOTEND_TEMP 190 +#define PLA_PREHEAT_HPB_TEMP 50 +#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 + +#define ABS_PREHEAT_HOTEND_TEMP 240 +#define ABS_PREHEAT_HPB_TEMP 110 +#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 + +// +// Print job timer +// +// Enable this option to automatically start and stop the +// print job timer when M104 and M109 commands are received. +// +// In all cases the timer can be started and stopped using +// the following commands: +// +// - M75 - Start the print job timer +// - M76 - Pause the print job timer +// - M77 - Stop the print job timer +#define PRINTJOB_TIMER_AUTOSTART + +// +// Print Counter +// +// When enabled Marlin will keep track of some print statistical data such as: +// - Total print jobs +// - Total successful print jobs +// - Total failed print jobs +// - Total time printing +// +// This information can be viewed by the M78 command. +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +// +// LCD LANGUAGE +// +// Here you may choose the language used by Marlin on the LCD menus, the following +// list of languages are available: +// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, +// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// +#define LCD_LANGUAGE en + +// +// LCD Character Set +// +// Note: This option is NOT applicable to Graphical Displays. +// +// All character-based LCD's provide ASCII plus one of these +// language extensions: +// +// - JAPANESE ... the most common +// - WESTERN ... with more accented characters +// - CYRILLIC ... for the Russian language +// +// To determine the language extension installed on your controller: +// +// - Compile and upload with LCD_LANGUAGE set to 'test' +// - Click the controller to view the LCD menu +// - The LCD will display Japanese, Western, or Cyrillic text +// +// See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language +// +// :['JAPANESE','WESTERN','CYRILLIC'] +// +#define DISPLAY_CHARSET_HD44780 JAPANESE + +// +// LCD TYPE +// +// You may choose ULTRA_LCD if you have character based LCD with 16x2, 16x4, 20x2, +// 20x4 char/lines or DOGLCD for the full graphics display with 128x64 pixels +// (ST7565R family). (This option will be set automatically for certain displays.) +// +// IMPORTANT NOTE: The U8glib library is required for Full Graphic Display! +// https://github.com/olikraus/U8glib_Arduino +// +//#define ULTRA_LCD // Character based +//#define DOGLCD // Full graphics display + +// +// SD CARD +// +// SD Card support is disabled by default. If your controller has an SD slot, +// you must uncomment the following option or it won't work. +// +#define SDSUPPORT + +// +// SD CARD: SPI SPEED +// +// Uncomment ONE of the following items to use a slower SPI transfer +// speed. This is usually required if you're getting volume init errors. +// +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +// +// SD CARD: ENABLE CRC +// +// Use CRC checks and retries on the SD communication. +// +//#define SD_CHECK_AND_RETRY + +// +// ENCODER SETTINGS +// +// This option overrides the default number of encoder pulses needed to +// produce one step. Should be increased for high-resolution encoders. +// +#define ENCODER_PULSES_PER_STEP 2 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 +#define LCD_FEEDBACK_FREQUENCY_HZ 1000 + +// +// CONTROLLER TYPE: Standard +// +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. +// + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +#define CARTESIO_UI + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// MaKr3d Makr-Panel with graphic controller and SD support. +// http://reprap.org/wiki/MaKr3d_MaKrPanel +// +//#define MAKRPANEL + +// +// Activate one of these if you have a Panucatt Devices +// Viki 2.0 or mini Viki with Graphic LCD +// http://panucatt.com +// +//#define VIKI2 +//#define miniVIKI + +// +// Adafruit ST7565 Full Graphic Controller. +// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ +// +//#define ELB_FULL_GRAPHIC_CONTROLLER + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + +// +// MakerLab Mini Panel with graphic +// controller and SD support - http://reprap.org/wiki/Mini_panel +// +//#define MINIPANEL + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key +// is pressed, a value of 10.0 means 10mm per click. +// +#define REPRAPWORLD_KEYPAD +#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#define RIGIDBOT_PANEL + +// +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. +// +//#define BQ_LCD_SMART_CONTROLLER + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart YW Robot (LCM1602) LCD Display +// +//#define LCD_I2C_SAINSMART_YWROBOT + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + //#define U8GLIB_SSD1306 + #define U8GLIB_SH1106 +#endif + +// +// CONTROLLER TYPE: Shift register panels +// +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +#define SOFT_PWM_SCALE 0 + +// Temperature status LEDs that display the hotend and bet temperature. +// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. +// Otherwise the RED led is on. There is 1C hysteresis. +#define TEMP_STAT_LEDS + +// M240 Triggers a camera by emulating a Canon RC-1 Remote +// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ +//#define PHOTOGRAPH_PIN 23 + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder. +//#define BARICUDA + +//define BlinkM/CyzRgb Support +//#define BLINKM + +/*********************************************************************\ +* R/C SERVO support +* Sponsored by TrinityLabs, Reworked by codexmas +**********************************************************************/ + +// Number of servos +// +// If you select a configuration below, this will receive a default value and does not need to be set manually +// set it manually if you have more servos than extruders and wish to manually control some +// leaving it undefined or defining as 0 will disable the servo subsystem +// If unsure, leave commented / disabled +// +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// Servo Endstops +// +// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. +// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. +// +//#define X_ENDSTOP_SERVO_NR 1 +//#define Y_ENDSTOP_SERVO_NR 2 +//#define Z_ENDSTOP_SERVO_NR 0 +//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles + +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + +/**********************************************************************\ + * Support for a filament diameter sensor + * Also allows adjustment of diameter at print time (vs at slicing) + * Single extruder only at this point (extruder 0) + * + * Motherboards + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 - Rambo - uses Analog input 3 + * Note may require analog pins to be defined for different motherboards + **********************************************************************/ +// Uncomment below to enable +//#define FILAMENT_WIDTH_SENSOR + +#define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) + #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel + + #define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm + #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm + #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially + + //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. + //#define FILAMENT_LCD_DISPLAY +#endif + +#include "Configuration_adv.h" +#include "thermistortables.h" + +#endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h new file mode 100644 index 000000000..4b7765e12 --- /dev/null +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -0,0 +1,719 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#ifndef CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H + +#include "Conditionals.h" + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection protects your printer from damage and fire if a + * thermistor falls out or temperature sensors fail in any way. + * + * The issue: If a thermistor falls out or a temperature sensor fails, + * Marlin can no longer sense the actual temperature. Since a disconnected + * thermistor reads as a low temperature, the firmware will keep the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too long (period), + * the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway" increase THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + /** + * Whenever an M104 or M109 increases the target temperature the firmware will wait for the + * WATCH_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE + * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, + * but only if the current temperature is far enough below the target for a reliable test. + * + * If you get false positives for "Heating failed" increase WATCH_TEMP_PERIOD and/or decrease WATCH_TEMP_INCREASE + * WATCH_TEMP_INCREASE should not be below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * Whenever an M140 or M190 increases the target temperature the firmware will wait for the + * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE + * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190, + * but only if the current temperature is far enough below the target for a reliable test. + * + * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease + * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.) + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // this adds an experimental additional term to the heating power, proportional to the extrusion speed. + // if Kc is chosen well, the additional required power due to increased melting should be compensated. + #define PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +//Show Temperature ADC value +//The M105 command return, besides traditional information, the ADC value read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +// @section extruder + +// extruder run-out prevention. +//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded +//#define EXTRUDER_RUNOUT_PREVENT +#define EXTRUDER_RUNOUT_MINTEMP 190 +#define EXTRUDER_RUNOUT_SECONDS 30. +#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament +#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_EXTRUDE 100 + +// @section temperature + +//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. +//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" +#define TEMP_SENSOR_AD595_OFFSET 3.0 +#define TEMP_SENSOR_AD595_GAIN 2.0 + +//This is for controlling a fan to cool down the stepper drivers +//it will turn on when any driver is enabled +//and turn off after the set amount of seconds from last driver being disabled again +#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable) +#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run +#define CONTROLLERFAN_SPEED 255 // == full speed + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// This defines the minimal speed for the main fan, run in PWM mode +// to enable uncomment and set minimal PWM speed for reliable running (1-255) +// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +//#define FAN_MIN_PWM 50 + +// @section extruder + +// Extruder cooling fans +// Configure fan pin outputs to automatically turn on/off when the associated +// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. +// Multiple extruders can be assigned to the same pin in which case +// the fan will turn on when any selected extruder is above the threshold. +#define EXTRUDER_0_AUTO_FAN_PIN 7 +#define EXTRUDER_1_AUTO_FAN_PIN 7 +#define EXTRUDER_2_AUTO_FAN_PIN -1 +#define EXTRUDER_3_AUTO_FAN_PIN -1 +#define EXTRUDER_AUTO_FAN_TEMPERATURE 35 +#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed + + +//=========================================================================== +//=============================Mechanical Settings=========================== +//=========================================================================== + +// @section homing + +#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// A single Z stepper driver is usually used to drive 2 stepper motors. +// Uncomment this define to utilize a separate stepper driver for each Z axis motor. +// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used +// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. +// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +//#define Z_DUAL_STEPPER_DRIVERS + +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + //#define Z_DUAL_ENDSTOPS + + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + +// Same again but for Y Axis. +//#define Y_DUAL_STEPPER_DRIVERS + +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Define if the two Y drives need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + +// Enable this for dual x-carriage printers. +// A dual x-carriage design has the advantage that the inactive extruder can be parked which +// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage +// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug. +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif //DUAL_X_CARRIAGE + +// @section homing + +//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. + +// When G28 is called, this option will make Y home before X +#define HOME_Y_BEFORE_X + +// @section machine + +#define AXIS_RELATIVE_MODES {false, false, false, false} + +//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +// @section lcd + +#if ENABLED(ULTIPANEL) + #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel + #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder +#endif + +// @section extras + +// minimum time in microseconds that a movement needs to take if the buffer is emptied. +#define DEFAULT_MINSEGMENTTIME 20000 + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec) + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] + +// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards) +#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) + +// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current) +//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps + +// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro +//#define DIGIPOT_I2C +// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8 +#define DIGIPOT_I2C_NUM_CHANNELS 8 +// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS +#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value + +//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ +#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again + +// @section lcd + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. + + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #if ENABLED(LCD_PROGRESS_BAR) + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // This option allows you to abort SD printing when any endstop is triggered. + // This feature must be enabled with "M540 S1" or from the LCD menu. + // To have any effect, endstops must be enabled during SD printing. + // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. + //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + +#endif // SDSUPPORT + +// for dogm lcd displays you can choose some additional fonts: +#if ENABLED(DOGLCD) + // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT + // we don't have a big font for Cyrillic, Kana + //#define USE_BIG_EDIT_FONT + + // If you have spare 2300Byte of progmem and want to use a + // smaller font on the Info-screen uncomment the next line. + //#define USE_SMALL_INFOFONT +#endif // DOGLCD + +// @section more + +// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +#define USE_WATCHDOG + +#if ENABLED(USE_WATCHDOG) + // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. + // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. + // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process +// it can e.g. be used to change z-positions in the print startup phase in real-time +// does not respect endstops! +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions + //not implemented for deltabots! + #define BABYSTEP_INVERT_Z false //true for inverse movements in Z + #define BABYSTEP_MULTIPLICATOR 1 //faster movements +#endif + +// @section extruder + +// extruder advance constant (s2/mm3) +// +// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 +// +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// so: v ^ 2 is proportional to number of steps we advance the extruder +//#define ADVANCE + +#if ENABLED(ADVANCE) + #define EXTRUDER_ADVANCE_K .0 + #define D_FILAMENT 2.85 +#endif + +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + +// @section leveling + +// Default mesh area is an area with an inset margin on the print area. +// Below are the macros that are used to define the borders for the mesh area, +// made available here for specialized needs, ie dual extruder setup. +#if ENABLED(MESH_BED_LEVELING) + #define MESH_MIN_X (X_MIN_POS + MESH_INSET) + #define MESH_MAX_X (X_MAX_POS - (MESH_INSET)) + #define MESH_MIN_Y (Y_MIN_POS + MESH_INSET) + #define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET)) +#endif + +// @section extras + +// Arc interpretation settings: +#define ARC_SUPPORT // Disabling this saves ~2738 bytes +#define MM_PER_ARC_SEGMENT 1 +#define N_ARC_CORRECTION 25 + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// 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 ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section more + +//The ASCII buffer for receiving from the serial: +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// @section fwretract + +// Firmware based and LCD controlled retract +// M207 and M208 can be used to define parameters for the retraction. +// The retraction can be called by the slicer using G10 and G11 +// until then, intended retractions can be detected by moves that only extrude and the direction. +// the moves are than replaced by the firmware controlled ones. + +//#define FWRETRACT //ONLY PARTIALLY TESTED +#if ENABLED(FWRETRACT) + #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt + #define RETRACT_LENGTH 3 //default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change + #define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s) + #define RETRACT_ZLIFT 0 //default retract Z-lift + #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change) + #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) +#endif + +// Add support for experimental filament exchange support M600; requires display +#if ENABLED(ULTIPANEL) + //#define FILAMENTCHANGEENABLE + #if ENABLED(FILAMENTCHANGEENABLE) + #define FILAMENTCHANGE_XPOS 30 + #define FILAMENTCHANGE_YPOS 10 + #define FILAMENTCHANGE_ZADD 10 + #define FILAMENTCHANGE_FIRSTRETRACT -1 + //#define FILAMENTCHANGE_FINALRETRACT -100 + //#define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD + //#define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop + //#define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + #endif +#endif + +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the Arduino IDE for this + ******************************************************************************/ + +// @section tmc + +//#define HAVE_TMCDRIVER +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + + //#define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + + //#define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + + //#define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + + //#define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + + //#define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + + //#define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + + //#define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + + //#define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + + //#define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the Arduino IDE for this + ******************************************************************************/ + +// @section l6470 + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; It uses multiple M155 commands with one B arg + * M155 A63 ; Target slave address + * M155 B77 ; M + * M155 B97 ; a + * M155 B114 ; r + * M155 B108 ; l + * M155 B105 ; i + * M155 B110 ; n + * M155 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 + * M156 A63 B5 + * + * ; Example #3 + * ; Example serial output of a M156 request + * echo:i2c-reply: from:63 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS + +#include "Conditionals.h" +#include "SanityCheck.h" + +#endif //CONFIGURATION_ADV_H diff --git a/Marlin/pins.h b/Marlin/pins.h index a9baf198c..4a090f348 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -31,6 +31,8 @@ #include "pins_GEN7_13.h" #elif MB(GEN7_14) #include "pins_GEN7_14.h" +#elif MB(CNCONTROLS_12) + #include "pins_CNCONTROLS_12.h" #elif MB(CHEAPTRONIC) #include "pins_CHEAPTRONIC.h" #elif MB(SETHI) diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h new file mode 100644 index 000000000..74fdf15cc --- /dev/null +++ b/Marlin/pins_CNCONTROLS_12.h @@ -0,0 +1,108 @@ +/** + * CartesioV12 pin assignments + */ + +#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) + #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. +#endif + +//#define LARGE_FLASH true + + #define X_ENABLE_PIN 26 + #define X_STEP_PIN 25 + #define X_DIR_PIN 27 + #define X_MIN_PIN 19 + #define X_MAX_PIN -1 + + #define Y_ENABLE_PIN 29 + #define Y_STEP_PIN 28 + #define Y_DIR_PIN 30 + #define Y_MIN_PIN 22 + #define Y_MAX_PIN -1 + + #define Z_ENABLE_PIN 32 + #define Z_STEP_PIN 31 + #define Z_DIR_PIN 33 + #define Z_MIN_PIN 23 + #define Z_MAX_PIN -1 + + +//Tools + + #define E0_ENABLE_PIN 58 + #define E0_STEP_PIN 57 + #define E0_DIR_PIN 55 + #define HEATER_0_PIN 11 + #define TEMP_0_PIN 0 // ANALOG INPUT !! +// #define TOOL_0_PIN 56 +// #define TOOL_0_PWM_PIN 10 // used for red warning led at dual extruder + + #define E1_ENABLE_PIN 60 + #define E1_STEP_PIN 61 + #define E1_DIR_PIN 62 + #define HEATER_1_PIN 9 + #define TEMP_1_PIN 9 // 9 for tool3 -> 13 for chambertemp +// #define TOOL_1_PIN 59 +// #define TOOL_1_PWM_PIN 8 // used for lights at dual extruder + + #define E2_ENABLE_PIN 44 + #define E2_STEP_PIN 46 + #define E2_DIR_PIN 66 + #define HEATER_2_PIN 6 + #define TEMP_2_PIN 13 // 10 for tool3 -> 13 for chambertemp +// #define TOOL_2_PIN 4 +// #define TOOL_2_PWM_PIN 5 + + #define E3_ENABLE_PIN 47 + #define E3_STEP_PIN 45 + #define E3_DIR_PIN 69 + #define HEATER_3_PIN 3 + #define TEMP_3_PIN 11 // 11 for tool4 -> 13 for chambertemp +// #define TOOL_3_PIN 14 +// #define TOOL_3_PWM_PIN 2 + + #define HEATER_BED_PIN 24 + #define TEMP_BED_PIN 14 // ANALOG INPUT !! + +//common I/O + + //#define TEMP_CHAMBER_PIN 13 // ANALOG INPUT !! + //#define FILAMENT_RUNOUT_SENSOR 18 + //#define PWM_1_PIN 12 + //#define PWM_2_PIN 13 + //#define SPARE_IO 17 + #define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools + + +//user interface + + #define BEEPER_PIN 16 + + // Pins for DOGM SPI LCD Support + #define DOGLCD_a0 39 + #define DOGLCD_cs 35 + #define DOGLCD_mosi 48 + #define DOGLCD_sck 49 + #define LCD_SCREEN_ROT_180 + + //The encoder and click button + #define BTN_EN1 36 + #define BTN_EN2 34 + #define BTN_ENC 38 //the click switch + + //hardware buttons for manual movement of XYZ + #define SHIFT_OUT 42 + #define SHIFT_LD 41 + #define SHIFT_CLK 40 + + + //#define UI1 43 + //#define UI2 37 + + +// Other + + #define SDSS 53 + #define SD_DETECT_PIN 15 + #define STAT_LED_BLUE -1 + #define STAT_LED_RED 10 // TOOL_0_PWM_PIN From 4fa05913c30a47544de0ee1a70a9054594f75e29 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 15 Jun 2016 22:24:10 -0700 Subject: [PATCH 075/580] Script to init the upstream remote for Marlin --- buildroot/share/git/mfinit | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 buildroot/share/git/mfinit diff --git a/buildroot/share/git/mfinit b/buildroot/share/git/mfinit new file mode 100755 index 000000000..5e2cbc0d8 --- /dev/null +++ b/buildroot/share/git/mfinit @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# mfinit +# +# Create the upstream repository for Marlin +# + +git remote add upstream git@github.com:MarlinFirmware/Marlin.git From 114d9db7d0bfcab03b08c79409da52249ba8e369 Mon Sep 17 00:00:00 2001 From: edwilliams16 Date: Sun, 12 Jun 2016 23:28:16 -1000 Subject: [PATCH 076/580] Show babysteps on the LCD in mm, not steps --- Marlin/ultralcd.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) mode change 100644 => 100755 Marlin/ultralcd.cpp diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp old mode 100644 new mode 100755 index a9f8aaa58..add6cb029 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -575,18 +575,21 @@ static void lcd_status_screen() { #if ENABLED(BABYSTEPPING) - int babysteps_done = 0; + long babysteps_done = 0; static void _lcd_babystep(const AxisEnum axis, const char* msg) { ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { - int distance = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR; + int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR; encoderPosition = 0; lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - thermalManager.babystep_axis(axis, distance); - babysteps_done += distance; + thermalManager.babystep_axis(axis, babystep_increment); + babysteps_done += babystep_increment; } - if (lcdDrawUpdate) lcd_implementation_drawedit(msg, itostr3sign(babysteps_done)); + if (lcdDrawUpdate) + lcd_implementation_drawedit(msg, ftostr43sign( + ((1000 * babysteps_done) / planner.axis_steps_per_mm[axis]) * 0.001f + )); if (LCD_CLICKED) lcd_goto_previous_menu(true); } From 008d0637dd68c18907f7890cfec761def6764233 Mon Sep 17 00:00:00 2001 From: MagoKimbra Date: Thu, 16 Jun 2016 09:05:36 +0200 Subject: [PATCH 077/580] Fix gcode_T --- Marlin/Marlin_main.cpp | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index de2b10ba3..016236b35 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6624,21 +6624,22 @@ inline void gcode_T(uint8_t tmp_extruder) { return; } - float stored_feedrate = feedrate; + #if HOTENDS > 1 - if (code_seen('F')) { - float next_feedrate = code_value_axis_units(X_AXIS); - if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate; - } - else { - #ifdef XY_TRAVEL_SPEED - feedrate = XY_TRAVEL_SPEED; - #else - feedrate = min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]); - #endif - } + float stored_feedrate = feedrate; + + if (code_seen('F')) { + float next_feedrate = code_value_axis_units(X_AXIS); + if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate; + } + else { + #ifdef XY_TRAVEL_SPEED + feedrate = XY_TRAVEL_SPEED; + #else + feedrate = min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]); + #endif + } - #if HOTENDS > 1 if (tmp_extruder != active_extruder) { bool no_move = code_seen('S') && code_value_bool(); // Save current position to return to after applying extruder offset @@ -6794,9 +6795,14 @@ inline void gcode_T(uint8_t tmp_extruder) { enable_solenoid_on_active_extruder(); #endif // EXT_SOLENOID - #endif // HOTENDS > 1 + feedrate = stored_feedrate; + + #else // !HOTENDS > 1 - feedrate = stored_feedrate; + // Set the new active extruder + active_extruder = tmp_extruder; + + #endif SERIAL_ECHO_START; SERIAL_ECHO(MSG_ACTIVE_EXTRUDER); From 106227540e4a64f25d1a822c58edc9ad6cec41ab Mon Sep 17 00:00:00 2001 From: esenapaj Date: Thu, 16 Jun 2016 19:22:31 +0900 Subject: [PATCH 078/580] Follow-up and improvement the PR #4053 (CNControls Cartesio UI Support) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Add implimantation of PR #3609 to configuration files of Cartesio ・Standardize macro names --- Marlin/dogm_lcd_implementation.h | 2 +- .../example_configurations/Cartesio/Configuration.h | 13 +++++++++++++ .../Cartesio/Configuration_adv.h | 13 +++++++++++++ Marlin/pins_CNCONTROLS_12.h | 8 ++++---- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index a992eb848..1ef521442 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -143,7 +143,7 @@ U8GLIB_ST7920_128X64_RRD u8g(0); #elif defined(CARTESIO_UI) // The CartesioUI display with SW-SPI - U8GLIB_DOGM128 u8g(DOGLCD_sck, DOGLCD_mosi, DOGLCD_cs, DOGLCD_a0); + U8GLIB_DOGM128 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); #elif ENABLED(U8GLIB_LM6059_AF) // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0); diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 0830692f4..d5fddbbd0 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -38,6 +38,19 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + #include "boards.h" #include "macros.h" diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 4b7765e12..7f61cf437 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -33,6 +33,19 @@ #ifndef CONFIGURATION_ADV_H #define CONFIGURATION_ADV_H +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 010100 + #include "Conditionals.h" // @section temperature diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h index 74fdf15cc..de27b8f9d 100644 --- a/Marlin/pins_CNCONTROLS_12.h +++ b/Marlin/pins_CNCONTROLS_12.h @@ -79,10 +79,10 @@ #define BEEPER_PIN 16 // Pins for DOGM SPI LCD Support - #define DOGLCD_a0 39 - #define DOGLCD_cs 35 - #define DOGLCD_mosi 48 - #define DOGLCD_sck 49 + #define DOGLCD_A0 39 + #define DOGLCD_CS 35 + #define DOGLCD_MOSI 48 + #define DOGLCD_SCK 49 #define LCD_SCREEN_ROT_180 //The encoder and click button From 340f97d6357b752143a352b243592aaa3662cf4a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Jun 2016 12:56:39 -0700 Subject: [PATCH 079/580] Add ghtp script to set remotes to HTTP or SSL --- buildroot/share/git/ghtp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 buildroot/share/git/ghtp diff --git a/buildroot/share/git/ghtp b/buildroot/share/git/ghtp new file mode 100755 index 000000000..83f461ef1 --- /dev/null +++ b/buildroot/share/git/ghtp @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# ghtp (GitHub Transport Protocol) +# +# Set all remotes in the current repo to HTTPS or SSH connection. +# Useful when switching environments, using public wifi, etc. +# + +GH_SSH="git@github\.com:" +GH_HTTPS="https:\/\/github\.com\/" + +case "$1" in + -[Hh]) TYPE=HTTPS ; MATCH="git@" ; FORMULA="$GH_SSH/$GH_HTTPS" ;; + -[Ss]) TYPE=SSH ; MATCH="https:" ; FORMULA="$GH_HTTPS/$GH_SSH" ;; + *) + echo "Usage: `basename $0` -h | -s" 1>&2 + echo -e " \e[0;92m-h\e[0m to switch to HTTPS" 1>&2 + echo -e " \e[0;92m-s\e[0m to switch to SSH" 1>&2 + exit 1 + ;; +esac + +REMOTES=$(git remote -v | egrep "\t$MATCH" | gawk '{print $1 " " $2}' | sort -u | sed "s/$FORMULA/") + +if [[ -z $REMOTES ]]; then + echo "Nothing to do." ; exit +fi + +echo "$REMOTES" | xargs -n2 git remote set-url + +echo -n "Remotes set to $TYPE: " +echo "$REMOTES" | gawk '{printf "%s ", $1}' +echo From ef3bef6b9e841d8174630772040e4222d2fab951 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Jun 2016 18:39:24 -0700 Subject: [PATCH 080/580] Fix feedrate in gcode_T (max_feedrate is mm/s) --- Marlin/Marlin_main.cpp | 12 +++++++----- Marlin/planner.cpp | 2 +- Marlin/planner.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 016236b35..3d63bec3d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6633,11 +6633,13 @@ inline void gcode_T(uint8_t tmp_extruder) { if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate; } else { - #ifdef XY_TRAVEL_SPEED - feedrate = XY_TRAVEL_SPEED; - #else - feedrate = min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]); - #endif + feedrate = + #ifdef XY_TRAVEL_SPEED + XY_TRAVEL_SPEED + #else + min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60 + #endif + ; } if (tmp_extruder != active_extruder) { diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 699987f15..be0fe8ba2 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -80,7 +80,7 @@ block_t Planner::block_buffer[BLOCK_BUFFER_SIZE]; volatile uint8_t Planner::block_buffer_head = 0; // Index of the next block to be pushed volatile uint8_t Planner::block_buffer_tail = 0; -float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per minute +float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per second float Planner::axis_steps_per_mm[NUM_AXIS]; unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS]; unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software diff --git a/Marlin/planner.h b/Marlin/planner.h index 51219743e..71e6b8119 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -115,7 +115,7 @@ class Planner { static volatile uint8_t block_buffer_head; // Index of the next block to be pushed static volatile uint8_t block_buffer_tail; - static float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute + static float max_feedrate[NUM_AXIS]; // Max speeds in mm per second static float axis_steps_per_mm[NUM_AXIS]; static unsigned long max_acceleration_steps_per_s2[NUM_AXIS]; static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software From 884bc63fbe4d2bfa510b80666d1623e60bd80c9c Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 15 Jun 2016 15:14:56 +0200 Subject: [PATCH 081/580] Add Croatian language --- Marlin/language_hr.h | 204 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 Marlin/language_hr.h diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h new file mode 100644 index 000000000..edb2dd7cd --- /dev/null +++ b/Marlin/language_hr.h @@ -0,0 +1,204 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Croatian(Hrvatski) + * + * LCD Menu Messages + * See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language + * + */ +#ifndef LANGUAGE_HR_H +#define LANGUAGE_HR_H + +#if DISABLED(MAPPER_NON) && DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_D0D1) && DISABLED(MAPPER_D0D1_MOD) && DISABLED(MAPPER_E382E383) + #define MAPPER_NON // For direct ascii codes +#endif + +//#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays +#if DISABLED(SIMULATE_ROMFONT) && DISABLED(DISPLAY_CHARSET_ISO10646_1) && DISABLED(DISPLAY_CHARSET_ISO10646_5) && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) && DISABLED(DISPLAY_CHARSET_ISO10646_CN) + #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. +#endif + + +#define WELCOME_MSG MACHINE_NAME " spreman." +#define MSG_SD_INSERTED "SD kartica umetnuta" +#define MSG_SD_REMOVED "SD kartica uklonjena" +#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters +#define MSG_MAIN "Main" +#define MSG_AUTOSTART "Automatsko pokretanje" +#define MSG_DISABLE_STEPPERS "Ugasi steppere" +#define MSG_AUTO_HOME "Automatski homing" +#define MSG_AUTO_HOME_X "Home-aj X" +#define MSG_AUTO_HOME_Y "Home-aj Y" +#define MSG_AUTO_HOME_Z "Home-aj Z" +#define MSG_LEVEL_BED_HOMING "Home-aj XYZ" +#define MSG_LEVEL_BED_WAITING "Click to Begin" +#define MSG_LEVEL_BED_NEXT_POINT "Sljedeća točka" +#define MSG_LEVEL_BED_DONE "Niveliranje gotovo!" +#define MSG_LEVEL_BED_CANCEL "Otkaži" +#define MSG_SET_HOME_OFFSETS "Postavi home offsete" +#define MSG_HOME_OFFSETS_APPLIED "Offsets postavljeni" +#define MSG_SET_ORIGIN "Postavi ishodište" +#define MSG_PREHEAT_PLA "Predgrij PLA" +#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " +#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " Sve" +#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Bed" +#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " conf" +#define MSG_PREHEAT_ABS "Predgrij ABS" +#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " +#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " Sve" +#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Bed" +#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " conf" +#define MSG_H1 "1" +#define MSG_H2 "2" +#define MSG_H3 "3" +#define MSG_H4 "4" +#define MSG_COOLDOWN "Hlađenje" +#define MSG_SWITCH_PS_ON "Uključi napajanje" +#define MSG_SWITCH_PS_OFF "Isključi napajanje" +#define MSG_EXTRUDE "Extrude" +#define MSG_RETRACT "Retract" +#define MSG_MOVE_AXIS "Miči os" +#define MSG_LEVEL_BED "Niveliraj bed" +#define MSG_MOVE_X "Miči X" +#define MSG_MOVE_Y "Miči Y" +#define MSG_MOVE_Z "Miči Z" +#define MSG_MOVE_E "Extruder" +#define MSG_MOVE_E1 "1" +#define MSG_MOVE_E2 "2" +#define MSG_MOVE_E3 "3" +#define MSG_MOVE_E4 "4" +#define MSG_MOVE_01MM "Miči 0.1mm" +#define MSG_MOVE_1MM "Miči 1mm" +#define MSG_MOVE_10MM "Miči 10mm" +#define MSG_SPEED "Brzina" +#define MSG_BED_Z "Bed Z" +#define MSG_NOZZLE "Nozzle" +#define MSG_N1 " 1" +#define MSG_N2 " 2" +#define MSG_N3 " 3" +#define MSG_N4 " 4" +#define MSG_BED "Bed" +#define MSG_FAN_SPEED "Brzina ventilatora" +#define MSG_FLOW "Flow" +#define MSG_CONTROL "Control" +#define MSG_MIN " " LCD_STR_THERMOMETER " Min" +#define MSG_MAX " " LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR " " LCD_STR_THERMOMETER " Fact" +#define MSG_AUTOTEMP "Autotemp" +#define MSG_ON "On " +#define MSG_OFF "Off" +#define MSG_PID_P "PID-P" +#define MSG_PID_I "PID-I" +#define MSG_PID_D "PID-D" +#define MSG_PID_C "PID-C" +#define MSG_E1 " E1" +#define MSG_E2 " E2" +#define MSG_E3 " E3" +#define MSG_E4 " E4" +#define MSG_ACC "Accel" +#define MSG_VXY_JERK "Vxy-jerk" +#define MSG_VZ_JERK "Vz-jerk" +#define MSG_VE_JERK "Ve-jerk" +#define MSG_VMAX "Vmax " +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" +#define MSG_VMIN "Vmin" +#define MSG_VTRAV_MIN "VTrav min" +#define MSG_AMAX "Amax " +#define MSG_A_RETRACT "A-retract" +#define MSG_A_TRAVEL "A-travel" +#define MSG_XSTEPS "Xsteps/mm" +#define MSG_YSTEPS "Ysteps/mm" +#define MSG_ZSTEPS "Zsteps/mm" +#define MSG_ESTEPS "Esteps/mm" +#define MSG_TEMPERATURE "Temperature" +#define MSG_MOTION "Motion" +#define MSG_VOLUMETRIC "Filament" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_FILAMENT_DIAM "Fil. Dia." +#define MSG_DIAM_E1 " 1" +#define MSG_DIAM_E2 " 2" +#define MSG_DIAM_E3 " 3" +#define MSG_DIAM_E4 " 4" +#define MSG_CONTRAST "Kontrast LCD-a" +#define MSG_STORE_EPROM "Pohrani u memoriju" +#define MSG_LOAD_EPROM "Učitaj memoriju" +#define MSG_RESTORE_FAILSAFE "Učitaj failsafe" +#define MSG_REFRESH "Osvježi" +#define MSG_WATCH "Info screen" +#define MSG_PREPARE "Pripremi" +#define MSG_TUNE "Tune" +#define MSG_PAUSE_PRINT "Pauziraj print" +#define MSG_RESUME_PRINT "Nastavi print" +#define MSG_STOP_PRINT "Zaustavi print" +#define MSG_CARD_MENU "Printaj s SD kartice" +#define MSG_NO_CARD "Nema SD kartice" +#define MSG_DWELL "Sleep..." +#define MSG_USERWAIT "Čekaj korisnika..." +#define MSG_RESUMING "Nastavljam print" +#define MSG_PRINT_ABORTED "Print otkazan" +#define MSG_NO_MOVE "No move." +#define MSG_KILLED "KILLED. " +#define MSG_STOPPED "ZAUSTAVLJEN. " +#define MSG_CONTROL_RETRACT "Retract mm" +#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm" +#define MSG_CONTROL_RETRACTF "Retract V" +#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" +#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" +#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm" +#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" +#define MSG_AUTORETRACT "AutoRetr." +#define MSG_FILAMENTCHANGE "Promijeni filament" +#define MSG_INIT_SDCARD "Init. SD karticu" +#define MSG_CNG_SDCARD "Promijeni SD karticu" +#define MSG_ZPROBE_OUT "Z probe out. bed" +#define MSG_YX_UNHOMED "Home-aj X/Y prije Z" +#define MSG_XYZ_UNHOMED "Home-aj XYZ prvo" +#define MSG_ZPROBE_ZOFFSET "Z Offset" +#define MSG_BABYSTEP_X "Babystep X" +#define MSG_BABYSTEP_Y "Babystep Y" +#define MSG_BABYSTEP_Z "Babystep Z" +#define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_HEATING_FAILED_LCD "Heating failed" +#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP" +#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" +#define MSG_ERR_MAXTEMP "Err: MAXTEMP" +#define MSG_ERR_MINTEMP "Err: MINTEMP" +#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" +#define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED" +#define MSG_END_HOUR "sati" +#define MSG_END_MINUTE "minuta" +#define MSG_HEATING "Grijanje..." +#define MSG_HEATING_COMPLETE "Grijanje gotovo." +#define MSG_BED_HEATING "Grijanje Bed-a." +#define MSG_BED_DONE "Bed gotov." +#define MSG_DELTA_CALIBRATE "Delta Kalibracija" +#define MSG_DELTA_CALIBRATE_X "Kalibriraj X" +#define MSG_DELTA_CALIBRATE_Y "Kalibriraj Y" +#define MSG_DELTA_CALIBRATE_Z "Kalibriraj Z" +#define MSG_DELTA_CALIBRATE_CENTER "Kalibriraj Središte" + +#endif // LANGUAGE_HR_H From 2015aad867fc4e10cae8cc2e127ef31950ac1fb9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 15 Jun 2016 22:01:57 -0700 Subject: [PATCH 082/580] Tweak Croatian language file heading --- Marlin/language_hr.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h index edb2dd7cd..f3bf014f5 100644 --- a/Marlin/language_hr.h +++ b/Marlin/language_hr.h @@ -21,7 +21,7 @@ */ /** - * Croatian(Hrvatski) + * Croatian (Hrvatski) * * LCD Menu Messages * See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language @@ -30,15 +30,11 @@ #ifndef LANGUAGE_HR_H #define LANGUAGE_HR_H -#if DISABLED(MAPPER_NON) && DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_D0D1) && DISABLED(MAPPER_D0D1_MOD) && DISABLED(MAPPER_E382E383) - #define MAPPER_NON // For direct ascii codes -#endif - -//#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays -#if DISABLED(SIMULATE_ROMFONT) && DISABLED(DISPLAY_CHARSET_ISO10646_1) && DISABLED(DISPLAY_CHARSET_ISO10646_5) && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) && DISABLED(DISPLAY_CHARSET_ISO10646_CN) - #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. -#endif +#define MAPPER_NON +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT +#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. #define WELCOME_MSG MACHINE_NAME " spreman." #define MSG_SD_INSERTED "SD kartica umetnuta" From 02e5dad29a8c9c644d0f5a8c653ceb8458e4c2ac Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 15 Jun 2016 22:02:12 -0700 Subject: [PATCH 083/580] Include Croatian in language listings --- Marlin/Configuration.h | 6 ++-- .../Felix/Configuration.h | 6 ++-- .../Felix/DUAL/Configuration.h | 6 ++-- .../Hephestos/Configuration.h | 6 ++-- .../Hephestos_2/Configuration.h | 6 ++-- .../K8200/Configuration.h | 6 ++-- .../RepRapWorld/Megatronics/Configuration.h | 6 ++-- .../RigidBot/Configuration.h | 6 ++-- .../SCARA/Configuration.h | 6 ++-- .../TAZ4/Configuration.h | 6 ++-- .../WITBOX/Configuration.h | 6 ++-- .../adafruit/ST7565/Configuration.h | 6 ++-- .../delta/biv2.5/Configuration.h | 6 ++-- .../delta/generic/Configuration.h | 6 ++-- .../delta/kossel_mini/Configuration.h | 6 ++-- .../delta/kossel_pro/Configuration.h | 6 ++-- .../delta/kossel_xl/Configuration.h | 6 ++-- .../makibox/Configuration.h | 6 ++-- .../tvrrug/Round2/Configuration.h | 6 ++-- Marlin/language.h | 33 ++++++++++--------- 20 files changed, 93 insertions(+), 54 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index afd024933..509427b61 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -820,8 +820,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index f9ed818d2..f92302db5 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -803,8 +803,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 6fbc59dc3..c243209d5 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -801,8 +801,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 716e48ef5..34ee387ee 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -812,8 +812,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 983607fe9..d5e6a0df0 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -814,8 +814,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 9add3b8b0..6797fcd89 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -837,8 +837,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 4c38e1e5d..9a4a2c7fb 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -820,8 +820,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 297b17915..dff38c635 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -815,8 +815,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index f64f2ea5c..5ac806382 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -828,8 +828,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 1b51bb1b6..5c1742d68 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -841,8 +841,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index b8c94b588..4055e15a3 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -812,8 +812,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index d3485e2db..fdbf9a869 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -820,8 +820,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index cbef37436..d6b783a95 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -909,8 +909,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 74c0ff8db..6f2963c37 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -903,8 +903,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 07041494f..5b4436647 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -906,8 +906,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 6e909558f..9ec47259d 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -906,8 +906,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 7bca47766..646c89416 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -908,8 +908,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index d969f2e84..2ad761ce5 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -823,8 +823,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 2e1282f16..4d8b04e38 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -814,8 +814,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/language.h b/Marlin/language.h index edef06be1..e675f93eb 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -42,28 +42,29 @@ // See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language // Languages -// en English -// pl Polish -// fr French +// an Aragonese +// bg Bulgarian +// ca Catalan +// cn Chinese +// cz Czech // de German +// en English // es Spanish -// ru Russian -// bg Bulgarian -// it Italian -// pt Portuguese -// pt_utf8 Portuguese (UTF8) -// pt-br Portuguese (Brazilian) -// pt-br_utf8 Portuguese (Brazilian UTF8) +// eu Basque-Euskera // fi Finnish -// an Aragonese -// nl Dutch +// fr French // gl Galician -// ca Catalan -// eu Basque-Euskera +// hr Croatian +// it Italian // kana Japanese // kana_utf8 Japanese (UTF8) -// cn Chinese -// cz Czech +// nl Dutch +// pl Polish +// pt Portuguese +// pt-br Portuguese (Brazilian) +// pt-br_utf8 Portuguese (Brazilian UTF8) +// pt_utf8 Portuguese (UTF8) +// ru Russian #if ENABLED(USE_AUTOMATIC_VERSIONING) #include "_Version.h" From ebbed2975e3b256127e4f6e56cbbe3ca6738fb47 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Jun 2016 16:39:36 -0700 Subject: [PATCH 084/580] Delete mysterious .swp files from #3609 --- .../Felix/.Configuration.h.swp | Bin 1024 -> 0 bytes .../Felix/DUAL/.Configuration.h.swp | Bin 1024 -> 0 bytes .../Hephestos/.Configuration.h.swp | Bin 1024 -> 0 bytes .../Hephestos_2/.Configuration.h.swp | Bin 1024 -> 0 bytes .../K8200/.Configuration.h.swp | Bin 1024 -> 0 bytes .../RepRapWorld/Megatronics/.Configuration.h.swp | Bin 1024 -> 0 bytes .../RigidBot/.Configuration.h.swp | Bin 1024 -> 0 bytes .../SCARA/.Configuration.h.swp | Bin 1024 -> 0 bytes .../TAZ4/.Configuration.h.swp | Bin 1024 -> 0 bytes .../WITBOX/.Configuration.h.swp | Bin 1024 -> 0 bytes .../adafruit/ST7565/.Configuration.h.swp | Bin 1024 -> 0 bytes .../delta/biv2.5/.Configuration.h.swp | Bin 1024 -> 0 bytes .../delta/generic/.Configuration.h.swp | Bin 1024 -> 0 bytes .../delta/kossel_mini/.Configuration.h.swp | Bin 1024 -> 0 bytes .../delta/kossel_pro/.Configuration.h.swp | Bin 1024 -> 0 bytes .../delta/kossel_xl/.Configuration.h.swp | Bin 1024 -> 0 bytes .../makibox/.Configuration.h.swp | Bin 1024 -> 0 bytes .../tvrrug/Round2/.Configuration.h.swp | Bin 1024 -> 0 bytes 18 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Marlin/example_configurations/Felix/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/Felix/DUAL/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/Hephestos/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/Hephestos_2/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/K8200/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/RepRapWorld/Megatronics/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/RigidBot/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/SCARA/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/TAZ4/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/WITBOX/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/adafruit/ST7565/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/delta/biv2.5/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/delta/generic/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/delta/kossel_mini/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/delta/kossel_pro/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/delta/kossel_xl/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/makibox/.Configuration.h.swp delete mode 100644 Marlin/example_configurations/tvrrug/Round2/.Configuration.h.swp diff --git a/Marlin/example_configurations/Felix/.Configuration.h.swp b/Marlin/example_configurations/Felix/.Configuration.h.swp deleted file mode 100644 index c3fc82b940236222c1e57b69864a173602799cdc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y`~@u2#kgR=^+3B%^4kg diff --git a/Marlin/example_configurations/Hephestos_2/.Configuration.h.swp b/Marlin/example_configurations/Hephestos_2/.Configuration.h.swp deleted file mode 100644 index a956da759364f0551e91f992c6b6ce939476c2d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*YzH47wbDCE7K!vJd#bL%+U}S J4FO_8005Q*BE7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y@45 diff --git a/Marlin/example_configurations/SCARA/.Configuration.h.swp b/Marlin/example_configurations/SCARA/.Configuration.h.swp deleted file mode 100644 index 681613a905ee69a3da8cb4f2f7756cfe31423d5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*YJc^#$>34uXb6mk09hdb0D_hqr2qf` diff --git a/Marlin/example_configurations/adafruit/ST7565/.Configuration.h.swp b/Marlin/example_configurations/adafruit/ST7565/.Configuration.h.swp deleted file mode 100644 index d7e98c4d740694e97ddc58dac77aebf44866370e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Yo9v diff --git a/Marlin/example_configurations/delta/biv2.5/.Configuration.h.swp b/Marlin/example_configurations/delta/biv2.5/.Configuration.h.swp deleted file mode 100644 index bf731ea1828bb3d4b57ff46840ffcfd9f508dd7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y17_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*YEwn7G);uJ0nZ#5jGUb{88p;2#kgRX(0drd?Oy- diff --git a/Marlin/example_configurations/delta/kossel_mini/.Configuration.h.swp b/Marlin/example_configurations/delta/kossel_mini/.Configuration.h.swp deleted file mode 100644 index 0277ddf09e6064c1f3834b4f5ea2ca2a280c82a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Yo diff --git a/Marlin/example_configurations/delta/kossel_pro/.Configuration.h.swp b/Marlin/example_configurations/delta/kossel_pro/.Configuration.h.swp deleted file mode 100644 index 08b8098505b6b220dc4b144ad6af31d85c30f949..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{5u)iY*50%vm>7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Y7_yRz600)vkwmdGQxenjlM*wqOCpJ;RwU*Yj&kR=A{_vJ0nZ#5jGUb{88p;2#kgRX(0drbQK=k From e7ab26dc9cf3ce23ba3570fe2b4812e1cf6ea2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 17 Jun 2016 01:50:51 +0100 Subject: [PATCH 085/580] Updates .gitignore --- .gitignore | 111 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 104 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index aa1d42424..d83d289e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,117 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + // Our automatic versioning scheme generates the following file // NEVER put it in the repository _Version.h -// All of the following OS, IDE and compiler generated file -// references should be moved from this file -// They are needed, but they belong in your global .gitignore -// rather than in a per-project file such as this - -*.o +// +// OS +// applet/ +*.DS_Store + + +// +// Misc +// *~ *.orig *.rej *.bak -*.DS_Store *.idea *.s *.i *.ii +*.swp + + +// +// C++ +// +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + + +// +// C +// +# Object files +*.o +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su From c5eecb11b2126c79fa9bfb8d9425d8c4fc5e86bc Mon Sep 17 00:00:00 2001 From: esenapaj Date: Fri, 17 Jun 2016 21:20:15 +0900 Subject: [PATCH 086/580] Follow-up the PR #4055 (Croatian language support) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update a forgotten Configuration.h of Cartesio --- Marlin/example_configurations/Cartesio/Configuration.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index d5fddbbd0..476a99118 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -819,8 +819,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, pl, fr, de, es, ru, bg, it, pt, pt_utf8, pt-br, pt-br_utf8, -// fi, an, nl, ca, eu, kana, kana_utf8, cn, cz, test +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en From d1e5dc6319c7777e9ec09ded4c9dffa315b9e4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 16 Jun 2016 19:24:11 +0100 Subject: [PATCH 087/580] Fixes misc gcc warnings --- Marlin/Marlin_main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7ae1a6831..60738dd27 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1244,14 +1244,14 @@ inline bool code_value_bool() { return code_value_byte() > 0; } } inline float code_value_linear_units() { return code_value_float() * linear_unit_factor; } - inline float code_value_per_axis_unit(int axis) { return code_value_float() / axis_unit_factor(axis); } inline float code_value_axis_units(int axis) { return code_value_float() * axis_unit_factor(axis); } + inline float code_value_per_axis_unit(int axis) { return code_value_float() / axis_unit_factor(axis); } #else inline float code_value_linear_units() { return code_value_float(); } - inline float code_value_per_axis_unit(int axis) { return code_value_float(); } - inline float code_value_axis_units(int axis) { return code_value_float(); } + inline float code_value_axis_units(int axis) { UNUSED(axis); return code_value_float(); } + inline float code_value_per_axis_unit(int axis) { UNUSED(axis); return code_value_float(); } #endif @@ -4892,7 +4892,7 @@ inline void gcode_M110() { * M111: Set the debug level */ inline void gcode_M111() { - marlin_debug_flags = code_seen('S') ? code_value_byte() : DEBUG_NONE; + marlin_debug_flags = code_seen('S') ? code_value_byte() : (uint8_t) DEBUG_NONE; const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO; const static char str_debug_2[] PROGMEM = MSG_DEBUG_INFO; @@ -7369,7 +7369,7 @@ void process_next_command() { gcode_M605(); break; #endif // DUAL_X_CARRIAGE - + #if ENABLED(LIN_ADVANCE) case 905: // M905 Set advance factor. gcode_M905(); From d087ae0b9f3b7a28708c6348460abb29d6056a3c Mon Sep 17 00:00:00 2001 From: Andre Ruiz Date: Fri, 17 Jun 2016 17:02:18 -0300 Subject: [PATCH 088/580] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9341bc59..58597efee 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ __Not for production use – use with caution!__ You can download earlier versions of Marlin on the [Releases page](https://github.com/MarlinFirmware/Marlin/releases). (The latest "stable" release of Marlin is 1.0.2-1.) -You'll always find the latest Release Candidate in the ["RC" branch](https://github.com/MarlinFirmware/Marlin/tree/RC). Bugs that we find in the current Release Candidate are patched in the ["RCBugFix" branch](https://github.com/MarlinFirmware/Marlin/tree/RC), so during beta testing this is where you can always find the latest code on its way towards release. +You'll always find the latest Release Candidate in the ["RC" branch](https://github.com/MarlinFirmware/Marlin/tree/RC). Bugs that we find in the current Release Candidate are patched in the ["RCBugFix" branch](https://github.com/MarlinFirmware/Marlin/tree/RCBugFix), so during beta testing this is where you can always find the latest code on its way towards release. Future development (Marlin 1.2 and beyond) takes place in the [MarlinDev repository](https://github.com/MarlinFirmware/MarlinDev/). From 47ce810f524c1816288638d5c0f789a98a0989b5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Jun 2016 20:18:24 -0700 Subject: [PATCH 089/580] Remove support for XY servo endstops --- .travis.yml | 2 +- Marlin/Conditionals.h | 10 -- Marlin/Configuration.h | 6 +- Marlin/Marlin_main.cpp | 165 +++++++----------- Marlin/SanityCheck.h | 27 ++- .../Felix/Configuration.h | 6 +- .../Felix/DUAL/Configuration.h | 6 +- .../Hephestos/Configuration.h | 6 +- .../Hephestos_2/Configuration.h | 6 +- .../K8200/Configuration.h | 6 +- .../RepRapWorld/Megatronics/Configuration.h | 6 +- .../RigidBot/Configuration.h | 6 +- .../SCARA/Configuration.h | 6 +- .../TAZ4/Configuration.h | 6 +- .../WITBOX/Configuration.h | 6 +- .../adafruit/ST7565/Configuration.h | 6 +- .../delta/biv2.5/Configuration.h | 6 +- .../delta/generic/Configuration.h | 6 +- .../delta/kossel_mini/Configuration.h | 6 +- .../delta/kossel_pro/Configuration.h | 6 +- .../delta/kossel_xl/Configuration.h | 6 +- .../makibox/Configuration.h | 6 +- .../tvrrug/Round2/Configuration.h | 6 +- 23 files changed, 114 insertions(+), 204 deletions(-) diff --git a/.travis.yml b/.travis.yml index 496b616aa..89459cbe7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,7 +104,7 @@ script: # # Test AUTO_BED_LEVELING & DEBUG_LEVELING_FEATURE with Servos # - - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR SERVO_ENDSTOP_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE + - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - build_marlin # # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 3ccfe57f7..4987e0055 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -764,19 +764,9 @@ #define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER)) #if HAS_SERVOS - #ifndef X_ENDSTOP_SERVO_NR - #define X_ENDSTOP_SERVO_NR -1 - #endif - #ifndef Y_ENDSTOP_SERVO_NR - #define Y_ENDSTOP_SERVO_NR -1 - #endif #ifndef Z_ENDSTOP_SERVO_NR #define Z_ENDSTOP_SERVO_NR -1 #endif - #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || HAS_Z_ENDSTOP_SERVO - #define HAS_SERVO_ENDSTOPS - #define SERVO_ENDSTOP_IDS { X_ENDSTOP_SERVO_NR, Y_ENDSTOP_SERVO_NR, Z_ENDSTOP_SERVO_NR } - #endif #endif #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED)) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 509427b61..7e5417c79 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -420,7 +420,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1164,10 +1164,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3d63bec3d..26525d856 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -391,9 +391,8 @@ static uint8_t target_extruder; }; #endif -#if ENABLED(HAS_SERVO_ENDSTOPS) - const int servo_endstop_id[] = SERVO_ENDSTOP_IDS; - const int servo_endstop_angle[][2] = SERVO_ENDSTOP_ANGLES; +#if HAS_Z_ENDSTOP_SERVO + const int z_servo_angle[2] = Z_SERVO_ANGLES; #endif #if ENABLED(BARICUDA) @@ -488,10 +487,8 @@ static bool send_ok[BUFSIZE]; #if HAS_SERVOS Servo servo[NUM_SERVOS]; #define MOVE_SERVO(I, P) servo[I].move(P) - #define SERVO_ENDSTOP_EXISTS(I) (servo_endstop_id[I] >= 0) - #define MOVE_SERVO_ENDSTOP(I, J) MOVE_SERVO(servo_endstop_id[I], servo_endstop_angle[I][J]) - #define DEPLOY_SERVO_ENDSTOP(I) MOVE_SERVO_ENDSTOP(I, 0) - #define STOW_SERVO_ENDSTOP(I) MOVE_SERVO_ENDSTOP(I, 1) + #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[0]) + #define STOW_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[1]) #endif #ifdef CHDK @@ -749,14 +746,12 @@ void servo_init() { servo[3].detach(); #endif - #if ENABLED(HAS_SERVO_ENDSTOPS) + #if HAS_Z_ENDSTOP_SERVO endstops.enable_z_probe(false); /** - * Set position of all defined Servo Endstops - * - * ** UNSAFE! - NEEDS UPDATE! ** + * Set position of Z Servo Endstop * * The servo might be deployed and positioned too low to stow * when starting up the machine or rebooting the board. @@ -764,11 +759,8 @@ void servo_init() { * homing has been done - no homing with z-probe without init! * */ - for (int i = 0; i < 3; i++) - if (SERVO_ENDSTOP_EXISTS(i)) - STOW_SERVO_ENDSTOP(i); - - #endif // HAS_SERVO_ENDSTOPS + STOW_Z_SERVO(); + #endif // HAS_Z_ENDSTOP_SERVO } @@ -1837,11 +1829,10 @@ static void setup_for_endstop_move() { if (endstops.z_probe_enabled) return; - #if ENABLED(HAS_SERVO_ENDSTOPS) + #if HAS_Z_ENDSTOP_SERVO // Engage Z Servo endstop if enabled - if (SERVO_ENDSTOP_EXISTS(Z_AXIS)) - DEPLOY_SERVO_ENDSTOP(Z_AXIS); + DEPLOY_Z_SERVO(); #elif ENABLED(Z_PROBE_ALLEN_KEY) feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE; @@ -1925,7 +1916,7 @@ static void setup_for_endstop_move() { } static void stow_z_probe(bool doRaise = true) { - #if !(ENABLED(HAS_SERVO_ENDSTOPS) && (Z_RAISE_AFTER_PROBING > 0)) + #if !(HAS_Z_ENDSTOP_SERVO && (Z_RAISE_AFTER_PROBING > 0)) UNUSED(doRaise); #endif #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1934,21 +1925,18 @@ static void setup_for_endstop_move() { if (!endstops.z_probe_enabled) return; - #if ENABLED(HAS_SERVO_ENDSTOPS) + #if HAS_Z_ENDSTOP_SERVO // Retract Z Servo endstop if enabled - if (SERVO_ENDSTOP_EXISTS(Z_AXIS)) { - - #if Z_RAISE_AFTER_PROBING > 0 - if (doRaise) { - raise_z_after_probing(); // this also updates current_position - stepper.synchronize(); - } - #endif + #if Z_RAISE_AFTER_PROBING > 0 + if (doRaise) { + raise_z_after_probing(); // this also updates current_position + stepper.synchronize(); + } + #endif - // Change the Z servo angle - STOW_SERVO_ENDSTOP(Z_AXIS); - } + // Change the Z servo angle + STOW_Z_SERVO(); #elif ENABLED(Z_PROBE_ALLEN_KEY) @@ -2168,16 +2156,25 @@ static void setup_for_endstop_move() { #endif // DELTA - #if ENABLED(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_SLED) + #if HAS_Z_ENDSTOP_SERVO && DISABLED(Z_PROBE_SLED) - void raise_z_for_servo() { - float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_PROBING; - /** - * The zprobe_zoffset is negative any switch below the nozzle, so - * multiply by Z_HOME_DIR (-1) to move enough away from bed for the probe - */ - z_dest += axis_homed[Z_AXIS] ? zprobe_zoffset * Z_HOME_DIR : zpos; - if (zpos < z_dest) do_blocking_move_to_z(z_dest); // also updates current_position + /** + * Raise Z to a minimum height to make room for a servo to move + * + * zprobe_zoffset: Negative of the Z height where the probe engages + * z_dest: The before / after probing raise distance + * + * The zprobe_zoffset is negative for a switch below the nozzle, so + * multiply by Z_HOME_DIR (-1) to move enough away from the bed. + */ + void raise_z_for_servo(float z_dest) { + z_dest += home_offset[Z_AXIS]; + + if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) + z_dest -= zprobe_zoffset; + + if (z_dest > current_position[Z_AXIS]) + do_blocking_move_to_z(z_dest); // also updates current_position } #endif @@ -2277,23 +2274,24 @@ static void homeaxis(AxisEnum axis) { sync_plan_position(); #if ENABLED(Z_PROBE_SLED) - #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z - #define _Z_SERVO_SUBTEST false // Z will never be invoked #define _Z_DEPLOY (dock_sled(false)) #define _Z_STOW (dock_sled(true)) - #elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z #define _Z_SERVO_SUBTEST false // Z will never be invoked + #elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) #define _Z_DEPLOY (deploy_z_probe()) #define _Z_STOW (stow_z_probe()) - #elif ENABLED(HAS_SERVO_ENDSTOPS) + #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z + #define _Z_SERVO_SUBTEST false // Z will never be invoked + #elif HAS_Z_ENDSTOP_SERVO + #define _Z_DEPLOY do{ raise_z_for_servo(Z_RAISE_BEFORE_PROBING); DEPLOY_Z_SERVO(); endstops.z_probe_enabled = true; }while(0) + #define _Z_STOW do{ raise_z_for_servo(Z_RAISE_AFTER_PROBING); STOW_Z_SERVO(); endstops.z_probe_enabled = false; }while(0) #define _Z_SERVO_TEST true // Z not deployed yet #define _Z_SERVO_SUBTEST (axis == Z_AXIS) // Z is a probe #endif - // If there's a Z probe that needs deployment... - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) - // ...and homing Z towards the bed? Deploy it. + // Homing Z towards the bed? Deploy the Z probe or endstop. + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_ENDSTOP_SERVO if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_DEPLOY)); @@ -2302,14 +2300,6 @@ static void homeaxis(AxisEnum axis) { } #endif - #if ENABLED(HAS_SERVO_ENDSTOPS) - // Engage an X, Y (or Z) Servo endstop if enabled - if (_Z_SERVO_TEST && SERVO_ENDSTOP_EXISTS(axis)) { - DEPLOY_SERVO_ENDSTOP(axis); - if (_Z_SERVO_SUBTEST) endstops.z_probe_enabled = true; - } - #endif - // Set a flag for Z motor locking #if ENABLED(Z_DUAL_ENDSTOPS) if (axis == Z_AXIS) stepper.set_homing_flag(true); @@ -2423,8 +2413,8 @@ static void homeaxis(AxisEnum axis) { axis_known_position[axis] = true; axis_homed[axis] = true; - // Put away the Z probe with a function - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) + // Put away the Z probe + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_ENDSTOP_SERVO if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_STOW)); @@ -2433,33 +2423,6 @@ static void homeaxis(AxisEnum axis) { } #endif - // Retract X, Y (or Z) Servo endstop if enabled - #if ENABLED(HAS_SERVO_ENDSTOPS) - if (_Z_SERVO_TEST && SERVO_ENDSTOP_EXISTS(axis)) { - // Raise the servo probe before stow outside ABL context. - // This is a workaround to allow use of a Servo Probe without - // ABL until more global probe handling is implemented. - #if Z_RAISE_AFTER_PROBING > 0 - if (axis == Z_AXIS) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Raise Z (after) by ", Z_RAISE_AFTER_PROBING); - #endif - current_position[Z_AXIS] = Z_RAISE_AFTER_PROBING; - feedrate = homing_feedrate[Z_AXIS]; - line_to_current_position(); - stepper.synchronize(); - } - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_ENDSTOPS > Stow with servo.move()"); - #endif - STOW_SERVO_ENDSTOP(axis); - if (_Z_SERVO_SUBTEST) endstops.enable_z_probe(false); - } - - #endif // HAS_SERVO_ENDSTOPS - } #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3801,7 +3764,7 @@ inline void gcode_G28() { #endif current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z) - #if ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + #if HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + Z_RAISE_AFTER_PROBING #endif ; @@ -3816,11 +3779,9 @@ inline void gcode_G28() { // Sled assembly for Cartesian bots #if ENABLED(Z_PROBE_SLED) dock_sled(true); // dock the sled - #else + #elif !HAS_Z_ENDSTOP_SERVO && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) // Raise Z axis for non-delta and non servo based probes - #if DISABLED(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) - raise_z_after_probing(); - #endif + raise_z_after_probing(); #endif #endif // !DELTA @@ -3862,8 +3823,8 @@ inline void gcode_G28() { * G30: Do a single Z probe at the current XY */ inline void gcode_G30() { - #if ENABLED(HAS_SERVO_ENDSTOPS) - raise_z_for_servo(); + #if HAS_Z_ENDSTOP_SERVO + raise_z_for_servo(Z_RAISE_BEFORE_PROBING); #endif deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -3884,8 +3845,8 @@ inline void gcode_G28() { clean_up_after_endstop_move(); // Too early. must be done after the stowing. - #if ENABLED(HAS_SERVO_ENDSTOPS) - raise_z_for_servo(); + #if HAS_Z_ENDSTOP_SERVO + raise_z_for_servo(Z_RAISE_AFTER_PROBING); #endif stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -6019,14 +5980,14 @@ inline void gcode_M303() { */ inline void gcode_M400() { stepper.synchronize(); } -#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY)) +#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY)) /** * M401: Engage Z Servo endstop if available */ inline void gcode_M401() { - #if ENABLED(HAS_SERVO_ENDSTOPS) - raise_z_for_servo(); + #if HAS_Z_ENDSTOP_SERVO + raise_z_for_servo(Z_RAISE_BEFORE_PROBING); #endif deploy_z_probe(); } @@ -6035,13 +5996,13 @@ inline void gcode_M400() { stepper.synchronize(); } * M402: Retract Z Servo endstop if enabled */ inline void gcode_M402() { - #if ENABLED(HAS_SERVO_ENDSTOPS) - raise_z_for_servo(); + #if HAS_Z_ENDSTOP_SERVO + raise_z_for_servo(Z_RAISE_AFTER_PROBING); #endif stow_z_probe(false); } -#endif // AUTO_BED_LEVELING_FEATURE && (ENABLED(HAS_SERVO_ENDSTOPS) || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED +#endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_ENDSTOP_SERVO || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -7338,14 +7299,14 @@ void process_next_command() { gcode_M400(); break; - #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) + #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) case 401: gcode_M401(); break; case 402: gcode_M402(); break; - #endif // AUTO_BED_LEVELING_FEATURE && (ENABLED(HAS_SERVO_ENDSTOPS) || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED + #endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_ENDSTOP_SERVO || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 063f4af22..5aea3663c 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -170,26 +170,19 @@ /** * Limited number of servos */ -#if NUM_SERVOS > 4 - #error "The maximum number of SERVOS in Marlin is 4." -#endif #if defined(NUM_SERVOS) && NUM_SERVOS > 0 - #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0 - #if X_ENDSTOP_SERVO_NR >= NUM_SERVOS - #error "X_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." - #elif Y_ENDSTOP_SERVO_NR >= NUM_SERVOS - #error "Y_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." - #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS - #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." - #endif + #if NUM_SERVOS > 4 + #error "The maximum number of SERVOS in Marlin is 4." + #elif HAS_Z_ENDSTOP_SERVO && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS + #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." #endif #endif /** * Servo deactivation depends on servo endstops */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && DISABLED(HAS_SERVO_ENDSTOPS) - #error "At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_ENDSTOP_SERVO + #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." #endif /** @@ -288,8 +281,8 @@ //#if Z_ENDSTOP_SERVO_NR < 0 // #error "You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_MIN_PROBE_ENDSTOP." //#endif - //#ifndef SERVO_ENDSTOP_ANGLES - // #error "You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP." + //#ifndef Z_SERVO_ANGLES + // #error "You must have Z_SERVO_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP." //#endif #endif @@ -613,6 +606,10 @@ #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." #elif defined(EXTRUDER_WATTS) #error "EXTRUDER_WATTS is deprecated. Use HOTEND_WATTS instead." +#elif defined(SERVO_ENDSTOP_ANGLES) + #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." +#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) + #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index f92302db5..4ae2fd7ae 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -402,7 +402,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1147,10 +1147,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index c243209d5..fe0c5898d 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -400,7 +400,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1145,10 +1145,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 34ee387ee..337d3617c 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -412,7 +412,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1156,10 +1156,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index d5e6a0df0..30c7fb081 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -414,7 +414,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1158,10 +1158,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 6797fcd89..a5b4cbf47 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -437,7 +437,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1181,10 +1181,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 9a4a2c7fb..e9a1f6e24 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -420,7 +420,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1164,10 +1164,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index dff38c635..c327bcae3 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -414,7 +414,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1161,10 +1161,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 5ac806382..4dd49cff2 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -428,7 +428,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1172,10 +1172,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 5c1742d68..a76f9f740 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -441,7 +441,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1185,10 +1185,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 4055e15a3..64e36be91 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -412,7 +412,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1156,10 +1156,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index fdbf9a869..d6281d3be 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -420,7 +420,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1164,10 +1164,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index d6b783a95..08e124693 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -462,7 +462,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1253,10 +1253,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 6f2963c37..bdf73c02d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -462,7 +462,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1247,10 +1247,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 5b4436647..db683c539 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -462,7 +462,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1250,10 +1250,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 9ec47259d..f9b9459cb 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -451,7 +451,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1250,10 +1250,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 646c89416..102490e20 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -460,7 +460,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1252,10 +1252,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 2ad761ce5..232894987 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -423,7 +423,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1167,10 +1167,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 4d8b04e38..d8aadd709 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -410,7 +410,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1158,10 +1158,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // From 1bed392c682f1f053fafb94ca51136f4f0003084 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Jun 2016 18:15:48 -0700 Subject: [PATCH 090/580] HAS_Z_ENDSTOP_SERVO => HAS_Z_SERVO_ENDSTOP --- Marlin/Conditionals.h | 6 +++--- Marlin/Marlin_main.cpp | 40 ++++++++++++++++++++-------------------- Marlin/SanityCheck.h | 12 ++++++------ 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 4987e0055..dba97862c 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -373,8 +373,8 @@ #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #endif - #define HAS_Z_ENDSTOP_SERVO (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) - #define SERVO_LEVELING (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_ENDSTOP_SERVO) + #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) + #define SERVO_LEVELING (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_SERVO_ENDSTOP) /** * Sled Options @@ -769,7 +769,7 @@ #endif #endif - #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED)) + #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED)) #define PROBE_PIN_CONFIGURED (HAS_Z_MIN_PROBE_PIN || (HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 26525d856..8d5361659 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -391,7 +391,7 @@ static uint8_t target_extruder; }; #endif -#if HAS_Z_ENDSTOP_SERVO +#if HAS_Z_SERVO_ENDSTOP const int z_servo_angle[2] = Z_SERVO_ANGLES; #endif @@ -746,7 +746,7 @@ void servo_init() { servo[3].detach(); #endif - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP endstops.enable_z_probe(false); @@ -760,7 +760,7 @@ void servo_init() { * */ STOW_Z_SERVO(); - #endif // HAS_Z_ENDSTOP_SERVO + #endif // HAS_Z_SERVO_ENDSTOP } @@ -1829,7 +1829,7 @@ static void setup_for_endstop_move() { if (endstops.z_probe_enabled) return; - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP // Engage Z Servo endstop if enabled DEPLOY_Z_SERVO(); @@ -1916,7 +1916,7 @@ static void setup_for_endstop_move() { } static void stow_z_probe(bool doRaise = true) { - #if !(HAS_Z_ENDSTOP_SERVO && (Z_RAISE_AFTER_PROBING > 0)) + #if !(HAS_Z_SERVO_ENDSTOP && (Z_RAISE_AFTER_PROBING > 0)) UNUSED(doRaise); #endif #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1925,7 +1925,7 @@ static void setup_for_endstop_move() { if (!endstops.z_probe_enabled) return; - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP // Retract Z Servo endstop if enabled #if Z_RAISE_AFTER_PROBING > 0 @@ -2156,7 +2156,7 @@ static void setup_for_endstop_move() { #endif // DELTA - #if HAS_Z_ENDSTOP_SERVO && DISABLED(Z_PROBE_SLED) + #if HAS_Z_SERVO_ENDSTOP /** * Raise Z to a minimum height to make room for a servo to move @@ -2283,7 +2283,7 @@ static void homeaxis(AxisEnum axis) { #define _Z_STOW (stow_z_probe()) #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z #define _Z_SERVO_SUBTEST false // Z will never be invoked - #elif HAS_Z_ENDSTOP_SERVO + #elif HAS_Z_SERVO_ENDSTOP #define _Z_DEPLOY do{ raise_z_for_servo(Z_RAISE_BEFORE_PROBING); DEPLOY_Z_SERVO(); endstops.z_probe_enabled = true; }while(0) #define _Z_STOW do{ raise_z_for_servo(Z_RAISE_AFTER_PROBING); STOW_Z_SERVO(); endstops.z_probe_enabled = false; }while(0) #define _Z_SERVO_TEST true // Z not deployed yet @@ -2291,7 +2291,7 @@ static void homeaxis(AxisEnum axis) { #endif // Homing Z towards the bed? Deploy the Z probe or endstop. - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_ENDSTOP_SERVO + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_SERVO_ENDSTOP if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_DEPLOY)); @@ -2414,7 +2414,7 @@ static void homeaxis(AxisEnum axis) { axis_homed[axis] = true; // Put away the Z probe - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_ENDSTOP_SERVO + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_SERVO_ENDSTOP if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_STOW)); @@ -3764,7 +3764,7 @@ inline void gcode_G28() { #endif current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z) - #if HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + #if HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + Z_RAISE_AFTER_PROBING #endif ; @@ -3779,7 +3779,7 @@ inline void gcode_G28() { // Sled assembly for Cartesian bots #if ENABLED(Z_PROBE_SLED) dock_sled(true); // dock the sled - #elif !HAS_Z_ENDSTOP_SERVO && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) + #elif !HAS_Z_SERVO_ENDSTOP && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) // Raise Z axis for non-delta and non servo based probes raise_z_after_probing(); #endif @@ -3823,7 +3823,7 @@ inline void gcode_G28() { * G30: Do a single Z probe at the current XY */ inline void gcode_G30() { - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP raise_z_for_servo(Z_RAISE_BEFORE_PROBING); #endif deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -3845,7 +3845,7 @@ inline void gcode_G28() { clean_up_after_endstop_move(); // Too early. must be done after the stowing. - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP raise_z_for_servo(Z_RAISE_AFTER_PROBING); #endif stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -5980,13 +5980,13 @@ inline void gcode_M303() { */ inline void gcode_M400() { stepper.synchronize(); } -#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY)) +#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY)) /** * M401: Engage Z Servo endstop if available */ inline void gcode_M401() { - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP raise_z_for_servo(Z_RAISE_BEFORE_PROBING); #endif deploy_z_probe(); @@ -5996,13 +5996,13 @@ inline void gcode_M400() { stepper.synchronize(); } * M402: Retract Z Servo endstop if enabled */ inline void gcode_M402() { - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP raise_z_for_servo(Z_RAISE_AFTER_PROBING); #endif stow_z_probe(false); } -#endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_ENDSTOP_SERVO || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED +#endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_SERVO_ENDSTOP || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -7299,14 +7299,14 @@ void process_next_command() { gcode_M400(); break; - #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) + #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) case 401: gcode_M401(); break; case 402: gcode_M402(); break; - #endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_ENDSTOP_SERVO || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED + #endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_SERVO_ENDSTOP || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 5aea3663c..bc3bf650b 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -173,7 +173,7 @@ #if defined(NUM_SERVOS) && NUM_SERVOS > 0 #if NUM_SERVOS > 4 #error "The maximum number of SERVOS in Marlin is 4." - #elif HAS_Z_ENDSTOP_SERVO && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS + #elif HAS_Z_SERVO_ENDSTOP && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." #endif #endif @@ -181,7 +181,7 @@ /** * Servo deactivation depends on servo endstops */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_ENDSTOP_SERVO +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_ENDSTOP #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." #endif @@ -246,10 +246,10 @@ /** * Only allow one probe option to be defined */ - #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \ - || (ENABLED(MECHANICAL_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \ - || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \ - || (HAS_Z_ENDSTOP_SERVO && ENABLED(Z_PROBE_SLED)) + #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + || (ENABLED(MECHANICAL_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + || (HAS_Z_SERVO_ENDSTOP && ENABLED(Z_PROBE_SLED)) #error "Please define only one type of probe: Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #endif From e189f6a8428e84993e624b81c1cef4f210a12ccd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Jun 2016 19:26:30 -0700 Subject: [PATCH 091/580] Patch Travis test for bed leveling --- .travis.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 89459cbe7..40a652523 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,10 +90,11 @@ script: - opt_enable PIDTEMPBED - build_marlin # - # Test AUTO_BED_LEVELING & DEBUG_LEVELING_FEATURE + # Test AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE with a Servo Probe # - restore_configs - - opt_enable ENABLE_AUTO_BED_LEVELING DEBUG_LEVELING_FEATURE + - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE + - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - build_marlin # # Test MESH_BED_LEVELING feature, with LCD @@ -102,11 +103,6 @@ script: - opt_enable MESH_BED_LEVELING MESH_G28_REST_ORIGIN MANUAL_BED_LEVELING ULTIMAKERCONTROLLER - build_marlin # - # Test AUTO_BED_LEVELING & DEBUG_LEVELING_FEATURE with Servos - # - - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - - build_marlin - # # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, # INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT # From 1000563d80c01e6795ef693dd783b543faa4d3d8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Jun 2016 18:05:20 -0700 Subject: [PATCH 092/580] Make M851 standard with a bed probe --- Marlin/Configuration.h | 12 --------- Marlin/Marlin.h | 2 +- Marlin/Marlin_main.cpp | 15 ++++++----- Marlin/configuration_store.cpp | 25 +++++++------------ .../Cartesio/Configuration.h | 12 --------- .../Felix/Configuration.h | 12 --------- .../Felix/DUAL/Configuration.h | 12 --------- .../Hephestos/Configuration.h | 12 --------- .../Hephestos_2/Configuration.h | 15 +++-------- .../K8200/Configuration.h | 12 --------- .../RepRapWorld/Megatronics/Configuration.h | 12 --------- .../RigidBot/Configuration.h | 12 --------- .../SCARA/Configuration.h | 12 --------- .../TAZ4/Configuration.h | 12 --------- .../WITBOX/Configuration.h | 12 --------- .../adafruit/ST7565/Configuration.h | 12 --------- .../delta/biv2.5/Configuration.h | 12 --------- .../delta/generic/Configuration.h | 12 --------- .../delta/kossel_mini/Configuration.h | 12 --------- .../delta/kossel_pro/Configuration.h | 15 +++-------- .../delta/kossel_xl/Configuration.h | 12 --------- .../makibox/Configuration.h | 12 --------- .../tvrrug/Round2/Configuration.h | 12 --------- Marlin/ultralcd.cpp | 2 +- 24 files changed, 28 insertions(+), 262 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 509427b61..c0aab3ee1 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -719,18 +719,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index f7c51e252..b99c3fb9b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -319,7 +319,7 @@ float code_value_temp_diff(); extern float z_endstop_adj; #endif -#if ENABLED(AUTO_BED_LEVELING_FEATURE) +#if HAS_BED_PROBE extern float zprobe_zoffset; #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3d63bec3d..2b6816488 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -364,9 +364,12 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL static uint8_t target_extruder; +#if HAS_BED_PROBE + float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; +#endif + #if ENABLED(AUTO_BED_LEVELING_FEATURE) int xy_travel_speed = XY_TRAVEL_SPEED; - float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; bool bed_leveling_in_progress = false; #endif @@ -1490,7 +1493,7 @@ static void set_axis_is_at_home(AxisEnum axis) { current_position[axis] = base_home_pos(axis) + home_offset[axis]; update_software_endstops(axis); - #if ENABLED(AUTO_BED_LEVELING_FEATURE) && Z_HOME_DIR < 0 + #if HAS_BED_PROBE && Z_HOME_DIR < 0 if (axis == Z_AXIS) { current_position[Z_AXIS] -= zprobe_zoffset; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -6263,9 +6266,9 @@ inline void gcode_M503() { #endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED -#ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET +#if HAS_BED_PROBE - inline void gcode_SET_Z_PROBE_OFFSET() { + inline void gcode_M851() { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET); @@ -6291,7 +6294,7 @@ inline void gcode_M503() { SERIAL_EOL; } -#endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET +#endif // HAS_BED_PROBE #if ENABLED(FILAMENTCHANGEENABLE) @@ -7400,7 +7403,7 @@ void process_next_command() { #ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET case CUSTOM_M_CODE_SET_Z_PROBE_OFFSET: - gcode_SET_Z_PROBE_OFFSET(); + gcode_M851(); break; #endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 130763123..4bad3ce0c 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -210,7 +210,7 @@ void Config_StoreSettings() { for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_WRITE_VAR(i, dummy); #endif // MESH_BED_LEVELING - #if DISABLED(AUTO_BED_LEVELING_FEATURE) + #if !HAS_BED_PROBE float zprobe_zoffset = 0; #endif EEPROM_WRITE_VAR(i, zprobe_zoffset); @@ -389,7 +389,7 @@ void Config_RetrieveSettings() { for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); #endif // MESH_BED_LEVELING - #if DISABLED(AUTO_BED_LEVELING_FEATURE) + #if !HAS_BED_PROBE float zprobe_zoffset = 0; #endif EEPROM_READ_VAR(i, zprobe_zoffset); @@ -554,7 +554,7 @@ void Config_ResetDefault() { mbl.reset(); #endif - #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #if HAS_BED_PROBE zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; #endif @@ -927,20 +927,13 @@ void Config_PrintSettings(bool forReplay) { /** * Auto Bed Leveling */ - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #if ENABLED(CUSTOM_M_CODES) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM("Z-Probe Offset (mm):"); - } + #if HAS_BED_PROBE + if (!forReplay) { CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M" STRINGIFY(CUSTOM_M_CODE_SET_Z_PROBE_OFFSET) " Z", zprobe_zoffset); - #else - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOPAIR("Z-Probe Offset (mm):", zprobe_zoffset); - } - #endif + SERIAL_ECHOLNPGM("Z-Probe Offset (mm):"); + } + CONFIG_ECHO_START; + SERIAL_ECHOPAIR(" M851 Z", zprobe_zoffset); SERIAL_EOL; #endif } diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index d5fddbbd0..d86161a58 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -718,18 +718,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index f92302db5..cad842c35 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -702,18 +702,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index c243209d5..c08e57e3c 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -700,18 +700,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 34ee387ee..a2f17dd2d 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -711,18 +711,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index d5e6a0df0..64f39854d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -713,17 +713,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -5 - #define Z_PROBE_OFFSET_RANGE_MAX 0 - #endif -#endif +// @section probes + +#define Z_PROBE_OFFSET_RANGE_MIN -5 +#define Z_PROBE_OFFSET_RANGE_MAX 0 // @section extras diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 6797fcd89..ababf64bb 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -736,18 +736,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 9a4a2c7fb..66af697dd 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -719,18 +719,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index dff38c635..2b544085b 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -714,18 +714,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 5ac806382..4e2792a1d 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -727,18 +727,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -//#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 5c1742d68..a015b7559 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -740,18 +740,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 4055e15a3..0977bc207 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -711,18 +711,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index fdbf9a869..f9f04744e 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -719,18 +719,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index d6b783a95..1a4a5b364 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -808,18 +808,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 6f2963c37..a555b6005 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -802,18 +802,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 5b4436647..cfb9ef354 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -805,18 +805,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 9ec47259d..22308c458 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -805,17 +805,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -15 - #define Z_PROBE_OFFSET_RANGE_MAX -5 - #endif -#endif +// @section probes + +#define Z_PROBE_OFFSET_RANGE_MIN -15 +#define Z_PROBE_OFFSET_RANGE_MAX 5 // @section extras diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 646c89416..f871b083f 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -807,18 +807,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 2ad761ce5..d0ac688f9 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -722,18 +722,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 4d8b04e38..8e40a5c5b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -713,18 +713,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Additional Features =========================== //============================================================================= -// @section more - -// Custom M code points -#define CUSTOM_M_CODES -#if ENABLED(CUSTOM_M_CODES) - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 - #define Z_PROBE_OFFSET_RANGE_MIN -20 - #define Z_PROBE_OFFSET_RANGE_MAX 20 - #endif -#endif - // @section extras // diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index add6cb029..537262684 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1684,7 +1684,7 @@ static void lcd_status_screen() { static void lcd_control_motion_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL); - #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #if HAS_BED_PROBE MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif // Manual bed leveling, Bed Z: From a8b8796cd72ae1f59abaa697447fc30ef149e5d5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Jun 2016 19:00:51 -0700 Subject: [PATCH 093/580] Define probe offsets when a probe exists --- Marlin/Conditionals.h | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 3ccfe57f7..d732dbccc 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -383,24 +383,6 @@ #define Z_SAFE_HOMING #endif - /** - * Z Safe Homing dependencies - */ - #if ENABLED(Z_SAFE_HOMING) - #ifndef X_PROBE_OFFSET_FROM_EXTRUDER - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif - #ifndef Y_PROBE_OFFSET_FROM_EXTRUDER - #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif - #ifndef Z_PROBE_OFFSET_FROM_EXTRUDER - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif - #ifndef XY_TRAVEL_SPEED - #define XY_TRAVEL_SPEED 4000 - #endif - #endif - /** * Host keep alive */ @@ -785,6 +767,30 @@ #define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED) + /** + * Probe dependencies + */ + #if HAS_BED_PROBE + #ifndef X_PROBE_OFFSET_FROM_EXTRUDER + #define X_PROBE_OFFSET_FROM_EXTRUDER 0 + #endif + #ifndef Y_PROBE_OFFSET_FROM_EXTRUDER + #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 + #endif + #ifndef Z_PROBE_OFFSET_FROM_EXTRUDER + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 + #endif + #ifndef Z_PROBE_OFFSET_RANGE_MIN + #define Z_PROBE_OFFSET_RANGE_MIN -20 + #endif + #ifndef Z_PROBE_OFFSET_RANGE_MAX + #define Z_PROBE_OFFSET_RANGE_MAX 20 + #endif + #ifndef XY_TRAVEL_SPEED + #define XY_TRAVEL_SPEED 4000 + #endif + #endif + /** * Delta radius/rod trimmers */ From fc56a547d1b50d4aba36540009048a302a34d125 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 17 Jun 2016 15:03:33 -0700 Subject: [PATCH 094/580] Rename movement section to motion --- Marlin/Configuration.h | 2 +- Marlin/example_configurations/Cartesio/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/DUAL/Configuration.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/Hephestos_2/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- Marlin/example_configurations/RigidBot/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/TAZ4/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c0aab3ee1..b5a1f614d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -691,7 +691,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index d86161a58..bf8b34e60 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -690,7 +690,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index cad842c35..a81b40890 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -673,7 +673,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index c08e57e3c..2bacc907f 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -671,7 +671,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index a2f17dd2d..7a4c2e5fc 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -683,7 +683,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 64f39854d..4d91ef562 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -685,7 +685,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index ababf64bb..5f9217e5a 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -708,7 +708,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 66af697dd..1ec58c76c 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -691,7 +691,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 2b544085b..e4237e576 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -685,7 +685,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 4e2792a1d..ee289a24b 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -699,7 +699,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index a015b7559..82c931409 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -712,7 +712,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 0977bc207..ccde39656 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -683,7 +683,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index f9f04744e..12df1d545 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -691,7 +691,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 1a4a5b364..c32698c10 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -777,7 +777,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index a555b6005..7a9584b39 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -771,7 +771,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index cfb9ef354..f4cfe56a8 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -774,7 +774,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 22308c458..fa4eb5293 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -768,7 +768,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index f871b083f..9d60cd77a 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -769,7 +769,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index d0ac688f9..62664377e 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -694,7 +694,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 8e40a5c5b..ee7e20808 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -681,7 +681,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif -// @section movement +// @section motion /** * MOVEMENT SETTINGS From eab44b30d487999450f33bc0695e21d214a148f3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 17 Jun 2016 15:03:43 -0700 Subject: [PATCH 095/580] Safety and serial sections --- Marlin/Configuration_adv.h | 9 +++++---- .../example_configurations/Cartesio/Configuration_adv.h | 9 +++++---- Marlin/example_configurations/Felix/Configuration_adv.h | 9 +++++---- .../example_configurations/Hephestos/Configuration_adv.h | 9 +++++---- .../Hephestos_2/Configuration_adv.h | 9 +++++---- Marlin/example_configurations/K8200/Configuration_adv.h | 9 +++++---- .../example_configurations/RigidBot/Configuration_adv.h | 9 +++++---- Marlin/example_configurations/SCARA/Configuration_adv.h | 9 +++++---- Marlin/example_configurations/TAZ4/Configuration_adv.h | 9 +++++---- Marlin/example_configurations/WITBOX/Configuration_adv.h | 9 +++++---- .../delta/biv2.5/Configuration_adv.h | 9 +++++---- .../delta/generic/Configuration_adv.h | 9 +++++---- .../delta/kossel_mini/Configuration_adv.h | 9 +++++---- .../delta/kossel_pro/Configuration_adv.h | 9 +++++---- .../delta/kossel_xl/Configuration_adv.h | 9 +++++---- .../example_configurations/makibox/Configuration_adv.h | 9 +++++---- .../tvrrug/Round2/Configuration_adv.h | 9 +++++---- 17 files changed, 85 insertions(+), 68 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index db7cc55f5..d0fd22139 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 7f61cf437..c69dc70f0 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index d0df4f71e..1cdad67fa 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 11c6130a9..537c9f52d 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 33e50780d..f5dad62f8 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -417,9 +417,10 @@ #define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index e6bb3bb18..00f203d2a 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -423,9 +423,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -516,9 +517,9 @@ const unsigned int dropsegments = 2; //everything with less than this number of #define BLOCK_BUFFER_SIZE 32 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index daffc55c7..9f4ef31cb 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 8 diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index a694aa5bb..add39fa3e 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 914644a6c..96e38bc6c 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -425,9 +425,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -518,9 +519,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 11c6130a9..537c9f52d 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 72117ccbf..b90ca6a1c 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -419,9 +419,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -512,9 +513,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index ffd33436b..bb3674b15 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -419,9 +419,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -512,9 +513,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index f182a71c5..cfd313dce 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -418,9 +418,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -511,9 +512,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index f4408f3db..221ddb16c 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -423,9 +423,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -516,9 +517,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 4c629088a..7286e3a69 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -419,9 +419,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -512,9 +513,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index ffe73bc90..820d9d53e 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index b94317331..fd96c8947 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -417,9 +417,10 @@ //#define USE_SMALL_INFOFONT #endif // DOGLCD -// @section more +// @section safety -// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. #define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) @@ -510,9 +511,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define BLOCK_BUFFER_SIZE 16 // maximize block buffer #endif -// @section more +// @section serial -//The ASCII buffer for receiving from the serial: +// The ASCII buffer for serial input #define MAX_CMD_SIZE 96 #define BUFSIZE 4 From de177ba6c9421385d3f329668ce592ddb0354168 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 17 Jun 2016 17:26:21 -0700 Subject: [PATCH 096/580] Minor tweaks to M109 / M190 --- Marlin/Marlin_main.cpp | 64 ++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3d63bec3d..4229e565c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4738,12 +4738,23 @@ inline void gcode_M109() { KEEPALIVE_STATE(NOT_BUSY); do { + // Target temperature might be changed during the loop + if (theTarget != thermalManager.degTargetHotend(target_extruder)) { + wants_to_cool = thermalManager.isCoolingHotend(target_extruder); + theTarget = thermalManager.degTargetHotend(target_extruder); + + // Exit if S, continue if S, R, or R + if (no_wait_for_cooling && wants_to_cool) break; + + // Prevent a wait-forever situation if R is misused i.e. M109 R0 + // Try to calculate a ballpark safe margin by halving EXTRUDE_MINTEMP + if (wants_to_cool && theTarget < (EXTRUDE_MINTEMP)/2) break; + } + now = millis(); if (ELAPSED(now, next_temp_ms)) { //Print temp & remaining time every 1s while waiting next_temp_ms = now + 1000UL; - #if HAS_TEMP_HOTEND || HAS_TEMP_BED - print_heaterstates(); - #endif + print_heaterstates(); #if TEMP_RESIDENCY_TIME > 0 SERIAL_PROTOCOLPGM(" W:"); if (residency_start_ms) { @@ -4758,19 +4769,6 @@ inline void gcode_M109() { #endif } - // Target temperature might be changed during the loop - if (theTarget != thermalManager.degTargetHotend(target_extruder)) { - wants_to_cool = thermalManager.isCoolingHotend(target_extruder); - theTarget = thermalManager.degTargetHotend(target_extruder); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - - // Prevent a wait-forever situation if R is misused i.e. M109 R0 - // Try to calculate a ballpark safe margin by halving EXTRUDE_MINTEMP - if (wants_to_cool && theTarget < (EXTRUDE_MINTEMP)/2) break; - } - idle(); refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out @@ -4780,11 +4778,11 @@ inline void gcode_M109() { if (!residency_start_ms) { // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_WINDOW) residency_start_ms = millis(); + if (temp_diff < TEMP_WINDOW) residency_start_ms = now; } else if (temp_diff > TEMP_HYSTERESIS) { // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = millis(); + residency_start_ms = now; } #endif //TEMP_RESIDENCY_TIME > 0 @@ -4825,6 +4823,19 @@ inline void gcode_M109() { KEEPALIVE_STATE(NOT_BUSY); do { + // Target temperature might be changed during the loop + if (theTarget != thermalManager.degTargetBed()) { + wants_to_cool = thermalManager.isCoolingBed(); + theTarget = thermalManager.degTargetBed(); + + // Exit if S, continue if S, R, or R + if (no_wait_for_cooling && wants_to_cool) break; + + // Prevent a wait-forever situation if R is misused i.e. M190 R0 + // Simply don't wait to cool a bed under 30C + if (wants_to_cool && theTarget < 30) break; + } + now = millis(); if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up. next_temp_ms = now + 1000UL; @@ -4843,19 +4854,6 @@ inline void gcode_M109() { #endif } - // Target temperature might be changed during the loop - if (theTarget != thermalManager.degTargetBed()) { - wants_to_cool = thermalManager.isCoolingBed(); - theTarget = thermalManager.degTargetBed(); - - // Exit if S, continue if S, R, or R - if (no_wait_for_cooling && wants_to_cool) break; - - // Prevent a wait-forever situation if R is misused i.e. M190 R0 - // Simply don't wait to cool a bed under 30C - if (wants_to_cool && theTarget < 30) break; - } - idle(); refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out @@ -4865,11 +4863,11 @@ inline void gcode_M109() { if (!residency_start_ms) { // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time. - if (temp_diff < TEMP_BED_WINDOW) residency_start_ms = millis(); + if (temp_diff < TEMP_BED_WINDOW) residency_start_ms = now; } else if (temp_diff > TEMP_BED_HYSTERESIS) { // Restart the timer whenever the temperature falls outside the hysteresis. - residency_start_ms = millis(); + residency_start_ms = now; } #endif //TEMP_BED_RESIDENCY_TIME > 0 From 17bd77031fd23c1c2621a1940e12c1dbbe14c4e4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 17 Jun 2016 17:47:07 -0700 Subject: [PATCH 097/580] .gitignore comments in correct format --- .gitignore | 71 +++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index d83d289e1..1e8701253 100644 --- a/.gitignore +++ b/.gitignore @@ -1,39 +1,38 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -// Our automatic versioning scheme generates the following file -// NEVER put it in the repository +# +# Marlin 3D Printer Firmware +# Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] +# +# Based on Sprinter and grbl. +# Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# Our automatic versioning scheme generates the following file +# NEVER put it in the repository _Version.h -// -// OS -// +# +# OS +# applet/ *.DS_Store -// -// Misc -// +# +# Misc +# *~ *.orig *.rej @@ -45,9 +44,9 @@ applet/ *.swp -// -// C++ -// +# +# C++ +# # Compiled Object files *.slo *.lo @@ -79,9 +78,9 @@ applet/ *.app -// -// C -// +# +# C +# # Object files *.o *.ko From bbf5b486c3be8b4de9ec4d6a294f7a3ea529ba1b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 17 Jun 2016 18:27:14 -0700 Subject: [PATCH 098/580] Add an SD Card stop function, use in ultralcd --- Marlin/cardreader.cpp | 7 +++++++ Marlin/cardreader.h | 1 + Marlin/ultralcd.cpp | 11 +++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 2fead5382..3910bee4e 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -282,6 +282,13 @@ void CardReader::pauseSDPrint() { if (sdprinting) sdprinting = false; } +void CardReader::stopSDPrint() { + if (sdprinting) { + sdprinting = false; + file.close(); + } +} + void CardReader::openLogFile(char* name) { logging = true; openFile(name, false); diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h index a18b718b5..78280fc8d 100644 --- a/Marlin/cardreader.h +++ b/Marlin/cardreader.h @@ -48,6 +48,7 @@ public: void openAndPrintFile(const char *name); void startFileprint(); void pauseSDPrint(); + void stopSDPrint(); void getStatus(); void printingHasFinished(); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 537262684..6f5990aca 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -496,17 +496,16 @@ static void lcd_status_screen() { } static void lcd_sdcard_stop() { - stepper.quick_stop(); - #if DISABLED(DELTA) && DISABLED(SCARA) - set_current_position_from_planner(); - #endif // !DELTA && !SCARA + card.stopSDPrint(); clear_command_queue(); - card.sdprinting = false; - card.closefile(); + stepper.quick_stop(); print_job_timer.stop(); thermalManager.autotempShutdown(); cancel_heatup = true; lcd_setstatus(MSG_PRINT_ABORTED, true); + #if DISABLED(DELTA) && DISABLED(SCARA) + set_current_position_from_planner(); + #endif // !DELTA && !SCARA } #endif //SDSUPPORT From defcacc1a971690ddd06ea50cb4aaf7fd443ce9b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 17 Jun 2016 18:49:17 -0700 Subject: [PATCH 099/580] Delete some obsolete Z servo macros --- Marlin/Marlin_main.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0a6a9ebdc..224636899 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2279,18 +2279,12 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(Z_PROBE_SLED) #define _Z_DEPLOY (dock_sled(false)) #define _Z_STOW (dock_sled(true)) - #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z - #define _Z_SERVO_SUBTEST false // Z will never be invoked #elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) #define _Z_DEPLOY (deploy_z_probe()) #define _Z_STOW (stow_z_probe()) - #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z - #define _Z_SERVO_SUBTEST false // Z will never be invoked #elif HAS_Z_SERVO_ENDSTOP #define _Z_DEPLOY do{ raise_z_for_servo(Z_RAISE_BEFORE_PROBING); DEPLOY_Z_SERVO(); endstops.z_probe_enabled = true; }while(0) #define _Z_STOW do{ raise_z_for_servo(Z_RAISE_AFTER_PROBING); STOW_Z_SERVO(); endstops.z_probe_enabled = false; }while(0) - #define _Z_SERVO_TEST true // Z not deployed yet - #define _Z_SERVO_SUBTEST (axis == Z_AXIS) // Z is a probe #endif // Homing Z towards the bed? Deploy the Z probe or endstop. From 5991eb428f3069cb99a2529f114c6e8bb1fb6896 Mon Sep 17 00:00:00 2001 From: Juan Ricardo Gomez Anaya Date: Sat, 18 Jun 2016 00:27:04 -0500 Subject: [PATCH 100/580] Update Spanish Language Spanish language update and also add missing messages --- Marlin/language_es.h | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 947294579..e3e388515 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -38,16 +38,20 @@ #define WELCOME_MSG MACHINE_NAME " lista." #define MSG_SD_INSERTED "Tarjeta colocada" #define MSG_SD_REMOVED "Tarjeta retirada" +#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters #define MSG_MAIN "Menu principal" #define MSG_AUTOSTART "Inicio automatico" #define MSG_DISABLE_STEPPERS "Apagar motores" #define MSG_AUTO_HOME "Llevar al origen" +#define MSG_AUTO_HOME_X "Origen X" +#define MSG_AUTO_HOME_Y "Origen Y" +#define MSG_AUTO_HOME_Z "Origen Z" #define MSG_LEVEL_BED_HOMING "Origen XYZ" -#define MSG_LEVEL_BED_WAITING "Click to Begin" -#define MSG_LEVEL_BED_DONE "Leveling Done!" -#define MSG_LEVEL_BED_CANCEL "Cancel" +#define MSG_LEVEL_BED_WAITING "Presione para iniciar" +#define MSG_LEVEL_BED_DONE "Nivelacion lista!" +#define MSG_LEVEL_BED_CANCEL "Cancelar" #define MSG_SET_HOME_OFFSETS "Ajustar desfases" -#define MSG_HOME_OFFSETS_APPLIED "Offsets applied" +#define MSG_HOME_OFFSETS_APPLIED "Desfase aplicado" #define MSG_SET_ORIGIN "Establecer origen" #define MSG_PREHEAT_PLA "Precalentar PLA" #define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " @@ -59,6 +63,10 @@ #define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS "Todo" #define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS "Plataforma" #define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS "Config" +#define MSG_H1 "1" +#define MSG_H2 "2" +#define MSG_H3 "3" +#define MSG_H4 "4" #define MSG_COOLDOWN "Enfriar" #define MSG_SWITCH_PS_ON "Encender" #define MSG_SWITCH_PS_OFF "Apagar" @@ -70,12 +78,20 @@ #define MSG_MOVE_Y "Mover Y" #define MSG_MOVE_Z "Mover Z" #define MSG_MOVE_E "Extrusor" +#define MSG_MOVE_E1 "1" +#define MSG_MOVE_E2 "2" +#define MSG_MOVE_E3 "3" +#define MSG_MOVE_E4 "4" #define MSG_MOVE_01MM "Mover 0.1mm" #define MSG_MOVE_1MM "Mover 1mm" #define MSG_MOVE_10MM "Mover 10mm" #define MSG_SPEED "Velocidad" #define MSG_BED_Z "Plataforma Z" #define MSG_NOZZLE "Boquilla" +#define MSG_N1 " 1" +#define MSG_N2 " 2" +#define MSG_N3 " 3" +#define MSG_N4 " 4" #define MSG_BED "Plataforma" #define MSG_FAN_SPEED "Ventilador" #define MSG_FLOW "Flujo" @@ -90,6 +106,10 @@ #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" +#define MSG_E1 " E1" +#define MSG_E2 " E2" +#define MSG_E3 " E3" +#define MSG_E4 " E4" #define MSG_ACC "Aceleracion" #define MSG_VXY_JERK "Vxy-jerk" #define MSG_VZ_JERK "Vz-jerk" @@ -113,12 +133,16 @@ #define MSG_VOLUMETRIC "Filamento" #define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_FILAMENT_DIAM "Fil. Dia." +#define MSG_DIAM_E1 " 1" +#define MSG_DIAM_E2 " 2" +#define MSG_DIAM_E3 " 3" +#define MSG_DIAM_E4 " 4" #define MSG_CONTRAST "Contraste" #define MSG_STORE_EPROM "Guardar memoria" #define MSG_LOAD_EPROM "Cargar memoria" #define MSG_RESTORE_FAILSAFE "Restaurar memoria." #define MSG_REFRESH "Volver a cargar" -#define MSG_WATCH "Monitorizar" +#define MSG_WATCH "Informacion" #define MSG_PREPARE "Preparar" #define MSG_TUNE "Ajustar" #define MSG_PAUSE_PRINT "Pausar impresion" @@ -146,11 +170,12 @@ #define MSG_CNG_SDCARD "Cambiar tarjeta" #define MSG_ZPROBE_OUT "Sonda Z fuera" #define MSG_YX_UNHOMED "Reiniciar X/Y y Z" +#define MSG_XYZ_UNHOMED "Reiniciar XYZ" #define MSG_ZPROBE_ZOFFSET "Desfase Z" #define MSG_BABYSTEP_X "Micropaso X" #define MSG_BABYSTEP_Y "Micropaso Y" #define MSG_BABYSTEP_Z "Micropaso Z" -#define MSG_ENDSTOP_ABORT "Endstop abort" +#define MSG_ENDSTOP_ABORT "Cancelado - Endstop" #define MSG_HEATING_FAILED_LCD "Error: al calentar" #define MSG_ERR_REDUNDANT_TEMP "Error: temperatura redundante" #define MSG_THERMAL_RUNAWAY "Error de temperatura" From d3a05de96eafd7b113183947441936f8b3f85107 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Jun 2016 01:16:26 -0700 Subject: [PATCH 101/580] Save and restore feedrate in probe functions --- Marlin/Marlin_main.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 224636899..71d383a61 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1667,6 +1667,8 @@ static void setup_for_endstop_move() { static void run_z_probe() { + float old_feedrate = feedrate; + /** * To prevent stepper_inactive_time from running out and * EXTRUDER_RUNOUT_PREVENT from extruding @@ -1743,6 +1745,8 @@ static void setup_for_endstop_move() { #endif #endif // !DELTA + + feedrate = old_feedrate; } /** @@ -1750,7 +1754,7 @@ static void setup_for_endstop_move() { * The final current_position may not be the one that was requested */ static void do_blocking_move_to(float x, float y, float z) { - float oldFeedRate = feedrate; + float old_feedrate = feedrate; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z); @@ -1769,8 +1773,6 @@ static void setup_for_endstop_move() { else prepare_move_to_destination(); // this will also set_current_to_destination - stepper.synchronize(); - #else feedrate = homing_feedrate[Z_AXIS]; @@ -1784,11 +1786,12 @@ static void setup_for_endstop_move() { current_position[X_AXIS] = x; current_position[Y_AXIS] = y; line_to_current_position(); - stepper.synchronize(); #endif - feedrate = oldFeedRate; + stepper.synchronize(); + + feedrate = old_feedrate; } inline void do_blocking_move_to_xy(float x, float y) { @@ -1838,6 +1841,8 @@ static void setup_for_endstop_move() { DEPLOY_Z_SERVO(); #elif ENABLED(Z_PROBE_ALLEN_KEY) + float old_feedrate = feedrate; + feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE; // If endstop is already false, the Z probe is deployed @@ -1890,6 +1895,8 @@ static void setup_for_endstop_move() { destination[Y_AXIS] = destination[Y_AXIS] * 0.75; prepare_move_to_destination_raw(); // this will also set_current_to_destination + feedrate = old_feedrate; + stepper.synchronize(); #if ENABLED(Z_MIN_PROBE_ENDSTOP) @@ -1943,6 +1950,8 @@ static void setup_for_endstop_move() { #elif ENABLED(Z_PROBE_ALLEN_KEY) + float old_feedrate = feedrate; + // Move up for safety feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE; @@ -1983,6 +1992,8 @@ static void setup_for_endstop_move() { destination[Y_AXIS] = 0; prepare_move_to_destination_raw(); // this will also set_current_to_destination + feedrate = old_feedrate; + stepper.synchronize(); #if ENABLED(Z_MIN_PROBE_ENDSTOP) @@ -3829,9 +3840,8 @@ inline void gcode_G28() { // TODO: clear the leveling matrix or the planner will be set incorrectly setup_for_endstop_move(); // Too late. Must be done before deploying. - feedrate = homing_feedrate[Z_AXIS]; - run_z_probe(); + SERIAL_PROTOCOLPGM("Bed X: "); SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); SERIAL_PROTOCOLPGM(" Y: "); From d36d4edd8017363cf6e67b024e2d8814b83bca99 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Jun 2016 01:16:50 -0700 Subject: [PATCH 102/580] Tweak partial homing code --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 71d383a61..58113f2a2 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1891,8 +1891,8 @@ static void setup_for_endstop_move() { } // Partially Home X,Y for safety - destination[X_AXIS] = destination[X_AXIS] * 0.75; - destination[Y_AXIS] = destination[Y_AXIS] * 0.75; + destination[X_AXIS] *= 0.75; + destination[Y_AXIS] *= 0.75; prepare_move_to_destination_raw(); // this will also set_current_to_destination feedrate = old_feedrate; From 4e860babbc86fb19382fff0ff1685e2939a05b1c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Jun 2016 01:40:49 -0700 Subject: [PATCH 103/580] Allow setting xy_travel_speed for delta leveling also --- Marlin/Marlin_main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 58113f2a2..28324d02e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1762,7 +1762,7 @@ static void setup_for_endstop_move() { #if ENABLED(DELTA) - feedrate = XY_TRAVEL_SPEED; + feedrate = xy_travel_speed; destination[X_AXIS] = x; destination[Y_AXIS] = y; @@ -1854,7 +1854,6 @@ static void setup_for_endstop_move() { if (z_min_endstop) #endif { - // Move to the start position to initiate deployment destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X; destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y; From d55b94d60679fcee09763cff1ed883860a3a1f3a Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 18 Jun 2016 17:58:31 +0900 Subject: [PATCH 104/580] Follow-up the PR #4065 (Remove support for XY servo endstops) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update a forgotten Configuration.h of Cartesio --- Marlin/example_configurations/Cartesio/Configuration.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 1159bb87f..95e9f26b1 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -419,7 +419,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1155,10 +1155,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // From c475291e19d1fb1531dc2072a429a6d91ec6e0f6 Mon Sep 17 00:00:00 2001 From: Juan Ricardo Gomez Anaya Date: Sat, 18 Jun 2016 15:58:42 -0500 Subject: [PATCH 105/580] Fix M851 Minor change missing in the process of standardize the gcode M851 --- Marlin/Marlin_main.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 28324d02e..7a41f19a6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -227,6 +227,7 @@ * M665 - Set delta configurations: L R S * M666 - Set delta endstop adjustment * M605 - Set dual x-carriage movement mode: S [ X R ] + * M851 - Set Z probe's Z offset (mm). Set to a negative value for probes that trigger below the nozzle. * M907 - Set digital trimpot motor current using axis codes. * M908 - Control digital trimpot directly. * M909 - DAC_STEPPER_CURRENT: Print digipot/DAC current value @@ -245,9 +246,6 @@ * * ************ Custom codes - This can change to suit future G-code regulations * M100 - Watch Free Memory (For Debugging Only) - * M851 - Set Z probe's Z offset (mm above extruder -- The value will always be negative) - - * M928 - Start SD logging (M928 filename.g) - ended by M29 * M999 - Restart after being stopped by error * @@ -7363,11 +7361,11 @@ void process_next_command() { break; #endif - #ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET - case CUSTOM_M_CODE_SET_Z_PROBE_OFFSET: + #if HAS_BED_PROBE + case 851: gcode_M851(); break; - #endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET + #endif // HAS_BED_PROBE #if ENABLED(FILAMENTCHANGEENABLE) case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] From 4edf813bde3abd32bbb5ff0525764d8f3aee9e23 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Jun 2016 01:41:57 -0700 Subject: [PATCH 106/580] Just-in-time declaration style in M48 --- Marlin/Marlin_main.cpp | 108 ++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 66 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 28324d02e..1070c3cdf 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4201,57 +4201,41 @@ inline void gcode_M42() { return; } - double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50]; - int8_t verbose_level = 1, n_samples = 10, n_legs = 0, schizoid_flag = 0; - - if (code_seen('V')) { - verbose_level = code_value_byte(); - if (verbose_level < 0 || verbose_level > 4) { - SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n"); - return; - } + int8_t verbose_level = code_seen('V') ? code_value_byte() : 1; + if (verbose_level < 0 || verbose_level > 4) { + SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n"); + return; } if (verbose_level > 0) SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n"); - if (code_seen('P')) { - n_samples = code_value_byte(); - if (n_samples < 4 || n_samples > 50) { - SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n"); - return; - } + int8_t n_samples = code_seen('P') ? code_value_byte() : 10; + if (n_samples < 4 || n_samples > 50) { + SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n"); + return; } float X_current = current_position[X_AXIS], Y_current = current_position[Y_AXIS], - Z_current = current_position[Z_AXIS], - X_probe_location = X_current + X_PROBE_OFFSET_FROM_EXTRUDER, - Y_probe_location = Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER, - Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING; + Z_start_location = current_position[Z_AXIS] + Z_RAISE_BEFORE_PROBING; bool deploy_probe_for_each_reading = code_seen('E'); - if (code_seen('X')) { - X_probe_location = code_value_axis_units(X_AXIS); - #if DISABLED(DELTA) - if (X_probe_location < MIN_PROBE_X || X_probe_location > MAX_PROBE_X) { - out_of_range_error(PSTR("X")); - return; - } - #endif - } - - if (code_seen('Y')) { - Y_probe_location = code_value_axis_units(Y_AXIS); - #if DISABLED(DELTA) - if (Y_probe_location < MIN_PROBE_Y || Y_probe_location > MAX_PROBE_Y) { - out_of_range_error(PSTR("Y")); - return; - } - #endif - } + float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER; + #if DISABLED(DELTA) + if (X_probe_location < MIN_PROBE_X || X_probe_location > MAX_PROBE_X) { + out_of_range_error(PSTR("X")); + return; + } + #endif - #if ENABLED(DELTA) + float Y_probe_location = code_seen('Y') ? code_value_axis_units(Y_AXIS) : Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER; + #if DISABLED(DELTA) + if (Y_probe_location < MIN_PROBE_Y || Y_probe_location > MAX_PROBE_Y) { + out_of_range_error(PSTR("Y")); + return; + } + #else if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) { SERIAL_PROTOCOLPGM("? (X,Y) location outside of probeable radius.\n"); return; @@ -4259,20 +4243,15 @@ inline void gcode_M42() { #endif bool seen_L = code_seen('L'); - - if (seen_L) { - n_legs = code_value_byte(); - if (n_legs < 0 || n_legs > 15) { - SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); - return; - } - if (n_legs == 1) n_legs = 2; + uint8_t n_legs = seen_L ? code_value_byte() : 0; + if (n_legs < 0 || n_legs > 15) { + SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); + return; } + if (n_legs == 1) n_legs = 2; - if (code_seen('S')) { - schizoid_flag++; - if (!seen_L) n_legs = 7; - } + bool schizoid_flag = code_seen('S'); + if (schizoid_flag && !seen_L) n_legs = 7; /** * Now get everything to the specified probe point So we can safely do a @@ -4307,20 +4286,21 @@ inline void gcode_M42() { raise_z_after_probing(); + randomSeed(millis()); + + double mean, sigma, sample_set[n_samples]; for (uint8_t n = 0; n < n_samples; n++) { - randomSeed(millis()); delay(500); if (n_legs) { - float radius, angle = random(0.0, 360.0); int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise - - radius = random( - #if ENABLED(DELTA) - DELTA_PROBEABLE_RADIUS / 8, DELTA_PROBEABLE_RADIUS / 3 - #else - 5, X_MAX_LENGTH / 8 - #endif - ); + float angle = random(0.0, 360.0), + radius = random( + #if ENABLED(DELTA) + DELTA_PROBEABLE_RADIUS / 8, DELTA_PROBEABLE_RADIUS / 3 + #else + 5, X_MAX_LENGTH / 8 + #endif + ); if (verbose_level > 3) { SERIAL_ECHOPAIR("Starting radius: ", radius); @@ -4404,7 +4384,7 @@ inline void gcode_M42() { /** * Get the current mean for the data points we have so far */ - sum = 0.0; + double sum = 0.0; for (uint8_t j = 0; j <= n; j++) sum += sample_set[j]; mean = sum / (n + 1); @@ -4437,19 +4417,15 @@ inline void gcode_M42() { do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); } // End of probe loop code - // raise_z_after_probing(); - if (verbose_level > 0) { SERIAL_PROTOCOLPGM("Mean: "); SERIAL_PROTOCOL_F(mean, 6); SERIAL_EOL; - delay(25); } SERIAL_PROTOCOLPGM("Standard Deviation: "); SERIAL_PROTOCOL_F(sigma, 6); SERIAL_EOL; SERIAL_EOL; - delay(25); clean_up_after_endstop_move(); From a647b05f822278743c4f8cdc715e765372580589 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Jun 2016 03:13:34 -0700 Subject: [PATCH 107/580] Shrink some debug code in G28 --- Marlin/Marlin_main.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1070c3cdf..84ba94786 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3518,22 +3518,16 @@ inline void gcode_G28() { float measured_z, z_before = probePointCounter ? Z_RAISE_BETWEEN_PROBINGS + current_position[Z_AXIS] : Z_RAISE_BEFORE_PROBING + home_offset[Z_AXIS]; - if (probePointCounter) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("z_before = (between) ", (Z_RAISE_BETWEEN_PROBINGS + current_position[Z_AXIS])); - SERIAL_EOL; - } - #endif - } - else { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("z_before = (before) ", Z_RAISE_BEFORE_PROBING + home_offset[Z_AXIS]); - SERIAL_EOL; - } - #endif - } + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPGM("z_before = ("); + if (probePointCounter) + SERIAL_ECHOPGM("between) "); + else + SERIAL_ECHOPGM("before) "); + SERIAL_ECHOLN(z_before); + } + #endif #if ENABLED(DELTA) // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. From 46d3ef222368c032ca75dc11c13f6ae249ea53be Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Jun 2016 03:15:49 -0700 Subject: [PATCH 108/580] Simplify sample_set probe_pt call in M48 --- Marlin/Marlin_main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 84ba94786..5665ba5ef 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4362,18 +4362,18 @@ inline void gcode_M42() { /** * We don't really have to do this move, but if we don't we can see a * funny shift in the Z Height because the user might not have the - * Z_RAISE_BEFORE_PROBING height identical to the Z_RAISE_BETWEEN_PROBING + * Z_RAISE_BEFORE_PROBING height identical to the Z_RAISE_BETWEEN_PROBINGS * height. This gets us back to the probe location at the same height that * we have been running around the circle at. */ + bool last_probe = (n == n_samples - 1); do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER)); - if (deploy_probe_for_each_reading) - sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeDeployAndStow, verbose_level); - else { - if (n == n_samples - 1) - sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeStow, verbose_level); else - sample_set[n] = probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, ProbeStay, verbose_level); - } + sample_set[n] = probe_pt( + X_probe_location, Y_probe_location, + Z_RAISE_BEFORE_PROBING, + deploy_probe_for_each_reading ? ProbeDeployAndStow : last_probe ? ProbeStow : ProbeStay, + verbose_level + ); /** * Get the current mean for the data points we have so far @@ -4408,7 +4408,7 @@ inline void gcode_M42() { } if (verbose_level > 0) SERIAL_EOL; delay(50); - do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); + do_blocking_move_to_z(current_position[Z_AXIS] + (last_probe ? Z_RAISE_AFTER_PROBING : Z_RAISE_BETWEEN_PROBINGS)); } // End of probe loop code if (verbose_level > 0) { From 1dad912b037363422a177a431a1e3dfcc6724fa8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Jun 2016 03:16:13 -0700 Subject: [PATCH 109/580] Adjust M48 raise / move handling --- Marlin/Marlin_main.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5665ba5ef..bac0f4202 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4274,17 +4274,18 @@ inline void gcode_M42() { */ setup_for_endstop_move(); + // Height before each probe (except the first) + float z_before = current_position[Z_AXIS] + (deploy_probe_for_each_reading ? Z_RAISE_BEFORE_PROBING : Z_RAISE_BETWEEN_PROBINGS); + + // Deploy the probe and probe the first point probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, deploy_probe_for_each_reading ? ProbeDeployAndStow : ProbeDeploy, verbose_level); - raise_z_after_probing(); - randomSeed(millis()); double mean, sigma, sample_set[n_samples]; for (uint8_t n = 0; n < n_samples; n++) { - delay(500); if (n_legs) { int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise float angle = random(0.0, 360.0), @@ -4359,18 +4360,13 @@ inline void gcode_M42() { } // n_legs loop } // n_legs - /** - * We don't really have to do this move, but if we don't we can see a - * funny shift in the Z Height because the user might not have the - * Z_RAISE_BEFORE_PROBING height identical to the Z_RAISE_BETWEEN_PROBINGS - * height. This gets us back to the probe location at the same height that - * we have been running around the circle at. - */ + // The last probe will differ bool last_probe = (n == n_samples - 1); - do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER)); + + // Probe a single point sample_set[n] = probe_pt( X_probe_location, Y_probe_location, - Z_RAISE_BEFORE_PROBING, + z_before, deploy_probe_for_each_reading ? ProbeDeployAndStow : last_probe ? ProbeStow : ProbeStay, verbose_level ); @@ -4392,6 +4388,7 @@ inline void gcode_M42() { sum += ss * ss; } sigma = sqrt(sum / (n + 1)); + if (verbose_level > 1) { SERIAL_PROTOCOL(n + 1); SERIAL_PROTOCOLPGM(" of "); @@ -4407,9 +4404,14 @@ inline void gcode_M42() { } } if (verbose_level > 0) SERIAL_EOL; - delay(50); - do_blocking_move_to_z(current_position[Z_AXIS] + (last_probe ? Z_RAISE_AFTER_PROBING : Z_RAISE_BETWEEN_PROBINGS)); - } // End of probe loop code + + // Raise before the next loop for the legs + if (n_legs || last_probe) { + do_blocking_move_to_z(last_probe ? Z_RAISE_AFTER_PROBING : z_before); + if (!last_probe) delay(500); + } + + } // End of probe loop if (verbose_level > 0) { SERIAL_PROTOCOLPGM("Mean: "); From b7e3c1bbc4245a8f9a5ee4b1e63c7e06971bb85f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Jun 2016 15:38:15 -0700 Subject: [PATCH 110/580] Tweak M48 output conditions --- Marlin/Marlin_main.cpp | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index bac0f4202..3934c8ebe 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4275,10 +4275,11 @@ inline void gcode_M42() { setup_for_endstop_move(); // Height before each probe (except the first) - float z_before = current_position[Z_AXIS] + (deploy_probe_for_each_reading ? Z_RAISE_BEFORE_PROBING : Z_RAISE_BETWEEN_PROBINGS); + float z_between = home_offset[Z_AXIS] + (deploy_probe_for_each_reading ? Z_RAISE_BEFORE_PROBING : Z_RAISE_BETWEEN_PROBINGS); // Deploy the probe and probe the first point - probe_pt(X_probe_location, Y_probe_location, Z_RAISE_BEFORE_PROBING, + probe_pt(X_probe_location, Y_probe_location, + home_offset[Z_AXIS] + Z_RAISE_BEFORE_PROBING, deploy_probe_for_each_reading ? ProbeDeployAndStow : ProbeDeploy, verbose_level); @@ -4366,7 +4367,7 @@ inline void gcode_M42() { // Probe a single point sample_set[n] = probe_pt( X_probe_location, Y_probe_location, - z_before, + z_between, deploy_probe_for_each_reading ? ProbeDeployAndStow : last_probe ? ProbeStow : ProbeStay, verbose_level ); @@ -4388,26 +4389,28 @@ inline void gcode_M42() { sum += ss * ss; } sigma = sqrt(sum / (n + 1)); - - if (verbose_level > 1) { - SERIAL_PROTOCOL(n + 1); - SERIAL_PROTOCOLPGM(" of "); - SERIAL_PROTOCOL((int)n_samples); - SERIAL_PROTOCOLPGM(" z: "); - SERIAL_PROTOCOL_F(current_position[Z_AXIS], 6); - delay(50); - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(" mean: "); - SERIAL_PROTOCOL_F(mean, 6); - SERIAL_PROTOCOLPGM(" sigma: "); - SERIAL_PROTOCOL_F(sigma, 6); + if (verbose_level > 0) { + if (verbose_level > 1) { + SERIAL_PROTOCOL(n + 1); + SERIAL_PROTOCOLPGM(" of "); + SERIAL_PROTOCOL((int)n_samples); + SERIAL_PROTOCOLPGM(" z: "); + SERIAL_PROTOCOL_F(current_position[Z_AXIS], 6); + delay(50); + if (verbose_level > 2) { + SERIAL_PROTOCOLPGM(" mean: "); + SERIAL_PROTOCOL_F(mean, 6); + SERIAL_PROTOCOLPGM(" sigma: "); + SERIAL_PROTOCOL_F(sigma, 6); + } } + SERIAL_EOL; } - if (verbose_level > 0) SERIAL_EOL; - // Raise before the next loop for the legs + // Raise before the next loop for the legs, + // or do the final raise after the last probe if (n_legs || last_probe) { - do_blocking_move_to_z(last_probe ? Z_RAISE_AFTER_PROBING : z_before); + do_blocking_move_to_z(last_probe ? home_offset[Z_AXIS] + Z_RAISE_AFTER_PROBING : z_between); if (!last_probe) delay(500); } From 400e13d136c5afea3896af8c27492987b220b5e6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 19 Jun 2016 17:14:56 -0700 Subject: [PATCH 111/580] Output a message for SD read errors --- Marlin/Marlin_main.cpp | 4 ++++ Marlin/language.h | 1 + 2 files changed, 5 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index fda145e5e..e726bd0ca 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1140,6 +1140,10 @@ inline void get_serial_commands() { card.printingHasFinished(); card.checkautostart(true); } + else if (n == -1) { + SERIAL_ERROR_START; + SERIAL_ECHOLNPGM(MSG_SD_ERR_READ); + } if (sd_char == '#') stop_buffering = true; sd_comment_mode = false; //for new command diff --git a/Marlin/language.h b/Marlin/language.h index e675f93eb..f7ac1474b 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -171,6 +171,7 @@ #define MSG_SD_PRINTING_BYTE "SD printing byte " #define MSG_SD_NOT_PRINTING "Not SD printing" #define MSG_SD_ERR_WRITE_TO_FILE "error writing to file" +#define MSG_SD_ERR_READ "SD read error" #define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " #define MSG_STEPPER_TOO_HIGH "Steprate too high: " From f8c278ce4d66e7c5897ec88e78271a6607cc3a75 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 19 Jun 2016 17:39:46 -0700 Subject: [PATCH 112/580] Cartesio UI display option in all configs --- Marlin/Configuration.h | 4 ++++ Marlin/example_configurations/Felix/Configuration.h | 4 ++++ Marlin/example_configurations/Felix/DUAL/Configuration.h | 4 ++++ Marlin/example_configurations/Hephestos/Configuration.h | 4 ++++ Marlin/example_configurations/Hephestos_2/Configuration.h | 4 ++++ Marlin/example_configurations/K8200/Configuration.h | 4 ++++ .../RepRapWorld/Megatronics/Configuration.h | 4 ++++ Marlin/example_configurations/RigidBot/Configuration.h | 4 ++++ Marlin/example_configurations/SCARA/Configuration.h | 4 ++++ Marlin/example_configurations/TAZ4/Configuration.h | 4 ++++ Marlin/example_configurations/WITBOX/Configuration.h | 4 ++++ Marlin/example_configurations/adafruit/ST7565/Configuration.h | 4 ++++ Marlin/example_configurations/delta/biv2.5/Configuration.h | 4 ++++ Marlin/example_configurations/delta/generic/Configuration.h | 4 ++++ .../example_configurations/delta/kossel_mini/Configuration.h | 4 ++++ .../example_configurations/delta/kossel_pro/Configuration.h | 4 ++++ Marlin/example_configurations/delta/kossel_xl/Configuration.h | 4 ++++ Marlin/example_configurations/makibox/Configuration.h | 4 ++++ Marlin/example_configurations/tvrrug/Round2/Configuration.h | 4 ++++ 19 files changed, 76 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 05916e4ef..929b2bd0f 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -958,6 +958,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 77b02a153..64900ea70 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -941,6 +941,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 7d3ef3dde..632684691 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -939,6 +939,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 39ee26f14..41c18990f 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -950,6 +950,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 431c51172..25c4f50e8 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -957,6 +957,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index e12f0993f..7db2e5c7a 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -975,6 +975,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 416d6ac00..46df1351f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -958,6 +958,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index b66f641ed..f90297638 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -953,6 +953,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 3fd2d26ef..442d5bfd3 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -966,6 +966,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index b1c3763d1..6ab386e53 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -979,6 +979,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 28db20cdf..899cd9e41 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -950,6 +950,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9cfa2aba3..758d22857 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -958,6 +958,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 5ff3a53ca..6965f70e1 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1047,6 +1047,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 8085cfcaf..83a50c6f3 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1041,6 +1041,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index a8a14bbe9..788526c25 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1044,6 +1044,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index b66ddc65b..e3271e084 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1049,6 +1049,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index b77e485a6..1dd5e083d 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1046,6 +1046,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index dc51bddc2..a90e28ffd 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -961,6 +961,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index e84e1bf3b..c06935a0d 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -952,6 +952,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +//#define CARTESIO_UI + // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // http://reprap.org/wiki/PanelOne From add00328202041558cbb86338d5587a2f0bc6d39 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 19 Jun 2016 18:05:57 -0700 Subject: [PATCH 113/580] Improve FILAMENT_RUNOUT_SENSOR, FILRUNOUT_PIN --- Marlin/Marlin_main.cpp | 18 ++++++++++++------ Marlin/SanityCheck.h | 11 +++++++++++ Marlin/pins_CNCONTROLS_12.h | 2 +- Marlin/pins_RAMPS_14.h | 6 ++---- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e726bd0ca..5769cac60 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -686,14 +686,16 @@ void setup_killpin() { #endif } -void setup_filrunoutpin() { - #if HAS_FILRUNOUT +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + + void setup_filrunoutpin() { pinMode(FILRUNOUT_PIN, INPUT); #if ENABLED(ENDSTOPPULLUP_FIL_RUNOUT) WRITE(FILRUNOUT_PIN, HIGH); #endif - #endif -} + } + +#endif // Set home pin void setup_homepin(void) { @@ -802,8 +804,12 @@ void setup() { MCUCR = 0x80; #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + setup_filrunoutpin(); + #endif + setup_killpin(); - setup_filrunoutpin(); + setup_powerhold(); #if HAS_STEPPER_RESET @@ -8144,7 +8150,7 @@ void idle( */ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { - #if HAS_FILRUNOUT + #if ENABLED(FILAMENT_RUNOUT_SENSOR) if (IS_SD_PRINTING && !(READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING)) handle_filament_runout(); #endif diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index bc3bf650b..5e349e4b2 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -124,6 +124,17 @@ #endif #endif +/** + * Filament Runout needs a pin and SD Support + */ +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if !HAS_FILRUNOUT + #error "FILAMENT_RUNOUT_SENSOR requires FILRUNOUT_PIN." + #elif DISABLED(SDSUPPORT) + #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT." + #endif +#endif + /** * Filament Change with Extruder Runout Prevention */ diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h index de27b8f9d..334251ef5 100644 --- a/Marlin/pins_CNCONTROLS_12.h +++ b/Marlin/pins_CNCONTROLS_12.h @@ -67,7 +67,7 @@ //common I/O //#define TEMP_CHAMBER_PIN 13 // ANALOG INPUT !! - //#define FILAMENT_RUNOUT_SENSOR 18 + #define FILRUNOUT_PIN 18 //#define PWM_1_PIN 12 //#define PWM_2_PIN 13 //#define SPARE_IO 17 diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 32232af4b..48d64fe63 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -98,10 +98,8 @@ #define Z_MIN_PROBE_PIN 32 #endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector - #define FILRUNOUT_PIN 4 -#endif +// define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector +#define FILRUNOUT_PIN 4 #if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB) #define FAN_PIN 9 // (Sprinter config) From de1222875805a0a2fa49826597e3481b529a2ac7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Jun 2016 18:03:17 -0700 Subject: [PATCH 114/580] Make Z Probe options independent of ABL --- Marlin/Conditionals.h | 11 +- Marlin/Configuration.h | 108 +++++----- Marlin/Marlin_main.cpp | 154 +++++++------- Marlin/SanityCheck.h | 10 +- .../Cartesio/Configuration.h | 108 +++++----- .../Felix/Configuration.h | 107 +++++----- .../Felix/DUAL/Configuration.h | 107 +++++----- .../Hephestos/Configuration.h | 107 +++++----- .../Hephestos_2/Configuration.h | 108 +++++----- .../K8200/Configuration.h | 107 +++++----- .../RepRapWorld/Megatronics/Configuration.h | 107 +++++----- .../RigidBot/Configuration.h | 107 +++++----- .../SCARA/Configuration.h | 107 +++++----- .../TAZ4/Configuration.h | 107 +++++----- .../WITBOX/Configuration.h | 107 +++++----- .../adafruit/ST7565/Configuration.h | 107 +++++----- .../delta/biv2.5/Configuration.h | 186 ++++++++--------- .../delta/generic/Configuration.h | 174 ++++++++-------- .../delta/kossel_mini/Configuration.h | 182 +++++++++-------- .../delta/kossel_pro/Configuration.h | 190 +++++++++--------- .../delta/kossel_xl/Configuration.h | 174 ++++++++-------- .../makibox/Configuration.h | 107 +++++----- .../tvrrug/Round2/Configuration.h | 107 +++++----- 23 files changed, 1455 insertions(+), 1234 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 3861f1301..d8d436496 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -371,6 +371,15 @@ #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + + #ifndef XY_TRAVEL_SPEED + #ifdef HOMING_FEEDRATE_XYZ + #define XY_TRAVEL_SPEED HOMING_FEEDRATE_XYZ + #else + #define XY_TRAVEL_SPEED 4000 + #endif + #endif + #endif #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) @@ -758,7 +767,7 @@ #define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED) /** - * Probe dependencies + * Bed Probe dependencies */ #if HAS_BED_PROBE #ifndef X_PROBE_OFFSET_FROM_EXTRUDER diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 05916e4ef..11aece9a2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -409,6 +409,57 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. // With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. // @@ -453,12 +504,20 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -606,27 +665,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -634,26 +672,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1147,14 +1165,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e726bd0ca..afde4784d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1575,7 +1575,7 @@ static void setup_for_endstop_move() { endstops.enable(); } -#if ENABLED(AUTO_BED_LEVELING_FEATURE) +#if HAS_BED_PROBE #if ENABLED(DELTA) /** @@ -1592,6 +1592,71 @@ static void setup_for_endstop_move() { } #endif + /** + * Plan a move to (X, Y, Z) and set the current_position + * The final current_position may not be the one that was requested + */ + static void do_blocking_move_to(float x, float y, float z) { + float old_feedrate = feedrate; + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z); + #endif + + #if ENABLED(DELTA) + + feedrate = + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + xy_travel_speed + #else + min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60 + #endif + ; + + destination[X_AXIS] = x; + destination[Y_AXIS] = y; + destination[Z_AXIS] = z; + + if (x == current_position[X_AXIS] && y == current_position[Y_AXIS]) + prepare_move_to_destination_raw(); // this will also set_current_to_destination + else + prepare_move_to_destination(); // this will also set_current_to_destination + + #else + + feedrate = homing_feedrate[Z_AXIS]; + + current_position[Z_AXIS] = z; + line_to_current_position(); + stepper.synchronize(); + + feedrate = + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + xy_travel_speed + #else + min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60 + #endif + ; + + current_position[X_AXIS] = x; + current_position[Y_AXIS] = y; + line_to_current_position(); + + #endif + + stepper.synchronize(); + + feedrate = old_feedrate; + } + + inline void do_blocking_move_to_z(float z) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); + } + +#endif //HAS_BED_PROBE + +#if ENABLED(AUTO_BED_LEVELING_FEATURE) + #if ENABLED(AUTO_BED_LEVELING_GRID) #if DISABLED(DELTA) @@ -1751,51 +1816,6 @@ static void setup_for_endstop_move() { feedrate = old_feedrate; } - /** - * Plan a move to (X, Y, Z) and set the current_position - * The final current_position may not be the one that was requested - */ - static void do_blocking_move_to(float x, float y, float z) { - float old_feedrate = feedrate; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z); - #endif - - #if ENABLED(DELTA) - - feedrate = xy_travel_speed; - - destination[X_AXIS] = x; - destination[Y_AXIS] = y; - destination[Z_AXIS] = z; - - if (x == current_position[X_AXIS] && y == current_position[Y_AXIS]) - prepare_move_to_destination_raw(); // this will also set_current_to_destination - else - prepare_move_to_destination(); // this will also set_current_to_destination - - #else - - feedrate = homing_feedrate[Z_AXIS]; - - current_position[Z_AXIS] = z; - line_to_current_position(); - stepper.synchronize(); - - feedrate = xy_travel_speed; - - current_position[X_AXIS] = x; - current_position[Y_AXIS] = y; - line_to_current_position(); - - #endif - - stepper.synchronize(); - - feedrate = old_feedrate; - } - inline void do_blocking_move_to_xy(float x, float y) { do_blocking_move_to(x, y, current_position[Z_AXIS]); } @@ -1804,10 +1824,6 @@ static void setup_for_endstop_move() { do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]); } - inline void do_blocking_move_to_z(float z) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); - } - inline void raise_z_after_probing() { #if Z_RAISE_AFTER_PROBING > 0 #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2171,30 +2187,30 @@ static void setup_for_endstop_move() { #endif // DELTA - #if HAS_Z_SERVO_ENDSTOP +#endif // AUTO_BED_LEVELING_FEATURE - /** - * Raise Z to a minimum height to make room for a servo to move - * - * zprobe_zoffset: Negative of the Z height where the probe engages - * z_dest: The before / after probing raise distance - * - * The zprobe_zoffset is negative for a switch below the nozzle, so - * multiply by Z_HOME_DIR (-1) to move enough away from the bed. - */ - void raise_z_for_servo(float z_dest) { - z_dest += home_offset[Z_AXIS]; +#if HAS_Z_SERVO_ENDSTOP - if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) - z_dest -= zprobe_zoffset; + /** + * Raise Z to a minimum height to make room for a servo to move + * + * zprobe_zoffset: Negative of the Z height where the probe engages + * z_dest: The before / after probing raise distance + * + * The zprobe_zoffset is negative for a switch below the nozzle, so + * multiply by Z_HOME_DIR (-1) to move enough away from the bed. + */ + void raise_z_for_servo(float z_dest) { + z_dest += home_offset[Z_AXIS]; - if (z_dest > current_position[Z_AXIS]) - do_blocking_move_to_z(z_dest); // also updates current_position - } + if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) + z_dest -= zprobe_zoffset; - #endif + if (z_dest > current_position[Z_AXIS]) + do_blocking_move_to_z(z_dest); // also updates current_position + } -#endif // AUTO_BED_LEVELING_FEATURE +#endif #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || ENABLED(AUTO_BED_LEVELING_FEATURE) static void axis_unhomed_error(bool xyz=false) { diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index bc3bf650b..1f0543f10 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -420,10 +420,14 @@ #endif /** - * Allen Key Z probe requires Auto Bed Leveling grid and Delta + * Allen Key Z probe requires Delta and Auto Bed Leveling grid */ -#if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA)) - #error "Invalid use of Z_PROBE_ALLEN_KEY." +#if ENABLED(Z_PROBE_ALLEN_KEY) + #if !ENABLED(DELTA) + #error "Z_PROBE_ALLEN_KEY is only usable with DELTA." + #elif ENABLED(MESH_BED_LEVELING) || (ENABLED(AUTO_BED_LEVELING_FEATURE) && !ENABLED(AUTO_BED_LEVELING_GRID)) + #error "Z_PROBE_ALLEN_KEY can only use AUTO_BED_LEVELING_GRID leveling." + #endif #endif /** diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 95e9f26b1..59bae3aef 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -408,6 +408,57 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. // With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. // @@ -452,12 +503,20 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 1 @@ -605,27 +664,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -633,26 +671,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1150,14 +1168,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 77b02a153..35f9ebb2a 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -435,12 +435,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -588,27 +647,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -616,25 +654,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1130,14 +1149,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 7d3ef3dde..65246a501 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -433,12 +433,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -586,27 +645,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -614,25 +652,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1128,14 +1147,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 39ee26f14..f9fedfbd2 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -445,12 +445,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -598,27 +657,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -626,25 +664,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1139,14 +1158,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 431c51172..59b5eb610 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -447,12 +447,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 5 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 5 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -600,27 +659,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 2 // How much the Z axis will be raised when traveling from between next probing points. @@ -628,26 +666,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - #define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1146,14 +1164,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index e12f0993f..3907e4184 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -470,12 +470,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -623,27 +682,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -651,25 +689,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1164,14 +1183,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 416d6ac00..453cfe75c 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -453,12 +453,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -606,27 +665,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -634,25 +672,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1147,14 +1166,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index b66f641ed..9057a9e86 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -447,12 +447,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -600,27 +659,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -628,25 +666,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1144,14 +1163,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // #define NUM_SERVOS 0 // DGlass3D - Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 3fd2d26ef..70c297292 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -461,12 +461,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -614,27 +673,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -642,25 +680,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1155,14 +1174,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index b1c3763d1..fc5c49ec2 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -474,12 +474,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -627,27 +686,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -655,25 +693,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1168,14 +1187,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 28db20cdf..f5dfa6d36 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -445,12 +445,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -598,27 +657,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -626,25 +664,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1139,14 +1158,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9cfa2aba3..d83749fc1 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -453,12 +453,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -606,27 +665,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -634,25 +672,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1147,14 +1166,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 5ff3a53ca..df66fd5b7 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -495,12 +495,108 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] + +// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe +// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +//#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + // Just like Kossel Pro + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_TRAVEL_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip + #define Z_PROBE_ALLEN_KEY_STOW_1_Y -122.00 + #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_2_X 36.00 // move down to retract probe + #define Z_PROBE_ALLEN_KEY_STOW_2_Y -122.00 + #define Z_PROBE_ALLEN_KEY_STOW_2_Z 25.0 + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 + #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_TRAVEL_SPEED + +#endif // Z_PROBE_ALLEN_KEY + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -652,27 +748,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -680,67 +755,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE - - // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe - // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. - //#define Z_PROBE_ALLEN_KEY - - #if ENABLED(Z_PROBE_ALLEN_KEY) - // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, - // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - - // Just like Kossel Pro - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE HOMING_FEEDRATE_XYZ - - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE HOMING_FEEDRATE_XYZ - - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (HOMING_FEEDRATE_XYZ)/2 - - #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip - #define Z_PROBE_ALLEN_KEY_STOW_1_Y -122.00 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE HOMING_FEEDRATE_XYZ - - #define Z_PROBE_ALLEN_KEY_STOW_2_X 36.00 // move down to retract probe - #define Z_PROBE_ALLEN_KEY_STOW_2_Y -122.00 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 25.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/2 - - #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_XYZ - - #endif // Z_PROBE_ALLEN_KEY - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1236,14 +1250,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 8085cfcaf..f8837258d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -495,12 +495,102 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] + +// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe +// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +//#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position + #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down + #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 + #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear + #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 + #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_TRAVEL_SPEED + +#endif // Z_PROBE_ALLEN_KEY + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -652,27 +742,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points @@ -680,61 +749,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE - - // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe - // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. - //#define Z_PROBE_ALLEN_KEY - - #if ENABLED(Z_PROBE_ALLEN_KEY) - // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, - // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE HOMING_FEEDRATE_XYZ - - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/10 - - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE HOMING_FEEDRATE_XYZ - - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/10 - - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_XYZ - - #endif // Z_PROBE_ALLEN_KEY - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1230,14 +1244,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index a8a14bbe9..3bd6146d1 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -419,7 +419,7 @@ // extra connectors. Leave undefined any used for non-endstop and non-probe purposes. //#define USE_XMIN_PLUG //#define USE_YMIN_PLUG -//#define USE_ZMIN_PLUG +#define USE_ZMIN_PLUG #define USE_XMAX_PLUG #define USE_YMAX_PLUG #define USE_ZMAX_PLUG @@ -495,12 +495,105 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] + +// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe +// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + // Kossel Mini + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED/10) + + #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 + // Move the probe into position + #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + // Move the nozzle down further to push the probe into retracted position. + #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X + #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y + #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED/10) + // Raise things back up slightly so we don't bump into anything + #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X + #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y + #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_TRAVEL_SPEED/2) + +#endif // Z_PROBE_ALLEN_KEY + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -652,27 +745,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points @@ -680,64 +752,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE - - // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe - // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. - #define Z_PROBE_ALLEN_KEY - - #if ENABLED(Z_PROBE_ALLEN_KEY) - // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, - // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - - // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED - - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED/10) - - #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED - // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED/10) - // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_TRAVEL_SPEED/2) - - #endif // Z_PROBE_ALLEN_KEY - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1233,14 +1247,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index b66ddc65b..579324567 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -484,12 +484,110 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -23 // KosselPro actual: -22.919 +#define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // KosselPro actual: -6.304 +// Kossel Pro note: The correct value is likely -17.45 but I'd rather err on the side of +// not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed. +#define Z_PROBE_OFFSET_FROM_EXTRUDER -17.25 // Increase this if the first layer is too thin (remember: it's a negative number so increase means closer to zero). + +// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe +// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + // Kossel Pro + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_TRAVEL_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip + #define Z_PROBE_ALLEN_KEY_STOW_1_Y -125.00 + #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X // move down to retract probe + #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y + #define Z_PROBE_ALLEN_KEY_STOW_2_Z 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 + #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_TRAVEL_SPEED + +#endif // Z_PROBE_ALLEN_KEY + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 100 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -641,29 +739,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -23 // KosselPro actual: -22.919 - #define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // KosselPro actual: -6.304 - // Kossel Pro note: The correct value is likely -17.45 but I'd rather err on the side of - // not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed. - #define Z_PROBE_OFFSET_FROM_EXTRUDER -17.25 // Increase this if the first layer is too thin (remember: it's a negative number so increase means closer to zero). - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -671,67 +746,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE - - // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe - // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. - #define Z_PROBE_ALLEN_KEY - - #if ENABLED(Z_PROBE_ALLEN_KEY) - // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, - // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - - // Kossel Pro - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE HOMING_FEEDRATE_XYZ - - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE HOMING_FEEDRATE_XYZ - - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (HOMING_FEEDRATE_XYZ)/2 - - #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip - #define Z_PROBE_ALLEN_KEY_STOW_1_Y -125.00 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE HOMING_FEEDRATE_XYZ - - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X // move down to retract probe - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/2 - - #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_XYZ - - #endif // Z_PROBE_ALLEN_KEY - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1238,14 +1252,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index b77e485a6..0d1d3a506 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -493,12 +493,102 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle X offset: -left +right +#define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle Y offset: -front +behind +#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.3 // Z probe to nozzle Z offset: -below (always!) + +// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe +// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +//#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 + //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS + //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + + //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 + //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS + //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED)/10 + + //#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position + //#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 + //#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + //#define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + + //#define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down + //#define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 + //#define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + //#define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED)/10 + + //#define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear + //#define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 + //#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_TRAVEL_SPEED + +#endif // Z_PROBE_ALLEN_KEY + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 20 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 20 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -650,27 +740,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle X offset: -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle Y offset: -front +behind - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.3 // Z probe to nozzle Z offset: -below (always!) - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 10 // How much the Z axis will be raised when traveling from between next probing points. @@ -678,61 +747,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - #define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE - - // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe - // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. - //#define Z_PROBE_ALLEN_KEY - - #if ENABLED(Z_PROBE_ALLEN_KEY) - // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, - // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - - //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE HOMING_FEEDRATE_XYZ - - //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/10 - - //#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - //#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - //#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 - //#define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE HOMING_FEEDRATE_XYZ - - //#define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - //#define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - //#define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 - //#define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (HOMING_FEEDRATE_XYZ)/10 - - //#define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - //#define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - //#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 - //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_XYZ - - #endif // Z_PROBE_ALLEN_KEY - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1235,14 +1249,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index dc51bddc2..6498d39df 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -456,12 +456,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 @@ -609,27 +668,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -637,25 +675,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1150,14 +1169,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index e84e1bf3b..b47bec944 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -443,12 +443,71 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A fix mounted probe, like the normal inductive probe, must be deactivated to go +// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment +// For example any setup that uses the nozzle itself as a probe. +//#define MECHANICAL_PROBE + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// // Probe Raise options provide clearance for the probe to deploy and stow. +// // For G28 these apply when the probe deploys and stows. // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 1 @@ -596,27 +655,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). - // X and Y offsets must be integers. - // - // In the following example the X and Y offsets are both positive: - // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 - // - // +-- BACK ---+ - // | | - // L | (+) P | R <-- probe (20,20) - // E | | I - // F | (-) N (+) | G <-- nozzle (10,10) - // T | | H - // | (-) | T - // | | - // O-- FRONT --+ - // (0,0) - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] - #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. @@ -624,25 +662,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // Probes are sensors/switches that need to be activated before they can be used - // and deactivated after their use. - // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE - - // A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER - // when the hardware endstops are active. - //#define FIX_MOUNTED_PROBE - - // A Servo Probe can be defined in the servo section below. - - // An Allen Key Probe is currently predefined only in the delta example configurations. - - // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. - //#define Z_PROBE_SLED - //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - - // A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment - // For example any setup that uses the nozzle itself as a probe. - //#define MECHANICAL_PROBE // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! @@ -1141,14 +1160,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Servo Endstops -// -// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. -// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. -// -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles - // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. From 42ccb5b0dffc999e8c6d46645c252d2f503860ae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 19 Jun 2016 17:48:26 -0700 Subject: [PATCH 115/580] Travis test a servo probe without ABL --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40a652523..ef027aa0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,13 +90,17 @@ script: - opt_enable PIDTEMPBED - build_marlin # - # Test AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE with a Servo Probe + # Test a Servo Probe without leveling # - restore_configs - - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - build_marlin # + # Test AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE with a Servo Probe + # + - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE + - build_marlin + # # Test MESH_BED_LEVELING feature, with LCD # - restore_configs From dfbf8b3c2c86734adaa6ed0604a535f5ede55309 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 19 Jun 2016 19:24:59 -0700 Subject: [PATCH 116/580] FIL_RUNOUT_INVERTING false by default --- Marlin/Configuration.h | 2 +- Marlin/example_configurations/Cartesio/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/DUAL/Configuration.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/Hephestos_2/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- Marlin/example_configurations/RigidBot/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/TAZ4/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 929b2bd0f..fce4276c2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -526,7 +526,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 95e9f26b1..91f60ac97 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -525,7 +525,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 64900ea70..b0722de82 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -508,7 +508,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 632684691..7b132a042 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -506,7 +506,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 41c18990f..2145ef70f 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -518,7 +518,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 25c4f50e8..4ba5f76f6 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -520,7 +520,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 7db2e5c7a..17550e36e 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -543,7 +543,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 46df1351f..a8e066359 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -526,7 +526,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index f90297638..69e4c58ed 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -520,7 +520,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 442d5bfd3..67479d19f 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -534,7 +534,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 6ab386e53..4e5557592 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -547,7 +547,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 899cd9e41..0192986f9 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -518,7 +518,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 758d22857..1d87953b9 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -526,7 +526,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 6965f70e1..fcf2b7157 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -568,7 +568,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 83a50c6f3..c4fd89998 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -568,7 +568,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 788526c25..8cb091cba 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -568,7 +568,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index e3271e084..6708e9efb 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -557,7 +557,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 1dd5e083d..3406ccce8 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -566,7 +566,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index a90e28ffd..4e1ac305e 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -529,7 +529,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index c06935a0d..8c72adb15 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -516,7 +516,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) - const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif From 2fd2301928ff56ac543a4bd2edc248ce8c77d26a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 19 Jun 2016 19:25:09 -0700 Subject: [PATCH 117/580] FILRUNOUT => FIL_RUNOUT --- Marlin/Conditionals.h | 2 +- Marlin/Marlin_main.cpp | 6 +++--- Marlin/SanityCheck.h | 4 ++-- Marlin/pins_CNCONTROLS_12.h | 2 +- Marlin/pins_RAMPS_14.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 3861f1301..62f08523f 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -634,7 +634,7 @@ #define HAS_SERVO_2 (PIN_EXISTS(SERVO2)) #define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) - #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT)) + #define HAS_FIL_RUNOUT (PIN_EXISTS(FIL_RUNOUT)) #define HAS_HOME (PIN_EXISTS(HOME)) #define HAS_KILL (PIN_EXISTS(KILL)) #define HAS_SUICIDE (PIN_EXISTS(SUICIDE)) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5769cac60..4f866d2a4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -689,9 +689,9 @@ void setup_killpin() { #if ENABLED(FILAMENT_RUNOUT_SENSOR) void setup_filrunoutpin() { - pinMode(FILRUNOUT_PIN, INPUT); + pinMode(FIL_RUNOUT_PIN, INPUT); #if ENABLED(ENDSTOPPULLUP_FIL_RUNOUT) - WRITE(FILRUNOUT_PIN, HIGH); + WRITE(FIL_RUNOUT_PIN, HIGH); #endif } @@ -8151,7 +8151,7 @@ void idle( void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #if ENABLED(FILAMENT_RUNOUT_SENSOR) - if (IS_SD_PRINTING && !(READ(FILRUNOUT_PIN) ^ FIL_RUNOUT_INVERTING)) + if (IS_SD_PRINTING && !(READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING)) handle_filament_runout(); #endif diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 5e349e4b2..2c567cfb9 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -128,8 +128,8 @@ * Filament Runout needs a pin and SD Support */ #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #if !HAS_FILRUNOUT - #error "FILAMENT_RUNOUT_SENSOR requires FILRUNOUT_PIN." + #if !HAS_FIL_RUNOUT + #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." #elif DISABLED(SDSUPPORT) #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT." #endif diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h index 334251ef5..850455670 100644 --- a/Marlin/pins_CNCONTROLS_12.h +++ b/Marlin/pins_CNCONTROLS_12.h @@ -67,7 +67,7 @@ //common I/O //#define TEMP_CHAMBER_PIN 13 // ANALOG INPUT !! - #define FILRUNOUT_PIN 18 + #define FIL_RUNOUT_PIN 18 //#define PWM_1_PIN 12 //#define PWM_2_PIN 13 //#define SPARE_IO 17 diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 48d64fe63..55e810aa6 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -99,7 +99,7 @@ #endif // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector -#define FILRUNOUT_PIN 4 +#define FIL_RUNOUT_PIN 4 #if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB) #define FAN_PIN 9 // (Sprinter config) From 7e9d4a68d48634a95d124a7d1854ae794d10d731 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Jun 2016 15:15:37 -0700 Subject: [PATCH 118/580] Always raise Z (if needed) for servo deploy/stow --- Marlin/Conditionals.h | 1 - Marlin/Marlin_main.cpp | 107 +++++++++++++++++------------------------ 2 files changed, 44 insertions(+), 64 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index b218d7b16..8ecf49ebe 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -383,7 +383,6 @@ #endif #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) - #define SERVO_LEVELING (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_SERVO_ENDSTOP) /** * Sled Options diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ebb28a5ba..8c6ef5c3f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -750,9 +750,6 @@ void servo_init() { #endif #if HAS_Z_SERVO_ENDSTOP - - endstops.enable_z_probe(false); - /** * Set position of Z Servo Endstop * @@ -763,8 +760,11 @@ void servo_init() { * */ STOW_Z_SERVO(); - #endif // HAS_Z_SERVO_ENDSTOP + #endif + #if HAS_BED_PROBE + endstops.enable_z_probe(false); + #endif } /** @@ -1661,6 +1661,29 @@ static void setup_for_endstop_move() { #endif //HAS_BED_PROBE +#if HAS_Z_SERVO_ENDSTOP + + /** + * Raise Z to a minimum height to make room for a servo to move + * + * zprobe_zoffset: Negative of the Z height where the probe engages + * z_dest: The before / after probing raise distance + * + * The zprobe_zoffset is negative for a switch below the nozzle, so + * multiply by Z_HOME_DIR (-1) to move enough away from the bed. + */ + void raise_z_for_servo(float z_dest) { + z_dest += home_offset[Z_AXIS]; + + if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) + z_dest -= zprobe_zoffset; + + if (z_dest > current_position[Z_AXIS]) + do_blocking_move_to_z(z_dest); // also updates current_position + } + +#endif + #if ENABLED(AUTO_BED_LEVELING_FEATURE) #if ENABLED(AUTO_BED_LEVELING_GRID) @@ -1861,6 +1884,9 @@ static void setup_for_endstop_move() { #if HAS_Z_SERVO_ENDSTOP + // Make room for Z Servo + raise_z_for_servo(Z_RAISE_BEFORE_PROBING); + // Engage Z Servo endstop if enabled DEPLOY_Z_SERVO(); @@ -1941,17 +1967,14 @@ static void setup_for_endstop_move() { #endif // Z_PROBE_ALLEN_KEY #if ENABLED(FIX_MOUNTED_PROBE) - // Noting to be done. Just set endstops.z_probe_enabled + // Nothing to be done. Just enable_z_probe below... #endif endstops.enable_z_probe(); } - static void stow_z_probe(bool doRaise = true) { - #if !(HAS_Z_SERVO_ENDSTOP && (Z_RAISE_AFTER_PROBING > 0)) - UNUSED(doRaise); - #endif + static void stow_z_probe() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position); #endif @@ -1960,13 +1983,8 @@ static void setup_for_endstop_move() { #if HAS_Z_SERVO_ENDSTOP - // Retract Z Servo endstop if enabled - #if Z_RAISE_AFTER_PROBING > 0 - if (doRaise) { - raise_z_after_probing(); // this also updates current_position - stepper.synchronize(); - } - #endif + // Make room for the servo + raise_z_for_servo(Z_RAISE_AFTER_PROBING); // Change the Z servo angle STOW_Z_SERVO(); @@ -2034,9 +2052,7 @@ static void setup_for_endstop_move() { } stop(); } - #endif // Z_PROBE_ALLEN_KEY - - #if ENABLED(FIX_MOUNTED_PROBE) + #elif ENABLED(FIX_MOUNTED_PROBE) // Nothing to do here. Just clear endstops.z_probe_enabled #endif @@ -2195,29 +2211,6 @@ static void setup_for_endstop_move() { #endif // AUTO_BED_LEVELING_FEATURE -#if HAS_Z_SERVO_ENDSTOP - - /** - * Raise Z to a minimum height to make room for a servo to move - * - * zprobe_zoffset: Negative of the Z height where the probe engages - * z_dest: The before / after probing raise distance - * - * The zprobe_zoffset is negative for a switch below the nozzle, so - * multiply by Z_HOME_DIR (-1) to move enough away from the bed. - */ - void raise_z_for_servo(float z_dest) { - z_dest += home_offset[Z_AXIS]; - - if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) - z_dest -= zprobe_zoffset; - - if (z_dest > current_position[Z_AXIS]) - do_blocking_move_to_z(z_dest); // also updates current_position - } - -#endif - #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || ENABLED(AUTO_BED_LEVELING_FEATURE) static void axis_unhomed_error(bool xyz=false) { if (xyz) { @@ -2313,7 +2306,7 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(Z_PROBE_SLED) #define _Z_DEPLOY (dock_sled(false)) #define _Z_STOW (dock_sled(true)) - #elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) + #elif ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_SERVO_ENDSTOP || ENABLED(FIX_MOUNTED_PROBE)) #define _Z_DEPLOY (deploy_z_probe()) #define _Z_STOW (stow_z_probe()) #elif HAS_Z_SERVO_ENDSTOP @@ -2322,10 +2315,10 @@ static void homeaxis(AxisEnum axis) { #endif // Homing Z towards the bed? Deploy the Z probe or endstop. - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_SERVO_ENDSTOP + #if HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(FIX_MOUNTED_PROBE) if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_DEPLOY)); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > " STRINGIFY(_Z_DEPLOY)); #endif _Z_DEPLOY; } @@ -2445,10 +2438,10 @@ static void homeaxis(AxisEnum axis) { axis_homed[axis] = true; // Put away the Z probe - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_SERVO_ENDSTOP + #if HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(FIX_MOUNTED_PROBE) if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_STOW)); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > " STRINGIFY(_Z_STOW)); #endif _Z_STOW; } @@ -3474,7 +3467,7 @@ inline void gcode_G28() { #if ENABLED(Z_PROBE_SLED) dock_sled(false); // engage (un-dock) the Z probe - #elif ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || (ENABLED(DELTA) && SERVO_LEVELING) + #elif ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || (ENABLED(DELTA) && HAS_Z_SERVO_ENDSTOP) deploy_z_probe(); #endif @@ -3727,7 +3720,7 @@ inline void gcode_G28() { #if ENABLED(DELTA) // Allen Key Probe for Delta - #if ENABLED(Z_PROBE_ALLEN_KEY) || SERVO_LEVELING + #if ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP stow_z_probe(); #else raise_z_after_probing(); // for non Allen Key probes, such as simple mechanical probe @@ -3848,9 +3841,6 @@ inline void gcode_G28() { * G30: Do a single Z probe at the current XY */ inline void gcode_G30() { - #if HAS_Z_SERVO_ENDSTOP - raise_z_for_servo(Z_RAISE_BEFORE_PROBING); - #endif deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here. stepper.synchronize(); @@ -3869,10 +3859,7 @@ inline void gcode_G28() { clean_up_after_endstop_move(); // Too early. must be done after the stowing. - #if HAS_Z_SERVO_ENDSTOP - raise_z_for_servo(Z_RAISE_AFTER_PROBING); - #endif - stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. + stow_z_probe(); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. report_current_position(); } @@ -5989,9 +5976,6 @@ inline void gcode_M400() { stepper.synchronize(); } * M401: Engage Z Servo endstop if available */ inline void gcode_M401() { - #if HAS_Z_SERVO_ENDSTOP - raise_z_for_servo(Z_RAISE_BEFORE_PROBING); - #endif deploy_z_probe(); } @@ -5999,10 +5983,7 @@ inline void gcode_M400() { stepper.synchronize(); } * M402: Retract Z Servo endstop if enabled */ inline void gcode_M402() { - #if HAS_Z_SERVO_ENDSTOP - raise_z_for_servo(Z_RAISE_AFTER_PROBING); - #endif - stow_z_probe(false); + stow_z_probe(); } #endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_SERVO_ENDSTOP || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED From 3b457c2dd3142b40213ab743793190ffb2959ac9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2016 14:31:01 -0700 Subject: [PATCH 119/580] Use deploy/stow with FIX_MOUNTED_PROBE too --- Marlin/Marlin_main.cpp | 381 +++++++++++++++++++++-------------------- 1 file changed, 192 insertions(+), 189 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8c6ef5c3f..4c7c0aaae 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1684,6 +1684,197 @@ static void setup_for_endstop_move() { #endif +#if HAS_BED_PROBE + + static void deploy_z_probe() { + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("deploy_z_probe", current_position); + #endif + + if (endstops.z_probe_enabled) return; + + #if HAS_Z_SERVO_ENDSTOP + + // Make room for Z Servo + raise_z_for_servo(Z_RAISE_BEFORE_PROBING); + + // Engage Z Servo endstop if enabled + DEPLOY_Z_SERVO(); + + #elif ENABLED(Z_PROBE_ALLEN_KEY) + float old_feedrate = feedrate; + + feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE; + + // If endstop is already false, the Z probe is deployed + #if ENABLED(Z_MIN_PROBE_ENDSTOP) + bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); + if (z_probe_endstop) + #else + bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); + if (z_min_endstop) + #endif + { + // Move to the start position to initiate deployment + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X; + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z; + prepare_move_to_destination_raw(); // this will also set_current_to_destination + + // Move to engage deployment + if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE) + feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE; + if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X) + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X; + if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y; + if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z; + prepare_move_to_destination_raw(); + + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X + if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) + feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE; + + // Move to trigger deployment + if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) + feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE; + if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X) + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X; + if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y; + if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z; + + prepare_move_to_destination_raw(); + #endif + } + + // Partially Home X,Y for safety + destination[X_AXIS] *= 0.75; + destination[Y_AXIS] *= 0.75; + prepare_move_to_destination_raw(); // this will also set_current_to_destination + + feedrate = old_feedrate; + + stepper.synchronize(); + + #if ENABLED(Z_MIN_PROBE_ENDSTOP) + z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); + if (z_probe_endstop) + #else + z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); + if (z_min_endstop) + #endif + { + if (IsRunning()) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); + LCD_ALERTMESSAGEPGM("Err: ZPROBE"); + } + stop(); + } + + #elif ENABLED(FIX_MOUNTED_PROBE) + + // Nothing to be done. Just enable_z_probe below... + + #endif + + endstops.enable_z_probe(); + } + + static void stow_z_probe() { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position); + #endif + + if (!endstops.z_probe_enabled) return; + + #if HAS_Z_SERVO_ENDSTOP + + // Make room for the servo + raise_z_for_servo(Z_RAISE_AFTER_PROBING); + + // Change the Z servo angle + STOW_Z_SERVO(); + + #elif ENABLED(Z_PROBE_ALLEN_KEY) + + float old_feedrate = feedrate; + + // Move up for safety + feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE; + + #if Z_RAISE_AFTER_PROBING > 0 + destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; + prepare_move_to_destination_raw(); // this will also set_current_to_destination + #endif + + // Move to the start position to initiate retraction + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X; + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z; + prepare_move_to_destination_raw(); + + // Move the nozzle down to push the Z probe into retracted position + if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE) + feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE; + if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X) + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X; + if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y) + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z; + prepare_move_to_destination_raw(); + + // Move up for safety + if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE) + feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE; + if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X) + destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X; + if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y) + destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y; + destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z; + prepare_move_to_destination_raw(); + + // Home XY for safety + feedrate = homing_feedrate[X_AXIS] / 2; + destination[X_AXIS] = 0; + destination[Y_AXIS] = 0; + prepare_move_to_destination_raw(); // this will also set_current_to_destination + + feedrate = old_feedrate; + + stepper.synchronize(); + + #if ENABLED(Z_MIN_PROBE_ENDSTOP) + bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); + if (!z_probe_endstop) + #else + bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); + if (!z_min_endstop) + #endif + { + if (IsRunning()) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); + LCD_ALERTMESSAGEPGM("Err: ZPROBE"); + } + stop(); + } + + #elif ENABLED(FIX_MOUNTED_PROBE) + + // Nothing to do here. Just clear endstops.z_probe_enabled + + #endif + + endstops.enable_z_probe(false); + } + +#endif // HAS_BED_PROBE + #if ENABLED(AUTO_BED_LEVELING_FEATURE) #if ENABLED(AUTO_BED_LEVELING_GRID) @@ -1872,194 +2063,6 @@ static void setup_for_endstop_move() { refresh_cmd_timeout(); } - #if HAS_BED_PROBE - - static void deploy_z_probe() { - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("deploy_z_probe", current_position); - #endif - - if (endstops.z_probe_enabled) return; - - #if HAS_Z_SERVO_ENDSTOP - - // Make room for Z Servo - raise_z_for_servo(Z_RAISE_BEFORE_PROBING); - - // Engage Z Servo endstop if enabled - DEPLOY_Z_SERVO(); - - #elif ENABLED(Z_PROBE_ALLEN_KEY) - float old_feedrate = feedrate; - - feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE; - - // If endstop is already false, the Z probe is deployed - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); - if (z_probe_endstop) - #else - bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (z_min_endstop) - #endif - { - // Move to the start position to initiate deployment - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z; - prepare_move_to_destination_raw(); // this will also set_current_to_destination - - // Move to engage deployment - if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE; - if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X) - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X; - if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y; - if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z; - prepare_move_to_destination_raw(); - - #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE; - - // Move to trigger deployment - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE; - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X) - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X; - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y; - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z; - - prepare_move_to_destination_raw(); - #endif - } - - // Partially Home X,Y for safety - destination[X_AXIS] *= 0.75; - destination[Y_AXIS] *= 0.75; - prepare_move_to_destination_raw(); // this will also set_current_to_destination - - feedrate = old_feedrate; - - stepper.synchronize(); - - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); - if (z_probe_endstop) - #else - z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (z_min_endstop) - #endif - { - if (IsRunning()) { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); - } - stop(); - } - - #endif // Z_PROBE_ALLEN_KEY - - #if ENABLED(FIX_MOUNTED_PROBE) - // Nothing to be done. Just enable_z_probe below... - #endif - - endstops.enable_z_probe(); - - } - - static void stow_z_probe() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position); - #endif - - if (!endstops.z_probe_enabled) return; - - #if HAS_Z_SERVO_ENDSTOP - - // Make room for the servo - raise_z_for_servo(Z_RAISE_AFTER_PROBING); - - // Change the Z servo angle - STOW_Z_SERVO(); - - #elif ENABLED(Z_PROBE_ALLEN_KEY) - - float old_feedrate = feedrate; - - // Move up for safety - feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE; - - #if Z_RAISE_AFTER_PROBING > 0 - destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; - prepare_move_to_destination_raw(); // this will also set_current_to_destination - #endif - - // Move to the start position to initiate retraction - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z; - prepare_move_to_destination_raw(); - - // Move the nozzle down to push the Z probe into retracted position - if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE; - if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X) - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X; - if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y) - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z; - prepare_move_to_destination_raw(); - - // Move up for safety - if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE; - if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X) - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X; - if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y) - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z; - prepare_move_to_destination_raw(); - - // Home XY for safety - feedrate = homing_feedrate[X_AXIS] / 2; - destination[X_AXIS] = 0; - destination[Y_AXIS] = 0; - prepare_move_to_destination_raw(); // this will also set_current_to_destination - - feedrate = old_feedrate; - - stepper.synchronize(); - - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); - if (!z_probe_endstop) - #else - bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (!z_min_endstop) - #endif - { - if (IsRunning()) { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); - } - stop(); - } - #elif ENABLED(FIX_MOUNTED_PROBE) - // Nothing to do here. Just clear endstops.z_probe_enabled - #endif - - endstops.enable_z_probe(false); - } - #endif // HAS_BED_PROBE - enum ProbeAction { ProbeStay = 0, ProbeDeploy = _BV(0), @@ -2306,7 +2309,7 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(Z_PROBE_SLED) #define _Z_DEPLOY (dock_sled(false)) #define _Z_STOW (dock_sled(true)) - #elif ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_SERVO_ENDSTOP || ENABLED(FIX_MOUNTED_PROBE)) + #elif (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_SERVO_ENDSTOP) || ENABLED(FIX_MOUNTED_PROBE) #define _Z_DEPLOY (deploy_z_probe()) #define _Z_STOW (stow_z_probe()) #elif HAS_Z_SERVO_ENDSTOP From f6b09cf465ed0d05685028cb32d35c2488557b97 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2016 15:50:51 -0700 Subject: [PATCH 120/580] Always use deploy/stow for dock_sled --- Marlin/Marlin_main.cpp | 252 +++++++++++++++++++---------------------- 1 file changed, 117 insertions(+), 135 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4c7c0aaae..0eba959b1 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1655,6 +1655,10 @@ static void setup_for_endstop_move() { feedrate = old_feedrate; } + inline void do_blocking_move_to_x(float x) { + do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]); + } + inline void do_blocking_move_to_z(float z) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); } @@ -1684,6 +1688,63 @@ static void setup_for_endstop_move() { #endif +#if HAS_BED_PROBE + + inline void raise_z_after_probing() { + #if Z_RAISE_AFTER_PROBING > 0 + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("raise_z_after_probing()"); + #endif + do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); + #endif + } +#endif + +#if ENABLED(Z_PROBE_SLED) + + #ifndef SLED_DOCKING_OFFSET + #define SLED_DOCKING_OFFSET 0 + #endif + + /** + * Method to dock/undock a sled designed by Charles Bell. + * + * dock[in] If true, move to MAX_X and engage the electromagnet + * offset[in] The additional distance to move to adjust docking location + */ + static void dock_sled(bool dock, int offset = 0) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("dock_sled(", dock); + SERIAL_ECHOLNPGM(")"); + } + #endif + + if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) { + axis_unhomed_error(true); + return; + } + + if (endstops.z_probe_enabled == !dock) return; // already docked/undocked? + + float oldXpos = current_position[X_AXIS]; // save x position + if (dock) { + raise_z_after_probing(); // raise Z + // Dock sled a bit closer to ensure proper capturing + do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); + digitalWrite(SLED_PIN, LOW); // turn off magnet + } + else { + float z_loc = current_position[Z_AXIS]; + if (z_loc < Z_RAISE_BEFORE_PROBING + 5) z_loc = Z_RAISE_BEFORE_PROBING; + do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], z_loc); // this also updates current_position + digitalWrite(SLED_PIN, HIGH); // turn on magnet + } + do_blocking_move_to_x(oldXpos); // return to position before docking + } + +#endif // Z_PROBE_SLED + #if HAS_BED_PROBE static void deploy_z_probe() { @@ -1694,7 +1755,11 @@ static void setup_for_endstop_move() { if (endstops.z_probe_enabled) return; - #if HAS_Z_SERVO_ENDSTOP + #if ENABLED(Z_PROBE_SLED) + + dock_sled(false); + + #elif HAS_Z_SERVO_ENDSTOP // Make room for Z Servo raise_z_for_servo(Z_RAISE_BEFORE_PROBING); @@ -1792,7 +1857,11 @@ static void setup_for_endstop_move() { if (!endstops.z_probe_enabled) return; - #if HAS_Z_SERVO_ENDSTOP + #if ENABLED(Z_PROBE_SLED) + + dock_sled(true); + + #elif HAS_Z_SERVO_ENDSTOP // Make room for the servo raise_z_for_servo(Z_RAISE_AFTER_PROBING); @@ -2040,19 +2109,6 @@ static void setup_for_endstop_move() { do_blocking_move_to(x, y, current_position[Z_AXIS]); } - inline void do_blocking_move_to_x(float x) { - do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]); - } - - inline void raise_z_after_probing() { - #if Z_RAISE_AFTER_PROBING > 0 - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("raise_z_after_probing()"); - #endif - do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); - #endif - } - static void clean_up_after_endstop_move() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("clean_up_after_endstop_move > ENDSTOPS_ONLY_FOR_HOMING > endstops.not_homing()"); @@ -2229,55 +2285,6 @@ static void setup_for_endstop_move() { } #endif -#if ENABLED(Z_PROBE_SLED) - - #ifndef SLED_DOCKING_OFFSET - #define SLED_DOCKING_OFFSET 0 - #endif - - /** - * Method to dock/undock a sled designed by Charles Bell. - * - * dock[in] If true, move to MAX_X and engage the electromagnet - * offset[in] The additional distance to move to adjust docking location - */ - static void dock_sled(bool dock, int offset = 0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("dock_sled(", dock); - SERIAL_ECHOLNPGM(")"); - } - #endif - - if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) { - axis_unhomed_error(true); - return; - } - - if (endstops.z_probe_enabled == !dock) return; // already docked/undocked? - - float oldXpos = current_position[X_AXIS]; // save x position - if (dock) { - raise_z_after_probing(); // raise Z - // Dock sled a bit closer to ensure proper capturing - do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); - digitalWrite(SLED_PIN, LOW); // turn off magnet - } - else { - float z_loc = current_position[Z_AXIS]; - if (z_loc < Z_RAISE_BEFORE_PROBING + 5) z_loc = Z_RAISE_BEFORE_PROBING; - do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], z_loc); // this also updates current_position - digitalWrite(SLED_PIN, HIGH); // turn on magnet - } - do_blocking_move_to_x(oldXpos); // return to position before docking - - endstops.enable_z_probe(!dock); // logically disable docked probe - } - -#endif // Z_PROBE_SLED - - - /** * Home an individual axis */ @@ -2306,24 +2313,13 @@ static void homeaxis(AxisEnum axis) { current_position[axis] = 0; sync_plan_position(); - #if ENABLED(Z_PROBE_SLED) - #define _Z_DEPLOY (dock_sled(false)) - #define _Z_STOW (dock_sled(true)) - #elif (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_SERVO_ENDSTOP) || ENABLED(FIX_MOUNTED_PROBE) - #define _Z_DEPLOY (deploy_z_probe()) - #define _Z_STOW (stow_z_probe()) - #elif HAS_Z_SERVO_ENDSTOP - #define _Z_DEPLOY do{ raise_z_for_servo(Z_RAISE_BEFORE_PROBING); DEPLOY_Z_SERVO(); endstops.z_probe_enabled = true; }while(0) - #define _Z_STOW do{ raise_z_for_servo(Z_RAISE_AFTER_PROBING); STOW_Z_SERVO(); endstops.z_probe_enabled = false; }while(0) - #endif - // Homing Z towards the bed? Deploy the Z probe or endstop. - #if HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(FIX_MOUNTED_PROBE) + #if HAS_BED_PROBE if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > " STRINGIFY(_Z_DEPLOY)); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > deploy_z_probe()"); #endif - _Z_DEPLOY; + deploy_z_probe(); } #endif @@ -2441,12 +2437,12 @@ static void homeaxis(AxisEnum axis) { axis_homed[axis] = true; // Put away the Z probe - #if HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(FIX_MOUNTED_PROBE) + #if HAS_BED_PROBE if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > " STRINGIFY(_Z_STOW)); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > stow_z_probe()"); #endif - _Z_STOW; + stow_z_probe(); } #endif @@ -3468,9 +3464,7 @@ inline void gcode_G28() { #endif // !DELTA } - #if ENABLED(Z_PROBE_SLED) - dock_sled(false); // engage (un-dock) the Z probe - #elif ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || (ENABLED(DELTA) && HAS_Z_SERVO_ENDSTOP) + #if HAS_BED_PROBE deploy_z_probe(); #endif @@ -3721,14 +3715,7 @@ inline void gcode_G28() { #endif // !AUTO_BED_LEVELING_GRID - #if ENABLED(DELTA) - // Allen Key Probe for Delta - #if ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP - stow_z_probe(); - #else - raise_z_after_probing(); // for non Allen Key probes, such as simple mechanical probe - #endif - #else // !DELTA + #if DISABLED(DELTA) if (verbose_level > 0) planner.bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); @@ -3788,7 +3775,7 @@ inline void gcode_G28() { #if HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + Z_RAISE_AFTER_PROBING #endif - ; + ; // current_position[Z_AXIS] += home_offset[Z_AXIS]; // The Z probe determines Z=0, not "Z home" sync_plan_position(); @@ -3796,18 +3783,13 @@ inline void gcode_G28() { if (DEBUGGING(LEVELING)) DEBUG_POS("> corrected Z in G29", current_position); #endif } - - // Sled assembly for Cartesian bots - #if ENABLED(Z_PROBE_SLED) - dock_sled(true); // dock the sled - #elif !HAS_Z_SERVO_ENDSTOP && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) - // Raise Z axis for non-delta and non servo based probes - raise_z_after_probing(); - #endif - #endif // !DELTA - #if ENABLED(MECHANICAL_PROBE) + #if DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) && !HAS_Z_SERVO_ENDSTOP + raise_z_after_probing(); + #endif + + #if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(MECHANICAL_PROBE) stow_z_probe(); #endif @@ -3838,38 +3820,38 @@ inline void gcode_G28() { KEEPALIVE_STATE(IN_HANDLER); } - #if DISABLED(Z_PROBE_SLED) // could be avoided +#endif //AUTO_BED_LEVELING_FEATURE - /** - * G30: Do a single Z probe at the current XY - */ - inline void gcode_G30() { - deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here. +#if HAS_BED_PROBE - stepper.synchronize(); - // TODO: clear the leveling matrix or the planner will be set incorrectly - setup_for_endstop_move(); // Too late. Must be done before deploying. + /** + * G30: Do a single Z probe at the current XY + */ + inline void gcode_G30() { + deploy_z_probe(); - run_z_probe(); + stepper.synchronize(); + // TODO: clear the leveling matrix or the planner will be set incorrectly + setup_for_endstop_move(); // Too late. Must be done before deploying. - SERIAL_PROTOCOLPGM("Bed X: "); - SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); - SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL(current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); - SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL(current_position[Z_AXIS] + 0.0001); - SERIAL_EOL; + run_z_probe(); - clean_up_after_endstop_move(); // Too early. must be done after the stowing. + SERIAL_PROTOCOLPGM("Bed X: "); + SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); + SERIAL_PROTOCOLPGM(" Y: "); + SERIAL_PROTOCOL(current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); + SERIAL_PROTOCOLPGM(" Z: "); + SERIAL_PROTOCOL(current_position[Z_AXIS] + 0.0001); + SERIAL_EOL; - stow_z_probe(); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. + clean_up_after_endstop_move(); // Too early. must be done after the stowing. - report_current_position(); - } + stow_z_probe(); - #endif //!Z_PROBE_SLED + report_current_position(); + } -#endif //AUTO_BED_LEVELING_FEATURE +#endif // HAS_BED_PROBE /** * G92: Set current position to given X Y Z E @@ -6875,24 +6857,24 @@ void process_next_command() { break; #endif - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - - #if DISABLED(Z_PROBE_SLED) + #if HAS_BED_PROBE - case 30: // G30 Single Z probe - gcode_G30(); - break; + case 30: // G30 Single Z probe + gcode_G30(); + break; - #else // Z_PROBE_SLED + #if ENABLED(Z_PROBE_SLED) case 31: // G31: dock the sled + stow_z_probe(); + break; case 32: // G32: undock the sled - dock_sled(codenum == 31); + deploy_z_probe(); break; #endif // Z_PROBE_SLED - #endif // AUTO_BED_LEVELING_FEATURE + #endif // HAS_BED_PROBE case 90: // G90 relative_mode = false; From 51d52cb52a5e1b2604b8d5eeef4e59e6785b549e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2016 16:02:27 -0700 Subject: [PATCH 121/580] Make run_z_probe available for any bed probe --- Marlin/Marlin_main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0eba959b1..d6dbc9f38 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2021,6 +2021,10 @@ static void setup_for_endstop_move() { #endif // !AUTO_BED_LEVELING_GRID +#endif // AUTO_BED_LEVELING_FEATURE + +#if HAS_BED_PROBE + static void run_z_probe() { float old_feedrate = feedrate; @@ -2105,6 +2109,10 @@ static void setup_for_endstop_move() { feedrate = old_feedrate; } +#endif // HAS_BED_PROBE + +#if ENABLED(AUTO_BED_LEVELING_FEATURE) + inline void do_blocking_move_to_xy(float x, float y) { do_blocking_move_to(x, y, current_position[Z_AXIS]); } From ed75b0ea1171e2ec35d72ee7aa3303da7a3d4348 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2016 16:21:43 -0700 Subject: [PATCH 122/580] Make clean_up function available for probes --- Marlin/Marlin_main.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d6dbc9f38..e1206e488 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1583,6 +1583,16 @@ static void setup_for_endstop_move() { #if HAS_BED_PROBE + static void clean_up_after_endstop_move() { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("clean_up_after_endstop_move > endstops.not_homing()"); + #endif + endstops.not_homing(); + feedrate = saved_feedrate; + feedrate_multiplier = saved_feedrate_multiplier; + refresh_cmd_timeout(); + } + #if ENABLED(DELTA) /** * Calculate delta, start a line, and set current_position to destination @@ -2067,7 +2077,10 @@ static void setup_for_endstop_move() { #else // !DELTA - planner.bed_level_matrix.set_to_identity(); + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + planner.bed_level_matrix.set_to_identity(); + #endif + feedrate = homing_feedrate[Z_AXIS]; // Move down until the Z probe (or endstop?) is triggered @@ -2117,16 +2130,6 @@ static void setup_for_endstop_move() { do_blocking_move_to(x, y, current_position[Z_AXIS]); } - static void clean_up_after_endstop_move() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("clean_up_after_endstop_move > ENDSTOPS_ONLY_FOR_HOMING > endstops.not_homing()"); - #endif - endstops.not_homing(); - feedrate = saved_feedrate; - feedrate_multiplier = saved_feedrate_multiplier; - refresh_cmd_timeout(); - } - enum ProbeAction { ProbeStay = 0, ProbeDeploy = _BV(0), From 04e88d008e615564b2a695c066f287fda81f99c7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2016 16:18:30 -0700 Subject: [PATCH 123/580] Clear up ordering in G30 --- Marlin/Marlin_main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e1206e488..21b286730 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3839,11 +3839,13 @@ inline void gcode_G28() { * G30: Do a single Z probe at the current XY */ inline void gcode_G30() { + + setup_for_endstop_move(); + deploy_z_probe(); stepper.synchronize(); // TODO: clear the leveling matrix or the planner will be set incorrectly - setup_for_endstop_move(); // Too late. Must be done before deploying. run_z_probe(); @@ -3855,10 +3857,10 @@ inline void gcode_G28() { SERIAL_PROTOCOL(current_position[Z_AXIS] + 0.0001); SERIAL_EOL; - clean_up_after_endstop_move(); // Too early. must be done after the stowing. - stow_z_probe(); + clean_up_after_endstop_move(); + report_current_position(); } From 6aba98e4704b151e3b24753a884c73ae6e63102b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2016 16:18:41 -0700 Subject: [PATCH 124/580] Comment on setup_for_endstop_move --- Marlin/Marlin_main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 21b286730..52f97db7f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1570,6 +1570,18 @@ inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[ inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); } inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } +// +// Prepare to do endstop or probe moves +// with custom feedrates. +// +// - Save current feedrates +// - Reset the rate multiplier +// - Enable the endstops +// - Reset the command timeout +// +// clean_up_after_endstop_move() restores +// feedrates, sets endstops back to global state. +// static void setup_for_endstop_move() { saved_feedrate = feedrate; saved_feedrate_multiplier = feedrate_multiplier; From 2530371516f037760f1282d7b105f8f3e4ae10b3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2016 16:40:28 -0700 Subject: [PATCH 125/580] Always disable probe at the end of G29 --- Marlin/Marlin_main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 52f97db7f..119131b41 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3814,6 +3814,8 @@ inline void gcode_G28() { #if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(MECHANICAL_PROBE) stow_z_probe(); + #else + endstops.enable_z_probe(false); #endif #ifdef Z_PROBE_END_SCRIPT @@ -3824,9 +3826,6 @@ inline void gcode_G28() { } #endif enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT)); - #if HAS_BED_PROBE - endstops.enable_z_probe(false); - #endif stepper.synchronize(); #endif @@ -3857,9 +3856,9 @@ inline void gcode_G28() { deploy_z_probe(); stepper.synchronize(); - // TODO: clear the leveling matrix or the planner will be set incorrectly - run_z_probe(); + // TODO: clear the leveling matrix or the planner will be set incorrectly + run_z_probe(); // clears the ABL non-delta matrix only SERIAL_PROTOCOLPGM("Bed X: "); SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); From 6563b07879a3537721d889bf958639b1755a7cc5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Jun 2016 14:56:16 -0700 Subject: [PATCH 126/580] Test for mechanical and fix mounted probes --- .travis.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef027aa0b..1916669c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,13 +90,35 @@ script: - opt_enable PIDTEMPBED - build_marlin # - # Test a Servo Probe without leveling + # Test a "Fix Mounted" Probe + # + - restore_configs + - opt_enable FIX_MOUNTED_PROBE + - build_marlin + # + # ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE + # + - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE + - build_marlin + # + # Test a Mechanical Probe + # + - restore_configs + - opt_enable MECHANICAL_PROBE + - build_marlin + # + # ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE + # + - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE + - build_marlin + # + # Test a Servo Probe # - restore_configs - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - build_marlin # - # Test AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE with a Servo Probe + # ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE # - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE - build_marlin From 7f8a2025af18c44136ddc04d1fcf903b3321cbb6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 01:02:01 -0700 Subject: [PATCH 127/580] Move raise_z_after_probing into earlier block --- Marlin/Marlin_main.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 119131b41..794aec5a8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1685,6 +1685,14 @@ static void setup_for_endstop_move() { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); } + inline void raise_z_after_probing() { + #if Z_RAISE_AFTER_PROBING > 0 + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("raise_z_after_probing()"); + #endif + do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); + #endif + } #endif //HAS_BED_PROBE #if HAS_Z_SERVO_ENDSTOP @@ -1710,18 +1718,6 @@ static void setup_for_endstop_move() { #endif -#if HAS_BED_PROBE - - inline void raise_z_after_probing() { - #if Z_RAISE_AFTER_PROBING > 0 - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("raise_z_after_probing()"); - #endif - do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); - #endif - } -#endif - #if ENABLED(Z_PROBE_SLED) #ifndef SLED_DOCKING_OFFSET From 26a9cd0b082e2bcccd7b54c36eec657f0ecc8b96 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 01:25:23 -0700 Subject: [PATCH 128/580] Move run_z_probe to earlier block --- Marlin/Marlin_main.cpp | 158 +++++++++++++++++++---------------------- 1 file changed, 75 insertions(+), 83 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 794aec5a8..fe8559dd8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1960,89 +1960,6 @@ static void setup_for_endstop_move() { endstops.enable_z_probe(false); } -#endif // HAS_BED_PROBE - -#if ENABLED(AUTO_BED_LEVELING_FEATURE) - - #if ENABLED(AUTO_BED_LEVELING_GRID) - - #if DISABLED(DELTA) - - static void set_bed_level_equation_lsq(double* plane_equation_coefficients) { - - //planner.bed_level_matrix.debug("bed level before"); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - planner.bed_level_matrix.set_to_identity(); - if (DEBUGGING(LEVELING)) { - vector_3 uncorrected_position = planner.adjusted_position(); - DEBUG_POS(">>> set_bed_level_equation_lsq", uncorrected_position); - DEBUG_POS(">>> set_bed_level_equation_lsq", current_position); - } - #endif - - vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - vector_3 corrected_position = planner.adjusted_position(); - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = corrected_position.z; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", corrected_position); - #endif - - sync_plan_position(); - } - - #endif // !DELTA - - #else // !AUTO_BED_LEVELING_GRID - - static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { - - planner.bed_level_matrix.set_to_identity(); - - vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); - vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); - vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); - vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); - - if (planeNormal.z < 0) { - planeNormal.x = -planeNormal.x; - planeNormal.y = -planeNormal.y; - planeNormal.z = -planeNormal.z; - } - - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - vector_3 corrected_position = planner.adjusted_position(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - vector_3 uncorrected_position = corrected_position; - DEBUG_POS("set_bed_level_equation_3pts", uncorrected_position); - } - #endif - - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = corrected_position.z; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", corrected_position); - #endif - - sync_plan_position(); - } - - #endif // !AUTO_BED_LEVELING_GRID - -#endif // AUTO_BED_LEVELING_FEATURE - -#if HAS_BED_PROBE - static void run_z_probe() { float old_feedrate = feedrate; @@ -2134,6 +2051,81 @@ static void setup_for_endstop_move() { #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #if ENABLED(AUTO_BED_LEVELING_GRID) + + #if DISABLED(DELTA) + + static void set_bed_level_equation_lsq(double* plane_equation_coefficients) { + + //planner.bed_level_matrix.debug("bed level before"); + + #if ENABLED(DEBUG_LEVELING_FEATURE) + planner.bed_level_matrix.set_to_identity(); + if (DEBUGGING(LEVELING)) { + vector_3 uncorrected_position = planner.adjusted_position(); + DEBUG_POS(">>> set_bed_level_equation_lsq", uncorrected_position); + DEBUG_POS(">>> set_bed_level_equation_lsq", current_position); + } + #endif + + vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); + planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + + vector_3 corrected_position = planner.adjusted_position(); + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = corrected_position.z; + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", corrected_position); + #endif + + sync_plan_position(); + } + + #endif // !DELTA + + #else // !AUTO_BED_LEVELING_GRID + + static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { + + planner.bed_level_matrix.set_to_identity(); + + vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); + vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); + vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); + vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); + + if (planeNormal.z < 0) { + planeNormal.x = -planeNormal.x; + planeNormal.y = -planeNormal.y; + planeNormal.z = -planeNormal.z; + } + + planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + + vector_3 corrected_position = planner.adjusted_position(); + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + vector_3 uncorrected_position = corrected_position; + DEBUG_POS("set_bed_level_equation_3pts", uncorrected_position); + } + #endif + + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = corrected_position.z; + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", corrected_position); + #endif + + sync_plan_position(); + } + + #endif // !AUTO_BED_LEVELING_GRID + inline void do_blocking_move_to_xy(float x, float y) { do_blocking_move_to(x, y, current_position[Z_AXIS]); } From 3996242e9df82a23f82a2175ac79188f0696c068 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 01:28:36 -0700 Subject: [PATCH 129/580] Allow Z_MIN_PROBE_REPEATABILITY_TEST solo --- Marlin/Configuration.h | 4 +++- Marlin/Marlin_main.cpp | 20 ++++--------------- Marlin/SanityCheck.h | 10 ++++------ .../Cartesio/Configuration.h | 4 +++- .../Felix/Configuration.h | 6 ++++-- .../Felix/DUAL/Configuration.h | 6 ++++-- .../Hephestos/Configuration.h | 4 +++- .../Hephestos_2/Configuration.h | 4 +++- .../K8200/Configuration.h | 4 +++- .../RepRapWorld/Megatronics/Configuration.h | 4 +++- .../RigidBot/Configuration.h | 6 ++++-- .../SCARA/Configuration.h | 6 ++++-- .../TAZ4/Configuration.h | 4 +++- .../WITBOX/Configuration.h | 4 +++- .../adafruit/ST7565/Configuration.h | 4 +++- .../delta/biv2.5/Configuration.h | 6 ++++-- .../delta/generic/Configuration.h | 6 ++++-- .../delta/kossel_mini/Configuration.h | 6 ++++-- .../delta/kossel_pro/Configuration.h | 6 ++++-- .../delta/kossel_xl/Configuration.h | 6 ++++-- .../makibox/Configuration.h | 4 +++- .../tvrrug/Round2/Configuration.h | 4 +++- 22 files changed, 77 insertions(+), 51 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 49a4c84bf..84cf41631 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -504,6 +504,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -620,7 +623,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index fe8559dd8..c9172e71b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4164,19 +4164,7 @@ inline void gcode_M42() { } // code_seen('S') } -#if ENABLED(AUTO_BED_LEVELING_FEATURE) && ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - - /** - * This is redundant since the SanityCheck.h already checks for a valid - * Z_MIN_PROBE_PIN, but here for clarity. - */ - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #if !HAS_Z_MIN_PROBE_PIN - #error "You must define Z_MIN_PROBE_PIN to enable Z probe repeatability calculation." - #endif - #elif !HAS_Z_MIN - #error "You must define Z_MIN_PIN to enable Z probe repeatability calculation." - #endif +#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) /** * M48: Z probe repeatability measurement function. @@ -4439,7 +4427,7 @@ inline void gcode_M42() { report_current_position(); } -#endif // AUTO_BED_LEVELING_FEATURE && Z_MIN_PROBE_REPEATABILITY_TEST +#endif // Z_MIN_PROBE_REPEATABILITY_TEST /** * M75: Start print timer @@ -6958,11 +6946,11 @@ void process_next_command() { gcode_M42(); break; - #if ENABLED(AUTO_BED_LEVELING_FEATURE) && ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) + #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) case 48: // M48 Z probe repeatability gcode_M48(); break; - #endif // AUTO_BED_LEVELING_FEATURE && Z_MIN_PROBE_REPEATABILITY_TEST + #endif // Z_MIN_PROBE_REPEATABILITY_TEST case 75: // Start print timer gcode_M75(); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 9fa8b87be..d80c2c296 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -300,10 +300,12 @@ #else /** - * Require some kind of probe for bed leveling + * Require some kind of probe for bed leveling and probe testing */ #if ENABLED(AUTO_BED_LEVELING_FEATURE) #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) + #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #endif #endif @@ -318,11 +320,7 @@ */ #if !PIN_EXISTS(Z_MIN) #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z probe, but not enable it. - #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - #error "You must have a Z_MIN or Z_PROBE endstop to enable Z_MIN_PROBE_REPEATABILITY_TEST." - #else - #error "AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin." - #endif + #error "AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin." #endif #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index ad240da88..47fea5818 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -503,6 +503,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -619,7 +622,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 2b03a996a..acb3e8e44 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -486,6 +486,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -602,8 +605,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 8aa3797ae..a00e802eb 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -484,6 +484,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -600,8 +603,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index ea372e1dc..18f273428 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -496,6 +496,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -612,7 +615,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 012117ed0..62b75ff82 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -498,6 +498,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -614,7 +617,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index c9c352fb2..40755a0af 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -521,6 +521,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -637,7 +640,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 0bf419522..64a79f7eb 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -504,6 +504,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -620,7 +623,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index d6f7fec37..fefb7a932 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -498,6 +498,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -614,8 +617,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 1325404f9..bc848f1fd 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -512,6 +512,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -628,8 +631,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 077ae99c6..5412a499e 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -525,6 +525,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -641,7 +644,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 40eace601..97195830f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -496,6 +496,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -612,7 +615,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 64aedccd2..be7609305 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -504,6 +504,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -620,7 +623,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index a1d12825e..846d7609d 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -583,6 +583,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // Z_PROBE_ALLEN_KEY +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -699,8 +702,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 215df5fb7..a50d083c0 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -577,6 +577,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // Z_PROBE_ALLEN_KEY +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -693,8 +696,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 688a53def..45fe403ab 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -580,6 +580,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // Z_PROBE_ALLEN_KEY +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -696,8 +699,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 8af093a9b..ff02bdf0a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -574,6 +574,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // Z_PROBE_ALLEN_KEY +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -690,8 +693,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index d97d5dfb9..c516ec73b 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -575,6 +575,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // Z_PROBE_ALLEN_KEY +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -691,8 +694,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -//#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. - +// #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index d06bbb04d..6f30d1188 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -507,6 +507,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -623,7 +626,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index ef06e4212..643372bc7 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -494,6 +494,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + // // Probe Raise options provide clearance for the probe to deploy and stow. // @@ -610,7 +613,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -#define Z_MIN_PROBE_REPEATABILITY_TEST // If not commented out, Z Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #if ENABLED(AUTO_BED_LEVELING_FEATURE) From dcb8ec32eef06e4870430be848db30b8f97a1acb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 02:13:41 -0700 Subject: [PATCH 130/580] Fix compile error with watch_bed_next_ms --- Marlin/temperature.cpp | 2 +- Marlin/temperature.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index b80950ffb..cb10f9d25 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -101,7 +101,7 @@ unsigned char Temperature::soft_pwm_bed; millis_t Temperature::watch_heater_next_ms[HOTENDS] = { 0 }; #endif -#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_BED_TEMP_PERIOD > 0 +#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0 int Temperature::watch_target_bed_temp = 0; millis_t Temperature::watch_bed_next_ms = 0; #endif diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 9cb990988..60aa80d6a 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -105,7 +105,7 @@ class Temperature { static millis_t watch_heater_next_ms[HOTENDS]; #endif - #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_BED_TEMP_PERIOD > 0 + #if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0 static int watch_target_bed_temp; static millis_t watch_bed_next_ms; #endif From 19fe93a5a9130e403688830f2edc319231c67997 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 03:10:46 -0700 Subject: [PATCH 131/580] Clean up configs for Z_MIN_PROBE_REPEATABILITY_TEST --- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/DUAL/Configuration.h | 2 +- Marlin/example_configurations/RigidBot/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index acb3e8e44..26493f74a 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -605,7 +605,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index a00e802eb..706d2a398 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -603,7 +603,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index fefb7a932..443f9d8ae 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -617,7 +617,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index bc848f1fd..89b397a80 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -631,7 +631,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 846d7609d..496ccc4aa 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -702,7 +702,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index a50d083c0..7cd5a5244 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -696,7 +696,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 45fe403ab..dce2a460c 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -699,7 +699,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index ff02bdf0a..13214454f 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -693,7 +693,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index c516ec73b..f9b12b194 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -694,7 +694,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE -// + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: From f77f3ffa7048a784dde0a3c1ed81b78b92018e1d Mon Sep 17 00:00:00 2001 From: esenapaj Date: Tue, 21 Jun 2016 19:33:45 +0900 Subject: [PATCH 132/580] Remove duplicated Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX --- .../example_configurations/Hephestos_2/Configuration.h | 9 ++------- .../delta/kossel_pro/Configuration.h | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 62b75ff82..62168c19d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -512,8 +512,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // For M851 give a range for adjusting the Z probe offset // -#define Z_PROBE_OFFSET_RANGE_MIN -20 -#define Z_PROBE_OFFSET_RANGE_MAX 20 +#define Z_PROBE_OFFSET_RANGE_MIN -5 +#define Z_PROBE_OFFSET_RANGE_MAX 0 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} @@ -733,11 +733,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section probes - -#define Z_PROBE_OFFSET_RANGE_MIN -5 -#define Z_PROBE_OFFSET_RANGE_MAX 0 - // @section extras // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index ff02bdf0a..205c87c80 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -588,8 +588,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // For M851 give a range for adjusting the Z probe offset // -#define Z_PROBE_OFFSET_RANGE_MIN -20 -#define Z_PROBE_OFFSET_RANGE_MAX 20 +#define Z_PROBE_OFFSET_RANGE_MIN -15 +#define Z_PROBE_OFFSET_RANGE_MAX 5 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} @@ -821,11 +821,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Additional Features =========================== //============================================================================= -// @section probes - -#define Z_PROBE_OFFSET_RANGE_MIN -15 -#define Z_PROBE_OFFSET_RANGE_MAX 5 - // @section extras // From 740fb2ce398111087c4a2cb77474404427ac94e7 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Tue, 21 Jun 2016 19:37:45 +0900 Subject: [PATCH 133/580] Adjust spacing --- Marlin/example_configurations/Felix/Configuration.h | 1 - Marlin/example_configurations/Felix/DUAL/Configuration.h | 1 - Marlin/example_configurations/Hephestos/Configuration.h | 1 - Marlin/example_configurations/K8200/Configuration.h | 1 - .../RepRapWorld/Megatronics/Configuration.h | 1 - Marlin/example_configurations/RigidBot/Configuration.h | 1 - Marlin/example_configurations/SCARA/Configuration.h | 1 - Marlin/example_configurations/TAZ4/Configuration.h | 1 - Marlin/example_configurations/WITBOX/Configuration.h | 1 - Marlin/example_configurations/adafruit/ST7565/Configuration.h | 1 - Marlin/example_configurations/makibox/Configuration.h | 1 - Marlin/example_configurations/tvrrug/Round2/Configuration.h | 1 - 12 files changed, 12 deletions(-) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index acb3e8e44..33dddfc1c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -656,7 +656,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index a00e802eb..9c3d42760 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -654,7 +654,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 18f273428..52ad056d1 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -666,7 +666,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 40755a0af..6846bcf46 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -691,7 +691,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 64a79f7eb..84088cefc 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -674,7 +674,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index fefb7a932..ec965013e 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -668,7 +668,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index bc848f1fd..ef69905dd 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -682,7 +682,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 5412a499e..91549d73c 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -695,7 +695,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 97195830f..a4c2445e8 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -666,7 +666,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index be7609305..30cf6eec9 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -674,7 +674,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 6f30d1188..c0dac4093 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -677,7 +677,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 643372bc7..7b56b9cc3 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -664,7 +664,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. - // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! From aa6d35bd491d7480dababa40bee766c1aeccfe9a Mon Sep 17 00:00:00 2001 From: esenapaj Date: Tue, 21 Jun 2016 20:32:00 +0900 Subject: [PATCH 134/580] Move code block of probe to appropriate position --- .../Felix/Configuration.h | 88 +++++++++---------- .../Felix/DUAL/Configuration.h | 88 +++++++++---------- .../Hephestos/Configuration.h | 88 +++++++++---------- .../Hephestos_2/Configuration.h | 88 +++++++++---------- .../K8200/Configuration.h | 88 +++++++++---------- .../RepRapWorld/Megatronics/Configuration.h | 88 +++++++++---------- .../RigidBot/Configuration.h | 88 +++++++++---------- .../SCARA/Configuration.h | 88 +++++++++---------- .../TAZ4/Configuration.h | 88 +++++++++---------- .../WITBOX/Configuration.h | 88 +++++++++---------- .../adafruit/ST7565/Configuration.h | 88 +++++++++---------- .../delta/biv2.5/Configuration.h | 88 +++++++++---------- .../delta/generic/Configuration.h | 88 +++++++++---------- .../delta/kossel_mini/Configuration.h | 88 +++++++++---------- .../delta/kossel_pro/Configuration.h | 88 +++++++++---------- .../delta/kossel_xl/Configuration.h | 88 +++++++++---------- .../makibox/Configuration.h | 88 +++++++++---------- .../tvrrug/Round2/Configuration.h | 88 +++++++++---------- 18 files changed, 792 insertions(+), 792 deletions(-) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 33dddfc1c..02aecfdf4 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -391,50 +391,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -486,6 +442,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 9c3d42760..ed87eae12 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -389,50 +389,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -484,6 +440,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 52ad056d1..a0a953c39 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -401,50 +401,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -496,6 +452,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 62168c19d..95e9e7f37 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -403,50 +403,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -498,6 +454,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 6846bcf46..e8a196e5a 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -426,50 +426,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -521,6 +477,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 84088cefc..fb099ba0f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -409,50 +409,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -504,6 +460,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index ec965013e..993637676 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -403,50 +403,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -498,6 +454,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index ef69905dd..b9aaff7fc 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -417,50 +417,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -512,6 +468,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 91549d73c..49d7afc98 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -430,50 +430,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -525,6 +481,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index a4c2445e8..8a54cbed2 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -401,50 +401,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -496,6 +452,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 30cf6eec9..6b28ed222 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -409,50 +409,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -504,6 +460,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 846d7609d..28dd41bcc 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -451,50 +451,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -583,6 +539,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // Z_PROBE_ALLEN_KEY +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index a50d083c0..093d064ac 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -451,50 +451,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -577,6 +533,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // Z_PROBE_ALLEN_KEY +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 45fe403ab..79a0dc36c 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -451,50 +451,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -580,6 +536,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // Z_PROBE_ALLEN_KEY +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 205c87c80..2aacb3b55 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -440,50 +440,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -574,6 +530,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // Z_PROBE_ALLEN_KEY +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index c516ec73b..7f363d70f 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -449,50 +449,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -575,6 +531,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // Z_PROBE_ALLEN_KEY +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index c0dac4093..2731ae6a2 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -412,50 +412,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -507,6 +463,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 7b56b9cc3..8874f019f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -399,50 +399,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //============================= Z Probe Options ============================= //=========================================================================== -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Some other boards map differently. -// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - -// To use a probe you must enable one of the two options above! - -// This option disables the use of the Z_MIN_PROBE_PIN -// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a -// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. -// If you're using the Z MIN endstop connector for your Z probe, this has no effect. -//#define DISABLE_Z_MIN_PROBE_ENDSTOP - // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. @@ -494,6 +450,50 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Allen Key Probe is defined in the Delta example configurations. // +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST From d583ea852ded211fc47f850edfaf40c3f0b2c449 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Tue, 21 Jun 2016 20:51:27 +0900 Subject: [PATCH 135/580] Standardize format description of Panel --- Marlin/Configuration.h | 4 ++++ Marlin/example_configurations/Cartesio/Configuration.h | 4 ++++ Marlin/example_configurations/Felix/Configuration.h | 4 ++++ Marlin/example_configurations/Felix/DUAL/Configuration.h | 4 ++++ Marlin/example_configurations/Hephestos/Configuration.h | 4 ++++ Marlin/example_configurations/Hephestos_2/Configuration.h | 4 ++++ Marlin/example_configurations/K8200/Configuration.h | 4 ++++ .../RepRapWorld/Megatronics/Configuration.h | 4 ++++ Marlin/example_configurations/RigidBot/Configuration.h | 4 ++++ Marlin/example_configurations/SCARA/Configuration.h | 4 ++++ Marlin/example_configurations/TAZ4/Configuration.h | 4 ++++ Marlin/example_configurations/WITBOX/Configuration.h | 4 ++++ Marlin/example_configurations/adafruit/ST7565/Configuration.h | 4 ++++ Marlin/example_configurations/delta/biv2.5/Configuration.h | 4 ++++ Marlin/example_configurations/delta/generic/Configuration.h | 4 ++++ .../example_configurations/delta/kossel_mini/Configuration.h | 4 ++++ .../example_configurations/delta/kossel_pro/Configuration.h | 4 ++++ Marlin/example_configurations/delta/kossel_xl/Configuration.h | 4 ++++ Marlin/example_configurations/makibox/Configuration.h | 4 ++++ Marlin/example_configurations/tvrrug/Round2/Configuration.h | 4 ++++ 20 files changed, 80 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 84cf41631..13f855fc3 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -978,8 +978,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1104,7 +1106,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 47fea5818..84794bd98 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -977,8 +977,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// #define CARTESIO_UI // @@ -1103,7 +1105,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 02aecfdf4..c354e0104 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -961,8 +961,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1087,7 +1089,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index ed87eae12..b8e1c1de8 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -959,8 +959,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1085,7 +1087,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index a0a953c39..59a111d4f 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -970,8 +970,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1096,7 +1098,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 95e9e7f37..eb209befb 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -972,8 +972,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1098,7 +1100,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index e8a196e5a..16ae40da1 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -995,8 +995,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1121,7 +1123,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index fb099ba0f..a2492565c 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -978,8 +978,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1104,7 +1106,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 993637676..dfaa21767 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -973,8 +973,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1101,7 +1103,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index b9aaff7fc..2a64f7103 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -986,8 +986,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1112,7 +1114,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 49d7afc98..fc7805553 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -999,8 +999,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1125,7 +1127,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 8a54cbed2..7712caab3 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -970,8 +970,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1096,7 +1098,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 6b28ed222..8225450f7 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -978,8 +978,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1104,7 +1106,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 28dd41bcc..339aa8ffa 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1063,8 +1063,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1189,7 +1191,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 093d064ac..ff7920c0f 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1057,8 +1057,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1183,7 +1185,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 79a0dc36c..002157091 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1060,8 +1060,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1186,7 +1188,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 2aacb3b55..a4332ac89 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1060,8 +1060,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1186,7 +1188,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 7f363d70f..2a0d9f190 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1062,8 +1062,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1188,7 +1190,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 2731ae6a2..76bc85cca 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -981,8 +981,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1107,7 +1109,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 8874f019f..e79d722cc 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -972,8 +972,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define ULTIPANEL +// // Cartesio UI // http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// //#define CARTESIO_UI // @@ -1098,7 +1100,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define U8GLIB_SSD1306 +// // SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// //#define SAV_3DGLCD #if ENABLED(SAV_3DGLCD) //#define U8GLIB_SSD1306 From 14b661b9e5dbd838c687c01bbfcf4a8ca6932892 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Mon, 16 May 2016 03:33:07 +0900 Subject: [PATCH 136/580] Enclose #error string by double-quotes --- Marlin/SanityCheck.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index d80c2c296..8d2edc5d3 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -45,11 +45,11 @@ * will force a minimum config file revision, otherwise Marlin will not build. */ #if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION - #error You are using an old Configuration.h file, update it before building Marlin. + #error "You are using an old Configuration.h file, update it before building Marlin." #endif #if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION - #error You are using an old Configuration_adv.h file, update it before building Marlin. + #error "You are using an old Configuration_adv.h file, update it before building Marlin." #endif /** @@ -146,7 +146,7 @@ * Individual axis homing is useless for DELTAS */ #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA) - #error INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics. + #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." #endif /** @@ -371,7 +371,7 @@ * Advance Extrusion */ #if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE) - #error You can enable ADVANCE or LIN_ADVANCE, but not both. + #error "You can enable ADVANCE or LIN_ADVANCE, but not both." #endif /** @@ -545,15 +545,15 @@ */ #if EXTRUDERS > 3 #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE) - #error E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board. + #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." #endif #elif EXTRUDERS > 2 #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE) - #error E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board. + #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." #endif #elif EXTRUDERS > 1 #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE) - #error E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board. + #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." #endif #endif From fac58f0291b466e147ab271c454ef48ce5771c5c Mon Sep 17 00:00:00 2001 From: esenapaj Date: Thu, 16 Jun 2016 17:41:03 +0900 Subject: [PATCH 137/580] Cosmetic changes for language files --- Marlin/language_an.h | 1 - Marlin/language_bg.h | 1 - Marlin/language_ca.h | 1 - Marlin/language_cn.h | 1 - Marlin/language_cz.h | 1 - Marlin/language_da.h | 12 +++++------- Marlin/language_de.h | 1 - Marlin/language_es.h | 1 - Marlin/language_eu.h | 1 - Marlin/language_fi.h | 1 - Marlin/language_fr.h | 1 - Marlin/language_gl.h | 11 +++++------ Marlin/language_it.h | 1 - Marlin/language_kana.h | 1 - Marlin/language_kana_utf8.h | 1 - Marlin/language_nl.h | 1 - Marlin/language_pt-br.h | 1 - Marlin/language_pt-br_utf8.h | 1 - Marlin/language_pt.h | 1 - Marlin/language_pt_utf8.h | 1 - Marlin/language_ru.h | 1 - 21 files changed, 10 insertions(+), 32 deletions(-) diff --git a/Marlin/language_an.h b/Marlin/language_an.h index c2d49fb25..fbfb4dd0c 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -150,7 +150,6 @@ #define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" - #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index 1071642a9..c86e97b7d 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -151,7 +151,6 @@ #define MSG_ENDSTOP_ABORT "Стоп Кр.Изключватели" #define MSG_END_HOUR "часа" #define MSG_END_MINUTE "минути" - #define MSG_DELTA_CALIBRATE "Делта Калибровка" #define MSG_DELTA_CALIBRATE_X "Калибровка X" #define MSG_DELTA_CALIBRATE_Y "Калибровка Y" diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 95ded7488..8866c9e6f 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -151,7 +151,6 @@ #define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" - #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index 487f72356..40f1908a3 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -156,7 +156,6 @@ #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" - #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index 9c4afe8d5..bd8ae6d59 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -194,7 +194,6 @@ #define MSG_HEATING_COMPLETE "Zahrati hotovo." #define MSG_BED_HEATING "Zahrivani podl." #define MSG_BED_DONE "Podlozka hotova." - #define MSG_DELTA_CALIBRATE "Delta Kalibrace" #define MSG_DELTA_CALIBRATE_X "Kalibrovat X" #define MSG_DELTA_CALIBRATE_Y "Kalibrovat Y" diff --git a/Marlin/language_da.h b/Marlin/language_da.h index 6610edf70..42d8dfa50 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -83,7 +83,6 @@ #define MSG_MOVE_E2 "2" #define MSG_MOVE_E3 "3" #define MSG_MOVE_E4 "4" - #define MSG_MOVE_01MM "Flyt 0.1mm" #define MSG_MOVE_1MM "Flyt 1mm" #define MSG_MOVE_10MM "Flyt 10mm" @@ -191,11 +190,10 @@ #define MSG_HEATING_COMPLETE "Opvarmet" #define MSG_BED_HEATING "Opvarmer plade" #define MSG_BED_DONE "Plade opvarmet" - -#define MSG_DELTA_CALIBRATE "Delta Kalibrering" -#define MSG_DELTA_CALIBRATE_X "Kalibrer X" -#define MSG_DELTA_CALIBRATE_Y "Kalibrer Y" -#define MSG_DELTA_CALIBRATE_Z "Kalibrer Z" -#define MSG_DELTA_CALIBRATE_CENTER "Kalibrerings Center" +#define MSG_DELTA_CALIBRATE "Delta Kalibrering" +#define MSG_DELTA_CALIBRATE_X "Kalibrer X" +#define MSG_DELTA_CALIBRATE_Y "Kalibrer Y" +#define MSG_DELTA_CALIBRATE_Z "Kalibrer Z" +#define MSG_DELTA_CALIBRATE_CENTER "Kalibrerings Center" #endif // LANGUAGE_DA_H diff --git a/Marlin/language_de.h b/Marlin/language_de.h index 9f94ef321..d4d5c3c98 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -164,7 +164,6 @@ #define MSG_HEATING_COMPLETE "Aufgeheizt" #define MSG_BED_HEATING "Bett aufheizen" #define MSG_BED_DONE "Bett aufgeheizt" - #define MSG_DELTA_CALIBRATE "Delta kalibrieren" #define MSG_DELTA_CALIBRATE_X "Kalibriere X" #define MSG_DELTA_CALIBRATE_Y "Kalibriere Y" diff --git a/Marlin/language_es.h b/Marlin/language_es.h index e3e388515..cf1785c79 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -189,7 +189,6 @@ #define MSG_HEATING_COMPLETE "Calentamiento Completo" #define MSG_BED_HEATING "Calentando plataforma ..." #define MSG_BED_DONE "Plataforma Caliente" - #define MSG_DELTA_CALIBRATE "Calibracion Delta" #define MSG_DELTA_CALIBRATE_X "Calibrar X" #define MSG_DELTA_CALIBRATE_Y "Calibrar Y" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 51600f8b4..8af3aab55 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -150,7 +150,6 @@ #define MSG_ENDSTOP_ABORT "Endstop deuseztat" #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" - #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index a1915fd3b..87cbb1fc4 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -150,7 +150,6 @@ #define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" - #define MSG_DELTA_CALIBRATE "Delta Kalibrointi" #define MSG_DELTA_CALIBRATE_X "Kalibroi X" #define MSG_DELTA_CALIBRATE_Y "Kalibroi Y" diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 79b3d35c2..7536d53a8 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -164,7 +164,6 @@ #define MSG_HEATING_COMPLETE "Chauffe terminee" #define MSG_BED_HEATING "Plateau en chauffe..." #define MSG_BED_DONE "Chauffe plateau terminee" - #define MSG_DELTA_CALIBRATE "Calibration Delta" #define MSG_DELTA_CALIBRATE_X "Calibrer X" #define MSG_DELTA_CALIBRATE_Y "Calibrer Y" diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h index 5365f3c70..5363010e8 100644 --- a/Marlin/language_gl.h +++ b/Marlin/language_gl.h @@ -190,11 +190,10 @@ #define MSG_HEATING_COMPLETE "Xa esta quente" #define MSG_BED_HEATING "Quentando cama" #define MSG_BED_DONE "Cama esta quente" - -#define MSG_DELTA_CALIBRATE "Calibracion Delta" -#define MSG_DELTA_CALIBRATE_X "Calibrar X" -#define MSG_DELTA_CALIBRATE_Y "Calibrar Y" -#define MSG_DELTA_CALIBRATE_Z "Calibrar Z" -#define MSG_DELTA_CALIBRATE_CENTER "Calibrar Centro" +#define MSG_DELTA_CALIBRATE "Calibracion Delta" +#define MSG_DELTA_CALIBRATE_X "Calibrar X" +#define MSG_DELTA_CALIBRATE_Y "Calibrar Y" +#define MSG_DELTA_CALIBRATE_Z "Calibrar Z" +#define MSG_DELTA_CALIBRATE_CENTER "Calibrar Centro" #endif // LANGUAGE_GL_H diff --git a/Marlin/language_it.h b/Marlin/language_it.h index a0f78ad67..6e305e1b3 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -170,7 +170,6 @@ #define MSG_HEATING_COMPLETE "Risc. completato" #define MSG_BED_HEATING "Risc. Piatto.." #define MSG_BED_DONE "Piatto Pronto" - #define MSG_DELTA_CALIBRATE "Calibraz. Delta" #define MSG_DELTA_CALIBRATE_X "Calibra X" #define MSG_DELTA_CALIBRATE_Y "Calibra Y" diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index e3f41a733..80c422462 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -222,7 +222,6 @@ #define MSG_HEATING_COMPLETE "\xb6\xc8\xc2\xb6\xdd\xd8\xae\xb3" // "カネツカンリョウ" ("Heating done.") #define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xc1\xad\xb3" // "ベッド カネツチュウ" ("Bed Heating.") #define MSG_BED_DONE "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xb6\xdd\xd8\xae\xb3" // "ベッド カネツカンリョウ" ("Bed done.") - #define MSG_DELTA_CALIBRATE "\xc3\xde\xd9\xc0\x20\xba\xb3\xbe\xb2" // "デルタ コウセイ" ("Delta Calibration") #define MSG_DELTA_CALIBRATE_X "X\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Xジク コウセイ" ("Calibrate X") #define MSG_DELTA_CALIBRATE_Y "Y\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Yジク コウセイ" ("Calibrate Y") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index e38afa09c..1188c63d3 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -175,7 +175,6 @@ #define MSG_HEATING_COMPLETE "カネツカンリョウ" // "Heating done." #define MSG_BED_HEATING "ベッド カネツチュウ" // "Bed Heating." #define MSG_BED_DONE "ベッド カネツカンリョウ" // "Bed done." - #define MSG_DELTA_CALIBRATE "デルタ コウセイ" // "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Xジク コウセイ" // "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Yジク コウセイ" // "Calibrate Y" diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 670bd7c20..dcac94019 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -163,7 +163,6 @@ #define MSG_HEATING_COMPLETE "Voorverw. kompl." #define MSG_BED_HEATING "Bed voorverw." #define MSG_BED_DONE "Bed is voorverw." - #define MSG_DELTA_CALIBRATE "Delta Calibratie" #define MSG_DELTA_CALIBRATE_X "Kalibreer X" #define MSG_DELTA_CALIBRATE_Y "Kalibreer Y" diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index f75f0330a..3bc25d9af 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -163,7 +163,6 @@ #define MSG_HEATING_COMPLETE "Aquecida." #define MSG_BED_HEATING "Aquecendo base.." #define MSG_BED_DONE "Base aquecida." - #define MSG_DELTA_CALIBRATE "Calibrar Delta" #define MSG_DELTA_CALIBRATE_X "Calibrar X" #define MSG_DELTA_CALIBRATE_Y "Calibrar Y" diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index b1db4a779..a746ad6b9 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -163,7 +163,6 @@ #define MSG_HEATING_COMPLETE "Aquecida." #define MSG_BED_HEATING "Aquecendo base.." #define MSG_BED_DONE "Base aquecida." - #define MSG_DELTA_CALIBRATE "Calibrar Delta" #define MSG_DELTA_CALIBRATE_X "Calibrar X" #define MSG_DELTA_CALIBRATE_Y "Calibrar Y" diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index c15572923..e4bb049a8 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -171,7 +171,6 @@ #define MSG_HEATING_COMPLETE "Aquecida." #define MSG_BED_HEATING "Aquecendo base.." #define MSG_BED_DONE "Base aquecida." - #define MSG_DELTA_CALIBRATE "Calibracao Delta" #define MSG_DELTA_CALIBRATE_X "Calibrar X" #define MSG_DELTA_CALIBRATE_Y "Calibrar Y" diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h index ad1d881a3..02b46bd92 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -171,7 +171,6 @@ #define MSG_HEATING_COMPLETE "Aquecida." #define MSG_BED_HEATING "Aquecendo base.." #define MSG_BED_DONE "Base aquecida." - #define MSG_DELTA_CALIBRATE "Calibração Delta" #define MSG_DELTA_CALIBRATE_X "Calibrar X" #define MSG_DELTA_CALIBRATE_Y "Calibrar Y" diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index de96dac14..4d0f976c9 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -162,7 +162,6 @@ #define MSG_HEATING_COMPLETE "Нагрев выполнен" #define MSG_BED_HEATING "Нагреваю стол" #define MSG_BED_DONE "Стол разогрет" - #define MSG_DELTA_CALIBRATE "Калибровка Delta" #define MSG_DELTA_CALIBRATE_X "Калибровать X" #define MSG_DELTA_CALIBRATE_Y "Калибровать Y" From 385945ca316148e4e0c8f90d74520f402d42e816 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Tue, 21 Jun 2016 03:53:55 +0900 Subject: [PATCH 138/580] Cosmetic changes and small fix for thermistortables.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Adjust spacing ・Standardize comments position ・Remove ',' at the tail of array --- Marlin/thermistortables.h | 1861 +++++++++++++++++++------------------ 1 file changed, 931 insertions(+), 930 deletions(-) diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index 370ed342f..2e6decdd9 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -29,312 +29,312 @@ #define OVERSAMPLENR 16 #if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORHEATER_2 == 1) || (THERMISTORHEATER_3 == 1) || (THERMISTORBED == 1) //100k bed thermistor - const short temptable_1[][2] PROGMEM = { - {23 * OVERSAMPLENR, 300}, - {25 * OVERSAMPLENR, 295}, - {27 * OVERSAMPLENR, 290}, - {28 * OVERSAMPLENR, 285}, - {31 * OVERSAMPLENR, 280}, - {33 * OVERSAMPLENR, 275}, - {35 * OVERSAMPLENR, 270}, - {38 * OVERSAMPLENR, 265}, - {41 * OVERSAMPLENR, 260}, - {44 * OVERSAMPLENR, 255}, - {48 * OVERSAMPLENR, 250}, - {52 * OVERSAMPLENR, 245}, - {56 * OVERSAMPLENR, 240}, - {61 * OVERSAMPLENR, 235}, - {66 * OVERSAMPLENR, 230}, - {71 * OVERSAMPLENR, 225}, - {78 * OVERSAMPLENR, 220}, - {84 * OVERSAMPLENR, 215}, - {92 * OVERSAMPLENR, 210}, - {100 * OVERSAMPLENR, 205}, - {109 * OVERSAMPLENR, 200}, - {120 * OVERSAMPLENR, 195}, - {131 * OVERSAMPLENR, 190}, - {143 * OVERSAMPLENR, 185}, - {156 * OVERSAMPLENR, 180}, - {171 * OVERSAMPLENR, 175}, - {187 * OVERSAMPLENR, 170}, - {205 * OVERSAMPLENR, 165}, - {224 * OVERSAMPLENR, 160}, - {245 * OVERSAMPLENR, 155}, - {268 * OVERSAMPLENR, 150}, - {293 * OVERSAMPLENR, 145}, - {320 * OVERSAMPLENR, 140}, - {348 * OVERSAMPLENR, 135}, - {379 * OVERSAMPLENR, 130}, - {411 * OVERSAMPLENR, 125}, - {445 * OVERSAMPLENR, 120}, - {480 * OVERSAMPLENR, 115}, - {516 * OVERSAMPLENR, 110}, - {553 * OVERSAMPLENR, 105}, - {591 * OVERSAMPLENR, 100}, - {628 * OVERSAMPLENR, 95}, - {665 * OVERSAMPLENR, 90}, - {702 * OVERSAMPLENR, 85}, - {737 * OVERSAMPLENR, 80}, - {770 * OVERSAMPLENR, 75}, - {801 * OVERSAMPLENR, 70}, - {830 * OVERSAMPLENR, 65}, - {857 * OVERSAMPLENR, 60}, - {881 * OVERSAMPLENR, 55}, - {903 * OVERSAMPLENR, 50}, - {922 * OVERSAMPLENR, 45}, - {939 * OVERSAMPLENR, 40}, - {954 * OVERSAMPLENR, 35}, - {966 * OVERSAMPLENR, 30}, - {977 * OVERSAMPLENR, 25}, - {985 * OVERSAMPLENR, 20}, - {993 * OVERSAMPLENR, 15}, - {999 * OVERSAMPLENR, 10}, - {1004 * OVERSAMPLENR, 5}, - {1008 * OVERSAMPLENR, 0} //safety + { 23 * OVERSAMPLENR, 300 }, + { 25 * OVERSAMPLENR, 295 }, + { 27 * OVERSAMPLENR, 290 }, + { 28 * OVERSAMPLENR, 285 }, + { 31 * OVERSAMPLENR, 280 }, + { 33 * OVERSAMPLENR, 275 }, + { 35 * OVERSAMPLENR, 270 }, + { 38 * OVERSAMPLENR, 265 }, + { 41 * OVERSAMPLENR, 260 }, + { 44 * OVERSAMPLENR, 255 }, + { 48 * OVERSAMPLENR, 250 }, + { 52 * OVERSAMPLENR, 245 }, + { 56 * OVERSAMPLENR, 240 }, + { 61 * OVERSAMPLENR, 235 }, + { 66 * OVERSAMPLENR, 230 }, + { 71 * OVERSAMPLENR, 225 }, + { 78 * OVERSAMPLENR, 220 }, + { 84 * OVERSAMPLENR, 215 }, + { 92 * OVERSAMPLENR, 210 }, + { 100 * OVERSAMPLENR, 205 }, + { 109 * OVERSAMPLENR, 200 }, + { 120 * OVERSAMPLENR, 195 }, + { 131 * OVERSAMPLENR, 190 }, + { 143 * OVERSAMPLENR, 185 }, + { 156 * OVERSAMPLENR, 180 }, + { 171 * OVERSAMPLENR, 175 }, + { 187 * OVERSAMPLENR, 170 }, + { 205 * OVERSAMPLENR, 165 }, + { 224 * OVERSAMPLENR, 160 }, + { 245 * OVERSAMPLENR, 155 }, + { 268 * OVERSAMPLENR, 150 }, + { 293 * OVERSAMPLENR, 145 }, + { 320 * OVERSAMPLENR, 140 }, + { 348 * OVERSAMPLENR, 135 }, + { 379 * OVERSAMPLENR, 130 }, + { 411 * OVERSAMPLENR, 125 }, + { 445 * OVERSAMPLENR, 120 }, + { 480 * OVERSAMPLENR, 115 }, + { 516 * OVERSAMPLENR, 110 }, + { 553 * OVERSAMPLENR, 105 }, + { 591 * OVERSAMPLENR, 100 }, + { 628 * OVERSAMPLENR, 95 }, + { 665 * OVERSAMPLENR, 90 }, + { 702 * OVERSAMPLENR, 85 }, + { 737 * OVERSAMPLENR, 80 }, + { 770 * OVERSAMPLENR, 75 }, + { 801 * OVERSAMPLENR, 70 }, + { 830 * OVERSAMPLENR, 65 }, + { 857 * OVERSAMPLENR, 60 }, + { 881 * OVERSAMPLENR, 55 }, + { 903 * OVERSAMPLENR, 50 }, + { 922 * OVERSAMPLENR, 45 }, + { 939 * OVERSAMPLENR, 40 }, + { 954 * OVERSAMPLENR, 35 }, + { 966 * OVERSAMPLENR, 30 }, + { 977 * OVERSAMPLENR, 25 }, + { 985 * OVERSAMPLENR, 20 }, + { 993 * OVERSAMPLENR, 15 }, + { 999 * OVERSAMPLENR, 10 }, + { 1004 * OVERSAMPLENR, 5 }, + { 1008 * OVERSAMPLENR, 0 } // safety }; #endif + #if (THERMISTORHEATER_0 == 2) || (THERMISTORHEATER_1 == 2) || (THERMISTORHEATER_2 == 2) || (THERMISTORHEATER_3 == 2) || (THERMISTORBED == 2) //200k bed thermistor +// 200k ATC Semitec 204GT-2 +// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf +// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance const short temptable_2[][2] PROGMEM = { - //200k ATC Semitec 204GT-2 - //Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf - // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance - {1 * OVERSAMPLENR, 848}, - {30 * OVERSAMPLENR, 300}, //top rating 300C - {34 * OVERSAMPLENR, 290}, - {39 * OVERSAMPLENR, 280}, - {46 * OVERSAMPLENR, 270}, - {53 * OVERSAMPLENR, 260}, - {63 * OVERSAMPLENR, 250}, - {74 * OVERSAMPLENR, 240}, - {87 * OVERSAMPLENR, 230}, - {104 * OVERSAMPLENR, 220}, - {124 * OVERSAMPLENR, 210}, - {148 * OVERSAMPLENR, 200}, - {176 * OVERSAMPLENR, 190}, - {211 * OVERSAMPLENR, 180}, - {252 * OVERSAMPLENR, 170}, - {301 * OVERSAMPLENR, 160}, - {357 * OVERSAMPLENR, 150}, - {420 * OVERSAMPLENR, 140}, - {489 * OVERSAMPLENR, 130}, - {562 * OVERSAMPLENR, 120}, - {636 * OVERSAMPLENR, 110}, - {708 * OVERSAMPLENR, 100}, - {775 * OVERSAMPLENR, 90}, - {835 * OVERSAMPLENR, 80}, - {884 * OVERSAMPLENR, 70}, - {924 * OVERSAMPLENR, 60}, - {955 * OVERSAMPLENR, 50}, - {977 * OVERSAMPLENR, 40}, - {993 * OVERSAMPLENR, 30}, - {1004 * OVERSAMPLENR, 20}, - {1012 * OVERSAMPLENR, 10}, - {1016 * OVERSAMPLENR, 0}, + { 1 * OVERSAMPLENR, 848 }, + { 30 * OVERSAMPLENR, 300 }, // top rating 300C + { 34 * OVERSAMPLENR, 290 }, + { 39 * OVERSAMPLENR, 280 }, + { 46 * OVERSAMPLENR, 270 }, + { 53 * OVERSAMPLENR, 260 }, + { 63 * OVERSAMPLENR, 250 }, + { 74 * OVERSAMPLENR, 240 }, + { 87 * OVERSAMPLENR, 230 }, + { 104 * OVERSAMPLENR, 220 }, + { 124 * OVERSAMPLENR, 210 }, + { 148 * OVERSAMPLENR, 200 }, + { 176 * OVERSAMPLENR, 190 }, + { 211 * OVERSAMPLENR, 180 }, + { 252 * OVERSAMPLENR, 170 }, + { 301 * OVERSAMPLENR, 160 }, + { 357 * OVERSAMPLENR, 150 }, + { 420 * OVERSAMPLENR, 140 }, + { 489 * OVERSAMPLENR, 130 }, + { 562 * OVERSAMPLENR, 120 }, + { 636 * OVERSAMPLENR, 110 }, + { 708 * OVERSAMPLENR, 100 }, + { 775 * OVERSAMPLENR, 90 }, + { 835 * OVERSAMPLENR, 80 }, + { 884 * OVERSAMPLENR, 70 }, + { 924 * OVERSAMPLENR, 60 }, + { 955 * OVERSAMPLENR, 50 }, + { 977 * OVERSAMPLENR, 40 }, + { 993 * OVERSAMPLENR, 30 }, + { 1004 * OVERSAMPLENR, 20 }, + { 1012 * OVERSAMPLENR, 10 }, + { 1016 * OVERSAMPLENR, 0 } }; - #endif + #if (THERMISTORHEATER_0 == 3) || (THERMISTORHEATER_1 == 3) || (THERMISTORHEATER_2 == 3) || (THERMISTORHEATER_3 == 3) || (THERMISTORBED == 3) //mendel-parts const short temptable_3[][2] PROGMEM = { - {1 * OVERSAMPLENR, 864}, - {21 * OVERSAMPLENR, 300}, - {25 * OVERSAMPLENR, 290}, - {29 * OVERSAMPLENR, 280}, - {33 * OVERSAMPLENR, 270}, - {39 * OVERSAMPLENR, 260}, - {46 * OVERSAMPLENR, 250}, - {54 * OVERSAMPLENR, 240}, - {64 * OVERSAMPLENR, 230}, - {75 * OVERSAMPLENR, 220}, - {90 * OVERSAMPLENR, 210}, - {107 * OVERSAMPLENR, 200}, - {128 * OVERSAMPLENR, 190}, - {154 * OVERSAMPLENR, 180}, - {184 * OVERSAMPLENR, 170}, - {221 * OVERSAMPLENR, 160}, - {265 * OVERSAMPLENR, 150}, - {316 * OVERSAMPLENR, 140}, - {375 * OVERSAMPLENR, 130}, - {441 * OVERSAMPLENR, 120}, - {513 * OVERSAMPLENR, 110}, - {588 * OVERSAMPLENR, 100}, - {734 * OVERSAMPLENR, 80}, - {856 * OVERSAMPLENR, 60}, - {938 * OVERSAMPLENR, 40}, - {986 * OVERSAMPLENR, 20}, - {1008 * OVERSAMPLENR, 0}, - {1018 * OVERSAMPLENR, -20} + { 1 * OVERSAMPLENR, 864 }, + { 21 * OVERSAMPLENR, 300 }, + { 25 * OVERSAMPLENR, 290 }, + { 29 * OVERSAMPLENR, 280 }, + { 33 * OVERSAMPLENR, 270 }, + { 39 * OVERSAMPLENR, 260 }, + { 46 * OVERSAMPLENR, 250 }, + { 54 * OVERSAMPLENR, 240 }, + { 64 * OVERSAMPLENR, 230 }, + { 75 * OVERSAMPLENR, 220 }, + { 90 * OVERSAMPLENR, 210 }, + { 107 * OVERSAMPLENR, 200 }, + { 128 * OVERSAMPLENR, 190 }, + { 154 * OVERSAMPLENR, 180 }, + { 184 * OVERSAMPLENR, 170 }, + { 221 * OVERSAMPLENR, 160 }, + { 265 * OVERSAMPLENR, 150 }, + { 316 * OVERSAMPLENR, 140 }, + { 375 * OVERSAMPLENR, 130 }, + { 441 * OVERSAMPLENR, 120 }, + { 513 * OVERSAMPLENR, 110 }, + { 588 * OVERSAMPLENR, 100 }, + { 734 * OVERSAMPLENR, 80 }, + { 856 * OVERSAMPLENR, 60 }, + { 938 * OVERSAMPLENR, 40 }, + { 986 * OVERSAMPLENR, 20 }, + { 1008 * OVERSAMPLENR, 0 }, + { 1018 * OVERSAMPLENR, -20 } }; - #endif + #if (THERMISTORHEATER_0 == 4) || (THERMISTORHEATER_1 == 4) || (THERMISTORHEATER_2 == 4) || (THERMISTORHEATER_3 == 4) || (THERMISTORBED == 4) //10k thermistor const short temptable_4[][2] PROGMEM = { - {1 * OVERSAMPLENR, 430}, - {54 * OVERSAMPLENR, 137}, - {107 * OVERSAMPLENR, 107}, - {160 * OVERSAMPLENR, 91}, - {213 * OVERSAMPLENR, 80}, - {266 * OVERSAMPLENR, 71}, - {319 * OVERSAMPLENR, 64}, - {372 * OVERSAMPLENR, 57}, - {425 * OVERSAMPLENR, 51}, - {478 * OVERSAMPLENR, 46}, - {531 * OVERSAMPLENR, 41}, - {584 * OVERSAMPLENR, 35}, - {637 * OVERSAMPLENR, 30}, - {690 * OVERSAMPLENR, 25}, - {743 * OVERSAMPLENR, 20}, - {796 * OVERSAMPLENR, 14}, - {849 * OVERSAMPLENR, 7}, - {902 * OVERSAMPLENR, 0}, - {955 * OVERSAMPLENR, -11}, - {1008 * OVERSAMPLENR, -35} + { 1 * OVERSAMPLENR, 430 }, + { 54 * OVERSAMPLENR, 137 }, + { 107 * OVERSAMPLENR, 107 }, + { 160 * OVERSAMPLENR, 91 }, + { 213 * OVERSAMPLENR, 80 }, + { 266 * OVERSAMPLENR, 71 }, + { 319 * OVERSAMPLENR, 64 }, + { 372 * OVERSAMPLENR, 57 }, + { 425 * OVERSAMPLENR, 51 }, + { 478 * OVERSAMPLENR, 46 }, + { 531 * OVERSAMPLENR, 41 }, + { 584 * OVERSAMPLENR, 35 }, + { 637 * OVERSAMPLENR, 30 }, + { 690 * OVERSAMPLENR, 25 }, + { 743 * OVERSAMPLENR, 20 }, + { 796 * OVERSAMPLENR, 14 }, + { 849 * OVERSAMPLENR, 7 }, + { 902 * OVERSAMPLENR, 0 }, + { 955 * OVERSAMPLENR, -11 }, + { 1008 * OVERSAMPLENR, -35 } }; #endif #if (THERMISTORHEATER_0 == 5) || (THERMISTORHEATER_1 == 5) || (THERMISTORHEATER_2 == 5) || (THERMISTORHEATER_3 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2) +// ATC Semitec 104GT-2 (Used in ParCan) +// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf +// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance const short temptable_5[][2] PROGMEM = { - // ATC Semitec 104GT-2 (Used in ParCan) - // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf - // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance - {1 * OVERSAMPLENR, 713}, - {17 * OVERSAMPLENR, 300}, //top rating 300C - {20 * OVERSAMPLENR, 290}, - {23 * OVERSAMPLENR, 280}, - {27 * OVERSAMPLENR, 270}, - {31 * OVERSAMPLENR, 260}, - {37 * OVERSAMPLENR, 250}, - {43 * OVERSAMPLENR, 240}, - {51 * OVERSAMPLENR, 230}, - {61 * OVERSAMPLENR, 220}, - {73 * OVERSAMPLENR, 210}, - {87 * OVERSAMPLENR, 200}, - {106 * OVERSAMPLENR, 190}, - {128 * OVERSAMPLENR, 180}, - {155 * OVERSAMPLENR, 170}, - {189 * OVERSAMPLENR, 160}, - {230 * OVERSAMPLENR, 150}, - {278 * OVERSAMPLENR, 140}, - {336 * OVERSAMPLENR, 130}, - {402 * OVERSAMPLENR, 120}, - {476 * OVERSAMPLENR, 110}, - {554 * OVERSAMPLENR, 100}, - {635 * OVERSAMPLENR, 90}, - {713 * OVERSAMPLENR, 80}, - {784 * OVERSAMPLENR, 70}, - {846 * OVERSAMPLENR, 60}, - {897 * OVERSAMPLENR, 50}, - {937 * OVERSAMPLENR, 40}, - {966 * OVERSAMPLENR, 30}, - {986 * OVERSAMPLENR, 20}, - {1000 * OVERSAMPLENR, 10}, - {1010 * OVERSAMPLENR, 0} + { 1 * OVERSAMPLENR, 713 }, + { 17 * OVERSAMPLENR, 300 }, // top rating 300C + { 20 * OVERSAMPLENR, 290 }, + { 23 * OVERSAMPLENR, 280 }, + { 27 * OVERSAMPLENR, 270 }, + { 31 * OVERSAMPLENR, 260 }, + { 37 * OVERSAMPLENR, 250 }, + { 43 * OVERSAMPLENR, 240 }, + { 51 * OVERSAMPLENR, 230 }, + { 61 * OVERSAMPLENR, 220 }, + { 73 * OVERSAMPLENR, 210 }, + { 87 * OVERSAMPLENR, 200 }, + { 106 * OVERSAMPLENR, 190 }, + { 128 * OVERSAMPLENR, 180 }, + { 155 * OVERSAMPLENR, 170 }, + { 189 * OVERSAMPLENR, 160 }, + { 230 * OVERSAMPLENR, 150 }, + { 278 * OVERSAMPLENR, 140 }, + { 336 * OVERSAMPLENR, 130 }, + { 402 * OVERSAMPLENR, 120 }, + { 476 * OVERSAMPLENR, 110 }, + { 554 * OVERSAMPLENR, 100 }, + { 635 * OVERSAMPLENR, 90 }, + { 713 * OVERSAMPLENR, 80 }, + { 784 * OVERSAMPLENR, 70 }, + { 846 * OVERSAMPLENR, 60 }, + { 897 * OVERSAMPLENR, 50 }, + { 937 * OVERSAMPLENR, 40 }, + { 966 * OVERSAMPLENR, 30 }, + { 986 * OVERSAMPLENR, 20 }, + { 1000 * OVERSAMPLENR, 10 }, + { 1010 * OVERSAMPLENR, 0 } }; #endif #if (THERMISTORHEATER_0 == 6) || (THERMISTORHEATER_1 == 6) || (THERMISTORHEATER_2 == 6) || (THERMISTORHEATER_3 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor const short temptable_6[][2] PROGMEM = { - {1 * OVERSAMPLENR, 350}, - {28 * OVERSAMPLENR, 250}, //top rating 250C - {31 * OVERSAMPLENR, 245}, - {35 * OVERSAMPLENR, 240}, - {39 * OVERSAMPLENR, 235}, - {42 * OVERSAMPLENR, 230}, - {44 * OVERSAMPLENR, 225}, - {49 * OVERSAMPLENR, 220}, - {53 * OVERSAMPLENR, 215}, - {62 * OVERSAMPLENR, 210}, - {71 * OVERSAMPLENR, 205}, //fitted graphically - {78 * OVERSAMPLENR, 200}, //fitted graphically - {94 * OVERSAMPLENR, 190}, - {102 * OVERSAMPLENR, 185}, - {116 * OVERSAMPLENR, 170}, - {143 * OVERSAMPLENR, 160}, - {183 * OVERSAMPLENR, 150}, - {223 * OVERSAMPLENR, 140}, - {270 * OVERSAMPLENR, 130}, - {318 * OVERSAMPLENR, 120}, - {383 * OVERSAMPLENR, 110}, - {413 * OVERSAMPLENR, 105}, - {439 * OVERSAMPLENR, 100}, - {484 * OVERSAMPLENR, 95}, - {513 * OVERSAMPLENR, 90}, - {607 * OVERSAMPLENR, 80}, - {664 * OVERSAMPLENR, 70}, - {781 * OVERSAMPLENR, 60}, - {810 * OVERSAMPLENR, 55}, - {849 * OVERSAMPLENR, 50}, - {914 * OVERSAMPLENR, 45}, - {914 * OVERSAMPLENR, 40}, - {935 * OVERSAMPLENR, 35}, - {954 * OVERSAMPLENR, 30}, - {970 * OVERSAMPLENR, 25}, - {978 * OVERSAMPLENR, 22}, - {1008 * OVERSAMPLENR, 3}, - {1023 * OVERSAMPLENR, 0} //to allow internal 0 degrees C + { 1 * OVERSAMPLENR, 350 }, + { 28 * OVERSAMPLENR, 250 }, // top rating 250C + { 31 * OVERSAMPLENR, 245 }, + { 35 * OVERSAMPLENR, 240 }, + { 39 * OVERSAMPLENR, 235 }, + { 42 * OVERSAMPLENR, 230 }, + { 44 * OVERSAMPLENR, 225 }, + { 49 * OVERSAMPLENR, 220 }, + { 53 * OVERSAMPLENR, 215 }, + { 62 * OVERSAMPLENR, 210 }, + { 71 * OVERSAMPLENR, 205 }, // fitted graphically + { 78 * OVERSAMPLENR, 200 }, // fitted graphically + { 94 * OVERSAMPLENR, 190 }, + { 102 * OVERSAMPLENR, 185 }, + { 116 * OVERSAMPLENR, 170 }, + { 143 * OVERSAMPLENR, 160 }, + { 183 * OVERSAMPLENR, 150 }, + { 223 * OVERSAMPLENR, 140 }, + { 270 * OVERSAMPLENR, 130 }, + { 318 * OVERSAMPLENR, 120 }, + { 383 * OVERSAMPLENR, 110 }, + { 413 * OVERSAMPLENR, 105 }, + { 439 * OVERSAMPLENR, 100 }, + { 484 * OVERSAMPLENR, 95 }, + { 513 * OVERSAMPLENR, 90 }, + { 607 * OVERSAMPLENR, 80 }, + { 664 * OVERSAMPLENR, 70 }, + { 781 * OVERSAMPLENR, 60 }, + { 810 * OVERSAMPLENR, 55 }, + { 849 * OVERSAMPLENR, 50 }, + { 914 * OVERSAMPLENR, 45 }, + { 914 * OVERSAMPLENR, 40 }, + { 935 * OVERSAMPLENR, 35 }, + { 954 * OVERSAMPLENR, 30 }, + { 970 * OVERSAMPLENR, 25 }, + { 978 * OVERSAMPLENR, 22 }, + { 1008 * OVERSAMPLENR, 3 }, + { 1023 * OVERSAMPLENR, 0 } // to allow internal 0 degrees C }; #endif #if (THERMISTORHEATER_0 == 7) || (THERMISTORHEATER_1 == 7) || (THERMISTORHEATER_2 == 7) || (THERMISTORHEATER_3 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01 const short temptable_7[][2] PROGMEM = { - {1 * OVERSAMPLENR, 941}, - {19 * OVERSAMPLENR, 362}, - {37 * OVERSAMPLENR, 299}, //top rating 300C - {55 * OVERSAMPLENR, 266}, - {73 * OVERSAMPLENR, 245}, - {91 * OVERSAMPLENR, 229}, - {109 * OVERSAMPLENR, 216}, - {127 * OVERSAMPLENR, 206}, - {145 * OVERSAMPLENR, 197}, - {163 * OVERSAMPLENR, 190}, - {181 * OVERSAMPLENR, 183}, - {199 * OVERSAMPLENR, 177}, - {217 * OVERSAMPLENR, 171}, - {235 * OVERSAMPLENR, 166}, - {253 * OVERSAMPLENR, 162}, - {271 * OVERSAMPLENR, 157}, - {289 * OVERSAMPLENR, 153}, - {307 * OVERSAMPLENR, 149}, - {325 * OVERSAMPLENR, 146}, - {343 * OVERSAMPLENR, 142}, - {361 * OVERSAMPLENR, 139}, - {379 * OVERSAMPLENR, 135}, - {397 * OVERSAMPLENR, 132}, - {415 * OVERSAMPLENR, 129}, - {433 * OVERSAMPLENR, 126}, - {451 * OVERSAMPLENR, 123}, - {469 * OVERSAMPLENR, 121}, - {487 * OVERSAMPLENR, 118}, - {505 * OVERSAMPLENR, 115}, - {523 * OVERSAMPLENR, 112}, - {541 * OVERSAMPLENR, 110}, - {559 * OVERSAMPLENR, 107}, - {577 * OVERSAMPLENR, 105}, - {595 * OVERSAMPLENR, 102}, - {613 * OVERSAMPLENR, 99}, - {631 * OVERSAMPLENR, 97}, - {649 * OVERSAMPLENR, 94}, - {667 * OVERSAMPLENR, 92}, - {685 * OVERSAMPLENR, 89}, - {703 * OVERSAMPLENR, 86}, - {721 * OVERSAMPLENR, 84}, - {739 * OVERSAMPLENR, 81}, - {757 * OVERSAMPLENR, 78}, - {775 * OVERSAMPLENR, 75}, - {793 * OVERSAMPLENR, 72}, - {811 * OVERSAMPLENR, 69}, - {829 * OVERSAMPLENR, 66}, - {847 * OVERSAMPLENR, 62}, - {865 * OVERSAMPLENR, 59}, - {883 * OVERSAMPLENR, 55}, - {901 * OVERSAMPLENR, 51}, - {919 * OVERSAMPLENR, 46}, - {937 * OVERSAMPLENR, 41}, - {955 * OVERSAMPLENR, 35}, - {973 * OVERSAMPLENR, 27}, - {991 * OVERSAMPLENR, 17}, - {1009 * OVERSAMPLENR, 1}, - {1023 * OVERSAMPLENR, 0} //to allow internal 0 degrees C + { 1 * OVERSAMPLENR, 941 }, + { 19 * OVERSAMPLENR, 362 }, + { 37 * OVERSAMPLENR, 299 }, // top rating 300C + { 55 * OVERSAMPLENR, 266 }, + { 73 * OVERSAMPLENR, 245 }, + { 91 * OVERSAMPLENR, 229 }, + { 109 * OVERSAMPLENR, 216 }, + { 127 * OVERSAMPLENR, 206 }, + { 145 * OVERSAMPLENR, 197 }, + { 163 * OVERSAMPLENR, 190 }, + { 181 * OVERSAMPLENR, 183 }, + { 199 * OVERSAMPLENR, 177 }, + { 217 * OVERSAMPLENR, 171 }, + { 235 * OVERSAMPLENR, 166 }, + { 253 * OVERSAMPLENR, 162 }, + { 271 * OVERSAMPLENR, 157 }, + { 289 * OVERSAMPLENR, 153 }, + { 307 * OVERSAMPLENR, 149 }, + { 325 * OVERSAMPLENR, 146 }, + { 343 * OVERSAMPLENR, 142 }, + { 361 * OVERSAMPLENR, 139 }, + { 379 * OVERSAMPLENR, 135 }, + { 397 * OVERSAMPLENR, 132 }, + { 415 * OVERSAMPLENR, 129 }, + { 433 * OVERSAMPLENR, 126 }, + { 451 * OVERSAMPLENR, 123 }, + { 469 * OVERSAMPLENR, 121 }, + { 487 * OVERSAMPLENR, 118 }, + { 505 * OVERSAMPLENR, 115 }, + { 523 * OVERSAMPLENR, 112 }, + { 541 * OVERSAMPLENR, 110 }, + { 559 * OVERSAMPLENR, 107 }, + { 577 * OVERSAMPLENR, 105 }, + { 595 * OVERSAMPLENR, 102 }, + { 613 * OVERSAMPLENR, 99 }, + { 631 * OVERSAMPLENR, 97 }, + { 649 * OVERSAMPLENR, 94 }, + { 667 * OVERSAMPLENR, 92 }, + { 685 * OVERSAMPLENR, 89 }, + { 703 * OVERSAMPLENR, 86 }, + { 721 * OVERSAMPLENR, 84 }, + { 739 * OVERSAMPLENR, 81 }, + { 757 * OVERSAMPLENR, 78 }, + { 775 * OVERSAMPLENR, 75 }, + { 793 * OVERSAMPLENR, 72 }, + { 811 * OVERSAMPLENR, 69 }, + { 829 * OVERSAMPLENR, 66 }, + { 847 * OVERSAMPLENR, 62 }, + { 865 * OVERSAMPLENR, 59 }, + { 883 * OVERSAMPLENR, 55 }, + { 901 * OVERSAMPLENR, 51 }, + { 919 * OVERSAMPLENR, 46 }, + { 937 * OVERSAMPLENR, 41 }, + { 955 * OVERSAMPLENR, 35 }, + { 973 * OVERSAMPLENR, 27 }, + { 991 * OVERSAMPLENR, 17 }, + { 1009 * OVERSAMPLENR, 1 }, + { 1023 * OVERSAMPLENR, 0 } // to allow internal 0 degrees C }; #endif @@ -345,319 +345,319 @@ const short temptable_7[][2] PROGMEM = { // R1 = 0 Ohm // R2 = 4700 Ohm const short temptable_71[][2] PROGMEM = { - {35 * OVERSAMPLENR, 300}, - {51 * OVERSAMPLENR, 270}, - {54 * OVERSAMPLENR, 265}, - {58 * OVERSAMPLENR, 260}, - {59 * OVERSAMPLENR, 258}, - {61 * OVERSAMPLENR, 256}, - {63 * OVERSAMPLENR, 254}, - {64 * OVERSAMPLENR, 252}, - {66 * OVERSAMPLENR, 250}, - {67 * OVERSAMPLENR, 249}, - {68 * OVERSAMPLENR, 248}, - {69 * OVERSAMPLENR, 247}, - {70 * OVERSAMPLENR, 246}, - {71 * OVERSAMPLENR, 245}, - {72 * OVERSAMPLENR, 244}, - {73 * OVERSAMPLENR, 243}, - {74 * OVERSAMPLENR, 242}, - {75 * OVERSAMPLENR, 241}, - {76 * OVERSAMPLENR, 240}, - {77 * OVERSAMPLENR, 239}, - {78 * OVERSAMPLENR, 238}, - {79 * OVERSAMPLENR, 237}, - {80 * OVERSAMPLENR, 236}, - {81 * OVERSAMPLENR, 235}, - {82 * OVERSAMPLENR, 234}, - {84 * OVERSAMPLENR, 233}, - {85 * OVERSAMPLENR, 232}, - {86 * OVERSAMPLENR, 231}, - {87 * OVERSAMPLENR, 230}, - {89 * OVERSAMPLENR, 229}, - {90 * OVERSAMPLENR, 228}, - {91 * OVERSAMPLENR, 227}, - {92 * OVERSAMPLENR, 226}, - {94 * OVERSAMPLENR, 225}, - {95 * OVERSAMPLENR, 224}, - {97 * OVERSAMPLENR, 223}, - {98 * OVERSAMPLENR, 222}, - {99 * OVERSAMPLENR, 221}, - {101 * OVERSAMPLENR, 220}, - {102 * OVERSAMPLENR, 219}, - {104 * OVERSAMPLENR, 218}, - {106 * OVERSAMPLENR, 217}, - {107 * OVERSAMPLENR, 216}, - {109 * OVERSAMPLENR, 215}, - {110 * OVERSAMPLENR, 214}, - {112 * OVERSAMPLENR, 213}, - {114 * OVERSAMPLENR, 212}, - {115 * OVERSAMPLENR, 211}, - {117 * OVERSAMPLENR, 210}, - {119 * OVERSAMPLENR, 209}, - {121 * OVERSAMPLENR, 208}, - {123 * OVERSAMPLENR, 207}, - {125 * OVERSAMPLENR, 206}, - {126 * OVERSAMPLENR, 205}, - {128 * OVERSAMPLENR, 204}, - {130 * OVERSAMPLENR, 203}, - {132 * OVERSAMPLENR, 202}, - {134 * OVERSAMPLENR, 201}, - {136 * OVERSAMPLENR, 200}, - {139 * OVERSAMPLENR, 199}, - {141 * OVERSAMPLENR, 198}, - {143 * OVERSAMPLENR, 197}, - {145 * OVERSAMPLENR, 196}, - {147 * OVERSAMPLENR, 195}, - {150 * OVERSAMPLENR, 194}, - {152 * OVERSAMPLENR, 193}, - {154 * OVERSAMPLENR, 192}, - {157 * OVERSAMPLENR, 191}, - {159 * OVERSAMPLENR, 190}, - {162 * OVERSAMPLENR, 189}, - {164 * OVERSAMPLENR, 188}, - {167 * OVERSAMPLENR, 187}, - {170 * OVERSAMPLENR, 186}, - {172 * OVERSAMPLENR, 185}, - {175 * OVERSAMPLENR, 184}, - {178 * OVERSAMPLENR, 183}, - {181 * OVERSAMPLENR, 182}, - {184 * OVERSAMPLENR, 181}, - {187 * OVERSAMPLENR, 180}, - {190 * OVERSAMPLENR, 179}, - {193 * OVERSAMPLENR, 178}, - {196 * OVERSAMPLENR, 177}, - {199 * OVERSAMPLENR, 176}, - {202 * OVERSAMPLENR, 175}, - {205 * OVERSAMPLENR, 174}, - {208 * OVERSAMPLENR, 173}, - {212 * OVERSAMPLENR, 172}, - {215 * OVERSAMPLENR, 171}, - {219 * OVERSAMPLENR, 170}, - {237 * OVERSAMPLENR, 165}, - {256 * OVERSAMPLENR, 160}, - {300 * OVERSAMPLENR, 150}, - {351 * OVERSAMPLENR, 140}, - {470 * OVERSAMPLENR, 120}, - {504 * OVERSAMPLENR, 115}, - {538 * OVERSAMPLENR, 110}, - {552 * OVERSAMPLENR, 108}, - {566 * OVERSAMPLENR, 106}, - {580 * OVERSAMPLENR, 104}, - {594 * OVERSAMPLENR, 102}, - {608 * OVERSAMPLENR, 100}, - {622 * OVERSAMPLENR, 98}, - {636 * OVERSAMPLENR, 96}, - {650 * OVERSAMPLENR, 94}, - {664 * OVERSAMPLENR, 92}, - {678 * OVERSAMPLENR, 90}, - {712 * OVERSAMPLENR, 85}, - {745 * OVERSAMPLENR, 80}, - {758 * OVERSAMPLENR, 78}, - {770 * OVERSAMPLENR, 76}, - {783 * OVERSAMPLENR, 74}, - {795 * OVERSAMPLENR, 72}, - {806 * OVERSAMPLENR, 70}, - {818 * OVERSAMPLENR, 68}, - {829 * OVERSAMPLENR, 66}, - {840 * OVERSAMPLENR, 64}, - {850 * OVERSAMPLENR, 62}, - {860 * OVERSAMPLENR, 60}, - {870 * OVERSAMPLENR, 58}, - {879 * OVERSAMPLENR, 56}, - {888 * OVERSAMPLENR, 54}, - {897 * OVERSAMPLENR, 52}, - {905 * OVERSAMPLENR, 50}, - {924 * OVERSAMPLENR, 45}, - {940 * OVERSAMPLENR, 40}, - {955 * OVERSAMPLENR, 35}, - {967 * OVERSAMPLENR, 30}, - {970 * OVERSAMPLENR, 29}, - {972 * OVERSAMPLENR, 28}, - {974 * OVERSAMPLENR, 27}, - {976 * OVERSAMPLENR, 26}, - {978 * OVERSAMPLENR, 25}, - {980 * OVERSAMPLENR, 24}, - {982 * OVERSAMPLENR, 23}, - {984 * OVERSAMPLENR, 22}, - {985 * OVERSAMPLENR, 21}, - {987 * OVERSAMPLENR, 20}, - {995 * OVERSAMPLENR, 15}, - {1001 * OVERSAMPLENR, 10}, - {1006 * OVERSAMPLENR, 5}, - {1010 * OVERSAMPLENR, 0}, + { 35 * OVERSAMPLENR, 300 }, + { 51 * OVERSAMPLENR, 270 }, + { 54 * OVERSAMPLENR, 265 }, + { 58 * OVERSAMPLENR, 260 }, + { 59 * OVERSAMPLENR, 258 }, + { 61 * OVERSAMPLENR, 256 }, + { 63 * OVERSAMPLENR, 254 }, + { 64 * OVERSAMPLENR, 252 }, + { 66 * OVERSAMPLENR, 250 }, + { 67 * OVERSAMPLENR, 249 }, + { 68 * OVERSAMPLENR, 248 }, + { 69 * OVERSAMPLENR, 247 }, + { 70 * OVERSAMPLENR, 246 }, + { 71 * OVERSAMPLENR, 245 }, + { 72 * OVERSAMPLENR, 244 }, + { 73 * OVERSAMPLENR, 243 }, + { 74 * OVERSAMPLENR, 242 }, + { 75 * OVERSAMPLENR, 241 }, + { 76 * OVERSAMPLENR, 240 }, + { 77 * OVERSAMPLENR, 239 }, + { 78 * OVERSAMPLENR, 238 }, + { 79 * OVERSAMPLENR, 237 }, + { 80 * OVERSAMPLENR, 236 }, + { 81 * OVERSAMPLENR, 235 }, + { 82 * OVERSAMPLENR, 234 }, + { 84 * OVERSAMPLENR, 233 }, + { 85 * OVERSAMPLENR, 232 }, + { 86 * OVERSAMPLENR, 231 }, + { 87 * OVERSAMPLENR, 230 }, + { 89 * OVERSAMPLENR, 229 }, + { 90 * OVERSAMPLENR, 228 }, + { 91 * OVERSAMPLENR, 227 }, + { 92 * OVERSAMPLENR, 226 }, + { 94 * OVERSAMPLENR, 225 }, + { 95 * OVERSAMPLENR, 224 }, + { 97 * OVERSAMPLENR, 223 }, + { 98 * OVERSAMPLENR, 222 }, + { 99 * OVERSAMPLENR, 221 }, + { 101 * OVERSAMPLENR, 220 }, + { 102 * OVERSAMPLENR, 219 }, + { 104 * OVERSAMPLENR, 218 }, + { 106 * OVERSAMPLENR, 217 }, + { 107 * OVERSAMPLENR, 216 }, + { 109 * OVERSAMPLENR, 215 }, + { 110 * OVERSAMPLENR, 214 }, + { 112 * OVERSAMPLENR, 213 }, + { 114 * OVERSAMPLENR, 212 }, + { 115 * OVERSAMPLENR, 211 }, + { 117 * OVERSAMPLENR, 210 }, + { 119 * OVERSAMPLENR, 209 }, + { 121 * OVERSAMPLENR, 208 }, + { 123 * OVERSAMPLENR, 207 }, + { 125 * OVERSAMPLENR, 206 }, + { 126 * OVERSAMPLENR, 205 }, + { 128 * OVERSAMPLENR, 204 }, + { 130 * OVERSAMPLENR, 203 }, + { 132 * OVERSAMPLENR, 202 }, + { 134 * OVERSAMPLENR, 201 }, + { 136 * OVERSAMPLENR, 200 }, + { 139 * OVERSAMPLENR, 199 }, + { 141 * OVERSAMPLENR, 198 }, + { 143 * OVERSAMPLENR, 197 }, + { 145 * OVERSAMPLENR, 196 }, + { 147 * OVERSAMPLENR, 195 }, + { 150 * OVERSAMPLENR, 194 }, + { 152 * OVERSAMPLENR, 193 }, + { 154 * OVERSAMPLENR, 192 }, + { 157 * OVERSAMPLENR, 191 }, + { 159 * OVERSAMPLENR, 190 }, + { 162 * OVERSAMPLENR, 189 }, + { 164 * OVERSAMPLENR, 188 }, + { 167 * OVERSAMPLENR, 187 }, + { 170 * OVERSAMPLENR, 186 }, + { 172 * OVERSAMPLENR, 185 }, + { 175 * OVERSAMPLENR, 184 }, + { 178 * OVERSAMPLENR, 183 }, + { 181 * OVERSAMPLENR, 182 }, + { 184 * OVERSAMPLENR, 181 }, + { 187 * OVERSAMPLENR, 180 }, + { 190 * OVERSAMPLENR, 179 }, + { 193 * OVERSAMPLENR, 178 }, + { 196 * OVERSAMPLENR, 177 }, + { 199 * OVERSAMPLENR, 176 }, + { 202 * OVERSAMPLENR, 175 }, + { 205 * OVERSAMPLENR, 174 }, + { 208 * OVERSAMPLENR, 173 }, + { 212 * OVERSAMPLENR, 172 }, + { 215 * OVERSAMPLENR, 171 }, + { 219 * OVERSAMPLENR, 170 }, + { 237 * OVERSAMPLENR, 165 }, + { 256 * OVERSAMPLENR, 160 }, + { 300 * OVERSAMPLENR, 150 }, + { 351 * OVERSAMPLENR, 140 }, + { 470 * OVERSAMPLENR, 120 }, + { 504 * OVERSAMPLENR, 115 }, + { 538 * OVERSAMPLENR, 110 }, + { 552 * OVERSAMPLENR, 108 }, + { 566 * OVERSAMPLENR, 106 }, + { 580 * OVERSAMPLENR, 104 }, + { 594 * OVERSAMPLENR, 102 }, + { 608 * OVERSAMPLENR, 100 }, + { 622 * OVERSAMPLENR, 98 }, + { 636 * OVERSAMPLENR, 96 }, + { 650 * OVERSAMPLENR, 94 }, + { 664 * OVERSAMPLENR, 92 }, + { 678 * OVERSAMPLENR, 90 }, + { 712 * OVERSAMPLENR, 85 }, + { 745 * OVERSAMPLENR, 80 }, + { 758 * OVERSAMPLENR, 78 }, + { 770 * OVERSAMPLENR, 76 }, + { 783 * OVERSAMPLENR, 74 }, + { 795 * OVERSAMPLENR, 72 }, + { 806 * OVERSAMPLENR, 70 }, + { 818 * OVERSAMPLENR, 68 }, + { 829 * OVERSAMPLENR, 66 }, + { 840 * OVERSAMPLENR, 64 }, + { 850 * OVERSAMPLENR, 62 }, + { 860 * OVERSAMPLENR, 60 }, + { 870 * OVERSAMPLENR, 58 }, + { 879 * OVERSAMPLENR, 56 }, + { 888 * OVERSAMPLENR, 54 }, + { 897 * OVERSAMPLENR, 52 }, + { 905 * OVERSAMPLENR, 50 }, + { 924 * OVERSAMPLENR, 45 }, + { 940 * OVERSAMPLENR, 40 }, + { 955 * OVERSAMPLENR, 35 }, + { 967 * OVERSAMPLENR, 30 }, + { 970 * OVERSAMPLENR, 29 }, + { 972 * OVERSAMPLENR, 28 }, + { 974 * OVERSAMPLENR, 27 }, + { 976 * OVERSAMPLENR, 26 }, + { 978 * OVERSAMPLENR, 25 }, + { 980 * OVERSAMPLENR, 24 }, + { 982 * OVERSAMPLENR, 23 }, + { 984 * OVERSAMPLENR, 22 }, + { 985 * OVERSAMPLENR, 21 }, + { 987 * OVERSAMPLENR, 20 }, + { 995 * OVERSAMPLENR, 15 }, + { 1001 * OVERSAMPLENR, 10 }, + { 1006 * OVERSAMPLENR, 5 }, + { 1010 * OVERSAMPLENR, 0 } }; #endif #if (THERMISTORHEATER_0 == 8) || (THERMISTORHEATER_1 == 8) || (THERMISTORHEATER_2 == 8) || (THERMISTORHEATER_3 == 8) || (THERMISTORBED == 8) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) const short temptable_8[][2] PROGMEM = { - {1 * OVERSAMPLENR, 704}, - {54 * OVERSAMPLENR, 216}, - {107 * OVERSAMPLENR, 175}, - {160 * OVERSAMPLENR, 152}, - {213 * OVERSAMPLENR, 137}, - {266 * OVERSAMPLENR, 125}, - {319 * OVERSAMPLENR, 115}, - {372 * OVERSAMPLENR, 106}, - {425 * OVERSAMPLENR, 99}, - {478 * OVERSAMPLENR, 91}, - {531 * OVERSAMPLENR, 85}, - {584 * OVERSAMPLENR, 78}, - {637 * OVERSAMPLENR, 71}, - {690 * OVERSAMPLENR, 65}, - {743 * OVERSAMPLENR, 58}, - {796 * OVERSAMPLENR, 50}, - {849 * OVERSAMPLENR, 42}, - {902 * OVERSAMPLENR, 31}, - {955 * OVERSAMPLENR, 17}, - {1008 * OVERSAMPLENR, 0} + { 1 * OVERSAMPLENR, 704 }, + { 54 * OVERSAMPLENR, 216 }, + { 107 * OVERSAMPLENR, 175 }, + { 160 * OVERSAMPLENR, 152 }, + { 213 * OVERSAMPLENR, 137 }, + { 266 * OVERSAMPLENR, 125 }, + { 319 * OVERSAMPLENR, 115 }, + { 372 * OVERSAMPLENR, 106 }, + { 425 * OVERSAMPLENR, 99 }, + { 478 * OVERSAMPLENR, 91 }, + { 531 * OVERSAMPLENR, 85 }, + { 584 * OVERSAMPLENR, 78 }, + { 637 * OVERSAMPLENR, 71 }, + { 690 * OVERSAMPLENR, 65 }, + { 743 * OVERSAMPLENR, 58 }, + { 796 * OVERSAMPLENR, 50 }, + { 849 * OVERSAMPLENR, 42 }, + { 902 * OVERSAMPLENR, 31 }, + { 955 * OVERSAMPLENR, 17 }, + { 1008 * OVERSAMPLENR, 0 } }; #endif + #if (THERMISTORHEATER_0 == 9) || (THERMISTORHEATER_1 == 9) || (THERMISTORHEATER_2 == 9) || (THERMISTORHEATER_3 == 9) || (THERMISTORBED == 9) // 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) const short temptable_9[][2] PROGMEM = { - {1 * OVERSAMPLENR, 936}, - {36 * OVERSAMPLENR, 300}, - {71 * OVERSAMPLENR, 246}, - {106 * OVERSAMPLENR, 218}, - {141 * OVERSAMPLENR, 199}, - {176 * OVERSAMPLENR, 185}, - {211 * OVERSAMPLENR, 173}, - {246 * OVERSAMPLENR, 163}, - {281 * OVERSAMPLENR, 155}, - {316 * OVERSAMPLENR, 147}, - {351 * OVERSAMPLENR, 140}, - {386 * OVERSAMPLENR, 134}, - {421 * OVERSAMPLENR, 128}, - {456 * OVERSAMPLENR, 122}, - {491 * OVERSAMPLENR, 117}, - {526 * OVERSAMPLENR, 112}, - {561 * OVERSAMPLENR, 107}, - {596 * OVERSAMPLENR, 102}, - {631 * OVERSAMPLENR, 97}, - {666 * OVERSAMPLENR, 92}, - {701 * OVERSAMPLENR, 87}, - {736 * OVERSAMPLENR, 81}, - {771 * OVERSAMPLENR, 76}, - {806 * OVERSAMPLENR, 70}, - {841 * OVERSAMPLENR, 63}, - {876 * OVERSAMPLENR, 56}, - {911 * OVERSAMPLENR, 48}, - {946 * OVERSAMPLENR, 38}, - {981 * OVERSAMPLENR, 23}, - {1005 * OVERSAMPLENR, 5}, - {1016 * OVERSAMPLENR, 0} + { 1 * OVERSAMPLENR, 936 }, + { 36 * OVERSAMPLENR, 300 }, + { 71 * OVERSAMPLENR, 246 }, + { 106 * OVERSAMPLENR, 218 }, + { 141 * OVERSAMPLENR, 199 }, + { 176 * OVERSAMPLENR, 185 }, + { 211 * OVERSAMPLENR, 173 }, + { 246 * OVERSAMPLENR, 163 }, + { 281 * OVERSAMPLENR, 155 }, + { 316 * OVERSAMPLENR, 147 }, + { 351 * OVERSAMPLENR, 140 }, + { 386 * OVERSAMPLENR, 134 }, + { 421 * OVERSAMPLENR, 128 }, + { 456 * OVERSAMPLENR, 122 }, + { 491 * OVERSAMPLENR, 117 }, + { 526 * OVERSAMPLENR, 112 }, + { 561 * OVERSAMPLENR, 107 }, + { 596 * OVERSAMPLENR, 102 }, + { 631 * OVERSAMPLENR, 97 }, + { 666 * OVERSAMPLENR, 92 }, + { 701 * OVERSAMPLENR, 87 }, + { 736 * OVERSAMPLENR, 81 }, + { 771 * OVERSAMPLENR, 76 }, + { 806 * OVERSAMPLENR, 70 }, + { 841 * OVERSAMPLENR, 63 }, + { 876 * OVERSAMPLENR, 56 }, + { 911 * OVERSAMPLENR, 48 }, + { 946 * OVERSAMPLENR, 38 }, + { 981 * OVERSAMPLENR, 23 }, + { 1005 * OVERSAMPLENR, 5 }, + { 1016 * OVERSAMPLENR, 0 } }; #endif + #if (THERMISTORHEATER_0 == 10) || (THERMISTORHEATER_1 == 10) || (THERMISTORHEATER_2 == 10) || (THERMISTORHEATER_3 == 10) || (THERMISTORBED == 10) // 100k RS thermistor 198-961 (4.7k pullup) const short temptable_10[][2] PROGMEM = { - {1 * OVERSAMPLENR, 929}, - {36 * OVERSAMPLENR, 299}, - {71 * OVERSAMPLENR, 246}, - {106 * OVERSAMPLENR, 217}, - {141 * OVERSAMPLENR, 198}, - {176 * OVERSAMPLENR, 184}, - {211 * OVERSAMPLENR, 173}, - {246 * OVERSAMPLENR, 163}, - {281 * OVERSAMPLENR, 154}, - {316 * OVERSAMPLENR, 147}, - {351 * OVERSAMPLENR, 140}, - {386 * OVERSAMPLENR, 134}, - {421 * OVERSAMPLENR, 128}, - {456 * OVERSAMPLENR, 122}, - {491 * OVERSAMPLENR, 117}, - {526 * OVERSAMPLENR, 112}, - {561 * OVERSAMPLENR, 107}, - {596 * OVERSAMPLENR, 102}, - {631 * OVERSAMPLENR, 97}, - {666 * OVERSAMPLENR, 91}, - {701 * OVERSAMPLENR, 86}, - {736 * OVERSAMPLENR, 81}, - {771 * OVERSAMPLENR, 76}, - {806 * OVERSAMPLENR, 70}, - {841 * OVERSAMPLENR, 63}, - {876 * OVERSAMPLENR, 56}, - {911 * OVERSAMPLENR, 48}, - {946 * OVERSAMPLENR, 38}, - {981 * OVERSAMPLENR, 23}, - {1005 * OVERSAMPLENR, 5}, - {1016 * OVERSAMPLENR, 0} + { 1 * OVERSAMPLENR, 929 }, + { 36 * OVERSAMPLENR, 299 }, + { 71 * OVERSAMPLENR, 246 }, + { 106 * OVERSAMPLENR, 217 }, + { 141 * OVERSAMPLENR, 198 }, + { 176 * OVERSAMPLENR, 184 }, + { 211 * OVERSAMPLENR, 173 }, + { 246 * OVERSAMPLENR, 163 }, + { 281 * OVERSAMPLENR, 154 }, + { 316 * OVERSAMPLENR, 147 }, + { 351 * OVERSAMPLENR, 140 }, + { 386 * OVERSAMPLENR, 134 }, + { 421 * OVERSAMPLENR, 128 }, + { 456 * OVERSAMPLENR, 122 }, + { 491 * OVERSAMPLENR, 117 }, + { 526 * OVERSAMPLENR, 112 }, + { 561 * OVERSAMPLENR, 107 }, + { 596 * OVERSAMPLENR, 102 }, + { 631 * OVERSAMPLENR, 97 }, + { 666 * OVERSAMPLENR, 91 }, + { 701 * OVERSAMPLENR, 86 }, + { 736 * OVERSAMPLENR, 81 }, + { 771 * OVERSAMPLENR, 76 }, + { 806 * OVERSAMPLENR, 70 }, + { 841 * OVERSAMPLENR, 63 }, + { 876 * OVERSAMPLENR, 56 }, + { 911 * OVERSAMPLENR, 48 }, + { 946 * OVERSAMPLENR, 38 }, + { 981 * OVERSAMPLENR, 23 }, + { 1005 * OVERSAMPLENR, 5 }, + { 1016 * OVERSAMPLENR, 0 } }; #endif #if (THERMISTORHEATER_0 == 11) || (THERMISTORHEATER_1 == 11) || (THERMISTORHEATER_2 == 11) || (THERMISTORHEATER_3 == 11) || (THERMISTORBED == 11) // QU-BD silicone bed QWG-104F-3950 thermistor - const short temptable_11[][2] PROGMEM = { - {1 * OVERSAMPLENR, 938}, - {31 * OVERSAMPLENR, 314}, - {41 * OVERSAMPLENR, 290}, - {51 * OVERSAMPLENR, 272}, - {61 * OVERSAMPLENR, 258}, - {71 * OVERSAMPLENR, 247}, - {81 * OVERSAMPLENR, 237}, - {91 * OVERSAMPLENR, 229}, - {101 * OVERSAMPLENR, 221}, - {111 * OVERSAMPLENR, 215}, - {121 * OVERSAMPLENR, 209}, - {131 * OVERSAMPLENR, 204}, - {141 * OVERSAMPLENR, 199}, - {151 * OVERSAMPLENR, 195}, - {161 * OVERSAMPLENR, 190}, - {171 * OVERSAMPLENR, 187}, - {181 * OVERSAMPLENR, 183}, - {191 * OVERSAMPLENR, 179}, - {201 * OVERSAMPLENR, 176}, - {221 * OVERSAMPLENR, 170}, - {241 * OVERSAMPLENR, 165}, - {261 * OVERSAMPLENR, 160}, - {281 * OVERSAMPLENR, 155}, - {301 * OVERSAMPLENR, 150}, - {331 * OVERSAMPLENR, 144}, - {361 * OVERSAMPLENR, 139}, - {391 * OVERSAMPLENR, 133}, - {421 * OVERSAMPLENR, 128}, - {451 * OVERSAMPLENR, 123}, - {491 * OVERSAMPLENR, 117}, - {531 * OVERSAMPLENR, 111}, - {571 * OVERSAMPLENR, 105}, - {611 * OVERSAMPLENR, 100}, - {641 * OVERSAMPLENR, 95}, - {681 * OVERSAMPLENR, 90}, - {711 * OVERSAMPLENR, 85}, - {751 * OVERSAMPLENR, 79}, - {791 * OVERSAMPLENR, 72}, - {811 * OVERSAMPLENR, 69}, - {831 * OVERSAMPLENR, 65}, - {871 * OVERSAMPLENR, 57}, - {881 * OVERSAMPLENR, 55}, - {901 * OVERSAMPLENR, 51}, - {921 * OVERSAMPLENR, 45}, - {941 * OVERSAMPLENR, 39}, - {971 * OVERSAMPLENR, 28}, - {981 * OVERSAMPLENR, 23}, - {991 * OVERSAMPLENR, 17}, - {1001 * OVERSAMPLENR, 9}, - {1021 * OVERSAMPLENR, -27} + { 1 * OVERSAMPLENR, 938 }, + { 31 * OVERSAMPLENR, 314 }, + { 41 * OVERSAMPLENR, 290 }, + { 51 * OVERSAMPLENR, 272 }, + { 61 * OVERSAMPLENR, 258 }, + { 71 * OVERSAMPLENR, 247 }, + { 81 * OVERSAMPLENR, 237 }, + { 91 * OVERSAMPLENR, 229 }, + { 101 * OVERSAMPLENR, 221 }, + { 111 * OVERSAMPLENR, 215 }, + { 121 * OVERSAMPLENR, 209 }, + { 131 * OVERSAMPLENR, 204 }, + { 141 * OVERSAMPLENR, 199 }, + { 151 * OVERSAMPLENR, 195 }, + { 161 * OVERSAMPLENR, 190 }, + { 171 * OVERSAMPLENR, 187 }, + { 181 * OVERSAMPLENR, 183 }, + { 191 * OVERSAMPLENR, 179 }, + { 201 * OVERSAMPLENR, 176 }, + { 221 * OVERSAMPLENR, 170 }, + { 241 * OVERSAMPLENR, 165 }, + { 261 * OVERSAMPLENR, 160 }, + { 281 * OVERSAMPLENR, 155 }, + { 301 * OVERSAMPLENR, 150 }, + { 331 * OVERSAMPLENR, 144 }, + { 361 * OVERSAMPLENR, 139 }, + { 391 * OVERSAMPLENR, 133 }, + { 421 * OVERSAMPLENR, 128 }, + { 451 * OVERSAMPLENR, 123 }, + { 491 * OVERSAMPLENR, 117 }, + { 531 * OVERSAMPLENR, 111 }, + { 571 * OVERSAMPLENR, 105 }, + { 611 * OVERSAMPLENR, 100 }, + { 641 * OVERSAMPLENR, 95 }, + { 681 * OVERSAMPLENR, 90 }, + { 711 * OVERSAMPLENR, 85 }, + { 751 * OVERSAMPLENR, 79 }, + { 791 * OVERSAMPLENR, 72 }, + { 811 * OVERSAMPLENR, 69 }, + { 831 * OVERSAMPLENR, 65 }, + { 871 * OVERSAMPLENR, 57 }, + { 881 * OVERSAMPLENR, 55 }, + { 901 * OVERSAMPLENR, 51 }, + { 921 * OVERSAMPLENR, 45 }, + { 941 * OVERSAMPLENR, 39 }, + { 971 * OVERSAMPLENR, 28 }, + { 981 * OVERSAMPLENR, 23 }, + { 991 * OVERSAMPLENR, 17 }, + { 1001 * OVERSAMPLENR, 9 }, + { 1021 * OVERSAMPLENR, -27 } }; #endif #if (THERMISTORHEATER_0 == 13) || (THERMISTORHEATER_1 == 13) || (THERMISTORHEATER_2 == 13) || (THERMISTORHEATER_3 == 13) || (THERMISTORBED == 13) // Hisens thermistor B25/50 =3950 +/-1% - const short temptable_13[][2] PROGMEM = { - { 20.04 * OVERSAMPLENR, 300 }, - { 23.19 * OVERSAMPLENR, 290 }, - { 26.71 * OVERSAMPLENR, 280 }, - { 31.23 * OVERSAMPLENR, 270 }, - { 36.52 * OVERSAMPLENR, 260 }, - { 42.75 * OVERSAMPLENR, 250 }, - { 50.68 * OVERSAMPLENR, 240 }, - { 60.22 * OVERSAMPLENR, 230 }, - { 72.03 * OVERSAMPLENR, 220 }, - { 86.84 * OVERSAMPLENR, 210 }, + { 20.04 * OVERSAMPLENR, 300 }, + { 23.19 * OVERSAMPLENR, 290 }, + { 26.71 * OVERSAMPLENR, 280 }, + { 31.23 * OVERSAMPLENR, 270 }, + { 36.52 * OVERSAMPLENR, 260 }, + { 42.75 * OVERSAMPLENR, 250 }, + { 50.68 * OVERSAMPLENR, 240 }, + { 60.22 * OVERSAMPLENR, 230 }, + { 72.03 * OVERSAMPLENR, 220 }, + { 86.84 * OVERSAMPLENR, 210 }, { 102.79 * OVERSAMPLENR, 200 }, { 124.46 * OVERSAMPLENR, 190 }, { 151.02 * OVERSAMPLENR, 180 }, @@ -666,18 +666,18 @@ const short temptable_13[][2] PROGMEM = { { 316.96 * OVERSAMPLENR, 140 }, { 447.17 * OVERSAMPLENR, 120 }, { 590.61 * OVERSAMPLENR, 100 }, - { 737.31 * OVERSAMPLENR, 80 }, - { 857.77 * OVERSAMPLENR, 60 }, - { 939.52 * OVERSAMPLENR, 40 }, - { 986.03 * OVERSAMPLENR, 20 }, - { 1008.7 * OVERSAMPLENR, 0} + { 737.31 * OVERSAMPLENR, 80 }, + { 857.77 * OVERSAMPLENR, 60 }, + { 939.52 * OVERSAMPLENR, 40 }, + { 986.03 * OVERSAMPLENR, 20 }, + { 1008.7 * OVERSAMPLENR, 0 } }; #endif #if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics -/* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature. -This does not match the normal thermistor behaviour so we need to set the following defines */ +// The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature. +// This does not match the normal thermistor behaviour so we need to set the following defines #if (THERMISTORHEATER_0 == 20) #define HEATER_0_RAW_HI_TEMP 16383 #define HEATER_0_RAW_LO_TEMP 0 @@ -699,55 +699,55 @@ This does not match the normal thermistor behaviour so we need to set the follow #define HEATER_BED_RAW_LO_TEMP 0 #endif const short temptable_20[][2] PROGMEM = { - { 0 * OVERSAMPLENR , 0 }, - { 227 * OVERSAMPLENR , 1 }, - { 236 * OVERSAMPLENR , 10 }, - { 245 * OVERSAMPLENR , 20 }, - { 253 * OVERSAMPLENR , 30 }, - { 262 * OVERSAMPLENR , 40 }, - { 270 * OVERSAMPLENR , 50 }, - { 279 * OVERSAMPLENR , 60 }, - { 287 * OVERSAMPLENR , 70 }, - { 295 * OVERSAMPLENR , 80 }, - { 304 * OVERSAMPLENR , 90 }, - { 312 * OVERSAMPLENR , 100 }, - { 320 * OVERSAMPLENR , 110 }, - { 329 * OVERSAMPLENR , 120 }, - { 337 * OVERSAMPLENR , 130 }, - { 345 * OVERSAMPLENR , 140 }, - { 353 * OVERSAMPLENR , 150 }, - { 361 * OVERSAMPLENR , 160 }, - { 369 * OVERSAMPLENR , 170 }, - { 377 * OVERSAMPLENR , 180 }, - { 385 * OVERSAMPLENR , 190 }, - { 393 * OVERSAMPLENR , 200 }, - { 401 * OVERSAMPLENR , 210 }, - { 409 * OVERSAMPLENR , 220 }, - { 417 * OVERSAMPLENR , 230 }, - { 424 * OVERSAMPLENR , 240 }, - { 432 * OVERSAMPLENR , 250 }, - { 440 * OVERSAMPLENR , 260 }, - { 447 * OVERSAMPLENR , 270 }, - { 455 * OVERSAMPLENR , 280 }, - { 463 * OVERSAMPLENR , 290 }, - { 470 * OVERSAMPLENR , 300 }, - { 478 * OVERSAMPLENR , 310 }, - { 485 * OVERSAMPLENR , 320 }, - { 493 * OVERSAMPLENR , 330 }, - { 500 * OVERSAMPLENR , 340 }, - { 507 * OVERSAMPLENR , 350 }, - { 515 * OVERSAMPLENR , 360 }, - { 522 * OVERSAMPLENR , 370 }, - { 529 * OVERSAMPLENR , 380 }, - { 537 * OVERSAMPLENR , 390 }, - { 544 * OVERSAMPLENR , 400 }, - { 614 * OVERSAMPLENR , 500 }, - { 681 * OVERSAMPLENR , 600 }, - { 744 * OVERSAMPLENR , 700 }, - { 805 * OVERSAMPLENR , 800 }, - { 862 * OVERSAMPLENR , 900 }, - { 917 * OVERSAMPLENR , 1000 }, - { 968 * OVERSAMPLENR , 1100 } + { 0 * OVERSAMPLENR, 0 }, + { 227 * OVERSAMPLENR, 1 }, + { 236 * OVERSAMPLENR, 10 }, + { 245 * OVERSAMPLENR, 20 }, + { 253 * OVERSAMPLENR, 30 }, + { 262 * OVERSAMPLENR, 40 }, + { 270 * OVERSAMPLENR, 50 }, + { 279 * OVERSAMPLENR, 60 }, + { 287 * OVERSAMPLENR, 70 }, + { 295 * OVERSAMPLENR, 80 }, + { 304 * OVERSAMPLENR, 90 }, + { 312 * OVERSAMPLENR, 100 }, + { 320 * OVERSAMPLENR, 110 }, + { 329 * OVERSAMPLENR, 120 }, + { 337 * OVERSAMPLENR, 130 }, + { 345 * OVERSAMPLENR, 140 }, + { 353 * OVERSAMPLENR, 150 }, + { 361 * OVERSAMPLENR, 160 }, + { 369 * OVERSAMPLENR, 170 }, + { 377 * OVERSAMPLENR, 180 }, + { 385 * OVERSAMPLENR, 190 }, + { 393 * OVERSAMPLENR, 200 }, + { 401 * OVERSAMPLENR, 210 }, + { 409 * OVERSAMPLENR, 220 }, + { 417 * OVERSAMPLENR, 230 }, + { 424 * OVERSAMPLENR, 240 }, + { 432 * OVERSAMPLENR, 250 }, + { 440 * OVERSAMPLENR, 260 }, + { 447 * OVERSAMPLENR, 270 }, + { 455 * OVERSAMPLENR, 280 }, + { 463 * OVERSAMPLENR, 290 }, + { 470 * OVERSAMPLENR, 300 }, + { 478 * OVERSAMPLENR, 310 }, + { 485 * OVERSAMPLENR, 320 }, + { 493 * OVERSAMPLENR, 330 }, + { 500 * OVERSAMPLENR, 340 }, + { 507 * OVERSAMPLENR, 350 }, + { 515 * OVERSAMPLENR, 360 }, + { 522 * OVERSAMPLENR, 370 }, + { 529 * OVERSAMPLENR, 380 }, + { 537 * OVERSAMPLENR, 390 }, + { 544 * OVERSAMPLENR, 400 }, + { 614 * OVERSAMPLENR, 500 }, + { 681 * OVERSAMPLENR, 600 }, + { 744 * OVERSAMPLENR, 700 }, + { 805 * OVERSAMPLENR, 800 }, + { 862 * OVERSAMPLENR, 900 }, + { 917 * OVERSAMPLENR, 1000 }, + { 968 * OVERSAMPLENR, 1100 } }; #endif @@ -757,59 +757,59 @@ const short temptable_20[][2] PROGMEM = { // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance // Advantage: Twice the resolution and better linearity from 150C to 200C const short temptable_51[][2] PROGMEM = { - {1 * OVERSAMPLENR, 350}, - {190 * OVERSAMPLENR, 250}, //top rating 250C - {203 * OVERSAMPLENR, 245}, - {217 * OVERSAMPLENR, 240}, - {232 * OVERSAMPLENR, 235}, - {248 * OVERSAMPLENR, 230}, - {265 * OVERSAMPLENR, 225}, - {283 * OVERSAMPLENR, 220}, - {302 * OVERSAMPLENR, 215}, - {322 * OVERSAMPLENR, 210}, - {344 * OVERSAMPLENR, 205}, - {366 * OVERSAMPLENR, 200}, - {390 * OVERSAMPLENR, 195}, - {415 * OVERSAMPLENR, 190}, - {440 * OVERSAMPLENR, 185}, - {467 * OVERSAMPLENR, 180}, - {494 * OVERSAMPLENR, 175}, - {522 * OVERSAMPLENR, 170}, - {551 * OVERSAMPLENR, 165}, - {580 * OVERSAMPLENR, 160}, - {609 * OVERSAMPLENR, 155}, - {638 * OVERSAMPLENR, 150}, - {666 * OVERSAMPLENR, 145}, - {695 * OVERSAMPLENR, 140}, - {722 * OVERSAMPLENR, 135}, - {749 * OVERSAMPLENR, 130}, - {775 * OVERSAMPLENR, 125}, - {800 * OVERSAMPLENR, 120}, - {823 * OVERSAMPLENR, 115}, - {845 * OVERSAMPLENR, 110}, - {865 * OVERSAMPLENR, 105}, - {884 * OVERSAMPLENR, 100}, - {901 * OVERSAMPLENR, 95}, - {917 * OVERSAMPLENR, 90}, - {932 * OVERSAMPLENR, 85}, - {944 * OVERSAMPLENR, 80}, - {956 * OVERSAMPLENR, 75}, - {966 * OVERSAMPLENR, 70}, - {975 * OVERSAMPLENR, 65}, - {982 * OVERSAMPLENR, 60}, - {989 * OVERSAMPLENR, 55}, - {995 * OVERSAMPLENR, 50}, - {1000 * OVERSAMPLENR, 45}, - {1004 * OVERSAMPLENR, 40}, - {1007 * OVERSAMPLENR, 35}, - {1010 * OVERSAMPLENR, 30}, - {1013 * OVERSAMPLENR, 25}, - {1015 * OVERSAMPLENR, 20}, - {1017 * OVERSAMPLENR, 15}, - {1018 * OVERSAMPLENR, 10}, - {1019 * OVERSAMPLENR, 5}, - {1020 * OVERSAMPLENR, 0}, - {1021 * OVERSAMPLENR, -5} + { 1 * OVERSAMPLENR, 350 }, + { 190 * OVERSAMPLENR, 250 }, // top rating 250C + { 203 * OVERSAMPLENR, 245 }, + { 217 * OVERSAMPLENR, 240 }, + { 232 * OVERSAMPLENR, 235 }, + { 248 * OVERSAMPLENR, 230 }, + { 265 * OVERSAMPLENR, 225 }, + { 283 * OVERSAMPLENR, 220 }, + { 302 * OVERSAMPLENR, 215 }, + { 322 * OVERSAMPLENR, 210 }, + { 344 * OVERSAMPLENR, 205 }, + { 366 * OVERSAMPLENR, 200 }, + { 390 * OVERSAMPLENR, 195 }, + { 415 * OVERSAMPLENR, 190 }, + { 440 * OVERSAMPLENR, 185 }, + { 467 * OVERSAMPLENR, 180 }, + { 494 * OVERSAMPLENR, 175 }, + { 522 * OVERSAMPLENR, 170 }, + { 551 * OVERSAMPLENR, 165 }, + { 580 * OVERSAMPLENR, 160 }, + { 609 * OVERSAMPLENR, 155 }, + { 638 * OVERSAMPLENR, 150 }, + { 666 * OVERSAMPLENR, 145 }, + { 695 * OVERSAMPLENR, 140 }, + { 722 * OVERSAMPLENR, 135 }, + { 749 * OVERSAMPLENR, 130 }, + { 775 * OVERSAMPLENR, 125 }, + { 800 * OVERSAMPLENR, 120 }, + { 823 * OVERSAMPLENR, 115 }, + { 845 * OVERSAMPLENR, 110 }, + { 865 * OVERSAMPLENR, 105 }, + { 884 * OVERSAMPLENR, 100 }, + { 901 * OVERSAMPLENR, 95 }, + { 917 * OVERSAMPLENR, 90 }, + { 932 * OVERSAMPLENR, 85 }, + { 944 * OVERSAMPLENR, 80 }, + { 956 * OVERSAMPLENR, 75 }, + { 966 * OVERSAMPLENR, 70 }, + { 975 * OVERSAMPLENR, 65 }, + { 982 * OVERSAMPLENR, 60 }, + { 989 * OVERSAMPLENR, 55 }, + { 995 * OVERSAMPLENR, 50 }, + { 1000 * OVERSAMPLENR, 45 }, + { 1004 * OVERSAMPLENR, 40 }, + { 1007 * OVERSAMPLENR, 35 }, + { 1010 * OVERSAMPLENR, 30 }, + { 1013 * OVERSAMPLENR, 25 }, + { 1015 * OVERSAMPLENR, 20 }, + { 1017 * OVERSAMPLENR, 15 }, + { 1018 * OVERSAMPLENR, 10 }, + { 1019 * OVERSAMPLENR, 5 }, + { 1020 * OVERSAMPLENR, 0 }, + { 1021 * OVERSAMPLENR, -5 } }; #endif @@ -819,38 +819,38 @@ const short temptable_51[][2] PROGMEM = { // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance // Advantage: More resolution and better linearity from 150C to 200C const short temptable_52[][2] PROGMEM = { - {1 * OVERSAMPLENR, 500}, - {125 * OVERSAMPLENR, 300}, //top rating 300C - {142 * OVERSAMPLENR, 290}, - {162 * OVERSAMPLENR, 280}, - {185 * OVERSAMPLENR, 270}, - {211 * OVERSAMPLENR, 260}, - {240 * OVERSAMPLENR, 250}, - {274 * OVERSAMPLENR, 240}, - {312 * OVERSAMPLENR, 230}, - {355 * OVERSAMPLENR, 220}, - {401 * OVERSAMPLENR, 210}, - {452 * OVERSAMPLENR, 200}, - {506 * OVERSAMPLENR, 190}, - {563 * OVERSAMPLENR, 180}, - {620 * OVERSAMPLENR, 170}, - {677 * OVERSAMPLENR, 160}, - {732 * OVERSAMPLENR, 150}, - {783 * OVERSAMPLENR, 140}, - {830 * OVERSAMPLENR, 130}, - {871 * OVERSAMPLENR, 120}, - {906 * OVERSAMPLENR, 110}, - {935 * OVERSAMPLENR, 100}, - {958 * OVERSAMPLENR, 90}, - {976 * OVERSAMPLENR, 80}, - {990 * OVERSAMPLENR, 70}, - {1000 * OVERSAMPLENR, 60}, - {1008 * OVERSAMPLENR, 50}, - {1013 * OVERSAMPLENR, 40}, - {1017 * OVERSAMPLENR, 30}, - {1019 * OVERSAMPLENR, 20}, - {1021 * OVERSAMPLENR, 10}, - {1022 * OVERSAMPLENR, 0} + { 1 * OVERSAMPLENR, 500 }, + { 125 * OVERSAMPLENR, 300 }, // top rating 300C + { 142 * OVERSAMPLENR, 290 }, + { 162 * OVERSAMPLENR, 280 }, + { 185 * OVERSAMPLENR, 270 }, + { 211 * OVERSAMPLENR, 260 }, + { 240 * OVERSAMPLENR, 250 }, + { 274 * OVERSAMPLENR, 240 }, + { 312 * OVERSAMPLENR, 230 }, + { 355 * OVERSAMPLENR, 220 }, + { 401 * OVERSAMPLENR, 210 }, + { 452 * OVERSAMPLENR, 200 }, + { 506 * OVERSAMPLENR, 190 }, + { 563 * OVERSAMPLENR, 180 }, + { 620 * OVERSAMPLENR, 170 }, + { 677 * OVERSAMPLENR, 160 }, + { 732 * OVERSAMPLENR, 150 }, + { 783 * OVERSAMPLENR, 140 }, + { 830 * OVERSAMPLENR, 130 }, + { 871 * OVERSAMPLENR, 120 }, + { 906 * OVERSAMPLENR, 110 }, + { 935 * OVERSAMPLENR, 100 }, + { 958 * OVERSAMPLENR, 90 }, + { 976 * OVERSAMPLENR, 80 }, + { 990 * OVERSAMPLENR, 70 }, + { 1000 * OVERSAMPLENR, 60 }, + { 1008 * OVERSAMPLENR, 50 }, + { 1013 * OVERSAMPLENR, 40 }, + { 1017 * OVERSAMPLENR, 30 }, + { 1019 * OVERSAMPLENR, 20 }, + { 1021 * OVERSAMPLENR, 10 }, + { 1022 * OVERSAMPLENR, 0 } }; #endif @@ -860,38 +860,38 @@ const short temptable_52[][2] PROGMEM = { // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance // Advantage: More resolution and better linearity from 150C to 200C const short temptable_55[][2] PROGMEM = { - {1 * OVERSAMPLENR, 500}, - {76 * OVERSAMPLENR, 300}, - {87 * OVERSAMPLENR, 290}, - {100 * OVERSAMPLENR, 280}, - {114 * OVERSAMPLENR, 270}, - {131 * OVERSAMPLENR, 260}, - {152 * OVERSAMPLENR, 250}, - {175 * OVERSAMPLENR, 240}, - {202 * OVERSAMPLENR, 230}, - {234 * OVERSAMPLENR, 220}, - {271 * OVERSAMPLENR, 210}, - {312 * OVERSAMPLENR, 200}, - {359 * OVERSAMPLENR, 190}, - {411 * OVERSAMPLENR, 180}, - {467 * OVERSAMPLENR, 170}, - {527 * OVERSAMPLENR, 160}, - {590 * OVERSAMPLENR, 150}, - {652 * OVERSAMPLENR, 140}, - {713 * OVERSAMPLENR, 130}, - {770 * OVERSAMPLENR, 120}, - {822 * OVERSAMPLENR, 110}, - {867 * OVERSAMPLENR, 100}, - {905 * OVERSAMPLENR, 90}, - {936 * OVERSAMPLENR, 80}, - {961 * OVERSAMPLENR, 70}, - {979 * OVERSAMPLENR, 60}, - {993 * OVERSAMPLENR, 50}, - {1003 * OVERSAMPLENR, 40}, - {1010 * OVERSAMPLENR, 30}, - {1015 * OVERSAMPLENR, 20}, - {1018 * OVERSAMPLENR, 10}, - {1020 * OVERSAMPLENR, 0} + { 1 * OVERSAMPLENR, 500 }, + { 76 * OVERSAMPLENR, 300 }, + { 87 * OVERSAMPLENR, 290 }, + { 100 * OVERSAMPLENR, 280 }, + { 114 * OVERSAMPLENR, 270 }, + { 131 * OVERSAMPLENR, 260 }, + { 152 * OVERSAMPLENR, 250 }, + { 175 * OVERSAMPLENR, 240 }, + { 202 * OVERSAMPLENR, 230 }, + { 234 * OVERSAMPLENR, 220 }, + { 271 * OVERSAMPLENR, 210 }, + { 312 * OVERSAMPLENR, 200 }, + { 359 * OVERSAMPLENR, 190 }, + { 411 * OVERSAMPLENR, 180 }, + { 467 * OVERSAMPLENR, 170 }, + { 527 * OVERSAMPLENR, 160 }, + { 590 * OVERSAMPLENR, 150 }, + { 652 * OVERSAMPLENR, 140 }, + { 713 * OVERSAMPLENR, 130 }, + { 770 * OVERSAMPLENR, 120 }, + { 822 * OVERSAMPLENR, 110 }, + { 867 * OVERSAMPLENR, 100 }, + { 905 * OVERSAMPLENR, 90 }, + { 936 * OVERSAMPLENR, 80 }, + { 961 * OVERSAMPLENR, 70 }, + { 979 * OVERSAMPLENR, 60 }, + { 993 * OVERSAMPLENR, 50 }, + { 1003 * OVERSAMPLENR, 40 }, + { 1010 * OVERSAMPLENR, 30 }, + { 1015 * OVERSAMPLENR, 20 }, + { 1018 * OVERSAMPLENR, 10 }, + { 1020 * OVERSAMPLENR, 0 } }; #endif @@ -905,179 +905,180 @@ const short temptable_55[][2] PROGMEM = { // min adc: 1 at 0.0048828125 V // max adc: 1023 at 4.9951171875 V const short temptable_60[][2] PROGMEM = { - {51 * OVERSAMPLENR, 272}, - {61 * OVERSAMPLENR, 258}, - {71 * OVERSAMPLENR, 247}, - {81 * OVERSAMPLENR, 237}, - {91 * OVERSAMPLENR, 229}, - {101 * OVERSAMPLENR, 221}, - {131 * OVERSAMPLENR, 204}, - {161 * OVERSAMPLENR, 190}, - {191 * OVERSAMPLENR, 179}, - {231 * OVERSAMPLENR, 167}, - {271 * OVERSAMPLENR, 157}, - {311 * OVERSAMPLENR, 148}, - {351 * OVERSAMPLENR, 140}, - {381 * OVERSAMPLENR, 135}, - {411 * OVERSAMPLENR, 130}, - {441 * OVERSAMPLENR, 125}, - {451 * OVERSAMPLENR, 123}, - {461 * OVERSAMPLENR, 122}, - {471 * OVERSAMPLENR, 120}, - {481 * OVERSAMPLENR, 119}, - {491 * OVERSAMPLENR, 117}, - {501 * OVERSAMPLENR, 116}, - {511 * OVERSAMPLENR, 114}, - {521 * OVERSAMPLENR, 113}, - {531 * OVERSAMPLENR, 111}, - {541 * OVERSAMPLENR, 110}, - {551 * OVERSAMPLENR, 108}, - {561 * OVERSAMPLENR, 107}, - {571 * OVERSAMPLENR, 105}, - {581 * OVERSAMPLENR, 104}, - {591 * OVERSAMPLENR, 102}, - {601 * OVERSAMPLENR, 101}, - {611 * OVERSAMPLENR, 100}, - {621 * OVERSAMPLENR, 98}, - {631 * OVERSAMPLENR, 97}, - {641 * OVERSAMPLENR, 95}, - {651 * OVERSAMPLENR, 94}, - {661 * OVERSAMPLENR, 92}, - {671 * OVERSAMPLENR, 91}, - {681 * OVERSAMPLENR, 90}, - {691 * OVERSAMPLENR, 88}, - {701 * OVERSAMPLENR, 87}, - {711 * OVERSAMPLENR, 85}, - {721 * OVERSAMPLENR, 84}, - {731 * OVERSAMPLENR, 82}, - {741 * OVERSAMPLENR, 81}, - {751 * OVERSAMPLENR, 79}, - {761 * OVERSAMPLENR, 77}, - {771 * OVERSAMPLENR, 76}, - {781 * OVERSAMPLENR, 74}, - {791 * OVERSAMPLENR, 72}, - {801 * OVERSAMPLENR, 71}, - {811 * OVERSAMPLENR, 69}, - {821 * OVERSAMPLENR, 67}, - {831 * OVERSAMPLENR, 65}, - {841 * OVERSAMPLENR, 63}, - {851 * OVERSAMPLENR, 62}, - {861 * OVERSAMPLENR, 60}, - {871 * OVERSAMPLENR, 57}, - {881 * OVERSAMPLENR, 55}, - {891 * OVERSAMPLENR, 53}, - {901 * OVERSAMPLENR, 51}, - {911 * OVERSAMPLENR, 48}, - {921 * OVERSAMPLENR, 45}, - {931 * OVERSAMPLENR, 42}, - {941 * OVERSAMPLENR, 39}, - {951 * OVERSAMPLENR, 36}, - {961 * OVERSAMPLENR, 32}, - {981 * OVERSAMPLENR, 23}, - {991 * OVERSAMPLENR, 17}, - {1001 * OVERSAMPLENR, 9}, - {1008 * OVERSAMPLENR, 0}, + { 51 * OVERSAMPLENR, 272 }, + { 61 * OVERSAMPLENR, 258 }, + { 71 * OVERSAMPLENR, 247 }, + { 81 * OVERSAMPLENR, 237 }, + { 91 * OVERSAMPLENR, 229 }, + { 101 * OVERSAMPLENR, 221 }, + { 131 * OVERSAMPLENR, 204 }, + { 161 * OVERSAMPLENR, 190 }, + { 191 * OVERSAMPLENR, 179 }, + { 231 * OVERSAMPLENR, 167 }, + { 271 * OVERSAMPLENR, 157 }, + { 311 * OVERSAMPLENR, 148 }, + { 351 * OVERSAMPLENR, 140 }, + { 381 * OVERSAMPLENR, 135 }, + { 411 * OVERSAMPLENR, 130 }, + { 441 * OVERSAMPLENR, 125 }, + { 451 * OVERSAMPLENR, 123 }, + { 461 * OVERSAMPLENR, 122 }, + { 471 * OVERSAMPLENR, 120 }, + { 481 * OVERSAMPLENR, 119 }, + { 491 * OVERSAMPLENR, 117 }, + { 501 * OVERSAMPLENR, 116 }, + { 511 * OVERSAMPLENR, 114 }, + { 521 * OVERSAMPLENR, 113 }, + { 531 * OVERSAMPLENR, 111 }, + { 541 * OVERSAMPLENR, 110 }, + { 551 * OVERSAMPLENR, 108 }, + { 561 * OVERSAMPLENR, 107 }, + { 571 * OVERSAMPLENR, 105 }, + { 581 * OVERSAMPLENR, 104 }, + { 591 * OVERSAMPLENR, 102 }, + { 601 * OVERSAMPLENR, 101 }, + { 611 * OVERSAMPLENR, 100 }, + { 621 * OVERSAMPLENR, 98 }, + { 631 * OVERSAMPLENR, 97 }, + { 641 * OVERSAMPLENR, 95 }, + { 651 * OVERSAMPLENR, 94 }, + { 661 * OVERSAMPLENR, 92 }, + { 671 * OVERSAMPLENR, 91 }, + { 681 * OVERSAMPLENR, 90 }, + { 691 * OVERSAMPLENR, 88 }, + { 701 * OVERSAMPLENR, 87 }, + { 711 * OVERSAMPLENR, 85 }, + { 721 * OVERSAMPLENR, 84 }, + { 731 * OVERSAMPLENR, 82 }, + { 741 * OVERSAMPLENR, 81 }, + { 751 * OVERSAMPLENR, 79 }, + { 761 * OVERSAMPLENR, 77 }, + { 771 * OVERSAMPLENR, 76 }, + { 781 * OVERSAMPLENR, 74 }, + { 791 * OVERSAMPLENR, 72 }, + { 801 * OVERSAMPLENR, 71 }, + { 811 * OVERSAMPLENR, 69 }, + { 821 * OVERSAMPLENR, 67 }, + { 831 * OVERSAMPLENR, 65 }, + { 841 * OVERSAMPLENR, 63 }, + { 851 * OVERSAMPLENR, 62 }, + { 861 * OVERSAMPLENR, 60 }, + { 871 * OVERSAMPLENR, 57 }, + { 881 * OVERSAMPLENR, 55 }, + { 891 * OVERSAMPLENR, 53 }, + { 901 * OVERSAMPLENR, 51 }, + { 911 * OVERSAMPLENR, 48 }, + { 921 * OVERSAMPLENR, 45 }, + { 931 * OVERSAMPLENR, 42 }, + { 941 * OVERSAMPLENR, 39 }, + { 951 * OVERSAMPLENR, 36 }, + { 961 * OVERSAMPLENR, 32 }, + { 981 * OVERSAMPLENR, 23 }, + { 991 * OVERSAMPLENR, 17 }, + { 1001 * OVERSAMPLENR, 9 }, + { 1008 * OVERSAMPLENR, 0 } }; #endif + #if (THERMISTORHEATER_0 == 12) || (THERMISTORHEATER_1 == 12) || (THERMISTORHEATER_2 == 12) || (THERMISTORHEATER_3 == 12) || (THERMISTORBED == 12) -//100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) +// 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) const short temptable_12[][2] PROGMEM = { - {35 * OVERSAMPLENR, 180}, //top rating 180C - {211 * OVERSAMPLENR, 140}, - {233 * OVERSAMPLENR, 135}, - {261 * OVERSAMPLENR, 130}, - {290 * OVERSAMPLENR, 125}, - {328 * OVERSAMPLENR, 120}, - {362 * OVERSAMPLENR, 115}, - {406 * OVERSAMPLENR, 110}, - {446 * OVERSAMPLENR, 105}, - {496 * OVERSAMPLENR, 100}, - {539 * OVERSAMPLENR, 95}, - {585 * OVERSAMPLENR, 90}, - {629 * OVERSAMPLENR, 85}, - {675 * OVERSAMPLENR, 80}, - {718 * OVERSAMPLENR, 75}, - {758 * OVERSAMPLENR, 70}, - {793 * OVERSAMPLENR, 65}, - {822 * OVERSAMPLENR, 60}, - {841 * OVERSAMPLENR, 55}, - {875 * OVERSAMPLENR, 50}, - {899 * OVERSAMPLENR, 45}, - {926 * OVERSAMPLENR, 40}, - {946 * OVERSAMPLENR, 35}, - {962 * OVERSAMPLENR, 30}, - {977 * OVERSAMPLENR, 25}, - {987 * OVERSAMPLENR, 20}, - {995 * OVERSAMPLENR, 15}, - {1001 * OVERSAMPLENR, 10}, - {1010 * OVERSAMPLENR, 0}, - {1023 * OVERSAMPLENR, -40}, + { 35 * OVERSAMPLENR, 180 }, // top rating 180C + { 211 * OVERSAMPLENR, 140 }, + { 233 * OVERSAMPLENR, 135 }, + { 261 * OVERSAMPLENR, 130 }, + { 290 * OVERSAMPLENR, 125 }, + { 328 * OVERSAMPLENR, 120 }, + { 362 * OVERSAMPLENR, 115 }, + { 406 * OVERSAMPLENR, 110 }, + { 446 * OVERSAMPLENR, 105 }, + { 496 * OVERSAMPLENR, 100 }, + { 539 * OVERSAMPLENR, 95 }, + { 585 * OVERSAMPLENR, 90 }, + { 629 * OVERSAMPLENR, 85 }, + { 675 * OVERSAMPLENR, 80 }, + { 718 * OVERSAMPLENR, 75 }, + { 758 * OVERSAMPLENR, 70 }, + { 793 * OVERSAMPLENR, 65 }, + { 822 * OVERSAMPLENR, 60 }, + { 841 * OVERSAMPLENR, 55 }, + { 875 * OVERSAMPLENR, 50 }, + { 899 * OVERSAMPLENR, 45 }, + { 926 * OVERSAMPLENR, 40 }, + { 946 * OVERSAMPLENR, 35 }, + { 962 * OVERSAMPLENR, 30 }, + { 977 * OVERSAMPLENR, 25 }, + { 987 * OVERSAMPLENR, 20 }, + { 995 * OVERSAMPLENR, 15 }, + { 1001 * OVERSAMPLENR, 10 }, + { 1010 * OVERSAMPLENR, 0 }, + { 1023 * OVERSAMPLENR, -40 } }; #endif #if (THERMISTORHEATER_0 == 70) || (THERMISTORHEATER_1 == 70) || (THERMISTORHEATER_2 == 70) || (THERMISTORHEATER_3 == 70) || (THERMISTORBED == 70) // bqh2 stock thermistor const short temptable_70[][2] PROGMEM = { - { 22 * OVERSAMPLENR , 300 }, - { 24 * OVERSAMPLENR , 295 }, - { 25 * OVERSAMPLENR , 290 }, - { 27 * OVERSAMPLENR , 285 }, - { 29 * OVERSAMPLENR , 280 }, - { 32 * OVERSAMPLENR , 275 }, - { 34 * OVERSAMPLENR , 270 }, - { 37 * OVERSAMPLENR , 265 }, - { 40 * OVERSAMPLENR , 260 }, - { 43 * OVERSAMPLENR , 255 }, - { 46 * OVERSAMPLENR , 250 }, - { 50 * OVERSAMPLENR , 245 }, - { 54 * OVERSAMPLENR , 240 }, - { 59 * OVERSAMPLENR , 235 }, - { 64 * OVERSAMPLENR , 230 }, - { 70 * OVERSAMPLENR , 225 }, - { 76 * OVERSAMPLENR , 220 }, - { 83 * OVERSAMPLENR , 215 }, - { 90 * OVERSAMPLENR , 210 }, - { 99 * OVERSAMPLENR , 205 }, - { 108 * OVERSAMPLENR , 200 }, - { 118 * OVERSAMPLENR , 195 }, - { 129 * OVERSAMPLENR , 190 }, - { 141 * OVERSAMPLENR , 185 }, - { 154 * OVERSAMPLENR , 180 }, - { 169 * OVERSAMPLENR , 175 }, - { 185 * OVERSAMPLENR , 170 }, - { 203 * OVERSAMPLENR , 165 }, - { 222 * OVERSAMPLENR , 160 }, - { 243 * OVERSAMPLENR , 155 }, - { 266 * OVERSAMPLENR , 150 }, - { 290 * OVERSAMPLENR , 145 }, - { 317 * OVERSAMPLENR , 140 }, - { 346 * OVERSAMPLENR , 135 }, - { 376 * OVERSAMPLENR , 130 }, - { 408 * OVERSAMPLENR , 125 }, - { 442 * OVERSAMPLENR , 120 }, - { 477 * OVERSAMPLENR , 115 }, - { 513 * OVERSAMPLENR , 110 }, - { 551 * OVERSAMPLENR , 105 }, - { 588 * OVERSAMPLENR , 100 }, - { 626 * OVERSAMPLENR , 95 }, - { 663 * OVERSAMPLENR , 90 }, - { 699 * OVERSAMPLENR , 85 }, - { 735 * OVERSAMPLENR , 80 }, - { 768 * OVERSAMPLENR , 75 }, - { 800 * OVERSAMPLENR , 70 }, - { 829 * OVERSAMPLENR , 65 }, - { 856 * OVERSAMPLENR , 60 }, - { 881 * OVERSAMPLENR , 55 }, - { 903 * OVERSAMPLENR , 50 }, - { 922 * OVERSAMPLENR , 45 }, - { 939 * OVERSAMPLENR , 40 }, - { 954 * OVERSAMPLENR , 35 }, - { 966 * OVERSAMPLENR , 30 }, - { 977 * OVERSAMPLENR , 25 }, - { 986 * OVERSAMPLENR , 20 }, - { 994 * OVERSAMPLENR , 15 }, - { 1000 * OVERSAMPLENR , 10 }, - { 1005 * OVERSAMPLENR , 5 }, - { 1009 * OVERSAMPLENR , 0 } //safety + { 22 * OVERSAMPLENR, 300 }, + { 24 * OVERSAMPLENR, 295 }, + { 25 * OVERSAMPLENR, 290 }, + { 27 * OVERSAMPLENR, 285 }, + { 29 * OVERSAMPLENR, 280 }, + { 32 * OVERSAMPLENR, 275 }, + { 34 * OVERSAMPLENR, 270 }, + { 37 * OVERSAMPLENR, 265 }, + { 40 * OVERSAMPLENR, 260 }, + { 43 * OVERSAMPLENR, 255 }, + { 46 * OVERSAMPLENR, 250 }, + { 50 * OVERSAMPLENR, 245 }, + { 54 * OVERSAMPLENR, 240 }, + { 59 * OVERSAMPLENR, 235 }, + { 64 * OVERSAMPLENR, 230 }, + { 70 * OVERSAMPLENR, 225 }, + { 76 * OVERSAMPLENR, 220 }, + { 83 * OVERSAMPLENR, 215 }, + { 90 * OVERSAMPLENR, 210 }, + { 99 * OVERSAMPLENR, 205 }, + { 108 * OVERSAMPLENR, 200 }, + { 118 * OVERSAMPLENR, 195 }, + { 129 * OVERSAMPLENR, 190 }, + { 141 * OVERSAMPLENR, 185 }, + { 154 * OVERSAMPLENR, 180 }, + { 169 * OVERSAMPLENR, 175 }, + { 185 * OVERSAMPLENR, 170 }, + { 203 * OVERSAMPLENR, 165 }, + { 222 * OVERSAMPLENR, 160 }, + { 243 * OVERSAMPLENR, 155 }, + { 266 * OVERSAMPLENR, 150 }, + { 290 * OVERSAMPLENR, 145 }, + { 317 * OVERSAMPLENR, 140 }, + { 346 * OVERSAMPLENR, 135 }, + { 376 * OVERSAMPLENR, 130 }, + { 408 * OVERSAMPLENR, 125 }, + { 442 * OVERSAMPLENR, 120 }, + { 477 * OVERSAMPLENR, 115 }, + { 513 * OVERSAMPLENR, 110 }, + { 551 * OVERSAMPLENR, 105 }, + { 588 * OVERSAMPLENR, 100 }, + { 626 * OVERSAMPLENR, 95 }, + { 663 * OVERSAMPLENR, 90 }, + { 699 * OVERSAMPLENR, 85 }, + { 735 * OVERSAMPLENR, 80 }, + { 768 * OVERSAMPLENR, 75 }, + { 800 * OVERSAMPLENR, 70 }, + { 829 * OVERSAMPLENR, 65 }, + { 856 * OVERSAMPLENR, 60 }, + { 881 * OVERSAMPLENR, 55 }, + { 903 * OVERSAMPLENR, 50 }, + { 922 * OVERSAMPLENR, 45 }, + { 939 * OVERSAMPLENR, 40 }, + { 954 * OVERSAMPLENR, 35 }, + { 966 * OVERSAMPLENR, 30 }, + { 977 * OVERSAMPLENR, 25 }, + { 986 * OVERSAMPLENR, 20 }, + { 994 * OVERSAMPLENR, 15 }, + { 1000 * OVERSAMPLENR, 10 }, + { 1005 * OVERSAMPLENR, 5 }, + { 1009 * OVERSAMPLENR, 0 } // safety }; #endif @@ -1095,8 +1096,8 @@ const short temptable_70[][2] PROGMEM = { #if (THERMISTORHEATER_0 == 110) || (THERMISTORHEATER_1 == 110) || (THERMISTORHEATER_2 == 110) || (THERMISTORHEATER_3 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup const short temptable_110[][2] PROGMEM = { // only few values are needed as the curve is very flat - PtLine(0, 100, 1000) - PtLine(50, 100, 1000) + PtLine( 0, 100, 1000) + PtLine( 50, 100, 1000) PtLine(100, 100, 1000) PtLine(150, 100, 1000) PtLine(200, 100, 1000) @@ -1107,8 +1108,8 @@ const short temptable_110[][2] PROGMEM = { #if (THERMISTORHEATER_0 == 147) || (THERMISTORHEATER_1 == 147) || (THERMISTORHEATER_2 == 147) || (THERMISTORHEATER_3 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup const short temptable_147[][2] PROGMEM = { // only few values are needed as the curve is very flat - PtLine(0, 100, 4700) - PtLine(50, 100, 4700) + PtLine( 0, 100, 4700) + PtLine( 50, 100, 4700) PtLine(100, 100, 4700) PtLine(150, 100, 4700) PtLine(200, 100, 4700) @@ -1118,10 +1119,10 @@ const short temptable_147[][2] PROGMEM = { #endif #if (THERMISTORHEATER_0 == 1010) || (THERMISTORHEATER_1 == 1010) || (THERMISTORHEATER_2 == 1010) || (THERMISTORHEATER_3 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup const short temptable_1010[][2] PROGMEM = { - PtLine(0, 1000, 1000) - PtLine(25, 1000, 1000) - PtLine(50, 1000, 1000) - PtLine(75, 1000, 1000) + PtLine( 0, 1000, 1000) + PtLine( 25, 1000, 1000) + PtLine( 50, 1000, 1000) + PtLine( 75, 1000, 1000) PtLine(100, 1000, 1000) PtLine(125, 1000, 1000) PtLine(150, 1000, 1000) @@ -1136,8 +1137,8 @@ const short temptable_1010[][2] PROGMEM = { #if (THERMISTORHEATER_0 == 1047) || (THERMISTORHEATER_1 == 1047) || (THERMISTORHEATER_2 == 1047) || (THERMISTORHEATER_3 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup const short temptable_1047[][2] PROGMEM = { // only few values are needed as the curve is very flat - PtLine(0, 1000, 4700) - PtLine(50, 1000, 4700) + PtLine( 0, 1000, 4700) + PtLine( 50, 1000, 4700) PtLine(100, 1000, 4700) PtLine(150, 1000, 4700) PtLine(200, 1000, 4700) @@ -1152,8 +1153,8 @@ const short temptable_1047[][2] PROGMEM = { #define DUMMY_THERMISTOR_999_VALUE 25 #endif const short temptable_999[][2] PROGMEM = { - {1 * OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE}, - {1023 * OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE} + { 1 * OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE }, + { 1023 * OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE } }; #endif @@ -1163,8 +1164,8 @@ const short temptable_1047[][2] PROGMEM = { #define DUMMY_THERMISTOR_998_VALUE 25 #endif const short temptable_998[][2] PROGMEM = { - {1 * OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE}, - {1023 * OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE} + { 1 * OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE }, + { 1023 * OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE } }; #endif @@ -1184,12 +1185,12 @@ const short temptable_1047[][2] PROGMEM = { #endif // HEATER_0_USES_THERMISTOR #endif -//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature +// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature #ifndef HEATER_0_RAW_HI_TEMP - #ifdef HEATER_0_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value + #ifdef HEATER_0_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value #define HEATER_0_RAW_HI_TEMP 0 #define HEATER_0_RAW_LO_TEMP 16383 - #else //In case of an thermocouple the highest temperature results in the highest ADC value + #else // In case of an thermocouple the highest temperature results in the highest ADC value #define HEATER_0_RAW_HI_TEMP 16383 #define HEATER_0_RAW_LO_TEMP 0 #endif @@ -1207,12 +1208,12 @@ const short temptable_1047[][2] PROGMEM = { #endif // HEATER_1_USES_THERMISTOR #endif -//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature +// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature #ifndef HEATER_1_RAW_HI_TEMP - #ifdef HEATER_1_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value + #ifdef HEATER_1_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value #define HEATER_1_RAW_HI_TEMP 0 #define HEATER_1_RAW_LO_TEMP 16383 - #else //In case of an thermocouple the highest temperature results in the highest ADC value + #else // In case of an thermocouple the highest temperature results in the highest ADC value #define HEATER_1_RAW_HI_TEMP 16383 #define HEATER_1_RAW_LO_TEMP 0 #endif @@ -1230,12 +1231,12 @@ const short temptable_1047[][2] PROGMEM = { #endif // HEATER_2_USES_THERMISTOR #endif -//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature +// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature #ifndef HEATER_2_RAW_HI_TEMP - #ifdef HEATER_2_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value + #ifdef HEATER_2_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value #define HEATER_2_RAW_HI_TEMP 0 #define HEATER_2_RAW_LO_TEMP 16383 - #else //In case of an thermocouple the highest temperature results in the highest ADC value + #else // In case of an thermocouple the highest temperature results in the highest ADC value #define HEATER_2_RAW_HI_TEMP 16383 #define HEATER_2_RAW_LO_TEMP 0 #endif @@ -1253,12 +1254,12 @@ const short temptable_1047[][2] PROGMEM = { #endif // HEATER_3_USES_THERMISTOR #endif -//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature +// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature #ifndef HEATER_3_RAW_HI_TEMP - #ifdef HEATER_3_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value + #ifdef HEATER_3_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value #define HEATER_3_RAW_HI_TEMP 0 #define HEATER_3_RAW_LO_TEMP 16383 - #else //In case of an thermocouple the highest temperature results in the highest ADC value + #else // In case of an thermocouple the highest temperature results in the highest ADC value #define HEATER_3_RAW_HI_TEMP 16383 #define HEATER_3_RAW_LO_TEMP 0 #endif @@ -1273,15 +1274,15 @@ const short temptable_1047[][2] PROGMEM = { #endif // BED_USES_THERMISTOR #endif -//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature +// Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature #ifndef HEATER_BED_RAW_HI_TEMP - #ifdef BED_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value + #ifdef BED_USES_THERMISTOR // In case of a thermistor the highest temperature results in the lowest ADC value #define HEATER_BED_RAW_HI_TEMP 0 #define HEATER_BED_RAW_LO_TEMP 16383 - #else //In case of an thermocouple the highest temperature results in the highest ADC value + #else // In case of an thermocouple the highest temperature results in the highest ADC value #define HEATER_BED_RAW_HI_TEMP 16383 #define HEATER_BED_RAW_LO_TEMP 0 #endif #endif -#endif //THERMISTORTABLES_H_ +#endif // THERMISTORTABLES_H_ From 40cd20a236b23483d7e6124217ebaee03b5b2b50 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 17:58:44 -0700 Subject: [PATCH 139/580] Fix comments on EXPERIMENTAL_I2CBUS --- Marlin/Configuration_adv.h | 10 +++++----- .../Cartesio/Configuration_adv.h | 10 +++++----- .../example_configurations/Felix/Configuration_adv.h | 10 +++++----- .../Hephestos/Configuration_adv.h | 10 +++++----- .../Hephestos_2/Configuration_adv.h | 10 +++++----- .../example_configurations/K8200/Configuration_adv.h | 10 +++++----- .../RigidBot/Configuration_adv.h | 10 +++++----- .../example_configurations/SCARA/Configuration_adv.h | 10 +++++----- Marlin/example_configurations/TAZ4/Configuration_adv.h | 10 +++++----- .../example_configurations/WITBOX/Configuration_adv.h | 10 +++++----- .../delta/biv2.5/Configuration_adv.h | 10 +++++----- .../delta/generic/Configuration_adv.h | 10 +++++----- .../delta/kossel_mini/Configuration_adv.h | 10 +++++----- .../delta/kossel_pro/Configuration_adv.h | 10 +++++----- .../delta/kossel_xl/Configuration_adv.h | 10 +++++----- .../example_configurations/makibox/Configuration_adv.h | 10 +++++----- .../tvrrug/Round2/Configuration_adv.h | 10 +++++----- 17 files changed, 85 insertions(+), 85 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d0fd22139..a0929dc96 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index c69dc70f0..c8d9be298 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 1cdad67fa..d739c56a8 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 537c9f52d..8644b5f18 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index f5dad62f8..b52f32cfd 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 00f203d2a..ea4205027 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -709,9 +709,9 @@ const unsigned int dropsegments = 2; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -721,12 +721,12 @@ const unsigned int dropsegments = 2; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 9f4ef31cb..4f38b0c4c 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index add39fa3e..489e57b19 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 96e38bc6c..7c3bba374 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -711,9 +711,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -723,12 +723,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 537c9f52d..8644b5f18 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index b90ca6a1c..35a745d1b 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -705,9 +705,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -717,12 +717,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index bb3674b15..82ca2d625 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -705,9 +705,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -717,12 +717,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index cfd313dce..7a8eea007 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -704,9 +704,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -716,12 +716,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 221ddb16c..4b5144065 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -709,9 +709,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -721,12 +721,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 7286e3a69..fb59b0df4 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -705,9 +705,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -717,12 +717,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 820d9d53e..b8c45f2cb 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index fd96c8947..7da66c773 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -703,9 +703,9 @@ const unsigned int dropsegments = 5; //everything with less than this number of * devices on the bus. * * ; Example #1 - * ; This macro send the string "Marlin" to the slave device with address 0x63 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) * ; It uses multiple M155 commands with one B arg - * M155 A63 ; Target slave address + * M155 A99 ; Target slave address * M155 B77 ; M * M155 B97 ; a * M155 B114 ; r @@ -715,12 +715,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of * M155 S1 ; Send the current buffer * * ; Example #2 - * ; Request 6 bytes from slave device with address 0x63 - * M156 A63 B5 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 * * ; Example #3 * ; Example serial output of a M156 request - * echo:i2c-reply: from:63 bytes:5 data:hello + * echo:i2c-reply: from:99 bytes:5 data:hello */ // @section i2cbus From 19fb04d76165212ec9e10462538db5836a9063a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 21 Jun 2016 00:40:56 +0100 Subject: [PATCH 140/580] Update bq Hephestos 2 config --- .../Hephestos_2/Configuration.h | 44 +++++++++---------- .../Hephestos_2/Configuration_adv.h | 16 +++---- .../Hephestos_2/readme.md | 6 ++- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index eb209befb..e74c1afde 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -221,20 +221,20 @@ // The minimal temperature defines the temperature below which the heater will not be enabled It is used // to check that the wiring to the thermistor is not broken. // Otherwise this would lead to the heater being powered on all the time. -#define HEATER_0_MINTEMP 5 -#define HEATER_1_MINTEMP 5 -#define HEATER_2_MINTEMP 5 -#define HEATER_3_MINTEMP 5 -#define BED_MINTEMP 5 +#define HEATER_0_MINTEMP 15 +//#define HEATER_1_MINTEMP 5 +//#define HEATER_2_MINTEMP 5 +//#define HEATER_3_MINTEMP 5 +//#define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! // You should use MINTEMP for thermistor short/failure protection. #define HEATER_0_MAXTEMP 250 -#define HEATER_1_MAXTEMP 275 -#define HEATER_2_MAXTEMP 275 -#define HEATER_3_MAXTEMP 275 -#define BED_MAXTEMP 150 +//#define HEATER_1_MAXTEMP 275 +//#define HEATER_2_MAXTEMP 275 +//#define HEATER_3_MAXTEMP 275 +//#define BED_MAXTEMP 150 // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS //#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R @@ -293,7 +293,7 @@ // all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis) // setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did, // so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED) -#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current +//#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) @@ -344,7 +344,7 @@ */ #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders -#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +//#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed //=========================================================================== //============================= Mechanical Settings ========================= @@ -512,7 +512,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // For M851 give a range for adjusting the Z probe offset // -#define Z_PROBE_OFFSET_RANGE_MIN -5 +#define Z_PROBE_OFFSET_RANGE_MIN -2 #define Z_PROBE_OFFSET_RANGE_MAX 0 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 @@ -561,8 +561,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops false // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops false // If true, axis won't move to coordinates greater than the defined lengths below. +#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. +#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // @section machine @@ -715,18 +715,18 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // default settings -#define DEFAULT_AXIS_STEPS_PER_UNIT {160, 160, 8000, 204.146} // default steps per unit for Ultimaker -#define DEFAULT_MAX_FEEDRATE {200, 200, 3.3, 200} // (mm/sec) -#define DEFAULT_MAX_ACCELERATION {1000, 1000, 100, 3000} // 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. +#define DEFAULT_AXIS_STEPS_PER_UNIT {160, 160, 8000, 203} // default steps per unit for Ultimaker +#define DEFAULT_MAX_FEEDRATE {250, 250, 2, 200} // (mm/sec) +#define DEFAULT_MAX_ACCELERATION {1000, 1000, 20, 1000} // 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. #define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) -#define DEFAULT_XYJERK 15.0 // (mm/sec) -#define DEFAULT_ZJERK 0.4 // (mm/sec) -#define DEFAULT_EJERK 2.0 // (mm/sec) +#define DEFAULT_XYJERK 10.0 // (mm/sec) +#define DEFAULT_ZJERK 0.4 // (mm/sec) +#define DEFAULT_EJERK 2.0 // (mm/sec) //============================================================================= @@ -809,7 +809,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // - Total time printing // // This information can be viewed by the M78 command. -//#define PRINTCOUNTER +#define PRINTCOUNTER //============================================================================= //============================= LCD and SD support ============================ @@ -889,7 +889,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Use CRC checks and retries on the SD communication. // -//#define SD_CHECK_AND_RETRY +#define SD_CHECK_AND_RETRY // // ENCODER SETTINGS diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index b52f32cfd..74a22c17d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -286,7 +286,7 @@ //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. // When G28 is called, this option will make Y home before X -//#define HOME_Y_BEFORE_X +#define HOME_Y_BEFORE_X // @section machine @@ -301,7 +301,7 @@ // Default stepper release if idle. Set to 0 to deactivate. // Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. // Time can be set by M18 and M84. -#define DEFAULT_STEPPER_DEACTIVE_TIME 60 +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 #define DISABLE_INACTIVE_X true #define DISABLE_INACTIVE_Y true #define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. @@ -333,7 +333,7 @@ // Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end // of the buffer and all stops. This should not be much greater than zero and should only be changed // if unwanted behavior is observed on a user's machine when running at very slow speeds. -#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec) +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/sec) // Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] @@ -355,12 +355,12 @@ //=============================Additional Features=========================== //=========================================================================== -#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly -#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value -#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value +//#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly +//#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +//#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ -#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again +//#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again // @section lcd @@ -374,7 +374,7 @@ #define SD_DETECT_INVERTED #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? - #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. + #define SD_FINISHED_RELEASECOMMAND "M104 S0\nM84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. diff --git a/Marlin/example_configurations/Hephestos_2/readme.md b/Marlin/example_configurations/Hephestos_2/readme.md index 19521705f..447022c94 100644 --- a/Marlin/example_configurations/Hephestos_2/readme.md +++ b/Marlin/example_configurations/Hephestos_2/readme.md @@ -5,4 +5,8 @@ NOTE: The look and feel of the Hephestos 2 while navigating the LCD menu will ch ## Changelog * 2016/03/01 - Initial release - * 2016/03/21 - Activated four point auto leveling by default; updated miscellaneous z-probe values + * 2016/03/21 - Activated 4-point auto leveling by default + Updated miscellaneous z-probe values + * 2016/06/21 - Disabled hot bed related options + Activated software endstops + SD printing now disables the heater when finished From 117db77c552a75ecec9f5e9d568a0ecb666c1c2a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 19:36:24 -0700 Subject: [PATCH 141/580] make motor_current_setting static and constexpr --- Marlin/stepper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 7612e6058..6ad55216d 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -134,7 +134,7 @@ class Stepper { #ifndef PWM_MOTOR_CURRENT #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT #endif - const int motor_current_setting[3] = PWM_MOTOR_CURRENT; + static constexpr int motor_current_setting[3] = PWM_MOTOR_CURRENT; #endif // From 528df1b02da7a7a02e455a73e4e86ffd30822fd3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 19:36:06 -0700 Subject: [PATCH 142/580] Travis test for MINIRAMBO and PWM_MOTOR_CURRENT --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1916669c5..900d438ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -155,6 +155,12 @@ script: - opt_enable BQ_LCD_SMART_CONTROLLER SPEAKER - build_marlin # + # Test MINIRAMBO for PWM_MOTOR_CURRENT + # + - restore_configs + - opt_set MOTHERBOARD BOARD_MINIRAMBO + - build_marlin + # # Enable FILAMENTCHANGEENABLE # - restore_configs From 88dc543584b52d002e3dcbbc74a2297b84f540f7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 02:22:43 -0700 Subject: [PATCH 143/580] Add a macro for XY_TRAVEL_FEEDRATE --- Marlin/Marlin_main.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c9172e71b..3832ea309 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -369,6 +369,9 @@ static uint8_t target_extruder; #if ENABLED(AUTO_BED_LEVELING_FEATURE) int xy_travel_speed = XY_TRAVEL_SPEED; bool bed_leveling_in_progress = false; + #define XY_TRAVEL_FEEDRATE xy_travel_speed +#else + #define XY_TRAVEL_FEEDRATE (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60) #endif #if ENABLED(Z_DUAL_ENDSTOPS) && DISABLED(DELTA) @@ -1633,13 +1636,7 @@ static void setup_for_endstop_move() { #if ENABLED(DELTA) - feedrate = - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - xy_travel_speed - #else - min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60 - #endif - ; + feedrate = XY_TRAVEL_FEEDRATE; destination[X_AXIS] = x; destination[Y_AXIS] = y; @@ -1658,13 +1655,7 @@ static void setup_for_endstop_move() { line_to_current_position(); stepper.synchronize(); - feedrate = - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - xy_travel_speed - #else - min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60 - #endif - ; + feedrate = XY_TRAVEL_FEEDRATE; current_position[X_AXIS] = x; current_position[Y_AXIS] = y; @@ -2981,7 +2972,8 @@ inline void gcode_G28() { destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - (X_PROBE_OFFSET_FROM_EXTRUDER)); destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER)); destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height - feedrate = XY_TRAVEL_SPEED; + + feedrate = XY_TRAVEL_FEEDRATE; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { From 2798499b71393aea90e45defbd625abfb58fcc9c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 02:38:50 -0700 Subject: [PATCH 144/580] XY_TRAVEL_SPEED => XY_PROBE_SPEED --- Marlin/Conditionals.h | 17 ++++++----------- Marlin/Configuration.h | 2 +- Marlin/Marlin_main.cpp | 18 +++++++++--------- Marlin/SanityCheck.h | 2 ++ .../Cartesio/Configuration.h | 2 +- .../Felix/Configuration.h | 2 +- .../Felix/DUAL/Configuration.h | 2 +- .../Hephestos/Configuration.h | 2 +- .../Hephestos_2/Configuration.h | 2 +- .../K8200/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- .../RigidBot/Configuration.h | 2 +- .../SCARA/Configuration.h | 2 +- .../TAZ4/Configuration.h | 2 +- .../WITBOX/Configuration.h | 2 +- .../adafruit/ST7565/Configuration.h | 2 +- .../delta/biv2.5/Configuration.h | 14 +++++++------- .../delta/generic/Configuration.h | 12 ++++++------ .../delta/kossel_mini/Configuration.h | 12 ++++++------ .../delta/kossel_pro/Configuration.h | 14 +++++++------- .../delta/kossel_xl/Configuration.h | 12 ++++++------ .../makibox/Configuration.h | 2 +- .../tvrrug/Round2/Configuration.h | 2 +- 23 files changed, 64 insertions(+), 67 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 8ecf49ebe..ad7d23cc4 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -371,15 +371,6 @@ #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - - #ifndef XY_TRAVEL_SPEED - #ifdef HOMING_FEEDRATE_XYZ - #define XY_TRAVEL_SPEED HOMING_FEEDRATE_XYZ - #else - #define XY_TRAVEL_SPEED 4000 - #endif - #endif - #endif #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) @@ -784,8 +775,12 @@ #ifndef Z_PROBE_OFFSET_RANGE_MAX #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif - #ifndef XY_TRAVEL_SPEED - #define XY_TRAVEL_SPEED 4000 + #ifndef XY_PROBE_SPEED + #ifdef HOMING_FEEDRATE_XYZ + #define XY_PROBE_SPEED HOMING_FEEDRATE_XYZ + #else + #define XY_PROBE_SPEED 4000 + #endif #endif #endif diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 13f855fc3..d1016a446 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -667,7 +667,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3832ea309..389f06e2c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -367,11 +367,11 @@ static uint8_t target_extruder; #endif #if ENABLED(AUTO_BED_LEVELING_FEATURE) - int xy_travel_speed = XY_TRAVEL_SPEED; + int xy_probe_speed = XY_PROBE_SPEED; bool bed_leveling_in_progress = false; - #define XY_TRAVEL_FEEDRATE xy_travel_speed + #define XY_PROBE_FEEDRATE xy_probe_speed #else - #define XY_TRAVEL_FEEDRATE (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60) + #define XY_PROBE_FEEDRATE (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60) #endif #if ENABLED(Z_DUAL_ENDSTOPS) && DISABLED(DELTA) @@ -1636,7 +1636,7 @@ static void setup_for_endstop_move() { #if ENABLED(DELTA) - feedrate = XY_TRAVEL_FEEDRATE; + feedrate = XY_PROBE_FEEDRATE; destination[X_AXIS] = x; destination[Y_AXIS] = y; @@ -1655,7 +1655,7 @@ static void setup_for_endstop_move() { line_to_current_position(); stepper.synchronize(); - feedrate = XY_TRAVEL_FEEDRATE; + feedrate = XY_PROBE_FEEDRATE; current_position[X_AXIS] = x; current_position[Y_AXIS] = y; @@ -2973,7 +2973,7 @@ inline void gcode_G28() { destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER)); destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height - feedrate = XY_TRAVEL_FEEDRATE; + feedrate = XY_PROBE_FEEDRATE; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -3395,7 +3395,7 @@ inline void gcode_G28() { } #endif - xy_travel_speed = code_seen('S') ? (int)code_value_linear_units() : XY_TRAVEL_SPEED; + xy_probe_speed = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED; int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LEFT_PROBE_BED_POSITION, right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : RIGHT_PROBE_BED_POSITION, @@ -6556,8 +6556,8 @@ inline void gcode_T(uint8_t tmp_extruder) { } else { feedrate = - #ifdef XY_TRAVEL_SPEED - XY_TRAVEL_SPEED + #ifdef XY_PROBE_SPEED + XY_PROBE_SPEED #else min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60 #endif diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 8d2edc5d3..a757f8a29 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -623,6 +623,8 @@ #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." +#elif defined(XY_TRAVEL_SPEED) + #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 84794bd98..e3e481312 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -666,7 +666,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index cab1522c0..703bf4e1d 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -649,7 +649,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 322b36f19..a4f82c77b 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -647,7 +647,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 59a111d4f..8a449cb43 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -659,7 +659,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index e74c1afde..4a63d71e7 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -661,7 +661,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 2 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 16ae40da1..4166cd6ee 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -684,7 +684,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index a2492565c..ea93c599d 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -667,7 +667,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 5cbf98f9f..36f6ba090 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -661,7 +661,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 1da70ab1b..147c914e7 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -675,7 +675,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index fc7805553..201ea0a10 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -688,7 +688,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 7712caab3..f8fc195ba 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -659,7 +659,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 8225450f7..30fa688ec 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -667,7 +667,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 1f57ead7e..25a3f0964 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -510,32 +510,32 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00 #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_TRAVEL_SPEED)/2 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_PROBE_SPEED)/2 #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip #define Z_PROBE_ALLEN_KEY_STOW_1_Y -122.00 #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_2_X 36.00 // move down to retract probe #define Z_PROBE_ALLEN_KEY_STOW_2_Y -122.00 #define Z_PROBE_ALLEN_KEY_STOW_2_Z 25.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED)/2 + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/2 #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY @@ -750,7 +750,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index acfe15c18..e9b85b1d8 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -509,27 +509,27 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED)/10 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED)/10 + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY @@ -744,7 +744,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 34fcddc73..58964a191 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -510,29 +510,29 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED/10) + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10) #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) // Raise things back up slightly so we don't bump into anything #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_TRAVEL_SPEED/2) + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) #endif // Z_PROBE_ALLEN_KEY @@ -747,7 +747,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 10bc94887..8dbfedf1f 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -501,32 +501,32 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00 #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_TRAVEL_SPEED)/2 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE (XY_PROBE_SPEED)/2 #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip #define Z_PROBE_ALLEN_KEY_STOW_1_Y -125.00 #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X // move down to retract probe #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y #define Z_PROBE_ALLEN_KEY_STOW_2_Z 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED)/2 + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/2 #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_TRAVEL_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY @@ -741,7 +741,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 1c295bd51..3bd11df10 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -507,27 +507,27 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 - //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED + //#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED)/10 + //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 //#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position //#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 //#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 - //#define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED + //#define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED //#define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down //#define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 //#define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 - //#define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED)/10 + //#define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 //#define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear //#define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 //#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 - //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_TRAVEL_SPEED + //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY @@ -742,7 +742,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 10 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 76bc85cca..8f7e00c60 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -670,7 +670,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index e79d722cc..201da3934 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -657,7 +657,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. + #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. From d50539583a087c45cab006255b655f2cebf27144 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 02:44:55 -0700 Subject: [PATCH 145/580] Make XY_PROBE_SPEED a general probe option --- Marlin/Configuration.h | 5 +++-- Marlin/Marlin_main.cpp | 2 ++ Marlin/example_configurations/Cartesio/Configuration.h | 5 +++-- Marlin/example_configurations/Felix/Configuration.h | 5 +++-- Marlin/example_configurations/Felix/DUAL/Configuration.h | 5 +++-- Marlin/example_configurations/Hephestos/Configuration.h | 5 +++-- Marlin/example_configurations/Hephestos_2/Configuration.h | 5 +++-- Marlin/example_configurations/K8200/Configuration.h | 5 +++-- .../RepRapWorld/Megatronics/Configuration.h | 5 +++-- Marlin/example_configurations/RigidBot/Configuration.h | 5 +++-- Marlin/example_configurations/SCARA/Configuration.h | 5 +++-- Marlin/example_configurations/TAZ4/Configuration.h | 5 +++-- Marlin/example_configurations/WITBOX/Configuration.h | 5 +++-- .../example_configurations/adafruit/ST7565/Configuration.h | 5 +++-- Marlin/example_configurations/delta/biv2.5/Configuration.h | 5 +++-- Marlin/example_configurations/delta/generic/Configuration.h | 5 +++-- .../example_configurations/delta/kossel_mini/Configuration.h | 5 +++-- .../example_configurations/delta/kossel_pro/Configuration.h | 5 +++-- .../example_configurations/delta/kossel_xl/Configuration.h | 5 +++-- Marlin/example_configurations/makibox/Configuration.h | 5 +++-- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 5 +++-- 21 files changed, 62 insertions(+), 40 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d1016a446..a55c878c1 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -456,6 +456,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -667,8 +670,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 389f06e2c..ad83f42ea 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -370,6 +370,8 @@ static uint8_t target_extruder; int xy_probe_speed = XY_PROBE_SPEED; bool bed_leveling_in_progress = false; #define XY_PROBE_FEEDRATE xy_probe_speed +#elif defined(XY_PROBE_SPEED) + #define XY_PROBE_FEEDRATE XY_PROBE_SPEED #else #define XY_PROBE_FEEDRATE (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60) #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index e3e481312..5eebcb077 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -455,6 +455,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -666,8 +669,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 703bf4e1d..fce00f7e0 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -438,6 +438,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -649,8 +652,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index a4f82c77b..4881d29a0 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -436,6 +436,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -647,8 +650,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 8a449cb43..91d879da4 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -448,6 +448,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -659,8 +662,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 4a63d71e7..dce0c97ee 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -450,6 +450,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -661,8 +664,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 2 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 4166cd6ee..0431ff3b3 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -473,6 +473,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -684,8 +687,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index ea93c599d..b84730898 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -456,6 +456,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -667,8 +670,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 36f6ba090..7d8425515 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -450,6 +450,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -661,8 +664,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 147c914e7..7bb2c7d7b 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -464,6 +464,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -675,8 +678,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 201ea0a10..fbaed6a81 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -477,6 +477,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -688,8 +691,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index f8fc195ba..1fa1f66b3 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -448,6 +448,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -659,8 +662,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 30fa688ec..1d2423232 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -456,6 +456,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -667,8 +670,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 25a3f0964..527e917f9 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -498,6 +498,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 4000 + // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. //#define Z_PROBE_ALLEN_KEY @@ -750,8 +753,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index e9b85b1d8..c870c8a10 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -498,6 +498,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 4000 + // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. //#define Z_PROBE_ALLEN_KEY @@ -744,8 +747,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 58964a191..2052ccf67 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -498,6 +498,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 4000 + // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. #define Z_PROBE_ALLEN_KEY @@ -747,8 +750,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 4000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 8dbfedf1f..64c242bb9 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -489,6 +489,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed. #define Z_PROBE_OFFSET_FROM_EXTRUDER -17.25 // Increase this if the first layer is too thin (remember: it's a negative number so increase means closer to zero). +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. #define Z_PROBE_ALLEN_KEY @@ -741,8 +744,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 3bd11df10..a992ffbf3 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -496,6 +496,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle Y offset: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.3 // Z probe to nozzle Z offset: -below (always!) +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. //#define Z_PROBE_ALLEN_KEY @@ -742,8 +745,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 10 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 8f7e00c60..af2b9f9f9 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -459,6 +459,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -670,8 +673,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 201da3934..efbc931cc 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -446,6 +446,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + // // Allen Key Probe is defined in the Delta example configurations. // @@ -657,8 +660,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define XY_PROBE_SPEED 8000 // X and Y axis travel speed between probes, in mm/min. - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. From bd99a2bcff49038899466d8a60305bfede1a8745 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 03:06:54 -0700 Subject: [PATCH 146/580] Add a Travis test of Z Safe Homing without ABL --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 900d438ee..eacedee8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,10 +90,10 @@ script: - opt_enable PIDTEMPBED - build_marlin # - # Test a "Fix Mounted" Probe + # Test a "Fix Mounted" Probe along with Safe Homing # - restore_configs - - opt_enable FIX_MOUNTED_PROBE + - opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING - build_marlin # # ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE From 07298ac992098d6fd9979c14d4bdffcd430ed562 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 14:58:42 -0700 Subject: [PATCH 147/580] Initialize current_position to home_offset on boot --- Marlin/Marlin_main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ad83f42ea..756ff7cc3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -861,13 +861,16 @@ void setup() { // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) Config_RetrieveSettings(); - thermalManager.init(); // Initialize temperature loop + // Initialize current position based on home_offset + memcpy(current_position, home_offset, sizeof(home_offset)); #if ENABLED(DELTA) || ENABLED(SCARA) // Vital to init kinematic equivalent for X0 Y0 Z0 sync_plan_position_delta(); #endif + thermalManager.init(); // Initialize temperature loop + #if ENABLED(USE_WATCHDOG) watchdog_init(); #endif @@ -918,8 +921,6 @@ void setup() { lcd_init(); #endif #endif - - } /** From 9f0c255c698b6f960abad57054f1d203e7f3a58e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 15:02:32 -0700 Subject: [PATCH 148/580] Show uncorrected position in set_bed_level_equation_3pts --- Marlin/Marlin_main.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 756ff7cc3..2abf2d5cf 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2085,6 +2085,13 @@ static void setup_for_endstop_move() { planner.bed_level_matrix.set_to_identity(); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + vector_3 uncorrected_position = planner.adjusted_position(); + DEBUG_POS("set_bed_level_equation_3pts", uncorrected_position); + } + #endif + vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); @@ -2097,16 +2104,8 @@ static void setup_for_endstop_move() { } planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - vector_3 corrected_position = planner.adjusted_position(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - vector_3 uncorrected_position = corrected_position; - DEBUG_POS("set_bed_level_equation_3pts", uncorrected_position); - } - #endif - current_position[X_AXIS] = corrected_position.x; current_position[Y_AXIS] = corrected_position.y; current_position[Z_AXIS] = corrected_position.z; From c3023f8cc56052f3bd46f12afe3bffcf674cf922 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 15:04:09 -0700 Subject: [PATCH 149/580] Make M401/M402 available with HAS_BED_PROBE --- Marlin/Marlin_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2abf2d5cf..ba5513b78 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5949,7 +5949,7 @@ inline void gcode_M303() { */ inline void gcode_M400() { stepper.synchronize(); } -#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY)) +#if HAS_BED_PROBE /** * M401: Engage Z Servo endstop if available @@ -5965,7 +5965,7 @@ inline void gcode_M400() { stepper.synchronize(); } stow_z_probe(); } -#endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_SERVO_ENDSTOP || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED +#endif // HAS_BED_PROBE #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -7262,14 +7262,14 @@ void process_next_command() { gcode_M400(); break; - #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) + #if HAS_BED_PROBE case 401: gcode_M401(); break; case 402: gcode_M402(); break; - #endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_SERVO_ENDSTOP || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED + #endif // HAS_BED_PROBE #if ENABLED(FILAMENT_WIDTH_SENSOR) case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width From 68e0e5855eee065443fedd73c116a587167fd501 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 15:11:56 -0700 Subject: [PATCH 150/580] For all probes, at the end of G29 simply raise and stow --- Marlin/Marlin_main.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ba5513b78..fc500eb6c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3788,17 +3788,14 @@ inline void gcode_G28() { if (DEBUGGING(LEVELING)) DEBUG_POS("> corrected Z in G29", current_position); #endif } + #endif // !DELTA - #if DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) && !HAS_Z_SERVO_ENDSTOP - raise_z_after_probing(); - #endif + // Final raise of Z axis after probing. + raise_z_after_probing(); - #if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(MECHANICAL_PROBE) - stow_z_probe(); - #else - endstops.enable_z_probe(false); - #endif + // Stow the probe. Servo will raise if needed. + stow_z_probe(); #ifdef Z_PROBE_END_SCRIPT #if ENABLED(DEBUG_LEVELING_FEATURE) From 1a92e2ef186d6a05dc4f4fd6638220c9bbb1dac9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 15:14:04 -0700 Subject: [PATCH 151/580] Comment on run_z_probe --- Marlin/Marlin_main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index fc500eb6c..4a18ff759 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1954,14 +1954,13 @@ static void setup_for_endstop_move() { endstops.enable_z_probe(false); } + // Do a single Z probe and return with current_position[Z_AXIS] + // at the height where the probe triggered. static void run_z_probe() { float old_feedrate = feedrate; - /** - * To prevent stepper_inactive_time from running out and - * EXTRUDER_RUNOUT_PREVENT from extruding - */ + // Prevent stepper_inactive_time from running out and EXTRUDER_RUNOUT_PREVENT from extruding refresh_cmd_timeout(); #if ENABLED(DELTA) From 0e18a4897b88146aad5931a8b649847c2c7d2b48 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 15:15:59 -0700 Subject: [PATCH 152/580] Simpler handling of sled/allen-key in probe_pt --- Marlin/Marlin_main.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4a18ff759..aa6d2316d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2163,26 +2163,27 @@ static void setup_for_endstop_move() { // this also updates current_position do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); - #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY) - if (probe_action & ProbeDeploy) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy"); - #endif - deploy_z_probe(); - } + // Z Sled and Allen Key should never deploy-and-stow + #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) + if (probe_action == ProbeDeployAndStow) probe_action == ProbeStay; #endif + if (probe_action & ProbeDeploy) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy"); + #endif + deploy_z_probe(); + } + run_z_probe(); float measured_z = current_position[Z_AXIS]; - #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY) - if (probe_action & ProbeStow) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeStow (stow_z_probe will do Z Raise)"); - #endif - stow_z_probe(); - } - #endif + if (probe_action & ProbeStow) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeStow (stow_z_probe will do Z Raise)"); + #endif + stow_z_probe(); + } if (verbose_level > 2) { SERIAL_PROTOCOLPGM("Bed X: "); From e69916d1bde5f990cb186cd91ab147caa462c72f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 15:32:28 -0700 Subject: [PATCH 153/580] Split up endstop_move functions --- Marlin/Marlin_main.cpp | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index aa6d2316d..50c9d204a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1582,34 +1582,40 @@ inline void set_destination_to_current() { memcpy(destination, current_position, // // - Save current feedrates // - Reset the rate multiplier -// - Enable the endstops // - Reset the command timeout +// - Enable the endstops (for endstop moves) // // clean_up_after_endstop_move() restores // feedrates, sets endstops back to global state. // -static void setup_for_endstop_move() { +static void setup_for_endstop_or_probe_move() { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position); + #endif saved_feedrate = feedrate; saved_feedrate_multiplier = feedrate_multiplier; feedrate_multiplier = 100; refresh_cmd_timeout(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("setup_for_endstop_move > endstops.enable()"); - #endif +} +static void setup_for_endstop_move() { + setup_for_endstop_or_probe_move(); endstops.enable(); } #if HAS_BED_PROBE - static void clean_up_after_endstop_move() { + static void clean_up_after_endstop_or_probe_move() { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("clean_up_after_endstop_move > endstops.not_homing()"); + if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position); #endif - endstops.not_homing(); feedrate = saved_feedrate; feedrate_multiplier = saved_feedrate_multiplier; refresh_cmd_timeout(); } + static void clean_up_after_endstop_move() { + clean_up_after_endstop_or_probe_move(); + endstops.not_homing(); + } #if ENABLED(DELTA) /** @@ -3475,7 +3481,7 @@ inline void gcode_G28() { stepper.synchronize(); - setup_for_endstop_move(); + setup_for_endstop_or_probe_move(); feedrate = homing_feedrate[Z_AXIS]; @@ -3589,7 +3595,7 @@ inline void gcode_G28() { if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position); #endif - clean_up_after_endstop_move(); + clean_up_after_endstop_or_probe_move(); #if ENABLED(DELTA) @@ -3715,7 +3721,7 @@ inline void gcode_G28() { ABL_PROBE_PT_3_Y + home_offset[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p3, verbose_level); - clean_up_after_endstop_move(); + clean_up_after_endstop_or_probe_move(); if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); #endif // !AUTO_BED_LEVELING_GRID @@ -3830,7 +3836,7 @@ inline void gcode_G28() { */ inline void gcode_G30() { - setup_for_endstop_move(); + setup_for_endstop_or_probe_move(); deploy_z_probe(); @@ -3849,7 +3855,7 @@ inline void gcode_G28() { stow_z_probe(); - clean_up_after_endstop_move(); + clean_up_after_endstop_or_probe_move(); report_current_position(); } @@ -4259,7 +4265,7 @@ inline void gcode_M42() { * OK, do the initial probe to get us close to the bed. * Then retrace the right amount and use that in subsequent probes */ - setup_for_endstop_move(); + setup_for_endstop_or_probe_move(); // Height before each probe (except the first) float z_between = home_offset[Z_AXIS] + (deploy_probe_for_each_reading ? Z_RAISE_BEFORE_PROBING : Z_RAISE_BETWEEN_PROBINGS); @@ -4413,7 +4419,7 @@ inline void gcode_M42() { SERIAL_PROTOCOL_F(sigma, 6); SERIAL_EOL; SERIAL_EOL; - clean_up_after_endstop_move(); + clean_up_after_endstop_or_probe_move(); report_current_position(); } From a6b8c67df4d27ebc0a346e88cfe3646b035a2582 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 16:03:02 -0700 Subject: [PATCH 154/580] Move probe deploy after setup call in G29 --- Marlin/Marlin_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 50c9d204a..7270e96be 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3475,14 +3475,14 @@ inline void gcode_G28() { #endif // !DELTA } - #if HAS_BED_PROBE - deploy_z_probe(); - #endif - stepper.synchronize(); setup_for_endstop_or_probe_move(); + #if HAS_BED_PROBE + deploy_z_probe(); + #endif + feedrate = homing_feedrate[Z_AXIS]; bed_leveling_in_progress = true; From bfccf26294e716479e5fbb4697efac3014a3b26b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 16:17:48 -0700 Subject: [PATCH 155/580] Use sync_plan_position_delta where needed --- Marlin/Marlin_main.cpp | 70 +++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7270e96be..e935aa5e6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2035,7 +2035,12 @@ static void setup_for_endstop_move() { // Get the current stepper position after bumping an endstop current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); - sync_plan_position(); + + #if ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position); @@ -2079,7 +2084,11 @@ static void setup_for_endstop_move() { if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", corrected_position); #endif - sync_plan_position(); + #if ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif } #endif // !DELTA @@ -2119,7 +2128,11 @@ static void setup_for_endstop_move() { if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", corrected_position); #endif - sync_plan_position(); + #if ENABLED(DELTA) || ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif } #endif // !AUTO_BED_LEVELING_GRID @@ -2321,7 +2334,11 @@ static void homeaxis(AxisEnum axis) { // Set the axis position as setup for the move current_position[axis] = 0; - sync_plan_position(); + #if ENABLED(DELTA) || ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif // Homing Z towards the bed? Deploy the Z probe or endstop. #if HAS_BED_PROBE @@ -2346,7 +2363,11 @@ static void homeaxis(AxisEnum axis) { // Set the axis position as setup for the move current_position[axis] = 0; - sync_plan_position(); + #if ENABLED(DELTA) || ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)"); @@ -2407,7 +2428,7 @@ static void homeaxis(AxisEnum axis) { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)"); #endif endstops.enable(false); // Disable endstops while moving away - sync_plan_position(); + sync_plan_position_delta(); destination[axis] = endstop_adj[axis]; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -2434,7 +2455,12 @@ static void homeaxis(AxisEnum axis) { // Set the axis position to its home position (plus home offsets) set_axis_is_at_home(axis); - sync_plan_position(); + + #if ENABLED(DELTA) || ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position); @@ -2485,7 +2511,7 @@ static void homeaxis(AxisEnum axis) { if (retract_zlift > 0.01) { current_position[Z_AXIS] -= retract_zlift; - #if ENABLED(DELTA) + #if ENABLED(DELTA) || ENABLED(SCARA) sync_plan_position_delta(); #else sync_plan_position(); @@ -2497,7 +2523,7 @@ static void homeaxis(AxisEnum axis) { if (retract_zlift > 0.01) { current_position[Z_AXIS] += retract_zlift; - #if ENABLED(DELTA) + #if ENABLED(DELTA) || ENABLED(SCARA) sync_plan_position_delta(); #else sync_plan_position(); @@ -3056,13 +3082,13 @@ inline void gcode_G28() { #endif // Z_HOME_DIR < 0 - sync_plan_position(); - - #endif // else DELTA + #if ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif - #if ENABLED(SCARA) - sync_plan_position_delta(); - #endif + #endif // !DELTA (gcode_G28) #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING) endstops.enable(false); @@ -3470,7 +3496,11 @@ inline void gcode_G28() { if (DEBUGGING(LEVELING)) DEBUG_POS("AFTER matrix.set_to_identity", uncorrected_position); #endif - sync_plan_position(); + #if ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif #endif // !DELTA } @@ -3788,7 +3818,11 @@ inline void gcode_G28() { #endif ; // current_position[Z_AXIS] += home_offset[Z_AXIS]; // The Z probe determines Z=0, not "Z home" - sync_plan_position(); + #if ENABLED(SCARA) + sync_plan_position_delta(); + #else + sync_plan_position(); + #endif #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> corrected Z in G29", current_position); @@ -6707,7 +6741,7 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif // !DUAL_X_CARRIAGE // Tell the planner the new "current position" - #if ENABLED(DELTA) + #if ENABLED(DELTA) || ENABLED(SCARA) sync_plan_position_delta(); #else sync_plan_position(); From b4a9d2366cdf26941f854ce7c206a0b892d6e3e0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 18:56:25 -0700 Subject: [PATCH 156/580] Use a macro for kinematic sync_plan_position --- Marlin/Marlin_main.cpp | 121 +++++++++++------------------------------ 1 file changed, 33 insertions(+), 88 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e935aa5e6..870766687 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -582,6 +582,9 @@ static void report_current_position(); calculate_delta(current_position); planner.set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); } + #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position_delta() +#else + #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position() #endif #if ENABLED(SDSUPPORT) @@ -866,7 +869,7 @@ void setup() { #if ENABLED(DELTA) || ENABLED(SCARA) // Vital to init kinematic equivalent for X0 Y0 Z0 - sync_plan_position_delta(); + SYNC_PLAN_POSITION_KINEMATIC(); #endif thermalManager.init(); // Initialize temperature loop @@ -1997,7 +2000,7 @@ static void setup_for_endstop_move() { if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position); #endif - sync_plan_position_delta(); + SYNC_PLAN_POSITION_KINEMATIC(); #else // !DELTA @@ -2036,11 +2039,7 @@ static void setup_for_endstop_move() { // Get the current stepper position after bumping an endstop current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); - #if ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position); @@ -2084,11 +2083,7 @@ static void setup_for_endstop_move() { if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", corrected_position); #endif - #if ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); } #endif // !DELTA @@ -2128,11 +2123,7 @@ static void setup_for_endstop_move() { if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", corrected_position); #endif - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); } #endif // !AUTO_BED_LEVELING_GRID @@ -2334,11 +2325,7 @@ static void homeaxis(AxisEnum axis) { // Set the axis position as setup for the move current_position[axis] = 0; - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); // Homing Z towards the bed? Deploy the Z probe or endstop. #if HAS_BED_PROBE @@ -2363,11 +2350,7 @@ static void homeaxis(AxisEnum axis) { // Set the axis position as setup for the move current_position[axis] = 0; - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)"); @@ -2408,7 +2391,7 @@ static void homeaxis(AxisEnum axis) { lockZ1 = (z_endstop_adj < 0); if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); // Move to the adjusted endstop height feedrate = homing_feedrate[axis]; @@ -2428,7 +2411,7 @@ static void homeaxis(AxisEnum axis) { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)"); #endif endstops.enable(false); // Disable endstops while moving away - sync_plan_position_delta(); + SYNC_PLAN_POSITION_KINEMATIC(); destination[axis] = endstop_adj[axis]; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -2456,11 +2439,7 @@ static void homeaxis(AxisEnum axis) { // Set the axis position to its home position (plus home offsets) set_axis_is_at_home(axis); - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position); @@ -2511,11 +2490,7 @@ static void homeaxis(AxisEnum axis) { if (retract_zlift > 0.01) { current_position[Z_AXIS] -= retract_zlift; - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); prepare_move_to_destination(); } } @@ -2523,11 +2498,7 @@ static void homeaxis(AxisEnum axis) { if (retract_zlift > 0.01) { current_position[Z_AXIS] += retract_zlift; - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); } feedrate = retract_recover_feedrate * 60; @@ -2838,7 +2809,7 @@ inline void gcode_G28() { HOMEAXIS(Y); HOMEAXIS(Z); - sync_plan_position_delta(); + SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("(DELTA)", current_position); @@ -2900,7 +2871,7 @@ inline void gcode_G28() { int x_axis_home_dir = home_dir(X_AXIS); #endif - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), mlratio = mlx > mly ? mly / mlx : mlx / mly; @@ -2913,7 +2884,7 @@ inline void gcode_G28() { set_axis_is_at_home(X_AXIS); set_axis_is_at_home(Y_AXIS); - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 1", current_position); @@ -2997,7 +2968,7 @@ inline void gcode_G28() { * enough to reach Z_SAFE_HOMING XY positions. * Just make sure the planner is in sync. */ - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); /** * Set the Z probe (or just the nozzle) destination to the safe @@ -3082,11 +3053,7 @@ inline void gcode_G28() { #endif // Z_HOME_DIR < 0 - #if ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); #endif // !DELTA (gcode_G28) @@ -3104,7 +3071,7 @@ inline void gcode_G28() { if (mbl.has_mesh()) { if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) { current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); mbl.set_active(true); #if ENABLED(MESH_G28_REST_ORIGIN) current_position[Z_AXIS] = 0.0; @@ -3120,7 +3087,7 @@ inline void gcode_G28() { } else if ((axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) && (homeX || homeY)) { current_position[Z_AXIS] = pre_home_z; - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); mbl.set_active(true); current_position[Z_AXIS] = pre_home_z - mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], @@ -3248,7 +3215,7 @@ inline void gcode_G28() { if (probe_point == 0) { // For the intial G29 S2 make Z a positive value (e.g., 4.0) current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); } else { // For G29 S2 after adjusting Z. @@ -3328,7 +3295,7 @@ inline void gcode_G28() { mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], current_position[Y_AXIS] - home_offset[Y_AXIS]) - MESH_HOME_SEARCH_Z; mbl.reset(); - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); } else mbl.reset(); @@ -3496,11 +3463,7 @@ inline void gcode_G28() { if (DEBUGGING(LEVELING)) DEBUG_POS("AFTER matrix.set_to_identity", uncorrected_position); #endif - #if ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); #endif // !DELTA } @@ -3818,11 +3781,7 @@ inline void gcode_G28() { #endif ; // current_position[Z_AXIS] += home_offset[Z_AXIS]; // The Z probe determines Z=0, not "Z home" - #if ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> corrected Z in G29", current_position); @@ -3919,16 +3878,10 @@ inline void gcode_G92() { } } } - if (didXYZ) { - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif - } - else if (didE) { + if (didXYZ) + SYNC_PLAN_POSITION_KINEMATIC(); + else if (didE) sync_plan_position_e(); - } } #if ENABLED(ULTIPANEL) @@ -5420,7 +5373,7 @@ inline void gcode_M206() { if (code_seen('P')) set_home_offset(Y_AXIS, code_value_axis_units(Y_AXIS)); // Psi #endif - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); report_current_position(); } @@ -6171,11 +6124,7 @@ inline void gcode_M428() { } if (!err) { - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); report_current_position(); LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); #if HAS_BUZZER @@ -6741,11 +6690,7 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif // !DUAL_X_CARRIAGE // Tell the planner the new "current position" - #if ENABLED(DELTA) || ENABLED(SCARA) - sync_plan_position_delta(); - #else - sync_plan_position(); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); // Move to the "old position" (move the extruder into place) if (!no_move && IsRunning()) prepare_move_to_destination(); @@ -7694,7 +7639,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[X_AXIS], 1); - sync_plan_position(); + SYNC_PLAN_POSITION_KINEMATIC(); stepper.synchronize(); extruder_duplication_enabled = true; active_extruder_parked = false; From ccae92588d50953ed06f47009414e087248c4296 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 16:18:19 -0700 Subject: [PATCH 157/580] Cleanup debug in G28 and G29 --- Marlin/Marlin_main.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 870766687..dabbc93b1 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3102,9 +3102,7 @@ inline void gcode_G28() { endstops.hit_on_purpose(); // clear endstop hit flags #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("<<< gcode_G28"); - } + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28"); #endif report_current_position(); @@ -3689,9 +3687,7 @@ inline void gcode_G28() { #else // !AUTO_BED_LEVELING_GRID #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("> 3-point Leveling"); - } + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling"); #endif // Actions for each probe From 5158bd6e93690e87510eb2603c7d2f71c7917bc2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2016 21:01:01 -0700 Subject: [PATCH 158/580] Screen out `G29 E` for sled and allen key, allow single probe --- Marlin/Marlin_main.cpp | 62 ++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index dabbc93b1..ca82f3fa8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2173,11 +2173,6 @@ static void setup_for_endstop_move() { // this also updates current_position do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); - // Z Sled and Allen Key should never deploy-and-stow - #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) - if (probe_action == ProbeDeployAndStow) probe_action == ProbeStay; - #endif - if (probe_action & ProbeDeploy) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy"); @@ -3370,8 +3365,11 @@ inline void gcode_G28() { return; } - bool dryrun = code_seen('D'), - deploy_probe_for_each_reading = code_seen('E'); + bool dryrun = code_seen('D'); + + #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY) + bool deploy_probe_for_each_reading = code_seen('E'); + #endif #if ENABLED(AUTO_BED_LEVELING_GRID) @@ -3470,9 +3468,8 @@ inline void gcode_G28() { setup_for_endstop_or_probe_move(); - #if HAS_BED_PROBE - deploy_z_probe(); - #endif + // Deploy the probe. Servo will raise if needed. + deploy_z_probe(); feedrate = homing_feedrate[Z_AXIS]; @@ -3551,15 +3548,19 @@ inline void gcode_G28() { if (distance_from_center > DELTA_PROBEABLE_RADIUS) continue; #endif //DELTA - ProbeAction act; - if (deploy_probe_for_each_reading) // G29 E - Stow between probes - act = ProbeDeployAndStow; - else if (yCount == 0 && xCount == xStart) - act = ProbeDeploy; - else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc) - act = ProbeStow; - else - act = ProbeStay; + #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) + const ProbeAction act = ProbeStay; + #else + ProbeAction act; + if (deploy_probe_for_each_reading) // G29 E - Stow between probes + act = ProbeDeployAndStow; + else if (yCount == 0 && xCount == xStart) + act = ProbeDeploy; + else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc) + act = ProbeStow; + else + act = ProbeStay; + #endif measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level); @@ -3690,12 +3691,16 @@ inline void gcode_G28() { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling"); #endif - // Actions for each probe - ProbeAction p1, p2, p3; - if (deploy_probe_for_each_reading) - p1 = p2 = p3 = ProbeDeployAndStow; - else - p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow; + #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) + const ProbeAction p1 = ProbeStay, p2 = ProbeStay, p3 = ProbeStay; + #else + // Actions for each probe + ProbeAction p1, p2, p3; + if (deploy_probe_for_each_reading) + p1 = p2 = p3 = ProbeDeployAndStow; + else + p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow; + #endif // Probe at 3 arbitrary points float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS], @@ -4189,7 +4194,12 @@ inline void gcode_M42() { float X_current = current_position[X_AXIS], Y_current = current_position[Y_AXIS], Z_start_location = current_position[Z_AXIS] + Z_RAISE_BEFORE_PROBING; - bool deploy_probe_for_each_reading = code_seen('E'); + + #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) + const bool deploy_probe_for_each_reading = false; + #else + bool deploy_probe_for_each_reading = code_seen('E'); + #endif float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER; #if DISABLED(DELTA) From bb9c67b4b59c8e1db7858acda5993f05e390fb26 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 03:27:31 -0700 Subject: [PATCH 159/580] Tweak some feedrate vars --- Marlin/Marlin.h | 2 +- Marlin/Marlin_main.cpp | 12 ++++++------ Marlin/configuration_store.cpp | 10 +++++----- Marlin/ultralcd.cpp | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index b99c3fb9b..17a1c421b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -352,7 +352,7 @@ float code_value_temp_diff(); #if ENABLED(FWRETRACT) extern bool autoretract_enabled; extern bool retracted[EXTRUDERS]; // extruder[n].retracted - extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift; + extern float retract_length, retract_length_swap, retract_feedrate_mm_s, retract_zlift; extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate; #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ca82f3fa8..cf61bd746 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -414,7 +414,7 @@ static uint8_t target_extruder; float retract_length = RETRACT_LENGTH; float retract_length_swap = RETRACT_LENGTH_SWAP; - float retract_feedrate = RETRACT_FEEDRATE; + float retract_feedrate_mm_s = RETRACT_FEEDRATE; float retract_zlift = RETRACT_ZLIFT; float retract_recover_length = RETRACT_RECOVER_LENGTH; float retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP; @@ -2472,13 +2472,13 @@ static void homeaxis(AxisEnum axis) { if (retracting == retracted[active_extruder]) return; - float oldFeedrate = feedrate; + float old_feedrate = feedrate; set_destination_to_current(); if (retracting) { - feedrate = retract_feedrate * 60; + feedrate = retract_feedrate_mm_s * 60; current_position[E_AXIS] += (swapping ? retract_length_swap : retract_length) / volumetric_multiplier[active_extruder]; sync_plan_position_e(); prepare_move_to_destination(); @@ -2503,7 +2503,7 @@ static void homeaxis(AxisEnum axis) { prepare_move_to_destination(); } - feedrate = oldFeedrate; + feedrate = old_feedrate; retracted[active_extruder] = retracting; } // retract() @@ -5452,12 +5452,12 @@ inline void gcode_M206() { * * S[+mm] retract_length * W[+mm] retract_length_swap (multi-extruder) - * F[mm/min] retract_feedrate + * F[mm/min] retract_feedrate_mm_s * Z[mm] retract_zlift */ inline void gcode_M207() { if (code_seen('S')) retract_length = code_value_axis_units(E_AXIS); - if (code_seen('F')) retract_feedrate = code_value_axis_units(E_AXIS) / 60; + if (code_seen('F')) retract_feedrate_mm_s = code_value_axis_units(E_AXIS) / 60; if (code_seen('Z')) retract_zlift = code_value_axis_units(Z_AXIS); #if EXTRUDERS > 1 if (code_seen('W')) retract_length_swap = code_value_axis_units(E_AXIS); diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 4bad3ce0c..3def1c3eb 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -107,7 +107,7 @@ * 391 M209 S autoretract_enabled (bool) * 392 M207 S retract_length (float) * 396 M207 W retract_length_swap (float) - * 400 M207 F retract_feedrate (float) + * 400 M207 F retract_feedrate_mm_s (float) * 404 M207 Z retract_zlift (float) * 408 M208 S retract_recover_length (float) * 412 M208 W retract_recover_length_swap (float) @@ -304,7 +304,7 @@ void Config_StoreSettings() { dummy = 0.0f; EEPROM_WRITE_VAR(i, dummy); #endif - EEPROM_WRITE_VAR(i, retract_feedrate); + EEPROM_WRITE_VAR(i, retract_feedrate_mm_s); EEPROM_WRITE_VAR(i, retract_zlift); EEPROM_WRITE_VAR(i, retract_recover_length); #if EXTRUDERS > 1 @@ -482,7 +482,7 @@ void Config_RetrieveSettings() { #else EEPROM_READ_VAR(i, dummy); #endif - EEPROM_READ_VAR(i, retract_feedrate); + EEPROM_READ_VAR(i, retract_feedrate_mm_s); EEPROM_READ_VAR(i, retract_zlift); EEPROM_READ_VAR(i, retract_recover_length); #if EXTRUDERS > 1 @@ -617,7 +617,7 @@ void Config_ResetDefault() { #if EXTRUDERS > 1 retract_length_swap = RETRACT_LENGTH_SWAP; #endif - retract_feedrate = RETRACT_FEEDRATE; + retract_feedrate_mm_s = RETRACT_FEEDRATE; retract_zlift = RETRACT_ZLIFT; retract_recover_length = RETRACT_RECOVER_LENGTH; #if EXTRUDERS > 1 @@ -864,7 +864,7 @@ void Config_PrintSettings(bool forReplay) { #if EXTRUDERS > 1 SERIAL_ECHOPAIR(" W", retract_length_swap); #endif - SERIAL_ECHOPAIR(" F", retract_feedrate * 60); + SERIAL_ECHOPAIR(" F", retract_feedrate_mm_s * 60); SERIAL_ECHOPAIR(" Z", retract_zlift); SERIAL_EOL; CONFIG_ECHO_START; diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 6f5990aca..3b33a97a6 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1797,7 +1797,7 @@ static void lcd_status_screen() { #if EXTRUDERS > 1 MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_SWAP, &retract_length_swap, 0, 100); #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate, 1, 999); + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &retract_feedrate_mm_s, 1, 999); MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_ZLIFT, &retract_zlift, 0, 999); MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER, &retract_recover_length, 0, 100); #if EXTRUDERS > 1 From b590a7dee040b4d191fc6b95ee236791e969d878 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 14:00:44 -0700 Subject: [PATCH 160/580] Make Z_RAISE_BETWEEN_PROBINGS a more general option --- Marlin/Configuration.h | 3 +-- Marlin/example_configurations/Cartesio/Configuration.h | 3 +-- Marlin/example_configurations/Felix/Configuration.h | 3 +-- Marlin/example_configurations/Felix/DUAL/Configuration.h | 3 +-- Marlin/example_configurations/Hephestos/Configuration.h | 3 +-- Marlin/example_configurations/Hephestos_2/Configuration.h | 3 +-- Marlin/example_configurations/K8200/Configuration.h | 3 +-- .../RepRapWorld/Megatronics/Configuration.h | 3 +-- Marlin/example_configurations/RigidBot/Configuration.h | 3 +-- Marlin/example_configurations/SCARA/Configuration.h | 3 +-- Marlin/example_configurations/TAZ4/Configuration.h | 3 +-- Marlin/example_configurations/WITBOX/Configuration.h | 3 +-- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 3 +-- Marlin/example_configurations/delta/biv2.5/Configuration.h | 3 +-- Marlin/example_configurations/delta/generic/Configuration.h | 3 +-- .../example_configurations/delta/kossel_mini/Configuration.h | 3 +-- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 3 +-- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 3 +-- Marlin/example_configurations/makibox/Configuration.h | 3 +-- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 3 +-- 20 files changed, 20 insertions(+), 40 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a55c878c1..14d63a6cb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -517,6 +517,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -670,8 +671,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 5eebcb077..da5c9a011 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -516,6 +516,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -669,8 +670,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index fce00f7e0..eb5068c26 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -499,6 +499,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -652,8 +653,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 4881d29a0..959981c9b 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -497,6 +497,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -650,8 +651,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 91d879da4..4b72240db 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -509,6 +509,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -662,8 +663,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index dce0c97ee..50eb96c08 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -511,6 +511,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 5 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 5 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 2 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -664,8 +665,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 2 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 0431ff3b3..aaeed3c7d 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -534,6 +534,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -687,8 +688,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index b84730898..56acd002f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -517,6 +517,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -670,8 +671,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 7d8425515..6ea37ef1b 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -511,6 +511,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -664,8 +665,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 7bb2c7d7b..91ce78a33 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -525,6 +525,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -678,8 +679,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index fbaed6a81..50b5f4652 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -538,6 +538,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -691,8 +692,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 1fa1f66b3..884c4bbbf 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -509,6 +509,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -662,8 +663,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 1d2423232..35ca9f9ff 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -517,6 +517,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -670,8 +671,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 527e917f9..074faa4ff 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -753,8 +754,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index c870c8a10..3f8eb0a4b 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -590,6 +590,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -747,8 +748,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 2052ccf67..569b1b34a 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -593,6 +593,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -750,8 +751,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 64c242bb9..3925f3334 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -587,6 +587,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 100 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -744,8 +745,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index a992ffbf3..b0267349e 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -588,6 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 20 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 20 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 10 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -745,8 +746,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 10 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index af2b9f9f9..8ec948195 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -520,6 +520,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -673,8 +674,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index efbc931cc..5eb34e2b7 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -507,6 +507,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // For G29 these apply before and after the full procedure. #define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). #define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset @@ -660,8 +661,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #endif // !AUTO_BED_LEVELING_GRID - #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. - //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. From 42ce60c5cc4dfb44b4ba1348b6dc953818905b04 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 14:01:19 -0700 Subject: [PATCH 161/580] Make sure NUM_SERVOS is set for Z servo endstop --- Marlin/SanityCheck.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index a757f8a29..91c4c7bd0 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -233,6 +233,17 @@ #if PROBE_SELECTED + /** + * NUM_SERVOS is required for a Z servo probe + */ + #if HAS_Z_SERVO_ENDSTOP + #ifndef NUM_SERVOS + #error "You must set NUM_SERVOS for a Z servo probe (Z_ENDSTOP_SERVO_NR)." + #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS + #error "Z_ENDSTOP_SERVO_NR must be less than NUM_SERVOS." + #endif + #endif + /** * A probe needs a pin */ From c3794bd6950e831a97f491441c69cebc8275935e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 14:03:22 -0700 Subject: [PATCH 162/580] Add HAS_PROBING_PROCEDURE conditional --- Marlin/Conditionals.h | 6 +- Marlin/Marlin_main.cpp | 200 +++++++++++++++++++++-------------------- 2 files changed, 108 insertions(+), 98 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index ad7d23cc4..c997fbbaf 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -363,9 +363,11 @@ #endif //!MANUAL_HOME_POSITIONS /** - * Auto Bed Leveling + * Auto Bed Leveling and Z Probe Repeatability Test */ - #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #define HAS_PROBING_PROCEDURE (ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) + + #if HAS_PROBING_PROCEDURE // Boundaries for probing based on set limits #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cf61bd746..09bc1d27a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1721,6 +1721,21 @@ static void setup_for_endstop_move() { #endif +#if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE + static void axis_unhomed_error(bool xyz=false) { + if (xyz) { + LCD_MESSAGEPGM(MSG_XYZ_UNHOMED); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_XYZ_UNHOMED); + } + else { + LCD_MESSAGEPGM(MSG_YX_UNHOMED); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_YX_UNHOMED); + } + } +#endif + #if ENABLED(Z_PROBE_SLED) #ifndef SLED_DOCKING_OFFSET @@ -2052,81 +2067,7 @@ static void setup_for_endstop_move() { #endif // HAS_BED_PROBE -#if ENABLED(AUTO_BED_LEVELING_FEATURE) - - #if ENABLED(AUTO_BED_LEVELING_GRID) - - #if DISABLED(DELTA) - - static void set_bed_level_equation_lsq(double* plane_equation_coefficients) { - - //planner.bed_level_matrix.debug("bed level before"); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - planner.bed_level_matrix.set_to_identity(); - if (DEBUGGING(LEVELING)) { - vector_3 uncorrected_position = planner.adjusted_position(); - DEBUG_POS(">>> set_bed_level_equation_lsq", uncorrected_position); - DEBUG_POS(">>> set_bed_level_equation_lsq", current_position); - } - #endif - - vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - - vector_3 corrected_position = planner.adjusted_position(); - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = corrected_position.z; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", corrected_position); - #endif - - SYNC_PLAN_POSITION_KINEMATIC(); - } - - #endif // !DELTA - - #else // !AUTO_BED_LEVELING_GRID - - static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { - - planner.bed_level_matrix.set_to_identity(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - vector_3 uncorrected_position = planner.adjusted_position(); - DEBUG_POS("set_bed_level_equation_3pts", uncorrected_position); - } - #endif - - vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); - vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); - vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); - vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); - - if (planeNormal.z < 0) { - planeNormal.x = -planeNormal.x; - planeNormal.y = -planeNormal.y; - planeNormal.z = -planeNormal.z; - } - - planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); - vector_3 corrected_position = planner.adjusted_position(); - - current_position[X_AXIS] = corrected_position.x; - current_position[Y_AXIS] = corrected_position.y; - current_position[Z_AXIS] = corrected_position.z; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", corrected_position); - #endif - - SYNC_PLAN_POSITION_KINEMATIC(); - } - - #endif // !AUTO_BED_LEVELING_GRID +#if HAS_PROBING_PROCEDURE inline void do_blocking_move_to_xy(float x, float y) { do_blocking_move_to(x, y, current_position[Z_AXIS]); @@ -2207,6 +2148,84 @@ static void setup_for_endstop_move() { return measured_z; } +#endif // AUTO_BED_LEVELING_FEATURE || Z_MIN_PROBE_REPEATABILITY_TEST + +#if ENABLED(AUTO_BED_LEVELING_FEATURE) + + #if ENABLED(AUTO_BED_LEVELING_GRID) + + #if DISABLED(DELTA) + + static void set_bed_level_equation_lsq(double* plane_equation_coefficients) { + + //planner.bed_level_matrix.debug("bed level before"); + + #if ENABLED(DEBUG_LEVELING_FEATURE) + planner.bed_level_matrix.set_to_identity(); + if (DEBUGGING(LEVELING)) { + vector_3 uncorrected_position = planner.adjusted_position(); + DEBUG_POS(">>> set_bed_level_equation_lsq", uncorrected_position); + DEBUG_POS(">>> set_bed_level_equation_lsq", current_position); + } + #endif + + vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); + planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + + vector_3 corrected_position = planner.adjusted_position(); + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = corrected_position.z; + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", corrected_position); + #endif + + SYNC_PLAN_POSITION_KINEMATIC(); + } + + #endif // !DELTA + + #else // !AUTO_BED_LEVELING_GRID + + static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float z_at_pt_3) { + + planner.bed_level_matrix.set_to_identity(); + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + vector_3 uncorrected_position = planner.adjusted_position(); + DEBUG_POS("set_bed_level_equation_3pts", uncorrected_position); + } + #endif + + vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, z_at_pt_1); + vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, z_at_pt_2); + vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, z_at_pt_3); + vector_3 planeNormal = vector_3::cross(pt1 - pt2, pt3 - pt2).get_normal(); + + if (planeNormal.z < 0) { + planeNormal.x = -planeNormal.x; + planeNormal.y = -planeNormal.y; + planeNormal.z = -planeNormal.z; + } + + planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); + vector_3 corrected_position = planner.adjusted_position(); + + current_position[X_AXIS] = corrected_position.x; + current_position[Y_AXIS] = corrected_position.y; + current_position[Z_AXIS] = corrected_position.z; + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("set_bed_level_equation_3pts", corrected_position); + #endif + + SYNC_PLAN_POSITION_KINEMATIC(); + } + + #endif // !AUTO_BED_LEVELING_GRID + #if ENABLED(DELTA) /** @@ -2279,21 +2298,6 @@ static void setup_for_endstop_move() { #endif // AUTO_BED_LEVELING_FEATURE -#if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || ENABLED(AUTO_BED_LEVELING_FEATURE) - static void axis_unhomed_error(bool xyz=false) { - if (xyz) { - LCD_MESSAGEPGM(MSG_XYZ_UNHOMED); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_XYZ_UNHOMED); - } - else { - LCD_MESSAGEPGM(MSG_YX_UNHOMED); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_YX_UNHOMED); - } - } -#endif - /** * Home an individual axis */ @@ -3103,6 +3107,16 @@ inline void gcode_G28() { report_current_position(); } +#if HAS_PROBING_PROCEDURE + + void out_of_range_error(const char* p_edge) { + SERIAL_PROTOCOLPGM("?Probe "); + serialprintPGM(p_edge); + SERIAL_PROTOCOLLNPGM(" position out of range."); + } + +#endif + #if ENABLED(MESH_BED_LEVELING) enum MeshLevelingState { MeshReport, MeshStart, MeshNext, MeshSet, MeshSetZOffset, MeshReset }; @@ -3300,12 +3314,6 @@ inline void gcode_G28() { #elif ENABLED(AUTO_BED_LEVELING_FEATURE) - void out_of_range_error(const char* p_edge) { - SERIAL_PROTOCOLPGM("?Probe "); - serialprintPGM(p_edge); - SERIAL_PROTOCOLLNPGM(" position out of range."); - } - /** * G29: Detailed Z probe, probes the bed at 3 or more points. * Will fail if the printer has not been homed with G28. From c01352cbd56f1a6190cd219a35cc333d006dcbef Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 14:04:23 -0700 Subject: [PATCH 163/580] Add a dependency for z servo macros --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 09bc1d27a..2160e9a31 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -493,8 +493,10 @@ static bool send_ok[BUFSIZE]; #if HAS_SERVOS Servo servo[NUM_SERVOS]; #define MOVE_SERVO(I, P) servo[I].move(P) - #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[0]) - #define STOW_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[1]) + #if HAS_Z_SERVO_ENDSTOP + #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[0]) + #define STOW_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[1]) + #endif #endif #ifdef CHDK From 15229d988b1ec34887cb8e967285e1b7a13b1c72 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 14:04:46 -0700 Subject: [PATCH 164/580] Fix compile error for bed matrix in M48 --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2160e9a31..768e49802 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4254,7 +4254,7 @@ inline void gcode_M42() { #if ENABLED(DELTA) // we don't do bed level correction in M48 because we want the raw data when we probe reset_bed_level(); - #else + #elif ENABLED(AUTO_BED_LEVELING_FEATURE) // we don't do bed level correction in M48 because we want the raw data when we probe planner.bed_level_matrix.set_to_identity(); #endif From 7da30807617c4cee31840cf6c0c3790754a6617e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 14:20:34 -0700 Subject: [PATCH 165/580] Simpler cleanup in G28 / G29 --- Marlin/Marlin_main.cpp | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 768e49802..cc1bdc4a2 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1607,16 +1607,17 @@ static void setup_for_endstop_move() { endstops.enable(); } +static void clean_up_after_endstop_or_probe_move() { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position); + #endif + feedrate = saved_feedrate; + feedrate_multiplier = saved_feedrate_multiplier; + refresh_cmd_timeout(); +} + #if HAS_BED_PROBE - static void clean_up_after_endstop_or_probe_move() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position); - #endif - feedrate = saved_feedrate; - feedrate_multiplier = saved_feedrate_multiplier; - refresh_cmd_timeout(); - } static void clean_up_after_endstop_move() { clean_up_after_endstop_or_probe_move(); endstops.not_homing(); @@ -3058,14 +3059,7 @@ inline void gcode_G28() { #endif // !DELTA (gcode_G28) - #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING) - endstops.enable(false); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("ENDSTOPS_ONLY_FOR_HOMING endstops.enable(false)"); - } - #endif - #endif + endstops.not_homing(); // Enable mesh leveling again #if ENABLED(MESH_BED_LEVELING) @@ -3097,9 +3091,8 @@ inline void gcode_G28() { } #endif - feedrate = saved_feedrate; - feedrate_multiplier = saved_feedrate_multiplier; - refresh_cmd_timeout(); + clean_up_after_endstop_or_probe_move(); + endstops.hit_on_purpose(); // clear endstop hit flags #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3597,8 +3590,6 @@ inline void gcode_G28() { if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position); #endif - clean_up_after_endstop_or_probe_move(); - #if ENABLED(DELTA) if (!dryrun) extrapolate_unprobed_bed_level(); @@ -3725,7 +3716,7 @@ inline void gcode_G28() { ABL_PROBE_PT_3_Y + home_offset[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, p3, verbose_level); - clean_up_after_endstop_or_probe_move(); + if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); #endif // !AUTO_BED_LEVELING_GRID @@ -3807,6 +3798,9 @@ inline void gcode_G28() { // Stow the probe. Servo will raise if needed. stow_z_probe(); + // Restore state after probing + clean_up_after_endstop_or_probe_move(); + #ifdef Z_PROBE_END_SCRIPT #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { From fe173c2bc6a6991867460d588c556350d95897dc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 14:40:15 -0700 Subject: [PATCH 166/580] Generalized probe raise, use for after probing --- Marlin/Marlin_main.cpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cc1bdc4a2..0fde223e7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1691,38 +1691,37 @@ static void clean_up_after_endstop_or_probe_move() { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); } - inline void raise_z_after_probing() { - #if Z_RAISE_AFTER_PROBING > 0 - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("raise_z_after_probing()"); - #endif - do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); - #endif - } -#endif //HAS_BED_PROBE - -#if HAS_Z_SERVO_ENDSTOP - /** - * Raise Z to a minimum height to make room for a servo to move + * Raise Z to a minimum height to make room for a probe to move * * zprobe_zoffset: Negative of the Z height where the probe engages - * z_dest: The before / after probing raise distance + * z_raise: The probing raise distance * * The zprobe_zoffset is negative for a switch below the nozzle, so * multiply by Z_HOME_DIR (-1) to move enough away from the bed. */ - void raise_z_for_servo(float z_dest) { - z_dest += home_offset[Z_AXIS]; + inline void do_probe_raise(float z_raise) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("do_probe_raise(", z_raise); + SERIAL_ECHOLNPGM(")"); + } + #endif + float z_dest = home_offset[Z_AXIS] + z_raise; if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) z_dest -= zprobe_zoffset; if (z_dest > current_position[Z_AXIS]) - do_blocking_move_to_z(z_dest); // also updates current_position + do_blocking_move_to_z(z_dest); } -#endif + inline void raise_z_after_probing() { + #if Z_RAISE_AFTER_PROBING > 0 + do_probe_raise(Z_RAISE_AFTER_PROBING); + #endif + } +#endif //HAS_BED_PROBE #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE static void axis_unhomed_error(bool xyz=false) { @@ -1801,7 +1800,7 @@ static void clean_up_after_endstop_or_probe_move() { #elif HAS_Z_SERVO_ENDSTOP // Make room for Z Servo - raise_z_for_servo(Z_RAISE_BEFORE_PROBING); + do_probe_raise(Z_RAISE_BEFORE_PROBING); // Engage Z Servo endstop if enabled DEPLOY_Z_SERVO(); @@ -1903,7 +1902,7 @@ static void clean_up_after_endstop_or_probe_move() { #elif HAS_Z_SERVO_ENDSTOP // Make room for the servo - raise_z_for_servo(Z_RAISE_AFTER_PROBING); + do_probe_raise(Z_RAISE_AFTER_PROBING); // Change the Z servo angle STOW_Z_SERVO(); From 6fdd5ba2462a3dbfc2457b87204f9599cb018fbb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 15:49:05 -0700 Subject: [PATCH 167/580] Save and restore feedrate in more places --- Marlin/Marlin_main.cpp | 47 +++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0fde223e7..9d8d2e6b3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -366,6 +366,8 @@ static uint8_t target_extruder; float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; #endif +#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS])) + #if ENABLED(AUTO_BED_LEVELING_FEATURE) int xy_probe_speed = XY_PROBE_SPEED; bool bed_leveling_in_progress = false; @@ -373,7 +375,7 @@ static uint8_t target_extruder; #elif defined(XY_PROBE_SPEED) #define XY_PROBE_FEEDRATE XY_PROBE_SPEED #else - #define XY_PROBE_FEEDRATE (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60) + #define XY_PROBE_FEEDRATE (PLANNER_XY_FEEDRATE() * 60) #endif #if ENABLED(Z_DUAL_ENDSTOPS) && DISABLED(DELTA) @@ -1712,8 +1714,12 @@ static void clean_up_after_endstop_or_probe_move() { if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) z_dest -= zprobe_zoffset; - if (z_dest > current_position[Z_AXIS]) + if (z_dest > current_position[Z_AXIS]) { + float old_feedrate = feedrate; + feedrate = homing_feedrate[Z_AXIS]; do_blocking_move_to_z(z_dest); + feedrate = old_feedrate; + } } inline void raise_z_after_probing() { @@ -1766,19 +1772,24 @@ static void clean_up_after_endstop_or_probe_move() { if (endstops.z_probe_enabled == !dock) return; // already docked/undocked? float oldXpos = current_position[X_AXIS]; // save x position + float old_feedrate = feedrate; if (dock) { raise_z_after_probing(); // raise Z // Dock sled a bit closer to ensure proper capturing + feedrate = XY_PROBE_FEEDRATE; do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); digitalWrite(SLED_PIN, LOW); // turn off magnet } else { + feedrate = XY_PROBE_FEEDRATE; float z_loc = current_position[Z_AXIS]; if (z_loc < Z_RAISE_BEFORE_PROBING + 5) z_loc = Z_RAISE_BEFORE_PROBING; do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], z_loc); // this also updates current_position digitalWrite(SLED_PIN, HIGH); // turn on magnet } do_blocking_move_to_x(oldXpos); // return to position before docking + + feedrate = old_feedrate; } #endif // Z_PROBE_SLED @@ -2102,7 +2113,10 @@ static void clean_up_after_endstop_or_probe_move() { } #endif + float old_feedrate = feedrate; + // Move Z up to the z_before height, then move the Z probe to the given XY + feedrate = homing_feedrate[Z_AXIS]; do_blocking_move_to_z(z_before); // this also updates current_position #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2114,6 +2128,7 @@ static void clean_up_after_endstop_or_probe_move() { #endif // this also updates current_position + feedrate = XY_PROBE_FEEDRATE; do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); if (probe_action & ProbeDeploy) { @@ -2147,6 +2162,8 @@ static void clean_up_after_endstop_or_probe_move() { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt"); #endif + feedrate = old_feedrate; + return measured_z; } @@ -3473,8 +3490,6 @@ inline void gcode_G28() { // Deploy the probe. Servo will raise if needed. deploy_z_probe(); - feedrate = homing_feedrate[Z_AXIS]; - bed_leveling_in_progress = true; #if ENABLED(AUTO_BED_LEVELING_GRID) @@ -4227,7 +4242,7 @@ inline void gcode_M42() { bool seen_L = code_seen('L'); uint8_t n_legs = seen_L ? code_value_byte() : 0; - if (n_legs < 0 || n_legs > 15) { + if (n_legs > 15) { SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); return; } @@ -4252,16 +4267,20 @@ inline void gcode_M42() { planner.bed_level_matrix.set_to_identity(); #endif - if (Z_start_location < Z_RAISE_BEFORE_PROBING * 2.0) + setup_for_endstop_or_probe_move(); + + if (Z_start_location < Z_RAISE_BEFORE_PROBING * 2.0) { + feedrate = homing_feedrate[Z_AXIS]; do_blocking_move_to_z(Z_start_location); + } + feedrate = XY_PROBE_FEEDRATE; do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER)); /** * OK, do the initial probe to get us close to the bed. * Then retrace the right amount and use that in subsequent probes */ - setup_for_endstop_or_probe_move(); // Height before each probe (except the first) float z_between = home_offset[Z_AXIS] + (deploy_probe_for_each_reading ? Z_RAISE_BEFORE_PROBING : Z_RAISE_BETWEEN_PROBINGS); @@ -4399,6 +4418,7 @@ inline void gcode_M42() { // Raise before the next loop for the legs, // or do the final raise after the last probe if (n_legs || last_probe) { + feedrate = homing_feedrate[Z_AXIS]; do_blocking_move_to_z(last_probe ? home_offset[Z_AXIS] + Z_RAISE_AFTER_PROBING : z_between); if (!last_probe) delay(500); } @@ -6551,15 +6571,8 @@ inline void gcode_T(uint8_t tmp_extruder) { float next_feedrate = code_value_axis_units(X_AXIS); if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate; } - else { - feedrate = - #ifdef XY_PROBE_SPEED - XY_PROBE_SPEED - #else - min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60 - #endif - ; - } + else + feedrate = XY_PROBE_FEEDRATE; if (tmp_extruder != active_extruder) { bool no_move = code_seen('S') && code_value_bool(); @@ -7668,7 +7681,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, delayed_move_time = 0; // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder); - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]), active_extruder); + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], PLANNER_XY_FEEDRATE(), active_extruder); planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder); active_extruder_parked = false; } From 1f48b5c30fa4a560eaa5fedc3883d008d2ecd9dd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 16:39:51 -0700 Subject: [PATCH 168/580] Pass a raise to probe_pt, not a Z position --- Marlin/Marlin_main.cpp | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9d8d2e6b3..519215287 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2094,7 +2094,7 @@ static void clean_up_after_endstop_or_probe_move() { }; // Probe bed height at position (x,y), returns the measured z value - static float probe_pt(float x, float y, float z_before, ProbeAction probe_action = ProbeDeployAndStow, int verbose_level = 1) { + static float probe_pt(float x, float y, float z_raise, ProbeAction probe_action = ProbeDeployAndStow, int verbose_level = 1) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOLNPGM("probe_pt >>>"); @@ -2104,20 +2104,16 @@ static void clean_up_after_endstop_or_probe_move() { } #endif + float old_feedrate = feedrate; + + // Raise by z_raise, then move the Z probe to the given XY #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Z Raise to z_before ", z_before); - SERIAL_EOL; - SERIAL_ECHOPAIR("> do_blocking_move_to_z ", z_before); + SERIAL_ECHOPAIR("Z Raise by z_raise ", z_raise); SERIAL_EOL; } #endif - - float old_feedrate = feedrate; - - // Move Z up to the z_before height, then move the Z probe to the given XY - feedrate = homing_feedrate[Z_AXIS]; - do_blocking_move_to_z(z_before); // this also updates current_position + do_probe_raise(z_raise); // this also updates current_position #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -3546,16 +3542,16 @@ inline void gcode_G28() { // raise extruder float measured_z, - z_before = probePointCounter ? Z_RAISE_BETWEEN_PROBINGS + current_position[Z_AXIS] : Z_RAISE_BEFORE_PROBING + home_offset[Z_AXIS]; + z_raise = probePointCounter ? Z_RAISE_BETWEEN_PROBINGS : Z_RAISE_BEFORE_PROBING; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("z_before = ("); + SERIAL_ECHOPGM("z_raise = ("); if (probePointCounter) SERIAL_ECHOPGM("between) "); else SERIAL_ECHOPGM("before) "); - SERIAL_ECHOLN(z_before); + SERIAL_ECHOLN(z_raise); } #endif @@ -3579,7 +3575,7 @@ inline void gcode_G28() { act = ProbeStay; #endif - measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level); + measured_z = probe_pt(xProbe, yProbe, z_raise, act, verbose_level); #if DISABLED(DELTA) mean += measured_z; @@ -3720,15 +3716,15 @@ inline void gcode_G28() { // Probe at 3 arbitrary points float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS], ABL_PROBE_PT_1_Y + home_offset[Y_AXIS], - Z_RAISE_BEFORE_PROBING + home_offset[Z_AXIS], + Z_RAISE_BEFORE_PROBING, p1, verbose_level), z_at_pt_2 = probe_pt( ABL_PROBE_PT_2_X + home_offset[X_AXIS], ABL_PROBE_PT_2_Y + home_offset[Y_AXIS], - current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, + Z_RAISE_BETWEEN_PROBINGS, p2, verbose_level), z_at_pt_3 = probe_pt( ABL_PROBE_PT_3_X + home_offset[X_AXIS], ABL_PROBE_PT_3_Y + home_offset[Y_AXIS], - current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, + Z_RAISE_BETWEEN_PROBINGS, p3, verbose_level); if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); @@ -4283,11 +4279,11 @@ inline void gcode_M42() { */ // Height before each probe (except the first) - float z_between = home_offset[Z_AXIS] + (deploy_probe_for_each_reading ? Z_RAISE_BEFORE_PROBING : Z_RAISE_BETWEEN_PROBINGS); + float z_between = deploy_probe_for_each_reading ? Z_RAISE_BEFORE_PROBING : Z_RAISE_BETWEEN_PROBINGS; // Deploy the probe and probe the first point probe_pt(X_probe_location, Y_probe_location, - home_offset[Z_AXIS] + Z_RAISE_BEFORE_PROBING, + Z_RAISE_BEFORE_PROBING, deploy_probe_for_each_reading ? ProbeDeployAndStow : ProbeDeploy, verbose_level); @@ -4418,8 +4414,7 @@ inline void gcode_M42() { // Raise before the next loop for the legs, // or do the final raise after the last probe if (n_legs || last_probe) { - feedrate = homing_feedrate[Z_AXIS]; - do_blocking_move_to_z(last_probe ? home_offset[Z_AXIS] + Z_RAISE_AFTER_PROBING : z_between); + do_probe_raise(last_probe ? Z_RAISE_AFTER_PROBING : z_between); if (!last_probe) delay(500); } From 3763d4565674577125c198f4109f123d74efb2f0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 16:52:32 -0700 Subject: [PATCH 169/580] Return Z position in run_z_probe --- Marlin/Marlin_main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 519215287..dc8b651ed 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1993,7 +1993,7 @@ static void clean_up_after_endstop_or_probe_move() { // Do a single Z probe and return with current_position[Z_AXIS] // at the height where the probe triggered. - static void run_z_probe() { + static float run_z_probe() { float old_feedrate = feedrate; @@ -2076,6 +2076,8 @@ static void clean_up_after_endstop_or_probe_move() { #endif // !DELTA feedrate = old_feedrate; + + return current_position[Z_AXIS]; } #endif // HAS_BED_PROBE @@ -2134,8 +2136,7 @@ static void clean_up_after_endstop_or_probe_move() { deploy_z_probe(); } - run_z_probe(); - float measured_z = current_position[Z_AXIS]; + float measured_z = run_z_probe(); if (probe_action & ProbeStow) { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3851,14 +3852,14 @@ inline void gcode_G28() { stepper.synchronize(); // TODO: clear the leveling matrix or the planner will be set incorrectly - run_z_probe(); // clears the ABL non-delta matrix only + float measured_z = run_z_probe(); // clears the ABL non-delta matrix only SERIAL_PROTOCOLPGM("Bed X: "); SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); SERIAL_PROTOCOLPGM(" Y: "); SERIAL_PROTOCOL(current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL(current_position[Z_AXIS] + 0.0001); + SERIAL_PROTOCOL(measured_z + 0.0001); SERIAL_EOL; stow_z_probe(); From 2640d13a9f4ff8b64759c6708640c2dde5b66f7c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 16:53:04 -0700 Subject: [PATCH 170/580] Simplify initial raise in M48 --- Marlin/Marlin_main.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index dc8b651ed..715a6db34 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4207,8 +4207,7 @@ inline void gcode_M42() { } float X_current = current_position[X_AXIS], - Y_current = current_position[Y_AXIS], - Z_start_location = current_position[Z_AXIS] + Z_RAISE_BEFORE_PROBING; + Y_current = current_position[Y_AXIS]; #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) const bool deploy_probe_for_each_reading = false; @@ -4266,10 +4265,7 @@ inline void gcode_M42() { setup_for_endstop_or_probe_move(); - if (Z_start_location < Z_RAISE_BEFORE_PROBING * 2.0) { - feedrate = homing_feedrate[Z_AXIS]; - do_blocking_move_to_z(Z_start_location); - } + do_probe_raise(Z_RAISE_BEFORE_PROBING); feedrate = XY_PROBE_FEEDRATE; do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER)); From bd015928165f50cedad5b325ee3052486b7523b3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 17:11:49 -0700 Subject: [PATCH 171/580] Goodbye MECHANICAL_PROBE --- .travis.yml | 4 ++-- Marlin/Conditionals.h | 2 +- Marlin/Configuration.h | 10 ++++------ Marlin/Marlin_main.cpp | 4 ++-- Marlin/SanityCheck.h | 9 ++++----- Marlin/example_configurations/Cartesio/Configuration.h | 10 ++++------ Marlin/example_configurations/Felix/Configuration.h | 10 ++++------ .../example_configurations/Felix/DUAL/Configuration.h | 10 ++++------ .../example_configurations/Hephestos/Configuration.h | 10 ++++------ .../example_configurations/Hephestos_2/Configuration.h | 10 ++++------ Marlin/example_configurations/K8200/Configuration.h | 10 ++++------ .../RepRapWorld/Megatronics/Configuration.h | 10 ++++------ Marlin/example_configurations/RigidBot/Configuration.h | 10 ++++------ Marlin/example_configurations/SCARA/Configuration.h | 10 ++++------ Marlin/example_configurations/TAZ4/Configuration.h | 10 ++++------ Marlin/example_configurations/WITBOX/Configuration.h | 10 ++++------ .../adafruit/ST7565/Configuration.h | 10 ++++------ .../delta/biv2.5/Configuration.h | 10 ++++------ .../delta/generic/Configuration.h | 10 ++++------ .../delta/kossel_mini/Configuration.h | 10 ++++------ .../delta/kossel_pro/Configuration.h | 10 ++++------ .../delta/kossel_xl/Configuration.h | 10 ++++------ Marlin/example_configurations/makibox/Configuration.h | 10 ++++------ .../tvrrug/Round2/Configuration.h | 10 ++++------ 24 files changed, 89 insertions(+), 130 deletions(-) diff --git a/.travis.yml b/.travis.yml index eacedee8f..30210b42f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -101,10 +101,10 @@ script: - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE - build_marlin # - # Test a Mechanical Probe + # Test a Sled Z Probe # - restore_configs - - opt_enable MECHANICAL_PROBE + - opt_enable Z_PROBE_SLED - build_marlin # # ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index c997fbbaf..b1ddcdc24 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -752,7 +752,7 @@ #endif #endif - #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED)) + #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED)) #define PROBE_PIN_CONFIGURED (HAS_Z_MIN_PROBE_PIN || (HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 14d63a6cb..d8f6af1fe 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -419,8 +419,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -431,10 +433,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 715a6db34..6379865c5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1890,7 +1890,7 @@ static void clean_up_after_endstop_or_probe_move() { stop(); } - #elif ENABLED(FIX_MOUNTED_PROBE) + #else // Nothing to be done. Just enable_z_probe below... @@ -1982,7 +1982,7 @@ static void clean_up_after_endstop_or_probe_move() { stop(); } - #elif ENABLED(FIX_MOUNTED_PROBE) + #else // Nothing to do here. Just clear endstops.z_probe_enabled diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 91c4c7bd0..dda663900 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -268,11 +268,10 @@ /** * Only allow one probe option to be defined */ - #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ - || (ENABLED(MECHANICAL_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ || (HAS_Z_SERVO_ENDSTOP && ENABLED(Z_PROBE_SLED)) - #error "Please define only one type of probe: Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #error "Please define only one type of probe: Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #endif /** @@ -314,9 +313,9 @@ * Require some kind of probe for bed leveling and probe testing */ #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #endif #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index da5c9a011..bbc7d10bf 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -418,8 +418,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -430,10 +432,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index eb5068c26..4c79f69a1 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -401,8 +401,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -413,10 +415,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 959981c9b..28e0862fa 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -399,8 +399,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -411,10 +413,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 4b72240db..2389c10a9 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -411,8 +411,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -423,10 +425,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 50eb96c08..46db14118 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -413,8 +413,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. #define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -425,10 +427,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index aaeed3c7d..1f7504e11 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -436,8 +436,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -448,10 +450,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 56acd002f..15e3d56ad 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -419,8 +419,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -431,10 +433,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 6ea37ef1b..29f26f43d 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -413,8 +413,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -425,10 +427,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 91ce78a33..7b29ec92c 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -427,8 +427,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -439,10 +441,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 50b5f4652..5565df7e0 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -440,8 +440,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -452,10 +454,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 884c4bbbf..65ffac1a1 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -411,8 +411,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -423,10 +425,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 35ca9f9ff..21a47e762 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -419,8 +419,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -431,10 +433,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 074faa4ff..35202c9ea 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -461,8 +461,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -473,10 +475,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 3f8eb0a4b..46bb74b45 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -461,8 +461,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -473,10 +475,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 569b1b34a..f94964a16 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -461,8 +461,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -473,10 +475,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 3925f3334..d9b18cf7d 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -450,8 +450,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -462,10 +464,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index b0267349e..d453fc589 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -459,8 +459,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. #define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -471,10 +473,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 8ec948195..fcc45adec 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -422,8 +422,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -434,10 +436,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 5eb34e2b7..7fcf6e394 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -409,8 +409,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // -// A fix mounted probe, like the normal inductive probe, must be deactivated to go -// below Z_PROBE_OFFSET_FROM_EXTRUDER when the hardware endstops are active. +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. @@ -421,10 +423,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// A Mechanical Probe is any probe that either doesn't deploy or needs manual deployment -// For example any setup that uses the nozzle itself as a probe. -//#define MECHANICAL_PROBE - // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // From 7b2fadd5988d1280890b4823ed71f4c058124c6b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 17:35:59 -0700 Subject: [PATCH 172/580] Apply some fixes from Andreas Derived from https://github.com/AnHardt/Marlin/commit/6e8ede8c694fa4d9e3c769840b09d56 7f8d8e0dd --- Marlin/Marlin_main.cpp | 8 +++++--- Marlin/temperature.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6379865c5..0e42a4bad 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4286,7 +4286,7 @@ inline void gcode_M42() { randomSeed(millis()); - double mean, sigma, sample_set[n_samples]; + double mean = 0, sigma = 0, sample_set[n_samples]; for (uint8_t n = 0; n < n_samples; n++) { if (n_legs) { int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise @@ -4410,8 +4410,10 @@ inline void gcode_M42() { // Raise before the next loop for the legs, // or do the final raise after the last probe - if (n_legs || last_probe) { - do_probe_raise(last_probe ? Z_RAISE_AFTER_PROBING : z_between); + if (last_probe) + do_probe_raise(Z_RAISE_AFTER_PROBING); + else if (n_legs) { + do_probe_raise(z_between); if (!last_probe) delay(500); } diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index cb10f9d25..4a19968d0 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -462,7 +462,7 @@ int Temperature::getHeaterPower(int heater) { EXTRUDER_3_AUTO_FAN_PIN == EXTRUDER_2_AUTO_FAN_PIN ? 2 : 3 }; uint8_t fanState = 0; - for (int f = 0; f <= HOTENDS; f++) { + for (int f = 0; f < HOTENDS; f++) { if (current_temperature[f] > EXTRUDER_AUTO_FAN_TEMPERATURE) SBI(fanState, fanBit[f]); } From d4134e69015f4f2f3d6f65eda62d0286ecd768ae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2016 17:48:41 -0700 Subject: [PATCH 173/580] Define Z_SAFE_HOMING point when Z_PROBE_SLED is activated alone --- Marlin/Conditionals.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index b1ddcdc24..c1db34cb1 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -378,12 +378,24 @@ #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) /** - * Sled Options + * Z Sled Probe requires Z_SAFE_HOMING */ #if ENABLED(Z_PROBE_SLED) #define Z_SAFE_HOMING #endif + /** + * Safe Homing Options + */ + #if ENABLED(Z_SAFE_HOMING) + #ifndef Z_SAFE_HOMING_X_POINT + #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) + #endif + #ifndef Z_SAFE_HOMING_Y_POINT + #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) + #endif + #endif + /** * Host keep alive */ From 0c5192b288ea66c66938f36b002538df0f95853a Mon Sep 17 00:00:00 2001 From: Sebastianv650 Date: Wed, 22 Jun 2016 18:32:01 +0200 Subject: [PATCH 174/580] Patch LIN_ADVANCE timing issue Also the extruder stepper ISR has to keep an eye on step_loops count. --- Marlin/stepper.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 8d1fe031e..1f1658ac3 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -451,7 +451,7 @@ void Stepper::isr() { #endif // ADVANCE or LIN_ADVANCE #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) - eISR_Rate = (timer >> 2) / abs(e_steps[current_block->active_extruder]); + eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[current_block->active_extruder]); #endif } else if (step_events_completed > (unsigned long)current_block->decelerate_after) { @@ -487,7 +487,7 @@ void Stepper::isr() { #endif // ADVANCE or LIN_ADVANCE #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) - eISR_Rate = (timer >> 2) / abs(e_steps[current_block->active_extruder]); + eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[current_block->active_extruder]); #endif } else { @@ -497,7 +497,7 @@ void Stepper::isr() { if (current_block->use_advance_lead) current_estep_rate[current_block->active_extruder] = final_estep_rate; - eISR_Rate = (OCR1A_nominal >> 2) / abs(e_steps[current_block->active_extruder]); + eISR_Rate = (OCR1A_nominal >> 2) * step_loops_nominal / abs(e_steps[current_block->active_extruder]); #endif @@ -542,16 +542,18 @@ void Stepper::isr() { } // Step all E steppers that have steps - STEP_E_ONCE(0); - #if EXTRUDERS > 1 - STEP_E_ONCE(1); - #if EXTRUDERS > 2 - STEP_E_ONCE(2); - #if EXTRUDERS > 3 - STEP_E_ONCE(3); + for (uint8_t i = 0; i < step_loops; i++) { + STEP_E_ONCE(0); + #if EXTRUDERS > 1 + STEP_E_ONCE(1); + #if EXTRUDERS > 2 + STEP_E_ONCE(2); + #if EXTRUDERS > 3 + STEP_E_ONCE(3); + #endif #endif #endif - #endif + } } From 664232140dcfca363e20c3f5f719fd867f64a90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 23 Jun 2016 02:22:17 +0100 Subject: [PATCH 175/580] Fixes somes compiler warnings --- Marlin/dogm_lcd_implementation.h | 4 ++++ Marlin/planner.cpp | 6 +++--- Marlin/stepper.cpp | 6 +++--- Marlin/temperature.cpp | 2 +- Marlin/ultralcd_st7920_u8glib_rrd.h | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 1ef521442..b52ff8d0c 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -474,6 +474,9 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { } static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) { + UNUSED(pstr); + UNUSED(pre_char); + char c; uint8_t n = LCD_WIDTH - 2; @@ -564,6 +567,7 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) { #if ENABLED(SDSUPPORT) static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char* const longFilename, bool isDir) { + UNUSED(pstr); char c; uint8_t n = LCD_WIDTH - 1; diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index be0fe8ba2..b742dfe6e 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -386,7 +386,7 @@ void Planner::recalculate() { #endif //AUTOTEMP /** - * Maintain fans, paste extruder pressure, + * Maintain fans, paste extruder pressure, */ void Planner::check_axes_activity() { unsigned char axis_active[NUM_AXIS] = { 0 }, @@ -539,7 +539,7 @@ void Planner::check_axes_activity() { while (block_buffer_tail == next_buffer_head) idle(); #if ENABLED(MESH_BED_LEVELING) - if (mbl.active()) + if (mbl.active()) z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]); #elif ENABLED(AUTO_BED_LEVELING_FEATURE) apply_rotation_xyz(bed_level_matrix, x, y, z); @@ -1057,7 +1057,7 @@ void Planner::check_axes_activity() { // This leads to an enormous number of advance steps due to a huge e_acceleration. // The math is correct, but you don't want a retract move done with advance! // So this situation is filtered out here. - if (!bse || (!bsx && !bsy && !bsz) || stepper.get_advance_k() == 0 || bse == allsteps) { + if (!bse || (!bsx && !bsy && !bsz) || stepper.get_advance_k() == 0 || (uint32_t) bse == allsteps) { block->use_advance_lead = false; } else { diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 8d1fe031e..e604eddc1 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -380,7 +380,7 @@ void Stepper::isr() { } #endif // ADVANCE or LIN_ADVANCE - + #define _COUNTER(AXIS) counter_## AXIS #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN @@ -468,7 +468,7 @@ void Stepper::isr() { timer = calc_timer(step_rate); OCR1A = timer; deceleration_time += timer; - + #if ENABLED(LIN_ADVANCE) if (current_block->use_advance_lead) @@ -998,7 +998,7 @@ void Stepper::digipot_init() { SPI.begin(); pinMode(DIGIPOTSS_PIN, OUTPUT); - for (int i = 0; i < COUNT(digipot_motor_current); i++) { + for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) { //digitalPotWrite(digipot_ch[i], digipot_motor_current[i]); digipot_current(i, digipot_motor_current[i]); } diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index cb10f9d25..4a19968d0 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -462,7 +462,7 @@ int Temperature::getHeaterPower(int heater) { EXTRUDER_3_AUTO_FAN_PIN == EXTRUDER_2_AUTO_FAN_PIN ? 2 : 3 }; uint8_t fanState = 0; - for (int f = 0; f <= HOTENDS; f++) { + for (int f = 0; f < HOTENDS; f++) { if (current_temperature[f] > EXTRUDER_AUTO_FAN_TEMPERATURE) SBI(fanState, fanBit[f]); } diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index 9aa53ceab..cc88b5256 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -135,7 +135,7 @@ u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g class U8GLIB_ST7920_128X64_RRD : public U8GLIB { public: - U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) {} + U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) { UNUSED(dummy); } }; From 570f3bbc073459c95c3d5bb165cc30854868c07a Mon Sep 17 00:00:00 2001 From: MagoKimbra Date: Thu, 23 Jun 2016 23:09:47 +0200 Subject: [PATCH 176/580] Single home Axis Delta need simple sync_plan_position --- Marlin/Marlin_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0e42a4bad..d1df105cc 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2340,7 +2340,7 @@ static void homeaxis(AxisEnum axis) { // Set the axis position as setup for the move current_position[axis] = 0; - SYNC_PLAN_POSITION_KINEMATIC(); + sync_plan_position(); // Homing Z towards the bed? Deploy the Z probe or endstop. #if HAS_BED_PROBE @@ -2365,7 +2365,7 @@ static void homeaxis(AxisEnum axis) { // Set the axis position as setup for the move current_position[axis] = 0; - SYNC_PLAN_POSITION_KINEMATIC(); + sync_plan_position(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)"); @@ -2406,7 +2406,7 @@ static void homeaxis(AxisEnum axis) { lockZ1 = (z_endstop_adj < 0); if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - SYNC_PLAN_POSITION_KINEMATIC(); + sync_plan_position(); // Move to the adjusted endstop height feedrate = homing_feedrate[axis]; @@ -2426,7 +2426,7 @@ static void homeaxis(AxisEnum axis) { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)"); #endif endstops.enable(false); // Disable endstops while moving away - SYNC_PLAN_POSITION_KINEMATIC(); + sync_plan_position(); destination[axis] = endstop_adj[axis]; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { From 03c70c1990f865d25b035f812c2948864f425981 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 14:33:29 -0700 Subject: [PATCH 177/580] SERVO_DEACTIVATION_DELAY => SERVO_DELAY --- Marlin/Configuration.h | 12 ++-- Marlin/SanityCheck.h | 6 +- .../Cartesio/Configuration.h | 12 ++-- .../Felix/Configuration.h | 12 ++-- .../Felix/DUAL/Configuration.h | 12 ++-- .../Hephestos/Configuration.h | 12 ++-- .../Hephestos_2/Configuration.h | 12 ++-- .../K8200/Configuration.h | 12 ++-- .../RepRapWorld/Megatronics/Configuration.h | 12 ++-- .../RigidBot/Configuration.h | 12 ++-- .../SCARA/Configuration.h | 12 ++-- .../TAZ4/Configuration.h | 12 ++-- .../WITBOX/Configuration.h | 12 ++-- .../adafruit/ST7565/Configuration.h | 12 ++-- .../delta/biv2.5/Configuration.h | 12 ++-- .../delta/generic/Configuration.h | 12 ++-- .../delta/kossel_mini/Configuration.h | 12 ++-- .../delta/kossel_pro/Configuration.h | 12 ++-- .../delta/kossel_xl/Configuration.h | 12 ++-- .../makibox/Configuration.h | 12 ++-- .../tvrrug/Round2/Configuration.h | 12 ++-- Marlin/servo.cpp | 70 ++++++++----------- Marlin/servo.h | 4 +- 23 files changed, 134 insertions(+), 186 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d8f6af1fe..ce046ca64 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1173,18 +1173,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index dda663900..81e2db8bd 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -593,8 +593,6 @@ #error "Z_LATE_ENABLE can't be used with COREXZ." #elif defined(X_HOME_RETRACT_MM) #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." -#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) - #error "PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY." #elif defined(BEEPER) #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." #elif defined(SDCARDDETECT) @@ -635,6 +633,10 @@ #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." #elif defined(XY_TRAVEL_SPEED) #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." +#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) + #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." +#elif defined(SERVO_DEACTIVATION_DELAY) + #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index bbc7d10bf..69997fbab 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -1172,18 +1172,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 4c79f69a1..9acb21c1c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1156,18 +1156,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 28e0862fa..9431c2084 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -1154,18 +1154,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 2389c10a9..fd98445be 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1165,18 +1165,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 46db14118..78ec36f71 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1167,18 +1167,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 1f7504e11..115e69d61 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1190,18 +1190,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 15e3d56ad..a0445647f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -1173,18 +1173,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 29f26f43d..5f069bac5 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -1170,18 +1170,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // #define NUM_SERVOS 0 // DGlass3D - Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 7b29ec92c..ee7a0e0f8 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1181,18 +1181,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 5565df7e0..043ebb3f3 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -1194,18 +1194,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 65ffac1a1..a15f582e0 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1165,18 +1165,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 21a47e762..e56c6b327 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -1173,18 +1173,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 35202c9ea..f4147a0cc 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1258,18 +1258,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 46bb74b45..f84451d8e 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1252,18 +1252,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index f94964a16..d6b6405af 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1255,18 +1255,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index d9b18cf7d..d6572bb97 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1255,18 +1255,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index d453fc589..49dc55403 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1257,18 +1257,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index fcc45adec..444c46e23 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1176,18 +1176,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 7fcf6e394..5d46e05e9 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1167,18 +1167,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - // Delay (in microseconds) before turning the servo off. This depends on the servo speed. - // 300ms is a good value but you can try less delay. - // If the servo can't reach the requested position, increase it. - #define SERVO_DEACTIVATION_DELAY 300 -#endif - /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp index 1b8442a0d..cbc0026d4 100644 --- a/Marlin/servo.cpp +++ b/Marlin/servo.cpp @@ -21,50 +21,35 @@ */ /** - servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - Copyright (c) 2009 Michael Margolis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 + * Copyright (c) 2009 Michael Margolis. All right reserved. */ /** - - A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - The servos are pulsed in the background using the value most recently written using the write() method - - Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - - The methods are: - - Servo - Class for manipulating servo motors connected to Arduino pins. - - attach(pin ) - Attaches a servo motor to an i/o pin. - attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds - default min is 544, max is 2400 - - write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds) - writeMicroseconds() - Sets the servo pulse width in microseconds - move(pin, angle) - Sequence of attach(pin), write(angle). - With DEACTIVATE_SERVOS_AFTER_MOVE it waits SERVO_DEACTIVATION_DELAY and detaches. - read() - Gets the last written servo pulse width as an angle between 0 and 180. - readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release) - attached() - Returns true if there is a servo attached. - detach() - Stops an attached servos from pulsing its i/o pin. - -*/ + * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. + * The servos are pulsed in the background using the value most recently written using the write() method + * + * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. + * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. + * + * The methods are: + * + * Servo - Class for manipulating servo motors connected to Arduino pins. + * + * attach(pin) - Attach a servo motor to an i/o pin. + * attach(pin, min, max) - Attach to a pin, setting min and max values in microseconds + * Default min is 544, max is 2400 + * + * write() - Set the servo angle in degrees. (Invalid angles —over MIN_PULSE_WIDTH— are treated as µs.) + * writeMicroseconds() - Set the servo pulse width in microseconds. + * move(pin, angle) - Sequence of attach(pin), write(angle), delay(SERVO_DELAY). + * With DEACTIVATE_SERVOS_AFTER_MOVE it detaches after SERVO_DELAY. + * read() - Get the last-written servo pulse width as an angle between 0 and 180. + * readMicroseconds() - Get the last-written servo pulse width in microseconds. + * attached() - Return true if a servo is attached. + * detach() - Stop an attached servo from pulsing its i/o pin. + * + */ #include "Configuration.h" #if HAS_SERVOS @@ -238,6 +223,7 @@ static void finISR(timer16_Sequence_t timer) { } #else //!WIRING // For arduino - in future: call here to a currently undefined function to reset the timer + UNUSED(timer); #endif } @@ -324,8 +310,8 @@ bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; } void Servo::move(int value) { if (this->attach(0) >= 0) { this->write(value); + delay(SERVO_DELAY); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - delay(SERVO_DEACTIVATION_DELAY); this->detach(); #endif } diff --git a/Marlin/servo.h b/Marlin/servo.h index d764fc440..07532bc30 100644 --- a/Marlin/servo.h +++ b/Marlin/servo.h @@ -63,7 +63,7 @@ attached() - Returns true if there is a servo attached. detach() - Stops an attached servos from pulsing its i/o pin. move(angle) - Sequence of attach(0), write(angle), - With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DEACTIVATION_DELAY and detach. + With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. */ #ifndef servo_h @@ -147,7 +147,7 @@ class Servo { void writeMicroseconds(int value); // write pulse width in microseconds void move(int value); // attach the servo, then move to value // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DEACTIVATION_DELAY, then detach + // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach int read(); // returns current pulse width as an angle between 0 and 180 degrees int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) bool attached(); // return true if this servo is attached, otherwise false From 6803c8e37eab3dd71a8db30defe5787c90372a92 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 15:50:13 -0700 Subject: [PATCH 178/580] Move Z up before, or down after XY, for "blocking move" --- Marlin/Marlin_main.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0e42a4bad..369e79977 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1666,18 +1666,25 @@ static void clean_up_after_endstop_or_probe_move() { #else - feedrate = homing_feedrate[Z_AXIS]; - - current_position[Z_AXIS] = z; - line_to_current_position(); - stepper.synchronize(); + // If Z needs to raise, do it before moving XY + if (current_position[Z_AXIS] < z) { + feedrate = homing_feedrate[Z_AXIS]; + current_position[Z_AXIS] = z; + line_to_current_position(); + } feedrate = XY_PROBE_FEEDRATE; - current_position[X_AXIS] = x; current_position[Y_AXIS] = y; line_to_current_position(); + // If Z needs to lower, do it after moving XY + if (current_position[Z_AXIS] > z) { + feedrate = homing_feedrate[Z_AXIS]; + current_position[Z_AXIS] = z; + line_to_current_position(); + } + #endif stepper.synchronize(); From 3afda99adf57209ecd99b890cee7911970a0d64a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 17:04:13 -0700 Subject: [PATCH 179/580] Regular handlers for G31 / G32 --- Marlin/Marlin_main.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 369e79977..dd130529a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3876,6 +3876,20 @@ inline void gcode_G28() { report_current_position(); } + #if ENABLED(Z_PROBE_SLED) + + /** + * G31: Deploy the Z probe + */ + inline void gcode_G31() { deploy_z_probe(); } + + /** + * G32: Stow the Z probe + */ + inline void gcode_G32() { stow_z_probe(); } + + #endif // Z_PROBE_SLED + #endif // HAS_BED_PROBE /** @@ -6865,10 +6879,11 @@ void process_next_command() { #if ENABLED(Z_PROBE_SLED) case 31: // G31: dock the sled - stow_z_probe(); + gcode_G31(); break; + case 32: // G32: undock the sled - deploy_z_probe(); + gcode_G32(); break; #endif // Z_PROBE_SLED From 68f3350050249d6800f7906c57743b18859b6c17 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 17:04:41 -0700 Subject: [PATCH 180/580] Cleanup M401 / M402 --- Marlin/Marlin_main.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index dd130529a..a4b933912 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5988,16 +5988,12 @@ inline void gcode_M400() { stepper.synchronize(); } /** * M401: Engage Z Servo endstop if available */ - inline void gcode_M401() { - deploy_z_probe(); - } + inline void gcode_M401() { deploy_z_probe(); } /** * M402: Retract Z Servo endstop if enabled */ - inline void gcode_M402() { - stow_z_probe(); - } + inline void gcode_M402() { stow_z_probe(); } #endif // HAS_BED_PROBE From bb38c816af1a89bf2b7087b6b406a2aef1a30e2f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 18:00:20 -0700 Subject: [PATCH 181/580] Always raise in deploy_z_probe / stow_z_probe --- Marlin/Marlin_main.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a4b933912..c62e32904 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1811,15 +1811,17 @@ static void clean_up_after_endstop_or_probe_move() { if (endstops.z_probe_enabled) return; + // Make room for probe + #if Z_RAISE_BEFORE_PROBING > 0 + do_probe_raise(Z_RAISE_BEFORE_PROBING); + #endif + #if ENABLED(Z_PROBE_SLED) dock_sled(false); #elif HAS_Z_SERVO_ENDSTOP - // Make room for Z Servo - do_probe_raise(Z_RAISE_BEFORE_PROBING); - // Engage Z Servo endstop if enabled DEPLOY_Z_SERVO(); @@ -1913,15 +1915,17 @@ static void clean_up_after_endstop_or_probe_move() { if (!endstops.z_probe_enabled) return; + // Make more room for the servo + #if Z_RAISE_AFTER_PROBING > 0 + do_probe_raise(Z_RAISE_AFTER_PROBING); + #endif + #if ENABLED(Z_PROBE_SLED) dock_sled(true); #elif HAS_Z_SERVO_ENDSTOP - // Make room for the servo - do_probe_raise(Z_RAISE_AFTER_PROBING); - // Change the Z servo angle STOW_Z_SERVO(); From 550c03a5a9262c05299c70332c92b2eb48a7d0cb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 18:11:54 -0700 Subject: [PATCH 182/580] Drop raise_z_after_probing function --- Marlin/Marlin_main.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c62e32904..f48ae6564 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1729,11 +1729,6 @@ static void clean_up_after_endstop_or_probe_move() { } } - inline void raise_z_after_probing() { - #if Z_RAISE_AFTER_PROBING > 0 - do_probe_raise(Z_RAISE_AFTER_PROBING); - #endif - } #endif //HAS_BED_PROBE #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE @@ -1781,7 +1776,9 @@ static void clean_up_after_endstop_or_probe_move() { float oldXpos = current_position[X_AXIS]; // save x position float old_feedrate = feedrate; if (dock) { - raise_z_after_probing(); // raise Z + #if Z_RAISE_AFTER_PROBING > 0 + do_probe_raise(Z_RAISE_AFTER_PROBING); + #endif // Dock sled a bit closer to ensure proper capturing feedrate = XY_PROBE_FEEDRATE; do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); From 9a71b7f8adc8ca28e4e2d4ca2e4d6135e857029b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 18:17:31 -0700 Subject: [PATCH 183/580] Fix debug message for 3-point leveling --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f48ae6564..aa9e2d056 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3606,7 +3606,7 @@ inline void gcode_G28() { } //yProbe #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling"); #endif #if ENABLED(DELTA) From c376c08042c2734a825ec8ea799e9b36cfe2e942 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 19:00:29 -0700 Subject: [PATCH 184/580] Simplified probe_pt function (part 1) --- Marlin/Marlin_main.cpp | 57 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index aa9e2d056..fa8e135c3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2096,19 +2096,20 @@ static void clean_up_after_endstop_or_probe_move() { do_blocking_move_to(x, y, current_position[Z_AXIS]); } - enum ProbeAction { - ProbeStay = 0, - ProbeDeploy = _BV(0), - ProbeStow = _BV(1), - ProbeDeployAndStow = (ProbeDeploy | ProbeStow) - }; - - // Probe bed height at position (x,y), returns the measured z value - static float probe_pt(float x, float y, float z_raise, ProbeAction probe_action = ProbeDeployAndStow, int verbose_level = 1) { + // + // - Move to the given XY + // - Deploy the probe, if not already deployed + // - Probe the bed, get the Z position + // - Depending on the 'stow' flag + // - Stow the probe, or + // - Raise to the BETWEEN height + // - Return the probed Z position + // + static float probe_pt(float x, float y, bool stow = true, int verbose_level = 1) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOLNPGM("probe_pt >>>"); - SERIAL_ECHOPAIR("> ProbeAction:", probe_action); + SERIAL_ECHOPAIR("> stow:", stow); SERIAL_EOL; DEBUG_POS("", current_position); } @@ -2119,39 +2120,37 @@ static void clean_up_after_endstop_or_probe_move() { // Raise by z_raise, then move the Z probe to the given XY #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Z Raise by z_raise ", z_raise); - SERIAL_EOL; - } - #endif - do_probe_raise(z_raise); // this also updates current_position - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("> do_blocking_move_to_xy ", x - (X_PROBE_OFFSET_FROM_EXTRUDER)); + SERIAL_ECHOPAIR("> do_blocking_move_to ", x - (X_PROBE_OFFSET_FROM_EXTRUDER)); SERIAL_ECHOPAIR(", ", y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); + SERIAL_ECHOPAIR(", ", max(current_position[Z_AXIS], Z_RAISE_BETWEEN_PROBINGS)); SERIAL_EOL; } #endif - // this also updates current_position feedrate = XY_PROBE_FEEDRATE; do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); - if (probe_action & ProbeDeploy) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy"); - #endif - deploy_z_probe(); - } + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> deploy_z_probe"); + #endif + deploy_z_probe(); float measured_z = run_z_probe(); - if (probe_action & ProbeStow) { + if (stow) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeStow (stow_z_probe will do Z Raise)"); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> stow_z_probe"); #endif stow_z_probe(); } + #if Z_RAISE_BETWEEN_PROBINGS > 0 + else { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> do_probe_raise"); + #endif + do_probe_raise(Z_RAISE_BETWEEN_PROBINGS); + } + #endif if (verbose_level > 2) { SERIAL_PROTOCOLPGM("Bed X: "); @@ -2172,7 +2171,7 @@ static void clean_up_after_endstop_or_probe_move() { return measured_z; } -#endif // AUTO_BED_LEVELING_FEATURE || Z_MIN_PROBE_REPEATABILITY_TEST +#endif // HAS_BED_PROBE #if ENABLED(AUTO_BED_LEVELING_FEATURE) From f8530c5d1f6fb2ee94357e46717c44ee200eba43 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 19:09:32 -0700 Subject: [PATCH 185/580] Simplified probe_pt function (G28 grid) --- Marlin/Marlin_main.cpp | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index fa8e135c3..9417a65bd 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3390,8 +3390,10 @@ inline void gcode_G28() { bool dryrun = code_seen('D'); - #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY) - bool deploy_probe_for_each_reading = code_seen('E'); + #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) + const bool stow_probe_after_each = false; + #else + bool stow_probe_after_each = code_seen('E'); #endif #if ENABLED(AUTO_BED_LEVELING_GRID) @@ -3548,42 +3550,13 @@ inline void gcode_G28() { for (int xCount = xStart; xCount != xStop; xCount += xInc) { double xProbe = left_probe_bed_position + xGridSpacing * xCount; - // raise extruder - float measured_z, - z_raise = probePointCounter ? Z_RAISE_BETWEEN_PROBINGS : Z_RAISE_BEFORE_PROBING; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("z_raise = ("); - if (probePointCounter) - SERIAL_ECHOPGM("between) "); - else - SERIAL_ECHOPGM("before) "); - SERIAL_ECHOLN(z_raise); - } - #endif - #if ENABLED(DELTA) // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. float distance_from_center = sqrt(xProbe * xProbe + yProbe * yProbe); if (distance_from_center > DELTA_PROBEABLE_RADIUS) continue; #endif //DELTA - #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) - const ProbeAction act = ProbeStay; - #else - ProbeAction act; - if (deploy_probe_for_each_reading) // G29 E - Stow between probes - act = ProbeDeployAndStow; - else if (yCount == 0 && xCount == xStart) - act = ProbeDeploy; - else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc) - act = ProbeStow; - else - act = ProbeStay; - #endif - - measured_z = probe_pt(xProbe, yProbe, z_raise, act, verbose_level); + float measured_z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level); #if DISABLED(DELTA) mean += measured_z; From 89a2aa026b2e72c94eb0dd36d48cebb8a36284b3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 19:22:45 -0700 Subject: [PATCH 186/580] Simplified probe_pt (in M48) --- Marlin/Marlin_main.cpp | 57 ++++++++---------------------------------- 1 file changed, 10 insertions(+), 47 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9417a65bd..abc0b8778 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4204,9 +4204,9 @@ inline void gcode_M42() { Y_current = current_position[Y_AXIS]; #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) - const bool deploy_probe_for_each_reading = false; + const bool stow_probe_after_each = false; #else - bool deploy_probe_for_each_reading = code_seen('E'); + bool stow_probe_after_each = code_seen('E'); #endif float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER; @@ -4259,24 +4259,8 @@ inline void gcode_M42() { setup_for_endstop_or_probe_move(); - do_probe_raise(Z_RAISE_BEFORE_PROBING); - - feedrate = XY_PROBE_FEEDRATE; - do_blocking_move_to_xy(X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER), Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER)); - - /** - * OK, do the initial probe to get us close to the bed. - * Then retrace the right amount and use that in subsequent probes - */ - - // Height before each probe (except the first) - float z_between = deploy_probe_for_each_reading ? Z_RAISE_BEFORE_PROBING : Z_RAISE_BETWEEN_PROBINGS; - - // Deploy the probe and probe the first point - probe_pt(X_probe_location, Y_probe_location, - Z_RAISE_BEFORE_PROBING, - deploy_probe_for_each_reading ? ProbeDeployAndStow : ProbeDeploy, - verbose_level); + // Move to the first point, deploy, and probe + probe_pt(X_probe_location, Y_probe_location, stow_probe_after_each, verbose_level); randomSeed(millis()); @@ -4296,12 +4280,9 @@ inline void gcode_M42() { if (verbose_level > 3) { SERIAL_ECHOPAIR("Starting radius: ", radius); SERIAL_ECHOPAIR(" angle: ", angle); - delay(100); - if (dir > 0) - SERIAL_ECHO(" Direction: Counter Clockwise \n"); - else - SERIAL_ECHO(" Direction: Clockwise \n"); - delay(100); + SERIAL_ECHO(" Direction: "); + if (dir > 0) SERIAL_ECHO("Counter "); + SERIAL_ECHOLN("Clockwise"); } for (uint8_t l = 0; l < n_legs - 1; l++) { @@ -4340,7 +4321,6 @@ inline void gcode_M42() { SERIAL_ECHOPAIR("Pulling point towards center:", X_current); SERIAL_ECHOPAIR(", ", Y_current); SERIAL_EOL; - delay(50); } } #endif @@ -4350,22 +4330,13 @@ inline void gcode_M42() { SERIAL_ECHOPAIR("y: ", Y_current); SERIAL_ECHOPAIR(" z: ", current_position[Z_AXIS]); SERIAL_EOL; - delay(55); } do_blocking_move_to_xy(X_current, Y_current); } // n_legs loop } // n_legs - // The last probe will differ - bool last_probe = (n == n_samples - 1); - // Probe a single point - sample_set[n] = probe_pt( - X_probe_location, Y_probe_location, - z_between, - deploy_probe_for_each_reading ? ProbeDeployAndStow : last_probe ? ProbeStow : ProbeStay, - verbose_level - ); + sample_set[n] = probe_pt(X_probe_location, Y_probe_location, stow_probe_after_each, verbose_level); /** * Get the current mean for the data points we have so far @@ -4391,7 +4362,6 @@ inline void gcode_M42() { SERIAL_PROTOCOL((int)n_samples); SERIAL_PROTOCOLPGM(" z: "); SERIAL_PROTOCOL_F(current_position[Z_AXIS], 6); - delay(50); if (verbose_level > 2) { SERIAL_PROTOCOLPGM(" mean: "); SERIAL_PROTOCOL_F(mean, 6); @@ -4402,17 +4372,10 @@ inline void gcode_M42() { SERIAL_EOL; } - // Raise before the next loop for the legs, - // or do the final raise after the last probe - if (last_probe) - do_probe_raise(Z_RAISE_AFTER_PROBING); - else if (n_legs) { - do_probe_raise(z_between); - if (!last_probe) delay(500); - } - } // End of probe loop + stow_z_probe(); + if (verbose_level > 0) { SERIAL_PROTOCOLPGM("Mean: "); SERIAL_PROTOCOL_F(mean, 6); From 2a4f8665618120b68371de2507f57be97cb0c10b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 20:22:28 -0700 Subject: [PATCH 187/580] Simplified probe_pt (in G29) --- Marlin/Marlin_main.cpp | 116 +++++++++++++---------------------------- 1 file changed, 36 insertions(+), 80 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index abc0b8778..e4d3f731c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3577,10 +3577,39 @@ inline void gcode_G28() { } //xProbe } //yProbe + #else // !AUTO_BED_LEVELING_GRID + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling"); #endif + // Probe at 3 arbitrary points + float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS], + ABL_PROBE_PT_1_Y + home_offset[Y_AXIS], + stow_probe_after_each, verbose_level), + z_at_pt_2 = probe_pt( ABL_PROBE_PT_2_X + home_offset[X_AXIS], + ABL_PROBE_PT_2_Y + home_offset[Y_AXIS], + stow_probe_after_each, verbose_level), + z_at_pt_3 = probe_pt( ABL_PROBE_PT_3_X + home_offset[X_AXIS], + ABL_PROBE_PT_3_Y + home_offset[Y_AXIS], + stow_probe_after_each, verbose_level); + + if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); + + #endif // !AUTO_BED_LEVELING_GRID + + // Raise to Z_RAISE_AFTER_PROBING. Stow the probe. + stow_z_probe(); + + // Restore state after probing + clean_up_after_endstop_or_probe_move(); + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position); + #endif + + // Calculate leveling, print reports, correct the position + #if ENABLED(AUTO_BED_LEVELING_GRID) #if ENABLED(DELTA) if (!dryrun) extrapolate_unprobed_bed_level(); @@ -3676,41 +3705,7 @@ inline void gcode_G28() { } } //do_topography_map #endif //!DELTA - - #else // !AUTO_BED_LEVELING_GRID - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling"); - #endif - - #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) - const ProbeAction p1 = ProbeStay, p2 = ProbeStay, p3 = ProbeStay; - #else - // Actions for each probe - ProbeAction p1, p2, p3; - if (deploy_probe_for_each_reading) - p1 = p2 = p3 = ProbeDeployAndStow; - else - p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow; - #endif - - // Probe at 3 arbitrary points - float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS], - ABL_PROBE_PT_1_Y + home_offset[Y_AXIS], - Z_RAISE_BEFORE_PROBING, - p1, verbose_level), - z_at_pt_2 = probe_pt( ABL_PROBE_PT_2_X + home_offset[X_AXIS], - ABL_PROBE_PT_2_Y + home_offset[Y_AXIS], - Z_RAISE_BETWEEN_PROBINGS, - p2, verbose_level), - z_at_pt_3 = probe_pt( ABL_PROBE_PT_3_X + home_offset[X_AXIS], - ABL_PROBE_PT_3_Y + home_offset[Y_AXIS], - Z_RAISE_BETWEEN_PROBINGS, - p3, verbose_level); - - if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); - - #endif // !AUTO_BED_LEVELING_GRID + #endif // AUTO_BED_LEVELING_GRID #if DISABLED(DELTA) if (verbose_level > 0) @@ -3725,13 +3720,12 @@ inline void gcode_G28() { float x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER, y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER, z_tmp = current_position[Z_AXIS], - real_z = stepper.get_axis_position_mm(Z_AXIS); //get the real Z (since planner.adjusted_position is now correcting the plane) + stepper_z = stepper.get_axis_position_mm(Z_AXIS); //get the real Z (since planner.adjusted_position is now correcting the plane) #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > z_tmp = ", z_tmp); - SERIAL_EOL; - SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > real_z = ", real_z); + SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > stepper_z = ", stepper_z); + SERIAL_ECHOPAIR(" ... z_tmp = ", z_tmp); SERIAL_EOL; } #endif @@ -3739,28 +3733,6 @@ inline void gcode_G28() { // Apply the correction sending the Z probe offset apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); - /* - * Get the current Z position and send it to the planner. - * - * >> (z_tmp - real_z) : The rotated current Z minus the uncorrected Z - * (most recent planner.set_position_mm/sync_plan_position) - * - * >> zprobe_zoffset : Z distance from nozzle to Z probe - * (set by default, M851, EEPROM, or Menu) - * - * >> Z_RAISE_AFTER_PROBING : The distance the Z probe will have lifted - * after the last probe - * - * >> Should home_offset[Z_AXIS] be included? - * - * - * Discussion: home_offset[Z_AXIS] was applied in G28 to set the - * starting Z. If Z is not tweaked in G29 -and- the Z probe in G29 is - * not actually "homing" Z... then perhaps it should not be included - * here. The purpose of home_offset[] is to adjust for inaccurate - * endstops, not for reasonably accurate probes. If it were added - * here, it could be seen as a compensating factor for the Z probe. - */ #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("> AFTER apply_rotation_xyz > z_tmp = ", z_tmp); @@ -3768,30 +3740,16 @@ inline void gcode_G28() { } #endif - current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z) - #if HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) - + Z_RAISE_AFTER_PROBING - #endif - ; - // current_position[Z_AXIS] += home_offset[Z_AXIS]; // The Z probe determines Z=0, not "Z home" + // Adjust the current Z and send it to the planner. + current_position[Z_AXIS] += z_tmp - stepper_z; SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> corrected Z in G29", current_position); #endif } - #endif // !DELTA - // Final raise of Z axis after probing. - raise_z_after_probing(); - - // Stow the probe. Servo will raise if needed. - stow_z_probe(); - - // Restore state after probing - clean_up_after_endstop_or_probe_move(); - #ifdef Z_PROBE_END_SCRIPT #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -3804,9 +3762,7 @@ inline void gcode_G28() { #endif #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("<<< gcode_G29"); - } + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G29"); #endif bed_leveling_in_progress = false; From 6a7045b9bf63df19a3b65de27a3ae8ab3b1c782a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 20:23:19 -0700 Subject: [PATCH 188/580] Remove clean_up_after_endstop_move --- Marlin/Marlin_main.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e4d3f731c..3093c64c0 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1592,9 +1592,6 @@ inline void set_destination_to_current() { memcpy(destination, current_position, // - Reset the command timeout // - Enable the endstops (for endstop moves) // -// clean_up_after_endstop_move() restores -// feedrates, sets endstops back to global state. -// static void setup_for_endstop_or_probe_move() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position); @@ -1619,12 +1616,6 @@ static void clean_up_after_endstop_or_probe_move() { } #if HAS_BED_PROBE - - static void clean_up_after_endstop_move() { - clean_up_after_endstop_or_probe_move(); - endstops.not_homing(); - } - #if ENABLED(DELTA) /** * Calculate delta, start a line, and set current_position to destination From 15a6b49f37124c493c46d076b70a78f9e28f3814 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jun 2016 20:25:46 -0700 Subject: [PATCH 189/580] Simplified probe_pt (in G30) --- Marlin/Marlin_main.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3093c64c0..343173807 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2079,10 +2079,6 @@ static void clean_up_after_endstop_or_probe_move() { return current_position[Z_AXIS]; } -#endif // HAS_BED_PROBE - -#if HAS_PROBING_PROCEDURE - inline void do_blocking_move_to_xy(float x, float y) { do_blocking_move_to(x, y, current_position[Z_AXIS]); } @@ -3774,12 +3770,10 @@ inline void gcode_G28() { setup_for_endstop_or_probe_move(); - deploy_z_probe(); - - stepper.synchronize(); - // TODO: clear the leveling matrix or the planner will be set incorrectly - float measured_z = run_z_probe(); // clears the ABL non-delta matrix only + float measured_z = probe_pt(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER, + current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER, + true, 1); SERIAL_PROTOCOLPGM("Bed X: "); SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001); @@ -3789,8 +3783,6 @@ inline void gcode_G28() { SERIAL_PROTOCOL(measured_z + 0.0001); SERIAL_EOL; - stow_z_probe(); - clean_up_after_endstop_or_probe_move(); report_current_position(); From 74878d1f16de58be7926582fd4d00619ce44106d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Jun 2016 14:46:10 -0700 Subject: [PATCH 190/580] Always do a brief delay in `lcd_quick_feedback` --- Marlin/ultralcd.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 3b33a97a6..cc794d1d7 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1999,9 +1999,8 @@ static void lcd_status_screen() { lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); #elif PIN_EXISTS(BEEPER) buzzer.tone(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #else - delay(LCD_FEEDBACK_FREQUENCY_DURATION_MS); #endif + delay(10); // needed for buttons to settle } /** From da88b00585855be8a2a1da51ea2868e64538246b Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Sat, 25 Jun 2016 21:58:02 +0200 Subject: [PATCH 191/580] MBL: Add support for max z endstop See https://github.com/MarlinFirmware/Marlin/issues/4088 --- Marlin/Marlin_main.cpp | 18 +++++++++++++++--- Marlin/ultralcd.cpp | 6 +++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 934ae9c46..28a6a9c15 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3072,7 +3072,11 @@ inline void gcode_G28() { #if ENABLED(MESH_BED_LEVELING) if (mbl.has_mesh()) { if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) { - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + #if Z_HOME_DIR > 0 + + Z_MAX_POS + #endif + ; SYNC_PLAN_POSITION_KINEMATIC(); mbl.set_active(true); #if ENABLED(MESH_G28_REST_ORIGIN) @@ -3084,7 +3088,11 @@ inline void gcode_G28() { #else current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], - current_position[Y_AXIS] - home_offset[Y_AXIS]); + current_position[Y_AXIS] - home_offset[Y_AXIS]) + #if Z_HOME_DIR > 0 + + Z_MAX_POS + #endif + ; #endif } else if ((axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) && (homeX || homeY)) { @@ -3223,7 +3231,11 @@ inline void gcode_G28() { // For each G29 S2... if (probe_point == 0) { // For the intial G29 S2 make Z a positive value (e.g., 4.0) - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + #if Z_HOME_DIR > 0 + + Z_MAX_POS + #endif + ; SYNC_PLAN_POSITION_KINEMATIC(); } else { diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index cc794d1d7..ea8d8c700 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1057,7 +1057,11 @@ static void lcd_status_screen() { if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING)); if (LCD_CLICKED) { _lcd_level_bed_position = 0; - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + #if Z_HOME_DIR > 0 + + Z_MAX_POS + #endif + ; planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); lcd_goto_screen(_lcd_level_goto_next_point, true); } From b4161cbd98e1c4b925af7489655829ef83a661e5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 25 Jun 2016 17:59:03 -0700 Subject: [PATCH 192/580] Fix debug output in probe_pt --- Marlin/Marlin_main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 934ae9c46..0f2df1530 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2107,10 +2107,9 @@ static void clean_up_after_endstop_or_probe_move() { // Raise by z_raise, then move the Z probe to the given XY #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("> do_blocking_move_to ", x - (X_PROBE_OFFSET_FROM_EXTRUDER)); + SERIAL_ECHOPAIR("> do_blocking_move_to_xy(", x - (X_PROBE_OFFSET_FROM_EXTRUDER)); SERIAL_ECHOPAIR(", ", y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); - SERIAL_ECHOPAIR(", ", max(current_position[Z_AXIS], Z_RAISE_BETWEEN_PROBINGS)); - SERIAL_EOL; + SERIAL_ECHOLNPGM(")"); } #endif From 56c42b572c5f94b11b1a2f9edabfcda84003cbef Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 4 Jun 2016 14:54:20 +0200 Subject: [PATCH 193/580] 3 ms speedup for ST7920 and delay for BOARD_3DRAG and saving ~1k memory by limiting the `#pragma GCC optimize (3)` optimisation to `ultralcd_st7920_u8glib_rrd.h`. These optimisation was and is not done for all the other displays, is the reason for the big additionally use of memory, because the complete 'ultralcd.cpp' and 'dogm_lcd_implementation.h' was optimised (sadly i did not observe a change in speed). Unrolling the loop in `ST7920_SWSPI_SND_8BIT()`, what i expected the optimiser to do, by hand, saved some speed by eliminating the loop variable (i) compares and increases. Every CPU cycle in this loop costs at least 0.5ms per display update because it's executed more than 1k times/s. The delays are now pre-filled with the calculated values for 4.5V driven ST7920. A way to simply add __your__ timing into the configuration was made. At 4.5V 1.) The CLK signal needs to be at least 200ns high and 200ns low. 2.) The DAT pin needs to be set at least 40ns before CLK goes high and must stay at this value until 40ns after CLK went high. A nop takes one processor cycle. For 16MHz one nop lasts 62.5ns. For 20MHz one not lasts 50ns. To fulfill condition 1.) we need 200/62.5 = 3.2 => 4 cycles (200/50 = 4 => 4). For the low phase, setting the pin takes much longer. For the high phase we (theoretically) have to throw in 2 nops, because changing the CLK takes only 2 cycles. Condition 2.) is always fulfilled because the processor needs two cycles (100 - 125ns) for switching the CLK pin. Needs tests and feedback. Especially i cant test 20MHz, 3DRAG and displays supplied wit less than 5V. Are the delays right? Please experiment with longer or shorter delays. And give feedback. Already tested are 5 displays with 4.9V - 5.1V at 16MHz where no delays are needed. --- Marlin/ultralcd_st7920_u8glib_rrd.h | 121 +++++++++++++++++++++++++--- 1 file changed, 109 insertions(+), 12 deletions(-) diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index cc88b5256..1df6343ed 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -27,9 +27,6 @@ #if ENABLED(U8GLIB_ST7920) -//set optimization so ARDUINO optimizes this file -#pragma GCC optimize (3) - #define ST7920_CLK_PIN LCD_PINS_D4 #define ST7920_DAT_PIN LCD_PINS_ENABLE #define ST7920_CS_PIN LCD_PINS_RS @@ -43,20 +40,119 @@ #include +//set optimization so ARDUINO optimizes this file +#pragma GCC push_options +#pragma GCC optimize (3) + +#define DELAY_0_NOP ; +#define DELAY_1_NOP __asm__("nop\n\t"); +#define DELAY_2_NOP __asm__("nop\n\t" "nop\n\t"); +#define DELAY_3_NOP __asm__("nop\n\t" "nop\n\t" "nop\n\t"); +#define DELAY_4_NOP __asm__("nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t"); + + +// If you want you can define your own set of delays in Configuration.h +//#define ST7920_DELAY_1 DELAY_0_NOP +//#define ST7920_DELAY_2 DELAY_0_NOP +//#define ST7920_DELAY_3 DELAY_0_NOP + +#if F_CPU >= 20000000 + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_2_NOP + #endif +#elif MOTHERBOARD == BOARD_3DRAG + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_2_NOP + #endif +#elif F_CPU == 16000000 + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_2_NOP + #endif +#else + #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd.h'" +#endif + static void ST7920_SWSPI_SND_8BIT(uint8_t val) { - uint8_t i; - for (i = 0; i < 8; i++) { WRITE(ST7920_CLK_PIN,0); - #if F_CPU == 20000000 - __asm__("nop\n\t"); - #endif + ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); val<<=1; + ST7920_DELAY_2 + WRITE(ST7920_CLK_PIN,1); + ST7920_DELAY_3 + + WRITE(ST7920_CLK_PIN,0); + ST7920_DELAY_1 + WRITE(ST7920_DAT_PIN,val&0x80); + val<<=1; + ST7920_DELAY_2 + WRITE(ST7920_CLK_PIN,1); + ST7920_DELAY_3 + + WRITE(ST7920_CLK_PIN,0); + ST7920_DELAY_1 + WRITE(ST7920_DAT_PIN,val&0x80); + val<<=1; + ST7920_DELAY_2 + WRITE(ST7920_CLK_PIN,1); + ST7920_DELAY_3 + + WRITE(ST7920_CLK_PIN,0); + ST7920_DELAY_1 + WRITE(ST7920_DAT_PIN,val&0x80); + val<<=1; + ST7920_DELAY_2 + WRITE(ST7920_CLK_PIN,1); + ST7920_DELAY_3 + + WRITE(ST7920_CLK_PIN,0); + ST7920_DELAY_1 + WRITE(ST7920_DAT_PIN,val&0x80); + val<<=1; + ST7920_DELAY_2 + WRITE(ST7920_CLK_PIN,1); + ST7920_DELAY_3 + + WRITE(ST7920_CLK_PIN,0); + ST7920_DELAY_1 + WRITE(ST7920_DAT_PIN,val&0x80); + val<<=1; + ST7920_DELAY_2 + WRITE(ST7920_CLK_PIN,1); + ST7920_DELAY_3 + + WRITE(ST7920_CLK_PIN,0); + ST7920_DELAY_1 + WRITE(ST7920_DAT_PIN,val&0x80); + val<<=1; + ST7920_DELAY_2 + WRITE(ST7920_CLK_PIN,1); + ST7920_DELAY_3 + + WRITE(ST7920_CLK_PIN,0); + ST7920_DELAY_1 + WRITE(ST7920_DAT_PIN,val&0x80); + val<<=1; + ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); - #if F_CPU == 20000000 - __asm__("nop\n\t""nop\n\t"); - #endif - } } #define ST7920_CS() {WRITE(ST7920_CS_PIN,1);u8g_10MicroDelay();} @@ -138,6 +234,7 @@ class U8GLIB_ST7920_128X64_RRD : public U8GLIB { U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) { UNUSED(dummy); } }; +#pragma GCC pop_options #endif //U8GLIB_ST7920 #endif //ULCDST7920_H From 4454d80276f4097f2e9713848df3efd9e5b431f0 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 7 Jun 2016 13:45:35 +0200 Subject: [PATCH 194/580] Decrease the needed nops to 1 by shitfing the left shift into the high phase. ``` 2 cbi 0x2,1 ;set CLK // 1 in r18,__SREG__ //1 1-3 sbrc r24,7 //2-4 2 rjmp .L19 //4 1 cli .L19: //5 2 lds r25,258 lds r25,258 //7 1 andi r25,lo8(-2) ori r25,lo8(1) //8 2 sts 258,r25 sts 258,r25 //10 1 out __SREG__,r18 out __SREG__,r18 //11 2 .L3: rjmp .L3 //13 //2 2 sbi 0x2,1 ;reset CLK // //13-15 //2-4 1 lsl r24 ; val //1 1 nop //2 2 cbi 0x2,1 ;set CLK //4 ... ``` --- Marlin/ultralcd_st7920_u8glib_rrd.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index 1df6343ed..9611efe6c 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -41,7 +41,6 @@ #include //set optimization so ARDUINO optimizes this file -#pragma GCC push_options #pragma GCC optimize (3) #define DELAY_0_NOP ; @@ -64,9 +63,9 @@ #define ST7920_DELAY_2 DELAY_0_NOP #endif #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_2_NOP + #define ST7920_DELAY_3 DELAY_1_NOP #endif -#elif MOTHERBOARD == BOARD_3DRAG +#elif (MOTHERBOARD == BOARD_3DRAG) || (MOTHERBOARD == BOARD_K8200) #ifndef ST7920_DELAY_1 #define ST7920_DELAY_1 DELAY_0_NOP #endif @@ -74,7 +73,7 @@ #define ST7920_DELAY_2 DELAY_0_NOP #endif #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_2_NOP + #define ST7920_DELAY_3 DELAY_1_NOP #endif #elif F_CPU == 16000000 #ifndef ST7920_DELAY_1 @@ -84,7 +83,7 @@ #define ST7920_DELAY_2 DELAY_0_NOP #endif #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_2_NOP + #define ST7920_DELAY_3 DELAY_1_NOP #endif #else #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd.h'" @@ -94,63 +93,62 @@ static void ST7920_SWSPI_SND_8BIT(uint8_t val) { WRITE(ST7920_CLK_PIN,0); ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); - val<<=1; ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); + val<<=1; ST7920_DELAY_3 WRITE(ST7920_CLK_PIN,0); ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); - val<<=1; ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); + val<<=1; ST7920_DELAY_3 WRITE(ST7920_CLK_PIN,0); ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); - val<<=1; ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); + val<<=1; ST7920_DELAY_3 WRITE(ST7920_CLK_PIN,0); ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); - val<<=1; ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); + val<<=1; ST7920_DELAY_3 WRITE(ST7920_CLK_PIN,0); ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); - val<<=1; ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); + val<<=1; ST7920_DELAY_3 WRITE(ST7920_CLK_PIN,0); ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); - val<<=1; ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); + val<<=1; ST7920_DELAY_3 WRITE(ST7920_CLK_PIN,0); ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); - val<<=1; ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); + val<<=1; ST7920_DELAY_3 WRITE(ST7920_CLK_PIN,0); ST7920_DELAY_1 WRITE(ST7920_DAT_PIN,val&0x80); - val<<=1; ST7920_DELAY_2 WRITE(ST7920_CLK_PIN,1); } @@ -234,7 +232,7 @@ class U8GLIB_ST7920_128X64_RRD : public U8GLIB { U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) { UNUSED(dummy); } }; -#pragma GCC pop_options +#pragma GCC reset_options #endif //U8GLIB_ST7920 #endif //ULCDST7920_H From b4076883ccd611e1e0e1de6e863803f3b43c4215 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 14 Jun 2016 11:08:28 +0200 Subject: [PATCH 195/580] Set testet delays for K8200, RAMBO, MINIRAMBO and ST7920 --- Marlin/ultralcd_st7920_u8glib_rrd.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index 9611efe6c..699934cef 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -66,6 +66,26 @@ #define ST7920_DELAY_3 DELAY_1_NOP #endif #elif (MOTHERBOARD == BOARD_3DRAG) || (MOTHERBOARD == BOARD_K8200) + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_3_NOP + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_0_NOP + #endif +#elif (MOTHERBOARD == BOARD_MINIRAMBO) + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_4_NOP + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_0_NOP + #endif +#elif (MOTHERBOARD == BOARD_RAMBO) #ifndef ST7920_DELAY_1 #define ST7920_DELAY_1 DELAY_0_NOP #endif @@ -73,7 +93,7 @@ #define ST7920_DELAY_2 DELAY_0_NOP #endif #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_1_NOP + #define ST7920_DELAY_3 DELAY_0_NOP #endif #elif F_CPU == 16000000 #ifndef ST7920_DELAY_1 From a7684eef7a214b47ff59ae94e902fe896efb66c5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 25 Jun 2016 18:32:13 -0700 Subject: [PATCH 196/580] Squish code in ST7920 --- Marlin/ultralcd_st7920_u8glib_rrd.h | 153 ++++++++-------------------- 1 file changed, 43 insertions(+), 110 deletions(-) diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index 699934cef..a87c19e8e 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -43,11 +43,11 @@ //set optimization so ARDUINO optimizes this file #pragma GCC optimize (3) -#define DELAY_0_NOP ; -#define DELAY_1_NOP __asm__("nop\n\t"); -#define DELAY_2_NOP __asm__("nop\n\t" "nop\n\t"); -#define DELAY_3_NOP __asm__("nop\n\t" "nop\n\t" "nop\n\t"); -#define DELAY_4_NOP __asm__("nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t"); +#define DELAY_0_NOP NOOP +#define DELAY_1_NOP __asm__("nop\n\t") +#define DELAY_2_NOP __asm__("nop\n\t" "nop\n\t") +#define DELAY_3_NOP __asm__("nop\n\t" "nop\n\t" "nop\n\t") +#define DELAY_4_NOP __asm__("nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t") // If you want you can define your own set of delays in Configuration.h @@ -56,121 +56,54 @@ //#define ST7920_DELAY_3 DELAY_0_NOP #if F_CPU >= 20000000 - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_0_NOP - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_0_NOP - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_1_NOP - #endif + #define CPU_ST7920_DELAY_1 DELAY_0_NOP + #define CPU_ST7920_DELAY_2 DELAY_0_NOP + #define CPU_ST7920_DELAY_3 DELAY_1_NOP #elif (MOTHERBOARD == BOARD_3DRAG) || (MOTHERBOARD == BOARD_K8200) - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_0_NOP - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_3_NOP - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_0_NOP - #endif + #define CPU_ST7920_DELAY_1 DELAY_0_NOP + #define CPU_ST7920_DELAY_2 DELAY_3_NOP + #define CPU_ST7920_DELAY_3 DELAY_0_NOP #elif (MOTHERBOARD == BOARD_MINIRAMBO) - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_0_NOP - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_4_NOP - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_0_NOP - #endif + #define CPU_ST7920_DELAY_1 DELAY_0_NOP + #define CPU_ST7920_DELAY_2 DELAY_4_NOP + #define CPU_ST7920_DELAY_3 DELAY_0_NOP #elif (MOTHERBOARD == BOARD_RAMBO) - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_0_NOP - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_0_NOP - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_0_NOP - #endif + #define CPU_ST7920_DELAY_1 DELAY_0_NOP + #define CPU_ST7920_DELAY_2 DELAY_0_NOP + #define CPU_ST7920_DELAY_3 DELAY_0_NOP #elif F_CPU == 16000000 - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_0_NOP - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_0_NOP - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_1_NOP - #endif + #define CPU_ST7920_DELAY_1 DELAY_0_NOP + #define CPU_ST7920_DELAY_2 DELAY_0_NOP + #define CPU_ST7920_DELAY_3 DELAY_1_NOP #else #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd.h'" #endif -static void ST7920_SWSPI_SND_8BIT(uint8_t val) { - WRITE(ST7920_CLK_PIN,0); - ST7920_DELAY_1 - WRITE(ST7920_DAT_PIN,val&0x80); - ST7920_DELAY_2 - WRITE(ST7920_CLK_PIN,1); - val<<=1; - ST7920_DELAY_3 - - WRITE(ST7920_CLK_PIN,0); - ST7920_DELAY_1 - WRITE(ST7920_DAT_PIN,val&0x80); - ST7920_DELAY_2 - WRITE(ST7920_CLK_PIN,1); - val<<=1; - ST7920_DELAY_3 - - WRITE(ST7920_CLK_PIN,0); - ST7920_DELAY_1 - WRITE(ST7920_DAT_PIN,val&0x80); - ST7920_DELAY_2 - WRITE(ST7920_CLK_PIN,1); - val<<=1; - ST7920_DELAY_3 - - WRITE(ST7920_CLK_PIN,0); - ST7920_DELAY_1 - WRITE(ST7920_DAT_PIN,val&0x80); - ST7920_DELAY_2 - WRITE(ST7920_CLK_PIN,1); - val<<=1; - ST7920_DELAY_3 - - WRITE(ST7920_CLK_PIN,0); - ST7920_DELAY_1 - WRITE(ST7920_DAT_PIN,val&0x80); - ST7920_DELAY_2 - WRITE(ST7920_CLK_PIN,1); - val<<=1; - ST7920_DELAY_3 - - WRITE(ST7920_CLK_PIN,0); - ST7920_DELAY_1 - WRITE(ST7920_DAT_PIN,val&0x80); - ST7920_DELAY_2 - WRITE(ST7920_CLK_PIN,1); - val<<=1; - ST7920_DELAY_3 +#ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 +#endif +#ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 CPU_ST7920_DELAY_2 +#endif +#ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 +#endif - WRITE(ST7920_CLK_PIN,0); - ST7920_DELAY_1 - WRITE(ST7920_DAT_PIN,val&0x80); - ST7920_DELAY_2 - WRITE(ST7920_CLK_PIN,1); - val<<=1; - ST7920_DELAY_3 +#define ST7920_SND_BIT \ + WRITE(ST7920_CLK_PIN, LOW); ST7920_DELAY_1; \ + WRITE(ST7920_DAT_PIN, val & 0x80); ST7920_DELAY_2; \ + WRITE(ST7920_CLK_PIN, HIGH); ST7920_DELAY_3; \ + val <<= 1 - WRITE(ST7920_CLK_PIN,0); - ST7920_DELAY_1 - WRITE(ST7920_DAT_PIN,val&0x80); - ST7920_DELAY_2 - WRITE(ST7920_CLK_PIN,1); +static void ST7920_SWSPI_SND_8BIT(uint8_t val) { + ST7920_SND_BIT; // 1 + ST7920_SND_BIT; // 2 + ST7920_SND_BIT; // 3 + ST7920_SND_BIT; // 4 + ST7920_SND_BIT; // 5 + ST7920_SND_BIT; // 6 + ST7920_SND_BIT; // 7 + ST7920_SND_BIT; // 8 } #define ST7920_CS() {WRITE(ST7920_CS_PIN,1);u8g_10MicroDelay();} From 3fa631130f2f93e7e95d72d6052df52011d99c61 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 25 Jun 2016 19:19:31 -0700 Subject: [PATCH 197/580] Ensure a minimum height before XY move in probe_pt --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 271fda4d3..953a88fdc 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2104,7 +2104,10 @@ static void clean_up_after_endstop_or_probe_move() { float old_feedrate = feedrate; - // Raise by z_raise, then move the Z probe to the given XY + // Ensure a minimum height before moving the probe + do_probe_raise(Z_RAISE_BETWEEN_PROBINGS); + + // Move to the XY where we shall probe #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("> do_blocking_move_to_xy(", x - (X_PROBE_OFFSET_FROM_EXTRUDER)); @@ -2112,7 +2115,6 @@ static void clean_up_after_endstop_or_probe_move() { SERIAL_ECHOLNPGM(")"); } #endif - feedrate = XY_PROBE_FEEDRATE; do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); From 10da7ac86c30321880e9ac8f2028b7e9035bc208 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jun 2016 13:56:30 -0700 Subject: [PATCH 198/580] Combine Z raise before/after options --- Marlin/Conditionals.h | 8 ++++++++ Marlin/Configuration.h | 7 ++----- Marlin/Marlin_main.cpp | 20 +++++++++---------- .../Cartesio/Configuration.h | 7 ++----- .../Felix/Configuration.h | 7 ++----- .../Felix/DUAL/Configuration.h | 7 ++----- .../Hephestos/Configuration.h | 7 ++----- .../Hephestos_2/Configuration.h | 7 ++----- .../K8200/Configuration.h | 7 ++----- .../RepRapWorld/Megatronics/Configuration.h | 7 ++----- .../RigidBot/Configuration.h | 7 ++----- .../SCARA/Configuration.h | 7 ++----- .../TAZ4/Configuration.h | 7 ++----- .../WITBOX/Configuration.h | 7 ++----- .../adafruit/ST7565/Configuration.h | 7 ++----- .../delta/biv2.5/Configuration.h | 7 ++----- .../delta/generic/Configuration.h | 7 ++----- .../delta/kossel_mini/Configuration.h | 7 ++----- .../delta/kossel_pro/Configuration.h | 7 ++----- .../delta/kossel_xl/Configuration.h | 7 ++----- .../makibox/Configuration.h | 7 ++----- .../tvrrug/Round2/Configuration.h | 7 ++----- 22 files changed, 58 insertions(+), 110 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index c1db34cb1..f88b41d8b 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -796,6 +796,14 @@ #define XY_PROBE_SPEED 4000 #endif #endif + #ifndef Z_RAISE_PROBE_DEPLOY_STOW + #if defined(Z_RAISE_BEFORE_PROBING) && defined(Z_RAISE_AFTER_PROBING) + #define Z_RAISE_PROBE_DEPLOY_STOW (max(Z_RAISE_BEFORE_PROBING, Z_RAISE_AFTER_PROBING)) + #else + #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration." + #endif + #endif + #define _Z_RAISE_PROBE_DEPLOY_STOW (max(Z_RAISE_PROBE_DEPLOY_STOW, Z_RAISE_BETWEEN_PROBINGS)) #endif /** diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ce046ca64..01c10530a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -509,12 +509,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 271fda4d3..b41065bb4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1767,8 +1767,8 @@ static void clean_up_after_endstop_or_probe_move() { float oldXpos = current_position[X_AXIS]; // save x position float old_feedrate = feedrate; if (dock) { - #if Z_RAISE_AFTER_PROBING > 0 - do_probe_raise(Z_RAISE_AFTER_PROBING); + #if _Z_RAISE_PROBE_DEPLOY_STOW > 0 + do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); #endif // Dock sled a bit closer to ensure proper capturing feedrate = XY_PROBE_FEEDRATE; @@ -1778,7 +1778,7 @@ static void clean_up_after_endstop_or_probe_move() { else { feedrate = XY_PROBE_FEEDRATE; float z_loc = current_position[Z_AXIS]; - if (z_loc < Z_RAISE_BEFORE_PROBING + 5) z_loc = Z_RAISE_BEFORE_PROBING; + if (z_loc < _Z_RAISE_PROBE_DEPLOY_STOW + 5) z_loc = _Z_RAISE_PROBE_DEPLOY_STOW; do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], z_loc); // this also updates current_position digitalWrite(SLED_PIN, HIGH); // turn on magnet } @@ -1800,8 +1800,8 @@ static void clean_up_after_endstop_or_probe_move() { if (endstops.z_probe_enabled) return; // Make room for probe - #if Z_RAISE_BEFORE_PROBING > 0 - do_probe_raise(Z_RAISE_BEFORE_PROBING); + #if _Z_RAISE_PROBE_DEPLOY_STOW > 0 + do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); #endif #if ENABLED(Z_PROBE_SLED) @@ -1904,8 +1904,8 @@ static void clean_up_after_endstop_or_probe_move() { if (!endstops.z_probe_enabled) return; // Make more room for the servo - #if Z_RAISE_AFTER_PROBING > 0 - do_probe_raise(Z_RAISE_AFTER_PROBING); + #if _Z_RAISE_PROBE_DEPLOY_STOW > 0 + do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); #endif #if ENABLED(Z_PROBE_SLED) @@ -1924,8 +1924,8 @@ static void clean_up_after_endstop_or_probe_move() { // Move up for safety feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE; - #if Z_RAISE_AFTER_PROBING > 0 - destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; + #if _Z_RAISE_PROBE_DEPLOY_STOW > 0 + destination[Z_AXIS] = current_position[Z_AXIS] + _Z_RAISE_PROBE_DEPLOY_STOW; prepare_move_to_destination_raw(); // this will also set_current_to_destination #endif @@ -3596,7 +3596,7 @@ inline void gcode_G28() { #endif // !AUTO_BED_LEVELING_GRID - // Raise to Z_RAISE_AFTER_PROBING. Stow the probe. + // Raise to _Z_RAISE_PROBE_DEPLOY_STOW. Stow the probe. stow_z_probe(); // Restore state after probing diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 69997fbab..915be5b55 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -508,12 +508,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 9acb21c1c..62aa357f8 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -491,12 +491,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 9431c2084..e20fa1211 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -489,12 +489,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index fd98445be..a1995b3b3 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -501,12 +501,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 78ec36f71..f15ad7a48 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -503,12 +503,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 5 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 5 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 5 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 2 // Raise between probing points. // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 115e69d61..54362c250 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -526,12 +526,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index a0445647f..356c706c8 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -509,12 +509,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 5f069bac5..91e5dba80 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -503,12 +503,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index ee7a0e0f8..cc10ca773 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -517,12 +517,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 043ebb3f3..77a5b1d96 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -530,12 +530,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index a15f582e0..b56080872 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -501,12 +501,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index e56c6b327..5039f64e9 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -509,12 +509,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index f4147a0cc..aca16d02d 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -588,12 +588,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 50 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index f84451d8e..5e2afed02 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -582,12 +582,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index d6b6405af..f27d37710 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -585,12 +585,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 50 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 50 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index d6572bb97..36fbd8e1a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -579,12 +579,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 100 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 100 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 49dc55403..48cc54fff 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -580,12 +580,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 20 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 20 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 20 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 10 // Raise between probing points. // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 444c46e23..f1b0c813d 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -512,12 +512,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 5d46e05e9..b693cb22b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -499,12 +499,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo //#define Z_MIN_PROBE_REPEATABILITY_TEST // -// Probe Raise options provide clearance for the probe to deploy and stow. +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. // -// For G28 these apply when the probe deploys and stows. -// For G29 these apply before and after the full procedure. -#define Z_RAISE_BEFORE_PROBING 15 // Raise before probe deploy (e.g., the first probe). -#define Z_RAISE_AFTER_PROBING 15 // Raise before probe stow (e.g., the last probe). +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // From 829c92f1bae8ac40a8706113a751edc35eb53fcd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jun 2016 15:38:54 -0700 Subject: [PATCH 199/580] Use Z_RAISE_BETWEEN_PROBINGS with MBL --- Marlin/Marlin_main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 132dc21f9..989134316 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3137,7 +3137,9 @@ inline void gcode_G28() { feedrate = homing_feedrate[X_AXIS]; current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - #if MIN_Z_HEIGHT_FOR_HOMING > 0 + #if Z_RAISE_BETWEEN_PROBINGS > MIN_Z_HEIGHT_FOR_HOMING + + Z_RAISE_BETWEEN_PROBINGS + #elif MIN_Z_HEIGHT_FOR_HOMING > 0 + MIN_Z_HEIGHT_FOR_HOMING #endif ; @@ -3147,7 +3149,7 @@ inline void gcode_G28() { current_position[Y_AXIS] = y + home_offset[Y_AXIS]; line_to_current_position(); - #if MIN_Z_HEIGHT_FOR_HOMING > 0 + #if Z_RAISE_BETWEEN_PROBINGS > 0 || MIN_Z_HEIGHT_FOR_HOMING > 0 current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; line_to_current_position(); #endif @@ -3252,7 +3254,9 @@ inline void gcode_G28() { else { // One last "return to the bed" (as originally coded) at completion current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - #if MIN_Z_HEIGHT_FOR_HOMING > 0 + #if Z_RAISE_BETWEEN_PROBINGS > MIN_Z_HEIGHT_FOR_HOMING + + Z_RAISE_BETWEEN_PROBINGS + #elif MIN_Z_HEIGHT_FOR_HOMING > 0 + MIN_Z_HEIGHT_FOR_HOMING #endif ; From 511503ede9c4e4edcfaa8611eee2cd62b5298474 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Jun 2016 12:04:49 -0700 Subject: [PATCH 200/580] CARTESIO_UI has lcd contrast --- Marlin/Conditionals.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index f88b41d8b..5e70cb04a 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -255,6 +255,7 @@ #define HAS_LCD_CONTRAST ( \ ENABLED(MAKRPANEL) \ + || ENABLED(CARTESIO_UI) \ || ENABLED(VIKI2) \ || ENABLED(miniVIKI) \ || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ From 593c8bf2861da587e1d6fae765f211bdab56b066 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Jun 2016 12:35:20 -0700 Subject: [PATCH 201/580] Support for Rigidbot V2 --- Marlin/boards.h | 1 + .../RigidBot/Configuration.h | 5 ++- Marlin/pins.h | 2 + Marlin/pins_RIGIDBOARD_V2.h | 40 +++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 Marlin/pins_RIGIDBOARD_V2.h diff --git a/Marlin/boards.h b/Marlin/boards.h index e85e68284..ae03bdec7 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -40,6 +40,7 @@ #define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 (Power outputs: Spindle, Controller Fan) #define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) #define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard +#define BOARD_RIGIDBOARD_V2 52 // Invent-A-Part RigidBoard V2 #define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Hotend, Fan, Bed) #define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed) #define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 91e5dba80..a0abbeda8 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -117,8 +117,11 @@ // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup +// for Rigidbot version 1 : #define MOTHERBOARD BOARD_RIGIDBOARD +// for Rigidbot Version 2 : #define MOTHERBOARD BOARD_RIGIDBOARD_V2 + #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RIGIDBOARD + #define MOTHERBOARD BOARD_RIGIDBOARD_V2 #endif // Optional custom name for your RepStrap or other custom machine diff --git a/Marlin/pins.h b/Marlin/pins.h index 4a090f348..bbabe53be 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -129,6 +129,8 @@ #include "pins_MKS_BASE.h" #elif MB(RIGIDBOARD) #include "pins_RIGIDBOARD.h" +#elif MB(RIGIDBOARD_V2) + #include "pins_RIGIDBOARD_V2.h" #elif MB(MEGACONTROLLER) #include "pins_MEGACONTROLLER.h" #elif MB(BQ_ZUM_MEGA_3D) diff --git a/Marlin/pins_RIGIDBOARD_V2.h b/Marlin/pins_RIGIDBOARD_V2.h new file mode 100644 index 000000000..1226c56de --- /dev/null +++ b/Marlin/pins_RIGIDBOARD_V2.h @@ -0,0 +1,40 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * RIGIDBOARD V2 Arduino Mega with RAMPS v1.4 pin assignments + */ + +#include "pins_RIGIDBOARD.h" + +// I2C based DAC like on the Printrboard REVF +#define DAC_STEPPER_CURRENT +// Channels available for DAC, For Rigidboard there are 4 +#define DAC_STEPPER_ORDER {0,1,2,3} + +#define DAC_STEPPER_SENSE 0.11 +#define DAC_STEPPER_ADDRESS 0 +#define DAC_STEPPER_MAX 5000 +#define DAC_STEPPER_VREF 1 //internal Vref, gain 1x = 2.048V +#define DAC_STEPPER_GAIN 0 +#define DAC_DISABLE_PIN 42 // set low to enable DAC +#define DAC_OR_ADDRESS 0x01 From 6c60869409ade7707587f50d15b776fe7deadc8c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Jun 2016 12:36:21 -0700 Subject: [PATCH 202/580] Support DAC_OR_ADDRESS in Printrboard too --- Marlin/dac_mcp4728.h | 4 +++- Marlin/pins_PRINTRBOARD_REVF.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/dac_mcp4728.h b/Marlin/dac_mcp4728.h index e1739c563..1f659bf88 100644 --- a/Marlin/dac_mcp4728.h +++ b/Marlin/dac_mcp4728.h @@ -50,7 +50,9 @@ #define GAINWRITE 0B11000000 // This is taken from the original lib, makes it easy to edit if needed -#define DAC_DEV_ADDRESS (BASE_ADDR | 0x00) +// DAC_OR_ADDRESS defined in pins_BOARD.h file +#define DAC_DEV_ADDRESS (BASE_ADDR | DAC_OR_ADDRESS) + void mcp4728_init(); uint8_t mcp4728_analogWrite(uint8_t channel, uint16_t value); diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h index c6773466f..799eb37c6 100644 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ b/Marlin/pins_PRINTRBOARD_REVF.h @@ -89,6 +89,7 @@ #define DAC_STEPPER_MAX 3520 #define DAC_STEPPER_VREF 1 //internal Vref, gain 1x = 2.048V #define DAC_STEPPER_GAIN 0 +#define DAC_OR_ADDRESS 0x00 #if DISABLED(SDSUPPORT) // these pins are defined in the SD library if building with SD support From e616093d4c07f7de0dc2723c78da91aaf7ae3284 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 27 Jun 2016 18:09:22 +0200 Subject: [PATCH 203/580] Simplify dock_sled() `dock_sled()` is never called with offset parameter - remove it. We move x only - so only that needs to be homed. Consequence is - we can home to z-min now with a sled probe! Feedrates are set and restored in `do_blocking_move()`. We already checked if the probe is deployed/stowed in deploy/stow_probe. ``` if (z_loc < _Z_RAISE_PROBE_DEPLOY_STOW + 5) z_loc = _Z_RAISE_PROBE_DEPLOY_STOW; ``` makes no sense - remove. Now the raise is the same for deploy/stow -> move before the if. Replace the if with a ternary. Instead writing LOW/HIGH use the boolean `stow` we already have. There is no reason for not using the sled probe in G29/M48 with 'E'. It takes a while but works. (tested!) --- Marlin/Marlin_main.cpp | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 989134316..d501be804 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1746,45 +1746,30 @@ static void clean_up_after_endstop_or_probe_move() { /** * Method to dock/undock a sled designed by Charles Bell. * - * dock[in] If true, move to MAX_X and engage the electromagnet - * offset[in] The additional distance to move to adjust docking location + * stow[in] If false, move to MAX_X and engage the solenoid + * If true, move to MAX_X and release the solenoid */ - static void dock_sled(bool dock, int offset = 0) { + static void dock_sled(bool stow) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("dock_sled(", dock); + SERIAL_ECHOPAIR("dock_sled(", stow); SERIAL_ECHOLNPGM(")"); } #endif - if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) { + if (!axis_homed[X_AXIS]) { axis_unhomed_error(true); return; } - if (endstops.z_probe_enabled == !dock) return; // already docked/undocked? - float oldXpos = current_position[X_AXIS]; // save x position - float old_feedrate = feedrate; - if (dock) { - #if _Z_RAISE_PROBE_DEPLOY_STOW > 0 - do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); - #endif - // Dock sled a bit closer to ensure proper capturing - feedrate = XY_PROBE_FEEDRATE; - do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); - digitalWrite(SLED_PIN, LOW); // turn off magnet - } - else { - feedrate = XY_PROBE_FEEDRATE; - float z_loc = current_position[Z_AXIS]; - if (z_loc < _Z_RAISE_PROBE_DEPLOY_STOW + 5) z_loc = _Z_RAISE_PROBE_DEPLOY_STOW; - do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], z_loc); // this also updates current_position - digitalWrite(SLED_PIN, HIGH); // turn on magnet - } + + // Dock sled a bit closer to ensure proper capturing + do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0)); + digitalWrite(SLED_PIN, !stow); // switch solenoid + do_blocking_move_to_x(oldXpos); // return to position before docking - feedrate = old_feedrate; } #endif // Z_PROBE_SLED @@ -3394,7 +3379,7 @@ inline void gcode_G28() { bool dryrun = code_seen('D'); - #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) + #if ENABLED(Z_PROBE_ALLEN_KEY) const bool stow_probe_after_each = false; #else bool stow_probe_after_each = code_seen('E'); @@ -4159,7 +4144,7 @@ inline void gcode_M42() { float X_current = current_position[X_AXIS], Y_current = current_position[Y_AXIS]; - #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) + #if ENABLED(Z_PROBE_ALLEN_KEY) const bool stow_probe_after_each = false; #else bool stow_probe_after_each = code_seen('E'); From 39883d03fca7c12f662cbf88627998bde228a822 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 28 Jun 2016 00:46:40 +0200 Subject: [PATCH 204/580] universalize axis_unhomed_error() --- Marlin/Marlin_main.cpp | 87 ++++++++++++++++++------------------ Marlin/language_an.h | 3 +- Marlin/language_bg.h | 3 +- Marlin/language_ca.h | 3 +- Marlin/language_cn.h | 3 +- Marlin/language_cz.h | 4 +- Marlin/language_da.h | 4 +- Marlin/language_de.h | 3 +- Marlin/language_en.h | 8 ++-- Marlin/language_es.h | 4 +- Marlin/language_eu.h | 3 +- Marlin/language_fi.h | 3 +- Marlin/language_fr.h | 3 +- Marlin/language_gl.h | 4 +- Marlin/language_hr.h | 4 +- Marlin/language_it.h | 4 +- Marlin/language_kana.h | 5 +++ Marlin/language_kana_utf8.h | 4 +- Marlin/language_nl.h | 3 +- Marlin/language_pl.h | 3 +- Marlin/language_pt-br.h | 3 +- Marlin/language_pt-br_utf8.h | 3 +- Marlin/language_pt.h | 3 +- Marlin/language_pt_utf8.h | 3 +- 24 files changed, 94 insertions(+), 76 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d501be804..c797981b4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1723,17 +1723,30 @@ static void clean_up_after_endstop_or_probe_move() { #endif //HAS_BED_PROBE #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE - static void axis_unhomed_error(bool xyz=false) { - if (xyz) { - LCD_MESSAGEPGM(MSG_XYZ_UNHOMED); + static bool axis_unhomed_error(const bool x, const bool y, const bool z) { + const bool xx = x && !axis_homed[X_AXIS], + yy = y && !axis_homed[Y_AXIS], + zz = z && !axis_homed[Z_AXIS]; + if (xx || yy || zz) { SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_XYZ_UNHOMED); - } - else { - LCD_MESSAGEPGM(MSG_YX_UNHOMED); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_YX_UNHOMED); + SERIAL_ECHOPGM(MSG_HOME " "); + if (xx) SERIAL_ECHOPGM(MSG_X); + if (yy) SERIAL_ECHOPGM(MSG_Y); + if (zz) SERIAL_ECHOPGM(MSG_Z); + SERIAL_ECHOLNPGM(" " MSG_FIRST); + + #if ENABLED(ULTRA_LCD) + char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1 + strcat_P(message, PSTR(MSG_HOME " ")); + if (xx) strcat_P(message, PSTR(MSG_X)); + if (yy) strcat_P(message, PSTR(MSG_Y)); + if (zz) strcat_P(message, PSTR(MSG_Z)); + strcat_P(message, PSTR(" " MSG_FIRST)); + lcd_setstatus(message); + #endif + return true; } + return false; } #endif @@ -1757,10 +1770,7 @@ static void clean_up_after_endstop_or_probe_move() { } #endif - if (!axis_homed[X_AXIS]) { - axis_unhomed_error(true); - return; - } + if (axis_unhomed_error(true, false, false)) return; float oldXpos = current_position[X_AXIS]; // save x position @@ -3000,32 +3010,27 @@ inline void gcode_G28() { else if (homeZ) { // Don't need to Home Z twice // Let's see if X and Y are homed - if (axis_homed[X_AXIS] && axis_homed[Y_AXIS]) { - - /** - * Make sure the Z probe is within the physical limits - * NOTE: This doesn't necessarily ensure the Z probe is also - * within the bed! - */ - float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS]; - if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) - && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) - && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) - && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) { - - // Home the Z axis - HOMEAXIS(Z); - } - else { - LCD_MESSAGEPGM(MSG_ZPROBE_OUT); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT); - } + if (axis_unhomed_error(true, true, false)) return; + + /** + * Make sure the Z probe is within the physical limits + * NOTE: This doesn't necessarily ensure the Z probe is also + * within the bed! + */ + float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS]; + if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) + && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) + && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) + && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) { + + // Home the Z axis + HOMEAXIS(Z); } else { - axis_unhomed_error(); + LCD_MESSAGEPGM(MSG_ZPROBE_OUT); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT); } - } // !home_all_axes && homeZ #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3366,10 +3371,7 @@ inline void gcode_G28() { #endif // Don't allow auto-leveling without homing first - if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) { - axis_unhomed_error(true); - return; - } + if (axis_unhomed_error(true, true, true)) return; int verbose_level = code_seen('V') ? code_value_int() : 1; if (verbose_level < 0 || verbose_level > 4) { @@ -4121,10 +4123,7 @@ inline void gcode_M42() { */ inline void gcode_M48() { - if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) { - axis_unhomed_error(true); - return; - } + if (axis_unhomed_error(true, true, true)) return; int8_t verbose_level = code_seen('V') ? code_value_byte() : 1; if (verbose_level < 0 || verbose_level > 4) { diff --git a/Marlin/language_an.h b/Marlin/language_an.h index fbfb4dd0c..968fa5168 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -142,7 +142,8 @@ #define MSG_INIT_SDCARD "Encetan. tarcheta" #define MSG_CNG_SDCARD "Cambiar tarcheta" #define MSG_ZPROBE_OUT "Z probe out. bed" -#define MSG_YX_UNHOMED "Home X/Y before Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index c86e97b7d..3fc7a5bee 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -143,7 +143,8 @@ #define MSG_INIT_SDCARD "Иниц. SD-Карта" #define MSG_CNG_SDCARD "Смяна SD-Карта" #define MSG_ZPROBE_OUT "Z-сондата е извадена" -#define MSG_YX_UNHOMED "Задайте X/Y преди Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Отстояние" #define MSG_BABYSTEP_X "Министъпка X" #define MSG_BABYSTEP_Y "Министъпка Y" diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 8866c9e6f..9c2ba49d3 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -143,7 +143,8 @@ #define MSG_INIT_SDCARD "Iniciant SD" #define MSG_CNG_SDCARD "Canviar SD" #define MSG_ZPROBE_OUT "Z probe out. bed" -#define MSG_YX_UNHOMED "Home X/Y abans Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index 40f1908a3..e2306a401 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -142,7 +142,8 @@ #define MSG_INIT_SDCARD "Init. SD card" #define MSG_CNG_SDCARD "Change SD card" #define MSG_ZPROBE_OUT "Z probe out. bed" -#define MSG_YX_UNHOMED "Home X/Y before Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index bd8ae6d59..cc8508e14 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -174,8 +174,8 @@ #define MSG_INIT_SDCARD "Nacist SD kartu" #define MSG_CNG_SDCARD "Vymenit SD kartu" #define MSG_ZPROBE_OUT "Sonda Z mimo podl" -#define MSG_YX_UNHOMED "Domu X/Y pred Z" -#define MSG_XYZ_UNHOMED "Domu XYZ prvni" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z ofset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_da.h b/Marlin/language_da.h index 42d8dfa50..55c9fd48c 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -170,8 +170,8 @@ #define MSG_INIT_SDCARD "Init. SD card" #define MSG_CNG_SDCARD "Skift SD kort" #define MSG_ZPROBE_OUT "Probe udenfor plade" -#define MSG_YX_UNHOMED "Home X/Y før Z" -#define MSG_XYZ_UNHOMED "Home XYZ first" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_de.h b/Marlin/language_de.h index d4d5c3c98..58acd9527 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -145,7 +145,8 @@ #define MSG_INIT_SDCARD "SD-Karte erkennen" // Manually initialize the SD-card via user interface #define MSG_CNG_SDCARD "SD-Karte getauscht" // SD-card changed by user. For machines with no autocarddetect. Both send "M21" #define MSG_ZPROBE_OUT "Sensor ausserhalb" -#define MSG_YX_UNHOMED "X/Y vor Z homen!" +#define MSG_HOME "Vorher" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "homen" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_en.h b/Marlin/language_en.h index e85d342d0..8f20bc030 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -445,11 +445,11 @@ #ifndef MSG_ZPROBE_OUT #define MSG_ZPROBE_OUT "Z probe out. bed" #endif -#ifndef MSG_YX_UNHOMED - #define MSG_YX_UNHOMED "Home X/Y before Z" +#ifndef MSG_HOME + #define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #endif -#ifndef MSG_XYZ_UNHOMED - #define MSG_XYZ_UNHOMED "Home XYZ first" +#ifndef MSG_FIRST + #define MSG_FIRST "first" #endif #ifndef MSG_ZPROBE_ZOFFSET #define MSG_ZPROBE_ZOFFSET "Z Offset" diff --git a/Marlin/language_es.h b/Marlin/language_es.h index cf1785c79..9722ccd2e 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -169,8 +169,8 @@ #define MSG_INIT_SDCARD "Iniciando tarjeta" #define MSG_CNG_SDCARD "Cambiar tarjeta" #define MSG_ZPROBE_OUT "Sonda Z fuera" -#define MSG_YX_UNHOMED "Reiniciar X/Y y Z" -#define MSG_XYZ_UNHOMED "Reiniciar XYZ" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Desfase Z" #define MSG_BABYSTEP_X "Micropaso X" #define MSG_BABYSTEP_Y "Micropaso Y" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 8af3aab55..f87ac2f1c 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -142,7 +142,8 @@ #define MSG_INIT_SDCARD "Hasieratu txartela" #define MSG_CNG_SDCARD "Aldatu txartela" #define MSG_ZPROBE_OUT "Z ohe hasiera" -#define MSG_YX_UNHOMED "Posizio ezezaguna" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z konpentsatu" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 87cbb1fc4..be3db646c 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -142,7 +142,8 @@ #define MSG_INIT_SDCARD "Init. SD-Card" #define MSG_CNG_SDCARD "Change SD-Card" #define MSG_ZPROBE_OUT "Z probe out. bed" -#define MSG_YX_UNHOMED "Home X/Y before Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 7536d53a8..f22abce00 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -145,7 +145,8 @@ #define MSG_INIT_SDCARD "Init. la carte SD" #define MSG_CNG_SDCARD "Changer de carte" #define MSG_ZPROBE_OUT "Z sonde exte. lit" -#define MSG_YX_UNHOMED "Rev. dans XY av.Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Decalage Z" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h index 5363010e8..f4e4639fc 100644 --- a/Marlin/language_gl.h +++ b/Marlin/language_gl.h @@ -170,8 +170,8 @@ #define MSG_INIT_SDCARD "Iniciando SD" #define MSG_CNG_SDCARD "Cambiar SD" #define MSG_ZPROBE_OUT "Sonda-Z sen cama" -#define MSG_YX_UNHOMED "X/Y antes que Z" -#define MSG_XYZ_UNHOMED "Orixe XYZ antes" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Offset Z" #define MSG_BABYSTEP_X "Micropaso X" #define MSG_BABYSTEP_Y "Micropaso Y" diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h index f3bf014f5..d48e58ccb 100644 --- a/Marlin/language_hr.h +++ b/Marlin/language_hr.h @@ -171,8 +171,8 @@ #define MSG_INIT_SDCARD "Init. SD karticu" #define MSG_CNG_SDCARD "Promijeni SD karticu" #define MSG_ZPROBE_OUT "Z probe out. bed" -#define MSG_YX_UNHOMED "Home-aj X/Y prije Z" -#define MSG_XYZ_UNHOMED "Home-aj XYZ prvo" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 6e305e1b3..481b725ab 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -150,8 +150,8 @@ #define MSG_INIT_SDCARD "Iniz. SD-Card" #define MSG_CNG_SDCARD "Cambia SD-Card" #define MSG_ZPROBE_OUT "Z probe out. bed" -#define MSG_YX_UNHOMED "Home X/Y prima di Z" -#define MSG_XYZ_UNHOMED "Home XYZ prima" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 80c422462..7eb6f592a 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -184,6 +184,10 @@ #define MSG_INIT_SDCARD "SD\xb6\xb0\xc4\xde\xbb\xb2\xd6\xd0\xba\xd0" // "SDカードサイヨミコミ" ("Init. SD card") #define MSG_CNG_SDCARD "SD\xb6\xb0\xc4\xde\xba\xb3\xb6\xdd" // "SDカードコウカン" ("Change SD card") #define MSG_ZPROBE_OUT "Z\xcc\xdf\xdb\xb0\xcc\xde\x20\xcd\xde\xaf\xc4\xde\xb6\xde\xb2" // "Zプローブ ベッドガイ" ("Z probe out. bed") + +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" +/* #if LCD_WIDTH < 20 #define MSG_YX_UNHOMED "\xbb\xb7\xc6X/Y\xa6\xcc\xaf\xb7\xbb\xbe\xd6" // "サキニX/Yヲフッキサセヨ" ("Home X/Y before Z") #define MSG_XYZ_UNHOMED "\xbb\xb7\xc6\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xa6\xbe\xd6" // "サキニゲンテンフッキヲセヨ" ("Home XYZ first") @@ -191,6 +195,7 @@ #define MSG_YX_UNHOMED "\xbb\xb7\xc6X/Y\xa6\xcc\xaf\xb7\xbb\xbe\xc3\xb8\xc0\xde\xbb\xb2" // "サキニX/Yヲフッキサセテクダサイ" ("Home X/Y before Z") #define MSG_XYZ_UNHOMED "\xbb\xb7\xc6\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xa6\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "サキニゲンテンフッキヲシテクダサイ" ("Home XYZ first") #endif +*/ #define MSG_ZPROBE_ZOFFSET "Z\xb5\xcc\xbe\xaf\xc4" // "Zオフセット" ("Z Offset") #define MSG_BABYSTEP_X "X\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Xジク ビドウ" ("Babystep X") #define MSG_BABYSTEP_Y "Y\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Yジク ビドウ" ("Babystep Y") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 1188c63d3..8a35e7cef 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -155,8 +155,8 @@ #define MSG_INIT_SDCARD "SDカードサイヨミコミ" // "Init. SD card" #define MSG_CNG_SDCARD "SDカードコウカン" // "Change SD card" #define MSG_ZPROBE_OUT "Zプローブ ベッドガイ" // "Z probe out. bed" -#define MSG_YX_UNHOMED "サキニX/Yヲフッキサセテクダサイ" // "Home X/Y before Z" -#define MSG_XYZ_UNHOMED "サキニゲンテンフッキヲシテクダサイ" // "Home XYZ first" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Zオフセット" // "Z Offset" #define MSG_BABYSTEP_X "Xジク ビドウ" // "Babystep X" #define MSG_BABYSTEP_Y "Yジク ビドウ" // "Babystep Y" diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index dcac94019..c74ad8fbd 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -144,7 +144,8 @@ #define MSG_INIT_SDCARD "Init. SD kaart" #define MSG_CNG_SDCARD "Verv. SD Kaart" #define MSG_ZPROBE_OUT "Z probe uit. bed" -#define MSG_YX_UNHOMED "Home X/Y voor Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_BABYSTEP_X "Babystap X" #define MSG_BABYSTEP_Y "Babystap Y" diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 8a54f6484..bbaae33cd 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -167,7 +167,8 @@ #define MSG_INIT_SDCARD "Inicjal. karty SD" #define MSG_CNG_SDCARD "Zmiana karty SD" #define MSG_ZPROBE_OUT "Sonda Z za lozem" -#define MSG_YX_UNHOMED "Wroc w XY przed Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Offset Z" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 3bc25d9af..cc37f31da 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -144,7 +144,8 @@ #define MSG_INIT_SDCARD "Iniciar SD" #define MSG_CNG_SDCARD "Trocar SD" #define MSG_ZPROBE_OUT "Son. fora da mesa" -#define MSG_YX_UNHOMED "Pos. Desconhecida" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Deslocamento no Z" #define MSG_BABYSTEP_X "Passinho X" #define MSG_BABYSTEP_Y "Passinho Y" diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index a746ad6b9..feb38b496 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -144,7 +144,8 @@ #define MSG_INIT_SDCARD "Iniciar SD" #define MSG_CNG_SDCARD "Trocar SD" #define MSG_ZPROBE_OUT "Son. fora da mesa" -#define MSG_YX_UNHOMED "Pos. Desconhecida" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Deslocamento no Z" #define MSG_BABYSTEP_X "Passinho X" #define MSG_BABYSTEP_Y "Passinho Y" diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index e4bb049a8..4c857a7c1 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -152,7 +152,8 @@ #define MSG_INIT_SDCARD "Inici. cartao SD" #define MSG_CNG_SDCARD "Trocar cartao SD" #define MSG_ZPROBE_OUT "Sensor fora/base" -#define MSG_YX_UNHOMED "XY antes de Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Desvio Z" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h index 02b46bd92..c2fab4d63 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -152,7 +152,8 @@ #define MSG_INIT_SDCARD "Inici. cartão SD" #define MSG_CNG_SDCARD "Trocar cartão SD" #define MSG_ZPROBE_OUT "Sensor fora/base" -#define MSG_YX_UNHOMED "XY antes de Z" +#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "first" #define MSG_ZPROBE_ZOFFSET "Desvio Z" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" From e480ee005442b6863bb24870b825c2b345de8fd4 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 27 Jun 2016 18:01:11 +0200 Subject: [PATCH 205/580] Further cleanup of G28 for probes --- Marlin/Marlin_main.cpp | 65 ++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c797981b4..aaddca033 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1713,10 +1713,7 @@ static void clean_up_after_endstop_or_probe_move() { z_dest -= zprobe_zoffset; if (z_dest > current_position[Z_AXIS]) { - float old_feedrate = feedrate; - feedrate = homing_feedrate[Z_AXIS]; do_blocking_move_to_z(z_dest); - feedrate = old_feedrate; } } @@ -1795,9 +1792,7 @@ static void clean_up_after_endstop_or_probe_move() { if (endstops.z_probe_enabled) return; // Make room for probe - #if _Z_RAISE_PROBE_DEPLOY_STOW > 0 - do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); - #endif + do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); #if ENABLED(Z_PROBE_SLED) @@ -1899,9 +1894,7 @@ static void clean_up_after_endstop_or_probe_move() { if (!endstops.z_probe_enabled) return; // Make more room for the servo - #if _Z_RAISE_PROBE_DEPLOY_STOW > 0 - do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); - #endif + do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); #if ENABLED(Z_PROBE_SLED) @@ -2839,28 +2832,33 @@ inline void gcode_G28() { #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 - // Raise Z before homing any other axes and z is not already high enough (never lower z) - if (current_position[Z_AXIS] <= MIN_Z_HEIGHT_FOR_HOMING) { - destination[Z_AXIS] = MIN_Z_HEIGHT_FOR_HOMING; - feedrate = planner.max_feedrate[Z_AXIS] * 60; // feedrate (mm/m) = max_feedrate (mm/s) - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise Z (before homing) to ", (MIN_Z_HEIGHT_FOR_HOMING)); - SERIAL_EOL; - DEBUG_POS("> (home_all_axis || homeZ)", current_position); - DEBUG_POS("> (home_all_axis || homeZ)", destination); - } - #endif - line_to_destination(); - stepper.synchronize(); + #if HAS_BED_PROBE + do_probe_raise(MIN_Z_HEIGHT_FOR_HOMING); + destination[Z_AXIS] = current_position[Z_AXIS]; + #else + // Raise Z before homing any other axes and z is not already high enough (never lower z) + if (current_position[Z_AXIS] <= MIN_Z_HEIGHT_FOR_HOMING) { + destination[Z_AXIS] = MIN_Z_HEIGHT_FOR_HOMING; + feedrate = planner.max_feedrate[Z_AXIS] * 60; // feedrate (mm/m) = max_feedrate (mm/s) + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Raise Z (before homing) to ", (MIN_Z_HEIGHT_FOR_HOMING)); + SERIAL_EOL; + DEBUG_POS("> (home_all_axis || homeZ)", current_position); + DEBUG_POS("> (home_all_axis || homeZ)", destination); + } + #endif + line_to_destination(); + stepper.synchronize(); - /** - * Update the current Z position even if it currently not real from - * Z-home otherwise each call to line_to_destination() will want to - * move Z-axis by MIN_Z_HEIGHT_FOR_HOMING. - */ - current_position[Z_AXIS] = destination[Z_AXIS]; - } + /** + * Update the current Z position even if it currently not real from + * Z-home otherwise each call to line_to_destination() will want to + * move Z-axis by MIN_Z_HEIGHT_FOR_HOMING. + */ + current_position[Z_AXIS] = destination[Z_AXIS]; + } + #endif #endif #if ENABLED(QUICK_HOME) @@ -2917,7 +2915,12 @@ inline void gcode_G28() { #if ENABLED(HOME_Y_BEFORE_X) // Home Y - if (home_all_axis || homeY) HOMEAXIS(Y); + if (home_all_axis || homeY) { + HOMEAXIS(Y); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position); + #endif + } #endif // Home X From ddb386c139c897724e62ada155b25540c79c433d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Jun 2016 12:38:00 -0700 Subject: [PATCH 206/580] Init DAC_DISABLE_PIN in dac_init --- Marlin/stepper_dac.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Marlin/stepper_dac.cpp b/Marlin/stepper_dac.cpp index 2e3248daa..2663ab969 100644 --- a/Marlin/stepper_dac.cpp +++ b/Marlin/stepper_dac.cpp @@ -51,6 +51,11 @@ const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER; int dac_init() { + #if PIN_EXISTS(DAC_DISABLE) + pinMode(DAC_DISABLE_PIN, OUTPUT); + digitalWrite(DAC_DISABLE_PIN, LOW); // set pin low to enable DAC + #endif + mcp4728_init(); if (mcp4728_simpleCommand(RESET)) return -1; From 0c24e0e44524686d2c12efe8d1f17e61fae48075 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Jun 2016 12:51:50 -0700 Subject: [PATCH 207/580] Support for newer Wire library --- Marlin/dac_mcp4728.cpp | 22 +++++++++++----------- Marlin/dac_mcp4728.h | 2 -- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Marlin/dac_mcp4728.cpp b/Marlin/dac_mcp4728.cpp index 3060e6e18..01e38edf8 100644 --- a/Marlin/dac_mcp4728.cpp +++ b/Marlin/dac_mcp4728.cpp @@ -43,9 +43,9 @@ void mcp4728_init() { Wire.begin(); Wire.requestFrom(int(DAC_DEV_ADDRESS), 24); while(Wire.available()) { - int deviceID = Wire.receive(); - int hiByte = Wire.receive(); - int loByte = Wire.receive(); + int deviceID = Wire.read(); + int hiByte = Wire.read(); + int loByte = Wire.read(); int isEEPROM = (deviceID & 0B00001000) >> 3; int channel = (deviceID & 0B00110000) >> 4; @@ -70,10 +70,10 @@ uint8_t mcp4728_analogWrite(uint8_t channel, uint16_t value) { */ uint8_t mcp4728_eepromWrite() { Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.send(SEQWRITE); + Wire.write(SEQWRITE); for (uint8_t channel=0; channel <= 3; channel++) { - Wire.send(DAC_STEPPER_VREF << 7 | 0 << 5 | DAC_STEPPER_GAIN << 4 | highByte(mcp4728_values[channel])); - Wire.send(lowByte(mcp4728_values[channel])); + Wire.write(DAC_STEPPER_VREF << 7 | 0 << 5 | DAC_STEPPER_GAIN << 4 | highByte(mcp4728_values[channel])); + Wire.write(lowByte(mcp4728_values[channel])); } return Wire.endTransmission(); } @@ -83,7 +83,7 @@ uint8_t mcp4728_eepromWrite() { */ uint8_t mcp4728_setVref_all(uint8_t value) { Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.send(VREFWRITE | value << 3 | value << 2 | value << 1 | value); + Wire.write(VREFWRITE | value << 3 | value << 2 | value << 1 | value); return Wire.endTransmission(); } /** @@ -91,7 +91,7 @@ uint8_t mcp4728_setVref_all(uint8_t value) { */ uint8_t mcp4728_setGain_all(uint8_t value) { Wire.beginTransmission(DAC_DEV_ADDRESS); - Wire.send(GAINWRITE | value << 3 | value << 2 | value << 1 | value); + Wire.write(GAINWRITE | value << 3 | value << 2 | value << 1 | value); return Wire.endTransmission(); } @@ -120,8 +120,8 @@ uint16_t mcp4728_getVout(uint8_t channel) { uint8_t mcp4728_fastWrite() { Wire.beginTransmission(DAC_DEV_ADDRESS); for (uint8_t channel=0; channel <= 3; channel++) { - Wire.send(highByte(mcp4728_values[channel])); - Wire.send(lowByte(mcp4728_values[channel])); + Wire.write(highByte(mcp4728_values[channel])); + Wire.write(lowByte(mcp4728_values[channel])); } return Wire.endTransmission(); } @@ -131,7 +131,7 @@ uint8_t mcp4728_fastWrite() { */ uint8_t mcp4728_simpleCommand(byte simpleCommand) { Wire.beginTransmission(GENERALCALL); - Wire.send(simpleCommand); + Wire.write(simpleCommand); return Wire.endTransmission(); } diff --git a/Marlin/dac_mcp4728.h b/Marlin/dac_mcp4728.h index 1f659bf88..18d22f21f 100644 --- a/Marlin/dac_mcp4728.h +++ b/Marlin/dac_mcp4728.h @@ -31,9 +31,7 @@ #include "Configuration_adv.h" #if ENABLED(DAC_STEPPER_CURRENT) -#include "WProgram.h" #include "Wire.h" -//#include #define defaultVDD 5000 #define BASE_ADDR 0x60 From bd491818d66c2612249a8d4ac6c1a6e356b7860c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Jun 2016 16:29:35 -0700 Subject: [PATCH 208/580] Reduce storage requirements for strings, make some PGM --- Marlin/M100_Free_Mem_Chk.cpp | 24 +++--- Marlin/Marlin.h | 3 +- Marlin/Marlin_main.cpp | 129 ++++++++++++++++----------------- Marlin/cardreader.cpp | 43 +++++------ Marlin/configuration_store.cpp | 6 +- Marlin/endstops.cpp | 2 +- Marlin/language.h | 2 +- Marlin/stepper.cpp | 2 +- Marlin/stepper_dac.cpp | 2 +- Marlin/temperature.cpp | 64 ++++++++-------- Marlin/ultralcd.cpp | 13 ++-- 11 files changed, 139 insertions(+), 151 deletions(-) diff --git a/Marlin/M100_Free_Mem_Chk.cpp b/Marlin/M100_Free_Mem_Chk.cpp index 521b759e3..c3027794c 100644 --- a/Marlin/M100_Free_Mem_Chk.cpp +++ b/Marlin/M100_Free_Mem_Chk.cpp @@ -86,7 +86,7 @@ void gcode_M100() { sp = top_of_stack(); SERIAL_ECHOPGM("\nStack Pointer : "); prt_hex_word((unsigned int) sp); - SERIAL_ECHOPGM("\n"); + SERIAL_EOL; sp = (unsigned char*)((unsigned long) sp | 0x000f); n = sp - ptr; // @@ -94,25 +94,25 @@ void gcode_M100() { // while (ptr < sp) { prt_hex_word((unsigned int) ptr); // Print the address - SERIAL_ECHOPGM(":"); + SERIAL_CHAR(':'); for (i = 0; i < 16; i++) { // and 16 data bytes prt_hex_byte(*(ptr + i)); - SERIAL_ECHOPGM(" "); + SERIAL_CHAR(' '); delay(2); } - SERIAL_ECHO("|"); // now show where non 0xE5's are + SERIAL_CHAR('|'); // now show where non 0xE5's are for (i = 0; i < 16; i++) { delay(2); if (*(ptr + i) == 0xe5) - SERIAL_ECHOPGM(" "); + SERIAL_CHAR(' '); else - SERIAL_ECHOPGM("?"); + SERIAL_CHAR('?'); } - SERIAL_ECHO("\n"); + SERIAL_EOL; ptr += 16; delay(2); } - SERIAL_ECHOLNPGM("Done.\n"); + SERIAL_ECHOLNPGM("Done."); return; } #endif @@ -137,7 +137,7 @@ void gcode_M100() { SERIAL_ECHOPAIR("Found ", j); SERIAL_ECHOPGM(" bytes free at 0x"); prt_hex_word((int) ptr + i); - SERIAL_ECHOPGM("\n"); + SERIAL_EOL; i += j; block_cnt++; } @@ -150,8 +150,8 @@ void gcode_M100() { } } if (block_cnt > 1) - SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area.\n"); - SERIAL_ECHO("\nDone.\n"); + SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); + SERIAL_ECHOLNPGM("\nDone."); return; } // @@ -173,7 +173,7 @@ void gcode_M100() { j = n / (x + 1); for (i = 1; i <= x; i++) { *(ptr + (i * j)) = i; - SERIAL_ECHO("\nCorrupting address: 0x"); + SERIAL_ECHOPGM("\nCorrupting address: 0x"); prt_hex_word((unsigned int)(ptr + (i * j))); } SERIAL_ECHOLNPGM("\n"); diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 17a1c421b..c4298aaac 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -84,8 +84,9 @@ typedef unsigned long millis_t; #define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y) #define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)) #define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x); SERIAL_EOL; }while(0) -#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)); SERIAL_EOL; }while(0) +#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x "\n")); }while(0) +#define SERIAL_PROTOCOLPAIR(name, value) SERIAL_ECHOPAIR(name, value) extern const char errormagic[] PROGMEM; extern const char echomagic[] PROGMEM; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index aaddca033..5cc93cf32 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2107,7 +2107,7 @@ static void clean_up_after_endstop_or_probe_move() { do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> deploy_z_probe"); + if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif deploy_z_probe(); @@ -2543,7 +2543,7 @@ void unknown_command_error() { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(current_command); - SERIAL_ECHOPGM("\"\n"); + SERIAL_ECHOLNPGM("\""); } #if ENABLED(HOST_KEEPALIVE_FEATURE) @@ -3187,19 +3187,11 @@ inline void gcode_G28() { switch (state) { case MeshReport: if (mbl.has_mesh()) { - SERIAL_PROTOCOLPGM("State: "); - if (mbl.active()) - SERIAL_PROTOCOLPGM("On"); - else - SERIAL_PROTOCOLPGM("Off"); - SERIAL_PROTOCOLPGM("\nNum X,Y: "); - SERIAL_PROTOCOL(MESH_NUM_X_POINTS); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); - SERIAL_PROTOCOLPGM("\nZ search height: "); - SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z); - SERIAL_PROTOCOLPGM("\nZ offset: "); - SERIAL_PROTOCOL_F(mbl.z_offset, 5); + SERIAL_PROTOCOLPAIR("State: ", mbl.active() ? "On" : "Off"); + SERIAL_PROTOCOLPAIR("\nNum X,Y: ", MESH_NUM_X_POINTS); + SERIAL_PROTOCOLCHAR(','); SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); + SERIAL_PROTOCOLPAIR("\nZ search height: ", MESH_HOME_SEARCH_Z); + SERIAL_PROTOCOLPGM("\nZ offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5); SERIAL_PROTOCOLLNPGM("\nMeasured points:"); for (py = 0; py < MESH_NUM_Y_POINTS; py++) { for (px = 0; px < MESH_NUM_X_POINTS; px++) { @@ -3268,30 +3260,30 @@ inline void gcode_G28() { if (code_seen('X')) { px = code_value_int() - 1; if (px < 0 || px >= MESH_NUM_X_POINTS) { - SERIAL_PROTOCOLPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").\n"); + SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ")."); return; } } else { - SERIAL_PROTOCOLPGM("X not entered.\n"); + SERIAL_PROTOCOLLNPGM("X not entered."); return; } if (code_seen('Y')) { py = code_value_int() - 1; if (py < 0 || py >= MESH_NUM_Y_POINTS) { - SERIAL_PROTOCOLPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").\n"); + SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ")."); return; } } else { - SERIAL_PROTOCOLPGM("Y not entered.\n"); + SERIAL_PROTOCOLLNPGM("Y not entered."); return; } if (code_seen('Z')) { z = code_value_axis_units(Z_AXIS); } else { - SERIAL_PROTOCOLPGM("Z not entered.\n"); + SERIAL_PROTOCOLLNPGM("Z not entered."); return; } mbl.z_values[py][px] = z; @@ -3302,7 +3294,7 @@ inline void gcode_G28() { z = code_value_axis_units(Z_AXIS); } else { - SERIAL_PROTOCOLPGM("Z not entered.\n"); + SERIAL_PROTOCOLLNPGM("Z not entered."); return; } mbl.z_offset = z; @@ -3397,8 +3389,8 @@ inline void gcode_G28() { #endif if (verbose_level > 0) { - SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n"); - if (dryrun) SERIAL_ECHOLNPGM("Running in DRY-RUN mode"); + SERIAL_PROTOCOLLNPGM("G29 Auto Bed Leveling"); + if (dryrun) SERIAL_PROTOCOLLNPGM("Running in DRY-RUN mode"); } int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS; @@ -3406,7 +3398,7 @@ inline void gcode_G28() { #if DISABLED(DELTA) if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int(); if (auto_bed_leveling_grid_points < 2) { - SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n"); + SERIAL_PROTOCOLLNPGM("?Number of probed (P)oints is implausible (2 minimum)."); return; } #endif @@ -3637,17 +3629,17 @@ inline void gcode_G28() { // Show the Topography map if enabled if (do_topography_map) { - SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n"); - SERIAL_PROTOCOLPGM(" +--- BACK --+\n"); - SERIAL_PROTOCOLPGM(" | |\n"); - SERIAL_PROTOCOLPGM(" L | (+) | R\n"); - SERIAL_PROTOCOLPGM(" E | | I\n"); - SERIAL_PROTOCOLPGM(" F | (-) N (+) | G\n"); - SERIAL_PROTOCOLPGM(" T | | H\n"); - SERIAL_PROTOCOLPGM(" | (-) | T\n"); - SERIAL_PROTOCOLPGM(" | |\n"); - SERIAL_PROTOCOLPGM(" O-- FRONT --+\n"); - SERIAL_PROTOCOLPGM(" (0,0)\n"); + SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n" + " +--- BACK --+\n" + " | |\n" + " L | (+) | R\n" + " E | | I\n" + " F | (-) N (+) | G\n" + " T | | H\n" + " | (-) | T\n" + " | |\n" + " O-- FRONT --+\n" + " (0,0)"); float min_diff = 999; @@ -3674,7 +3666,7 @@ inline void gcode_G28() { } // yy SERIAL_EOL; if (verbose_level > 3) { - SERIAL_PROTOCOLPGM(" \nCorrected Bed Height vs. Bed Topology: \n"); + SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:"); for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) { for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) { @@ -3703,7 +3695,7 @@ inline void gcode_G28() { #if DISABLED(DELTA) if (verbose_level > 0) - planner.bed_level_matrix.debug(" \n\nBed Level Correction Matrix:"); + planner.bed_level_matrix.debug("\n\nBed Level Correction Matrix:"); if (!dryrun) { /** @@ -3747,7 +3739,7 @@ inline void gcode_G28() { #ifdef Z_PROBE_END_SCRIPT #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHO("Z Probe End Script: "); + SERIAL_ECHOPGM("Z Probe End Script: "); SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT); } #endif @@ -4130,16 +4122,16 @@ inline void gcode_M42() { int8_t verbose_level = code_seen('V') ? code_value_byte() : 1; if (verbose_level < 0 || verbose_level > 4) { - SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n"); + SERIAL_PROTOCOLLNPGM("?Verbose Level not plausible (0-4)."); return; } if (verbose_level > 0) - SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n"); + SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability test"); int8_t n_samples = code_seen('P') ? code_value_byte() : 10; if (n_samples < 4 || n_samples > 50) { - SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n"); + SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50)."); return; } @@ -4168,7 +4160,7 @@ inline void gcode_M42() { } #else if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) { - SERIAL_PROTOCOLPGM("? (X,Y) location outside of probeable radius.\n"); + SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius."); return; } #endif @@ -4176,7 +4168,7 @@ inline void gcode_M42() { bool seen_L = code_seen('L'); uint8_t n_legs = seen_L ? code_value_byte() : 0; if (n_legs > 15) { - SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); + SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15)."); return; } if (n_legs == 1) n_legs = 2; @@ -4190,7 +4182,7 @@ inline void gcode_M42() { * we don't want to use that as a starting point for each probe. */ if (verbose_level > 2) - SERIAL_PROTOCOLPGM("Positioning the probe...\n"); + SERIAL_PROTOCOLLNPGM("Positioning the probe..."); #if ENABLED(DELTA) // we don't do bed level correction in M48 because we want the raw data when we probe @@ -4223,9 +4215,9 @@ inline void gcode_M42() { if (verbose_level > 3) { SERIAL_ECHOPAIR("Starting radius: ", radius); SERIAL_ECHOPAIR(" angle: ", angle); - SERIAL_ECHO(" Direction: "); - if (dir > 0) SERIAL_ECHO("Counter "); - SERIAL_ECHOLN("Clockwise"); + SERIAL_ECHOPGM(" Direction: "); + if (dir > 0) SERIAL_ECHOPGM("Counter-"); + SERIAL_ECHOLNPGM("Clockwise"); } for (uint8_t l = 0; l < n_legs - 1; l++) { @@ -4268,10 +4260,10 @@ inline void gcode_M42() { } #endif if (verbose_level > 3) { - SERIAL_PROTOCOL("Going to:"); - SERIAL_ECHOPAIR("x: ", X_current); - SERIAL_ECHOPAIR("y: ", Y_current); - SERIAL_ECHOPAIR(" z: ", current_position[Z_AXIS]); + SERIAL_PROTOCOLPGM("Going to:"); + SERIAL_ECHOPAIR(" X", X_current); + SERIAL_ECHOPAIR(" Y", Y_current); + SERIAL_ECHOPAIR(" Z", current_position[Z_AXIS]); SERIAL_EOL; } do_blocking_move_to_xy(X_current, Y_current); @@ -5542,9 +5534,9 @@ inline void gcode_M226() { } else if (servo_index >= 0) { SERIAL_ECHO_START; - SERIAL_ECHO(" Servo "); + SERIAL_ECHOPGM(" Servo "); SERIAL_ECHO(servo_index); - SERIAL_ECHO(": "); + SERIAL_ECHOPGM(": "); SERIAL_ECHOLN(servo[servo_index].read()); } } @@ -5601,17 +5593,17 @@ inline void gcode_M226() { thermalManager.updatePID(); SERIAL_ECHO_START; #if ENABLED(PID_PARAMS_PER_HOTEND) - SERIAL_ECHO(" e:"); // specify extruder in serial output + SERIAL_ECHOPGM(" e:"); // specify extruder in serial output SERIAL_ECHO(e); #endif // PID_PARAMS_PER_HOTEND - SERIAL_ECHO(" p:"); + SERIAL_ECHOPGM(" p:"); SERIAL_ECHO(PID_PARAM(Kp, e)); - SERIAL_ECHO(" i:"); + SERIAL_ECHOPGM(" i:"); SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e))); - SERIAL_ECHO(" d:"); + SERIAL_ECHOPGM(" d:"); SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e))); #if ENABLED(PID_ADD_EXTRUSION_RATE) - SERIAL_ECHO(" c:"); + SERIAL_ECHOPGM(" c:"); //Kc does not have scaling applied above, or in resetting defaults SERIAL_ECHO(PID_PARAM(Kc, e)); #endif @@ -5635,11 +5627,11 @@ inline void gcode_M226() { thermalManager.updatePID(); SERIAL_ECHO_START; - SERIAL_ECHO(" p:"); + SERIAL_ECHOPGM(" p:"); SERIAL_ECHO(thermalManager.bedKp); - SERIAL_ECHO(" i:"); + SERIAL_ECHOPGM(" i:"); SERIAL_ECHO(unscalePID_i(thermalManager.bedKi)); - SERIAL_ECHO(" d:"); + SERIAL_ECHOPGM(" d:"); SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd)); } @@ -5739,7 +5731,7 @@ inline void gcode_M303() { #if ENABLED(SCARA) bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) { //SoftEndsEnabled = false; // Ignore soft endstops during calibration - //SERIAL_ECHOLN(" Soft endstops disabled "); + //SERIAL_ECHOLNPGM(" Soft endstops disabled"); if (IsRunning()) { //gcode_get_destination(); // For X Y Z E F delta[X_AXIS] = delta_x; @@ -5758,7 +5750,7 @@ inline void gcode_M303() { * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration) */ inline bool gcode_M360() { - SERIAL_ECHOLN(" Cal: Theta 0 "); + SERIAL_ECHOLNPGM(" Cal: Theta 0"); return SCARA_move_to_cal(0, 120); } @@ -5766,7 +5758,7 @@ inline void gcode_M303() { * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) */ inline bool gcode_M361() { - SERIAL_ECHOLN(" Cal: Theta 90 "); + SERIAL_ECHOLNPGM(" Cal: Theta 90"); return SCARA_move_to_cal(90, 130); } @@ -5774,7 +5766,7 @@ inline void gcode_M303() { * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration) */ inline bool gcode_M362() { - SERIAL_ECHOLN(" Cal: Psi 0 "); + SERIAL_ECHOLNPGM(" Cal: Psi 0"); return SCARA_move_to_cal(60, 180); } @@ -5782,7 +5774,7 @@ inline void gcode_M303() { * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) */ inline bool gcode_M363() { - SERIAL_ECHOLN(" Cal: Psi 90 "); + SERIAL_ECHOLNPGM(" Cal: Psi 90"); return SCARA_move_to_cal(50, 90); } @@ -5790,7 +5782,7 @@ inline void gcode_M303() { * M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) */ inline bool gcode_M364() { - SERIAL_ECHOLN(" Cal: Theta-Psi 90 "); + SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90"); return SCARA_move_to_cal(45, 135); } @@ -6109,6 +6101,7 @@ inline void gcode_M503() { else { SERIAL_ECHOPGM(MSG_Z_MIN); SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN); + SERIAL_CHAR(' '); SERIAL_ECHOPGM(MSG_Z_MAX); SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX); } @@ -6625,7 +6618,7 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif SERIAL_ECHO_START; - SERIAL_ECHO(MSG_ACTIVE_EXTRUDER); + SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER); SERIAL_PROTOCOLLN((int)active_extruder); } diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 3910bee4e..4b7aaf676 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -102,7 +102,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m if (!dir.open(parent, lfilename, O_READ)) { if (lsAction == LS_SerialPrint) { SERIAL_ECHO_START; - SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR); + SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); SERIAL_ECHOLN(lfilename); } } @@ -357,8 +357,8 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { dirname_start = &name[1]; while (dirname_start != NULL) { dirname_end = strchr(dirname_start, '/'); - //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name)); - //SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name)); + //SERIAL_ECHOPGM("start:");SERIAL_ECHOLN((int)(dirname_start - name)); + //SERIAL_ECHOPGM("end :");SERIAL_ECHOLN((int)(dirname_end - name)); if (dirname_end != NULL && dirname_end > dirname_start) { char subdirname[FILENAME_LENGTH]; strncpy(subdirname, dirname_start, dirname_end - dirname_start); @@ -371,7 +371,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { return; } else { - //SERIAL_ECHOLN("dive ok"); + //SERIAL_ECHOLNPGM("dive ok"); } curDir = &myDir; @@ -379,7 +379,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { } else { // the remainder after all /fsa/fdsa/ is the filename fname = dirname_start; - //SERIAL_ECHOLN("remainder"); + //SERIAL_ECHOLNPGM("remainder"); //SERIAL_ECHOLN(fname); break; } @@ -392,10 +392,9 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { if (read) { if (file.open(curDir, fname, O_READ)) { filesize = file.fileSize(); - SERIAL_PROTOCOLPGM(MSG_SD_FILE_OPENED); - SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLPGM(MSG_SD_SIZE); - SERIAL_PROTOCOLLN(filesize); + SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname); + SERIAL_PROTOCOLPAIR(MSG_SD_SIZE, filesize); + SERIAL_EOL; sdpos = 0; SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED); @@ -403,21 +402,20 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { lcd_setstatus(longFilename[0] ? longFilename : fname); } else { - SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); - SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLPGM(".\n"); + SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); + SERIAL_PROTOCOLCHAR('.'); + SERIAL_EOL; } } else { //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { - SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); - SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLPGM(".\n"); + SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); + SERIAL_PROTOCOLCHAR('.'); + SERIAL_EOL; } else { saving = true; - SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE); - SERIAL_PROTOCOLLN(name); + SERIAL_PROTOCOLPAIR(MSG_SD_WRITE_TO_FILE, name); lcd_setstatus(fname); } } @@ -438,21 +436,20 @@ void CardReader::removeFile(char* name) { dirname_start = strchr(name, '/') + 1; while (dirname_start != NULL) { dirname_end = strchr(dirname_start, '/'); - //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name)); - //SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name)); + //SERIAL_ECHOPGM("start:");SERIAL_ECHOLN((int)(dirname_start - name)); + //SERIAL_ECHOPGM("end :");SERIAL_ECHOLN((int)(dirname_end - name)); if (dirname_end != NULL && dirname_end > dirname_start) { char subdirname[FILENAME_LENGTH]; strncpy(subdirname, dirname_start, dirname_end - dirname_start); subdirname[dirname_end - dirname_start] = 0; SERIAL_ECHOLN(subdirname); if (!myDir.open(curDir, subdirname, O_READ)) { - SERIAL_PROTOCOLPGM("open failed, File: "); - SERIAL_PROTOCOL(subdirname); + SERIAL_PROTOCOLPAIR("open failed, File: ", subdirname); SERIAL_PROTOCOLCHAR('.'); return; } else { - //SERIAL_ECHOLN("dive ok"); + //SERIAL_ECHOLNPGM("dive ok"); } curDir = &myDir; @@ -460,7 +457,7 @@ void CardReader::removeFile(char* name) { } else { // the remainder after all /fsa/fdsa/ is the filename fname = dirname_start; - //SERIAL_ECHOLN("remainder"); + //SERIAL_ECHOLNPGM("remainder"); //SERIAL_ECHOLN(fname); break; } diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 3def1c3eb..8af50da26 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -344,7 +344,7 @@ void Config_RetrieveSettings() { char stored_ver[4]; char ver[4] = EEPROM_VERSION; EEPROM_READ_VAR(i, stored_ver); //read stored version - // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]"); + // SERIAL_ECHO("Version: [" << ver << "] Stored version: [" << stored_ver << "]\n"); if (strncmp(ver, stored_ver, 3) != 0) { Config_ResetDefault(); @@ -717,7 +717,7 @@ void Config_PrintSettings(bool forReplay) { CONFIG_ECHO_START; if (!forReplay) { - SERIAL_ECHOLNPGM("Home offset (mm):"); + SERIAL_ECHOLNPGM("Home offset (mm)"); CONFIG_ECHO_START; } SERIAL_ECHOPAIR(" M206 X", home_offset[X_AXIS]); @@ -883,7 +883,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries"); CONFIG_ECHO_START; } - SERIAL_ECHOPAIR(" M209 S", (autoretract_enabled ? 1 : 0)); + SERIAL_ECHOPAIR(" M209 S", autoretract_enabled ? 1 : 0); SERIAL_EOL; #endif // FWRETRACT diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 945b61577..81a080ebf 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -197,7 +197,7 @@ void Endstops::report_state() { } // Endstops::report_state void Endstops::M119() { - SERIAL_PROTOCOLLN(MSG_M119_REPORT); + SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT); #if HAS_X_MIN SERIAL_PROTOCOLPGM(MSG_X_MIN); SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); diff --git a/Marlin/language.h b/Marlin/language.h index f7ac1474b..eb378feea 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -157,7 +157,7 @@ #define MSG_ENDSTOP_OPEN "open" #define MSG_HOTEND_OFFSET "Hotend offsets:" -#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir" +#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir " #define MSG_SD_INIT_FAIL "SD init fail" #define MSG_SD_VOL_INIT_FAIL "volume.init failed" #define MSG_SD_OPENROOT_FAIL "openRoot failed" diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index b544cd6fe..300bd286f 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1103,7 +1103,7 @@ void Stepper::microstep_mode(uint8_t driver, uint8_t stepping_mode) { } void Stepper::microstep_readings() { - SERIAL_PROTOCOLPGM("MS1,MS2 Pins\n"); + SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); SERIAL_PROTOCOLPGM("X: "); SERIAL_PROTOCOL(digitalRead(X_MS1_PIN)); SERIAL_PROTOCOLLN(digitalRead(X_MS2_PIN)); diff --git a/Marlin/stepper_dac.cpp b/Marlin/stepper_dac.cpp index 2e3248daa..cb078570c 100644 --- a/Marlin/stepper_dac.cpp +++ b/Marlin/stepper_dac.cpp @@ -98,7 +98,7 @@ SERIAL_ECHOPAIR(" (", dac_amps(2)); SERIAL_ECHOPAIR(") E:", dac_perc(3)); SERIAL_ECHOPAIR(" (", dac_amps(3)); - SERIAL_ECHOLN(")"); + SERIAL_ECHOLNPGM(")"); } void dac_commit_eeprom() { diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 4a19968d0..a011b77d2 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -304,37 +304,37 @@ unsigned char Temperature::soft_pwm[HOTENDS]; bias = constrain(bias, 20, max_pow - 20); d = (bias > max_pow / 2) ? max_pow - 1 - bias : bias; - SERIAL_PROTOCOLPGM(MSG_BIAS); SERIAL_PROTOCOL(bias); - SERIAL_PROTOCOLPGM(MSG_D); SERIAL_PROTOCOL(d); - SERIAL_PROTOCOLPGM(MSG_T_MIN); SERIAL_PROTOCOL(min); - SERIAL_PROTOCOLPGM(MSG_T_MAX); SERIAL_PROTOCOLLN(max); + SERIAL_PROTOCOLPAIR(MSG_BIAS, bias); + SERIAL_PROTOCOLPAIR(MSG_D, d); + SERIAL_PROTOCOLPAIR(MSG_T_MIN, min); + SERIAL_PROTOCOLPAIR(MSG_T_MAX, max); if (cycles > 2) { Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0); Tu = ((float)(t_low + t_high) / 1000.0); - SERIAL_PROTOCOLPGM(MSG_KU); SERIAL_PROTOCOL(Ku); - SERIAL_PROTOCOLPGM(MSG_TU); SERIAL_PROTOCOLLN(Tu); + SERIAL_PROTOCOLPAIR(MSG_KU, Ku); + SERIAL_PROTOCOLPAIR(MSG_TU, Tu); workKp = 0.6 * Ku; workKi = 2 * workKp / Tu; workKd = workKp * Tu / 8; SERIAL_PROTOCOLLNPGM(MSG_CLASSIC_PID); - SERIAL_PROTOCOLPGM(MSG_KP); SERIAL_PROTOCOLLN(workKp); - SERIAL_PROTOCOLPGM(MSG_KI); SERIAL_PROTOCOLLN(workKi); - SERIAL_PROTOCOLPGM(MSG_KD); SERIAL_PROTOCOLLN(workKd); + SERIAL_PROTOCOLPAIR(MSG_KP, workKp); + SERIAL_PROTOCOLPAIR(MSG_KI, workKi); + SERIAL_PROTOCOLPAIR(MSG_KD, workKd); /** workKp = 0.33*Ku; workKi = workKp/Tu; workKd = workKp*Tu/3; - SERIAL_PROTOCOLLNPGM(" Some overshoot "); - SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(workKp); - SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(workKi); - SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(workKd); + SERIAL_PROTOCOLLNPGM(" Some overshoot"); + SERIAL_PROTOCOLPAIR(" Kp: ", workKp); + SERIAL_PROTOCOLPAIR(" Ki: ", workKi); + SERIAL_PROTOCOLPAIR(" Kd: ", workKd); workKp = 0.2*Ku; workKi = 2*workKp/Tu; workKd = workKp*Tu/3; - SERIAL_PROTOCOLLNPGM(" No overshoot "); - SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(workKp); - SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(workKi); - SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(workKd); + SERIAL_PROTOCOLLNPGM(" No overshoot"); + SERIAL_PROTOCOLPAIR(" Kp: ", workKp); + SERIAL_PROTOCOLPAIR(" Ki: ", workKi); + SERIAL_PROTOCOLPAIR(" Kd: ", workKd); */ } } @@ -377,17 +377,17 @@ unsigned char Temperature::soft_pwm[HOTENDS]; #if HAS_PID_FOR_BOTH const char* estring = hotend < 0 ? "bed" : ""; - SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kp "); SERIAL_PROTOCOLLN(workKp); - SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Ki "); SERIAL_PROTOCOLLN(workKi); - SERIAL_PROTOCOLPGM("#define DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kd "); SERIAL_PROTOCOLLN(workKd); + SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp); + SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi); + SERIAL_PROTOCOLPAIR("#define DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd); #elif ENABLED(PIDTEMP) - SERIAL_PROTOCOLPGM("#define DEFAULT_Kp "); SERIAL_PROTOCOLLN(workKp); - SERIAL_PROTOCOLPGM("#define DEFAULT_Ki "); SERIAL_PROTOCOLLN(workKi); - SERIAL_PROTOCOLPGM("#define DEFAULT_Kd "); SERIAL_PROTOCOLLN(workKd); + SERIAL_PROTOCOLPAIR("#define DEFAULT_Kp ", workKp); + SERIAL_PROTOCOLPAIR("#define DEFAULT_Ki ", workKi); + SERIAL_PROTOCOLPAIR("#define DEFAULT_Kd ", workKd); #else - SERIAL_PROTOCOLPGM("#define DEFAULT_bedKp "); SERIAL_PROTOCOLLN(workKp); - SERIAL_PROTOCOLPGM("#define DEFAULT_bedKi "); SERIAL_PROTOCOLLN(workKi); - SERIAL_PROTOCOLPGM("#define DEFAULT_bedKd "); SERIAL_PROTOCOLLN(workKd); + SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKp ", workKp); + SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKi ", workKi); + SERIAL_PROTOCOLPAIR("#define DEFAULT_bedKd ", workKd); #endif #define _SET_BED_PID() \ @@ -626,16 +626,16 @@ float Temperature::get_pid_output(int e) { #if ENABLED(PID_BED_DEBUG) SERIAL_ECHO_START; - SERIAL_ECHO(" PID_BED_DEBUG "); - SERIAL_ECHO(": Input "); + SERIAL_ECHOPGM(" PID_BED_DEBUG "); + SERIAL_ECHOPGM(": Input "); SERIAL_ECHO(current_temperature_bed); - SERIAL_ECHO(" Output "); + SERIAL_ECHOPGM(" Output "); SERIAL_ECHO(pid_output); - SERIAL_ECHO(" pTerm "); + SERIAL_ECHOPGM(" pTerm "); SERIAL_ECHO(pTerm_bed); - SERIAL_ECHO(" iTerm "); + SERIAL_ECHOPGM(" iTerm "); SERIAL_ECHO(iTerm_bed); - SERIAL_ECHO(" dTerm "); + SERIAL_ECHOPGM(" dTerm "); SERIAL_ECHOLN(dTerm_bed); #endif //PID_BED_DEBUG diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index ea8d8c700..7fd0e9f25 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2266,14 +2266,11 @@ void lcd_update() { #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) SERIAL_ECHO_START; - SERIAL_ECHO("Enc Step Rate: "); - SERIAL_ECHO(encoderStepRate); - SERIAL_ECHO(" Multiplier: "); - SERIAL_ECHO(encoderMultiplier); - SERIAL_ECHO(" ENCODER_10X_STEPS_PER_SEC: "); - SERIAL_ECHO(ENCODER_10X_STEPS_PER_SEC); - SERIAL_ECHO(" ENCODER_100X_STEPS_PER_SEC: "); - SERIAL_ECHOLN(ENCODER_100X_STEPS_PER_SEC); + SERIAL_ECHOPAIR("Enc Step Rate: ", encoderStepRate); + SERIAL_ECHOPAIR(" Multiplier: ", encoderMultiplier); + SERIAL_ECHOPAIR(" ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC); + SERIAL_ECHOPAIR(" ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC); + SERIAL_EOL; #endif //ENCODER_RATE_MULTIPLIER_DEBUG } From dc2c0e5e24dc684411399290ecc721afe7312c4e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Jun 2016 19:16:21 -0700 Subject: [PATCH 209/580] Simpler debug output for deploy/stow --- Marlin/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5cc93cf32..d7e5d7d4d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2115,7 +2115,7 @@ static void clean_up_after_endstop_or_probe_move() { if (stow) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> stow_z_probe"); + if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif stow_z_probe(); } @@ -2329,7 +2329,7 @@ static void homeaxis(AxisEnum axis) { #if HAS_BED_PROBE if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > deploy_z_probe()"); + if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif deploy_z_probe(); } @@ -2453,7 +2453,7 @@ static void homeaxis(AxisEnum axis) { #if HAS_BED_PROBE if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > stow_z_probe()"); + if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif stow_z_probe(); } From 2e96276bf4a477de495fa59ef40915de35209f53 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Jun 2016 19:33:37 -0700 Subject: [PATCH 210/580] More debug message cleanup --- Marlin/Marlin_main.cpp | 23 +++++++++++------------ Marlin/configuration_store.cpp | 4 +++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d7e5d7d4d..293d16522 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1442,8 +1442,8 @@ static void set_home_offset(AxisEnum axis, float v) { static void set_axis_is_at_home(AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("set_axis_is_at_home(", axis); - SERIAL_ECHOLNPGM(") >>>"); + SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis); + SERIAL_ECHOLNPGM(")"); } #endif @@ -1993,7 +1993,7 @@ static void clean_up_after_endstop_or_probe_move() { long start_steps = stepper.position(Z_AXIS); #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("run_z_probe (DELTA) 1"); + if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 1", current_position); #endif // move down slowly until you find the bed @@ -2015,8 +2015,6 @@ static void clean_up_after_endstop_or_probe_move() { if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position); #endif - SYNC_PLAN_POSITION_KINEMATIC(); - #else // !DELTA #if ENABLED(AUTO_BED_LEVELING_FEATURE) @@ -2054,14 +2052,14 @@ static void clean_up_after_endstop_or_probe_move() { // Get the current stepper position after bumping an endstop current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); - SYNC_PLAN_POSITION_KINEMATIC(); - #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position); #endif #endif // !DELTA + SYNC_PLAN_POSITION_KINEMATIC(); + feedrate = old_feedrate; return current_position[Z_AXIS]; @@ -2083,9 +2081,10 @@ static void clean_up_after_endstop_or_probe_move() { static float probe_pt(float x, float y, bool stow = true, int verbose_level = 1) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("probe_pt >>>"); - SERIAL_ECHOPAIR("> stow:", stow); - SERIAL_EOL; + SERIAL_ECHOPAIR(">>> probe_pt(", x); + SERIAL_ECHOPAIR(", ", y); + SERIAL_ECHOPAIR(", ", stow ? "stow" : "no stow"); + SERIAL_ECHOLNPGM(")"); DEBUG_POS("", current_position); } #endif @@ -2741,7 +2740,7 @@ inline void gcode_G4() { inline void gcode_G28() { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("gcode_G28 >>>"); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(">>> gcode_G28"); #endif // Wait for planner moves to finish! @@ -3360,7 +3359,7 @@ inline void gcode_G28() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("gcode_G29 >>>"); + SERIAL_ECHOLNPGM(">>> gcode_G29"); DEBUG_POS("", current_position); } #endif diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 8af50da26..ea81b0c72 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -344,7 +344,9 @@ void Config_RetrieveSettings() { char stored_ver[4]; char ver[4] = EEPROM_VERSION; EEPROM_READ_VAR(i, stored_ver); //read stored version - // SERIAL_ECHO("Version: [" << ver << "] Stored version: [" << stored_ver << "]\n"); + // SERIAL_ECHOPAIR("Version: [", ver); + // SERIAL_ECHOPAIR("] Stored version: [", stored_ver); + // SERIAL_ECHOLNPGM("]"); if (strncmp(ver, stored_ver, 3) != 0) { Config_ResetDefault(); From 8268c0a9a06f2b39b32cdf4dc31730d3d77c5776 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jun 2016 16:27:22 -0700 Subject: [PATCH 211/580] Always define temp sensor, heater pins for RUMBA --- Marlin/pins_RUMBA.h | 49 +++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h index e086ec446..91f631d38 100644 --- a/Marlin/pins_RUMBA.h +++ b/Marlin/pins_RUMBA.h @@ -77,43 +77,36 @@ #define PS_ON_PIN 45 #define KILL_PIN 46 -#if TEMP_SENSOR_0 != 0 - #define HEATER_0_PIN 2 // EXTRUDER 1 - #if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 6 // ANALOG NUMBERING - connector *K1* on RUMBA thermocouple ADD ON is used - #else - #define TEMP_0_PIN 15 // ANALOG NUMBERING - default connector for thermistor *T0* on rumba board is used - #endif +#define HEATER_0_PIN 2 // EXTRUDER 1 +#define HEATER_1_PIN 3 // EXTRUDER 2 +#define HEATER_2_PIN 6 // EXTRUDER 3 + +#if TEMP_SENSOR_0 == -1 + #define TEMP_0_PIN 6 // ANALOG NUMBERING - connector *K1* on RUMBA thermocouple ADD ON is used +#else + #define TEMP_0_PIN 15 // ANALOG NUMBERING - default connector for thermistor *T0* on rumba board is used #endif -#if TEMP_SENSOR_1 != 0 - #define HEATER_1_PIN 3 // EXTRUDER 2 - #if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 5 // ANALOG NUMBERING - connector *K2* on RUMBA thermocouple ADD ON is used - #else - #define TEMP_1_PIN 14 // ANALOG NUMBERING - default connector for thermistor *T1* on rumba board is used - #endif +#if TEMP_SENSOR_1 == -1 + #define TEMP_1_PIN 5 // ANALOG NUMBERING - connector *K2* on RUMBA thermocouple ADD ON is used +#else + #define TEMP_1_PIN 14 // ANALOG NUMBERING - default connector for thermistor *T1* on rumba board is used #endif -#if TEMP_SENSOR_2 != 0 - #define HEATER_2_PIN 6 // EXTRUDER 3 - #if TEMP_SENSOR_2 == -1 - #define TEMP_2_PIN 7 // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_BED is defined as thermocouple - #else - #define TEMP_2_PIN 13 // ANALOG NUMBERING - default connector for thermistor *T2* on rumba board is used - #endif +#if TEMP_SENSOR_2 == -1 + #define TEMP_2_PIN 7 // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_BED is defined as thermocouple +#else + #define TEMP_2_PIN 13 // ANALOG NUMBERING - default connector for thermistor *T2* on rumba board is used #endif //optional for extruder 4 or chamber: #define TEMP_X_PIN 12 // ANALOG NUMBERING - default connector for thermistor *T3* on rumba board is used //optional FAN1 can be used as 4th heater output: #define HEATER_3_PIN 8 // EXTRUDER 4 -#if TEMP_SENSOR_BED != 0 - #define HEATER_BED_PIN 9 // BED - #if TEMP_SENSOR_BED == -1 - #define TEMP_BED_PIN 7 // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_2 is defined as thermocouple - #else - #define TEMP_BED_PIN 11 // ANALOG NUMBERING - default connector for thermistor *THB* on rumba board is used - #endif +#define HEATER_BED_PIN 9 // BED +#if TEMP_SENSOR_BED == -1 + #define TEMP_BED_PIN 7 // ANALOG NUMBERING - connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_2 is defined as thermocouple +#else + #define TEMP_BED_PIN 11 // ANALOG NUMBERING - default connector for thermistor *THB* on rumba board is used #endif #define SDSS 53 From 683975cf90ff3e1c1ca22ad9dd5ea9834dc97141 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jun 2016 16:49:13 -0700 Subject: [PATCH 212/580] Fix spelling in a config comment --- Marlin/Configuration.h | 2 +- Marlin/example_configurations/Cartesio/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/DUAL/Configuration.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/Hephestos_2/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- Marlin/example_configurations/RigidBot/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/TAZ4/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 01c10530a..aa1733cc2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1138,7 +1138,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 915be5b55..2fd390eed 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -1137,7 +1137,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. #define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 62aa357f8..d8495eb84 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1121,7 +1121,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index e20fa1211..731d8ce5e 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -1119,7 +1119,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index a1995b3b3..a047e59c5 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1130,7 +1130,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index f15ad7a48..4704fa822 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1132,7 +1132,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 54362c250..5267edcbd 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1155,7 +1155,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 356c706c8..e394b6b2a 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -1138,7 +1138,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index a0abbeda8..ad5c40850 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -1138,7 +1138,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index cc10ca773..1c23794d0 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1146,7 +1146,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 77a5b1d96..e5a7dd844 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -1159,7 +1159,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index b56080872..d3012dbfb 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1130,7 +1130,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 5039f64e9..9c4f23d18 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -1138,7 +1138,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index aca16d02d..5dd547a51 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1223,7 +1223,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 5e2afed02..509cfca31 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1217,7 +1217,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index f27d37710..f2e3b46f9 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1220,7 +1220,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 36fbd8e1a..66781c796 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1220,7 +1220,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 48cc54fff..c62d63d3f 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1222,7 +1222,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index f1b0c813d..654392558 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1141,7 +1141,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index b693cb22b..8d14edadf 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1132,7 +1132,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // at zero value, there are 128 effective control positions. #define SOFT_PWM_SCALE 0 -// Temperature status LEDs that display the hotend and bet temperature. +// Temperature status LEDs that display the hotend and bed temperature. // If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. // Otherwise the RED led is on. There is 1C hysteresis. //#define TEMP_STAT_LEDS From abda4ab4273d4aea3e16371d08348b40f6f72779 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jun 2016 16:56:48 -0700 Subject: [PATCH 213/580] Clean up CNControls pins --- Marlin/pins_CNCONTROLS_12.h | 191 ++++++++++++++++++------------------ 1 file changed, 93 insertions(+), 98 deletions(-) diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h index 850455670..81e885eef 100644 --- a/Marlin/pins_CNCONTROLS_12.h +++ b/Marlin/pins_CNCONTROLS_12.h @@ -8,101 +8,96 @@ //#define LARGE_FLASH true - #define X_ENABLE_PIN 26 - #define X_STEP_PIN 25 - #define X_DIR_PIN 27 - #define X_MIN_PIN 19 - #define X_MAX_PIN -1 - - #define Y_ENABLE_PIN 29 - #define Y_STEP_PIN 28 - #define Y_DIR_PIN 30 - #define Y_MIN_PIN 22 - #define Y_MAX_PIN -1 - - #define Z_ENABLE_PIN 32 - #define Z_STEP_PIN 31 - #define Z_DIR_PIN 33 - #define Z_MIN_PIN 23 - #define Z_MAX_PIN -1 - - -//Tools - - #define E0_ENABLE_PIN 58 - #define E0_STEP_PIN 57 - #define E0_DIR_PIN 55 - #define HEATER_0_PIN 11 - #define TEMP_0_PIN 0 // ANALOG INPUT !! -// #define TOOL_0_PIN 56 -// #define TOOL_0_PWM_PIN 10 // used for red warning led at dual extruder - - #define E1_ENABLE_PIN 60 - #define E1_STEP_PIN 61 - #define E1_DIR_PIN 62 - #define HEATER_1_PIN 9 - #define TEMP_1_PIN 9 // 9 for tool3 -> 13 for chambertemp -// #define TOOL_1_PIN 59 -// #define TOOL_1_PWM_PIN 8 // used for lights at dual extruder - - #define E2_ENABLE_PIN 44 - #define E2_STEP_PIN 46 - #define E2_DIR_PIN 66 - #define HEATER_2_PIN 6 - #define TEMP_2_PIN 13 // 10 for tool3 -> 13 for chambertemp -// #define TOOL_2_PIN 4 -// #define TOOL_2_PWM_PIN 5 - - #define E3_ENABLE_PIN 47 - #define E3_STEP_PIN 45 - #define E3_DIR_PIN 69 - #define HEATER_3_PIN 3 - #define TEMP_3_PIN 11 // 11 for tool4 -> 13 for chambertemp -// #define TOOL_3_PIN 14 -// #define TOOL_3_PWM_PIN 2 - - #define HEATER_BED_PIN 24 - #define TEMP_BED_PIN 14 // ANALOG INPUT !! - -//common I/O - - //#define TEMP_CHAMBER_PIN 13 // ANALOG INPUT !! - #define FIL_RUNOUT_PIN 18 - //#define PWM_1_PIN 12 - //#define PWM_2_PIN 13 - //#define SPARE_IO 17 - #define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools - - -//user interface - - #define BEEPER_PIN 16 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 39 - #define DOGLCD_CS 35 - #define DOGLCD_MOSI 48 - #define DOGLCD_SCK 49 - #define LCD_SCREEN_ROT_180 - - //The encoder and click button - #define BTN_EN1 36 - #define BTN_EN2 34 - #define BTN_ENC 38 //the click switch - - //hardware buttons for manual movement of XYZ - #define SHIFT_OUT 42 - #define SHIFT_LD 41 - #define SHIFT_CLK 40 - - - //#define UI1 43 - //#define UI2 37 - - -// Other - - #define SDSS 53 - #define SD_DETECT_PIN 15 - #define STAT_LED_BLUE -1 - #define STAT_LED_RED 10 // TOOL_0_PWM_PIN +#define X_ENABLE_PIN 26 +#define X_STEP_PIN 25 +#define X_DIR_PIN 27 +#define X_MIN_PIN 19 +#define X_MAX_PIN -1 + +#define Y_ENABLE_PIN 29 +#define Y_STEP_PIN 28 +#define Y_DIR_PIN 30 +#define Y_MIN_PIN 22 +#define Y_MAX_PIN -1 + +#define Z_ENABLE_PIN 32 +#define Z_STEP_PIN 31 +#define Z_DIR_PIN 33 +#define Z_MIN_PIN 23 +#define Z_MAX_PIN -1 + +#define E0_ENABLE_PIN 58 +#define E0_STEP_PIN 57 +#define E0_DIR_PIN 55 +#define HEATER_0_PIN 11 +#define TEMP_0_PIN 0 // ANALOG INPUT !! + +#define E1_ENABLE_PIN 60 +#define E1_STEP_PIN 61 +#define E1_DIR_PIN 62 +#define HEATER_1_PIN 9 +#define TEMP_1_PIN 9 // 9 for tool3 -> 13 for chambertemp + +#define E2_ENABLE_PIN 44 +#define E2_STEP_PIN 46 +#define E2_DIR_PIN 66 +#define HEATER_2_PIN 6 +#define TEMP_2_PIN 13 // 10 for tool3 -> 13 for chambertemp + +#define E3_ENABLE_PIN 47 +#define E3_STEP_PIN 45 +#define E3_DIR_PIN 69 +#define HEATER_3_PIN 3 +#define TEMP_3_PIN 11 // 11 for tool4 -> 13 for chambertemp + +#define HEATER_BED_PIN 24 +#define TEMP_BED_PIN 14 // ANALOG INPUT !! + +// Tools + +//#define TOOL_0_PIN 56 +//#define TOOL_0_PWM_PIN 10 // red warning led at dual extruder +//#define TOOL_1_PIN 59 +//#define TOOL_1_PWM_PIN 8 // lights at dual extruder +//#define TOOL_2_PIN 4 +//#define TOOL_2_PWM_PIN 5 +//#define TOOL_3_PIN 14 +//#define TOOL_3_PWM_PIN 2 + +// Common I/O + +//#define TEMP_CHAMBER_PIN 13 // ANALOG INPUT !! +#define FIL_RUNOUT_PIN 18 +//#define PWM_1_PIN 12 +//#define PWM_2_PIN 13 +//#define SPARE_IO 17 +#define FAN_PIN 5 // 5 is PWMtool3 -> 7 is common PWM pin for all tools + +// User interface +#define BEEPER_PIN 16 + +// Pins for DOGM SPI LCD Support +#define DOGLCD_A0 39 +#define DOGLCD_CS 35 +#define DOGLCD_MOSI 48 +#define DOGLCD_SCK 49 +#define LCD_SCREEN_ROT_180 + +// The encoder and click button +#define BTN_EN1 36 +#define BTN_EN2 34 +#define BTN_ENC 38 + +// Hardware buttons for manual movement of XYZ +#define SHIFT_OUT 42 +#define SHIFT_LD 41 +#define SHIFT_CLK 40 + +//#define UI1 43 +//#define UI2 37 + +// Other +#define SDSS 53 +#define SD_DETECT_PIN 15 +#define STAT_LED_BLUE -1 +#define STAT_LED_RED 10 // TOOL_0_PWM_PIN From 0b0b7aac6e04270d187b8d8c04b6cbb4a8d057d7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jun 2016 18:11:32 -0700 Subject: [PATCH 214/580] Support for VIKI2 in RAMPS and derivatives --- Marlin/pins_AZTEEG_X3.h | 20 ++++++-------------- Marlin/pins_AZTEEG_X3_PRO.h | 27 +++++---------------------- Marlin/pins_MKS_13.h | 5 +++++ Marlin/pins_RAMPS_14.h | 21 +++++++++++++++++++++ 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index 2668d0913..adc0332fb 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -26,26 +26,18 @@ #include "pins_RAMPS_14_EFB.h" -//LCD Pins// - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support + #undef DOGLCD_A0 + #undef DOGLCD_CS + #undef BTN_ENC #define DOGLCD_A0 31 #define DOGLCD_CS 32 - #define LCD_SCREEN_ROT_180 - - //The encoder and click button - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 12 //the click switch - - #define SDSS 53 - #define SD_DETECT -1 // Pin 49 if using display sd interface + #define BTN_ENC 12 #if ENABLED(TEMP_STAT_LEDS) + #undef STAT_LED_RED + #undef STAT_LED_BLUE #define STAT_LED_RED 64 #define STAT_LED_BLUE 63 #endif diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index a209d0b83..58d979ab3 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -105,27 +105,10 @@ #undef SERVO0_PIN #define SERVO0_PIN 47 -//LCD Pins// - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 33 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - //The encoder and click button - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 //the click switch - - #define SDSS 53 - #define SD_DETECT_PIN 49 - - #define KILL_PIN 31 -#endif - -#if ENABLED(TEMP_STAT_LEDS) - #define STAT_LED_RED 32 - #define STAT_LED_BLUE 35 + #undef SD_DETECT_PIN + #define SD_DETECT_PIN 49 // For easy adapter board +#elif ENABLED(TEMP_STAT_LEDS) + #define STAT_LED_RED 32 + #define STAT_LED_BLUE 35 #endif diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index 5857a2bf9..346a43e29 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -33,3 +33,8 @@ #undef HEATER_1_PIN #define HEATER_1_PIN 7 // EXTRUDER 2 (-1 on RAMPS 1.4) + +#if ENABLED(VIKI2) || ENABLED(miniVIKI) + //#undef SD_DETECT_PIN + //#define SD_DETECT_PIN 49 // For easy adapter board +#endif diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 55e810aa6..e860585e3 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -183,6 +183,27 @@ #define BTN_ENC -1 #define LCD_SDSS 53 #define SD_DETECT_PIN 49 + #elif ENABLED(VIKI2) || ENABLED(miniVIKI) + #define BEEPER_PIN 33 + + // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 44 + #define DOGLCD_CS 45 + #define LCD_SCREEN_ROT_180 + + #define BTN_EN1 22 + #define BTN_EN2 7 + #define BTN_ENC 39 + + #define SDSS 53 + #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board + + #define KILL_PIN 31 + + #if ENABLED(TEMP_STAT_LEDS) + #define STAT_LED_RED 32 + #define STAT_LED_BLUE 35 + #endif #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #define BTN_EN1 35 // reverse if the encoder turns the wrong way. #define BTN_EN2 37 From 5e14a528dd7ac4f13d577b56f20b93425ca675b3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jun 2016 19:00:59 -0700 Subject: [PATCH 215/580] Always wait for cooling in M109/M190, break at low temp or if cooling stalls --- Marlin/Marlin_main.cpp | 49 +++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 293d16522..b053827aa 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4550,7 +4550,7 @@ inline void gcode_M109() { else print_job_timer.start(); #endif - if (temp > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING); + if (thermalManager.isHeatingHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING); } #if ENABLED(AUTOTEMP) @@ -4566,10 +4566,10 @@ inline void gcode_M109() { #define TEMP_CONDITIONS (wants_to_cool ? thermalManager.isCoolingHotend(target_extruder) : thermalManager.isHeatingHotend(target_extruder)) #endif //TEMP_RESIDENCY_TIME > 0 - float theTarget = -1; + float theTarget = -1.0, old_temp = 9999.0; bool wants_to_cool; cancel_heatup = false; - millis_t now, next_temp_ms = 0; + millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; KEEPALIVE_STATE(NOT_BUSY); @@ -4581,10 +4581,6 @@ inline void gcode_M109() { // Exit if S, continue if S, R, or R if (no_wait_for_cooling && wants_to_cool) break; - - // Prevent a wait-forever situation if R is misused i.e. M109 R0 - // Try to calculate a ballpark safe margin by halving EXTRUDE_MINTEMP - if (wants_to_cool && theTarget < (EXTRUDE_MINTEMP)/2) break; } now = millis(); @@ -4608,9 +4604,11 @@ inline void gcode_M109() { idle(); refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out + float temp = thermalManager.degHotend(target_extruder); + #if TEMP_RESIDENCY_TIME > 0 - float temp_diff = fabs(theTarget - thermalManager.degHotend(target_extruder)); + float temp_diff = fabs(theTarget - temp); if (!residency_start_ms) { // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time. @@ -4623,6 +4621,17 @@ inline void gcode_M109() { #endif //TEMP_RESIDENCY_TIME > 0 + // Prevent a wait-forever situation if R is misused i.e. M109 R0 + if (wants_to_cool) { + if (temp < (EXTRUDE_MINTEMP) / 2) break; // always break at (default) 85° + // break after 20 seconds if cooling stalls + if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { + if (old_temp - temp < 1.0) break; + next_cool_check_ms = now + 20000; + old_temp = temp; + } + } + } while (!cancel_heatup && TEMP_CONDITIONS); LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); @@ -4651,10 +4660,10 @@ inline void gcode_M109() { #define TEMP_BED_CONDITIONS (wants_to_cool ? thermalManager.isCoolingBed() : thermalManager.isHeatingBed()) #endif //TEMP_BED_RESIDENCY_TIME > 0 - float theTarget = -1; + float theTarget = -1.0, old_temp = 9999.0; bool wants_to_cool; cancel_heatup = false; - millis_t now, next_temp_ms = 0; + millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; KEEPALIVE_STATE(NOT_BUSY); @@ -4666,10 +4675,6 @@ inline void gcode_M109() { // Exit if S, continue if S, R, or R if (no_wait_for_cooling && wants_to_cool) break; - - // Prevent a wait-forever situation if R is misused i.e. M190 R0 - // Simply don't wait to cool a bed under 30C - if (wants_to_cool && theTarget < 30) break; } now = millis(); @@ -4693,9 +4698,11 @@ inline void gcode_M109() { idle(); refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out + float temp = thermalManager.degBed(); + #if TEMP_BED_RESIDENCY_TIME > 0 - float temp_diff = fabs(theTarget - thermalManager.degBed()); + float temp_diff = fabs(theTarget - temp); if (!residency_start_ms) { // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time. @@ -4708,7 +4715,19 @@ inline void gcode_M109() { #endif //TEMP_BED_RESIDENCY_TIME > 0 + // Prevent a wait-forever situation if R is misused i.e. M190 R0 + if (wants_to_cool) { + if (temp < 30.0) break; // always break at 30° + // break after 20 seconds if cooling stalls + if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { + if (old_temp - temp < 1.0) break; + next_cool_check_ms = now + 20000; + old_temp = temp; + } + } + } while (!cancel_heatup && TEMP_BED_CONDITIONS); + LCD_MESSAGEPGM(MSG_BED_DONE); KEEPALIVE_STATE(IN_HANDLER); } From f84d85f76141efe66ccc205c96bd98cfb0af3233 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 30 Jun 2016 00:06:00 -0700 Subject: [PATCH 216/580] Cleanup extruder runout configs --- Marlin/Configuration_adv.h | 6 +++--- Marlin/example_configurations/Cartesio/Configuration_adv.h | 6 +++--- Marlin/example_configurations/Felix/Configuration_adv.h | 6 +++--- Marlin/example_configurations/Hephestos/Configuration_adv.h | 6 +++--- .../example_configurations/Hephestos_2/Configuration_adv.h | 6 +++--- Marlin/example_configurations/K8200/Configuration_adv.h | 6 +++--- Marlin/example_configurations/RigidBot/Configuration_adv.h | 6 +++--- Marlin/example_configurations/SCARA/Configuration_adv.h | 6 +++--- Marlin/example_configurations/TAZ4/Configuration_adv.h | 6 +++--- Marlin/example_configurations/WITBOX/Configuration_adv.h | 6 +++--- .../example_configurations/delta/biv2.5/Configuration_adv.h | 6 +++--- .../delta/generic/Configuration_adv.h | 6 +++--- .../delta/kossel_mini/Configuration_adv.h | 6 +++--- .../delta/kossel_pro/Configuration_adv.h | 6 +++--- .../delta/kossel_xl/Configuration_adv.h | 6 +++--- Marlin/example_configurations/makibox/Configuration_adv.h | 6 +++--- .../tvrrug/Round2/Configuration_adv.h | 6 +++--- 17 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index a0929dc96..baabbb50a 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index c8d9be298..e7f4f10e8 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index d739c56a8..8de3db946 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 8644b5f18..727fe6c0e 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 74a22c17d..24aa11cdc 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index ea4205027..491a8d923 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -153,9 +153,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 4f38b0c4c..020804017 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 489e57b19..d232c6beb 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 180 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 180. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 180 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 7c3bba374..ca80621ba 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 8644b5f18..727fe6c0e 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 35a745d1b..8e0653dbb 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 82ca2d625..af1035228 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 7a8eea007..94f6f134a 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 4b5144065..7ed46feeb 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -152,9 +152,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index fb59b0df4..117a2ad31 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index b8c45f2cb..772f05e5e 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 7da66c773..78758bd79 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -147,9 +147,9 @@ //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded //#define EXTRUDER_RUNOUT_PREVENT #define EXTRUDER_RUNOUT_MINTEMP 190 -#define EXTRUDER_RUNOUT_SECONDS 30. -#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament -#define EXTRUDER_RUNOUT_SPEED 1500. //extrusion speed +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed #define EXTRUDER_RUNOUT_EXTRUDE 100 // @section temperature From c42f8fb8dd69afb5438243099c439ce8b03f3e86 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 30 Jun 2016 15:37:32 -0700 Subject: [PATCH 217/580] Rename some movement sub-functions --- Marlin/Marlin_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 293d16522..1da32e849 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7537,7 +7537,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, #if ENABLED(DUAL_X_CARRIAGE) - inline bool prepare_move_dual_x_carriage() { + inline bool prepare_move_to_destination_dualx() { if (active_extruder_parked) { if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) { // move duplicate extruder into correct duplication position. @@ -7576,7 +7576,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, #if DISABLED(DELTA) && DISABLED(SCARA) - inline bool prepare_cartesian_move_to_destination() { + inline bool prepare_move_to_destination_cartesian() { // Do not use feedrate_multiplier for E or Z only moves if (current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS]) { line_to_destination(); @@ -7637,9 +7637,9 @@ void prepare_move_to_destination() { if (!prepare_delta_move_to(destination)) return; #else #if ENABLED(DUAL_X_CARRIAGE) - if (!prepare_move_dual_x_carriage()) return; + if (!prepare_move_to_destination_dualx()) return; #endif - if (!prepare_cartesian_move_to_destination()) return; + if (!prepare_move_to_destination_cartesian()) return; #endif set_current_to_destination(); From da6b0dab5f96f08996f22428087eed0bc7420773 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 30 Jun 2016 16:09:43 -0700 Subject: [PATCH 218/580] Use prepare_move_to_destination for Allen Key deploy/stow --- Marlin/Marlin_main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1da32e849..646ec3bd6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1821,7 +1821,7 @@ static void clean_up_after_endstop_or_probe_move() { destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X; destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z; - prepare_move_to_destination_raw(); // this will also set_current_to_destination + prepare_move_to_destination(); // this will also set_current_to_destination // Move to engage deployment if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE) @@ -1832,7 +1832,7 @@ static void clean_up_after_endstop_or_probe_move() { destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y; if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z; - prepare_move_to_destination_raw(); + prepare_move_to_destination(); #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) @@ -1848,14 +1848,14 @@ static void clean_up_after_endstop_or_probe_move() { if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z; - prepare_move_to_destination_raw(); + prepare_move_to_destination(); #endif } // Partially Home X,Y for safety destination[X_AXIS] *= 0.75; destination[Y_AXIS] *= 0.75; - prepare_move_to_destination_raw(); // this will also set_current_to_destination + prepare_move_to_destination(); // this will also set_current_to_destination feedrate = old_feedrate; @@ -1921,7 +1921,7 @@ static void clean_up_after_endstop_or_probe_move() { destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X; destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z; - prepare_move_to_destination_raw(); + prepare_move_to_destination(); // Move the nozzle down to push the Z probe into retracted position if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE) @@ -1931,7 +1931,7 @@ static void clean_up_after_endstop_or_probe_move() { if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y) destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z; - prepare_move_to_destination_raw(); + prepare_move_to_destination(); // Move up for safety if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE) @@ -1941,13 +1941,13 @@ static void clean_up_after_endstop_or_probe_move() { if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y) destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y; destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z; - prepare_move_to_destination_raw(); + prepare_move_to_destination(); // Home XY for safety feedrate = homing_feedrate[X_AXIS] / 2; destination[X_AXIS] = 0; destination[Y_AXIS] = 0; - prepare_move_to_destination_raw(); // this will also set_current_to_destination + prepare_move_to_destination(); // this will also set_current_to_destination feedrate = old_feedrate; From 5e370006fcebac9f38f60e79c6435b846d0c5f65 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 29 Jun 2016 18:12:23 -0700 Subject: [PATCH 219/580] EEPROM Checksum --- Marlin/configuration_store.cpp | 158 +++++++++++++++++++-------------- 1 file changed, 91 insertions(+), 67 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index ea81b0c72..79d23b000 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -36,88 +36,89 @@ * */ -#define EEPROM_VERSION "V23" +#define EEPROM_VERSION "V24" /** - * V23 EEPROM Layout: + * V24 EEPROM Layout: * * 100 Version (char x4) + * 104 EEPROM Checksum (uint16_t) * - * 104 M92 XYZE planner.axis_steps_per_mm (float x4) - * 120 M203 XYZE planner.max_feedrate (float x4) - * 136 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4) - * 152 M204 P planner.acceleration (float) - * 156 M204 R planner.retract_acceleration (float) - * 160 M204 T planner.travel_acceleration (float) - * 164 M205 S planner.min_feedrate (float) - * 168 M205 T planner.min_travel_feedrate (float) - * 172 M205 B planner.min_segment_time (ulong) - * 176 M205 X planner.max_xy_jerk (float) - * 180 M205 Z planner.max_z_jerk (float) - * 184 M205 E planner.max_e_jerk (float) - * 188 M206 XYZ home_offset (float x3) + * 106 M92 XYZE planner.axis_steps_per_mm (float x4) + * 122 M203 XYZE planner.max_feedrate (float x4) + * 138 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4) + * 154 M204 P planner.acceleration (float) + * 158 M204 R planner.retract_acceleration (float) + * 162 M204 T planner.travel_acceleration (float) + * 166 M205 S planner.min_feedrate (float) + * 170 M205 T planner.min_travel_feedrate (float) + * 174 M205 B planner.min_segment_time (ulong) + * 178 M205 X planner.max_xy_jerk (float) + * 182 M205 Z planner.max_z_jerk (float) + * 186 M205 E planner.max_e_jerk (float) + * 190 M206 XYZ home_offset (float x3) * * Mesh bed leveling: - * 200 M420 S status (uint8) - * 201 z_offset (float) - * 205 mesh_num_x (uint8 as set in firmware) - * 206 mesh_num_y (uint8 as set in firmware) - * 207 G29 S3 XYZ z_values[][] (float x9, by default) + * 202 M420 S status (uint8) + * 203 z_offset (float) + * 207 mesh_num_x (uint8 as set in firmware) + * 208 mesh_num_y (uint8 as set in firmware) + * 209 G29 S3 XYZ z_values[][] (float x9, by default) * * AUTO BED LEVELING - * 243 M851 zprobe_zoffset (float) + * 245 M851 zprobe_zoffset (float) * * DELTA: - * 247 M666 XYZ endstop_adj (float x3) - * 259 M665 R delta_radius (float) - * 263 M665 L delta_diagonal_rod (float) - * 267 M665 S delta_segments_per_second (float) - * 271 M665 A delta_diagonal_rod_trim_tower_1 (float) - * 275 M665 B delta_diagonal_rod_trim_tower_2 (float) - * 279 M665 C delta_diagonal_rod_trim_tower_3 (float) + * 249 M666 XYZ endstop_adj (float x3) + * 261 M665 R delta_radius (float) + * 265 M665 L delta_diagonal_rod (float) + * 269 M665 S delta_segments_per_second (float) + * 273 M665 A delta_diagonal_rod_trim_tower_1 (float) + * 277 M665 B delta_diagonal_rod_trim_tower_2 (float) + * 281 M665 C delta_diagonal_rod_trim_tower_3 (float) * * Z_DUAL_ENDSTOPS: - * 283 M666 Z z_endstop_adj (float) + * 285 M666 Z z_endstop_adj (float) * * ULTIPANEL: - * 287 M145 S0 H plaPreheatHotendTemp (int) - * 289 M145 S0 B plaPreheatHPBTemp (int) - * 291 M145 S0 F plaPreheatFanSpeed (int) - * 293 M145 S1 H absPreheatHotendTemp (int) - * 295 M145 S1 B absPreheatHPBTemp (int) - * 297 M145 S1 F absPreheatFanSpeed (int) + * 289 M145 S0 H plaPreheatHotendTemp (int) + * 291 M145 S0 B plaPreheatHPBTemp (int) + * 293 M145 S0 F plaPreheatFanSpeed (int) + * 295 M145 S1 H absPreheatHotendTemp (int) + * 297 M145 S1 B absPreheatHPBTemp (int) + * 299 M145 S1 F absPreheatFanSpeed (int) * * PIDTEMP: - * 299 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) - * 315 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4) - * 331 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4) - * 347 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) - * 363 M301 L lpq_len (int) + * 301 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) + * 317 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4) + * 333 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4) + * 349 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) + * 365 M301 L lpq_len (int) * * PIDTEMPBED: - * 365 M304 PID thermalManager.bedKp, thermalManager.bedKi, thermalManager.bedKd (float x3) + * 367 M304 PID thermalManager.bedKp, thermalManager.bedKi, thermalManager.bedKd (float x3) * * DOGLCD: - * 377 M250 C lcd_contrast (int) + * 379 M250 C lcd_contrast (int) * * SCARA: - * 379 M365 XYZ axis_scaling (float x3) + * 381 M365 XYZ axis_scaling (float x3) * * FWRETRACT: - * 391 M209 S autoretract_enabled (bool) - * 392 M207 S retract_length (float) - * 396 M207 W retract_length_swap (float) - * 400 M207 F retract_feedrate_mm_s (float) - * 404 M207 Z retract_zlift (float) - * 408 M208 S retract_recover_length (float) - * 412 M208 W retract_recover_length_swap (float) - * 416 M208 F retract_recover_feedrate (float) + * 393 M209 S autoretract_enabled (bool) + * 394 M207 S retract_length (float) + * 398 M207 W retract_length_swap (float) + * 402 M207 F retract_feedrate_mm_s (float) + * 406 M207 Z retract_zlift (float) + * 410 M208 S retract_recover_length (float) + * 414 M208 W retract_recover_length_swap (float) + * 418 M208 F retract_recover_feedrate (float) * * Volumetric Extrusion: - * 420 M200 D volumetric_enabled (bool) - * 421 M200 T D filament_size (float x4) (T0..3) + * 422 M200 D volumetric_enabled (bool) + * 423 M200 T D filament_size (float x4) (T0..3) * - * 437 This Slot is Available! + * 439 This Slot is Available! * */ #include "Marlin.h" @@ -131,6 +132,9 @@ #include "mesh_bed_leveling.h" #endif +uint16_t eeprom_checksum; +const char version[4] = EEPROM_VERSION; + void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) { uint8_t c; while (size--) { @@ -140,13 +144,16 @@ void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) { SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); } + eeprom_checksum += c; pos++; value++; }; } void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) { do { - *value = eeprom_read_byte((unsigned char*)pos); + uint8_t c = eeprom_read_byte((unsigned char*)pos); + *value = c; + eeprom_checksum += c; pos++; value++; } while (--size); @@ -172,7 +179,12 @@ void Config_StoreSettings() { float dummy = 0.0f; char ver[4] = "000"; int i = EEPROM_OFFSET; - EEPROM_WRITE_VAR(i, ver); // invalidate data first + + EEPROM_WRITE_VAR(i, ver); // invalidate data first + i += sizeof(eeprom_checksum); // Skip the checksum slot + + eeprom_checksum = 0; // clear before first "real data" + EEPROM_WRITE_VAR(i, planner.axis_steps_per_mm); EEPROM_WRITE_VAR(i, planner.max_feedrate); EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2); @@ -324,9 +336,11 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, dummy); } - char ver2[4] = EEPROM_VERSION; + uint16_t final_checksum = eeprom_checksum; + int j = EEPROM_OFFSET; - EEPROM_WRITE_VAR(j, ver2); // validate data + EEPROM_WRITE_VAR(j, version); + EEPROM_WRITE_VAR(j, final_checksum); // Report storage size SERIAL_ECHO_START; @@ -342,18 +356,21 @@ void Config_RetrieveSettings() { int i = EEPROM_OFFSET; char stored_ver[4]; - char ver[4] = EEPROM_VERSION; - EEPROM_READ_VAR(i, stored_ver); //read stored version + uint16_t stored_checksum; + EEPROM_READ_VAR(i, stored_ver); + EEPROM_READ_VAR(i, stored_checksum); // SERIAL_ECHOPAIR("Version: [", ver); // SERIAL_ECHOPAIR("] Stored version: [", stored_ver); // SERIAL_ECHOLNPGM("]"); - if (strncmp(ver, stored_ver, 3) != 0) { + if (strncmp(version, stored_ver, 3) != 0) { Config_ResetDefault(); } else { float dummy = 0; + eeprom_checksum = 0; // clear before reading first "real data" + // version number match EEPROM_READ_VAR(i, planner.axis_steps_per_mm); EEPROM_READ_VAR(i, planner.max_feedrate); @@ -506,12 +523,19 @@ void Config_RetrieveSettings() { // Call thermalManager.updatePID (similar to when we have processed M301) thermalManager.updatePID(); - // Report settings retrieved and length - SERIAL_ECHO_START; - SERIAL_ECHO(ver); - SERIAL_ECHOPAIR(" stored settings retrieved (", i); - SERIAL_ECHOLNPGM(" bytes)"); - } + if (eeprom_checksum == stored_checksum) { + Config_Postprocess(); + SERIAL_ECHO_START; + SERIAL_ECHO(version); + SERIAL_ECHOPAIR(" stored settings retrieved (", i); + SERIAL_ECHOLNPGM(" bytes)"); + } + else { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("EEPROM checksum mismatch"); + Config_ResetDefault(); + } + } #if ENABLED(EEPROM_CHITCHAT) Config_PrintSettings(); From adcd0f5de3882c4fde5d45a549bf65046287a42e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 29 Jun 2016 18:18:46 -0700 Subject: [PATCH 220/580] Some formatting in configuration_store.cpp --- Marlin/configuration_store.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 79d23b000..2946c8455 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -38,6 +38,9 @@ #define EEPROM_VERSION "V24" +// Change EEPROM version if these are changed: +#define EEPROM_OFFSET 100 + /** * V24 EEPROM Layout: * @@ -158,23 +161,22 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) { value++; } while (--size); } -#define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value)) -#define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value)) /** * Store Configuration Settings - M500 */ -#define DUMMY_PID_VALUE 3000.0f -#define EEPROM_OFFSET 100 #if ENABLED(EEPROM_SETTINGS) + #define DUMMY_PID_VALUE 3000.0f + #define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value)) + #define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value)) + /** - * Store Configuration Settings - M500 + * M500 - Store Configuration */ - void Config_StoreSettings() { float dummy = 0.0f; char ver[4] = "000"; @@ -349,11 +351,9 @@ void Config_StoreSettings() { } /** - * Retrieve Configuration Settings - M501 + * M501 - Retrieve Configuration */ - void Config_RetrieveSettings() { - int i = EEPROM_OFFSET; char stored_ver[4]; uint16_t stored_checksum; @@ -545,9 +545,8 @@ void Config_RetrieveSettings() { #endif // EEPROM_SETTINGS /** - * Reset Configuration Settings - M502 + * M502 - Reset Configuration */ - void Config_ResetDefault() { float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT; float tmp2[] = DEFAULT_MAX_FEEDRATE; @@ -663,12 +662,11 @@ void Config_ResetDefault() { #if DISABLED(DISABLE_M503) -/** - * Print Configuration Settings - M503 - */ - #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START; }while(0) +/** + * M503 - Print Configuration + */ void Config_PrintSettings(bool forReplay) { // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown From bc3748b7bc9871b0f709e13c886f6e6568f038a7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 29 Jun 2016 18:19:26 -0700 Subject: [PATCH 221/580] Add shared Config_Postprocess for Read and Reset --- Marlin/configuration_store.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 2946c8455..0cb1a4f9c 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -163,10 +163,22 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) { } /** - * Store Configuration Settings - M500 + * Post-process after Retrieve or Reset */ +void Config_Postprocess() { + // steps per s2 needs to be updated to agree with units per s2 + planner.reset_acceleration_rates(); + + #if ENABLED(DELTA) + recalc_delta_settings(delta_radius, delta_diagonal_rod); + #endif + #if ENABLED(PIDTEMP) + thermalManager.updatePID(); + #endif + calculate_volumetric_multipliers(); +} #if ENABLED(EEPROM_SETTINGS) @@ -376,9 +388,6 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, planner.max_feedrate); EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2); - // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner) - planner.reset_acceleration_rates(); - EEPROM_READ_VAR(i, planner.acceleration); EEPROM_READ_VAR(i, planner.retract_acceleration); EEPROM_READ_VAR(i, planner.travel_acceleration); @@ -421,7 +430,6 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_1); // 1 float EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_2); // 1 float EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_3); // 1 float - recalc_delta_settings(delta_radius, delta_diagonal_rod); #elif ENABLED(Z_DUAL_ENDSTOPS) EEPROM_READ_VAR(i, z_endstop_adj); dummy = 0.0f; @@ -519,10 +527,6 @@ void Config_RetrieveSettings() { if (q < EXTRUDERS) filament_size[q] = dummy; } - calculate_volumetric_multipliers(); - // Call thermalManager.updatePID (similar to when we have processed M301) - thermalManager.updatePID(); - if (eeprom_checksum == stored_checksum) { Config_Postprocess(); SERIAL_ECHO_START; @@ -561,9 +565,6 @@ void Config_ResetDefault() { #endif } - // steps per sq second need to be updated to agree with the units per sq second - planner.reset_acceleration_rates(); - planner.acceleration = DEFAULT_ACCELERATION; planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION; planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION; @@ -591,7 +592,6 @@ void Config_ResetDefault() { delta_diagonal_rod_trim_tower_1 = DELTA_DIAGONAL_ROD_TRIM_TOWER_1; delta_diagonal_rod_trim_tower_2 = DELTA_DIAGONAL_ROD_TRIM_TOWER_2; delta_diagonal_rod_trim_tower_3 = DELTA_DIAGONAL_ROD_TRIM_TOWER_3; - recalc_delta_settings(delta_radius, delta_diagonal_rod); #elif ENABLED(Z_DUAL_ENDSTOPS) z_endstop_adj = 0; #endif @@ -626,8 +626,6 @@ void Config_ResetDefault() { #if ENABLED(PID_ADD_EXTRUSION_RATE) lpq_len = 20; // default last-position-queue size #endif - // call thermalManager.updatePID (similar to when we have processed M301) - thermalManager.updatePID(); #endif // PIDTEMP #if ENABLED(PIDTEMPBED) @@ -654,7 +652,8 @@ void Config_ResetDefault() { volumetric_enabled = false; for (uint8_t q = 0; q < COUNT(filament_size); q++) filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA; - calculate_volumetric_multipliers(); + + Config_Postprocess(); SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); From 787f3946766d5067e35a59e6480f1dcbcc182033 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 30 Jun 2016 00:07:31 -0700 Subject: [PATCH 222/580] MAX_EXTRUDERS replaces mysterious "4" --- Marlin/configuration_store.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 0cb1a4f9c..87f7a9a2a 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -40,6 +40,7 @@ // Change EEPROM version if these are changed: #define EEPROM_OFFSET 100 +#define MAX_EXTRUDERS 4 /** * V24 EEPROM Layout: @@ -270,7 +271,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, absPreheatHPBTemp); EEPROM_WRITE_VAR(i, absPreheatFanSpeed); - for (uint8_t e = 0; e < 4; e++) { + for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { #if ENABLED(PIDTEMP) if (e < HOTENDS) { @@ -345,7 +346,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, volumetric_enabled); // Save filament sizes - for (uint8_t q = 0; q < 4; q++) { + for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { if (q < EXTRUDERS) dummy = filament_size[q]; EEPROM_WRITE_VAR(i, dummy); } @@ -452,7 +453,7 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, absPreheatFanSpeed); #if ENABLED(PIDTEMP) - for (uint8_t e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin + for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { EEPROM_READ_VAR(i, dummy); // Kp if (e < HOTENDS && dummy != DUMMY_PID_VALUE) { // do not need to scale PID values as the values in EEPROM are already scaled @@ -471,7 +472,7 @@ void Config_RetrieveSettings() { } #else // !PIDTEMP // 4 x 4 = 16 slots for PID parameters - for (uint8_t q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc + for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ_VAR(i, dummy); // Kp, Ki, Kd, Kc #endif // !PIDTEMP #if DISABLED(PID_ADD_EXTRUSION_RATE) @@ -522,7 +523,7 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, volumetric_enabled); - for (uint8_t q = 0; q < 4; q++) { + for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { EEPROM_READ_VAR(i, dummy); if (q < EXTRUDERS) filament_size[q] = dummy; } From 6b2a7b30afd55954dd001e1d921c0eac13011627 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 30 Jun 2016 00:29:16 -0700 Subject: [PATCH 223/580] Extra comments to clarify EEPROM code --- Marlin/configuration_store.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 87f7a9a2a..4420a0e1f 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -226,6 +226,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, mesh_num_y); EEPROM_WRITE_VAR(i, mbl.z_values); #else + // For disabled MBL write a default mesh uint8_t mesh_num_x = 3, mesh_num_y = 3, dummy_uint8 = 0; @@ -242,6 +243,7 @@ void Config_StoreSettings() { #endif EEPROM_WRITE_VAR(i, zprobe_zoffset); + // 9 floats for DELTA / Z_DUAL_ENDSTOPS #if ENABLED(DELTA) EEPROM_WRITE_VAR(i, endstop_adj); // 3 floats EEPROM_WRITE_VAR(i, delta_radius); // 1 float @@ -409,12 +411,16 @@ void Config_RetrieveSettings() { mbl.status = dummy_uint8; mbl.z_offset = dummy; if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) { + // EEPROM data fits the current mesh EEPROM_READ_VAR(i, mbl.z_values); - } else { + } + else { + // EEPROM data is stale mbl.reset(); for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); } #else + // MBL is disabled - skip the stored data for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); #endif // MESH_BED_LEVELING From cb1b31f69b2e6e11bdb1f77a5af7a9fae603f610 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 1 Jul 2016 15:28:41 +0200 Subject: [PATCH 224/580] Unconditional do_probe_raise() in probe_pt() If Z_RAISE_BETWEEN_PROBINGS is null or undefined the probe is currently not raised by home_offset[Z_AXIS] and zprobe_zoffset. But when different from 0 is. If an undefined Z_RAISE_BETWEEN_PROBINGS expands to 0 (and it does) this is the solution. A similar asymmetry exists with the newly introduced 'short-cut' in G28 - but its the rise before anything is probed - so should not make a difference. --- Marlin/Marlin_main.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 78f1cabc6..b05f5b523 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2118,14 +2118,12 @@ static void clean_up_after_endstop_or_probe_move() { #endif stow_z_probe(); } - #if Z_RAISE_BETWEEN_PROBINGS > 0 - else { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> do_probe_raise"); - #endif - do_probe_raise(Z_RAISE_BETWEEN_PROBINGS); - } - #endif + else { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> do_probe_raise"); + #endif + do_probe_raise(Z_RAISE_BETWEEN_PROBINGS); + } if (verbose_level > 2) { SERIAL_PROTOCOLPGM("Bed X: "); From 03b8f88092fd111d4c370b7cd72937b89c90661b Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 2 Jul 2016 07:53:38 +0900 Subject: [PATCH 225/580] Tab to Space --- Marlin/language_pl.h | 10 +++++----- Marlin/servo.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index bbaae33cd..9c38a6db5 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -187,10 +187,10 @@ #define MSG_HEATING_COMPLETE "Rozgrzano" #define MSG_BED_HEATING "Rozgrzewanie loza..." #define MSG_BED_DONE "Rozgrzano loze" -#define MSG_DELTA_CALIBRATE "Kalibrowanie Delty" -#define MSG_DELTA_CALIBRATE_X "Kalibruj X" -#define MSG_DELTA_CALIBRATE_Y "Kalibruj Y" -#define MSG_DELTA_CALIBRATE_Z "Kalibruj Z" -#define MSG_DELTA_CALIBRATE_CENTER "Kalibruj środek" +#define MSG_DELTA_CALIBRATE "Kalibrowanie Delty" +#define MSG_DELTA_CALIBRATE_X "Kalibruj X" +#define MSG_DELTA_CALIBRATE_Y "Kalibruj Y" +#define MSG_DELTA_CALIBRATE_Z "Kalibruj Z" +#define MSG_DELTA_CALIBRATE_CENTER "Kalibruj środek" #endif // LANGUAGE_PL_H diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp index cbc0026d4..c9708b8d8 100644 --- a/Marlin/servo.cpp +++ b/Marlin/servo.cpp @@ -223,7 +223,7 @@ static void finISR(timer16_Sequence_t timer) { } #else //!WIRING // For arduino - in future: call here to a currently undefined function to reset the timer - UNUSED(timer); + UNUSED(timer); #endif } From e650a75b88f66b44091d8082d2150d57320ff553 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jul 2016 20:27:55 -0700 Subject: [PATCH 226/580] Simplified variable-size array macros --- Marlin/Conditionals.h | 26 ++++---------------------- Marlin/macros.h | 11 +++++++++++ 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 5e70cb04a..e3c72d76f 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -552,32 +552,14 @@ /** * ARRAY_BY_EXTRUDERS based on EXTRUDERS */ - #if EXTRUDERS > 3 - #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3, v4 } - #elif EXTRUDERS > 2 - #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3 } - #elif EXTRUDERS > 1 - #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2 } - #else - #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1 } - #endif - - #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1) + #define ARRAY_BY_EXTRUDERS(args...) ARRAY_N(EXTRUDERS, args) + #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1) /** * ARRAY_BY_HOTENDS based on HOTENDS */ - #if HOTENDS > 3 - #define ARRAY_BY_HOTENDS(v1, v2, v3, v4) { v1, v2, v3, v4 } - #elif HOTENDS > 2 - #define ARRAY_BY_HOTENDS(v1, v2, v3, v4) { v1, v2, v3 } - #elif HOTENDS > 1 - #define ARRAY_BY_HOTENDS(v1, v2, v3, v4) { v1, v2 } - #else - #define ARRAY_BY_HOTENDS(v1, v2, v3, v4) { v1 } - #endif - - #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1) + #define ARRAY_BY_HOTENDS(args...) ARRAY_N(HOTENDS, args) + #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) /** * Z_DUAL_ENDSTOPS endstop reassignment diff --git a/Marlin/macros.h b/Marlin/macros.h index eaa9875e0..2b535bbdd 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -55,6 +55,17 @@ #define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-') #define COUNT(a) (sizeof(a)/sizeof(*a)) +// Macros for initializing arrays +#define ARRAY_6(v1, v2, v3, v4, v5, v6, args...) { v1, v2, v3, v4, v5, v6 } +#define ARRAY_5(v1, v2, v3, v4, v5, args...) { v1, v2, v3, v4, v5 } +#define ARRAY_4(v1, v2, v3, v4, args...) { v1, v2, v3, v4 } +#define ARRAY_3(v1, v2, v3, args...) { v1, v2, v3 } +#define ARRAY_2(v1, v2, args...) { v1, v2 } +#define ARRAY_1(v1, args...) { v1 } + +#define _ARRAY_N(N, args...) ARRAY_ ##N(args) +#define ARRAY_N(N, args...) _ARRAY_N(N, args) + // Macros for adding #define INC_0 1 #define INC_1 2 From 7a377c1d7580a3fa0afd85586395ab941887f3d0 Mon Sep 17 00:00:00 2001 From: Anthony Birkett Date: Thu, 30 Jun 2016 10:24:29 +0100 Subject: [PATCH 227/580] Add "About Printer" information menu. Includes: *firmware version / branch / date. *extruder count *board information (name, serial details, power supply type) *thermistors (names, min/max temperatures) *printer statistics (PRINTCOUNTER details) Thanks to @thinkyhead for contributions. --- Marlin/Configuration_adv.h | 3 + Marlin/dogm_lcd_implementation.h | 16 ++ .../Cartesio/Configuration_adv.h | 3 + .../Felix/Configuration_adv.h | 3 + .../Hephestos/Configuration_adv.h | 3 + .../Hephestos_2/Configuration_adv.h | 3 + .../K8200/Configuration_adv.h | 3 + .../RigidBot/Configuration_adv.h | 3 + .../SCARA/Configuration_adv.h | 3 + .../TAZ4/Configuration_adv.h | 3 + .../WITBOX/Configuration_adv.h | 3 + .../delta/biv2.5/Configuration_adv.h | 3 + .../delta/generic/Configuration_adv.h | 3 + .../delta/kossel_mini/Configuration_adv.h | 3 + .../delta/kossel_pro/Configuration_adv.h | 3 + .../delta/kossel_xl/Configuration_adv.h | 3 + .../makibox/Configuration_adv.h | 3 + .../tvrrug/Round2/Configuration_adv.h | 3 + Marlin/language_en.h | 39 ++++ Marlin/pins_3DRAG.h | 15 +- Marlin/pins_5DPRINT.h | 1 + Marlin/pins_99.h | 3 +- Marlin/pins_A4JP.h | 2 + Marlin/pins_AZTEEG_X1.h | 3 +- Marlin/pins_AZTEEG_X3.h | 2 + Marlin/pins_AZTEEG_X3_PRO.h | 2 + Marlin/pins_BAM_DICE_DUE.h | 2 + Marlin/pins_BQ_ZUM_MEGA_3D.h | 2 + Marlin/pins_BRAINWAVE.h | 2 + Marlin/pins_BRAINWAVE_PRO.h | 2 + Marlin/pins_CHEAPTRONIC.h | 1 + Marlin/pins_CNCONTROLS_12.h | 2 + Marlin/pins_ELEFU_3.h | 2 + Marlin/pins_FELIX2.h | 2 + Marlin/pins_GEN3_MONOLITHIC.h | 1 + Marlin/pins_GEN3_PLUS.h | 2 + Marlin/pins_GEN6.h | 4 + Marlin/pins_GEN6_DELUXE.h | 2 + Marlin/pins_GEN7_12.h | 4 + Marlin/pins_GEN7_13.h | 4 +- Marlin/pins_GEN7_14.h | 6 +- Marlin/pins_GEN7_CUSTOM.h | 2 + Marlin/pins_K8200.h | 8 +- Marlin/pins_LEAPFROG.h | 2 + Marlin/pins_MEGACONTROLLER.h | 2 + Marlin/pins_MEGATRONICS.h | 1 + Marlin/pins_MEGATRONICS_2.h | 1 + Marlin/pins_MEGATRONICS_3.h | 1 + Marlin/pins_MELZI.h | 3 +- Marlin/pins_MELZI_MAKR3D.h | 5 +- Marlin/pins_MINIRAMBO.h | 1 + Marlin/pins_MINITRONICS.h | 1 + Marlin/pins_MKS_13.h | 2 + Marlin/pins_MKS_BASE.h | 2 + Marlin/pins_OMCA.h | 2 + Marlin/pins_OMCA_A.h | 2 + Marlin/pins_PRINTRBOARD.h | 1 + Marlin/pins_PRINTRBOARD_REVF.h | 1 + Marlin/pins_RAMBO.h | 2 + Marlin/pins_RAMPS_13.h | 5 +- Marlin/pins_RAMPS_13_EFB.h | 3 +- Marlin/pins_RAMPS_14.h | 4 + Marlin/pins_RAMPS_14_EFB.h | 5 +- Marlin/pins_RAMPS_OLD.h | 2 + Marlin/pins_RIGIDBOARD.h | 3 + Marlin/pins_RIGIDBOARD_V2.h | 3 + Marlin/pins_RUMBA.h | 1 + Marlin/pins_SAINSMART_2IN1.h | 3 + Marlin/pins_SANGUINOLOLU_11.h | 14 +- Marlin/pins_SANGUINOLOLU_12.h | 3 +- Marlin/pins_SAV_MKI.h | 1 + Marlin/pins_SETHI.h | 2 + Marlin/pins_STB_11.h | 3 +- Marlin/pins_TEENSY2.h | 2 + Marlin/pins_TEENSYLU.h | 2 + Marlin/pins_ULTIMAIN_2.h | 1 + Marlin/pins_ULTIMAKER.h | 1 + Marlin/pins_ULTIMAKER_OLD.h | 1 + Marlin/printcounter.h | 6 + Marlin/thermistornames.h | 91 ++++++++++ Marlin/ultralcd.cpp | 171 ++++++++++++++++++ .../ultralcd_implementation_hitachi_HD44780.h | 15 ++ 82 files changed, 526 insertions(+), 27 deletions(-) create mode 100644 Marlin/thermistornames.h diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index baabbb50a..25ec27a11 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index b52ff8d0c..023df5baa 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -473,6 +473,22 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { u8g.setPrintPos((START_ROW) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)); } +static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true) { + char c; + uint8_t n = LCD_WIDTH; + u8g.setPrintPos(0, (row + 1) * (DOG_CHAR_HEIGHT)); + u8g.setColorIndex(1); // normal text + if (center) { + int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; + while (--pad >= 0) { lcd_print(' '); n--; } + } + while (c = pgm_read_byte(pstr)) { + n -= lcd_print(c); + pstr++; + } + while (n--) lcd_print(' '); +} + static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) { UNUSED(pstr); UNUSED(pre_char); diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index e7f4f10e8..8b48f00da 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 8de3db946..d514288d7 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 727fe6c0e..b4062e8e6 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 24aa11cdc..d86b8c0e3 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 491a8d923..ae6488742 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -370,6 +370,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 020804017..7b608f80a 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index d232c6beb..58d36231b 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index ca80621ba..11b9e6c1d 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -372,6 +372,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 727fe6c0e..b4062e8e6 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 8e0653dbb..1978c0927 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -366,6 +366,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index af1035228..f673a200b 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -366,6 +366,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 94f6f134a..93e9e30d6 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -365,6 +365,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 7ed46feeb..f417a57e4 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -370,6 +370,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 117a2ad31..bcbf1c1b1 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -366,6 +366,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 772f05e5e..7b7b4f9b7 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 78758bd79..d58dbb37c 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -364,6 +364,9 @@ // @section lcd +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 8f20bc030..165a15838 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -520,5 +520,44 @@ #ifndef MSG_DELTA_CALIBRATE_CENTER #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #endif +#ifndef MSG_INFO_MENU + #define MSG_INFO_MENU "About Printer" +#endif +#ifndef MSG_INFO_STATS_MENU + #define MSG_INFO_STATS_MENU "Printer Stats" +#endif +#ifndef MSG_INFO_BOARD_MENU + #define MSG_INFO_BOARD_MENU "Board Info" +#endif +#ifndef MSG_INFO_THERMISTOR_MENU + #define MSG_INFO_THERMISTOR_MENU "Thermistors" +#endif +#ifndef MSG_INFO_EXTRUDERS + #define MSG_INFO_EXTRUDERS "Extruders" +#endif +#ifndef MSG_INFO_BAUDRATE + #define MSG_INFO_BAUDRATE "Baud" +#endif +#ifndef MSG_INFO_PROTOCOL + #define MSG_INFO_PROTOCOL "Protocol" +#endif +#ifndef MSG_INFO_TOTAL_PRINTS + #define MSG_INFO_TOTAL_PRINTS "Total Prints" +#endif +#ifndef MSG_INFO_FINISHED_PRINTS + #define MSG_INFO_FINISHED_PRINTS "Finished Prints" +#endif +#ifndef MSG_INFO_PRINT_TIME + #define MSG_INFO_PRINT_TIME "Total Print Time" +#endif +#ifndef MSG_INFO_MIN_TEMP + #define MSG_INFO_MIN_TEMP "Min Temp" +#endif +#ifndef MSG_INFO_MAX_TEMP + #define MSG_INFO_MAX_TEMP "Max Temp" +#endif +#ifndef MSG_INFO_PSU + #define MSG_INFO_PSU "Power Supply" +#endif #endif // LANGUAGE_EN_H diff --git a/Marlin/pins_3DRAG.h b/Marlin/pins_3DRAG.h index 9de52e389..c04464b43 100644 --- a/Marlin/pins_3DRAG.h +++ b/Marlin/pins_3DRAG.h @@ -24,10 +24,19 @@ * 3DRAG (and K8200) Arduino Mega with RAMPS v1.4 pin assignments */ -#include "pins_RAMPS_14.h" +#ifndef BOARD_NAME + #define BOARD_NAME "3Drag" +#endif + +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "3Drag" +#endif -#define DEFAULT_MACHINE_NAME "3Drag" -#define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/" +#ifndef DEFAULT_SOURCE_CODE_URL + #define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/" +#endif + +#include "pins_RAMPS_14.h" #undef Z_ENABLE_PIN #define Z_ENABLE_PIN 63 diff --git a/Marlin/pins_5DPRINT.h b/Marlin/pins_5DPRINT.h index 1365cd407..0674a98d1 100644 --- a/Marlin/pins_5DPRINT.h +++ b/Marlin/pins_5DPRINT.h @@ -31,6 +31,7 @@ #endif #define DEFAULT_MACHINE_NAME "Makibox" +#define BOARD_NAME "5DPrint D8" #define LARGE_FLASH true diff --git a/Marlin/pins_99.h b/Marlin/pins_99.h index 8ae78b26e..6b7d1e891 100644 --- a/Marlin/pins_99.h +++ b/Marlin/pins_99.h @@ -23,7 +23,8 @@ /** * Board 99 pin assignments */ - +#define BOARD_NAME "99 Unknown" + #define X_STEP_PIN 2 #define X_DIR_PIN 3 #define X_ENABLE_PIN -1 diff --git a/Marlin/pins_A4JP.h b/Marlin/pins_A4JP.h index ca217414d..990abc309 100644 --- a/Marlin/pins_A4JP.h +++ b/Marlin/pins_A4JP.h @@ -28,6 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "AJ4P" + // Servo support #define SERVO0_PIN 22 // Motor header MX1 #define SERVO1_PIN 23 // Motor header MX2 diff --git a/Marlin/pins_AZTEEG_X1.h b/Marlin/pins_AZTEEG_X1.h index 21bb491f5..8f87a7eaa 100644 --- a/Marlin/pins_AZTEEG_X1.h +++ b/Marlin/pins_AZTEEG_X1.h @@ -24,6 +24,7 @@ * Azteeg X1 pin assignments */ -#define SANGUINOLOLU_V_1_2 +#define BOARD_NAME "Azteeg X1" +#define SANGUINOLOLU_V_1_2 #include "pins_SANGUINOLOLU_11.h" diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index adc0332fb..f16eee310 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -24,6 +24,8 @@ * AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments */ +#define BOARD_NAME "Azteeg X3" + #include "pins_RAMPS_14_EFB.h" #if ENABLED(VIKI2) || ENABLED(miniVIKI) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 58d979ab3..3331a299a 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -24,6 +24,8 @@ * AZTEEG_X3_PRO (Arduino Mega) pin assignments */ +#define BOARD_NAME "Azteeg X3 Pro" + #include "pins_RAMPS_14.h" #undef FAN_PIN diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h index 355daf5c1..a8e76a7ef 100644 --- a/Marlin/pins_BAM_DICE_DUE.h +++ b/Marlin/pins_BAM_DICE_DUE.h @@ -24,6 +24,8 @@ * BAM&DICE Due (Arduino Mega) pin assignments */ +#define BOARD_NAME "2PrintBeta Due" + #include "pins_RAMPS_14_EFB.h" #undef TEMP_0_PIN diff --git a/Marlin/pins_BQ_ZUM_MEGA_3D.h b/Marlin/pins_BQ_ZUM_MEGA_3D.h index 13f81a9ce..c5509d4e5 100644 --- a/Marlin/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/pins_BQ_ZUM_MEGA_3D.h @@ -28,6 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "ZUM Mega 3D" + #include "pins_RAMPS_13.h" #undef X_MAX_PIN diff --git a/Marlin/pins_BRAINWAVE.h b/Marlin/pins_BRAINWAVE.h index 20713502f..63e2d0bbc 100644 --- a/Marlin/pins_BRAINWAVE.h +++ b/Marlin/pins_BRAINWAVE.h @@ -31,6 +31,8 @@ #error "Oops! Make sure you have 'Brainwave' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Brainwave" + #define X_STEP_PIN 27 #define X_DIR_PIN 29 #define X_ENABLE_PIN 28 diff --git a/Marlin/pins_BRAINWAVE_PRO.h b/Marlin/pins_BRAINWAVE_PRO.h index 7961608ab..fc10c2977 100644 --- a/Marlin/pins_BRAINWAVE_PRO.h +++ b/Marlin/pins_BRAINWAVE_PRO.h @@ -37,6 +37,8 @@ #error "Uncomment #define AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h for this config" #endif +#define BOARD_NAME "Brainwave Pro" + #define LARGE_FLASH true #define X_STEP_PIN 33 diff --git a/Marlin/pins_CHEAPTRONIC.h b/Marlin/pins_CHEAPTRONIC.h index 8c5f90002..41e3dacb0 100644 --- a/Marlin/pins_CHEAPTRONIC.h +++ b/Marlin/pins_CHEAPTRONIC.h @@ -28,6 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Cheaptronic v1.0" #define LARGE_FLASH true // X motor stepper diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h index 81e885eef..f1de6c11a 100644 --- a/Marlin/pins_CNCONTROLS_12.h +++ b/Marlin/pins_CNCONTROLS_12.h @@ -6,6 +6,8 @@ #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. #endif +#define BOARD_NAME "CN Controls V12" + //#define LARGE_FLASH true #define X_ENABLE_PIN 26 diff --git a/Marlin/pins_ELEFU_3.h b/Marlin/pins_ELEFU_3.h index 3e4fcf3e6..546b5a84e 100644 --- a/Marlin/pins_ELEFU_3.h +++ b/Marlin/pins_ELEFU_3.h @@ -28,6 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Elefu Ra v3" + #define X_STEP_PIN 49 #define X_DIR_PIN 13 #define X_ENABLE_PIN 48 diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index e5aa87922..dfea48358 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -24,6 +24,8 @@ * FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments */ +#define BOARD_NAME "Felix 2.0+" + #include "pins_RAMPS_14_EFB.h" #undef HEATER_1_PIN diff --git a/Marlin/pins_GEN3_MONOLITHIC.h b/Marlin/pins_GEN3_MONOLITHIC.h index fb31a8bf1..85d5b3fae 100644 --- a/Marlin/pins_GEN3_MONOLITHIC.h +++ b/Marlin/pins_GEN3_MONOLITHIC.h @@ -28,6 +28,7 @@ #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Gen3 Monolithic" #define DEBUG_PIN 0 // x axis diff --git a/Marlin/pins_GEN3_PLUS.h b/Marlin/pins_GEN3_PLUS.h index a96b6b8da..7889a0103 100644 --- a/Marlin/pins_GEN3_PLUS.h +++ b/Marlin/pins_GEN3_PLUS.h @@ -28,6 +28,8 @@ #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Gen3+" + #define X_STEP_PIN 15 #define X_DIR_PIN 18 #define X_STOP_PIN 20 diff --git a/Marlin/pins_GEN6.h b/Marlin/pins_GEN6.h index f44c696d0..ae3d33a9a 100644 --- a/Marlin/pins_GEN6.h +++ b/Marlin/pins_GEN6.h @@ -30,6 +30,10 @@ #endif #endif +#ifndef BOARD_NAME + #define BOARD_NAME "Gen6" +#endif + //x axis pins #define X_STEP_PIN 15 #define X_DIR_PIN 18 diff --git a/Marlin/pins_GEN6_DELUXE.h b/Marlin/pins_GEN6_DELUXE.h index 718f517c6..b1a1037ed 100644 --- a/Marlin/pins_GEN6_DELUXE.h +++ b/Marlin/pins_GEN6_DELUXE.h @@ -24,4 +24,6 @@ * Gen6 Deluxe pin assignments */ +#define BOARD_NAME "Gen6 Deluxe" + #include "pins_GEN6.h" diff --git a/Marlin/pins_GEN7_12.h b/Marlin/pins_GEN7_12.h index 58fad2fe0..1e59ae6fa 100644 --- a/Marlin/pins_GEN7_12.h +++ b/Marlin/pins_GEN7_12.h @@ -28,6 +28,10 @@ #error "Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu." #endif +#ifndef BOARD_NAME + #define BOARD_NAME "Gen7 v1.1 / 1.2" +#endif + #ifndef GEN7_VERSION #define GEN7_VERSION 12 // v1.x #endif diff --git a/Marlin/pins_GEN7_13.h b/Marlin/pins_GEN7_13.h index 5887aeca8..2365ae8be 100644 --- a/Marlin/pins_GEN7_13.h +++ b/Marlin/pins_GEN7_13.h @@ -24,7 +24,7 @@ * Gen7 v1.3 pin assignments */ -#define MOTHERBOARD BOARD_GEN7_12 -#define GEN7_VERSION 13 // v1.3 +#define BOARD_NAME "Gen7 v1.3" +#define GEN7_VERSION 13 // v1.3 #include "pins_GEN7_12.h" diff --git a/Marlin/pins_GEN7_14.h b/Marlin/pins_GEN7_14.h index b85a09314..87ccb6018 100644 --- a/Marlin/pins_GEN7_14.h +++ b/Marlin/pins_GEN7_14.h @@ -24,12 +24,14 @@ * Gen7 v1.4 pin assignments */ -#define GEN7_VERSION 14 // v1.4 - #if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__) #error "Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Gen7 v1.4" + +#define GEN7_VERSION 14 // v1.4 + //x axis pins #define X_STEP_PIN 29 #define X_DIR_PIN 28 diff --git a/Marlin/pins_GEN7_CUSTOM.h b/Marlin/pins_GEN7_CUSTOM.h index 11a0a4447..f740e4a01 100644 --- a/Marlin/pins_GEN7_CUSTOM.h +++ b/Marlin/pins_GEN7_CUSTOM.h @@ -31,6 +31,8 @@ #error "Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Gen7 Custom" + //x axis pins #define X_STEP_PIN 21 // different from standard GEN7 #define X_DIR_PIN 20 // different from standard GEN7 diff --git a/Marlin/pins_K8200.h b/Marlin/pins_K8200.h index ac65297eb..cc3e73117 100644 --- a/Marlin/pins_K8200.h +++ b/Marlin/pins_K8200.h @@ -25,10 +25,8 @@ * Identical to 3DRAG */ -#include "pins_3DRAG.h" - -#undef DEFAULT_MACHINE_NAME +#define BOARD_NAME "Velleman K8200" #define DEFAULT_MACHINE_NAME "K8200" - -#undef DEFAULT_SOURCE_CODE_URL #define DEFAULT_SOURCE_CODE_URL "https://github.com/CONSULitAS/Marlin-K8200" + +#include "pins_3DRAG.h" diff --git a/Marlin/pins_LEAPFROG.h b/Marlin/pins_LEAPFROG.h index 5acad0479..acfba0373 100644 --- a/Marlin/pins_LEAPFROG.h +++ b/Marlin/pins_LEAPFROG.h @@ -28,6 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Leapfrog" + #define X_STEP_PIN 28 #define X_DIR_PIN 63 #define X_ENABLE_PIN 29 diff --git a/Marlin/pins_MEGACONTROLLER.h b/Marlin/pins_MEGACONTROLLER.h index 8e423a3bc..600f2f528 100644 --- a/Marlin/pins_MEGACONTROLLER.h +++ b/Marlin/pins_MEGACONTROLLER.h @@ -32,6 +32,8 @@ #error "Mega Controller supports up to 2 extruders. Comment this line to keep going." #endif +#define BOARD_NAME "Mega Controller" + #define SERVO0_PIN 30 #define SERVO1_PIN 31 #define SERVO2_PIN 32 diff --git a/Marlin/pins_MEGATRONICS.h b/Marlin/pins_MEGATRONICS.h index b8022e642..4e766d8b9 100644 --- a/Marlin/pins_MEGATRONICS.h +++ b/Marlin/pins_MEGATRONICS.h @@ -28,6 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Megatronics" #define LARGE_FLASH true #define X_STEP_PIN 26 diff --git a/Marlin/pins_MEGATRONICS_2.h b/Marlin/pins_MEGATRONICS_2.h index 6fb347552..90e9b1fee 100644 --- a/Marlin/pins_MEGATRONICS_2.h +++ b/Marlin/pins_MEGATRONICS_2.h @@ -28,6 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Megatronics v2.0" #define LARGE_FLASH true #define X_STEP_PIN 26 diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h index 8410ce061..47ec17649 100644 --- a/Marlin/pins_MEGATRONICS_3.h +++ b/Marlin/pins_MEGATRONICS_3.h @@ -28,6 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Megatronics v3.0" #define LARGE_FLASH true #if ENABLED(Z_PROBE_SLED) diff --git a/Marlin/pins_MELZI.h b/Marlin/pins_MELZI.h index dae033bf8..677f0cf36 100644 --- a/Marlin/pins_MELZI.h +++ b/Marlin/pins_MELZI.h @@ -24,10 +24,11 @@ * Melzi pin assignments */ -#define SANGUINOLOLU_V_1_2 +#define BOARD_NAME "Melzi" #if defined(__AVR_ATmega1284P__) #define LARGE_FLASH true #endif +#define SANGUINOLOLU_V_1_2 #include "pins_SANGUINOLOLU_11.h" diff --git a/Marlin/pins_MELZI_MAKR3D.h b/Marlin/pins_MELZI_MAKR3D.h index fe77e27bc..877f8cbd2 100644 --- a/Marlin/pins_MELZI_MAKR3D.h +++ b/Marlin/pins_MELZI_MAKR3D.h @@ -24,12 +24,11 @@ * Melzi with ATmega1284 (MaKr3d version) pin assignments */ -#undef MOTHERBOARD -#define MOTHERBOARD BOARD_MELZI -#define SANGUINOLOLU_V_1_2 +#define BOARD_NAME "Melzi ATmega1284" #if defined(__AVR_ATmega1284P__) #define LARGE_FLASH true #endif +#define SANGUINOLOLU_V_1_2 #include "pins_SANGUINOLOLU_11.h" diff --git a/Marlin/pins_MINIRAMBO.h b/Marlin/pins_MINIRAMBO.h index 29bc9dfb5..089ea5996 100644 --- a/Marlin/pins_MINIRAMBO.h +++ b/Marlin/pins_MINIRAMBO.h @@ -28,6 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Mini Rambo" #define LARGE_FLASH true #define X_STEP_PIN 37 diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h index e21993fff..0c80ceda4 100644 --- a/Marlin/pins_MINITRONICS.h +++ b/Marlin/pins_MINITRONICS.h @@ -28,6 +28,7 @@ #error "Oops! Make sure you have 'Minitronics' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Minitronics v1.0 / v1.1" #define LARGE_FLASH true #define X_STEP_PIN 48 diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index 346a43e29..1b2565337 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -29,6 +29,8 @@ * MKS v1.4 (Extruder, Extruder, Fan, Bed) */ +#define BOARD_NAME "MKS > v1.3" + #include "pins_RAMPS_14_EFB.h" #undef HEATER_1_PIN diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h index 5ca8e05b9..3c721f5ff 100644 --- a/Marlin/pins_MKS_BASE.h +++ b/Marlin/pins_MKS_BASE.h @@ -24,6 +24,8 @@ * MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments */ +#define BOARD_NAME "MKS BASE 1.0" + #include "pins_RAMPS_14_EFB.h" #undef HEATER_1_PIN diff --git a/Marlin/pins_OMCA.h b/Marlin/pins_OMCA.h index 261e64549..9ec6309d5 100644 --- a/Marlin/pins_OMCA.h +++ b/Marlin/pins_OMCA.h @@ -55,6 +55,8 @@ #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. (Final OMCA board)" #endif +#define BOARD_NAME "Final OMCA" + #define X_STEP_PIN 26 #define X_DIR_PIN 25 #define X_ENABLE_PIN 10 diff --git a/Marlin/pins_OMCA_A.h b/Marlin/pins_OMCA_A.h index 1b82c5c46..39d232aee 100644 --- a/Marlin/pins_OMCA_A.h +++ b/Marlin/pins_OMCA_A.h @@ -54,6 +54,8 @@ #error "Oops! Make sure you have 'SanguinoA' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Alpha OMCA" + #define X_STEP_PIN 21 #define X_DIR_PIN 20 #define X_ENABLE_PIN 24 diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h index 91455a615..eaccabe9d 100644 --- a/Marlin/pins_PRINTRBOARD.h +++ b/Marlin/pins_PRINTRBOARD.h @@ -35,6 +35,7 @@ #error "These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h" #endif +#define BOARD_NAME "Printrboard" #define LARGE_FLASH true // Disable JTAG pins so they can be used for the Extrudrboard diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h index 799eb37c6..d2a45623a 100644 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ b/Marlin/pins_PRINTRBOARD_REVF.h @@ -35,6 +35,7 @@ #error "These Printrboard assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h" #endif +#define BOARD_NAME "Printrboard Rev F" #define LARGE_FLASH true #define X_STEP_PIN 0 diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index 0e7c7aade..68c627b90 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -28,6 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Rambo" + #define LARGE_FLASH true // Servo support diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index 5655f35a1..e3a854b11 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -33,6 +33,9 @@ * */ -#define IS_RAMPS_13 +#ifndef BOARD_NAME + #define BOARD_NAME "RAMPS 1.3" +#endif +#define IS_RAMPS_13 #include "pins_RAMPS_14.h" diff --git a/Marlin/pins_RAMPS_13_EFB.h b/Marlin/pins_RAMPS_13_EFB.h index e0bea37e7..80e292729 100644 --- a/Marlin/pins_RAMPS_13_EFB.h +++ b/Marlin/pins_RAMPS_13_EFB.h @@ -26,6 +26,7 @@ * RAMPS_13_EFB (Extruder, Fan, Bed) */ -#define IS_RAMPS_13 +#define BOARD_NAME "RAMPS 1.3 EFB" +#define IS_RAMPS_13 #include "pins_RAMPS_14_EFB.h" diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index e860585e3..0a63c2495 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -48,6 +48,10 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +#ifndef BOARD_NAME + #define BOARD_NAME "RAMPS 1.4" +#endif + #define LARGE_FLASH true #ifdef IS_RAMPS_13 diff --git a/Marlin/pins_RAMPS_14_EFB.h b/Marlin/pins_RAMPS_14_EFB.h index a43e4d227..b7282ea56 100644 --- a/Marlin/pins_RAMPS_14_EFB.h +++ b/Marlin/pins_RAMPS_14_EFB.h @@ -26,6 +26,9 @@ * RAMPS_14_EFB (Extruder, Fan, Bed) */ -#define IS_RAMPS_EFB +#ifndef BOARD_NAME + #define BOARD_NAME "RAMPS 1.4 EFB" +#endif +#define IS_RAMPS_EFB #include "pins_RAMPS_14.h" diff --git a/Marlin/pins_RAMPS_OLD.h b/Marlin/pins_RAMPS_OLD.h index e731d65c4..470071a2f 100644 --- a/Marlin/pins_RAMPS_OLD.h +++ b/Marlin/pins_RAMPS_OLD.h @@ -28,6 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "MEGA/RAMPS <1.2" + // Uncomment the following line for RAMPS v1.0 //#define RAMPS_V_1_0 diff --git a/Marlin/pins_RIGIDBOARD.h b/Marlin/pins_RIGIDBOARD.h index 69ce67d87..7fdc1ae30 100644 --- a/Marlin/pins_RIGIDBOARD.h +++ b/Marlin/pins_RIGIDBOARD.h @@ -26,6 +26,9 @@ #include "pins_RAMPS_14.h" +#undef BOARD_NAME +#define BOARD_NAME "RigidBoard" + #if ENABLED(Z_MIN_PROBE_ENDSTOP) #undef Z_MAX_PIN #define Z_MAX_PIN -1 diff --git a/Marlin/pins_RIGIDBOARD_V2.h b/Marlin/pins_RIGIDBOARD_V2.h index 1226c56de..7aad12e9a 100644 --- a/Marlin/pins_RIGIDBOARD_V2.h +++ b/Marlin/pins_RIGIDBOARD_V2.h @@ -26,6 +26,9 @@ #include "pins_RIGIDBOARD.h" +#undef BOARD_NAME +#define BOARD_NAME "RigidBoard V2" + // I2C based DAC like on the Printrboard REVF #define DAC_STEPPER_CURRENT // Channels available for DAC, For Rigidboard there are 4 diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h index 91f631d38..a0fe01360 100644 --- a/Marlin/pins_RUMBA.h +++ b/Marlin/pins_RUMBA.h @@ -33,6 +33,7 @@ #endif #define DEFAULT_MACHINE_NAME "Rumba" +#define BOARD_NAME "Rumba" #define X_STEP_PIN 17 #define X_DIR_PIN 16 diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h index 518cf501e..3664fbd3a 100644 --- a/Marlin/pins_SAINSMART_2IN1.h +++ b/Marlin/pins_SAINSMART_2IN1.h @@ -26,6 +26,9 @@ #include "pins_RAMPS_14_EFB.h" +#undef BOARD_NAME +#define BOARD_NAME "Sainsmart" + #undef FAN_PIN #define FAN_PIN 7 // PART FAN in front of board next to Extruder heat diff --git a/Marlin/pins_SANGUINOLOLU_11.h b/Marlin/pins_SANGUINOLOLU_11.h index 9b00788c3..a6220c596 100644 --- a/Marlin/pins_SANGUINOLOLU_11.h +++ b/Marlin/pins_SANGUINOLOLU_11.h @@ -28,6 +28,12 @@ #error "Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu." #endif +#ifndef BOARD_NAME + #define BOARD_NAME "Sanguinololu <1.2" +#endif + +#define IS_MELZI (MB(MELZI) || MB(MELZI_MAKR3D)) + #define X_STEP_PIN 15 #define X_DIR_PIN 21 #define X_STOP_PIN 18 @@ -43,11 +49,11 @@ #define E0_STEP_PIN 1 #define E0_DIR_PIN 0 -#if MB(AZTEEG_X1) || MB(STB_11) || MB(MELZI) +#if MB(AZTEEG_X1) || MB(STB_11) || IS_MELZI #define FAN_PIN 4 // Works for Panelolu2 too #endif -#if MB(MELZI) +#if IS_MELZI #define LED_PIN 27 // On some broken versions of the Sanguino libraries the pin definitions are wrong, so LED_PIN needs to be 28. But you should upgrade your Sanguino libraries! See #368. #elif MB(STB_11) #define LCD_PIN_BL 17 // LCD backlight LED @@ -101,7 +107,7 @@ #if ENABLED(U8GLIB_ST7920) //SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 - #if MB(MELZI) // Melzi board + #if IS_MELZI // Melzi board #define LCD_PINS_RS 30 //CS chip select /SS chip slave select #define LCD_PINS_ENABLE 29 //SID (MOSI) #define LCD_PINS_D4 17 //SCK (CLK) clock @@ -147,7 +153,7 @@ #define BTN_EN1 11 #define BTN_EN2 10 #if ENABLED(LCD_I2C_PANELOLU2) - #if MB(MELZI) + #if IS_MELZI #define BTN_ENC 29 #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi #else diff --git a/Marlin/pins_SANGUINOLOLU_12.h b/Marlin/pins_SANGUINOLOLU_12.h index 84d86275e..f214d6f02 100644 --- a/Marlin/pins_SANGUINOLOLU_12.h +++ b/Marlin/pins_SANGUINOLOLU_12.h @@ -32,10 +32,11 @@ * STB_11 */ -#define SANGUINOLOLU_V_1_2 +#define BOARD_NAME "Sanguinololu 1.2" #if defined(__AVR_ATmega1284P__) #define LARGE_FLASH true #endif +#define SANGUINOLOLU_V_1_2 #include "pins_SANGUINOLOLU_11.h" diff --git a/Marlin/pins_SAV_MKI.h b/Marlin/pins_SAV_MKI.h index b6f4504ba..97189bf77 100644 --- a/Marlin/pins_SAV_MKI.h +++ b/Marlin/pins_SAV_MKI.h @@ -33,6 +33,7 @@ #define DEFAULT_MACHINE_NAME "SAV MkI" #define DEFAULT_SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" +#define BOARD_NAME "SAV MkI" #define LARGE_FLASH true diff --git a/Marlin/pins_SETHI.h b/Marlin/pins_SETHI.h index a3e01e282..ff154acf5 100644 --- a/Marlin/pins_SETHI.h +++ b/Marlin/pins_SETHI.h @@ -28,6 +28,8 @@ #error "Oops! Make sure you have 'Sethi 3D' selected from the 'Tools -> Boards' menu." #endif +#define BOARD_NAME "Sethi 3D_1" + #ifndef GEN7_VERSION #define GEN7_VERSION 12 // v1.x #endif diff --git a/Marlin/pins_STB_11.h b/Marlin/pins_STB_11.h index 9ca93a3f7..318dc39c0 100644 --- a/Marlin/pins_STB_11.h +++ b/Marlin/pins_STB_11.h @@ -24,10 +24,11 @@ * STB V1.1 pin assignments */ -#define SANGUINOLOLU_V_1_2 +#define BOARD_NAME "STB V1.1" #if defined(__AVR_ATmega1284P__) #define LARGE_FLASH true #endif +#define SANGUINOLOLU_V_1_2 #include "pins_SANGUINOLOLU_11.h" diff --git a/Marlin/pins_TEENSY2.h b/Marlin/pins_TEENSY2.h index 1fe1342c5..0f83117f2 100644 --- a/Marlin/pins_TEENSY2.h +++ b/Marlin/pins_TEENSY2.h @@ -74,6 +74,8 @@ // (or build from command line) #endif +#define BOARD_NAME "Teensy++2.0" + #define LARGE_FLASH true #define X_STEP_PIN 28 // 0 Marlin diff --git a/Marlin/pins_TEENSYLU.h b/Marlin/pins_TEENSYLU.h index 047d803f4..a19ef038b 100644 --- a/Marlin/pins_TEENSYLU.h +++ b/Marlin/pins_TEENSYLU.h @@ -35,6 +35,8 @@ #error "These Teensylu assignments depend on traditional Marlin assignments, not AT90USBxx_TEENSYPP_ASSIGNMENTS in fastio.h" #endif +#define BOARD_NAME "Teensylu" + #define LARGE_FLASH true #define X_STEP_PIN 0 diff --git a/Marlin/pins_ULTIMAIN_2.h b/Marlin/pins_ULTIMAIN_2.h index 792e62117..c348ebb49 100644 --- a/Marlin/pins_ULTIMAIN_2.h +++ b/Marlin/pins_ULTIMAIN_2.h @@ -30,6 +30,7 @@ #define DEFAULT_MACHINE_NAME "Ultimaker" #define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" +#define BOARD_NAME "Ultimaker 2.x" #define X_STEP_PIN 25 #define X_DIR_PIN 23 diff --git a/Marlin/pins_ULTIMAKER.h b/Marlin/pins_ULTIMAKER.h index aab43ecb0..d770f3a61 100644 --- a/Marlin/pins_ULTIMAKER.h +++ b/Marlin/pins_ULTIMAKER.h @@ -30,6 +30,7 @@ #define DEFAULT_MACHINE_NAME "Ultimaker" #define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" +#define BOARD_NAME "Ultimaker" #define LARGE_FLASH true diff --git a/Marlin/pins_ULTIMAKER_OLD.h b/Marlin/pins_ULTIMAKER_OLD.h index b13e1f572..33bc26c9a 100644 --- a/Marlin/pins_ULTIMAKER_OLD.h +++ b/Marlin/pins_ULTIMAKER_OLD.h @@ -30,6 +30,7 @@ #define DEFAULT_MACHINE_NAME "Ultimaker" #define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" +#define BOARD_NAME "Ultimaker <1.5.4" #define LARGE_FLASH true diff --git a/Marlin/printcounter.h b/Marlin/printcounter.h index dbee3f9e6..d6ac80b77 100644 --- a/Marlin/printcounter.h +++ b/Marlin/printcounter.h @@ -131,6 +131,12 @@ class PrintCounter: public Stopwatch { */ void showStats(); + /** + * @brief Return the currently loaded statistics + * @details Return the raw data, in the same structure used internally + */ + printStatistics getStats() { return this->data; } + /** * @brief Loop function * @details This function should be called at loop, it will take care of diff --git a/Marlin/thermistornames.h b/Marlin/thermistornames.h new file mode 100644 index 000000000..4ad13f86b --- /dev/null +++ b/Marlin/thermistornames.h @@ -0,0 +1,91 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#undef THERMISTOR_NAME + +// Thermcouples +#if THERMISTOR_ID == -3 + #define THERMISTOR_NAME "MAX31855" +#elif THERMISTOR_ID == -2 + #define THERMISTOR_NAME "MAX6675" +#elif THERMISTOR_ID == -1 + #define THERMISTOR_NAME "AD595" + +// Standard thermistors +#elif THERMISTOR_ID == 1 + #define THERMISTOR_NAME "EPCOS 100K" +#elif THERMISTOR_ID == 2 + #define THERMISTOR_NAME "ATC 204GT-2" +#elif THERMISTOR_ID == 3 + #define THERMISTOR_NAME "Mendel-parts" +#elif THERMISTOR_ID == 4 + #define THERMISTOR_NAME "Generic 10K" +#elif THERMISTOR_ID == 5 + #define THERMISTOR_NAME "ATC 104GT-2" +#elif THERMISTOR_ID == 6 + #define THERMISTOR_NAME "EPCOS (alt)" +#elif THERMISTOR_ID == 7 + #define THERMISTOR_NAME "HW 104LAG" +#elif THERMISTOR_ID == 71 + #define THERMISTOR_NAME "HW 104LAF" +#elif THERMISTOR_ID == 8 + #define THERMISTOR_NAME "E3104FXT" +#elif THERMISTOR_ID == 9 + #define THERMISTOR_NAME "GE AL03006" +#elif THERMISTOR_ID == 10 + #define THERMISTOR_NAME "RS 198-961" +#elif THERMISTOR_ID == 11 + #define THERMISTOR_NAME "1% beta 3950" +#elif THERMISTOR_ID == 12 + #define THERMISTOR_NAME "E3104FXT (alt)" +#elif THERMISTOR_ID == 13 + #define THERMISTOR_NAME "Hisens 3950" +#elif THERMISTOR_ID == 20 + #define THERMISTOR_NAME "PT100 UltiMB" +#elif THERMISTOR_ID == 60 + #define THERMISTOR_NAME "Makers Tool" +#elif THERMISTOR_ID == 70 + #define THERMISTOR_NAME "Hephestos 2" + +// Modified thermistors +#elif THERMISTOR_ID == 51 + #define THERMISTOR_NAME "EPCOS 1K" +#elif THERMISTOR_ID == 52 + #define THERMISTOR_NAME "ATC204GT-2 1K" +#elif THERMISTOR_ID == 55 + #define THERMISTOR_NAME "ATC104GT-2 1K" +#elif THERMISTOR_ID == 1047 + #define THERMISTOR_NAME "PT1000 4K7" +#elif THERMISTOR_ID == 1010 + #define THERMISTOR_NAME "PT1000 1K" +#elif THERMISTOR_ID == 147 + #define THERMISTOR_NAME "PT100 4K7" +#elif THERMISTOR_ID == 110 + #define THERMISTOR_NAME "PT100 1K" + +// Dummies for dev testing +#elif THERMISTOR_ID == 998 + #define THERMISTOR_NAME "Dummy 1" +#elif THERMISTOR_ID == 999 + #define THERMISTOR_NAME "Dummy 2" + +#endif // THERMISTOR_ID diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 7fd0e9f25..8d52cc2f1 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -29,6 +29,10 @@ #include "stepper.h" #include "configuration_store.h" +#if ENABLED(PRINTCOUNTER) + #include "printcounter.h" +#endif + int plaPreheatHotendTemp; int plaPreheatHPBTemp; int plaPreheatFanSpeed; @@ -117,6 +121,15 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to static void lcd_control_motion_menu(); static void lcd_control_volumetric_menu(); + #if ENABLED(LCD_INFO_MENU) + #if ENABLED(PRINTCOUNTER) + static void lcd_info_stats_menu(); + #endif + static void lcd_info_thermistors_menu(); + static void lcd_info_board_menu(); + static void lcd_info_menu(); + #endif + #if HAS_LCD_CONTRAST static void lcd_set_contrast(); #endif @@ -189,6 +202,12 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to /** * START_MENU generates the init code for a menu function + * + * encoderLine is the position based on the encoder + * currentMenuViewOffset is the top menu line to display + * _drawLineNr is the index of the LCD line (0-3) + * _lineNr is the menu item to draw and process + * _menuItemNr is the index of each MENU_ITEM */ #define START_MENU() do { \ ENCODER_DIRECTION_MENUS(); \ @@ -242,6 +261,26 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to _MENU_ITEM_PART_2(type, ## args); \ } while(0) + // Used to print static text with no visible cursor. + #define STATIC_ITEM(label, args...) \ + if (_menuItemNr == _lineNr) { \ + if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) \ + encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ + if (lcdDrawUpdate) \ + lcd_implementation_drawmenu_static(_drawLineNr, PSTR(label), ## args); \ + } \ + _menuItemNr++ + + // Same as STATIC_ITEM, but can display variables. Do not use for text strings. + #define STATIC_ITEM_VAR(label, args...) \ + if (_menuItemNr == _lineNr) { \ + if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) \ + encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ + if (lcdDrawUpdate) \ + lcd_implementation_drawmenu_static(_drawLineNr, label, ## args); \ + } \ + _menuItemNr++ + #if ENABLED(ENCODER_RATE_MULTIPLIER) //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value @@ -554,6 +593,10 @@ static void lcd_status_screen() { } #endif //SDSUPPORT + #if ENABLED(LCD_INFO_MENU) + MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu); + #endif + END_MENU(); } @@ -1870,6 +1913,134 @@ static void lcd_status_screen() { #endif //SDSUPPORT + #if ENABLED(LCD_INFO_MENU) + #if ENABLED(PRINTCOUNTER) + /** + * + * Printer Info > Stastics submenu + * + */ + static void lcd_info_stats_menu() { + PrintCounter print_job_counter = PrintCounter(); + print_job_counter.loadStats(); + printStatistics stats = print_job_counter.getStats(); + + char totalPrints[18]; + itoa(stats.totalPrints, totalPrints, 10); + char finishedPrints[18]; + itoa(stats.finishedPrints, finishedPrints, 10); + char printTime[18]; + itoa(stats.printTime, printTime, 10); + + if (LCD_CLICKED) lcd_goto_previous_menu(true); + START_MENU(); + STATIC_ITEM(MSG_INFO_TOTAL_PRINTS ": "); // Total Prints: + STATIC_ITEM_VAR(totalPrints); // 999 + STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": "); // Finished Prints: + STATIC_ITEM_VAR(finishedPrints); // 666 + STATIC_ITEM(MSG_INFO_PRINT_TIME ": "); // Total Print Time: + STATIC_ITEM_VAR(printTime); // 123456 + END_MENU(); + } + #endif + + /** + * + * Printer Info > Thermistors + * + */ + static void lcd_info_thermistors_menu() { + if (LCD_CLICKED) lcd_goto_previous_menu(true); + START_MENU(); + #define THERMISTOR_ID TEMP_SENSOR_0 + #include "thermistornames.h" + STATIC_ITEM("T0: " THERMISTOR_NAME); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP)); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP)); + + #if TEMP_SENSOR_1 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_1 + #include "thermistornames.h" + STATIC_ITEM("T1: " THERMISTOR_NAME); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP)); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP)); + #endif + + #if TEMP_SENSOR_2 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_2 + #include "thermistornames.h" + STATIC_ITEM("T2: " THERMISTOR_NAME); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP)); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP)); + #endif + + #if TEMP_SENSOR_3 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_3 + #include "thermistornames.h" + STATIC_ITEM("T3: " THERMISTOR_NAME); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP)); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP)); + #endif + + #if TEMP_SENSOR_BED != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_BED + #include "thermistornames.h" + STATIC_ITEM("TBed:" THERMISTOR_NAME); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP)); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP)); + #endif + END_MENU(); + } + + /** + * + * Printer Info > Board Info + * + */ + static void lcd_info_board_menu() { + if (LCD_CLICKED) lcd_goto_previous_menu(true); + START_MENU(); + STATIC_ITEM(BOARD_NAME); // MyPrinterController + STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE)); // Baud: 250000 + STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION); // Protocol: 1.0 + #ifdef POWER_SUPPLY + #if (POWER_SUPPLY == 1) + STATIC_ITEM(MSG_INFO_PSU ": ATX"); // Power Supply: ATX + #elif (POWER_SUPPLY == 2) + STATIC_ITEM(MSG_INFO_PSU ": XBox"); // Power Supply: XBox + #endif + #endif // POWER_SUPPLY + END_MENU(); + } + + /** + * + * "Printer Info" submenu + * + */ + static void lcd_info_menu() { + START_MENU(); + MENU_ITEM(back, MSG_INFO_MENU); + STATIC_ITEM(MSG_MARLIN); // Marlin + STATIC_ITEM(SHORT_BUILD_VERSION); // x.x.x-Branch + STATIC_ITEM(STRING_DISTRIBUTION_DATE); // YYYY-MM-DD HH:MM + STATIC_ITEM(MACHINE_NAME); // My3DPrinter + STATIC_ITEM(WEBSITE_URL); // www.my3dprinter.com + STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS)); // Extruders: 2 + + MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu); // Board Info -> + MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors -> + #if ENABLED(PRINTCOUNTER) + MENU_ITEM(submenu, MSG_INFO_STATS_MENU, lcd_info_stats_menu); // Printer Statistics -> + #endif + END_MENU(); + } + #endif // LCD_INFO_MENU + /** * * Functions for editing single values diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 24b68830d..cc1803d96 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -815,6 +815,21 @@ static void lcd_implementation_status_screen() { lcd_print(lcd_status_message); } +static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true) { + char c; + uint8_t n = LCD_WIDTH; + lcd.setCursor(0, row); + if (center) { + int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; + while (--pad >= 0) { lcd.print(' '); n--; } + } + while ((c = pgm_read_byte(pstr)) && n > 0) { + n -= lcd_print(c); + pstr++; + } + while (n--) lcd.print(' '); +} + static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) { char c; uint8_t n = LCD_WIDTH - 2; From dbfc87cdcfc364532f0592182d54f907d85d3432 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Jul 2016 14:01:24 -0700 Subject: [PATCH 228/580] Squish sanity check for build info --- Marlin/SanityCheck.h | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 81e2db8bd..ad8ca867e 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -56,35 +56,21 @@ * Marlin release, version and default string */ #ifndef SHORT_BUILD_VERSION - #error "SHORT_BUILD_VERSION Information must be specified" -#endif - -#ifndef DETAILED_BUILD_VERSION - #error "BUILD_VERSION Information must be specified" -#endif - -#ifndef STRING_DISTRIBUTION_DATE - #error "STRING_DISTRIBUTION_DATE Information must be specified" -#endif - -#ifndef PROTOCOL_VERSION - #error "PROTOCOL_VERSION Information must be specified" -#endif - -#ifndef MACHINE_NAME - #error "MACHINE_NAME Information must be specified" -#endif - -#ifndef SOURCE_CODE_URL - #error "SOURCE_CODE_URL Information must be specified" -#endif - -#ifndef DEFAULT_MACHINE_UUID - #error "DEFAULT_MACHINE_UUID Information must be specified" -#endif - -#ifndef WEBSITE_URL - #error "WEBSITE_URL Information must be specified" + #error "SHORT_BUILD_VERSION must be specified." +#elif !defined(DETAILED_BUILD_VERSION) + #error "BUILD_VERSION must be specified." +#elif !defined(STRING_DISTRIBUTION_DATE) + #error "STRING_DISTRIBUTION_DATE must be specified." +#elif !defined(PROTOCOL_VERSION) + #error "PROTOCOL_VERSION must be specified." +#elif !defined(MACHINE_NAME) + #error "MACHINE_NAME must be specified." +#elif !defined(SOURCE_CODE_URL) + #error "SOURCE_CODE_URL must be specified." +#elif !defined(DEFAULT_MACHINE_UUID) + #error "DEFAULT_MACHINE_UUID must be specified." +#elif !defined(WEBSITE_URL) + #error "WEBSITE_URL must be specified." #endif /** From fa9b2a925da2035c7055d3424a3c017b076d9764 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Jul 2016 14:04:35 -0700 Subject: [PATCH 229/580] Tweak spacing in printcounter.cpp --- Marlin/printcounter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp index 0c79087ff..78e3630d3 100644 --- a/Marlin/printcounter.cpp +++ b/Marlin/printcounter.cpp @@ -88,7 +88,7 @@ void PrintCounter::showStats() { SERIAL_ECHO(this->data.totalPrints - this->data.finishedPrints - ((this->isRunning() || this->isPaused()) ? 1 : 0)); // Removes 1 from failures with an active counter - uint32_t t = this->data.printTime /60; + uint32_t t = this->data.printTime / 60; SERIAL_ECHOPGM(", Total print time: "); SERIAL_ECHO(t / 60); From 439e78147d7a3dbd8693b9c218862d7e85026b68 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Jul 2016 13:57:24 -0700 Subject: [PATCH 230/580] Static menu items take an optional string, LJ by default --- Marlin/dogm_lcd_implementation.h | 36 +++++++++++-------- .../ultralcd_implementation_hitachi_HD44780.h | 34 +++++++++++------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 023df5baa..6813d3a85 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -473,21 +473,29 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { u8g.setPrintPos((START_ROW) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)); } -static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true) { - char c; - uint8_t n = LCD_WIDTH; - u8g.setPrintPos(0, (row + 1) * (DOG_CHAR_HEIGHT)); - u8g.setColorIndex(1); // normal text - if (center) { - int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; - while (--pad >= 0) { lcd_print(' '); n--; } - } - while (c = pgm_read_byte(pstr)) { - n -= lcd_print(c); - pstr++; +#if ENABLED(LCD_INFO_MENU) + + static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char* valstr=NULL, bool center=false) { + char c; + int8_t n = LCD_WIDTH; + u8g.setPrintPos(0, (row + 1) * (DOG_CHAR_HEIGHT)); + u8g.setColorIndex(1); // normal text + if (center) { + int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; + while (--pad >= 0) { lcd_print(' '); n--; } + } + while (c = pgm_read_byte(pstr)) { + n -= lcd_print(c); + pstr++; + } + if (valstr) { + lcd_print(valstr); + n -= lcd_strlen(valstr); + } + while (n-- > 0) lcd_print(' '); } - while (n--) lcd_print(' '); -} + +#endif // LCD_INFO_MENU static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) { UNUSED(pstr); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index cc1803d96..e9392414a 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -815,20 +815,28 @@ static void lcd_implementation_status_screen() { lcd_print(lcd_status_message); } -static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true) { - char c; - uint8_t n = LCD_WIDTH; - lcd.setCursor(0, row); - if (center) { - int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; - while (--pad >= 0) { lcd.print(' '); n--; } - } - while ((c = pgm_read_byte(pstr)) && n > 0) { - n -= lcd_print(c); - pstr++; +#if ENABLED(LCD_INFO_MENU) + + static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char *valstr=NULL, bool center=true) { + char c; + int8_t n = LCD_WIDTH; + lcd.setCursor(0, row); + if (center) { + int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; + while (--pad >= 0) { lcd.print(' '); n--; } + } + while ((c = pgm_read_byte(pstr)) && n > 0) { + n -= lcd_print(c); + pstr++; + } + if (valstr) { + lcd_print(valstr); + n -= lcd_strlen(valstr); + } + while (n-- > 0) lcd.print(' '); } - while (n--) lcd.print(' '); -} + +#endif // LCD_INFO_MENU static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) { char c; From 51b782068688ba820e2833ef9335cf10b2b5246e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Jul 2016 14:04:18 -0700 Subject: [PATCH 231/580] Patch up About Printer sub-menus --- Marlin/language_en.h | 3 +++ Marlin/ultralcd.cpp | 64 ++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 165a15838..1e9c955cb 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -523,6 +523,9 @@ #ifndef MSG_INFO_MENU #define MSG_INFO_MENU "About Printer" #endif +#ifndef MSG_INFO_PRINTER_MENU + #define MSG_INFO_PRINTER_MENU "Printer Info" +#endif #ifndef MSG_INFO_STATS_MENU #define MSG_INFO_STATS_MENU "Printer Stats" #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 8d52cc2f1..11c998b4b 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -271,16 +271,6 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to } \ _menuItemNr++ - // Same as STATIC_ITEM, but can display variables. Do not use for text strings. - #define STATIC_ITEM_VAR(label, args...) \ - if (_menuItemNr == _lineNr) { \ - if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_static(_drawLineNr, label, ## args); \ - } \ - _menuItemNr++ - #if ENABLED(ENCODER_RATE_MULTIPLIER) //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value @@ -1914,10 +1904,11 @@ static void lcd_status_screen() { #endif //SDSUPPORT #if ENABLED(LCD_INFO_MENU) + #if ENABLED(PRINTCOUNTER) /** * - * Printer Info > Stastics submenu + * About Printer > Stastics submenu * */ static void lcd_info_stats_menu() { @@ -1925,28 +1916,21 @@ static void lcd_status_screen() { print_job_counter.loadStats(); printStatistics stats = print_job_counter.getStats(); - char totalPrints[18]; - itoa(stats.totalPrints, totalPrints, 10); - char finishedPrints[18]; - itoa(stats.finishedPrints, finishedPrints, 10); - char printTime[18]; - itoa(stats.printTime, printTime, 10); + char printTime[6]; + sprintf(printTime, "%02d:%02d", stats.printTime / 60, stats.printTime % 60); if (LCD_CLICKED) lcd_goto_previous_menu(true); START_MENU(); - STATIC_ITEM(MSG_INFO_TOTAL_PRINTS ": "); // Total Prints: - STATIC_ITEM_VAR(totalPrints); // 999 - STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": "); // Finished Prints: - STATIC_ITEM_VAR(finishedPrints); // 666 - STATIC_ITEM(MSG_INFO_PRINT_TIME ": "); // Total Print Time: - STATIC_ITEM_VAR(printTime); // 123456 + STATIC_ITEM(MSG_INFO_TOTAL_PRINTS ": ", itostr3left(stats.totalPrints)); // Total Prints: 999 + STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", itostr3left(stats.finishedPrints)); // Finished Prints: 666 + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", printTime); // Total Print Time: 123456 END_MENU(); } - #endif - + #endif // PRINTCOUNTER + /** * - * Printer Info > Thermistors + * About Printer > Thermistors * */ static void lcd_info_thermistors_menu() { @@ -1984,7 +1968,7 @@ static void lcd_status_screen() { STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP)); STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP)); #endif - + #if TEMP_SENSOR_BED != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED @@ -1998,7 +1982,7 @@ static void lcd_status_screen() { /** * - * Printer Info > Board Info + * About Printer > Board Info * */ static void lcd_info_board_menu() { @@ -2019,23 +2003,34 @@ static void lcd_status_screen() { /** * - * "Printer Info" submenu + * About Printer > Printer Info * */ - static void lcd_info_menu() { + static void lcd_info_printer_menu() { + if (LCD_CLICKED) lcd_goto_previous_menu(true); START_MENU(); - MENU_ITEM(back, MSG_INFO_MENU); STATIC_ITEM(MSG_MARLIN); // Marlin STATIC_ITEM(SHORT_BUILD_VERSION); // x.x.x-Branch STATIC_ITEM(STRING_DISTRIBUTION_DATE); // YYYY-MM-DD HH:MM STATIC_ITEM(MACHINE_NAME); // My3DPrinter STATIC_ITEM(WEBSITE_URL); // www.my3dprinter.com STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS)); // Extruders: 2 + END_MENU(); + } - MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu); // Board Info -> - MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors -> + /** + * + * "About Printer" submenu + * + */ + static void lcd_info_menu() { + START_MENU(); + MENU_ITEM(back, MSG_MAIN); + MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, lcd_info_printer_menu); // Printer Info > + MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu); // Board Info > + MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors > #if ENABLED(PRINTCOUNTER) - MENU_ITEM(submenu, MSG_INFO_STATS_MENU, lcd_info_stats_menu); // Printer Statistics -> + MENU_ITEM(submenu, MSG_INFO_STATS_MENU, lcd_info_stats_menu); // Printer Statistics > #endif END_MENU(); } @@ -2744,7 +2739,6 @@ char *ftostr4sign(const float& x) { return itostr4sign((int)x); } // Convert unsigned int to string with 12 format char* itostr2(const uint8_t& x) { - //sprintf(conv,"%5.1f",x); int xx = x; conv[0] = DIGIMOD(xx / 10); conv[1] = DIGIMOD(xx); From b77069de0126c011607a0612caeffab5f794ae85 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Jul 2016 14:11:43 -0700 Subject: [PATCH 232/580] Add a Travis test for LCD_INFO_MENU --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30210b42f..81808fedc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -161,11 +161,11 @@ script: - opt_set MOTHERBOARD BOARD_MINIRAMBO - build_marlin # - # Enable FILAMENTCHANGEENABLE + # Test FILAMENTCHANGEENABLE and LCD_INFO_MENU # - restore_configs - opt_enable ULTIMAKERCONTROLLER - - opt_enable_adv FILAMENTCHANGEENABLE + - opt_enable_adv FILAMENTCHANGEENABLE LCD_INFO_MENU - build_marlin # # Enable filament sensor From 43ff0ce35fcacba99ea322d77ae00bc777b22a7c Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Thu, 28 Apr 2016 18:57:21 +0200 Subject: [PATCH 233/580] Rewritten FILAMENT_CHANGE_ENABLE feature --- .travis.yml | 4 +- Marlin/Configuration_adv.h | 34 +++- Marlin/Marlin.h | 13 +- Marlin/Marlin_main.cpp | 189 +++++++++++------- Marlin/SanityCheck.h | 6 +- .../Felix/Configuration_adv.h | 34 +++- .../Hephestos/Configuration_adv.h | 34 +++- .../Hephestos_2/Configuration_adv.h | 34 +++- .../K8200/Configuration_adv.h | 34 +++- .../RigidBot/Configuration_adv.h | 34 +++- .../SCARA/Configuration_adv.h | 34 +++- .../TAZ4/Configuration_adv.h | 34 +++- .../WITBOX/Configuration_adv.h | 34 +++- .../delta/biv2.5/Configuration_adv.h | 34 +++- .../delta/generic/Configuration_adv.h | 34 +++- .../delta/kossel_mini/Configuration_adv.h | 34 +++- .../delta/kossel_pro/Configuration_adv.h | 34 +++- .../delta/kossel_xl/Configuration_adv.h | 34 +++- .../makibox/Configuration_adv.h | 34 +++- .../tvrrug/Round2/Configuration_adv.h | 34 +++- Marlin/language_cz.h | 23 +++ Marlin/language_en.h | 67 +++++++ Marlin/ultralcd.cpp | 124 +++++++++++- Marlin/ultralcd.h | 15 ++ 24 files changed, 740 insertions(+), 245 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81808fedc..eb471fd11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -161,11 +161,11 @@ script: - opt_set MOTHERBOARD BOARD_MINIRAMBO - build_marlin # - # Test FILAMENTCHANGEENABLE and LCD_INFO_MENU + # Test FILAMENT_CHANGE_FEATURE and LCD_INFO_MENU # - restore_configs - opt_enable ULTIMAKERCONTROLLER - - opt_enable_adv FILAMENTCHANGEENABLE LCD_INFO_MENU + - opt_enable_adv FILAMENT_CHANGE_FEATURE LCD_INFO_MENU - build_marlin # # Enable filament sensor diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 25ec27a11..3a673a673 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index c4298aaac..616a8bf35 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -123,8 +123,8 @@ FORCE_INLINE void serialprintPGM(const char* str) { } void idle( - #if ENABLED(FILAMENTCHANGEENABLE) - bool no_stepper_sleep=false // pass true to keep steppers from disabling on timeout + #if ENABLED(FILAMENT_CHANGE_FEATURE) + bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout #endif ); @@ -346,6 +346,15 @@ float code_value_temp_diff(); extern int meas_delay_cm; //delay distance #endif +#if ENABLED(FILAMENT_CHANGE_FEATURE) + enum FilamentChangeMenuResponse { + FILAMENT_CHANGE_RESPONSE_WAIT_FOR, + FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE, + FILAMENT_CHANGE_RESPONSE_RESUME_PRINT + }; + extern FilamentChangeMenuResponse filament_change_menu_response; +#endif + #if ENABLED(PID_ADD_EXTRUSION_RATE) extern int lpq_len; #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b05f5b523..59f526f06 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -294,6 +294,7 @@ static char command_queue[BUFSIZE][MAX_CMD_SIZE]; #endif const float homing_feedrate[] = HOMING_FEEDRATE; + bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedrate_multiplier = 100; //100->1 200->2 int saved_feedrate_multiplier; @@ -490,6 +491,10 @@ static uint8_t target_extruder; static bool filament_ran_out = false; #endif +#if ENABLED(FILAMENT_CHANGE_FEATURE) + FilamentChangeMenuResponse filament_change_menu_response; +#endif + static bool send_ok[BUFSIZE]; #if HAS_SERVOS @@ -1564,9 +1569,8 @@ inline void line_to_z(float zPosition) { inline void line_to_destination(float mm_m) { planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], mm_m / 60, active_extruder); } -inline void line_to_destination() { - line_to_destination(feedrate); -} +inline void line_to_destination() { line_to_destination(feedrate); } + /** * sync_plan_position * Set planner / stepper positions to the cartesian current_position. @@ -3123,7 +3127,7 @@ inline void gcode_G28() { enum MeshLevelingState { MeshReport, MeshStart, MeshNext, MeshSet, MeshSetZOffset, MeshReset }; inline void _mbl_goto_xy(float x, float y) { - saved_feedrate = feedrate; + float old_feedrate = feedrate; feedrate = homing_feedrate[X_AXIS]; current_position[Z_AXIS] = MESH_HOME_SEARCH_Z @@ -3144,7 +3148,7 @@ inline void gcode_G28() { line_to_current_position(); #endif - feedrate = saved_feedrate; + feedrate = old_feedrate; stepper.synchronize(); } @@ -6131,7 +6135,7 @@ inline void gcode_M503() { #endif // HAS_BED_PROBE -#if ENABLED(FILAMENTCHANGEENABLE) +#if ENABLED(FILAMENT_CHANGE_FEATURE) /** * M600: Pause for filament change @@ -6153,129 +6157,160 @@ inline void gcode_M503() { return; } + // Show initial message and wait for synchronize steppers + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INIT); + stepper.synchronize(); + float lastpos[NUM_AXIS]; - #if ENABLED(DELTA) - float fr60 = feedrate / 60; - #endif - for (int i = 0; i < NUM_AXIS; i++) + // Save current position of all axes + for (uint8_t i = 0; i < NUM_AXIS; i++) lastpos[i] = destination[i] = current_position[i]; + // Define runplan for move axes #if ENABLED(DELTA) - #define RUNPLAN calculate_delta(destination); \ - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], fr60, active_extruder); + #define RUNPLAN(RATE) calculate_delta(destination); \ + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], RATE, active_extruder); #else - #define RUNPLAN line_to_destination(); + #define RUNPLAN(RATE) line_to_destination(RATE * 60); #endif - //retract by E + KEEPALIVE_STATE(IN_HANDLER); + + // Initial retract before move to filament change position if (code_seen('E')) destination[E_AXIS] += code_value_axis_units(E_AXIS); - #ifdef FILAMENTCHANGE_FIRSTRETRACT - else destination[E_AXIS] += FILAMENTCHANGE_FIRSTRETRACT; + #if defined(FILAMENT_CHANGE_RETRACT_LENGTH) && FILAMENT_CHANGE_RETRACT_LENGTH > 0 + else destination[E_AXIS] -= FILAMENT_CHANGE_RETRACT_LENGTH; #endif - RUNPLAN; + RUNPLAN(FILAMENT_CHANGE_RETRACT_FEEDRATE); - //lift Z - if (code_seen('Z')) destination[Z_AXIS] += code_value_axis_units(Z_AXIS); - #ifdef FILAMENTCHANGE_ZADD - else destination[Z_AXIS] += FILAMENTCHANGE_ZADD; - #endif + // Lift Z axis + float z_lift = code_seen('Z') ? code_value_axis_units(Z_AXIS) : + #if defined(FILAMENT_CHANGE_Z_ADD) && FILAMENT_CHANGE_Z_ADD > 0 + FILAMENT_CHANGE_Z_ADD + #else + 0 + #endif + ; - RUNPLAN; + if (z_lift > 0) { + destination[Z_AXIS] += z_lift; + NOMORE(destination[Z_AXIS], Z_MAX_POS); + RUNPLAN(FILAMENT_CHANGE_Z_FEEDRATE); + } - //move xy + // Move XY axes to filament exchange position if (code_seen('X')) destination[X_AXIS] = code_value_axis_units(X_AXIS); - #ifdef FILAMENTCHANGE_XPOS - else destination[X_AXIS] = FILAMENTCHANGE_XPOS; + #ifdef FILAMENT_CHANGE_X_POS + else destination[X_AXIS] = FILAMENT_CHANGE_X_POS; #endif if (code_seen('Y')) destination[Y_AXIS] = code_value_axis_units(Y_AXIS); - #ifdef FILAMENTCHANGE_YPOS - else destination[Y_AXIS] = FILAMENTCHANGE_YPOS; + #ifdef FILAMENT_CHANGE_Y_POS + else destination[Y_AXIS] = FILAMENT_CHANGE_Y_POS; #endif - RUNPLAN; + RUNPLAN(FILAMENT_CHANGE_XY_FEEDRATE); + + stepper.synchronize(); + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_UNLOAD); + // Unload filament if (code_seen('L')) destination[E_AXIS] += code_value_axis_units(E_AXIS); - #ifdef FILAMENTCHANGE_FINALRETRACT - else destination[E_AXIS] += FILAMENTCHANGE_FINALRETRACT; + #if defined(FILAMENT_CHANGE_UNLOAD_LENGTH) && FILAMENT_CHANGE_UNLOAD_LENGTH > 0 + else destination[E_AXIS] -= FILAMENT_CHANGE_UNLOAD_LENGTH; #endif - RUNPLAN; + RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE); - //finish moves + // Synchronize steppers and then disable extruders steppers for manual filament changing stepper.synchronize(); - //disable extruder steppers so filament can be removed disable_e0(); disable_e1(); disable_e2(); disable_e3(); delay(100); - LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE); - #if DISABLED(AUTO_FILAMENT_CHANGE) - millis_t next_tick = 0; - #endif - KEEPALIVE_STATE(PAUSED_FOR_USER); + + millis_t next_tick = 0; + + // Wait for filament insert by user and press button + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT); + while (!lcd_clicked()) { - #if DISABLED(AUTO_FILAMENT_CHANGE) + #if HAS_BUZZER millis_t ms = millis(); - if (ELAPSED(ms, next_tick)) { - lcd_quick_feedback(); - next_tick = ms + 2500UL; // feedback every 2.5s while waiting + if (ms >= next_tick) { + buzzer.tone(300, 2000); + next_tick = ms + 2500; // Beep every 2.5s while waiting } - idle(true); - #else - current_position[E_AXIS] += AUTO_FILAMENT_CHANGE_LENGTH; - destination[E_AXIS] = current_position[E_AXIS]; - line_to_destination(AUTO_FILAMENT_CHANGE_FEEDRATE); - stepper.synchronize(); #endif - } // while(!lcd_clicked) - KEEPALIVE_STATE(IN_HANDLER); - lcd_quick_feedback(); // click sound feedback + idle(true); + } + delay(100); + while (lcd_clicked()) idle(true); + delay(100); - #if ENABLED(AUTO_FILAMENT_CHANGE) - current_position[E_AXIS] = 0; - stepper.synchronize(); - #endif + // Show load message + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD); - //return to normal + // Load filament if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS); - #ifdef FILAMENTCHANGE_FINALRETRACT - else destination[E_AXIS] -= FILAMENTCHANGE_FINALRETRACT; + #if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0 + else destination[E_AXIS] += FILAMENT_CHANGE_LOAD_LENGTH; #endif - current_position[E_AXIS] = destination[E_AXIS]; //the long retract of L is compensated by manual filament feeding - sync_plan_position_e(); + RUNPLAN(FILAMENT_CHANGE_LOAD_FEEDRATE); + stepper.synchronize(); - RUNPLAN; //should do nothing + #if defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) && FILAMENT_CHANGE_EXTRUDE_LENGTH > 0 + do { + // Extrude filament to get into hotend + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_EXTRUDE); + destination[E_AXIS] += FILAMENT_CHANGE_EXTRUDE_LENGTH; + RUNPLAN(FILAMENT_CHANGE_EXTRUDE_FEEDRATE); + stepper.synchronize(); + // Ask user if more filament should be extruded + KEEPALIVE_STATE(PAUSED_FOR_USER); + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_OPTION); + while (filament_change_menu_response == FILAMENT_CHANGE_RESPONSE_WAIT_FOR) idle(true); + KEEPALIVE_STATE(IN_HANDLER); + } while (filament_change_menu_response != FILAMENT_CHANGE_RESPONSE_RESUME_PRINT); + #endif + + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_RESUME); - lcd_reset_alert_level(); + KEEPALIVE_STATE(IN_HANDLER); + + // Set extruder to saved position + current_position[E_AXIS] = lastpos[E_AXIS]; + destination[E_AXIS] = lastpos[E_AXIS]; + planner.set_e_position_mm(current_position[E_AXIS]); #if ENABLED(DELTA) // Move XYZ to starting position, then E calculate_delta(lastpos); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], fr60, active_extruder); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], lastpos[E_AXIS], fr60, active_extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], FILAMENT_CHANGE_XY_FEEDRATE, active_extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], lastpos[E_AXIS], FILAMENT_CHANGE_XY_FEEDRATE, active_extruder); #else // Move XY to starting position, then Z, then E destination[X_AXIS] = lastpos[X_AXIS]; destination[Y_AXIS] = lastpos[Y_AXIS]; - line_to_destination(); + RUNPLAN(FILAMENT_CHANGE_XY_FEEDRATE); destination[Z_AXIS] = lastpos[Z_AXIS]; - line_to_destination(); - destination[E_AXIS] = lastpos[E_AXIS]; - line_to_destination(); + RUNPLAN(FILAMENT_CHANGE_Z_FEEDRATE); #endif + stepper.synchronize(); #if ENABLED(FILAMENT_RUNOUT_SENSOR) filament_ran_out = false; #endif + // Show status screen + lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_STATUS); } -#endif // FILAMENTCHANGEENABLE +#endif // FILAMENT_CHANGE_FEATURE #if ENABLED(DUAL_X_CARRIAGE) @@ -6464,11 +6499,11 @@ inline void gcode_T(uint8_t tmp_extruder) { #if HOTENDS > 1 - float stored_feedrate = feedrate; + float old_feedrate = feedrate; if (code_seen('F')) { float next_feedrate = code_value_axis_units(X_AXIS); - if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate; + if (next_feedrate > 0.0) old_feedrate = feedrate = next_feedrate; } else feedrate = XY_PROBE_FEEDRATE; @@ -6624,7 +6659,7 @@ inline void gcode_T(uint8_t tmp_extruder) { enable_solenoid_on_active_extruder(); #endif // EXT_SOLENOID - feedrate = stored_feedrate; + feedrate = old_feedrate; #else // !HOTENDS > 1 @@ -7232,11 +7267,11 @@ void process_next_command() { break; #endif // HAS_BED_PROBE - #if ENABLED(FILAMENTCHANGEENABLE) + #if ENABLED(FILAMENT_CHANGE_FEATURE) case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] gcode_M600(); break; - #endif // FILAMENTCHANGEENABLE + #endif // FILAMENT_CHANGE_FEATURE #if ENABLED(DUAL_X_CARRIAGE) case 605: @@ -7993,14 +8028,14 @@ void disable_all_steppers() { * Standard idle routine keeps the machine alive */ void idle( - #if ENABLED(FILAMENTCHANGEENABLE) + #if ENABLED(FILAMENT_CHANGE_FEATURE) bool no_stepper_sleep/*=false*/ #endif ) { lcd_update(); host_keepalive(); manage_inactivity( - #if ENABLED(FILAMENTCHANGEENABLE) + #if ENABLED(FILAMENT_CHANGE_FEATURE) no_stepper_sleep #endif ); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index ad8ca867e..941821be2 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -124,8 +124,8 @@ /** * Filament Change with Extruder Runout Prevention */ -#if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT) - #error "EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE." +#if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(EXTRUDER_RUNOUT_PREVENT) + #error "EXTRUDER_RUNOUT_PREVENT is incompatible with FILAMENT_CHANGE_FEATURE." #endif /** @@ -623,6 +623,8 @@ #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." #elif defined(SERVO_DEACTIVATION_DELAY) #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." +#elif ENABLED(FILAMENTCHANGEENABLE) + #error "FILAMENTCHANGEENABLE is now FILAMENT_CHANGE_FEATURE. Please update your configuration." #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index d514288d7..ffad11995 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index b4062e8e6..8956c41cd 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index d86b8c0e3..704b20ce4 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index ae6488742..1a00bb376 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -557,16 +557,30 @@ const unsigned int dropsegments = 2; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 7b608f80a..e1280f2d2 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 58d36231b..475e0335a 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 11b9e6c1d..1a6ab806a 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -559,16 +559,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - #define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - //#define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - //#define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - //#define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index b4062e8e6..8956c41cd 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 1978c0927..894e86163 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -553,16 +553,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index f673a200b..fba00960a 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -553,16 +553,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 93e9e30d6..7265b7628 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -552,16 +552,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index f417a57e4..69eb9ce95 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -557,16 +557,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index bcbf1c1b1..f224fd60e 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -553,16 +553,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 7b7b4f9b7..857f320e4 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index d58dbb37c..69ee6e04b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 3 - #define FILAMENTCHANGE_YPOS 3 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -2 - #define FILAMENTCHANGE_FINALRETRACT -100 - #define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - #define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - #define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 3 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 2 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index cc8508e14..730ad6217 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -200,4 +200,27 @@ #define MSG_DELTA_CALIBRATE_Z "Kalibrovat Z" #define MSG_DELTA_CALIBRATE_CENTER "Kalibrovat Stred" +#define MSG_FILAMENT_CHANGE_HEADER "VYMENA FILAMENTU" +#define MSG_FILAMENT_CHANGE_INIT_1 "Cekejte prosim" +#define MSG_FILAMENT_CHANGE_INIT_2 "na zahajeni" +#define MSG_FILAMENT_CHANGE_INIT_3 "vymeny filamentu" +#define MSG_FILAMENT_CHANGE_UNLOAD_1 "Cekejte prosim" +#define MSG_FILAMENT_CHANGE_UNLOAD_2 "na vysunuti" +#define MSG_FILAMENT_CHANGE_UNLOAD_3 "filamentu" +#define MSG_FILAMENT_CHANGE_INSERT_1 "Vlozte filament" +#define MSG_FILAMENT_CHANGE_INSERT_2 "a stisknete" +#define MSG_FILAMENT_CHANGE_INSERT_3 "tlacitko..." +#define MSG_FILAMENT_CHANGE_LOAD_1 "Cekejte prosim" +#define MSG_FILAMENT_CHANGE_LOAD_2 "na zavedeni" +#define MSG_FILAMENT_CHANGE_LOAD_3 "filamentu" +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Cekejte prosim" +#define MSG_FILAMENT_CHANGE_EXTRUDE_2 "na vytlaceni" +#define MSG_FILAMENT_CHANGE_EXTRUDE_3 "filamentu" +#define MSG_FILAMENT_CHANGE_OPTION_HEADER "CO DAL?" +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Jeste vytlacit" +#define MSG_FILAMENT_CHANGE_OPTION_RESUME "Obnovit tisk" +#define MSG_FILAMENT_CHANGE_RESUME_1 "Cekejte prosim" +#define MSG_FILAMENT_CHANGE_RESUME_2 "na pokracovani" +#define MSG_FILAMENT_CHANGE_RESUME_3 "tisku" + #endif // LANGUAGE_CZ_H diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 1e9c955cb..fb21bb03e 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -563,4 +563,71 @@ #define MSG_INFO_PSU "Power Supply" #endif +#ifndef MSG_FILAMENT_CHANGE_HEADER + #define MSG_FILAMENT_CHANGE_HEADER "CHANGE FILAMENT" +#endif +#ifndef MSG_FILAMENT_CHANGE_INIT_1 + #define MSG_FILAMENT_CHANGE_INIT_1 "Wait for start" +#endif +#ifndef MSG_FILAMENT_CHANGE_INIT_2 + #define MSG_FILAMENT_CHANGE_INIT_2 "of the filament" +#endif +#ifndef MSG_FILAMENT_CHANGE_INIT_3 + #define MSG_FILAMENT_CHANGE_INIT_3 "change" +#endif +#ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Wait for" +#endif +#ifndef MSG_FILAMENT_CHANGE_UNLOAD_2 + #define MSG_FILAMENT_CHANGE_UNLOAD_2 "filament unload" +#endif +#ifndef MSG_FILAMENT_CHANGE_UNLOAD_3 + #define MSG_FILAMENT_CHANGE_UNLOAD_3 "" +#endif +#ifndef MSG_FILAMENT_CHANGE_INSERT_1 + #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert filament" +#endif +#ifndef MSG_FILAMENT_CHANGE_INSERT_2 + #define MSG_FILAMENT_CHANGE_INSERT_2 "and press button" +#endif +#ifndef MSG_FILAMENT_CHANGE_INSERT_3 + #define MSG_FILAMENT_CHANGE_INSERT_3 "to continue..." +#endif +#ifndef MSG_FILAMENT_CHANGE_LOAD_1 + #define MSG_FILAMENT_CHANGE_LOAD_1 "Wait for" +#endif +#ifndef MSG_FILAMENT_CHANGE_LOAD_2 + #define MSG_FILAMENT_CHANGE_LOAD_2 "filament load" +#endif +#ifndef MSG_FILAMENT_CHANGE_LOAD_3 + #define MSG_FILAMENT_CHANGE_LOAD_3 "" +#endif +#ifndef MSG_FILAMENT_CHANGE_EXTRUDE_1 + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Wait for" +#endif +#ifndef MSG_FILAMENT_CHANGE_EXTRUDE_2 + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "filament extrude" +#endif +#ifndef MSG_FILAMENT_CHANGE_EXTRUDE_3 + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "" +#endif +#ifndef MSG_FILAMENT_CHANGE_OPTION_HEADER + #define MSG_FILAMENT_CHANGE_OPTION_HEADER "WHAT NEXT?" +#endif +#ifndef MSG_FILAMENT_CHANGE_OPTION_EXTRUDE + #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Extrude more" +#endif +#ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME + #define MSG_FILAMENT_CHANGE_OPTION_RESUME "Resume print" +#endif +#ifndef MSG_FILAMENT_CHANGE_RESUME_1 + #define MSG_FILAMENT_CHANGE_RESUME_1 "Wait for print" +#endif +#ifndef MSG_FILAMENT_CHANGE_RESUME_2 + #define MSG_FILAMENT_CHANGE_RESUME_2 "to resume" +#endif +#ifndef MSG_FILAMENT_CHANGE_RESUME_3 + #define MSG_FILAMENT_CHANGE_RESUME_3 "" +#endif + #endif // LANGUAGE_EN_H diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 11c998b4b..a495a28a5 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -128,7 +128,17 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to static void lcd_info_thermistors_menu(); static void lcd_info_board_menu(); static void lcd_info_menu(); - #endif + #endif // LCD_INFO_MENU + + #if ENABLED(FILAMENT_CHANGE_FEATURE) + static void lcd_filament_change_option_menu(); + static void lcd_filament_change_init_message(); + static void lcd_filament_change_unload_message(); + static void lcd_filament_change_insert_message(); + static void lcd_filament_change_load_message(); + static void lcd_filament_change_extrude_message(); + static void lcd_filament_change_resume_message(); + #endif #if HAS_LCD_CONTRAST static void lcd_set_contrast(); @@ -791,7 +801,7 @@ static void lcd_status_screen() { // // Change filament // - #if ENABLED(FILAMENTCHANGEENABLE) + #if ENABLED(FILAMENT_CHANGE_FEATURE) MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600")); #endif @@ -2036,6 +2046,116 @@ static void lcd_status_screen() { } #endif // LCD_INFO_MENU + #if ENABLED(FILAMENT_CHANGE_FEATURE) + + static void lcd_filament_change_nothing() { + } + + static void lcd_filament_change_resume_print() { + filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_RESUME_PRINT; + lcdDrawUpdate = 2; + lcd_goto_screen(lcd_status_screen); + } + + static void lcd_filament_change_extrude_more() { + filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE; + } + + static void lcd_filament_change_option_menu() { + START_MENU(); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_HEADER, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_filament_change_resume_print); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_EXTRUDE, lcd_filament_change_extrude_more); + END_MENU(); + } + + static void lcd_filament_change_init_message() { + START_MENU(); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_INIT_1, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_INIT_2, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_INIT_3, lcd_filament_change_nothing); + END_MENU(); + } + + static void lcd_filament_change_unload_message() { + START_MENU(); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_UNLOAD_1, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_UNLOAD_2, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_UNLOAD_3, lcd_filament_change_nothing); + END_MENU(); + } + + static void lcd_filament_change_insert_message() { + START_MENU(); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_INSERT_1, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_INSERT_2, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_INSERT_3, lcd_filament_change_nothing); + END_MENU(); + } + + static void lcd_filament_change_load_message() { + START_MENU(); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_LOAD_1, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_LOAD_2, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_LOAD_3, lcd_filament_change_nothing); + END_MENU(); + } + + static void lcd_filament_change_extrude_message() { + START_MENU(); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_EXTRUDE_1, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_EXTRUDE_2, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_EXTRUDE_3, lcd_filament_change_nothing); + END_MENU(); + } + + static void lcd_filament_change_resume_message() { + START_MENU(); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_RESUME_1, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_RESUME_2, lcd_filament_change_nothing); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_RESUME_3, lcd_filament_change_nothing); + END_MENU(); + } + + void lcd_filament_change_show_message(FilamentChangeMessage message) { + switch (message) { + case FILAMENT_CHANGE_MESSAGE_INIT: + defer_return_to_status = true; + lcd_goto_screen(lcd_filament_change_init_message); + break; + case FILAMENT_CHANGE_MESSAGE_UNLOAD: + lcd_goto_screen(lcd_filament_change_unload_message); + break; + case FILAMENT_CHANGE_MESSAGE_INSERT: + lcd_goto_screen(lcd_filament_change_insert_message); + break; + case FILAMENT_CHANGE_MESSAGE_LOAD: + lcd_goto_screen(lcd_filament_change_load_message); + break; + case FILAMENT_CHANGE_MESSAGE_EXTRUDE: + lcd_goto_screen(lcd_filament_change_extrude_message); + break; + case FILAMENT_CHANGE_MESSAGE_OPTION: + filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_WAIT_FOR; + lcd_goto_screen(lcd_filament_change_option_menu); + break; + case FILAMENT_CHANGE_MESSAGE_RESUME: + lcd_goto_screen(lcd_filament_change_resume_message); + break; + case FILAMENT_CHANGE_MESSAGE_STATUS: + lcd_return_to_status(); + break; + } + } + + #endif // FILAMENT_CHANGE_FEATURE + /** * * Functions for editing single values diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 8e7e2ee5f..fd5c4fc57 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -69,6 +69,21 @@ void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual bool lcd_clicked(); void lcd_ignore_click(bool b=true); + + #if ENABLED(FILAMENT_CHANGE_FEATURE) + enum FilamentChangeMessage { + FILAMENT_CHANGE_MESSAGE_INIT, + FILAMENT_CHANGE_MESSAGE_UNLOAD, + FILAMENT_CHANGE_MESSAGE_INSERT, + FILAMENT_CHANGE_MESSAGE_LOAD, + FILAMENT_CHANGE_MESSAGE_EXTRUDE, + FILAMENT_CHANGE_MESSAGE_OPTION, + FILAMENT_CHANGE_MESSAGE_RESUME, + FILAMENT_CHANGE_MESSAGE_STATUS + }; + void lcd_filament_change_show_message(FilamentChangeMessage message); + #endif // FILAMENT_CHANGE_FEATURE + #else FORCE_INLINE void lcd_buttons_update() {} #endif From 982f10e6a0cb7bc020f68de883e8cc5df34bc929 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Jun 2016 19:24:24 -0700 Subject: [PATCH 234/580] Use STATIC_ITEM for LCD message display --- Marlin/dogm_lcd_implementation.h | 9 +-- Marlin/ultralcd.cpp | 79 ++++++++++++------- .../ultralcd_implementation_hitachi_HD44780.h | 6 +- 3 files changed, 58 insertions(+), 36 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 6813d3a85..ffe6a52ab 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -473,14 +473,14 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { u8g.setPrintPos((START_ROW) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)); } -#if ENABLED(LCD_INFO_MENU) +#if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE) - static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char* valstr=NULL, bool center=false) { + static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char* valstr=NULL, bool center=true) { char c; int8_t n = LCD_WIDTH; u8g.setPrintPos(0, (row + 1) * (DOG_CHAR_HEIGHT)); u8g.setColorIndex(1); // normal text - if (center) { + if (center && !valstr) { int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd_print(' '); n--; } } @@ -495,10 +495,9 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { while (n-- > 0) lcd_print(' '); } -#endif // LCD_INFO_MENU +#endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) { - UNUSED(pstr); UNUSED(pre_char); char c; diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index a495a28a5..cf0b15ff3 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2048,9 +2048,6 @@ static void lcd_status_screen() { #if ENABLED(FILAMENT_CHANGE_FEATURE) - static void lcd_filament_change_nothing() { - } - static void lcd_filament_change_resume_print() { filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_RESUME_PRINT; lcdDrawUpdate = 2; @@ -2063,7 +2060,9 @@ static void lcd_status_screen() { static void lcd_filament_change_option_menu() { START_MENU(); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_HEADER, lcd_filament_change_nothing); + #if LCD_HEIGHT > 2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER); + #endif MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_filament_change_resume_print); MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_EXTRUDE, lcd_filament_change_extrude_more); END_MENU(); @@ -2071,55 +2070,79 @@ static void lcd_status_screen() { static void lcd_filament_change_init_message() { START_MENU(); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_INIT_1, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_INIT_2, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_INIT_3, lcd_filament_change_nothing); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1); + #ifdef MSG_FILAMENT_CHANGE_INIT_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2); + #endif + #ifdef MSG_FILAMENT_CHANGE_INIT_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3); + #endif END_MENU(); } static void lcd_filament_change_unload_message() { START_MENU(); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_UNLOAD_1, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_UNLOAD_2, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_UNLOAD_3, lcd_filament_change_nothing); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1); + #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2); + #endif + #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3); + #endif END_MENU(); } static void lcd_filament_change_insert_message() { START_MENU(); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_INSERT_1, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_INSERT_2, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_INSERT_3, lcd_filament_change_nothing); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1); + #ifdef MSG_FILAMENT_CHANGE_INSERT_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2); + #endif + #ifdef MSG_FILAMENT_CHANGE_INSERT_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3); + #endif END_MENU(); } static void lcd_filament_change_load_message() { START_MENU(); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_LOAD_1, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_LOAD_2, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_LOAD_3, lcd_filament_change_nothing); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1); + #ifdef MSG_FILAMENT_CHANGE_LOAD_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2); + #endif + #ifdef MSG_FILAMENT_CHANGE_LOAD_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3); + #endif END_MENU(); } static void lcd_filament_change_extrude_message() { START_MENU(); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_EXTRUDE_1, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_EXTRUDE_2, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_EXTRUDE_3, lcd_filament_change_nothing); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_1); + #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_2); + #endif + #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_3); + #endif END_MENU(); } static void lcd_filament_change_resume_message() { START_MENU(); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_HEADER, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_RESUME_1, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_RESUME_2, lcd_filament_change_nothing); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_RESUME_3, lcd_filament_change_nothing); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1); + #ifdef MSG_FILAMENT_CHANGE_RESUME_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_2); + #endif + #ifdef MSG_FILAMENT_CHANGE_RESUME_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_3); + #endif END_MENU(); } diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index e9392414a..edb496e2e 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -815,13 +815,13 @@ static void lcd_implementation_status_screen() { lcd_print(lcd_status_message); } -#if ENABLED(LCD_INFO_MENU) +#if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE) static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char *valstr=NULL, bool center=true) { char c; int8_t n = LCD_WIDTH; lcd.setCursor(0, row); - if (center) { + if (center && !valstr) { int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd.print(' '); n--; } } @@ -836,7 +836,7 @@ static void lcd_implementation_status_screen() { while (n-- > 0) lcd.print(' '); } -#endif // LCD_INFO_MENU +#endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) { char c; From a06c5165a7fa7cbfc0b53312e77d184a1de0fbe9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Jun 2016 19:40:46 -0700 Subject: [PATCH 235/580] Shorter strings for smaller LCDs --- Marlin/language_en.h | 133 +++++++++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 56 deletions(-) diff --git a/Marlin/language_en.h b/Marlin/language_en.h index fb21bb03e..aa9a52dfb 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -566,53 +566,8 @@ #ifndef MSG_FILAMENT_CHANGE_HEADER #define MSG_FILAMENT_CHANGE_HEADER "CHANGE FILAMENT" #endif -#ifndef MSG_FILAMENT_CHANGE_INIT_1 - #define MSG_FILAMENT_CHANGE_INIT_1 "Wait for start" -#endif -#ifndef MSG_FILAMENT_CHANGE_INIT_2 - #define MSG_FILAMENT_CHANGE_INIT_2 "of the filament" -#endif -#ifndef MSG_FILAMENT_CHANGE_INIT_3 - #define MSG_FILAMENT_CHANGE_INIT_3 "change" -#endif -#ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 - #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Wait for" -#endif -#ifndef MSG_FILAMENT_CHANGE_UNLOAD_2 - #define MSG_FILAMENT_CHANGE_UNLOAD_2 "filament unload" -#endif -#ifndef MSG_FILAMENT_CHANGE_UNLOAD_3 - #define MSG_FILAMENT_CHANGE_UNLOAD_3 "" -#endif -#ifndef MSG_FILAMENT_CHANGE_INSERT_1 - #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert filament" -#endif -#ifndef MSG_FILAMENT_CHANGE_INSERT_2 - #define MSG_FILAMENT_CHANGE_INSERT_2 "and press button" -#endif -#ifndef MSG_FILAMENT_CHANGE_INSERT_3 - #define MSG_FILAMENT_CHANGE_INSERT_3 "to continue..." -#endif -#ifndef MSG_FILAMENT_CHANGE_LOAD_1 - #define MSG_FILAMENT_CHANGE_LOAD_1 "Wait for" -#endif -#ifndef MSG_FILAMENT_CHANGE_LOAD_2 - #define MSG_FILAMENT_CHANGE_LOAD_2 "filament load" -#endif -#ifndef MSG_FILAMENT_CHANGE_LOAD_3 - #define MSG_FILAMENT_CHANGE_LOAD_3 "" -#endif -#ifndef MSG_FILAMENT_CHANGE_EXTRUDE_1 - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Wait for" -#endif -#ifndef MSG_FILAMENT_CHANGE_EXTRUDE_2 - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "filament extrude" -#endif -#ifndef MSG_FILAMENT_CHANGE_EXTRUDE_3 - #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "" -#endif #ifndef MSG_FILAMENT_CHANGE_OPTION_HEADER - #define MSG_FILAMENT_CHANGE_OPTION_HEADER "WHAT NEXT?" + #define MSG_FILAMENT_CHANGE_OPTION_HEADER "CHANGE OPTIONS:" #endif #ifndef MSG_FILAMENT_CHANGE_OPTION_EXTRUDE #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Extrude more" @@ -620,14 +575,80 @@ #ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME #define MSG_FILAMENT_CHANGE_OPTION_RESUME "Resume print" #endif -#ifndef MSG_FILAMENT_CHANGE_RESUME_1 - #define MSG_FILAMENT_CHANGE_RESUME_1 "Wait for print" -#endif -#ifndef MSG_FILAMENT_CHANGE_RESUME_2 - #define MSG_FILAMENT_CHANGE_RESUME_2 "to resume" -#endif -#ifndef MSG_FILAMENT_CHANGE_RESUME_3 - #define MSG_FILAMENT_CHANGE_RESUME_3 "" -#endif - +#if LCD_HEIGHT >= 4 + #ifndef MSG_FILAMENT_CHANGE_INIT_1 + #define MSG_FILAMENT_CHANGE_INIT_1 "Wait for start" + #endif + #ifndef MSG_FILAMENT_CHANGE_INIT_2 + #define MSG_FILAMENT_CHANGE_INIT_2 "of the filament" + #endif + #ifndef MSG_FILAMENT_CHANGE_INIT_3 + #define MSG_FILAMENT_CHANGE_INIT_3 "change" + #endif + #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Wait for" + #endif + #ifndef MSG_FILAMENT_CHANGE_UNLOAD_2 + #define MSG_FILAMENT_CHANGE_UNLOAD_2 "filament unload" + #endif + #ifndef MSG_FILAMENT_CHANGE_UNLOAD_3 + #define MSG_FILAMENT_CHANGE_UNLOAD_3 "" + #endif + #ifndef MSG_FILAMENT_CHANGE_INSERT_1 + #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert filament" + #endif + #ifndef MSG_FILAMENT_CHANGE_INSERT_2 + #define MSG_FILAMENT_CHANGE_INSERT_2 "and press button" + #endif + #ifndef MSG_FILAMENT_CHANGE_INSERT_3 + #define MSG_FILAMENT_CHANGE_INSERT_3 "to continue..." + #endif + #ifndef MSG_FILAMENT_CHANGE_LOAD_1 + #define MSG_FILAMENT_CHANGE_LOAD_1 "Wait for" + #endif + #ifndef MSG_FILAMENT_CHANGE_LOAD_2 + #define MSG_FILAMENT_CHANGE_LOAD_2 "filament load" + #endif + #ifndef MSG_FILAMENT_CHANGE_LOAD_3 + #define MSG_FILAMENT_CHANGE_LOAD_3 "" + #endif + #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_1 + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Wait for" + #endif + #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_2 + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "filament extrude" + #endif + #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_3 + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "" + #endif + #ifndef MSG_FILAMENT_CHANGE_RESUME_1 + #define MSG_FILAMENT_CHANGE_RESUME_1 "Wait for print" + #endif + #ifndef MSG_FILAMENT_CHANGE_RESUME_2 + #define MSG_FILAMENT_CHANGE_RESUME_2 "to resume" + #endif + #ifndef MSG_FILAMENT_CHANGE_RESUME_3 + #define MSG_FILAMENT_CHANGE_RESUME_3 "" + #endif +#else // LCD_HEIGHT < 4 + #ifndef MSG_FILAMENT_CHANGE_INIT_1 + #define MSG_FILAMENT_CHANGE_INIT_1 "Please wait..." + #endif + #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Ejecting..." + #endif + #ifndef MSG_FILAMENT_CHANGE_INSERT_1 + #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert and Click" + #endif + #ifndef MSG_FILAMENT_CHANGE_LOAD_1 + #define MSG_FILAMENT_CHANGE_LOAD_1 "Loading..." + #endif + #ifndef MSG_FILAMENT_CHANGE_EXTRUDE_1 + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Extruding..." + #endif + #ifndef MSG_FILAMENT_CHANGE_RESUME_1 + #define MSG_FILAMENT_CHANGE_RESUME_1 "Resuming..." + #endif +#endif // LCD_HEIGHT < 4 + #endif // LANGUAGE_EN_H From 95347fc650a259225b65abe17c3ef8f22c2cc4fe Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sun, 3 Jul 2016 09:04:29 +0900 Subject: [PATCH 236/580] Follow-up the PR #3662 (Rewritten FILAMENT_CHANGE_ENABLE feature) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update a forgotten Configuration_adv.h of Cartesio --- .../Cartesio/Configuration_adv.h | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 8b48f00da..d17635221 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -551,16 +551,30 @@ const unsigned int dropsegments = 5; //everything with less than this number of // Add support for experimental filament exchange support M600; requires display #if ENABLED(ULTIPANEL) - //#define FILAMENTCHANGEENABLE - #if ENABLED(FILAMENTCHANGEENABLE) - #define FILAMENTCHANGE_XPOS 30 - #define FILAMENTCHANGE_YPOS 10 - #define FILAMENTCHANGE_ZADD 10 - #define FILAMENTCHANGE_FIRSTRETRACT -1 - //#define FILAMENTCHANGE_FINALRETRACT -100 - //#define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD - //#define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop - //#define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop + // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 30 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 10 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 1 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + //#define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate #endif #endif From 9b42c6b44b172dffcf7bd72abe795d39b1f95de5 Mon Sep 17 00:00:00 2001 From: lrpirlet Date: Sun, 3 Jul 2016 21:43:42 +0200 Subject: [PATCH 237/580] apply correction when swtiching from MBL to physical in G28 X --- Marlin/Marlin_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 59f526f06..d4c353e2f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2770,6 +2770,7 @@ inline void gcode_G28() { current_position[Y_AXIS] - home_offset[Y_AXIS]); } mbl.set_active(false); + current_position[Z_AXIS] = pre_home_z; } #endif From a0b00d29e3a1f71c536a3821bac448248911cea4 Mon Sep 17 00:00:00 2001 From: Anthony Birkett Date: Sat, 2 Jul 2016 14:32:21 +0100 Subject: [PATCH 238/580] Add a ported example configuration for the Velleman K8400 (Vertex) printer. Supports both dual and single head printers (with the correct config). Includes community sourced feed rate fix. Rename / move files. Remove redundant definitions. --- Marlin/boards.h | 3 +- .../K8400/Configuration.h | 1216 +++++++++++++++++ .../K8400/Configuration_adv.h | 750 ++++++++++ .../K8400/Dual Heads/Configuration.h | 1216 +++++++++++++++++ Marlin/example_configurations/K8400/README.md | 15 + Marlin/pins.h | 2 + Marlin/pins_3DRAG.h | 2 +- Marlin/pins_K8400.h | 52 + Marlin/ultralcd_st7920_u8glib_rrd.h | 2 +- 9 files changed, 3255 insertions(+), 3 deletions(-) create mode 100644 Marlin/example_configurations/K8400/Configuration.h create mode 100644 Marlin/example_configurations/K8400/Configuration_adv.h create mode 100644 Marlin/example_configurations/K8400/Dual Heads/Configuration.h create mode 100644 Marlin/example_configurations/K8400/README.md create mode 100644 Marlin/pins_K8400.h diff --git a/Marlin/boards.h b/Marlin/boards.h index ae03bdec7..07ee68a33 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -60,7 +60,8 @@ #define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare) #define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) #define BOARD_3DRAG 77 // 3Drag Controller -#define BOARD_K8200 78 // Vellemann K8200 Controller (derived from 3Drag Controller) +#define BOARD_K8200 78 // Velleman K8200 Controller (derived from 3Drag Controller) +#define BOARD_K8400 79 // Velleman K8400 Controller (derived from 3Drag Controller) #define BOARD_TEENSYLU 8 // Teensylu #define BOARD_RUMBA 80 // Rumba #define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286) diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h new file mode 100644 index 000000000..a7c61de56 --- /dev/null +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -0,0 +1,1216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration.h + * + * Basic settings such as: + * + * - Type of electronics + * - Type of temperature sensor + * - Printer geometry + * - Endstop configuration + * - LCD controller + * - Extra features + * + * Advanced settings can be found in Configuration_adv.h + * + */ +#ifndef CONFIGURATION_H +#define CONFIGURATION_H + +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + +#include "boards.h" +#include "macros.h" + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer replace the configuration files with the files in the +// example_configurations/delta directory. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a Scara printer replace the configuration files with the files in the +// example_configurations/SCARA directory. +// + +// @section info + +#if ENABLED(USE_AUTOMATIC_VERSIONING) + #include "_Version.h" +#else + #include "Version.h" +#endif + +// User-specified version info of this build to display in [Pronterface, etc] terminal window during +// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this +// build by the user have been successfully uploaded into firmware. +#define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. +#define SHOW_BOOTSCREEN +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 +//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 + +// @section machine + +// SERIAL_PORT selects which serial port should be used for communication with the host. +// This allows the connection of wireless adapters (for instance) to non-default port pins. +// Serial port 0 is still used by the Arduino bootloader regardless of this setting. +// :[0,1,2,3,4,5,6,7] +#define SERIAL_PORT 0 + +// This determines the communication speed of the printer +// :[2400,9600,19200,38400,57600,115200,250000] +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// The following define selects which electronics board you have. +// Please choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_K8400 +#endif + +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) +// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// This defines the number of extruders +// :[1,2,3,4] +#define EXTRUDERS 1 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis + +//// The following define selects which power supply you have. Please choose the one that matches your setup +// 1 = ATX +// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) +// :{1:'ATX',2:'X-Box 360'} + +#define POWER_SUPPLY 1 + +// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. +//#define PS_DEFAULT_OFF + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== +// +//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table +// +//// Temperature sensor settings: +// -3 is thermocouple with MAX31855 (only for sensor 0) +// -2 is thermocouple with MAX6675 (only for sensor 0) +// -1 is thermocouple with AD595 +// 0 is not used +// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup) +// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) +// 3 is Mendel-parts thermistor (4.7k pullup) +// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! +// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) +// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) +// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) +// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) +// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) +// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) +// 10 is 100k RS thermistor 198-961 (4.7k pullup) +// 11 is 100k beta 3950 1% thermistor (4.7k pullup) +// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 20 is the PT100 circuit found in the Ultimainboard V2.x +// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 70 is the 100K thermistor found in the bq Hephestos 2 +// +// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k +// (but gives greater accuracy and more stable PID) +// 51 is 100k thermistor - EPCOS (1k pullup) +// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup) +// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) +// +// 1047 is Pt1000 with 4k7 pullup +// 1010 is Pt1000 with 1k pullup (non standard) +// 147 is Pt100 with 4k7 pullup +// 110 is Pt100 with 1k pullup (non standard) +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// Use it for Testing or Development purposes. NEVER for production machine. +//#define DUMMY_THERMISTOR_998_VALUE 25 +//#define DUMMY_THERMISTOR_999_VALUE 100 +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +#define TEMP_SENSOR_0 5 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_BED 0 + +// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +// Extruder temperature must be close to target for this long before M109 returns success +#define TEMP_RESIDENCY_TIME 2 // (seconds) +#define TEMP_HYSTERESIS 5 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// Bed temperature must be close to target for this long before M190 returns success +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) +#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// The minimal temperature defines the temperature below which the heater will not be enabled It is used +// to check that the wiring to the thermistor is not broken. +// Otherwise this would lead to the heater being powered on all the time. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define BED_MINTEMP 5 + +// When temperature exceeds max temp, your heater will be switched off. +// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +// You should use MINTEMP for thermistor short/failure protection. +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define BED_MAXTEMP 150 + +// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#if ENABLED(PIDTEMP) + //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term + #define K1 0.95 //smoothing factor within the PID + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + #define DEFAULT_Kp 63.0 + #define DEFAULT_Ki 2.25 + #define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//============================= PID > Bed Temperature Control =============== +//=========================================================================== +// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis +// +// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, +// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. +// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. +// If your configuration is significantly different than this and you don't understand the issues involved, you probably +// shouldn't use bed PID until someone else verifies your hardware works. +// If this is enabled, find your own PID constants below. +//#define PIDTEMPBED + +//#define BED_LIMIT_SWITCHING + +// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option. +// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis) +// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did, +// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED) +#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current + +#if ENABLED(PIDTEMPBED) + + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit +//can be software-disabled for whatever purposes by +#define PREVENT_DANGEROUS_EXTRUDE +//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately. +#define PREVENT_LENGTHY_EXTRUDE + +#define EXTRUDE_MINTEMP 160 +#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances. + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection protects your printer from damage and fire if a + * thermistor falls out or temperature sensors fail in any way. + * + * The issue: If a thermistor falls out or a temperature sensor fails, + * Marlin can no longer sense the actual temperature. Since a disconnected + * thermistor reads as a low temperature, the firmware will keep the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +//#define COREXY +//#define COREXZ +//#define COREYZ + +// Enable this option for Toshiba steppers +//#define CONFIG_STEPPERS_TOSHIBA + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + +#if DISABLED(ENDSTOPPULLUPS) + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. + +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== + +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. +// +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. + +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{0:'Low',1:'High'} +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR true +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false + +// @section homing +//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure you have this distance over your Z_MAX_POS in case. + +// ENDSTOP SETTINGS: +// Sets direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. +#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. + +// @section machine + +// Travel limits after homing (units are in mm) +#define X_MIN_POS 0 +#define Y_MIN_POS 20 +#define Z_MIN_POS 0 +#define X_MAX_POS 200 +#define Y_MAX_POS 200 +#define Z_MAX_POS 190 + +//=========================================================================== +//========================= Filament Runout Sensor ========================== +//=========================================================================== +//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament + // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. + // It is assumed that when logic high = filament available + // when logic low = filament ran out +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + +//=========================================================================== +//============================ Mesh Bed Leveling ============================ +//=========================================================================== + +//#define MESH_BED_LEVELING // Enable mesh bed leveling. + +#if ENABLED(MESH_BED_LEVELING) + #define MESH_INSET 10 // Mesh inset margin on print area + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_Y_POINTS 3 + #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0] + + //#define MANUAL_BED_LEVELING // Add display menu option for bed leveling. + + #if ENABLED(MANUAL_BED_LEVELING) + #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. + #endif // MANUAL_BED_LEVELING + +#endif // MESH_BED_LEVELING + +//=========================================================================== +//============================ Bed Auto Leveling ============================ +//=========================================================================== + +// @section bedlevel + +//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) +//#define DEBUG_LEVELING_FEATURE + +#if ENABLED(AUTO_BED_LEVELING_FEATURE) + + // There are 2 different ways to specify probing locations: + // + // - "grid" mode + // Probe several points in a rectangular grid. + // You specify the rectangle and the density of sample points. + // This mode is preferred because there are more measurements. + // + // - "3-point" mode + // Probe 3 arbitrary points on the bed (that aren't collinear) + // You specify the XY coordinates of all 3 points. + + // Enable this to sample the bed in a grid (least squares solution). + // Note: this feature generates 10KB extra code size. + #define AUTO_BED_LEVELING_GRID + + #if ENABLED(AUTO_BED_LEVELING_GRID) + + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this. + + // Set the number of grid points per dimension. + // You probably don't need more than 3 (squared=9). + #define AUTO_BED_LEVELING_GRID_POINTS 2 + + #else // !AUTO_BED_LEVELING_GRID + + // Arbitrary points to probe. + // A simple cross-product is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 15 + #define ABL_PROBE_PT_1_Y 180 + #define ABL_PROBE_PT_2_X 15 + #define ABL_PROBE_PT_2_Y 20 + #define ABL_PROBE_PT_3_X 170 + #define ABL_PROBE_PT_3_Y 20 + + #endif // !AUTO_BED_LEVELING_GRID + + //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. + // Useful to retract a deployable Z probe. + + // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, + // it is highly recommended you also enable Z_SAFE_HOMING below! + +#endif // AUTO_BED_LEVELING_FEATURE + + +// @section homing + +// The position of the homing switches +//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used +//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) + +// Manual homing switch locations: +// For deltabots this means top and center of the Cartesian print volume. +#if ENABLED(MANUAL_HOME_POSITIONS) + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). +#endif + + +// @section motion + +/** + * MOVEMENT SETTINGS + */ + +#define HOMING_FEEDRATE {50*60, 50*60, 8*60, 0} // set the homing speeds (mm/min) + +// default settings + +#define DEFAULT_AXIS_STEPS_PER_UNIT {134.74,134.74,4266.66,148.7} // default steps per unit for Ultimaker +#define DEFAULT_MAX_FEEDRATE {160, 160, 10, 10000} // (mm/sec) +#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. + +#define DEFAULT_ACCELERATION 6000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 6000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + +// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) +#define DEFAULT_XYJERK 10.0 // (mm/sec) +#define DEFAULT_ZJERK 0.5 // (mm/sec) +#define DEFAULT_EJERK 20.0 // (mm/sec) + + +//============================================================================= +//============================= Additional Features =========================== +//============================================================================= + +// @section extras + +// +// EEPROM +// +// The microcontroller can store settings in the EEPROM, e.g. max velocity... +// M500 - stores parameters in EEPROM +// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). +// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. +//define this to enable EEPROM support +#define EEPROM_SETTINGS + +#if ENABLED(EEPROM_SETTINGS) + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // Please keep turned on if you can. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PLA_PREHEAT_HOTEND_TEMP 210 +#define PLA_PREHEAT_HPB_TEMP 0 +#define PLA_PREHEAT_FAN_SPEED 165 // Insert Value between 0 and 255 + +#define ABS_PREHEAT_HOTEND_TEMP 245 +#define ABS_PREHEAT_HPB_TEMP 0 +#define ABS_PREHEAT_FAN_SPEED 165 // Insert Value between 0 and 255 + +// +// Print job timer +// +// Enable this option to automatically start and stop the +// print job timer when M104 and M109 commands are received. +// +// In all cases the timer can be started and stopped using +// the following commands: +// +// - M75 - Start the print job timer +// - M76 - Pause the print job timer +// - M77 - Stop the print job timer +#define PRINTJOB_TIMER_AUTOSTART + +// +// Print Counter +// +// When enabled Marlin will keep track of some print statistical data such as: +// - Total print jobs +// - Total successful print jobs +// - Total failed print jobs +// - Total time printing +// +// This information can be viewed by the M78 command. +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +// +// LCD LANGUAGE +// +// Here you may choose the language used by Marlin on the LCD menus, the following +// list of languages are available: +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// +#define LCD_LANGUAGE en + +// +// LCD Character Set +// +// Note: This option is NOT applicable to Graphical Displays. +// +// All character-based LCD's provide ASCII plus one of these +// language extensions: +// +// - JAPANESE ... the most common +// - WESTERN ... with more accented characters +// - CYRILLIC ... for the Russian language +// +// To determine the language extension installed on your controller: +// +// - Compile and upload with LCD_LANGUAGE set to 'test' +// - Click the controller to view the LCD menu +// - The LCD will display Japanese, Western, or Cyrillic text +// +// See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language +// +// :['JAPANESE','WESTERN','CYRILLIC'] +// +#define DISPLAY_CHARSET_HD44780 JAPANESE + +// +// LCD TYPE +// +// You may choose ULTRA_LCD if you have character based LCD with 16x2, 16x4, 20x2, +// 20x4 char/lines or DOGLCD for the full graphics display with 128x64 pixels +// (ST7565R family). (This option will be set automatically for certain displays.) +// +// IMPORTANT NOTE: The U8glib library is required for Full Graphic Display! +// https://github.com/olikraus/U8glib_Arduino +// +#define ULTRA_LCD // Character based +//#define DOGLCD // Full graphics display + +// +// SD CARD +// +// SD Card support is disabled by default. If your controller has an SD slot, +// you must uncomment the following option or it won't work. +// +#define SDSUPPORT + +// +// SD CARD: SPI SPEED +// +// Uncomment ONE of the following items to use a slower SPI transfer +// speed. This is usually required if you're getting volume init errors. +// +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +// +// SD CARD: ENABLE CRC +// +// Use CRC checks and retries on the SD communication. +// +//#define SD_CHECK_AND_RETRY + +// +// ENCODER SETTINGS +// +// This option overrides the default number of encoder pulses needed to +// produce one step. Should be increased for high-resolution encoders. +// +#define ENCODER_PULSES_PER_STEP 4 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +#define REVERSE_MENU_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 +//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 + +// +// CONTROLLER TYPE: Standard +// +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. +// + +// +// ULTIMAKER Controller. +// +#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// MaKr3d Makr-Panel with graphic controller and SD support. +// http://reprap.org/wiki/MaKr3d_MaKrPanel +// +//#define MAKRPANEL + +// +// Activate one of these if you have a Panucatt Devices +// Viki 2.0 or mini Viki with Graphic LCD +// http://panucatt.com +// +//#define VIKI2 +//#define miniVIKI + +// +// Adafruit ST7565 Full Graphic Controller. +// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ +// +//#define ELB_FULL_GRAPHIC_CONTROLLER + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + +// +// MakerLab Mini Panel with graphic +// controller and SD support - http://reprap.org/wiki/Mini_panel +// +//#define MINIPANEL + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key +// is pressed, a value of 10.0 means 10mm per click. +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#define RIGIDBOT_PANEL + +// +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. +// +//#define BQ_LCD_SMART_CONTROLLER + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart YW Robot (LCM1602) LCD Display +// +//#define LCD_I2C_SAINSMART_YWROBOT + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + //#define U8GLIB_SSD1306 + #define U8GLIB_SH1106 +#endif + +// +// CONTROLLER TYPE: Shift register panels +// +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +#define SOFT_PWM_SCALE 0 + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. +// Otherwise the RED led is on. There is 1C hysteresis. +//#define TEMP_STAT_LEDS + +// M240 Triggers a camera by emulating a Canon RC-1 Remote +// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ +//#define PHOTOGRAPH_PIN 23 + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder. +//#define BARICUDA + +//define BlinkM/CyzRgb Support +//#define BLINKM + +/*********************************************************************\ +* R/C SERVO support +* Sponsored by TrinityLabs, Reworked by codexmas +**********************************************************************/ + +// Number of servos +// +// If you select a configuration below, this will receive a default value and does not need to be set manually +// set it manually if you have more servos than extruders and wish to manually control some +// leaving it undefined or defining as 0 will disable the servo subsystem +// If unsure, leave commented / disabled +// +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +/**********************************************************************\ + * Support for a filament diameter sensor + * Also allows adjustment of diameter at print time (vs at slicing) + * Single extruder only at this point (extruder 0) + * + * Motherboards + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 - Rambo - uses Analog input 3 + * Note may require analog pins to be defined for different motherboards + **********************************************************************/ +// Uncomment below to enable +//#define FILAMENT_WIDTH_SENSOR + +#define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) + #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel + + #define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm + #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm + #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially + + //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. + //#define FILAMENT_LCD_DISPLAY +#endif + +#include "Configuration_adv.h" +#include "thermistortables.h" + +#endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h new file mode 100644 index 000000000..29b759d17 --- /dev/null +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -0,0 +1,750 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#ifndef CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H + +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_ADV_H_VERSION 010100 + +#include "Conditionals.h" + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 1000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 1 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection protects your printer from damage and fire if a + * thermistor falls out or temperature sensors fail in any way. + * + * The issue: If a thermistor falls out or a temperature sensor fails, + * Marlin can no longer sense the actual temperature. Since a disconnected + * thermistor reads as a low temperature, the firmware will keep the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too long (period), + * the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway" increase THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + /** + * Whenever an M104 or M109 increases the target temperature the firmware will wait for the + * WATCH_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE + * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, + * but only if the current temperature is far enough below the target for a reliable test. + * + * If you get false positives for "Heating failed" increase WATCH_TEMP_PERIOD and/or decrease WATCH_TEMP_INCREASE + * WATCH_TEMP_INCREASE should not be below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * Whenever an M140 or M190 increases the target temperature the firmware will wait for the + * WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE + * degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190, + * but only if the current temperature is far enough below the target for a reliable test. + * + * If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease + * WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.) + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // this adds an experimental additional term to the heating power, proportional to the extrusion speed. + // if Kc is chosen well, the additional required power due to increased melting should be compensated. + #define PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +//Show Temperature ADC value +//The M105 command return, besides traditional information, the ADC value read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +// @section extruder + +// extruder run-out prevention. +//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded +//#define EXTRUDER_RUNOUT_PREVENT +#define EXTRUDER_RUNOUT_MINTEMP 190 +#define EXTRUDER_RUNOUT_SECONDS 30 +#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament +#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed +#define EXTRUDER_RUNOUT_EXTRUDE 100 + +// @section temperature + +//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements. +//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET" +#define TEMP_SENSOR_AD595_OFFSET 0.0 +#define TEMP_SENSOR_AD595_GAIN 1.0 + +//This is for controlling a fan to cool down the stepper drivers +//it will turn on when any driver is enabled +//and turn off after the set amount of seconds from last driver being disabled again +#define CONTROLLERFAN_PIN 2 //Pin used for the fan to cool controller (-1 to disable) +#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run +#define CONTROLLERFAN_SPEED 255 // == full speed + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// This defines the minimal speed for the main fan, run in PWM mode +// to enable uncomment and set minimal PWM speed for reliable running (1-255) +// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM +//#define FAN_MIN_PWM 50 + +// @section extruder + +// Extruder cooling fans +// Configure fan pin outputs to automatically turn on/off when the associated +// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. +// Multiple extruders can be assigned to the same pin in which case +// the fan will turn on when any selected extruder is above the threshold. +#define EXTRUDER_0_AUTO_FAN_PIN -1 +#define EXTRUDER_1_AUTO_FAN_PIN -1 +#define EXTRUDER_2_AUTO_FAN_PIN -1 +#define EXTRUDER_3_AUTO_FAN_PIN -1 +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed + + +//=========================================================================== +//=============================Mechanical Settings=========================== +//=========================================================================== + +// @section homing + +#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// A single Z stepper driver is usually used to drive 2 stepper motors. +// Uncomment this define to utilize a separate stepper driver for each Z axis motor. +// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used +// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. +// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +//#define Z_DUAL_STEPPER_DRIVERS + +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + + // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // There is also an implementation of M666 (software endstops adjustment) to this feature. + // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. + // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. + // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive. + // Play a little bit with small adjustments (0.5mm) and check the behaviour. + // The M119 (endstops report) will start reporting the Z2 Endstop as well. + + //#define Z_DUAL_ENDSTOPS + + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #endif + +#endif // Z_DUAL_STEPPER_DRIVERS + +// Same again but for Y Axis. +//#define Y_DUAL_STEPPER_DRIVERS + +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Define if the two Y drives need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + +// Enable this for dual x-carriage printers. +// A dual x-carriage design has the advantage that the inactive extruder can be parked which +// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage +// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug. +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + // Configuration for second X-carriage + // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; + // the second x-carriage always homes to the maximum endstop. + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + + // Default settings in "Auto-park Mode" + #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder + #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif //DUAL_X_CARRIAGE + +// @section homing + +//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: +#define X_HOME_BUMP_MM 10 +#define Y_HOME_BUMP_MM 10 +#define Z_HOME_BUMP_MM 3 +#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. + +// When G28 is called, this option will make Y home before X +//#define HOME_Y_BEFORE_X + +// @section machine + +#define AXIS_RELATIVE_MODES {false, false, false, false} + +//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +// @section lcd + +#if ENABLED(ULTIPANEL) + #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel + #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder +#endif + +// @section extras + +// minimum time in microseconds that a movement needs to take if the buffer is emptied. +#define DEFAULT_MINSEGMENTTIME 20000 + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec) + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] + +// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards) +#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) + +// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current) +//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps + +// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro +//#define DIGIPOT_I2C +// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8 +#define DIGIPOT_I2C_NUM_CHANNELS 8 +// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS +#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0} + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value + +//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ +#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again + +// @section lcd + +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. + + #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. + // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. + // using: + //#define MENU_ADDAUTOSTART + + // Show a progress bar on HD44780 LCDs for SD printing + //#define LCD_PROGRESS_BAR + + #if ENABLED(LCD_PROGRESS_BAR) + // Amount of time (ms) to show the bar + #define PROGRESS_BAR_BAR_TIME 2000 + // Amount of time (ms) to show the status message + #define PROGRESS_BAR_MSG_TIME 3000 + // Amount of time (ms) to retain the status message (0=forever) + #define PROGRESS_MSG_EXPIRE 0 + // Enable this to show messages for MSG_TIME then hide them + //#define PROGRESS_MSG_ONCE + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // This option allows you to abort SD printing when any endstop is triggered. + // This feature must be enabled with "M540 S1" or from the LCD menu. + // To have any effect, endstops must be enabled during SD printing. + // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. + //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + +#endif // SDSUPPORT + +// for dogm lcd displays you can choose some additional fonts: +#if ENABLED(DOGLCD) + // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT + // we don't have a big font for Cyrillic, Kana + //#define USE_BIG_EDIT_FONT + + // If you have spare 2300Byte of progmem and want to use a + // smaller font on the Info-screen uncomment the next line. + //#define USE_SMALL_INFOFONT +#endif // DOGLCD + +// @section safety + +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. +#define USE_WATCHDOG + +#if ENABLED(USE_WATCHDOG) + // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. + // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. + // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process +// it can e.g. be used to change z-positions in the print startup phase in real-time +// does not respect endstops! +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions + //not implemented for deltabots! + #define BABYSTEP_INVERT_Z false //true for inverse movements in Z + #define BABYSTEP_MULTIPLICATOR 1 //faster movements +#endif + +// @section extruder + +// extruder advance constant (s2/mm3) +// +// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2 +// +// Hooke's law says: force = k * distance +// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant +// so: v ^ 2 is proportional to number of steps we advance the extruder +//#define ADVANCE + +#if ENABLED(ADVANCE) + #define EXTRUDER_ADVANCE_K .0 + #define D_FILAMENT 2.85 +#endif + +// Implementation of a linear pressure control +// Assumption: advance = k * (delta velocity) +// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75 +//#define LIN_ADVANCE + +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 75 +#endif + +// @section leveling + +// Default mesh area is an area with an inset margin on the print area. +// Below are the macros that are used to define the borders for the mesh area, +// made available here for specialized needs, ie dual extruder setup. +#if ENABLED(MESH_BED_LEVELING) + #define MESH_MIN_X (X_MIN_POS + MESH_INSET) + #define MESH_MAX_X (X_MAX_POS - (MESH_INSET)) + #define MESH_MIN_Y (Y_MIN_POS + MESH_INSET) + #define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET)) +#endif + +// @section extras + +// Arc interpretation settings: +#define ARC_SUPPORT // Disabling this saves ~2738 bytes +#define MM_PER_ARC_SEGMENT 1 +#define N_ARC_CORRECTION 25 + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// 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 ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 26 + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// @section fwretract + +// Firmware based and LCD controlled retract +// M207 and M208 can be used to define parameters for the retraction. +// The retraction can be called by the slicer using G10 and G11 +// until then, intended retractions can be detected by moves that only extrude and the direction. +// the moves are than replaced by the firmware controlled ones. + +//#define FWRETRACT //ONLY PARTIALLY TESTED +#if ENABLED(FWRETRACT) + #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt + #define RETRACT_LENGTH 3 //default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change + #define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s) + #define RETRACT_ZLIFT 0 //default retract Z-lift + #define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change) + #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) +#endif + +// Add support for experimental filament exchange support M600; requires display +#if ENABLED(ULTIPANEL) + #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too) + #if ENABLED(FILAMENT_CHANGE_FEATURE) + #define FILAMENT_CHANGE_X_POS 100 // X position of hotend + #define FILAMENT_CHANGE_Y_POS 100 // Y position of hotend + #define FILAMENT_CHANGE_Z_ADD 20 // Z addition of hotend (lift) + #define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) + #define FILAMENT_CHANGE_RETRACT_LENGTH 5 // Initial retract in mm + // It is a short retract used immediately after print interrupt before move to filament exchange position + #define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s + #define FILAMENT_CHANGE_UNLOAD_LENGTH 600 // Unload filament length from hotend in mm + // Longer length for bowden printers to unload filament from whole bowden tube, + // shorter lenght for printers without bowden to unload filament from extruder only, + // 0 to disable unloading for manual unloading + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast + #define FILAMENT_CHANGE_LOAD_LENGTH 600 // Load filament length over hotend in mm + // Longer length for bowden printers to fast load filament into whole bowden tube over the hotend, + // Short or zero length for printers without bowden where loading is not used + #define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast + #define FILAMENT_CHANGE_EXTRUDE_LENGTH 100 // Extrude filament length in mm after filament is load over the hotend, + // 0 to disable for manual extrusion + // Filament can be extruded repeatedly from the filament exchange menu to fill the hotend, + // or until outcoming filament color is not clear for filament color change + #define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate + #endif +#endif + +/******************************************************************************\ + * enable this section if you have TMC26X motor drivers. + * you need to import the TMC26XStepper library into the Arduino IDE for this + ******************************************************************************/ + +// @section tmc + +//#define HAVE_TMCDRIVER +#if ENABLED(HAVE_TMCDRIVER) + + //#define X_IS_TMC + #define X_MAX_CURRENT 1000 //in mA + #define X_SENSE_RESISTOR 91 //in mOhms + #define X_MICROSTEPS 16 //number of microsteps + + //#define X2_IS_TMC + #define X2_MAX_CURRENT 1000 //in mA + #define X2_SENSE_RESISTOR 91 //in mOhms + #define X2_MICROSTEPS 16 //number of microsteps + + //#define Y_IS_TMC + #define Y_MAX_CURRENT 1000 //in mA + #define Y_SENSE_RESISTOR 91 //in mOhms + #define Y_MICROSTEPS 16 //number of microsteps + + //#define Y2_IS_TMC + #define Y2_MAX_CURRENT 1000 //in mA + #define Y2_SENSE_RESISTOR 91 //in mOhms + #define Y2_MICROSTEPS 16 //number of microsteps + + //#define Z_IS_TMC + #define Z_MAX_CURRENT 1000 //in mA + #define Z_SENSE_RESISTOR 91 //in mOhms + #define Z_MICROSTEPS 16 //number of microsteps + + //#define Z2_IS_TMC + #define Z2_MAX_CURRENT 1000 //in mA + #define Z2_SENSE_RESISTOR 91 //in mOhms + #define Z2_MICROSTEPS 16 //number of microsteps + + //#define E0_IS_TMC + #define E0_MAX_CURRENT 1000 //in mA + #define E0_SENSE_RESISTOR 91 //in mOhms + #define E0_MICROSTEPS 16 //number of microsteps + + //#define E1_IS_TMC + #define E1_MAX_CURRENT 1000 //in mA + #define E1_SENSE_RESISTOR 91 //in mOhms + #define E1_MICROSTEPS 16 //number of microsteps + + //#define E2_IS_TMC + #define E2_MAX_CURRENT 1000 //in mA + #define E2_SENSE_RESISTOR 91 //in mOhms + #define E2_MICROSTEPS 16 //number of microsteps + + //#define E3_IS_TMC + #define E3_MAX_CURRENT 1000 //in mA + #define E3_SENSE_RESISTOR 91 //in mOhms + #define E3_MICROSTEPS 16 //number of microsteps + +#endif + +/******************************************************************************\ + * enable this section if you have L6470 motor drivers. + * you need to import the L6470 library into the Arduino IDE for this + ******************************************************************************/ + +// @section l6470 + +//#define HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) + + //#define X_IS_L6470 + #define X_MICROSTEPS 16 //number of microsteps + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define X2_IS_L6470 + #define X2_MICROSTEPS 16 //number of microsteps + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Y_IS_L6470 + #define Y_MICROSTEPS 16 //number of microsteps + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Z_IS_L6470 + #define Z_MICROSTEPS 16 //number of microsteps + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Z2_IS_L6470 + #define Z2_MICROSTEPS 16 //number of microsteps + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define E0_IS_L6470 + #define E0_MICROSTEPS 16 //number of microsteps + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define E1_IS_L6470 + #define E1_MICROSTEPS 16 //number of microsteps + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define E2_IS_L6470 + #define E2_MICROSTEPS 16 //number of microsteps + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define E3_IS_L6470 + #define E3_MICROSTEPS 16 //number of microsteps + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high + #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off + #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall + +#endif + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M155 commands with one B arg + * M155 A99 ; Target slave address + * M155 B77 ; M + * M155 B97 ; a + * M155 B114 ; r + * M155 B108 ; l + * M155 B105 ; i + * M155 B110 ; n + * M155 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M156 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M156 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS + +#include "Conditionals.h" +#include "SanityCheck.h" + +#endif //CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h new file mode 100644 index 000000000..c244ea043 --- /dev/null +++ b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h @@ -0,0 +1,1216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Configuration.h + * + * Basic settings such as: + * + * - Type of electronics + * - Type of temperature sensor + * - Printer geometry + * - Endstop configuration + * - LCD controller + * - Extra features + * + * Advanced settings can be found in Configuration_adv.h + * + */ +#ifndef CONFIGURATION_H +#define CONFIGURATION_H + +/** + * + * *********************************** + * ** ATTENTION TO ALL DEVELOPERS ** + * *********************************** + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option. + * + * Note: Update also Version.h ! + */ +#define CONFIGURATION_H_VERSION 010100 + +#include "boards.h" +#include "macros.h" + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer replace the configuration files with the files in the +// example_configurations/delta directory. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a Scara printer replace the configuration files with the files in the +// example_configurations/SCARA directory. +// + +// @section info + +#if ENABLED(USE_AUTOMATIC_VERSIONING) + #include "_Version.h" +#else + #include "Version.h" +#endif + +// User-specified version info of this build to display in [Pronterface, etc] terminal window during +// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this +// build by the user have been successfully uploaded into firmware. +#define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. +#define SHOW_BOOTSCREEN +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 +//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 + +// @section machine + +// SERIAL_PORT selects which serial port should be used for communication with the host. +// This allows the connection of wireless adapters (for instance) to non-default port pins. +// Serial port 0 is still used by the Arduino bootloader regardless of this setting. +// :[0,1,2,3,4,5,6,7] +#define SERIAL_PORT 0 + +// This determines the communication speed of the printer +// :[2400,9600,19200,38400,57600,115200,250000] +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// The following define selects which electronics board you have. +// Please choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_K8400 +#endif + +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) +// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// This defines the number of extruders +// :[1,2,3,4] +#define EXTRUDERS 2 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis + +//// The following define selects which power supply you have. Please choose the one that matches your setup +// 1 = ATX +// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) +// :{1:'ATX',2:'X-Box 360'} + +#define POWER_SUPPLY 1 + +// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. +//#define PS_DEFAULT_OFF + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== +// +//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table +// +//// Temperature sensor settings: +// -3 is thermocouple with MAX31855 (only for sensor 0) +// -2 is thermocouple with MAX6675 (only for sensor 0) +// -1 is thermocouple with AD595 +// 0 is not used +// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup) +// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) +// 3 is Mendel-parts thermistor (4.7k pullup) +// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! +// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup) +// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) +// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) +// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) +// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) +// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) +// 10 is 100k RS thermistor 198-961 (4.7k pullup) +// 11 is 100k beta 3950 1% thermistor (4.7k pullup) +// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) +// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" +// 20 is the PT100 circuit found in the Ultimainboard V2.x +// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 70 is the 100K thermistor found in the bq Hephestos 2 +// +// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k +// (but gives greater accuracy and more stable PID) +// 51 is 100k thermistor - EPCOS (1k pullup) +// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup) +// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) +// +// 1047 is Pt1000 with 4k7 pullup +// 1010 is Pt1000 with 1k pullup (non standard) +// 147 is Pt100 with 4k7 pullup +// 110 is Pt100 with 1k pullup (non standard) +// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. +// Use it for Testing or Development purposes. NEVER for production machine. +//#define DUMMY_THERMISTOR_998_VALUE 25 +//#define DUMMY_THERMISTOR_999_VALUE 100 +// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +#define TEMP_SENSOR_0 5 +#define TEMP_SENSOR_1 5 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_BED 0 + +// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +// Extruder temperature must be close to target for this long before M109 returns success +#define TEMP_RESIDENCY_TIME 2 // (seconds) +#define TEMP_HYSTERESIS 5 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// Bed temperature must be close to target for this long before M190 returns success +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) +#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// The minimal temperature defines the temperature below which the heater will not be enabled It is used +// to check that the wiring to the thermistor is not broken. +// Otherwise this would lead to the heater being powered on all the time. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define BED_MINTEMP 5 + +// When temperature exceeds max temp, your heater will be switched off. +// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +// You should use MINTEMP for thermistor short/failure protection. +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define BED_MAXTEMP 150 + +// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS +//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R +//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#if ENABLED(PIDTEMP) + //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term + #define K1 0.95 //smoothing factor within the PID + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + #define DEFAULT_Kp 63.0 + #define DEFAULT_Ki 2.25 + #define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//============================= PID > Bed Temperature Control =============== +//=========================================================================== +// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis +// +// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder. +// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz, +// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating. +// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. +// If your configuration is significantly different than this and you don't understand the issues involved, you probably +// shouldn't use bed PID until someone else verifies your hardware works. +// If this is enabled, find your own PID constants below. +//#define PIDTEMPBED + +//#define BED_LIMIT_SWITCHING + +// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option. +// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis) +// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did, +// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED) +#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current + +#if ENABLED(PIDTEMPBED) + + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit +//can be software-disabled for whatever purposes by +#define PREVENT_DANGEROUS_EXTRUDE +//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately. +#define PREVENT_LENGTHY_EXTRUDE + +#define EXTRUDE_MINTEMP 160 +#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances. + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection protects your printer from damage and fire if a + * thermistor falls out or temperature sensors fail in any way. + * + * The issue: If a thermistor falls out or a temperature sensor fails, + * Marlin can no longer sense the actual temperature. Since a disconnected + * thermistor reads as a low temperature, the firmware will keep the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +//#define COREXY +//#define COREXZ +//#define COREYZ + +// Enable this option for Toshiba steppers +//#define CONFIG_STEPPERS_TOSHIBA + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// coarse Endstop Settings +#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors + +#if DISABLED(ENDSTOPPULLUPS) + // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. + +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== + +// +// Probe Type +// Probes are sensors/switches that are activated / deactivated before/after use. +// +// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. +// You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. +// +// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. +// + +// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. +// For example an inductive probe, or a setup that uses the nozzle to probe. +// An inductive probe must be deactivated to go below +// its trigger-point if hardware endstops are active. +//#define FIX_MOUNTED_PROBE + +// Z Servo Probe, such as an endstop switch on a rotating arm. +//#define Z_ENDSTOP_SERVO_NR 0 +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// Z Probe to nozzle (X,Y) offset, relative to (0, 0). +// X and Y offsets must be integers. +// +// In the following example the X and Y offsets are both positive: +// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 +// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 +// +// +-- BACK ---+ +// | | +// L | (+) P | R <-- probe (20,20) +// E | | I +// F | (-) N (+) | G <-- nozzle (10,10) +// T | | H +// | (-) | T +// | | +// O-- FRONT --+ +// (0,0) +#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + +// +// Allen Key Probe is defined in the Delta example configurations. +// + +// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. +// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. +// +// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** +// +// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. +// Example: To park the head outside the bed area when homing with G28. +// +// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. +// +// For a servo-based Z probe, you must set up servo support below, including +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. +// +// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. +// - Use 5V for powered (usu. inductive) sensors. +// - Otherwise connect: +// - normally-closed switches to GND and D32. +// - normally-open switches to 5V and D32. +// +// Normally-closed switches are advised and are the default. +// +// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) +// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the +// default pin for all RAMPS-based boards. Some other boards map differently. +// To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. +// +// WARNING: +// Setting the wrong pin may have unexpected and potentially disastrous consequences. +// Use with caution and do your homework. +// +//#define Z_MIN_PROBE_ENDSTOP + +// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. +// The Z_MIN_PIN will then be used for both Z-homing and probing. +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +// To use a probe you must enable one of the two options above! + +// This option disables the use of the Z_MIN_PROBE_PIN +// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a +// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. +// If you're using the Z MIN endstop connector for your Z probe, this has no effect. +//#define DISABLE_Z_MIN_PROBE_ENDSTOP + +// Enable Z Probe Repeatability test to see how accurate your probe is +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// +// Probe Raise options provide clearance for the probe to deploy, stow, and travel. +// +#define Z_RAISE_PROBE_DEPLOY_STOW 15 // Raise to make room for the probe to deploy / stow +#define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. + +// +// For M851 give a range for adjusting the Z probe offset +// +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{0:'Low',1:'High'} +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR true +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false + +// @section homing +//#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure you have this distance over your Z_MAX_POS in case. + +// ENDSTOP SETTINGS: +// Sets direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. +#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. + +// @section machine + +// Travel limits after homing (units are in mm) +#define X_MIN_POS 0 +#define Y_MIN_POS 20 +#define Z_MIN_POS 0 +#define X_MAX_POS 200 +#define Y_MAX_POS 200 +#define Z_MAX_POS 190 + +//=========================================================================== +//========================= Filament Runout Sensor ========================== +//=========================================================================== +//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament + // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. + // It is assumed that when logic high = filament available + // when logic low = filament ran out +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. + #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. + #define FILAMENT_RUNOUT_SCRIPT "M600" +#endif + +//=========================================================================== +//============================ Mesh Bed Leveling ============================ +//=========================================================================== + +//#define MESH_BED_LEVELING // Enable mesh bed leveling. + +#if ENABLED(MESH_BED_LEVELING) + #define MESH_INSET 10 // Mesh inset margin on print area + #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_NUM_Y_POINTS 3 + #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0] + + //#define MANUAL_BED_LEVELING // Add display menu option for bed leveling. + + #if ENABLED(MANUAL_BED_LEVELING) + #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. + #endif // MANUAL_BED_LEVELING + +#endif // MESH_BED_LEVELING + +//=========================================================================== +//============================ Bed Auto Leveling ============================ +//=========================================================================== + +// @section bedlevel + +//#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) +//#define DEBUG_LEVELING_FEATURE + +#if ENABLED(AUTO_BED_LEVELING_FEATURE) + + // There are 2 different ways to specify probing locations: + // + // - "grid" mode + // Probe several points in a rectangular grid. + // You specify the rectangle and the density of sample points. + // This mode is preferred because there are more measurements. + // + // - "3-point" mode + // Probe 3 arbitrary points on the bed (that aren't collinear) + // You specify the XY coordinates of all 3 points. + + // Enable this to sample the bed in a grid (least squares solution). + // Note: this feature generates 10KB extra code size. + #define AUTO_BED_LEVELING_GRID + + #if ENABLED(AUTO_BED_LEVELING_GRID) + + #define LEFT_PROBE_BED_POSITION 15 + #define RIGHT_PROBE_BED_POSITION 170 + #define FRONT_PROBE_BED_POSITION 20 + #define BACK_PROBE_BED_POSITION 170 + + #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this. + + // Set the number of grid points per dimension. + // You probably don't need more than 3 (squared=9). + #define AUTO_BED_LEVELING_GRID_POINTS 2 + + #else // !AUTO_BED_LEVELING_GRID + + // Arbitrary points to probe. + // A simple cross-product is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 15 + #define ABL_PROBE_PT_1_Y 180 + #define ABL_PROBE_PT_2_X 15 + #define ABL_PROBE_PT_2_Y 20 + #define ABL_PROBE_PT_3_X 170 + #define ABL_PROBE_PT_3_Y 20 + + #endif // !AUTO_BED_LEVELING_GRID + + //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. + // Useful to retract a deployable Z probe. + + // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, + // it is highly recommended you also enable Z_SAFE_HOMING below! + +#endif // AUTO_BED_LEVELING_FEATURE + + +// @section homing + +// The position of the homing switches +//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used +//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) + +// Manual homing switch locations: +// For deltabots this means top and center of the Cartesian print volume. +#if ENABLED(MANUAL_HOME_POSITIONS) + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 + #define MANUAL_Z_HOME_POS 0 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. +#endif + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). +#endif + + +// @section motion + +/** + * MOVEMENT SETTINGS + */ + +#define HOMING_FEEDRATE {50*60, 50*60, 8*60, 0} // set the homing speeds (mm/min) + +// default settings + +#define DEFAULT_AXIS_STEPS_PER_UNIT {134.74,134.74,4266.66,148.7} // default steps per unit for Ultimaker +#define DEFAULT_MAX_FEEDRATE {160, 160, 10, 10000} // (mm/sec) +#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. + +#define DEFAULT_ACCELERATION 6000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 6000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + +// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) +#define DEFAULT_XYJERK 10.0 // (mm/sec) +#define DEFAULT_ZJERK 0.5 // (mm/sec) +#define DEFAULT_EJERK 20.0 // (mm/sec) + + +//============================================================================= +//============================= Additional Features =========================== +//============================================================================= + +// @section extras + +// +// EEPROM +// +// The microcontroller can store settings in the EEPROM, e.g. max velocity... +// M500 - stores parameters in EEPROM +// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). +// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. +//define this to enable EEPROM support +#define EEPROM_SETTINGS + +#if ENABLED(EEPROM_SETTINGS) + // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + #define EEPROM_CHITCHAT // Please keep turned on if you can. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PLA_PREHEAT_HOTEND_TEMP 210 +#define PLA_PREHEAT_HPB_TEMP 0 +#define PLA_PREHEAT_FAN_SPEED 165 // Insert Value between 0 and 255 + +#define ABS_PREHEAT_HOTEND_TEMP 245 +#define ABS_PREHEAT_HPB_TEMP 0 +#define ABS_PREHEAT_FAN_SPEED 165 // Insert Value between 0 and 255 + +// +// Print job timer +// +// Enable this option to automatically start and stop the +// print job timer when M104 and M109 commands are received. +// +// In all cases the timer can be started and stopped using +// the following commands: +// +// - M75 - Start the print job timer +// - M76 - Pause the print job timer +// - M77 - Stop the print job timer +#define PRINTJOB_TIMER_AUTOSTART + +// +// Print Counter +// +// When enabled Marlin will keep track of some print statistical data such as: +// - Total print jobs +// - Total successful print jobs +// - Total failed print jobs +// - Total time printing +// +// This information can be viewed by the M78 command. +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +// +// LCD LANGUAGE +// +// Here you may choose the language used by Marlin on the LCD menus, the following +// list of languages are available: +// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, +// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// +#define LCD_LANGUAGE en + +// +// LCD Character Set +// +// Note: This option is NOT applicable to Graphical Displays. +// +// All character-based LCD's provide ASCII plus one of these +// language extensions: +// +// - JAPANESE ... the most common +// - WESTERN ... with more accented characters +// - CYRILLIC ... for the Russian language +// +// To determine the language extension installed on your controller: +// +// - Compile and upload with LCD_LANGUAGE set to 'test' +// - Click the controller to view the LCD menu +// - The LCD will display Japanese, Western, or Cyrillic text +// +// See https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language +// +// :['JAPANESE','WESTERN','CYRILLIC'] +// +#define DISPLAY_CHARSET_HD44780 JAPANESE + +// +// LCD TYPE +// +// You may choose ULTRA_LCD if you have character based LCD with 16x2, 16x4, 20x2, +// 20x4 char/lines or DOGLCD for the full graphics display with 128x64 pixels +// (ST7565R family). (This option will be set automatically for certain displays.) +// +// IMPORTANT NOTE: The U8glib library is required for Full Graphic Display! +// https://github.com/olikraus/U8glib_Arduino +// +#define ULTRA_LCD // Character based +//#define DOGLCD // Full graphics display + +// +// SD CARD +// +// SD Card support is disabled by default. If your controller has an SD slot, +// you must uncomment the following option or it won't work. +// +#define SDSUPPORT + +// +// SD CARD: SPI SPEED +// +// Uncomment ONE of the following items to use a slower SPI transfer +// speed. This is usually required if you're getting volume init errors. +// +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +// +// SD CARD: ENABLE CRC +// +// Use CRC checks and retries on the SD communication. +// +//#define SD_CHECK_AND_RETRY + +// +// ENCODER SETTINGS +// +// This option overrides the default number of encoder pulses needed to +// produce one step. Should be increased for high-resolution encoders. +// +#define ENCODER_PULSES_PER_STEP 4 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +#define REVERSE_MENU_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 +//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 + +// +// CONTROLLER TYPE: Standard +// +// Marlin supports a wide variety of controllers. +// Enable one of the following options to specify your controller. +// + +// +// ULTIMAKER Controller. +// +#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// MaKr3d Makr-Panel with graphic controller and SD support. +// http://reprap.org/wiki/MaKr3d_MaKrPanel +// +//#define MAKRPANEL + +// +// Activate one of these if you have a Panucatt Devices +// Viki 2.0 or mini Viki with Graphic LCD +// http://panucatt.com +// +//#define VIKI2 +//#define miniVIKI + +// +// Adafruit ST7565 Full Graphic Controller. +// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ +// +//#define ELB_FULL_GRAPHIC_CONTROLLER + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + +// +// MakerLab Mini Panel with graphic +// controller and SD support - http://reprap.org/wiki/Mini_panel +// +//#define MINIPANEL + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key +// is pressed, a value of 10.0 means 10mm per click. +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#define RIGIDBOT_PANEL + +// +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. +// +//#define BQ_LCD_SMART_CONTROLLER + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart YW Robot (LCM1602) LCD Display +// +//#define LCD_I2C_SAINSMART_YWROBOT + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + //#define U8GLIB_SSD1306 + #define U8GLIB_SH1106 +#endif + +// +// CONTROLLER TYPE: Shift register panels +// +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +#define SOFT_PWM_SCALE 0 + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on. +// Otherwise the RED led is on. There is 1C hysteresis. +//#define TEMP_STAT_LEDS + +// M240 Triggers a camera by emulating a Canon RC-1 Remote +// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ +//#define PHOTOGRAPH_PIN 23 + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder. +//#define BARICUDA + +//define BlinkM/CyzRgb Support +//#define BLINKM + +/*********************************************************************\ +* R/C SERVO support +* Sponsored by TrinityLabs, Reworked by codexmas +**********************************************************************/ + +// Number of servos +// +// If you select a configuration below, this will receive a default value and does not need to be set manually +// set it manually if you have more servos than extruders and wish to manually control some +// leaving it undefined or defining as 0 will disable the servo subsystem +// If unsure, leave commented / disabled +// +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +/**********************************************************************\ + * Support for a filament diameter sensor + * Also allows adjustment of diameter at print time (vs at slicing) + * Single extruder only at this point (extruder 0) + * + * Motherboards + * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector + * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 - Rambo - uses Analog input 3 + * Note may require analog pins to be defined for different motherboards + **********************************************************************/ +// Uncomment below to enable +//#define FILAMENT_WIDTH_SENSOR + +#define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) + #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel + + #define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm + #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm + #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially + + //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. + //#define FILAMENT_LCD_DISPLAY +#endif + +#include "Configuration_adv.h" +#include "thermistortables.h" + +#endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/K8400/README.md b/Marlin/example_configurations/K8400/README.md new file mode 100644 index 000000000..c9089b587 --- /dev/null +++ b/Marlin/example_configurations/K8400/README.md @@ -0,0 +1,15 @@ +# Configuration for Velleman K8400 Vertex +http://www.k8400.eu/ + +Configuration files for the K8400, ported upstream from the official Velleman firmware. +Like it's predecessor, (K8200), the K8400 is a 3Drag clone. There are some minor differences, documented in pins_K8400.h. + +Single and dual head configurations provided. Copy the correct Configuration.h and Configuration_adv.h to the /Marlin/ directory. + +**NOTE: This configuration includes the community sourced feed rate fix. Use 100% feed rate in Repetier!** + +For implementation and updated K8400 firmware, see https://github.com/birkett/Velleman-K8400-Firmware + +### Original Sources +Credit to Velleman for the original 1.0.x based code:
+http://www.vertex3dprinter.eu/downloads/files/vertex/firmware/vertex-m1-v1.4-h2.zip diff --git a/Marlin/pins.h b/Marlin/pins.h index bbabe53be..bd251216e 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -77,6 +77,8 @@ #include "pins_3DRAG.h" #elif MB(K8200) #include "pins_K8200.h" +#elif MB(K8400) + #include "pins_K8400.h" #elif MB(TEENSYLU) #include "pins_TEENSYLU.h" #elif MB(RUMBA) diff --git a/Marlin/pins_3DRAG.h b/Marlin/pins_3DRAG.h index c04464b43..6f253ac8a 100644 --- a/Marlin/pins_3DRAG.h +++ b/Marlin/pins_3DRAG.h @@ -21,7 +21,7 @@ */ /** - * 3DRAG (and K8200) Arduino Mega with RAMPS v1.4 pin assignments + * 3DRAG (and K8200 / K8400) Arduino Mega with RAMPS v1.4 pin assignments */ #ifndef BOARD_NAME diff --git a/Marlin/pins_K8400.h b/Marlin/pins_K8400.h new file mode 100644 index 000000000..a15e9e494 --- /dev/null +++ b/Marlin/pins_K8400.h @@ -0,0 +1,52 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Velleman K8400 (Vertex) + * 3DRAG clone + * + * K8400 has some minor differences over a normal 3Drag: + * - No X/Y max endstops + * - Second extruder step pin has moved + * - No power supply control + * - Second heater has moved pin + */ + +#define BOARD_NAME "K8400" +#define DEFAULT_MACHINE_NAME "Vertex" +#define DEFAULT_SOURCE_CODE_URL "https://github.com/birkett/Vertex-K8400-Firmware" + +#include "pins_3DRAG.h" + +#undef X_MAX_PIN +#define X_MAX_PIN -1 +#undef Y_MAX_PIN +#define Y_MAX_PIN -1 + +#undef E1_STEP_PIN +#define E1_STEP_PIN 32 + +#undef PS_ON_PIN +#undef KILL_PIN + +#undef HEATER_1_PIN +#define HEATER_1_PIN 11 diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h index a87c19e8e..7226f55c9 100644 --- a/Marlin/ultralcd_st7920_u8glib_rrd.h +++ b/Marlin/ultralcd_st7920_u8glib_rrd.h @@ -59,7 +59,7 @@ #define CPU_ST7920_DELAY_1 DELAY_0_NOP #define CPU_ST7920_DELAY_2 DELAY_0_NOP #define CPU_ST7920_DELAY_3 DELAY_1_NOP -#elif (MOTHERBOARD == BOARD_3DRAG) || (MOTHERBOARD == BOARD_K8200) +#elif (MOTHERBOARD == BOARD_3DRAG) || (MOTHERBOARD == BOARD_K8200) || (MOTHERBOARD == BOARD_K8400) #define CPU_ST7920_DELAY_1 DELAY_0_NOP #define CPU_ST7920_DELAY_2 DELAY_3_NOP #define CPU_ST7920_DELAY_3 DELAY_0_NOP From e77844594d061e88b0f85e9dd59272944ebba09b Mon Sep 17 00:00:00 2001 From: Anthony Birkett Date: Sun, 3 Jul 2016 22:13:35 +0100 Subject: [PATCH 239/580] readme.md -> README.md --- .../example_configurations/Hephestos_2/{readme.md => README.md} | 0 Marlin/example_configurations/K8200/{readme.md => README.md} | 0 .../delta/kossel_pro/{readme.md => README.md} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Marlin/example_configurations/Hephestos_2/{readme.md => README.md} (100%) rename Marlin/example_configurations/K8200/{readme.md => README.md} (100%) rename Marlin/example_configurations/delta/kossel_pro/{readme.md => README.md} (100%) diff --git a/Marlin/example_configurations/Hephestos_2/readme.md b/Marlin/example_configurations/Hephestos_2/README.md similarity index 100% rename from Marlin/example_configurations/Hephestos_2/readme.md rename to Marlin/example_configurations/Hephestos_2/README.md diff --git a/Marlin/example_configurations/K8200/readme.md b/Marlin/example_configurations/K8200/README.md similarity index 100% rename from Marlin/example_configurations/K8200/readme.md rename to Marlin/example_configurations/K8200/README.md diff --git a/Marlin/example_configurations/delta/kossel_pro/readme.md b/Marlin/example_configurations/delta/kossel_pro/README.md similarity index 100% rename from Marlin/example_configurations/delta/kossel_pro/readme.md rename to Marlin/example_configurations/delta/kossel_pro/README.md From 2ed625dafa89ca2648f602922828034c42a38004 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Jul 2016 15:12:21 -0700 Subject: [PATCH 240/580] Fix compiler warnings for static screens --- Marlin/ultralcd.cpp | 81 ++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index cf0b15ff3..da1a2a5e7 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -211,7 +211,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to /* Helper macros for menus */ /** - * START_MENU generates the init code for a menu function + * START_SCREEN generates the init code for a screen function * * encoderLine is the position based on the encoder * currentMenuViewOffset is the top menu line to display @@ -219,17 +219,26 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to * _lineNr is the menu item to draw and process * _menuItemNr is the index of each MENU_ITEM */ - #define START_MENU() do { \ + #define _START_SCREEN(CODE) do { \ ENCODER_DIRECTION_MENUS(); \ encoderRateMultiplierEnabled = false; \ if (encoderPosition > 0x8000) encoderPosition = 0; \ uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ NOMORE(currentMenuViewOffset, encoderLine); \ uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ - bool wasClicked = LCD_CLICKED, itemSelected; \ + CODE; \ for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \ _menuItemNr = 0; + #define START_SCREEN() _START_SCREEN(0) + + /** + * START_MENU generates the init code for a menu function + * + * wasClicked indicates the controller was clicked + */ + #define START_MENU() _START_SCREEN(bool wasClicked = LCD_CLICKED) + /** * MENU_ITEM generates draw & handler code for a menu item, potentially calling: * @@ -253,10 +262,9 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to */ #define _MENU_ITEM_PART_1(type, label, args...) \ if (_menuItemNr == _lineNr) { \ - itemSelected = encoderLine == _menuItemNr; \ if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \ - if (wasClicked && itemSelected) { \ + lcd_implementation_drawmenu_ ## type(encoderLine == _menuItemNr, _drawLineNr, PSTR(label), ## args); \ + if (wasClicked && encoderLine == _menuItemNr) { \ lcd_quick_feedback() #define _MENU_ITEM_PART_2(type, args...) \ @@ -281,6 +289,21 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to } \ _menuItemNr++ + #define END_SCREEN() \ + if (encoderLine >= _menuItemNr) { \ + encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; \ + encoderLine = _menuItemNr - 1; \ + } \ + if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { \ + currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; \ + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ + _lineNr = currentMenuViewOffset - 1; \ + _drawLineNr = -1; \ + } \ + } } while(0) + + #define END_MENU() END_SCREEN() + #if ENABLED(ENCODER_RATE_MULTIPLIER) //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value @@ -307,10 +330,6 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) #endif //!ENCODER_RATE_MULTIPLIER - #define END_MENU() \ - if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; encoderLine = _menuItemNr - 1; }\ - if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \ - } } while(0) /** Used variables to keep track of the menu */ volatile uint8_t buttons; //the last checked buttons in a bit array. @@ -1927,14 +1946,14 @@ static void lcd_status_screen() { printStatistics stats = print_job_counter.getStats(); char printTime[6]; - sprintf(printTime, "%02d:%02d", stats.printTime / 60, stats.printTime % 60); + sprintf(printTime, "%02d:%02d", int(stats.printTime / 60), int(stats.printTime % 60)); if (LCD_CLICKED) lcd_goto_previous_menu(true); - START_MENU(); + START_SCREEN(); STATIC_ITEM(MSG_INFO_TOTAL_PRINTS ": ", itostr3left(stats.totalPrints)); // Total Prints: 999 STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", itostr3left(stats.finishedPrints)); // Finished Prints: 666 STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", printTime); // Total Print Time: 123456 - END_MENU(); + END_SCREEN(); } #endif // PRINTCOUNTER @@ -1945,7 +1964,7 @@ static void lcd_status_screen() { */ static void lcd_info_thermistors_menu() { if (LCD_CLICKED) lcd_goto_previous_menu(true); - START_MENU(); + START_SCREEN(); #define THERMISTOR_ID TEMP_SENSOR_0 #include "thermistornames.h" STATIC_ITEM("T0: " THERMISTOR_NAME); @@ -1987,7 +2006,7 @@ static void lcd_status_screen() { STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP)); STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP)); #endif - END_MENU(); + END_SCREEN(); } /** @@ -1997,7 +2016,7 @@ static void lcd_status_screen() { */ static void lcd_info_board_menu() { if (LCD_CLICKED) lcd_goto_previous_menu(true); - START_MENU(); + START_SCREEN(); STATIC_ITEM(BOARD_NAME); // MyPrinterController STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE)); // Baud: 250000 STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION); // Protocol: 1.0 @@ -2008,7 +2027,7 @@ static void lcd_status_screen() { STATIC_ITEM(MSG_INFO_PSU ": XBox"); // Power Supply: XBox #endif #endif // POWER_SUPPLY - END_MENU(); + END_SCREEN(); } /** @@ -2018,14 +2037,14 @@ static void lcd_status_screen() { */ static void lcd_info_printer_menu() { if (LCD_CLICKED) lcd_goto_previous_menu(true); - START_MENU(); + START_SCREEN(); STATIC_ITEM(MSG_MARLIN); // Marlin STATIC_ITEM(SHORT_BUILD_VERSION); // x.x.x-Branch STATIC_ITEM(STRING_DISTRIBUTION_DATE); // YYYY-MM-DD HH:MM STATIC_ITEM(MACHINE_NAME); // My3DPrinter STATIC_ITEM(WEBSITE_URL); // www.my3dprinter.com STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS)); // Extruders: 2 - END_MENU(); + END_SCREEN(); } /** @@ -2069,7 +2088,7 @@ static void lcd_status_screen() { } static void lcd_filament_change_init_message() { - START_MENU(); + START_SCREEN(); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1); #ifdef MSG_FILAMENT_CHANGE_INIT_2 @@ -2078,11 +2097,11 @@ static void lcd_status_screen() { #ifdef MSG_FILAMENT_CHANGE_INIT_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3); #endif - END_MENU(); + END_SCREEN(); } static void lcd_filament_change_unload_message() { - START_MENU(); + START_SCREEN(); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1); #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2 @@ -2091,11 +2110,11 @@ static void lcd_status_screen() { #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3); #endif - END_MENU(); + END_SCREEN(); } static void lcd_filament_change_insert_message() { - START_MENU(); + START_SCREEN(); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1); #ifdef MSG_FILAMENT_CHANGE_INSERT_2 @@ -2104,11 +2123,11 @@ static void lcd_status_screen() { #ifdef MSG_FILAMENT_CHANGE_INSERT_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3); #endif - END_MENU(); + END_SCREEN(); } static void lcd_filament_change_load_message() { - START_MENU(); + START_SCREEN(); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1); #ifdef MSG_FILAMENT_CHANGE_LOAD_2 @@ -2117,11 +2136,11 @@ static void lcd_status_screen() { #ifdef MSG_FILAMENT_CHANGE_LOAD_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3); #endif - END_MENU(); + END_SCREEN(); } static void lcd_filament_change_extrude_message() { - START_MENU(); + START_SCREEN(); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_1); #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_2 @@ -2130,11 +2149,11 @@ static void lcd_status_screen() { #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_3); #endif - END_MENU(); + END_SCREEN(); } static void lcd_filament_change_resume_message() { - START_MENU(); + START_SCREEN(); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1); #ifdef MSG_FILAMENT_CHANGE_RESUME_2 @@ -2143,7 +2162,7 @@ static void lcd_status_screen() { #ifdef MSG_FILAMENT_CHANGE_RESUME_3 STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_3); #endif - END_MENU(); + END_SCREEN(); } void lcd_filament_change_show_message(FilamentChangeMessage message) { From ef8980bfa03ee06aa725391c98b4a5af45dfede1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Jul 2016 15:56:19 -0700 Subject: [PATCH 241/580] Shorter labels for Print Stats info --- Marlin/language_en.h | 29 +++++++++++++++++++++-------- Marlin/ultralcd.cpp | 6 +++--- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Marlin/language_en.h b/Marlin/language_en.h index aa9a52dfb..f69ef9ca3 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -544,14 +544,27 @@ #ifndef MSG_INFO_PROTOCOL #define MSG_INFO_PROTOCOL "Protocol" #endif -#ifndef MSG_INFO_TOTAL_PRINTS - #define MSG_INFO_TOTAL_PRINTS "Total Prints" -#endif -#ifndef MSG_INFO_FINISHED_PRINTS - #define MSG_INFO_FINISHED_PRINTS "Finished Prints" -#endif -#ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME "Total Print Time" + +#if LCD_WIDTH > 19 + #ifndef MSG_INFO_PRINT_COUNT + #define MSG_INFO_PRINT_COUNT "Print Count " + #endif + #ifndef MSG_INFO_FINISHED_PRINTS + #define MSG_INFO_FINISHED_PRINTS "Finished " + #endif + #ifndef MSG_INFO_PRINT_TIME + #define MSG_INFO_PRINT_TIME "Total Time " + #endif +#else + #ifndef MSG_INFO_PRINT_COUNT + #define MSG_INFO_PRINT_COUNT "Prints " + #endif + #ifndef MSG_INFO_FINISHED_PRINTS + #define MSG_INFO_FINISHED_PRINTS "Finished " + #endif + #ifndef MSG_INFO_PRINT_TIME + #define MSG_INFO_PRINT_TIME "Duration " + #endif #endif #ifndef MSG_INFO_MIN_TEMP #define MSG_INFO_MIN_TEMP "Min Temp" diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index da1a2a5e7..304174330 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1950,9 +1950,9 @@ static void lcd_status_screen() { if (LCD_CLICKED) lcd_goto_previous_menu(true); START_SCREEN(); - STATIC_ITEM(MSG_INFO_TOTAL_PRINTS ": ", itostr3left(stats.totalPrints)); // Total Prints: 999 - STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", itostr3left(stats.finishedPrints)); // Finished Prints: 666 - STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", printTime); // Total Print Time: 123456 + STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", itostr3left(stats.totalPrints)); // Print Count : 999 + STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", itostr3left(stats.finishedPrints)); // Finished : 666 + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", printTime); // Total Time : 12:34 END_SCREEN(); } #endif // PRINTCOUNTER From f31af61ee2abeb8f0e017dc604c4409ca0b6dabd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Jul 2016 16:51:26 -0700 Subject: [PATCH 242/580] Fix position adjustment with gcode_T and MBL --- Marlin/Marlin_main.cpp | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d4c353e2f..fc5df9443 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -310,6 +310,9 @@ float position_shift[3] = { 0 }; // Set by M206, M428, or menu item. Saved to EEPROM. float home_offset[3] = { 0 }; +#define RAW_POSITION(POS, AXIS) (POS - home_offset[AXIS] - position_shift[AXIS]) +#define RAW_CURRENT_POSITION(AXIS) (RAW_POSITION(current_position[AXIS], AXIS)) + // Software Endstops. Default to configured limits. float sw_endstop_min[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float sw_endstop_max[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; @@ -2766,8 +2769,7 @@ inline void gcode_G28() { // Save known Z position if already homed if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) { pre_home_z = current_position[Z_AXIS]; - pre_home_z += mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], - current_position[Y_AXIS] - home_offset[Y_AXIS]); + pre_home_z += mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS)); } mbl.set_active(false); current_position[Z_AXIS] = pre_home_z; @@ -3083,8 +3085,7 @@ inline void gcode_G28() { stepper.synchronize(); #else current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - - mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], - current_position[Y_AXIS] - home_offset[Y_AXIS]) + mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS)) #if Z_HOME_DIR > 0 + Z_MAX_POS #endif @@ -3096,8 +3097,7 @@ inline void gcode_G28() { SYNC_PLAN_POSITION_KINEMATIC(); mbl.set_active(true); current_position[Z_AXIS] = pre_home_z - - mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], - current_position[Y_AXIS] - home_offset[Y_AXIS]); + mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS)); } } #endif @@ -3305,8 +3305,7 @@ inline void gcode_G28() { case MeshReset: if (mbl.active()) { current_position[Z_AXIS] += - mbl.get_z(current_position[X_AXIS] - home_offset[X_AXIS], - current_position[Y_AXIS] - home_offset[Y_AXIS]) - MESH_HOME_SEARCH_Z; + mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS)) - MESH_HOME_SEARCH_Z; mbl.reset(); SYNC_PLAN_POSITION_KINEMATIC(); } @@ -6620,21 +6619,23 @@ inline void gcode_T(uint8_t tmp_extruder) { } #endif - #elif ENABLED(MESH_BED_LEVELING) + #else // !AUTO_BED_LEVELING_FEATURE - if (mbl.active()) { - float xpos = current_position[X_AXIS] - home_offset[X_AXIS], - ypos = current_position[Y_AXIS] - home_offset[Y_AXIS]; - current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos); - } + #if ENABLED(MESH_BED_LEVELING) + + if (mbl.active()) { + float xpos = RAW_CURRENT_POSITION(X_AXIS), + ypos = RAW_CURRENT_POSITION(Y_AXIS); + current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos); + } - #else // no bed leveling + #endif // MESH_BED_LEVELING // The newly-selected extruder XY is actually at... current_position[X_AXIS] += xydiff[X_AXIS]; current_position[Y_AXIS] += xydiff[Y_AXIS]; - #endif // no bed leveling + #endif // !AUTO_BED_LEVELING_FEATURE for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) { position_shift[i] += xydiff[i]; @@ -7476,10 +7477,10 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, set_current_to_destination(); return; } - int pcx = mbl.cell_index_x(current_position[X_AXIS] - home_offset[X_AXIS]); - int pcy = mbl.cell_index_y(current_position[Y_AXIS] - home_offset[Y_AXIS]); - int cx = mbl.cell_index_x(x - home_offset[X_AXIS]); - int cy = mbl.cell_index_y(y - home_offset[Y_AXIS]); + int pcx = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)), + pcy = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), + cx = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)), + cy = mbl.cell_index_y(RAW_POSITION(x, Y_AXIS)); NOMORE(pcx, MESH_NUM_X_POINTS - 2); NOMORE(pcy, MESH_NUM_Y_POINTS - 2); NOMORE(cx, MESH_NUM_X_POINTS - 2); From c9e536cf872c1fb2acce1bdb3da0d63f79093be8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Jul 2016 18:06:54 -0700 Subject: [PATCH 243/580] Additional patches for gcode_T position change --- Marlin/Marlin_main.cpp | 48 ++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index fc5df9443..a1a7a80b7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6497,6 +6497,13 @@ inline void gcode_T(uint8_t tmp_extruder) { return; } + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOLNPGM(">>> gcode_T"); + DEBUG_POS("BEFORE", current_position); + } + #endif + #if HOTENDS > 1 float old_feedrate = feedrate; @@ -6579,11 +6586,6 @@ inline void gcode_T(uint8_t tmp_extruder) { // Z software endstop. But this is technically correct (and // there is no viable alternative). // - float xydiff[2] = { - hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], - hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder] - }; - #if ENABLED(AUTO_BED_LEVELING_FEATURE) // Offset extruder, make sure to apply the bed level rotation matrix vector_3 tmp_offset_vec = vector_3(hotend_offset[X_AXIS][tmp_extruder], @@ -6596,31 +6598,29 @@ inline void gcode_T(uint8_t tmp_extruder) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM(">>> gcode_T"); tmp_offset_vec.debug("tmp_offset_vec"); act_offset_vec.debug("act_offset_vec"); offset_vec.debug("offset_vec (BEFORE)"); - DEBUG_POS("BEFORE rotation", current_position); } #endif offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix)); - // Adjust the current position - current_position[X_AXIS] += offset_vec.x; - current_position[Y_AXIS] += offset_vec.y; - current_position[Z_AXIS] += offset_vec.z; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - offset_vec.debug("offset_vec (AFTER)"); - DEBUG_POS("AFTER rotation", current_position); - SERIAL_ECHOLNPGM("<<< gcode_T"); - } + if (DEBUGGING(LEVELING)) offset_vec.debug("offset_vec (AFTER)"); #endif + // Adjustments to the current position + float xydiff[2] = { offset_vec.x, offset_vec.y }; + current_position[Z_AXIS] += offset_vec.z; + #else // !AUTO_BED_LEVELING_FEATURE + float xydiff[2] = { + hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], + hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder] + }; + #if ENABLED(MESH_BED_LEVELING) if (mbl.active()) { @@ -6631,12 +6631,11 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif // MESH_BED_LEVELING - // The newly-selected extruder XY is actually at... - current_position[X_AXIS] += xydiff[X_AXIS]; - current_position[Y_AXIS] += xydiff[Y_AXIS]; - #endif // !AUTO_BED_LEVELING_FEATURE + // The newly-selected extruder XY is actually at... + current_position[X_AXIS] += xydiff[X_AXIS]; + current_position[Y_AXIS] += xydiff[Y_AXIS]; for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) { position_shift[i] += xydiff[i]; update_software_endstops((AxisEnum)i); @@ -6670,6 +6669,13 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + DEBUG_POS("AFTER", current_position); + SERIAL_ECHOLNPGM("<<< gcode_T"); + } + #endif + SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER); SERIAL_PROTOCOLLN((int)active_extruder); From ff91d28a3aafaeeb7b0b795637aaf4870829d417 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 4 Jul 2016 03:12:11 +0200 Subject: [PATCH 244/580] Remove wants_to_cool warning Remove wants_to_cool warning --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index fc5df9443..bdf0156d3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4569,7 +4569,7 @@ inline void gcode_M109() { #endif //TEMP_RESIDENCY_TIME > 0 float theTarget = -1.0, old_temp = 9999.0; - bool wants_to_cool; + bool wants_to_cool = false; cancel_heatup = false; millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; @@ -4663,7 +4663,7 @@ inline void gcode_M109() { #endif //TEMP_BED_RESIDENCY_TIME > 0 float theTarget = -1.0, old_temp = 9999.0; - bool wants_to_cool; + bool wants_to_cool = false; cancel_heatup = false; millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; From e104b91ea6b1d563bee60dbfc569e243d7eda7e5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Jul 2016 20:08:22 -0700 Subject: [PATCH 245/580] References to millimeters in code comments need an update --- Marlin/Marlin_main.cpp | 100 +++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index fc5df9443..4f47c4ced 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -183,19 +183,23 @@ * M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. * M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling - * M200 - set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).:D- + * M200 - Set filament diameter, D, setting E axis units to cubic. (Use S0 to revert to linear units.) * M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) * M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! - * M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec - * M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2 - * M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk + * M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec + * M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in units/sec^2 + * M205 - Set advanced settings. Current units apply: + S T minimum speeds + B + X, Z, E * M206 - Set additional homing offset - * M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting - * M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min] - * M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. - * M218 - Set hotend offset (in mm): T X Y - * M220 - Set speed factor override percentage: S - * M221 - Set extrude factor override percentage: S + * M207 - Set Retract Length: S, Feedrate: F, and Z lift: Z + * M208 - Set Recover (unretract) Additional (!) Length: S and Feedrate: F + * M209 - Turn Automatic Retract Detection on/off: S (For slicers that don't support G10/11). + Every normal extrude-only move will be classified as retract depending on the direction. + * M218 - Set a tool offset: T X Y + * M220 - Set Feedrate Percentage: S ("FR" on your LCD) + * M221 - Set Flow Percentage: S * M226 - Wait until the specified pin reaches the state required: P S * M240 - Trigger a camera to take a photograph * M250 - Set LCD contrast C (value 0..63) @@ -210,13 +214,13 @@ * M400 - Finish all moves * M401 - Lower Z probe if present * M402 - Raise Z probe if present - * M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters - * M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder - * M406 - Turn off Filament Sensor extrusion control - * M407 - Display measured filament diameter + * M404 - Display or set the Nominal Filament Width: [ N ] + * M405 - Enable Filament Sensor extrusion control. Optional delay between sensor and extruder: D + * M406 - Disable Filament Sensor extrusion control + * M407 - Display measured filament diameter in millimeters * M410 - Quickstop. Abort all the planned moves * M420 - Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable - * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z + * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z * M428 - Set the home_offset logically based on the current_position * M500 - Store parameters in EEPROM * M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily). @@ -227,7 +231,7 @@ * M665 - Set delta configurations: L R S * M666 - Set delta endstop adjustment * M605 - Set dual x-carriage movement mode: S [ X R ] - * M851 - Set Z probe's Z offset (mm). Set to a negative value for probes that trigger below the nozzle. + * M851 - Set Z probe's Z offset in current units. (Negative values apply to probes that extend below the nozzle.) * M907 - Set digital trimpot motor current using axis codes. * M908 - Control digital trimpot directly. * M909 - DAC_STEPPER_CURRENT: Print digipot/DAC current value @@ -251,7 +255,7 @@ * * "T" Codes * - * T0-T3 - Select a tool by index (usually an extruder) [ F ] + * T0-T3 - Select a tool by index (usually an extruder) [ F ] * */ @@ -1578,7 +1582,7 @@ inline void line_to_destination() { line_to_destination(feedrate); } * sync_plan_position * Set planner / stepper positions to the cartesian current_position. * The stepper code translates these coordinates into step units. - * Allows translation between steps and units (mm) for cartesian & core robots + * Allows translation between steps and millimeters for cartesian & core robots */ inline void sync_plan_position() { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3331,7 +3335,7 @@ inline void gcode_G28() { * Not supported by non-linear delta printer bed leveling. * Example: "G29 P4" * - * S Set the XY travel speed between probe points (in mm/min) + * S Set the XY travel speed between probe points (in units/min) * * D Dry-Run mode. Just evaluate the bed Topology - Don't apply * or clean the rotation Matrix. Useful to check the topology @@ -5185,7 +5189,7 @@ inline void gcode_M121() { endstops.enable_globally(false); } * M200: Set filament diameter and set E axis units to cubic units * * T - Optional extruder number. Current extruder if omitted. - * D - Diameter of the filament. Use "D0" to switch back to linear units on the E axis. + * D - Diameter of the filament. Use "D0" to switch back to linear units on the E axis. */ inline void gcode_M200() { @@ -5234,7 +5238,7 @@ inline void gcode_M201() { /** - * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec + * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec */ inline void gcode_M203() { for (int8_t i = 0; i < NUM_AXIS; i++) { @@ -5245,7 +5249,7 @@ inline void gcode_M203() { } /** - * M204: Set Accelerations in mm/sec^2 (M204 P1200 R3000 T3000) + * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000) * * P = Printing moves * R = Retract only (no X, Y, Z) moves @@ -5279,12 +5283,12 @@ inline void gcode_M204() { /** * M205: Set Advanced Settings * - * S = Min Feed Rate (mm/s) - * T = Min Travel Feed Rate (mm/s) + * S = Min Feed Rate (units/s) + * T = Min Travel Feed Rate (units/s) * B = Min Segment Time (µs) - * X = Max XY Jerk (mm/s/s) - * Z = Max Z Jerk (mm/s/s) - * E = Max E Jerk (mm/s/s) + * X = Max XY Jerk (units/sec^2) + * Z = Max Z Jerk (units/sec^2) + * E = Max E Jerk (units/sec^2) */ inline void gcode_M205() { if (code_seen('S')) planner.min_feedrate = code_value_linear_units(); @@ -5379,10 +5383,10 @@ inline void gcode_M206() { /** * M207: Set firmware retraction values * - * S[+mm] retract_length - * W[+mm] retract_length_swap (multi-extruder) - * F[mm/min] retract_feedrate_mm_s - * Z[mm] retract_zlift + * S[+units] retract_length + * W[+units] retract_length_swap (multi-extruder) + * F[units/min] retract_feedrate_mm_s + * Z[units] retract_zlift */ inline void gcode_M207() { if (code_seen('S')) retract_length = code_value_axis_units(E_AXIS); @@ -5396,9 +5400,9 @@ inline void gcode_M206() { /** * M208: Set firmware un-retraction values * - * S[+mm] retract_recover_length (in addition to M207 S*) - * W[+mm] retract_recover_length_swap (multi-extruder) - * F[mm/min] retract_recover_feedrate + * S[+units] retract_recover_length (in addition to M207 S*) + * W[+units] retract_recover_length_swap (multi-extruder) + * F[units/min] retract_recover_feedrate */ inline void gcode_M208() { if (code_seen('S')) retract_recover_length = code_value_axis_units(E_AXIS); @@ -5435,7 +5439,7 @@ inline void gcode_M206() { #if HOTENDS > 1 /** - * M218 - set hotend offset (in mm) + * M218 - set hotend offset (in linear units) * * T * X @@ -5891,7 +5895,7 @@ inline void gcode_M400() { stepper.synchronize(); } #if ENABLED(FILAMENT_WIDTH_SENSOR) /** - * M404: Display or set the nominal filament width (3mm, 1.75mm ) W<3.0> + * M404: Display or set (in current units) the nominal filament width (3mm, 1.75mm ) W<3.0> */ inline void gcode_M404() { if (code_seen('W')) { @@ -5984,7 +5988,7 @@ inline void gcode_M410() { /** * M421: Set a single Mesh Bed Leveling Z coordinate - * Use either 'M421 X Y Z' or 'M421 I J Z' + * Use either 'M421 X Y Z' or 'M421 I J Z' */ inline void gcode_M421() { int8_t px, py; @@ -6320,7 +6324,7 @@ inline void gcode_M503() { * M605 S0: Full control mode. The slicer has full control over x-carriage movement * M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement * M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn - * millimeters x-offset and an optional differential hotend temperature of + * units x-offset and an optional differential hotend temperature of * mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate * the first with a spacing of 100mm in the x direction and 2 degrees hotter. * @@ -6485,8 +6489,8 @@ inline void gcode_M999() { /** * T0-T3: Switch tool, usually switching extruders * - * F[mm/min] Set the movement feedrate - * S1 Don't move the tool in XY after change + * F[units/min] Set the movement feedrate + * S1 Don't move the tool in XY after change */ inline void gcode_T(uint8_t tmp_extruder) { if (tmp_extruder >= EXTRUDERS) { @@ -7066,7 +7070,7 @@ void process_next_command() { #endif //EXPERIMENTAL_I2CBUS - case 200: // M200 D set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). + case 200: // M200 D Set filament diameter and set E axis units to cubic. (Use S0 to revert to linear units.) gcode_M200(); break; case 201: // M201 @@ -7077,7 +7081,7 @@ void process_next_command() { gcode_M202(); break; #endif - case 203: // M203 max feedrate mm/sec + case 203: // M203 max feedrate units/sec gcode_M203(); break; case 204: // M204 acclereration S normal moves T filmanent only moves @@ -7103,28 +7107,28 @@ void process_next_command() { #endif #if ENABLED(FWRETRACT) - case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop] + case 207: // M207 - Set Retract Length: S, Feedrate: F, and Z lift: Z gcode_M207(); break; - case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min] + case 208: // M208 - Set Recover (unretract) Additional (!) Length: S and Feedrate: F gcode_M208(); break; - case 209: // M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. + case 209: // M209 - Turn Automatic Retract Detection on/off: S (For slicers that don't support G10/11). Every normal extrude-only move will be classified as retract depending on the direction. gcode_M209(); break; #endif // FWRETRACT #if HOTENDS > 1 - case 218: // M218 - set hotend offset (in mm), T X Y + case 218: // M218 - Set a tool offset: T X Y gcode_M218(); break; #endif - case 220: // M220 S- set speed factor override percentage + case 220: // M220 - Set Feedrate Percentage: S ("FR" on your LCD) gcode_M220(); break; - case 221: // M221 S- set extrude factor override percentage + case 221: // M221 - Set Flow Percentage: S gcode_M221(); break; From 8b02e68cb6009d3eb8695df26186e823bed31702 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 5 Jul 2016 10:42:33 +0200 Subject: [PATCH 246/580] Make raise for probe deploy relative in homeaxis() Make raise for probe deploy relative in homeaxis() by setting `current_position[axis]` to zero later. --- Marlin/Marlin_main.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9ca282492..7d89e9e51 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2331,10 +2331,6 @@ static void homeaxis(AxisEnum axis) { #endif home_dir(axis); - // Set the axis position as setup for the move - current_position[axis] = 0; - sync_plan_position(); - // Homing Z towards the bed? Deploy the Z probe or endstop. #if HAS_BED_PROBE if (axis == Z_AXIS && axis_home_dir < 0) { @@ -2345,6 +2341,10 @@ static void homeaxis(AxisEnum axis) { } #endif + // Set the axis position as setup for the move + current_position[axis] = 0; + sync_plan_position(); + // Set a flag for Z motor locking #if ENABLED(Z_DUAL_ENDSTOPS) if (axis == Z_AXIS) stepper.set_homing_flag(true); @@ -2454,7 +2454,6 @@ static void homeaxis(AxisEnum axis) { #endif destination[axis] = current_position[axis]; - feedrate = 0.0; endstops.hit_on_purpose(); // clear endstop hit flags axis_known_position[axis] = true; axis_homed[axis] = true; @@ -2790,8 +2789,6 @@ inline void gcode_G28() { */ set_destination_to_current(); - feedrate = 0.0; - #if ENABLED(DELTA) /** * A delta can only safely home all axis at the same time @@ -2906,7 +2903,6 @@ inline void gcode_G28() { destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; line_to_destination(); - feedrate = 0.0; stepper.synchronize(); endstops.hit_on_purpose(); // clear endstop hit flags From f799f18388a94f242348661701809d55120da4ae Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 5 Jul 2016 18:19:53 +0200 Subject: [PATCH 247/580] MBL typo --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9ca282492..07eb8daea 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7503,7 +7503,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, int pcx = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)), pcy = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), cx = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)), - cy = mbl.cell_index_y(RAW_POSITION(x, Y_AXIS)); + cy = mbl.cell_index_y(RAW_POSITION(y, Y_AXIS)); NOMORE(pcx, MESH_NUM_X_POINTS - 2); NOMORE(pcy, MESH_NUM_Y_POINTS - 2); NOMORE(cx, MESH_NUM_X_POINTS - 2); From 0d4ff0c48b7dfe6909f4fe73db45aadd3e3c8aca Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 5 Jul 2016 16:12:31 -0700 Subject: [PATCH 248/580] Allow the queue to be cleared from within commands --- Marlin/Marlin_main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4409a36df..100d56dd4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -990,8 +990,11 @@ void loop() { #endif // SDSUPPORT - commands_in_queue--; - cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE; + // The queue may be reset by a command handler or by code invoked by idle() within a handler + if (commands_in_queue) { + --commands_in_queue; + cmd_queue_index_r = (cmd_queue_index_r + 1) % BUFSIZE; + } } endstops.report_state(); idle(); From b114b6a0b3cea2ad9e031ac2473381f9b2d37df8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 5 Jul 2016 16:29:28 -0700 Subject: [PATCH 249/580] Save 152 bytes using uint8_t for command indices --- Marlin/Marlin_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 100d56dd4..c31002bca 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -284,11 +284,11 @@ bool axis_homed[3] = { false }; static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; -static char* current_command, *current_command_args; -static int cmd_queue_index_r = 0; -static int cmd_queue_index_w = 0; -static int commands_in_queue = 0; static char command_queue[BUFSIZE][MAX_CMD_SIZE]; +static char* current_command, *current_command_args; +static uint8_t cmd_queue_index_r = 0, + cmd_queue_index_w = 0, + commands_in_queue = 0; #if ENABLED(INCH_MODE_SUPPORT) float linear_unit_factor = 1.0; From 7d063c111c1d84e08f04def5b7297549d8e1ca58 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 4 Jul 2016 09:40:59 +0200 Subject: [PATCH 250/580] Add a optional feedrate parameter to `do_blocking_move()` Add a optional feedrate parameter to `do_blocking_move()` and its companions. --- Marlin/Marlin_main.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c31002bca..38d3c36a8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1651,7 +1651,7 @@ static void clean_up_after_endstop_or_probe_move() { * Plan a move to (X, Y, Z) and set the current_position * The final current_position may not be the one that was requested */ - static void do_blocking_move_to(float x, float y, float z) { + static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) { float old_feedrate = feedrate; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1660,7 +1660,7 @@ static void clean_up_after_endstop_or_probe_move() { #if ENABLED(DELTA) - feedrate = XY_PROBE_FEEDRATE; + feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE; destination[X_AXIS] = x; destination[Y_AXIS] = y; @@ -1675,19 +1675,19 @@ static void clean_up_after_endstop_or_probe_move() { // If Z needs to raise, do it before moving XY if (current_position[Z_AXIS] < z) { - feedrate = homing_feedrate[Z_AXIS]; + feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS]; current_position[Z_AXIS] = z; line_to_current_position(); } - feedrate = XY_PROBE_FEEDRATE; + feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE; current_position[X_AXIS] = x; current_position[Y_AXIS] = y; line_to_current_position(); // If Z needs to lower, do it after moving XY if (current_position[Z_AXIS] > z) { - feedrate = homing_feedrate[Z_AXIS]; + feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS]; current_position[Z_AXIS] = z; line_to_current_position(); } @@ -1699,12 +1699,12 @@ static void clean_up_after_endstop_or_probe_move() { feedrate = old_feedrate; } - inline void do_blocking_move_to_x(float x) { - do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]); + inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) { + do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate); } - inline void do_blocking_move_to_z(float z) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z); + inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate); } /** @@ -2081,8 +2081,8 @@ static void clean_up_after_endstop_or_probe_move() { return current_position[Z_AXIS]; } - inline void do_blocking_move_to_xy(float x, float y) { - do_blocking_move_to(x, y, current_position[Z_AXIS]); + inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) { + do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate); } // From 5126cce7fdd1eff9cab8968167879bf457c6a900 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 4 Jul 2016 09:46:22 +0200 Subject: [PATCH 251/580] Move Allen Key probe move scripts to their own functions There was an hidden extra move after the scripts. This is configurable now. Added the extra moves to the relevant configs. --- Marlin/Marlin_main.cpp | 245 +++++++++++------- .../delta/biv2.5/Configuration.h | 10 + .../delta/generic/Configuration.h | 10 + .../delta/kossel_mini/Configuration.h | 10 + .../delta/kossel_pro/Configuration.h | 10 + .../delta/kossel_xl/Configuration.h | 10 + 6 files changed, 208 insertions(+), 87 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 38d3c36a8..2aebe2fad 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1796,6 +1796,162 @@ static void clean_up_after_endstop_or_probe_move() { } #endif // Z_PROBE_SLED +#if ENABLED(Z_PROBE_ALLEN_KEY) + void run_deploy_moves_script() { + #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Y + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_1_X, Z_PROBE_ALLEN_KEY_DEPLOY_1_Y, Z_PROBE_ALLEN_KEY_DEPLOY_1_Z, Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE); + #endif + #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_X + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Y + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_2_X, Z_PROBE_ALLEN_KEY_DEPLOY_2_Y, Z_PROBE_ALLEN_KEY_DEPLOY_2_Z, Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE); + #endif + #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Z) + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_X + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Y + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_3_X, Z_PROBE_ALLEN_KEY_DEPLOY_3_Y, Z_PROBE_ALLEN_KEY_DEPLOY_3_Z, Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE); + #endif + #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Z) + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_X + #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Y + #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE + #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_4_X, Z_PROBE_ALLEN_KEY_DEPLOY_4_Y, Z_PROBE_ALLEN_KEY_DEPLOY_4_Z, Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE); + #endif + #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Z) + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_X + #define Z_PROBE_ALLEN_KEY_DEPLOY_5_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Y + #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE + #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z, Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE); + #endif + } + void run_stow_moves_script() { + #if defined(Z_PROBE_ALLEN_KEY_STOW_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Z) + #ifndef Z_PROBE_ALLEN_KEY_STOW_1_X + #define Z_PROBE_ALLEN_KEY_STOW_1_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Y + #define Z_PROBE_ALLEN_KEY_STOW_1_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Z + #define Z_PROBE_ALLEN_KEY_STOW_1_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_1_X, Z_PROBE_ALLEN_KEY_STOW_1_Y, Z_PROBE_ALLEN_KEY_STOW_1_Z, Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE); + #endif + #if defined(Z_PROBE_ALLEN_KEY_STOW_2_X) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Z) + #ifndef Z_PROBE_ALLEN_KEY_STOW_2_X + #define Z_PROBE_ALLEN_KEY_STOW_2_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Y + #define Z_PROBE_ALLEN_KEY_STOW_2_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Z + #define Z_PROBE_ALLEN_KEY_STOW_2_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_2_X, Z_PROBE_ALLEN_KEY_STOW_2_Y, Z_PROBE_ALLEN_KEY_STOW_2_Z, Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE); + #endif + #if defined(Z_PROBE_ALLEN_KEY_STOW_3_X) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Z) + #ifndef Z_PROBE_ALLEN_KEY_STOW_3_X + #define Z_PROBE_ALLEN_KEY_STOW_3_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Y + #define Z_PROBE_ALLEN_KEY_STOW_3_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_3_X, Z_PROBE_ALLEN_KEY_STOW_3_Y, Z_PROBE_ALLEN_KEY_STOW_3_Z, Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE); + #endif + #if defined(Z_PROBE_ALLEN_KEY_STOW_4_X) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Z) + #ifndef Z_PROBE_ALLEN_KEY_STOW_4_X + #define Z_PROBE_ALLEN_KEY_STOW_4_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Y + #define Z_PROBE_ALLEN_KEY_STOW_4_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Z + #define Z_PROBE_ALLEN_KEY_STOW_4_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_4_X, Z_PROBE_ALLEN_KEY_STOW_4_Y, Z_PROBE_ALLEN_KEY_STOW_4_Z, Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE); + #endif + #if defined(Z_PROBE_ALLEN_KEY_STOW_5_X) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Z) + #ifndef Z_PROBE_ALLEN_KEY_STOW_5_X + #define Z_PROBE_ALLEN_KEY_STOW_5_X current_position[X_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Y + #define Z_PROBE_ALLEN_KEY_STOW_5_Y current_position[Y_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Z + #define Z_PROBE_ALLEN_KEY_STOW_5_Z current_position[Z_AXIS] + #endif + #ifndef Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE + #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0 + #endif + do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z, Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE); + #endif + } +#endif #if HAS_BED_PROBE @@ -1833,50 +1989,9 @@ static void clean_up_after_endstop_or_probe_move() { if (z_min_endstop) #endif { - // Move to the start position to initiate deployment - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z; - prepare_move_to_destination(); // this will also set_current_to_destination - - // Move to engage deployment - if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE; - if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X) - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X; - if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y; - if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z; - prepare_move_to_destination(); - - #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE; - - // Move to trigger deployment - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE; - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X) - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X; - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y; - if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z; - - prepare_move_to_destination(); - #endif + run_deploy_moves_script(); } - // Partially Home X,Y for safety - destination[X_AXIS] *= 0.75; - destination[Y_AXIS] *= 0.75; - prepare_move_to_destination(); // this will also set_current_to_destination - - feedrate = old_feedrate; - - stepper.synchronize(); - #if ENABLED(Z_MIN_PROBE_ENDSTOP) z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); if (z_probe_endstop) @@ -1923,51 +2038,7 @@ static void clean_up_after_endstop_or_probe_move() { #elif ENABLED(Z_PROBE_ALLEN_KEY) - float old_feedrate = feedrate; - - // Move up for safety - feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE; - - #if _Z_RAISE_PROBE_DEPLOY_STOW > 0 - destination[Z_AXIS] = current_position[Z_AXIS] + _Z_RAISE_PROBE_DEPLOY_STOW; - prepare_move_to_destination_raw(); // this will also set_current_to_destination - #endif - - // Move to the start position to initiate retraction - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X; - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z; - prepare_move_to_destination(); - - // Move the nozzle down to push the Z probe into retracted position - if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE; - if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X) - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X; - if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y) - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z; - prepare_move_to_destination(); - - // Move up for safety - if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE) - feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE; - if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X) - destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X; - if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y) - destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y; - destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z; - prepare_move_to_destination(); - - // Home XY for safety - feedrate = homing_feedrate[X_AXIS] / 2; - destination[X_AXIS] = 0; - destination[Y_AXIS] = 0; - prepare_move_to_destination(); // this will also set_current_to_destination - - feedrate = old_feedrate; - - stepper.synchronize(); + run_stow_moves_script(); #if ENABLED(Z_MIN_PROBE_ENDSTOP) bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 5dd547a51..3dfd2dd93 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -518,6 +518,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00 #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z 100.0 @@ -538,6 +543,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + #endif // Z_PROBE_ALLEN_KEY // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 509cfca31..396a40671 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -517,6 +517,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 @@ -532,6 +537,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + #endif // Z_PROBE_ALLEN_KEY // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index f2e3b46f9..53f0310b0 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -518,6 +518,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 @@ -535,6 +540,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) + #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + #endif // Z_PROBE_ALLEN_KEY // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 66781c796..ec37272de 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -509,6 +509,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00 #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z @@ -529,6 +534,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED + #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + #endif // Z_PROBE_ALLEN_KEY // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index c62d63d3f..1d17d17f1 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -515,6 +515,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 + //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 + //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 + //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + //#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position //#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 //#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 @@ -530,6 +535,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED + //#define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 + //#define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 + //#define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + //#define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + #endif // Z_PROBE_ALLEN_KEY // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. From 8555816a11a27730c9785606c97b8412777eeba1 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 6 Jul 2016 03:56:17 +0200 Subject: [PATCH 252/580] Generalize and simplify 'triggered when stowed test` The `PROBE_IS_TRIGGERED_WHEN_STOWED_TEST` is able to detect if a probe is successfully deployed/stowed. It was part of the Allen Key probes code only. Now the function is generally available. Currently this test is compulsory for Allen Key probes to not alter the used behaviour If you want to add the test for an other type of probe simply add ``` #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST ``` to your config. --- Marlin/Conditionals.h | 4 ++ Marlin/Marlin_main.cpp | 99 ++++++++++++++++++++++-------------------- 2 files changed, 56 insertions(+), 47 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index e3c72d76f..734b644be 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -753,6 +753,10 @@ #define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED) + #if ENABLED(Z_PROBE_ALLEN_KEY) + #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST + #endif + /** * Bed Probe dependencies */ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2aebe2fad..7fb99d6da 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1955,6 +1955,15 @@ static void clean_up_after_endstop_or_probe_move() { #if HAS_BED_PROBE + // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed. + #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST) + #if ENABLED(Z_MIN_PROBE_ENDSTOP) + #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) + #else + #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) + #endif + #endif + static void deploy_z_probe() { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1966,6 +1975,14 @@ static void clean_up_after_endstop_or_probe_move() { // Make room for probe do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); + #ifdef _TRIGGERED_WHEN_STOWED_TEST + // If endstop is already false, the Z probe is deployed + if (_TRIGGERED_WHEN_STOWED_TEST) { // closed after the probe specific actions. + // Would a goto be less ugly? + //while (!_TRIGGERED_WHEN_STOWED_TEST) { idle(); // would offer the opportunity + // for a triggered when stowed manual probe. + #endif + #if ENABLED(Z_PROBE_SLED) dock_sled(false); @@ -1976,37 +1993,8 @@ static void clean_up_after_endstop_or_probe_move() { DEPLOY_Z_SERVO(); #elif ENABLED(Z_PROBE_ALLEN_KEY) - float old_feedrate = feedrate; - - feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE; - - // If endstop is already false, the Z probe is deployed - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); - if (z_probe_endstop) - #else - bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (z_min_endstop) - #endif - { - run_deploy_moves_script(); - } - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); - if (z_probe_endstop) - #else - z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (z_min_endstop) - #endif - { - if (IsRunning()) { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed to engage!"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); - } - stop(); - } + run_deploy_moves_script(); #else @@ -2014,6 +2002,19 @@ static void clean_up_after_endstop_or_probe_move() { #endif + #ifdef _TRIGGERED_WHEN_STOWED_TEST + }; // opened before the probe specific actions + + if (_TRIGGERED_WHEN_STOWED_TEST) { + if (IsRunning()) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Z-Probe failed"); + LCD_ALERTMESSAGEPGM("Err: ZPROBE"); + } + stop(); + } + #endif + endstops.enable_z_probe(); } @@ -2027,7 +2028,14 @@ static void clean_up_after_endstop_or_probe_move() { // Make more room for the servo do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); - #if ENABLED(Z_PROBE_SLED) + #ifdef _TRIGGERED_WHEN_STOWED_TEST + // If endstop is already false, the Z probe is deployed + if (!_TRIGGERED_WHEN_STOWED_TEST) { // closed after the probe specific actions. + // Would a goto be less ugly? + //while (!_TRIGGERED_WHEN_STOWED_TEST) { idle(); // would offer the opportunity + // for a triggered when stowed manual probe. + + #if ENABLED(Z_PROBE_SLED) dock_sled(true); @@ -2040,28 +2048,25 @@ static void clean_up_after_endstop_or_probe_move() { run_stow_moves_script(); - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING); - if (!z_probe_endstop) - #else - bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); - if (!z_min_endstop) - #endif - { - if (IsRunning()) { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed to retract!"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); - } - stop(); - } - #else // Nothing to do here. Just clear endstops.z_probe_enabled #endif + #ifdef _TRIGGERED_WHEN_STOWED_TEST + }; // opened before the probe specific actions + if (!_TRIGGERED_WHEN_STOWED_TEST) { + if (IsRunning()) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM("Z-Probe failed!"); + LCD_ALERTMESSAGEPGM("Err: ZPROBE"); + } + stop(); + return true; + } + #endif + endstops.enable_z_probe(false); } From 16c83d203b9d5b0c797e2a0ee147ae3ecc3569a5 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 6 Jul 2016 03:40:21 +0200 Subject: [PATCH 253/580] Make use of the good features of a sled probe for all probes. Move and extend axis_unhomed test to deploy/stow_z_probe(). Move and extend position store/restore to deploy/stow_z_probe(). Now all kinds of probes can use the 'E' parameter in G29/M48. Allen key probes can be used now for grid and 3-point levelling. Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. Throw a compile time error when we try to configure an Allen Key probe homing to z-min and having no other z-min-endstop. --- Marlin/Marlin_main.cpp | 146 +++++++++++++---------------------------- Marlin/SanityCheck.h | 11 ++-- 2 files changed, 49 insertions(+), 108 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7fb99d6da..b9a88b512 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1735,7 +1735,7 @@ static void clean_up_after_endstop_or_probe_move() { #endif //HAS_BED_PROBE -#if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE +#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE static bool axis_unhomed_error(const bool x, const bool y, const bool z) { const bool xx = x && !axis_homed[X_AXIS], yy = y && !axis_homed[Y_AXIS], @@ -1783,16 +1783,10 @@ static void clean_up_after_endstop_or_probe_move() { } #endif - if (axis_unhomed_error(true, false, false)) return; - - float oldXpos = current_position[X_AXIS]; // save x position - // Dock sled a bit closer to ensure proper capturing do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0)); digitalWrite(SLED_PIN, !stow); // switch solenoid - do_blocking_move_to_x(oldXpos); // return to position before docking - } #endif // Z_PROBE_SLED @@ -1964,102 +1958,59 @@ static void clean_up_after_endstop_or_probe_move() { #endif #endif - static void deploy_z_probe() { + #define DEPLOY_PROBE() set_probe_deployed( true ) + #define STOW_PROBE() set_probe_deployed( false ) + + // returns false for ok and true for failure + static bool set_probe_deployed(bool deploy) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("deploy_z_probe", current_position); + if (DEBUGGING(LEVELING)) { + DEBUG_POS("set_probe_deployed", current_position); + SERIAL_ECHOPAIR("deploy: ", deploy); + } #endif - if (endstops.z_probe_enabled) return; + if (endstops.z_probe_enabled == deploy) return false; // Make room for probe do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); - #ifdef _TRIGGERED_WHEN_STOWED_TEST - // If endstop is already false, the Z probe is deployed - if (_TRIGGERED_WHEN_STOWED_TEST) { // closed after the probe specific actions. - // Would a goto be less ugly? - //while (!_TRIGGERED_WHEN_STOWED_TEST) { idle(); // would offer the opportunity - // for a triggered when stowed manual probe. - #endif - #if ENABLED(Z_PROBE_SLED) - - dock_sled(false); - - #elif HAS_Z_SERVO_ENDSTOP - - // Engage Z Servo endstop if enabled - DEPLOY_Z_SERVO(); - + if (axis_unhomed_error(true, false, false)) { stop(); return true; } #elif ENABLED(Z_PROBE_ALLEN_KEY) - - run_deploy_moves_script(); - - #else - - // Nothing to be done. Just enable_z_probe below... - + if (axis_unhomed_error(true, true, true )) { stop(); return true; } #endif - #ifdef _TRIGGERED_WHEN_STOWED_TEST - }; // opened before the probe specific actions - - if (_TRIGGERED_WHEN_STOWED_TEST) { - if (IsRunning()) { - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); - } - stop(); - } - #endif - - endstops.enable_z_probe(); - } - - static void stow_z_probe() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position); - #endif - - if (!endstops.z_probe_enabled) return; - - // Make more room for the servo - do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW); + float oldXpos = current_position[X_AXIS]; // save x position + float oldYpos = current_position[Y_AXIS]; // save y position #ifdef _TRIGGERED_WHEN_STOWED_TEST // If endstop is already false, the Z probe is deployed - if (!_TRIGGERED_WHEN_STOWED_TEST) { // closed after the probe specific actions. - // Would a goto be less ugly? + if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions. + // Would a goto be less ugly? //while (!_TRIGGERED_WHEN_STOWED_TEST) { idle(); // would offer the opportunity // for a triggered when stowed manual probe. + #endif - #if ENABLED(Z_PROBE_SLED) - - dock_sled(true); - + #if ENABLED(Z_PROBE_SLED) + dock_sled(!deploy); #elif HAS_Z_SERVO_ENDSTOP - - // Change the Z servo angle - STOW_Z_SERVO(); - + servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[((deploy) ? 0 : 1)]); #elif ENABLED(Z_PROBE_ALLEN_KEY) - - run_stow_moves_script(); - - #else - - // Nothing to do here. Just clear endstops.z_probe_enabled - + if (!deploy) run_stow_moves_script(); + else run_deploy_moves_script(); + #else + // Nothing to be done. Just enable_z_probe below... #endif #ifdef _TRIGGERED_WHEN_STOWED_TEST }; // opened before the probe specific actions - if (!_TRIGGERED_WHEN_STOWED_TEST) { + + if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { if (IsRunning()) { SERIAL_ERROR_START; - SERIAL_ERRORLNPGM("Z-Probe failed!"); + SERIAL_ERRORLNPGM("Z-Probe failed"); LCD_ALERTMESSAGEPGM("Err: ZPROBE"); } stop(); @@ -2067,7 +2018,9 @@ static void clean_up_after_endstop_or_probe_move() { } #endif - endstops.enable_z_probe(false); + do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy + endstops.enable_z_probe( deploy ); + return false; } // Do a single Z probe and return with current_position[Z_AXIS] @@ -2200,7 +2153,7 @@ static void clean_up_after_endstop_or_probe_move() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif - deploy_z_probe(); + if (DEPLOY_PROBE()) return NAN; float measured_z = run_z_probe(); @@ -2208,7 +2161,7 @@ static void clean_up_after_endstop_or_probe_move() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif - stow_z_probe(); + if (STOW_PROBE()) return NAN; } else { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2416,7 +2369,7 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif - deploy_z_probe(); + if (DEPLOY_PROBE()) return; } #endif @@ -2543,7 +2496,7 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif - stow_z_probe(); + if (STOW_PROBE()) return; } #endif @@ -3457,12 +3410,7 @@ inline void gcode_G28() { } bool dryrun = code_seen('D'); - - #if ENABLED(Z_PROBE_ALLEN_KEY) - const bool stow_probe_after_each = false; - #else - bool stow_probe_after_each = code_seen('E'); - #endif + bool stow_probe_after_each = code_seen('E'); #if ENABLED(AUTO_BED_LEVELING_GRID) @@ -3561,8 +3509,8 @@ inline void gcode_G28() { setup_for_endstop_or_probe_move(); - // Deploy the probe. Servo will raise if needed. - deploy_z_probe(); + // Deploy the probe. Probe will raise if needed. + if (DEPLOY_PROBE()) return; bed_leveling_in_progress = true; @@ -3667,7 +3615,7 @@ inline void gcode_G28() { #endif // !AUTO_BED_LEVELING_GRID // Raise to _Z_RAISE_PROBE_DEPLOY_STOW. Stow the probe. - stow_z_probe(); + if (STOW_PROBE()) return; // Restore state after probing clean_up_after_endstop_or_probe_move(); @@ -3874,12 +3822,12 @@ inline void gcode_G28() { /** * G31: Deploy the Z probe */ - inline void gcode_G31() { deploy_z_probe(); } + inline void gcode_G31() { DEPLOY_PROBE(); } /** * G32: Stow the Z probe */ - inline void gcode_G32() { stow_z_probe(); } + inline void gcode_G32() { STOW_PROBE(); } #endif // Z_PROBE_SLED @@ -4220,11 +4168,7 @@ inline void gcode_M42() { float X_current = current_position[X_AXIS], Y_current = current_position[Y_AXIS]; - #if ENABLED(Z_PROBE_ALLEN_KEY) - const bool stow_probe_after_each = false; - #else - bool stow_probe_after_each = code_seen('E'); - #endif + bool stow_probe_after_each = code_seen('E'); float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER; #if DISABLED(DELTA) @@ -4391,7 +4335,7 @@ inline void gcode_M42() { } // End of probe loop - stow_z_probe(); + if (STOW_PROBE()) return; if (verbose_level > 0) { SERIAL_PROTOCOLPGM("Mean: "); @@ -5967,12 +5911,12 @@ inline void gcode_M400() { stepper.synchronize(); } /** * M401: Engage Z Servo endstop if available */ - inline void gcode_M401() { deploy_z_probe(); } + inline void gcode_M401() { DEPLOY_PROBE(); } /** * M402: Retract Z Servo endstop if enabled */ - inline void gcode_M402() { stow_z_probe(); } + inline void gcode_M402() { STOW_PROBE(); } #endif // HAS_BED_PROBE diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 941821be2..b63877531 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -425,14 +425,11 @@ #endif /** - * Allen Key Z probe requires Delta and Auto Bed Leveling grid + * Allen Key + * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. */ -#if ENABLED(Z_PROBE_ALLEN_KEY) - #if !ENABLED(DELTA) - #error "Z_PROBE_ALLEN_KEY is only usable with DELTA." - #elif ENABLED(MESH_BED_LEVELING) || (ENABLED(AUTO_BED_LEVELING_FEATURE) && !ENABLED(AUTO_BED_LEVELING_GRID)) - #error "Z_PROBE_ALLEN_KEY can only use AUTO_BED_LEVELING_GRID leveling." - #endif +#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY" #endif /** From 160a2be11762dee7fb56e26a0ace6dca272fe179 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 09:17:50 -0700 Subject: [PATCH 254/580] Change cancel_heatup to wait_for_heatup --- Marlin/Marlin_main.cpp | 16 +++++++--------- Marlin/ultralcd.cpp | 2 +- Marlin/ultralcd.h | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c31002bca..747fa879e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -332,7 +332,7 @@ uint8_t active_extruder = 0; // Relative Mode. Enable with G91, disable with G90. static bool relative_mode = false; -bool cancel_heatup = false; +bool wait_for_heatup = true; const char errormagic[] PROGMEM = "Error:"; const char echomagic[] PROGMEM = "echo:"; @@ -1107,7 +1107,7 @@ inline void get_serial_commands() { // If command was e-stop process now if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); - if (strcmp(command, "M108") == 0) cancel_heatup = true; + if (strcmp(command, "M108") == 0) wait_for_heatup = false; #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 last_command_time = ms; @@ -4520,9 +4520,7 @@ inline void gcode_M105() { /** * M108: Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser */ -inline void gcode_M108() { - cancel_heatup = true; -} +inline void gcode_M108() { wait_for_heatup = false; } /** * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. @@ -4582,7 +4580,7 @@ inline void gcode_M109() { float theTarget = -1.0, old_temp = 9999.0; bool wants_to_cool = false; - cancel_heatup = false; + wait_for_heatup = true; millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; KEEPALIVE_STATE(NOT_BUSY); @@ -4646,7 +4644,7 @@ inline void gcode_M109() { } } - } while (!cancel_heatup && TEMP_CONDITIONS); + } while (wait_for_heatup && TEMP_CONDITIONS); LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); KEEPALIVE_STATE(IN_HANDLER); @@ -4676,7 +4674,7 @@ inline void gcode_M109() { float theTarget = -1.0, old_temp = 9999.0; bool wants_to_cool = false; - cancel_heatup = false; + wait_for_heatup = true; millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; KEEPALIVE_STATE(NOT_BUSY); @@ -4740,7 +4738,7 @@ inline void gcode_M109() { } } - } while (!cancel_heatup && TEMP_BED_CONDITIONS); + } while (wait_for_heatup && TEMP_BED_CONDITIONS); LCD_MESSAGEPGM(MSG_BED_DONE); KEEPALIVE_STATE(IN_HANDLER); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 304174330..ca0db6d67 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -559,7 +559,7 @@ static void lcd_status_screen() { stepper.quick_stop(); print_job_timer.stop(); thermalManager.autotempShutdown(); - cancel_heatup = true; + wait_for_heatup = false; lcd_setstatus(MSG_PRINT_ABORTED, true); #if DISABLED(DELTA) && DISABLED(SCARA) set_current_position_from_planner(); diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index fd5c4fc57..cc0a10fd3 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -95,7 +95,7 @@ extern int absPreheatHPBTemp; extern int absPreheatFanSpeed; - extern bool cancel_heatup; + extern bool wait_for_heatup; #if ENABLED(FILAMENT_LCD_DISPLAY) extern millis_t previous_lcd_status_ms; From b81b77111bce9063d8015fc323299578e3e064df Mon Sep 17 00:00:00 2001 From: petrzjunior Date: Wed, 6 Jul 2016 21:04:34 +0200 Subject: [PATCH 255/580] Update language_cz.h --- Marlin/language_cz.h | 69 +++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index 730ad6217..fabaf0e98 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -174,8 +174,8 @@ #define MSG_INIT_SDCARD "Nacist SD kartu" #define MSG_CNG_SDCARD "Vymenit SD kartu" #define MSG_ZPROBE_OUT "Sonda Z mimo podl" -#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST "first" +#define MSG_HOME "Domu" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "prvni" #define MSG_ZPROBE_ZOFFSET "Z ofset" #define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_Y "Babystep Y" @@ -199,28 +199,57 @@ #define MSG_DELTA_CALIBRATE_Y "Kalibrovat Y" #define MSG_DELTA_CALIBRATE_Z "Kalibrovat Z" #define MSG_DELTA_CALIBRATE_CENTER "Kalibrovat Stred" +#define MSG_INFO_MENU "O tiskarne" +#define MSG_INFO_PRINTER_MENU "Info o tiskarne" +#define MSG_INFO_STATS_MENU "Statistika" +#define MSG_INFO_BOARD_MENU "Info o desce" +#define MSG_INFO_THERMISTOR_MENU "Termistory" +#define MSG_INFO_EXTRUDERS "Extrudery" +#define MSG_INFO_BAUDRATE "Rychlost" +#define MSG_INFO_PROTOCOL "Protokol" +#if LCD_WIDTH > 19 + #define MSG_INFO_PRINT_COUNT "Pocet tisku " + #define MSG_INFO_FINISHED_PRINTS "Dokonceno " + #define MSG_INFO_PRINT_TIME "Celkovy cas " +#else + #define MSG_INFO_PRINT_COUNT "Tisky " + #define MSG_INFO_FINISHED_PRINTS "Hotovo " + #define MSG_INFO_PRINT_TIME "Cas " +#endif +#define MSG_INFO_MIN_TEMP "Teplota min" +#define MSG_INFO_MAX_TEMP "Teplota max" +#define MSG_INFO_PSU "Nap. zdroj" #define MSG_FILAMENT_CHANGE_HEADER "VYMENA FILAMENTU" -#define MSG_FILAMENT_CHANGE_INIT_1 "Cekejte prosim" -#define MSG_FILAMENT_CHANGE_INIT_2 "na zahajeni" -#define MSG_FILAMENT_CHANGE_INIT_3 "vymeny filamentu" -#define MSG_FILAMENT_CHANGE_UNLOAD_1 "Cekejte prosim" -#define MSG_FILAMENT_CHANGE_UNLOAD_2 "na vysunuti" -#define MSG_FILAMENT_CHANGE_UNLOAD_3 "filamentu" -#define MSG_FILAMENT_CHANGE_INSERT_1 "Vlozte filament" -#define MSG_FILAMENT_CHANGE_INSERT_2 "a stisknete" -#define MSG_FILAMENT_CHANGE_INSERT_3 "tlacitko..." -#define MSG_FILAMENT_CHANGE_LOAD_1 "Cekejte prosim" -#define MSG_FILAMENT_CHANGE_LOAD_2 "na zavedeni" -#define MSG_FILAMENT_CHANGE_LOAD_3 "filamentu" -#define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Cekejte prosim" -#define MSG_FILAMENT_CHANGE_EXTRUDE_2 "na vytlaceni" -#define MSG_FILAMENT_CHANGE_EXTRUDE_3 "filamentu" #define MSG_FILAMENT_CHANGE_OPTION_HEADER "CO DAL?" #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Jeste vytlacit" #define MSG_FILAMENT_CHANGE_OPTION_RESUME "Obnovit tisk" -#define MSG_FILAMENT_CHANGE_RESUME_1 "Cekejte prosim" -#define MSG_FILAMENT_CHANGE_RESUME_2 "na pokracovani" -#define MSG_FILAMENT_CHANGE_RESUME_3 "tisku" +#if LCD_HEIGHT >= 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "Cekejte prosim" + #define MSG_FILAMENT_CHANGE_INIT_2 "na zahajeni" + #define MSG_FILAMENT_CHANGE_INIT_3 "vymeny filamentu" + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Cekejte prosim" + #define MSG_FILAMENT_CHANGE_UNLOAD_2 "na vysunuti" + #define MSG_FILAMENT_CHANGE_UNLOAD_3 "filamentu" + #define MSG_FILAMENT_CHANGE_INSERT_1 "Vlozte filament" + #define MSG_FILAMENT_CHANGE_INSERT_2 "a stisknete" + #define MSG_FILAMENT_CHANGE_INSERT_3 "tlacitko..." + #define MSG_FILAMENT_CHANGE_LOAD_1 "Cekejte prosim" + #define MSG_FILAMENT_CHANGE_LOAD_2 "na zavedeni" + #define MSG_FILAMENT_CHANGE_LOAD_3 "filamentu" + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Cekejte prosim" + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "na vytlaceni" + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "filamentu" + #define MSG_FILAMENT_CHANGE_RESUME_1 "Cekejte prosim" + #define MSG_FILAMENT_CHANGE_RESUME_2 "na pokracovani" + #define MSG_FILAMENT_CHANGE_RESUME_3 "tisku" +#else // LCD_HEIGHT < 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "Cekejte..." + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Vysouvani..." + #define MSG_FILAMENT_CHANGE_INSERT_1 "Vlozte, kliknete" + #define MSG_FILAMENT_CHANGE_LOAD_1 "Zavadeni..." + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Vytlacovani..." + #define MSG_FILAMENT_CHANGE_RESUME_1 "Pokracovani..." +#endif // LCD_HEIGHT < 4 #endif // LANGUAGE_CZ_H From cf8ec1216a819dddfd3a98d91dda17e867d546bf Mon Sep 17 00:00:00 2001 From: Philip Schell Date: Wed, 6 Jul 2016 21:44:16 +0200 Subject: [PATCH 256/580] Update language_de.h for German translation @MarlinFirmware/language-team my changes for the German language. Feel free to improve :) --- Marlin/language_de.h | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/Marlin/language_de.h b/Marlin/language_de.h index 58acd9527..2b29eaa59 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -171,4 +171,52 @@ #define MSG_DELTA_CALIBRATE_Z "Kalibriere Z" #define MSG_DELTA_CALIBRATE_CENTER "Kalibriere Mitte" +#define MSG_INFO_MENU "Über den Drucker" +#define MSG_INFO_PRINTER_MENU "Drucker Info" +#define MSG_INFO_STATS_MENU "Drucker Stats" +#define MSG_INFO_BOARD_MENU "Board Info" +#define MSG_INFO_THERMISTOR_MENU "Thermistors" +#define MSG_INFO_EXTRUDERS "Extruders" +#define MSG_INFO_BAUDRATE "Baud" +#define MSG_INFO_PROTOCOL "Protokol" +#define MSG_INFO_TOTAL_PRINTS "Gesamte Drucke" +#define MSG_INFO_FINISHED_PRINTS "Beendete Drucke" +#define MSG_INFO_PRINT_TIME "Gesamte Druckzeit" +#define MSG_INFO_MIN_TEMP "Min Temp" +#define MSG_INFO_MAX_TEMP "Max Temp" +#define MSG_INFO_PSU "Stromversorgung" + +#define MSG_FILAMENT_CHANGE_HEADER "ÄNDERE FILAMENT" +#define MSG_FILAMENT_CHANGE_OPTION_HEADER "ÄNDERE OPTIONEN:" +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Extrude mehr" +#define MSG_FILAMENT_CHANGE_OPTION_RESUME "Drucke weiter" + +#if LCD_HEIGHT >= 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "Warte auf den" + #define MSG_FILAMENT_CHANGE_INIT_2 "Start zum " + #define MSG_FILAMENT_CHANGE_INIT_3 "Filament wechsel" + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Warte auf das" + #define MSG_FILAMENT_CHANGE_UNLOAD_2 "herrausnehmen" + #define MSG_FILAMENT_CHANGE_UNLOAD_3 "des Filaments" + #define MSG_FILAMENT_CHANGE_INSERT_1 "Fädel Filament" + #define MSG_FILAMENT_CHANGE_INSERT_2 "ein und drücke" + #define MSG_FILAMENT_CHANGE_INSERT_3 "den Knopf..." + #define MSG_FILAMENT_CHANGE_LOAD_1 "Warte auf das" + #define MSG_FILAMENT_CHANGE_LOAD_2 "laden des" + #define MSG_FILAMENT_CHANGE_LOAD_3 "Filaments" + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Warte auf das" + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "Extruden des" + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "Filaments" + #define MSG_FILAMENT_CHANGE_RESUME_1 "Warte auf das" + #define MSG_FILAMENT_CHANGE_RESUME_2 "fortfahren des" + #define MSG_FILAMENT_CHANGE_RESUME_3 "Druckes" +#else // LCD_HEIGHT < 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "Bitte warten..." + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Auswerfen..." + #define MSG_FILAMENT_CHANGE_INSERT_1 "Laden und Klick" + #define MSG_FILAMENT_CHANGE_LOAD_1 "Laden..." + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Extruden..." + #define MSG_FILAMENT_CHANGE_RESUME_1 "Weitermachen..." +#endif // LCD_HEIGHT < 4 + #endif // LANGUAGE_DE_H From e0a6b978f5f549b4906ac3590aa3442e4135d624 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 5 Jul 2016 18:32:24 -0700 Subject: [PATCH 257/580] Don't do_probe_raise with MIN_Z_HEIGHT_FOR_HOMING --- Marlin/Marlin_main.cpp | 46 +++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e38b7bcb6..2bf87fd9a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1728,9 +1728,8 @@ static void clean_up_after_endstop_or_probe_move() { if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) z_dest -= zprobe_zoffset; - if (z_dest > current_position[Z_AXIS]) { + if (z_dest > current_position[Z_AXIS]) do_blocking_move_to_z(z_dest); - } } #endif //HAS_BED_PROBE @@ -2860,6 +2859,8 @@ inline void gcode_G28() { home_all_axis = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ); + set_destination_to_current(); + #if Z_HOME_DIR > 0 // If homing away from BED do Z first if (home_all_axis || homeZ) { @@ -2871,34 +2872,25 @@ inline void gcode_G28() { #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 + // Raise Z before homing any other axes and z is not already high enough (never lower z) + float z_dest = (current_position[Z_AXIS] += MIN_Z_HEIGHT_FOR_HOMING); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest); + SERIAL_EOL; + } + #endif + + feedrate = homing_feedrate[Z_AXIS]; + #if HAS_BED_PROBE - do_probe_raise(MIN_Z_HEIGHT_FOR_HOMING); - destination[Z_AXIS] = current_position[Z_AXIS]; + do_blocking_move_to_z(z_dest); #else - // Raise Z before homing any other axes and z is not already high enough (never lower z) - if (current_position[Z_AXIS] <= MIN_Z_HEIGHT_FOR_HOMING) { - destination[Z_AXIS] = MIN_Z_HEIGHT_FOR_HOMING; - feedrate = planner.max_feedrate[Z_AXIS] * 60; // feedrate (mm/m) = max_feedrate (mm/s) - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise Z (before homing) to ", (MIN_Z_HEIGHT_FOR_HOMING)); - SERIAL_EOL; - DEBUG_POS("> (home_all_axis || homeZ)", current_position); - DEBUG_POS("> (home_all_axis || homeZ)", destination); - } - #endif - line_to_destination(); - stepper.synchronize(); - - /** - * Update the current Z position even if it currently not real from - * Z-home otherwise each call to line_to_destination() will want to - * move Z-axis by MIN_Z_HEIGHT_FOR_HOMING. - */ - current_position[Z_AXIS] = destination[Z_AXIS]; - } + line_to_z(z_dest); + stepper.synchronize(); #endif - #endif + + #endif // MIN_Z_HEIGHT_FOR_HOMING #if ENABLED(QUICK_HOME) From d0b29cabf33832dc19ddd9dff0a6b1d1e090c703 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 5 Jul 2016 20:10:15 -0700 Subject: [PATCH 258/580] Don't re-home X and Y if you quick homed --- Marlin/Marlin_main.cpp | 118 ++++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2bf87fd9a..37ccd983c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2763,6 +2763,57 @@ inline void gcode_G4() { } #endif +#if ENABLED(QUICK_HOME) + + static void quick_home_xy() { + + current_position[X_AXIS] = current_position[Y_AXIS] = 0; + + #if ENABLED(DUAL_X_CARRIAGE) + int x_axis_home_dir = x_home_dir(active_extruder); + extruder_duplication_enabled = false; + #else + int x_axis_home_dir = home_dir(X_AXIS); + #endif + + SYNC_PLAN_POSITION_KINEMATIC(); + + float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), + mlratio = mlx > mly ? mly / mlx : mlx / mly; + + destination[X_AXIS] = 1.5 * mlx * x_axis_home_dir; + destination[Y_AXIS] = 1.5 * mly * home_dir(Y_AXIS); + feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1); + line_to_destination(); + stepper.synchronize(); + + set_axis_is_at_home(X_AXIS); + set_axis_is_at_home(Y_AXIS); + SYNC_PLAN_POSITION_KINEMATIC(); + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 1", current_position); + #endif + + destination[X_AXIS] = current_position[X_AXIS]; + destination[Y_AXIS] = current_position[Y_AXIS]; + line_to_destination(); + stepper.synchronize(); + endstops.hit_on_purpose(); // clear endstop hit flags + + current_position[X_AXIS] = destination[X_AXIS]; + current_position[Y_AXIS] = destination[Y_AXIS]; + #if DISABLED(SCARA) + current_position[Z_AXIS] = destination[Z_AXIS]; + #endif + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 2", current_position); + #endif + } + +#endif // QUICK_HOME + /** * G28: Home all axes according to settings * @@ -2814,16 +2865,9 @@ inline void gcode_G28() { setup_for_endstop_move(); - /** - * Directly after a reset this is all 0. Later we get a hint if we have - * to raise z or not. - */ - set_destination_to_current(); - #if ENABLED(DELTA) /** - * A delta can only safely home all axis at the same time - * all axis have to home at the same time + * A delta can only safely home all axes at the same time */ // Pretend the current position is 0,0,0 @@ -2894,67 +2938,29 @@ inline void gcode_G28() { #if ENABLED(QUICK_HOME) - if (home_all_axis || (homeX && homeY)) { // First diagonal move - - current_position[X_AXIS] = current_position[Y_AXIS] = 0; - - #if ENABLED(DUAL_X_CARRIAGE) - int x_axis_home_dir = x_home_dir(active_extruder); - extruder_duplication_enabled = false; - #else - int x_axis_home_dir = home_dir(X_AXIS); - #endif - - SYNC_PLAN_POSITION_KINEMATIC(); - - float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), - mlratio = mlx > mly ? mly / mlx : mlx / mly; - - destination[X_AXIS] = 1.5 * mlx * x_axis_home_dir; - destination[Y_AXIS] = 1.5 * mly * home_dir(Y_AXIS); - feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1); - line_to_destination(); - stepper.synchronize(); - - set_axis_is_at_home(X_AXIS); - set_axis_is_at_home(Y_AXIS); - SYNC_PLAN_POSITION_KINEMATIC(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 1", current_position); - #endif - - destination[X_AXIS] = current_position[X_AXIS]; - destination[Y_AXIS] = current_position[Y_AXIS]; - line_to_destination(); - stepper.synchronize(); - endstops.hit_on_purpose(); // clear endstop hit flags + bool quick_homed = home_all_axis || (homeX && homeY); + if (quick_homed) quick_home_xy(); - current_position[X_AXIS] = destination[X_AXIS]; - current_position[Y_AXIS] = destination[Y_AXIS]; - #if DISABLED(SCARA) - current_position[Z_AXIS] = destination[Z_AXIS]; - #endif + #else - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 2", current_position); - #endif - } + const bool quick_homed = false; - #endif // QUICK_HOME + #endif #if ENABLED(HOME_Y_BEFORE_X) + // Home Y - if (home_all_axis || homeY) { + if (!quick_homed && (home_all_axis || homeY)) { HOMEAXIS(Y); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position); #endif } + #endif // Home X - if (home_all_axis || homeX) { + if (!quick_homed && (home_all_axis || homeX)) { #if ENABLED(DUAL_X_CARRIAGE) int tmp_extruder = active_extruder; extruder_duplication_enabled = false; @@ -2977,7 +2983,7 @@ inline void gcode_G28() { #if DISABLED(HOME_Y_BEFORE_X) // Home Y - if (home_all_axis || homeY) { + if (!quick_homed && (home_all_axis || homeY)) { HOMEAXIS(Y); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position); From d7e964750586db2b253adf79524c7b632adeea4d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 5 Jul 2016 20:09:30 -0700 Subject: [PATCH 259/580] Sanity Check for probe raises --- Marlin/Conditionals.h | 11 ++++------- Marlin/SanityCheck.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 734b644be..1c6aa9abc 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -783,14 +783,11 @@ #define XY_PROBE_SPEED 4000 #endif #endif - #ifndef Z_RAISE_PROBE_DEPLOY_STOW - #if defined(Z_RAISE_BEFORE_PROBING) && defined(Z_RAISE_AFTER_PROBING) - #define Z_RAISE_PROBE_DEPLOY_STOW (max(Z_RAISE_BEFORE_PROBING, Z_RAISE_AFTER_PROBING)) - #else - #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration." - #endif + #if Z_RAISE_BETWEEN_PROBINGS > Z_RAISE_PROBE_DEPLOY_STOW + #define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_BETWEEN_PROBINGS + #else + #define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_PROBE_DEPLOY_STOW #endif - #define _Z_RAISE_PROBE_DEPLOY_STOW (max(Z_RAISE_PROBE_DEPLOY_STOW, Z_RAISE_BETWEEN_PROBINGS)) #endif /** diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index b63877531..b075cd4c7 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -293,6 +293,21 @@ //#endif #endif + /** + * Make sure Z raise values are set + */ + #if defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) + #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_RAISE_PROBE_DEPLOY_STOW instead." + #elif !defined(Z_RAISE_PROBE_DEPLOY_STOW) + #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration." + #elif !defined(Z_RAISE_BETWEEN_PROBINGS) + #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration." + #elif Z_RAISE_PROBE_DEPLOY_STOW < 1 + #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 1." + #elif Z_RAISE_BETWEEN_PROBINGS < 1 + #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 1." + #endif + #else /** From 6559f7359f90d7fd7a72186b881b6c5f90cf3025 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 16:21:51 -0700 Subject: [PATCH 260/580] Fix comment on Z raise for homing, save a few bytes --- Marlin/Marlin_main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 37ccd983c..d7afc0355 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2916,11 +2916,11 @@ inline void gcode_G28() { #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 - // Raise Z before homing any other axes and z is not already high enough (never lower z) - float z_dest = (current_position[Z_AXIS] += MIN_Z_HEIGHT_FOR_HOMING); + // Raise Z before homing, if specified + destination[Z_AXIS] = (current_position[Z_AXIS] += MIN_Z_HEIGHT_FOR_HOMING); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest); + SERIAL_ECHOPAIR("Raise Z (before homing) to ", destination[Z_AXIS]); SERIAL_EOL; } #endif @@ -2928,9 +2928,9 @@ inline void gcode_G28() { feedrate = homing_feedrate[Z_AXIS]; #if HAS_BED_PROBE - do_blocking_move_to_z(z_dest); + do_blocking_move_to_z(destination[Z_AXIS]); #else - line_to_z(z_dest); + line_to_z(destination[Z_AXIS]); stepper.synchronize(); #endif From e2f7cb0905569283ce24e13f1e1869ce91911119 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 18:37:21 -0700 Subject: [PATCH 261/580] Don't use axis_codes if a literal will do --- Marlin/Marlin_main.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 37ccd983c..2dc8e2427 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2897,9 +2897,7 @@ inline void gcode_G28() { #else // NOT DELTA - bool homeX = code_seen(axis_codes[X_AXIS]), - homeY = code_seen(axis_codes[Y_AXIS]), - homeZ = code_seen(axis_codes[Z_AXIS]); + bool homeX = code_seen('X'), homeY = code_seen('Y'), homeZ = code_seen('Z'); home_all_axis = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ); @@ -3522,7 +3520,7 @@ inline void gcode_G28() { delta_grid_spacing[0] = xGridSpacing; delta_grid_spacing[1] = yGridSpacing; float zoffset = zprobe_zoffset; - if (code_seen(axis_codes[Z_AXIS])) zoffset += code_value_axis_units(Z_AXIS); + if (code_seen('Z')) zoffset += code_value_axis_units(Z_AXIS); #else // !DELTA /** * solve the plane equation ax + by + d = z @@ -3835,7 +3833,7 @@ inline void gcode_G28() { * G92: Set current position to given X Y Z E */ inline void gcode_G92() { - bool didE = code_seen(axis_codes[E_AXIS]); + bool didE = code_seen('E'); if (!didE) stepper.synchronize(); @@ -5017,7 +5015,7 @@ inline void gcode_M18_M84() { stepper_inactive_time = code_value_millis_from_seconds(); } else { - bool all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])) || (code_seen(axis_codes[E_AXIS]))); + bool all_axis = !((code_seen('X')) || (code_seen('Y')) || (code_seen('Z')) || (code_seen('E'))); if (all_axis) { stepper.finish_and_disable(); } @@ -5265,11 +5263,9 @@ inline void gcode_M201() { * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec */ inline void gcode_M203() { - for (int8_t i = 0; i < NUM_AXIS; i++) { - if (code_seen(axis_codes[i])) { + for (int8_t i = 0; i < NUM_AXIS; i++) + if (code_seen(axis_codes[i])) planner.max_feedrate[i] = code_value_axis_units(i); - } - } } /** From 9c5b462ef25abfd53ae6f30b9fdca5ade9e6e829 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 7 Jul 2016 11:42:19 -0700 Subject: [PATCH 262/580] Move XYZ in print_xyz and DEBUG_POS to the front --- Marlin/Marlin_main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 37ccd983c..de402d3fc 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -573,19 +573,19 @@ void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); static void report_current_position(); #if ENABLED(DEBUG_LEVELING_FEATURE) - void print_xyz(const char* prefix, const float x, const float y, const float z) { - SERIAL_ECHO(prefix); - SERIAL_ECHOPAIR(": (", x); + void print_xyz(const char* suffix, const float x, const float y, const float z) { + SERIAL_ECHOPAIR("(", x); SERIAL_ECHOPAIR(", ", y); SERIAL_ECHOPAIR(", ", z); - SERIAL_ECHOLNPGM(")"); + SERIAL_ECHOLNPGM(") "); + SERIAL_ECHO(suffix); } - void print_xyz(const char* prefix, const float xyz[]) { - print_xyz(prefix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); + void print_xyz(const char* suffix, const float xyz[]) { + print_xyz(suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); } #if ENABLED(AUTO_BED_LEVELING_FEATURE) - void print_xyz(const char* prefix, const vector_3 &xyz) { - print_xyz(prefix, xyz.x, xyz.y, xyz.z); + void print_xyz(const char* suffix, const vector_3 &xyz) { + print_xyz(suffix, xyz.x, xyz.y, xyz.z); } #endif #define DEBUG_POS(PREFIX,VAR) do{ SERIAL_ECHOPGM(PREFIX); print_xyz(" > " STRINGIFY(VAR), VAR); }while(0) From 177ec20bf0001ac8473b325f028877be5b0c13e5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 7 Jul 2016 12:13:14 -0700 Subject: [PATCH 263/580] Revert quick-home changes --- Marlin/Marlin_main.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 836b54311..967f9b3f4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2936,19 +2936,14 @@ inline void gcode_G28() { #if ENABLED(QUICK_HOME) - bool quick_homed = home_all_axis || (homeX && homeY); - if (quick_homed) quick_home_xy(); - - #else - - const bool quick_homed = false; + if (home_all_axis || (homeX && homeY)) quick_home_xy(); #endif #if ENABLED(HOME_Y_BEFORE_X) // Home Y - if (!quick_homed && (home_all_axis || homeY)) { + if (home_all_axis || homeY) { HOMEAXIS(Y); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position); @@ -2958,7 +2953,7 @@ inline void gcode_G28() { #endif // Home X - if (!quick_homed && (home_all_axis || homeX)) { + if (home_all_axis || homeX) { #if ENABLED(DUAL_X_CARRIAGE) int tmp_extruder = active_extruder; extruder_duplication_enabled = false; @@ -2981,7 +2976,7 @@ inline void gcode_G28() { #if DISABLED(HOME_Y_BEFORE_X) // Home Y - if (!quick_homed && (home_all_axis || homeY)) { + if (home_all_axis || homeY) { HOMEAXIS(Y); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position); From 0b6f8f82442a55b60fa1d62116be83a1169b0d8f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 7 Jul 2016 12:14:54 -0700 Subject: [PATCH 264/580] Apply MIN_Z_HEIGHT_FOR_HOMING raise literally --- Marlin/Marlin_main.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 967f9b3f4..dbac3f111 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2915,22 +2915,27 @@ inline void gcode_G28() { #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 // Raise Z before homing, if specified - destination[Z_AXIS] = (current_position[Z_AXIS] += MIN_Z_HEIGHT_FOR_HOMING); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise Z (before homing) to ", destination[Z_AXIS]); - SERIAL_EOL; - } - #endif + float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING; + if (z_dest > current_position[Z_AXIS]) { - feedrate = homing_feedrate[Z_AXIS]; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest); + SERIAL_EOL; + } + #endif - #if HAS_BED_PROBE - do_blocking_move_to_z(destination[Z_AXIS]); - #else - line_to_z(destination[Z_AXIS]); - stepper.synchronize(); - #endif + feedrate = homing_feedrate[Z_AXIS]; + + #if HAS_BED_PROBE + do_blocking_move_to_z(z_dest); + #else + line_to_z(z_dest); + stepper.synchronize(); + #endif + + destination[Z_AXIS] = current_position[Z_AXIS] = z_dest; + } #endif // MIN_Z_HEIGHT_FOR_HOMING From 4036c73cdd93e90e80d23e80afc8192fb3fa24ec Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 7 Jul 2016 12:28:23 -0700 Subject: [PATCH 265/580] Don't raise Z if only homing Z --- Marlin/Marlin_main.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index dbac3f111..1a8028bda 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2914,27 +2914,29 @@ inline void gcode_G28() { #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 - // Raise Z before homing, if specified - float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING; - if (z_dest > current_position[Z_AXIS]) { + // Raise Z before homing X or Y, if specified + if (home_all_axis || homeX || homeY) { + float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING; + if (z_dest > current_position[Z_AXIS]) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest); - SERIAL_EOL; - } - #endif + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest); + SERIAL_EOL; + } + #endif - feedrate = homing_feedrate[Z_AXIS]; + feedrate = homing_feedrate[Z_AXIS]; - #if HAS_BED_PROBE - do_blocking_move_to_z(z_dest); - #else - line_to_z(z_dest); - stepper.synchronize(); - #endif + #if HAS_BED_PROBE + do_blocking_move_to_z(z_dest); + #else + line_to_z(z_dest); + stepper.synchronize(); + #endif - destination[Z_AXIS] = current_position[Z_AXIS] = z_dest; + destination[Z_AXIS] = current_position[Z_AXIS] = z_dest; + } } #endif // MIN_Z_HEIGHT_FOR_HOMING From a129078927c8968022569175cec7fea35c920fd2 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 4 Jul 2016 23:23:22 +0200 Subject: [PATCH 266/580] Add an emergency-command parser to MarlinSerial (supporting M108) Add an emergency-command parser to MarlinSerial's RX interrupt. The parser tries to find and execute M108,M112,M410 before the commands disappear in the RX-buffer. To avoid false positives for M117, comments and commands followed by filenames (M23, M28, M30, M32, M33) are filtered. This enables Marlin to receive and react on the Emergency command at all times - regardless of whether the buffers are full or not. It remains to convince hosts to send the commands. To inform the hosts about the new feature a new entry in the M115-report was made. "`EMERGENCY_CODES:M112,M108,M410;`". The parser is fast. It only ever needs two switch decisions and one assignment of the new state for every character. One problem remains. If the host has sent an incomplete line before sending an emergency command the emergency command could be omitted when the parser is in `state_IGNORE`. In that case the host should send "\ncommand\n" Also introduces M108 to break the waiting for the heaters in M109, M190 and M303. Rename `cancel_heatup` to `wait_for_heatup` to better see the purpose. --- Marlin/Conditionals.h | 6 + Marlin/Configuration_adv.h | 6 + Marlin/Marlin.h | 1 + Marlin/MarlinSerial.cpp | 158 ++++++++++++++++++ Marlin/MarlinSerial.h | 9 + Marlin/Marlin_main.cpp | 65 ++++--- Marlin/SanityCheck.h | 7 + .../Cartesio/Configuration_adv.h | 6 + .../Felix/Configuration_adv.h | 6 + .../Hephestos/Configuration_adv.h | 6 + .../Hephestos_2/Configuration_adv.h | 6 + .../K8200/Configuration_adv.h | 6 + .../K8400/Configuration_adv.h | 6 + .../RigidBot/Configuration_adv.h | 6 + .../SCARA/Configuration_adv.h | 6 + .../TAZ4/Configuration_adv.h | 6 + .../WITBOX/Configuration_adv.h | 6 + .../delta/biv2.5/Configuration_adv.h | 6 + .../delta/generic/Configuration_adv.h | 6 + .../delta/kossel_mini/Configuration_adv.h | 6 + .../delta/kossel_pro/Configuration_adv.h | 6 + .../delta/kossel_xl/Configuration_adv.h | 6 + .../makibox/Configuration_adv.h | 6 + .../tvrrug/Round2/Configuration_adv.h | 6 + Marlin/language.h | 2 +- Marlin/temperature.cpp | 5 +- 26 files changed, 335 insertions(+), 26 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 1c6aa9abc..6b8a682ac 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -284,6 +284,12 @@ #define HardwareSerial_h // trick to disable the standard HWserial #endif + #if ENABLED(EMERGENCY_PARSER) + #define EMERGENCY_PARSER_CAPABILITIES " EMERGENCY_CODES:M108,M112,M410" + #else + #define EMERGENCY_PARSER_CAPABILITIES "" + #endif + #include "Arduino.h" /** diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 3a673a673..93ca69391 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 616a8bf35..9d40ce161 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -288,6 +288,7 @@ extern float sw_endstop_min[3]; // axis[n].sw_endstop_min extern float sw_endstop_max[3]; // axis[n].sw_endstop_max extern bool axis_known_position[3]; // axis[n].is_known extern bool axis_homed[3]; // axis[n].is_homed +extern bool wait_for_heatup; // GCode support for external objects bool code_seen(char); diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index e6362fc7c..7f1920528 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -30,6 +30,7 @@ #include "Marlin.h" #include "MarlinSerial.h" +#include "stepper.h" #ifndef USBCON // this next line disables the entire HardwareSerial.cpp, @@ -54,6 +55,10 @@ FORCE_INLINE void store_char(unsigned char c) { rx_buffer.head = i; } CRITICAL_SECTION_END; + + #if ENABLED(EMERGENCY_PARSER) + emergency_parser(c); + #endif } @@ -310,3 +315,156 @@ MarlinSerial customizedSerial; #if defined(USBCON) && ENABLED(BLUETOOTH) HardwareSerial bluetoothSerial; #endif + +#if ENABLED(EMERGENCY_PARSER) + + // Currently looking for: M108, M112, M410 + // If you alter the parser please don't forget to update the capabilities in Conditionals.h + + void emergency_parser(unsigned char c) { + + enum e_parser_state { + state_RESET, + state_M, + state_M1, + state_M10, + state_M11, + state_M2, + state_M3, + state_M4, + state_M41, + state_IGNORE // to '\n' + }; + + static e_parser_state state = state_RESET; + + switch (state) { + case state_RESET: + switch (c) { + case 'M': + state = state_M; + break; + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_M: + switch (c) { + case '1': + state = state_M1; + break; + case '2': + state = state_M2; + break; + case '3': + state = state_M3; + break; + case '4': + state = state_M4; + break; + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_M1: + switch (c) { + case '0': + state = state_M10; + break; + case '1': + state = state_M11; + break; + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_M2: + switch (c) { + case '3': // M23 + case '8': // M28 + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_M3: + switch (c) { + case '0': // M30 + case '2': // M32 + case '3': // M33 + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_M10: + switch (c) { + case '8': // M108 + { state = state_RESET; wait_for_heatup = false; } + break; + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_M11: + switch (c) { + case '2': // M112 + state = state_RESET; kill(PSTR(MSG_KILLED)); + break; + case '7': // M117 + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_M4: + switch (c) { + case '1': + state = state_M41; + break; + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_M41: + switch (c) { + case '0': + { state = state_RESET; stepper.quick_stop(); } + break; + case ';': + state = state_IGNORE; + break; + default: state = state_RESET; + } + break; + + case state_IGNORE: + if (c == '\n') state = state_RESET; + break; + + default: + state = state_RESET; + } + } +#endif diff --git a/Marlin/MarlinSerial.h b/Marlin/MarlinSerial.h index 34d234615..b27b98169 100644 --- a/Marlin/MarlinSerial.h +++ b/Marlin/MarlinSerial.h @@ -101,6 +101,11 @@ struct ring_buffer { extern ring_buffer rx_buffer; #endif +#if ENABLED(EMERGENCY_PARSER) + #include "language.h" + void emergency_parser(unsigned char c); +#endif + class MarlinSerial { //: public Stream public: @@ -141,6 +146,10 @@ class MarlinSerial { //: public Stream rx_buffer.head = i; } CRITICAL_SECTION_END; + + #if ENABLED(EMERGENCY_PARSER) + emergency_parser(c); + #endif } } diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 836b54311..ab7ef8f05 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -160,7 +160,7 @@ * M105 - Read current temp * M106 - Fan on * M107 - Fan off - * M108 - Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser + * M108 - Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature. * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling * IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F @@ -1105,9 +1105,12 @@ inline void get_serial_commands() { } } - // If command was e-stop process now - if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); - if (strcmp(command, "M108") == 0) wait_for_heatup = false; + #if DISABLED(EMERGENCY_PARSER) + // If command was e-stop process now + if (strcmp(command, "M108") == 0) wait_for_heatup = false; + if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); + if (strcmp(command, "M410") == 0) stepper.quick_stop(); + #endif #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 last_command_time = ms; @@ -4533,10 +4536,14 @@ inline void gcode_M105() { #endif // FAN_COUNT > 0 -/** - * M108: Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser - */ -inline void gcode_M108() { wait_for_heatup = false; } +#if DISABLED(EMERGENCY_PARSER) + + /** + * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature. + */ + inline void gcode_M108() { wait_for_heatup = false; } + +#endif /** * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. @@ -4811,7 +4818,9 @@ inline void gcode_M111() { /** * M112: Emergency Stop */ -inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } +#if DISABLED(EMERGENCY_PARSER) + inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } +#endif #if ENABLED(HOST_KEEPALIVE_FEATURE) @@ -5991,13 +6000,15 @@ inline void gcode_M400() { stepper.synchronize(); } * This will stop the carriages mid-move, so most likely they * will be out of sync with the stepper position after this. */ -inline void gcode_M410() { - stepper.quick_stop(); - #if DISABLED(DELTA) && DISABLED(SCARA) - set_current_position_from_planner(); - #endif -} +#if DISABLED(EMERGENCY_PARSER) + inline void gcode_M410() { + stepper.quick_stop(); + #if DISABLED(DELTA) && DISABLED(SCARA) + set_current_position_from_planner(); + #endif + } +#endif #if ENABLED(MESH_BED_LEVELING) @@ -6953,9 +6964,11 @@ void process_next_command() { gcode_M111(); break; - case 112: // M112: Emergency Stop - gcode_M112(); - break; + #if DISABLED(EMERGENCY_PARSER) + case 112: // M112: Emergency Stop + gcode_M112(); + break; + #endif #if ENABLED(HOST_KEEPALIVE_FEATURE) @@ -6974,9 +6987,11 @@ void process_next_command() { KEEPALIVE_STATE(NOT_BUSY); return; // "ok" already printed - case 108: - gcode_M108(); - break; + #if DISABLED(EMERGENCY_PARSER) + case 108: + gcode_M108(); + break; + #endif case 109: // M109: Wait for temperature gcode_M109(); @@ -7261,9 +7276,11 @@ void process_next_command() { break; #endif // ENABLED(FILAMENT_WIDTH_SENSOR) - case 410: // M410 quickstop - Abort all the planned moves. - gcode_M410(); - break; + #if DISABLED(EMERGENCY_PARSER) + case 410: // M410 quickstop - Abort all the planned moves. + gcode_M410(); + break; + #endif #if ENABLED(MESH_BED_LEVELING) case 420: // M420 Enable/Disable Mesh Bed Leveling diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index b075cd4c7..3200982a0 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -579,6 +579,13 @@ #endif /** + * emergency-command parser + */ +#if ENABLED(EMERGENCY_PARSER) && ENABLED(USBCON) + #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." +#endif + + /** * Warnings for old configurations */ #if WATCH_TEMP_PERIOD > 500 diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index d17635221..e1848a3ed 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index ffad11995..b46c49778 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 8956c41cd..48c0c4b5a 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 704b20ce4..bfd8b9a92 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 1a00bb376..9476e5b3b 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -526,6 +526,12 @@ const unsigned int dropsegments = 2; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 29b759d17..1c73ae074 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 26 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index e1280f2d2..bf798bb8f 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 8 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 475e0335a..f743b6608 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 1a6ab806a..a4309db76 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -528,6 +528,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 8956c41cd..48c0c4b5a 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 894e86163..a19e75bed 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index fba00960a..fcd0d9f1c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 7265b7628..d634ce5ab 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -521,6 +521,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 69eb9ce95..f508233ef 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -526,6 +526,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index f224fd60e..796966872 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 857f320e4..f266d270e 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 69ee6e04b..ade737a73 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + // Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. diff --git a/Marlin/language.h b/Marlin/language.h index eb378feea..03c063d4f 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -128,7 +128,7 @@ #define MSG_INVALID_EXTRUDER "Invalid extruder" #define MSG_INVALID_SOLENOID "Invalid solenoid" #define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature" -#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n" +#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID EMERGENCY_PARSER_CAPABILITIES "\n" #define MSG_COUNT_X " Count X: " #define MSG_COUNT_A " Count A: " #define MSG_ERR_KILLED "Printer halted. kill() called!" diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index a011b77d2..fb9b40cf0 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -238,8 +238,10 @@ unsigned char Temperature::soft_pwm[HOTENDS]; soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2; #endif + wait_for_heatup = true; + // PID Tuning loop - for (;;) { + while (wait_for_heatup) { millis_t ms = millis(); @@ -421,6 +423,7 @@ unsigned char Temperature::soft_pwm[HOTENDS]; } lcd_update(); } + if (!wait_for_heatup) disable_all_heaters(); } #endif // HAS_PID_HEATING From ecffe92e2021c75b725d2403a5f59d4c874fb80d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 11:52:36 -0700 Subject: [PATCH 267/580] Group EMERGENCY_PARSER commands --- Marlin/Marlin_main.cpp | 65 +++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ab7ef8f05..c4cdbb731 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4543,6 +4543,26 @@ inline void gcode_M105() { */ inline void gcode_M108() { wait_for_heatup = false; } + + /** + * M112: Emergency Stop + */ + inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } + + + /** + * M410: Quickstop - Abort all planned moves + * + * This will stop the carriages mid-move, so most likely they + * will be out of sync with the stepper position after this. + */ + inline void gcode_M410() { + stepper.quick_stop(); + #if DISABLED(DELTA) && DISABLED(SCARA) + set_current_position_from_planner(); + #endif + } + #endif /** @@ -4815,13 +4835,6 @@ inline void gcode_M111() { SERIAL_EOL; } -/** - * M112: Emergency Stop - */ -#if DISABLED(EMERGENCY_PARSER) - inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } -#endif - #if ENABLED(HOST_KEEPALIVE_FEATURE) /** @@ -5994,22 +6007,6 @@ inline void gcode_M400() { stepper.synchronize(); } } #endif -/** - * M410: Quickstop - Abort all planned moves - * - * This will stop the carriages mid-move, so most likely they - * will be out of sync with the stepper position after this. - */ - -#if DISABLED(EMERGENCY_PARSER) - inline void gcode_M410() { - stepper.quick_stop(); - #if DISABLED(DELTA) && DISABLED(SCARA) - set_current_position_from_planner(); - #endif - } -#endif - #if ENABLED(MESH_BED_LEVELING) /** @@ -6965,9 +6962,19 @@ void process_next_command() { break; #if DISABLED(EMERGENCY_PARSER) + + case 108: // M108: Cancel Waiting + gcode_M108(); + break; + case 112: // M112: Emergency Stop gcode_M112(); break; + + case 410: // M410 quickstop - Abort all the planned moves. + gcode_M410(); + break; + #endif #if ENABLED(HOST_KEEPALIVE_FEATURE) @@ -6987,12 +6994,6 @@ void process_next_command() { KEEPALIVE_STATE(NOT_BUSY); return; // "ok" already printed - #if DISABLED(EMERGENCY_PARSER) - case 108: - gcode_M108(); - break; - #endif - case 109: // M109: Wait for temperature gcode_M109(); break; @@ -7276,12 +7277,6 @@ void process_next_command() { break; #endif // ENABLED(FILAMENT_WIDTH_SENSOR) - #if DISABLED(EMERGENCY_PARSER) - case 410: // M410 quickstop - Abort all the planned moves. - gcode_M410(); - break; - #endif - #if ENABLED(MESH_BED_LEVELING) case 420: // M420 Enable/Disable Mesh Bed Leveling gcode_M420(); From 834ad14c8d43dd3496280717fcd428c88f870942 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 12:00:28 -0700 Subject: [PATCH 268/580] Add quickstop_stepper to update current position with stepper.quick_stop() --- Marlin/Marlin.h | 4 +--- Marlin/MarlinSerial.cpp | 3 ++- Marlin/Marlin_main.cpp | 18 +++++++----------- Marlin/endstops.cpp | 5 +---- Marlin/ultralcd.cpp | 5 +---- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 9d40ce161..2159fb019 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -230,9 +230,7 @@ void ok_to_send(); void reset_bed_level(); void kill(const char*); -#if DISABLED(DELTA) && DISABLED(SCARA) - void set_current_position_from_planner(); -#endif +void quickstop_stepper(); #if ENABLED(FILAMENT_RUNOUT_SENSOR) void handle_filament_runout(); diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index 7f1920528..82812986b 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -450,7 +450,8 @@ MarlinSerial customizedSerial; case state_M41: switch (c) { case '0': - { state = state_RESET; stepper.quick_stop(); } + state = state_RESET; + quickstop_stepper(); break; case ';': state = state_IGNORE; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c4cdbb731..3d8ba8443 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1109,7 +1109,7 @@ inline void get_serial_commands() { // If command was e-stop process now if (strcmp(command, "M108") == 0) wait_for_heatup = false; if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); - if (strcmp(command, "M410") == 0) stepper.quick_stop(); + if (strcmp(command, "M410") == 0) { quickstop_stepper(); } #endif #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 @@ -4556,12 +4556,7 @@ inline void gcode_M105() { * This will stop the carriages mid-move, so most likely they * will be out of sync with the stepper position after this. */ - inline void gcode_M410() { - stepper.quick_stop(); - #if DISABLED(DELTA) && DISABLED(SCARA) - set_current_position_from_planner(); - #endif - } + inline void gcode_M410() { quickstop_stepper(); } #endif @@ -5990,8 +5985,9 @@ inline void gcode_M400() { stepper.synchronize(); } #endif // FILAMENT_WIDTH_SENSOR -#if DISABLED(DELTA) && DISABLED(SCARA) - void set_current_position_from_planner() { +void quickstop_stepper() { + stepper.quick_stop(); + #if DISABLED(DELTA) && DISABLED(SCARA) stepper.synchronize(); #if ENABLED(AUTO_BED_LEVELING_FEATURE) vector_3 pos = planner.adjusted_position(); // values directly from steppers... @@ -6004,8 +6000,8 @@ inline void gcode_M400() { stepper.synchronize(); } current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); #endif sync_plan_position(); // ...re-apply to planner position - } -#endif + #endif +} #if ENABLED(MESH_BED_LEVELING) diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 81a080ebf..3bfb67a11 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -186,10 +186,7 @@ void Endstops::report_state() { if (stepper.abort_on_endstop_hit) { card.sdprinting = false; card.closefile(); - stepper.quick_stop(); - #if DISABLED(DELTA) && DISABLED(SCARA) - set_current_position_from_planner(); - #endif + quickstop_stepper(); thermalManager.disable_all_heaters(); // switch off all heaters. } #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index ca0db6d67..87104d87e 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -556,14 +556,11 @@ static void lcd_status_screen() { static void lcd_sdcard_stop() { card.stopSDPrint(); clear_command_queue(); - stepper.quick_stop(); + quickstop_stepper(); print_job_timer.stop(); thermalManager.autotempShutdown(); wait_for_heatup = false; lcd_setstatus(MSG_PRINT_ABORTED, true); - #if DISABLED(DELTA) && DISABLED(SCARA) - set_current_position_from_planner(); - #endif // !DELTA && !SCARA } #endif //SDSUPPORT From ea47803ae2f9249bf5311a71c03647bac8e50b9b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 12:48:21 -0700 Subject: [PATCH 269/580] Simplify emergency parser (only parse initial command) --- Marlin/MarlinSerial.cpp | 142 +++++++++++----------------------------- 1 file changed, 39 insertions(+), 103 deletions(-) diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index 82812986b..69fce4055 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -325,12 +325,11 @@ MarlinSerial customizedSerial; enum e_parser_state { state_RESET, + state_N, state_M, state_M1, state_M10, state_M11, - state_M2, - state_M3, state_M4, state_M41, state_IGNORE // to '\n' @@ -338,131 +337,68 @@ MarlinSerial customizedSerial; static e_parser_state state = state_RESET; + if (c == '\n') state = state_IGNORE; + switch (state) { case state_RESET: switch (c) { - case 'M': - state = state_M; - break; - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; - } - break; - - case state_M: - switch (c) { - case '1': - state = state_M1; - break; - case '2': - state = state_M2; - break; - case '3': - state = state_M3; - break; - case '4': - state = state_M4; - break; - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; + case ' ': break; + case 'N': state = state_N; break; + case 'M': state = state_M; break; + default: state = state_IGNORE; } - break; + break; - case state_M1: + case state_N: switch (c) { - case '0': - state = state_M10; - break; - case '1': - state = state_M11; - break; - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; + case '0': case '1': case '2': + case '3': case '4': case '5': + case '6': case '7': case '8': + case '9': case '-': case ' ': break; + case 'M': state = state_M; break; + default: state = state_IGNORE; } - break; + break; - case state_M2: + case state_M: switch (c) { - case '3': // M23 - case '8': // M28 - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; + case ' ': break; + case '1': state = state_M1; break; + case '4': state = state_M4; break; + default: state = state_IGNORE; } - break; + break; - case state_M3: + case state_M1: switch (c) { - case '0': // M30 - case '2': // M32 - case '3': // M33 - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; + case '0': state = state_M10; break; + case '1': state = state_M11; break; + default: state = state_IGNORE; } - break; + break; case state_M10: - switch (c) { - case '8': // M108 - { state = state_RESET; wait_for_heatup = false; } - break; - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; - } - break; + if (c == '8') wait_for_heatup = false; // M108 + state = state_IGNORE; + break; case state_M11: - switch (c) { - case '2': // M112 - state = state_RESET; kill(PSTR(MSG_KILLED)); - break; - case '7': // M117 - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; - } - break; + if (c == '2') kill(PSTR(MSG_KILLED)); // M112 + state = state_IGNORE; + break; case state_M4: - switch (c) { - case '1': - state = state_M41; - break; - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; - } - break; + state = (c == '1') ? state_M41 : state_IGNORE; + break; case state_M41: - switch (c) { - case '0': - state = state_RESET; - quickstop_stepper(); - break; - case ';': - state = state_IGNORE; - break; - default: state = state_RESET; - } - break; + if (c == '0') quickstop_stepper(); // M410 + state = state_IGNORE; + break; case state_IGNORE: if (c == '\n') state = state_RESET; - break; + break; default: state = state_RESET; From bd5a825b8ba270bb17206c30a4e160b571705328 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 16:03:33 -0700 Subject: [PATCH 270/580] Wait for end of line before invoking action --- Marlin/MarlinSerial.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index 69fce4055..c87f31b31 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -329,16 +329,17 @@ MarlinSerial customizedSerial; state_M, state_M1, state_M10, + state_M108, state_M11, + state_M112, state_M4, state_M41, + state_M410, state_IGNORE // to '\n' }; static e_parser_state state = state_RESET; - if (c == '\n') state = state_IGNORE; - switch (state) { case state_RESET: switch (c) { @@ -378,13 +379,11 @@ MarlinSerial customizedSerial; break; case state_M10: - if (c == '8') wait_for_heatup = false; // M108 - state = state_IGNORE; + state = (c == '8') ? state_M108 : state_IGNORE; break; case state_M11: - if (c == '2') kill(PSTR(MSG_KILLED)); // M112 - state = state_IGNORE; + state = (c == '2') ? state_M112 : state_IGNORE; break; case state_M4: @@ -392,8 +391,7 @@ MarlinSerial customizedSerial; break; case state_M41: - if (c == '0') quickstop_stepper(); // M410 - state = state_IGNORE; + state = (c == '0') ? state_M410 : state_IGNORE; break; case state_IGNORE: @@ -401,7 +399,20 @@ MarlinSerial customizedSerial; break; default: - state = state_RESET; + if (c == '\n') { + switch (state) { + case state_M108: + wait_for_heatup = false; + break; + case state_M112: + kill(PSTR(MSG_KILLED)); + break; + case state_M410: + quickstop_stepper(); + break; + } + state = state_RESET; + } } } #endif From 2ee4e4f79120e5f530a70650704cdec94b6b0376 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 19:59:19 -0700 Subject: [PATCH 271/580] Make wait_for_heatup volatile --- Marlin/Marlin.h | 2 +- Marlin/Marlin_main.cpp | 2 +- Marlin/ultralcd.h | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 2159fb019..5c698834b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -286,7 +286,7 @@ extern float sw_endstop_min[3]; // axis[n].sw_endstop_min extern float sw_endstop_max[3]; // axis[n].sw_endstop_max extern bool axis_known_position[3]; // axis[n].is_known extern bool axis_homed[3]; // axis[n].is_homed -extern bool wait_for_heatup; +extern volatile bool wait_for_heatup; // GCode support for external objects bool code_seen(char); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3d8ba8443..fffff449b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -332,7 +332,7 @@ uint8_t active_extruder = 0; // Relative Mode. Enable with G91, disable with G90. static bool relative_mode = false; -bool wait_for_heatup = true; +volatile bool wait_for_heatup = true; const char errormagic[] PROGMEM = "Error:"; const char echomagic[] PROGMEM = "echo:"; diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index cc0a10fd3..40b09606a 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -95,8 +95,6 @@ extern int absPreheatHPBTemp; extern int absPreheatFanSpeed; - extern bool wait_for_heatup; - #if ENABLED(FILAMENT_LCD_DISPLAY) extern millis_t previous_lcd_status_ms; #endif From 653eff3b31d38f2819ec55134831fdd5daf3e980 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 8 Jul 2016 13:40:38 +0200 Subject: [PATCH 272/580] Clean up `quick_home_xy()` Since we do the actual homing now in the 'normal' routines `quick_home_xy()` can be simplified to a relative simple diagonal move. --- Marlin/Marlin_main.cpp | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8b419b9e7..0c3588576 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2779,8 +2779,6 @@ inline void gcode_G4() { int x_axis_home_dir = home_dir(X_AXIS); #endif - SYNC_PLAN_POSITION_KINEMATIC(); - float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), mlratio = mlx > mly ? mly / mlx : mlx / mly; @@ -2789,30 +2787,9 @@ inline void gcode_G4() { feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1); line_to_destination(); stepper.synchronize(); - - set_axis_is_at_home(X_AXIS); - set_axis_is_at_home(Y_AXIS); - SYNC_PLAN_POSITION_KINEMATIC(); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 1", current_position); - #endif - - destination[X_AXIS] = current_position[X_AXIS]; - destination[Y_AXIS] = current_position[Y_AXIS]; - line_to_destination(); - stepper.synchronize(); endstops.hit_on_purpose(); // clear endstop hit flags - current_position[X_AXIS] = destination[X_AXIS]; - current_position[Y_AXIS] = destination[Y_AXIS]; - #if DISABLED(SCARA) - current_position[Z_AXIS] = destination[Z_AXIS]; - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 2", current_position); - #endif + destination[X_AXIS] = destination[Y_AXIS] = 0; } #endif // QUICK_HOME @@ -2917,8 +2894,8 @@ inline void gcode_G28() { #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 - // Raise Z before homing X or Y, if specified if (home_all_axis || homeX || homeY) { + // Raise Z before homing any other axes and z is not already high enough (never lower z) float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING; if (z_dest > current_position[Z_AXIS]) { From 88ed232f53a4b2053dfd5303c6103b81788e1ef8 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 8 Jul 2016 13:47:40 +0200 Subject: [PATCH 273/580] Remove HAS_BED_PROBE case in first raise in G28 Differentiating made sense here when we could save a dozen lines of code, but not for one line. --- Marlin/Marlin_main.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0c3588576..160274c11 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2907,14 +2907,8 @@ inline void gcode_G28() { #endif feedrate = homing_feedrate[Z_AXIS]; - - #if HAS_BED_PROBE - do_blocking_move_to_z(z_dest); - #else - line_to_z(z_dest); - stepper.synchronize(); - #endif - + line_to_z(z_dest); + stepper.synchronize(); destination[Z_AXIS] = current_position[Z_AXIS] = z_dest; } } From de3a16933603ff892ffde48ec077488519ec5153 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 8 Jul 2016 15:08:32 +0200 Subject: [PATCH 274/580] Always define MIN_Z_HEIGHT_FOR_HOMING even if 0 Always define MIN_Z_HEIGHT_FOR_HOMING even if 0 Always make a potential rise to `home_offset[Z_AXIS]` possible in G28. Get rid of some very ugly constructs in MBL (ultralcd.cpp). --- Marlin/Conditionals.h | 15 +++++++++++++++ Marlin/Marlin_main.cpp | 4 ++-- Marlin/ultralcd.cpp | 14 +++----------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 6b8a682ac..844d2a4e5 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -842,5 +842,20 @@ #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 #endif #endif + + /** + * MIN_Z_HEIGHT_FOR_HOMING / Z_RAISE_BETWEEN_PROBINGS + */ + #ifndef MIN_Z_HEIGHT_FOR_HOMING + #ifndef Z_RAISE_BETWEEN_PROBINGS + #define MIN_Z_HEIGHT_FOR_HOMING 0 + #else + #define MIN_Z_HEIGHT_FOR_HOMING Z_RAISE_BETWEEN_PROBINGS + #endif + #endif + #ifndef Z_RAISE_BETWEEN_PROBINGS + #define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING + #endif + #endif //CONFIGURATION_LCD #endif //CONDITIONALS_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 160274c11..ef01f1226 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2892,7 +2892,7 @@ inline void gcode_G28() { #endif } - #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0 + #else if (home_all_axis || homeX || homeY) { // Raise Z before homing any other axes and z is not already high enough (never lower z) @@ -2913,7 +2913,7 @@ inline void gcode_G28() { } } - #endif // MIN_Z_HEIGHT_FOR_HOMING + #endif #if ENABLED(QUICK_HOME) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 87104d87e..e7a59d4cc 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -978,17 +978,13 @@ static void lcd_status_screen() { // Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z // Z position will be restored with the final action, a G28 inline void _mbl_goto_xy(float x, float y) { - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - #if MIN_Z_HEIGHT_FOR_HOMING > 0 - + MIN_Z_HEIGHT_FOR_HOMING - #endif - ; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + MIN_Z_HEIGHT_FOR_HOMING; line_to_current(Z_AXIS); current_position[X_AXIS] = x + home_offset[X_AXIS]; current_position[Y_AXIS] = y + home_offset[Y_AXIS]; line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS); #if MIN_Z_HEIGHT_FOR_HOMING > 0 - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; // How do condition and action match? line_to_current(Z_AXIS); #endif stepper.synchronize(); @@ -1038,11 +1034,7 @@ static void lcd_status_screen() { if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) { lcd_goto_screen(_lcd_level_bed_done, true); - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - #if MIN_Z_HEIGHT_FOR_HOMING > 0 - + MIN_Z_HEIGHT_FOR_HOMING - #endif - ; + current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + MIN_Z_HEIGHT_FOR_HOMING; line_to_current(Z_AXIS); stepper.synchronize(); From 0ea6247fc2dd921be941c14236eb44dbeae7dc8f Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 8 Jul 2016 14:43:01 +0200 Subject: [PATCH 275/580] Use logic in Z_SAFE_HOMING Use logic in Z_SAFE_HOMING From ``` if (home_all_axis || homeZ) { if (home_all_axis) { ... home z } else if (homeZ) { // Don't need to Home Z twice home z } } ``` to ``` if (home_all_axis || homeZ) { if (home_all_axis) { ... } home z } ``` --- Marlin/Marlin_main.cpp | 46 ++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ef01f1226..e89d702d8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3015,36 +3015,30 @@ inline void gcode_G28() { */ current_position[X_AXIS] = destination[X_AXIS]; current_position[Y_AXIS] = destination[Y_AXIS]; - - // Home the Z axis - HOMEAXIS(Z); } - else if (homeZ) { // Don't need to Home Z twice + // Let's see if X and Y are homed + if (axis_unhomed_error(true, true, false)) return; - // Let's see if X and Y are homed - if (axis_unhomed_error(true, true, false)) return; + /** + * Make sure the Z probe is within the physical limits + * NOTE: This doesn't necessarily ensure the Z probe is also + * within the bed! + */ + float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS]; + if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) + && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) + && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) + && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) { - /** - * Make sure the Z probe is within the physical limits - * NOTE: This doesn't necessarily ensure the Z probe is also - * within the bed! - */ - float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS]; - if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) - && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) - && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) - && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) { - - // Home the Z axis - HOMEAXIS(Z); - } - else { - LCD_MESSAGEPGM(MSG_ZPROBE_OUT); - SERIAL_ECHO_START; - SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT); - } - } // !home_all_axes && homeZ + // Home the Z axis + HOMEAXIS(Z); + } + else { + LCD_MESSAGEPGM(MSG_ZPROBE_OUT); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT); + } #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { From f69434d81c730c7366f4201d65713872698e3456 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 8 Jul 2016 15:23:20 +0200 Subject: [PATCH 276/580] Eliminate `void setup_for_endstop_move()` --- Marlin/Marlin_main.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e89d702d8..82dbf01cb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1620,10 +1620,6 @@ static void setup_for_endstop_or_probe_move() { feedrate_multiplier = 100; refresh_cmd_timeout(); } -static void setup_for_endstop_move() { - setup_for_endstop_or_probe_move(); - endstops.enable(); -} static void clean_up_after_endstop_or_probe_move() { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2843,7 +2839,8 @@ inline void gcode_G28() { } #endif - setup_for_endstop_move(); + setup_for_endstop_or_probe_move(); + endstops.enable(); #if ENABLED(DELTA) /** From eff791224342adac0a68b92417938f873e642d1f Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 8 Jul 2016 15:49:10 +0200 Subject: [PATCH 277/580] Ensble/disable hardware endstops in G28 globally. For moving away from the endstops we do not have to disable them. They are not tested anyway. --- Marlin/Marlin_main.cpp | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 82dbf01cb..e57c1f2e9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2390,21 +2390,11 @@ static void homeaxis(AxisEnum axis) { current_position[axis] = 0; sync_plan_position(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)"); - #endif - endstops.enable(false); // Disable endstops while moving away - // Move away from the endstop by the axis HOME_BUMP_MM destination[axis] = -home_bump_mm(axis) * axis_home_dir; line_to_destination(); stepper.synchronize(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)"); - #endif - endstops.enable(true); // Enable endstops for next homing move - // Slow down the feedrate for the next move set_homing_bump_feedrate(axis); @@ -2445,10 +2435,6 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(DELTA) // retrace by the amount specified in endstop_adj if (endstop_adj[axis] * axis_home_dir < 0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)"); - #endif - endstops.enable(false); // Disable endstops while moving away sync_plan_position(); destination[axis] = endstop_adj[axis]; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2459,19 +2445,7 @@ static void homeaxis(AxisEnum axis) { #endif line_to_destination(); stepper.synchronize(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)"); - #endif - endstops.enable(true); // Enable endstops for next homing move } - #if ENABLED(DEBUG_LEVELING_FEATURE) - else { - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("> endstop_adj * axis_home_dir = ", endstop_adj[axis] * axis_home_dir); - SERIAL_EOL; - } - } - #endif #endif // Set the axis position to its home position (plus home offsets) @@ -2840,7 +2814,11 @@ inline void gcode_G28() { #endif setup_for_endstop_or_probe_move(); - endstops.enable(); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)"); + #endif + endstops.enable(true); // Enable endstops for next homing move + #if ENABLED(DELTA) /** @@ -3061,7 +3039,11 @@ inline void gcode_G28() { #endif // !DELTA (gcode_G28) + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.not_homing()"); + #endif endstops.not_homing(); + endstops.hit_on_purpose(); // clear endstop hit flags // Enable mesh leveling again #if ENABLED(MESH_BED_LEVELING) @@ -3101,8 +3083,6 @@ inline void gcode_G28() { clean_up_after_endstop_or_probe_move(); - endstops.hit_on_purpose(); // clear endstop hit flags - #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28"); #endif From 468f7f03a21fdfe3e83f880f3b1301d358efbb99 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 8 Jul 2016 15:59:33 +0200 Subject: [PATCH 278/580] homeaxis() can leave early when no known axis needs to be homed. Most changes are only caused from altering the indentation. ``` if (axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) { ... } to if (!(axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0)) return; ... ``` --- Marlin/Marlin_main.cpp | 203 ++++++++++++++++++++--------------------- 1 file changed, 101 insertions(+), 102 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e57c1f2e9..fec3b9382 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2344,135 +2344,134 @@ static void clean_up_after_endstop_or_probe_move() { #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) static void homeaxis(AxisEnum axis) { + #define HOMEAXIS_DO(LETTER) \ + ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) + + if (!(axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0)) return; + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR(">>> homeaxis(", axis); SERIAL_ECHOLNPGM(")"); } #endif - #define HOMEAXIS_DO(LETTER) \ - ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) - if (axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) { + int axis_home_dir = + #if ENABLED(DUAL_X_CARRIAGE) + (axis == X_AXIS) ? x_home_dir(active_extruder) : + #endif + home_dir(axis); - int axis_home_dir = - #if ENABLED(DUAL_X_CARRIAGE) - (axis == X_AXIS) ? x_home_dir(active_extruder) : + // Homing Z towards the bed? Deploy the Z probe or endstop. + #if HAS_BED_PROBE + if (axis == Z_AXIS && axis_home_dir < 0) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); #endif - home_dir(axis); - - // Homing Z towards the bed? Deploy the Z probe or endstop. - #if HAS_BED_PROBE - if (axis == Z_AXIS && axis_home_dir < 0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); - #endif - if (DEPLOY_PROBE()) return; - } - #endif + if (DEPLOY_PROBE()) return; + } + #endif - // Set the axis position as setup for the move - current_position[axis] = 0; - sync_plan_position(); + // Set the axis position as setup for the move + current_position[axis] = 0; + sync_plan_position(); - // Set a flag for Z motor locking - #if ENABLED(Z_DUAL_ENDSTOPS) - if (axis == Z_AXIS) stepper.set_homing_flag(true); - #endif + // Set a flag for Z motor locking + #if ENABLED(Z_DUAL_ENDSTOPS) + if (axis == Z_AXIS) stepper.set_homing_flag(true); + #endif - // Move towards the endstop until an endstop is triggered - destination[axis] = 1.5 * max_length(axis) * axis_home_dir; - feedrate = homing_feedrate[axis]; - line_to_destination(); - stepper.synchronize(); + // Move towards the endstop until an endstop is triggered + destination[axis] = 1.5 * max_length(axis) * axis_home_dir; + feedrate = homing_feedrate[axis]; + line_to_destination(); + stepper.synchronize(); - // Set the axis position as setup for the move - current_position[axis] = 0; - sync_plan_position(); + // Set the axis position as setup for the move + current_position[axis] = 0; + sync_plan_position(); - // Move away from the endstop by the axis HOME_BUMP_MM - destination[axis] = -home_bump_mm(axis) * axis_home_dir; - line_to_destination(); - stepper.synchronize(); + // Move away from the endstop by the axis HOME_BUMP_MM + destination[axis] = -home_bump_mm(axis) * axis_home_dir; + line_to_destination(); + stepper.synchronize(); - // Slow down the feedrate for the next move - set_homing_bump_feedrate(axis); + // Slow down the feedrate for the next move + set_homing_bump_feedrate(axis); - // Move slowly towards the endstop until triggered - destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir; - line_to_destination(); - stepper.synchronize(); + // Move slowly towards the endstop until triggered + destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir; + line_to_destination(); + stepper.synchronize(); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position); - #endif + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position); + #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - if (axis == Z_AXIS) { - float adj = fabs(z_endstop_adj); - bool lockZ1; - if (axis_home_dir > 0) { - adj = -adj; - lockZ1 = (z_endstop_adj > 0); - } - else - lockZ1 = (z_endstop_adj < 0); + #if ENABLED(Z_DUAL_ENDSTOPS) + if (axis == Z_AXIS) { + float adj = fabs(z_endstop_adj); + bool lockZ1; + if (axis_home_dir > 0) { + adj = -adj; + lockZ1 = (z_endstop_adj > 0); + } + else + lockZ1 = (z_endstop_adj < 0); - if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - sync_plan_position(); + if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true); + sync_plan_position(); - // Move to the adjusted endstop height - feedrate = homing_feedrate[axis]; - destination[Z_AXIS] = adj; - line_to_destination(); - stepper.synchronize(); - - if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false); - stepper.set_homing_flag(false); - } // Z_AXIS - #endif + // Move to the adjusted endstop height + feedrate = homing_feedrate[axis]; + destination[Z_AXIS] = adj; + line_to_destination(); + stepper.synchronize(); - #if ENABLED(DELTA) - // retrace by the amount specified in endstop_adj - if (endstop_adj[axis] * axis_home_dir < 0) { - sync_plan_position(); - destination[axis] = endstop_adj[axis]; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]); - DEBUG_POS("", destination); - } - #endif - line_to_destination(); - stepper.synchronize(); - } - #endif + if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false); + stepper.set_homing_flag(false); + } // Z_AXIS + #endif - // Set the axis position to its home position (plus home offsets) - set_axis_is_at_home(axis); + #if ENABLED(DELTA) + // retrace by the amount specified in endstop_adj + if (endstop_adj[axis] * axis_home_dir < 0) { + sync_plan_position(); + destination[axis] = endstop_adj[axis]; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]); + DEBUG_POS("", destination); + } + #endif + line_to_destination(); + stepper.synchronize(); + } + #endif - SYNC_PLAN_POSITION_KINEMATIC(); + // Set the axis position to its home position (plus home offsets) + set_axis_is_at_home(axis); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position); - #endif + SYNC_PLAN_POSITION_KINEMATIC(); - destination[axis] = current_position[axis]; - endstops.hit_on_purpose(); // clear endstop hit flags - axis_known_position[axis] = true; - axis_homed[axis] = true; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position); + #endif - // Put away the Z probe - #if HAS_BED_PROBE - if (axis == Z_AXIS && axis_home_dir < 0) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); - #endif - if (STOW_PROBE()) return; - } - #endif + destination[axis] = current_position[axis]; + endstops.hit_on_purpose(); // clear endstop hit flags + axis_known_position[axis] = true; + axis_homed[axis] = true; - } + // Put away the Z probe + #if HAS_BED_PROBE + if (axis == Z_AXIS && axis_home_dir < 0) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); + #endif + if (STOW_PROBE()) return; + } + #endif #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { From 4b44a23a36193297aeb9ed71c6932fa231d78ea4 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 8 Jul 2016 17:25:21 +0200 Subject: [PATCH 279/580] Add TX-buffer for MarlinSerial Similar to the current Arduino HardwareSerial but with max. 256 byte buffer-size. Deactivated by default. The boards with AT90USB processor (USBCON) already use a TX-buffer. --- Marlin/Configuration_adv.h | 6 + Marlin/MarlinSerial.cpp | 148 +++++++++++++++++- Marlin/MarlinSerial.h | 72 ++++----- .../Cartesio/Configuration_adv.h | 6 + .../Felix/Configuration_adv.h | 6 + .../Hephestos/Configuration_adv.h | 6 + .../Hephestos_2/Configuration_adv.h | 6 + .../K8200/Configuration_adv.h | 6 + .../K8400/Configuration_adv.h | 6 + .../RigidBot/Configuration_adv.h | 6 + .../SCARA/Configuration_adv.h | 6 + .../TAZ4/Configuration_adv.h | 6 + .../WITBOX/Configuration_adv.h | 6 + .../delta/biv2.5/Configuration_adv.h | 6 + .../delta/generic/Configuration_adv.h | 6 + .../delta/kossel_mini/Configuration_adv.h | 6 + .../delta/kossel_pro/Configuration_adv.h | 6 + .../delta/kossel_xl/Configuration_adv.h | 6 + .../makibox/Configuration_adv.h | 6 + .../tvrrug/Round2/Configuration_adv.h | 6 + 20 files changed, 280 insertions(+), 48 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 93ca69391..fdeeba222 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index c87f31b31..114ec1105 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -21,11 +21,12 @@ */ /** - HardwareSerial.cpp - Hardware serial library for Wiring + MarlinSerial.cpp - Hardware serial library for Wiring Copyright (c) 2006 Nicholas Zambetti. All right reserved. Modified 23 November 2006 by David A. Mellis Modified 28 September 2010 by Mark Sproul + Modified 14 February 2016 by Andreas Hardtung (added tx buffer) */ #include "Marlin.h" @@ -38,9 +39,14 @@ #if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H) #if UART_PRESENT(SERIAL_PORT) - ring_buffer rx_buffer = { { 0 }, 0, 0 }; + ring_buffer_r rx_buffer = { { 0 }, 0, 0 }; + #if TX_BUFFER_SIZE > 0 + ring_buffer_t tx_buffer = { { 0 }, 0, 0 }; + static bool _written; + #endif #endif + FORCE_INLINE void store_char(unsigned char c) { CRITICAL_SECTION_START; uint8_t h = rx_buffer.head; @@ -61,12 +67,38 @@ FORCE_INLINE void store_char(unsigned char c) { #endif } +#if TX_BUFFER_SIZE > 0 + FORCE_INLINE void _tx_udr_empty_irq(void) + { + // If interrupts are enabled, there must be more data in the output + // buffer. Send the next byte + uint8_t t = tx_buffer.tail; + uint8_t c = tx_buffer.buffer[t]; + tx_buffer.tail = (t + 1) & (TX_BUFFER_SIZE - 1); + + M_UDRx = c; + + // clear the TXC bit -- "can be cleared by writing a one to its bit + // location". This makes sure flush() won't return until the bytes + // actually got written + SBI(M_UCSRxA, M_TXCx); + + if (tx_buffer.head == tx_buffer.tail) { + // Buffer empty, so disable interrupts + CBI(M_UCSRxB, M_UDRIEx); + } + } + + #if defined(M_USARTx_UDRE_vect) + ISR(M_USARTx_UDRE_vect) { + _tx_udr_empty_irq(); + } + #endif + +#endif -//#elif defined(SIG_USART_RECV) #if defined(M_USARTx_RX_vect) - // fixed by Mark Sproul this is on the 644/644p - //SIGNAL(SIG_USART_RECV) - SIGNAL(M_USARTx_RX_vect) { + ISR(M_USARTx_RX_vect) { unsigned char c = M_UDRx; store_char(c); } @@ -107,14 +139,25 @@ void MarlinSerial::begin(long baud) { SBI(M_UCSRxB, M_RXENx); SBI(M_UCSRxB, M_TXENx); SBI(M_UCSRxB, M_RXCIEx); + #if TX_BUFFER_SIZE > 0 + CBI(M_UCSRxB, M_UDRIEx); + _written = false; + #endif } void MarlinSerial::end() { CBI(M_UCSRxB, M_RXENx); CBI(M_UCSRxB, M_TXENx); CBI(M_UCSRxB, M_RXCIEx); + CBI(M_UCSRxB, M_UDRIEx); } +void MarlinSerial::checkRx(void) { + if (TEST(M_UCSRxA, M_RXCx)) { + uint8_t c = M_UDRx; + store_char(c); + } +} int MarlinSerial::peek(void) { int v; @@ -145,7 +188,16 @@ int MarlinSerial::read(void) { return v; } -void MarlinSerial::flush() { +uint8_t MarlinSerial::available(void) { + CRITICAL_SECTION_START; + uint8_t h = rx_buffer.head; + uint8_t t = rx_buffer.tail; + CRITICAL_SECTION_END; + return (uint8_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1); +} + +void MarlinSerial::flush(void) { + // RX // don't reverse this or there may be problems if the RX interrupt // occurs after reading the value of rx_buffer_head but before writing // the value to rx_buffer_tail; the previous value of rx_buffer_head @@ -156,6 +208,86 @@ void MarlinSerial::flush() { CRITICAL_SECTION_END; } +#if TX_BUFFER_SIZE > 0 + uint8_t MarlinSerial::availableForWrite(void) { + CRITICAL_SECTION_START; + uint8_t h = tx_buffer.head; + uint8_t t = tx_buffer.tail; + CRITICAL_SECTION_END; + return (uint8_t)(TX_BUFFER_SIZE + h - t) & (TX_BUFFER_SIZE - 1); + } + + void MarlinSerial::write(uint8_t c) { + _written = true; + CRITICAL_SECTION_START; + bool emty = (tx_buffer.head == tx_buffer.tail); + CRITICAL_SECTION_END; + // If the buffer and the data register is empty, just write the byte + // to the data register and be done. This shortcut helps + // significantly improve the effective datarate at high (> + // 500kbit/s) bitrates, where interrupt overhead becomes a slowdown. + if (emty && TEST(M_UCSRxA, M_UDREx)) { + CRITICAL_SECTION_START; + M_UDRx = c; + SBI(M_UCSRxA, M_TXCx); + CRITICAL_SECTION_END; + return; + } + uint8_t i = (tx_buffer.head + 1) & (TX_BUFFER_SIZE - 1); + + // If the output buffer is full, there's nothing for it other than to + // wait for the interrupt handler to empty it a bit + while (i == tx_buffer.tail) { + if (!TEST(SREG, SREG_I)) { + // Interrupts are disabled, so we'll have to poll the data + // register empty flag ourselves. If it is set, pretend an + // interrupt has happened and call the handler to free up + // space for us. + if(TEST(M_UCSRxA, M_UDREx)) + _tx_udr_empty_irq(); + } else { + // nop, the interrupt handler will free up space for us + } + } + + tx_buffer.buffer[tx_buffer.head] = c; + { CRITICAL_SECTION_START; + tx_buffer.head = i; + SBI(M_UCSRxB, M_UDRIEx); + CRITICAL_SECTION_END; + } + return; + } + + void MarlinSerial::flushTX(void) { + // TX + // If we have never written a byte, no need to flush. This special + // case is needed since there is no way to force the TXC (transmit + // complete) bit to 1 during initialization + if (!_written) + return; + + while (TEST(M_UCSRxB, M_UDRIEx) || !TEST(M_UCSRxA, M_TXCx)) { + if (!TEST(SREG, SREG_I) && TEST(M_UCSRxB, M_UDRIEx)) + // Interrupts are globally disabled, but the DR empty + // interrupt should be enabled, so poll the DR empty flag to + // prevent deadlock + if (TEST(M_UCSRxA, M_UDREx)) + _tx_udr_empty_irq(); + } + // If we get here, nothing is queued anymore (DRIE is disabled) and + // the hardware finished tranmission (TXC is set). +} + +#else + void MarlinSerial::write(uint8_t c) { + while (!TEST(M_UCSRxA, M_UDREx)) + ; + M_UDRx = c; + } +#endif + +// end NEW /// imports from print.h @@ -321,7 +453,7 @@ MarlinSerial customizedSerial; // Currently looking for: M108, M112, M410 // If you alter the parser please don't forget to update the capabilities in Conditionals.h - void emergency_parser(unsigned char c) { + FORCE_INLINE void emergency_parser(unsigned char c) { enum e_parser_state { state_RESET, diff --git a/Marlin/MarlinSerial.h b/Marlin/MarlinSerial.h index b27b98169..a5e2ee71d 100644 --- a/Marlin/MarlinSerial.h +++ b/Marlin/MarlinSerial.h @@ -21,10 +21,12 @@ */ /** - HardwareSerial.h - Hardware serial library for Wiring + MarlinSerial.h - Hardware serial library for Wiring Copyright (c) 2006 Nicholas Zambetti. All right reserved. Modified 28 September 2010 by Mark Sproul + Modified 14 February 2016 by Andreas Hardtung (added tx buffer) + */ #ifndef MarlinSerial_h @@ -61,14 +63,17 @@ #define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,B) #define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,) #define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,) +#define M_TXCx SERIAL_REGNAME(TXC,SERIAL_PORT,) #define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,) #define M_UDREx SERIAL_REGNAME(UDRE,SERIAL_PORT,) +#define M_UDRIEx SERIAL_REGNAME(UDRIE,SERIAL_PORT,) #define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,) #define M_UBRRxH SERIAL_REGNAME(UBRR,SERIAL_PORT,H) #define M_UBRRxL SERIAL_REGNAME(UBRR,SERIAL_PORT,L) #define M_RXCx SERIAL_REGNAME(RXC,SERIAL_PORT,) #define M_USARTx_RX_vect SERIAL_REGNAME(USART,SERIAL_PORT,_RX_vect) #define M_U2Xx SERIAL_REGNAME(U2X,SERIAL_PORT,) +#define M_USARTx_UDRE_vect SERIAL_REGNAME(USART,SERIAL_PORT,_UDRE_vect) #define DEC 10 @@ -87,18 +92,35 @@ #ifndef RX_BUFFER_SIZE #define RX_BUFFER_SIZE 128 #endif +#ifndef TX_BUFFER_SIZE + #define TX_BUFFER_SIZE 32 +#endif #if !((RX_BUFFER_SIZE == 256) ||(RX_BUFFER_SIZE == 128) ||(RX_BUFFER_SIZE == 64) ||(RX_BUFFER_SIZE == 32) ||(RX_BUFFER_SIZE == 16) ||(RX_BUFFER_SIZE == 8) ||(RX_BUFFER_SIZE == 4) ||(RX_BUFFER_SIZE == 2)) #error "RX_BUFFER_SIZE has to be a power of 2 and >= 2" #endif +#if !((TX_BUFFER_SIZE == 256) ||(TX_BUFFER_SIZE == 128) ||(TX_BUFFER_SIZE == 64) ||(TX_BUFFER_SIZE == 32) ||(TX_BUFFER_SIZE == 16) ||(TX_BUFFER_SIZE == 8) ||(TX_BUFFER_SIZE == 4) ||(TX_BUFFER_SIZE == 2) ||(TX_BUFFER_SIZE == 0)) + #error TX_BUFFER_SIZE has to be a power of 2 or 0 +#endif -struct ring_buffer { +struct ring_buffer_r { unsigned char buffer[RX_BUFFER_SIZE]; volatile uint8_t head; volatile uint8_t tail; }; +#if TX_BUFFER_SIZE > 0 + struct ring_buffer_t { + unsigned char buffer[TX_BUFFER_SIZE]; + volatile uint8_t head; + volatile uint8_t tail; + }; +#endif + #if UART_PRESENT(SERIAL_PORT) - extern ring_buffer rx_buffer; + extern ring_buffer_r rx_buffer; + #if TX_BUFFER_SIZE > 0 + extern ring_buffer_t tx_buffer; + #endif #endif #if ENABLED(EMERGENCY_PARSER) @@ -115,43 +137,13 @@ class MarlinSerial { //: public Stream int peek(void); int read(void); void flush(void); - - FORCE_INLINE uint8_t available(void) { - CRITICAL_SECTION_START; - uint8_t h = rx_buffer.head; - uint8_t t = rx_buffer.tail; - CRITICAL_SECTION_END; - return (uint8_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1); - } - - FORCE_INLINE void write(uint8_t c) { - while (!TEST(M_UCSRxA, M_UDREx)) - ; - M_UDRx = c; - } - - FORCE_INLINE void checkRx(void) { - if (TEST(M_UCSRxA, M_RXCx)) { - unsigned char c = M_UDRx; - CRITICAL_SECTION_START; - uint8_t h = rx_buffer.head; - uint8_t i = (uint8_t)(h + 1) & (RX_BUFFER_SIZE - 1); - - // if we should be storing the received character into the location - // just before the tail (meaning that the head would advance to the - // current location of the tail), we're about to overflow the buffer - // and so we don't write the character or advance the head. - if (i != rx_buffer.tail) { - rx_buffer.buffer[h] = c; - rx_buffer.head = i; - } - CRITICAL_SECTION_END; - - #if ENABLED(EMERGENCY_PARSER) - emergency_parser(c); - #endif - } - } + uint8_t available(void); + void checkRx(void); + void write(uint8_t c); + #if TX_BUFFER_SIZE > 0 + uint8_t availableForWrite(void); + void flushTX(void); + #endif private: void printNumber(unsigned long, uint8_t); diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index e1848a3ed..c538b3d84 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index b46c49778..fddd7c408 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 48c0c4b5a..ab000aa4c 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index bfd8b9a92..6c5473560 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 9476e5b3b..8bc16833d 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -526,6 +526,12 @@ const unsigned int dropsegments = 2; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 1c73ae074..f5056cc05 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 26 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index bf798bb8f..6adeb2b3e 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 8 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index f743b6608..7dd0ce5bf 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index a4309db76..18994554b 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -528,6 +528,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 48c0c4b5a..ab000aa4c 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index a19e75bed..525a33a27 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index fcd0d9f1c..01f15087c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index d634ce5ab..995b6a876 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -521,6 +521,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index f508233ef..ed1a7b04a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -526,6 +526,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 796966872..92e5616ad 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index f266d270e..c95c2ec84 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index ade737a73..fe78f3407 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 +// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. +// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 +// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. +// Any other output does not need to be that speedy. +#define TX_BUFFER_SIZE 0 + // Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 From e03414b2dd0c76db3505d1ea6abb99183ec4f939 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Jul 2016 19:54:45 -0700 Subject: [PATCH 280/580] Simpler/extensible thermistor test in thermistortables.h --- Marlin/thermistortables.h | 54 ++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index 2e6decdd9..a0268e435 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -28,7 +28,9 @@ #define OVERSAMPLENR 16 -#if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORHEATER_2 == 1) || (THERMISTORHEATER_3 == 1) || (THERMISTORBED == 1) //100k bed thermistor +#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORBED == n) + +#if ANY_THERMISTOR_IS(1) // 100k bed thermistor const short temptable_1[][2] PROGMEM = { { 23 * OVERSAMPLENR, 300 }, { 25 * OVERSAMPLENR, 295 }, @@ -94,7 +96,7 @@ const short temptable_1[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 2) || (THERMISTORHEATER_1 == 2) || (THERMISTORHEATER_2 == 2) || (THERMISTORHEATER_3 == 2) || (THERMISTORBED == 2) //200k bed thermistor +#if ANY_THERMISTOR_IS(2) // 200k bed thermistor // 200k ATC Semitec 204GT-2 // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance @@ -134,7 +136,7 @@ const short temptable_2[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 3) || (THERMISTORHEATER_1 == 3) || (THERMISTORHEATER_2 == 3) || (THERMISTORHEATER_3 == 3) || (THERMISTORBED == 3) //mendel-parts +#if ANY_THERMISTOR_IS(3) // mendel-parts const short temptable_3[][2] PROGMEM = { { 1 * OVERSAMPLENR, 864 }, { 21 * OVERSAMPLENR, 300 }, @@ -167,7 +169,7 @@ const short temptable_3[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 4) || (THERMISTORHEATER_1 == 4) || (THERMISTORHEATER_2 == 4) || (THERMISTORHEATER_3 == 4) || (THERMISTORBED == 4) //10k thermistor +#if ANY_THERMISTOR_IS(4) // 10k thermistor const short temptable_4[][2] PROGMEM = { { 1 * OVERSAMPLENR, 430 }, { 54 * OVERSAMPLENR, 137 }, @@ -192,7 +194,7 @@ const short temptable_4[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 5) || (THERMISTORHEATER_1 == 5) || (THERMISTORHEATER_2 == 5) || (THERMISTORHEATER_3 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2) +#if ANY_THERMISTOR_IS(5) // 100k ParCan thermistor (104GT-2) // ATC Semitec 104GT-2 (Used in ParCan) // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance @@ -232,7 +234,7 @@ const short temptable_5[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 6) || (THERMISTORHEATER_1 == 6) || (THERMISTORHEATER_2 == 6) || (THERMISTORHEATER_3 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor +#if ANY_THERMISTOR_IS(6) // 100k Epcos thermistor const short temptable_6[][2] PROGMEM = { { 1 * OVERSAMPLENR, 350 }, { 28 * OVERSAMPLENR, 250 }, // top rating 250C @@ -275,7 +277,7 @@ const short temptable_6[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 7) || (THERMISTORHEATER_1 == 7) || (THERMISTORHEATER_2 == 7) || (THERMISTORHEATER_3 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01 +#if ANY_THERMISTOR_IS(7) // 100k Honeywell 135-104LAG-J01 const short temptable_7[][2] PROGMEM = { { 1 * OVERSAMPLENR, 941 }, { 19 * OVERSAMPLENR, 362 }, @@ -338,7 +340,7 @@ const short temptable_7[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 71) || (THERMISTORHEATER_1 == 71) || (THERMISTORHEATER_2 == 71) || (THERMISTORHEATER_3 == 71) || (THERMISTORBED == 71) // 100k Honeywell 135-104LAF-J01 +#if ANY_THERMISTOR_IS(71) // 100k Honeywell 135-104LAF-J01 // R0 = 100000 Ohm // T0 = 25 °C // Beta = 3974 @@ -489,7 +491,7 @@ const short temptable_71[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 8) || (THERMISTORHEATER_1 == 8) || (THERMISTORHEATER_2 == 8) || (THERMISTORHEATER_3 == 8) || (THERMISTORBED == 8) +#if ANY_THERMISTOR_IS(8) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) const short temptable_8[][2] PROGMEM = { { 1 * OVERSAMPLENR, 704 }, @@ -515,7 +517,7 @@ const short temptable_8[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 9) || (THERMISTORHEATER_1 == 9) || (THERMISTORHEATER_2 == 9) || (THERMISTORHEATER_3 == 9) || (THERMISTORBED == 9) +#if ANY_THERMISTOR_IS(9) // 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) const short temptable_9[][2] PROGMEM = { { 1 * OVERSAMPLENR, 936 }, @@ -552,7 +554,7 @@ const short temptable_9[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 10) || (THERMISTORHEATER_1 == 10) || (THERMISTORHEATER_2 == 10) || (THERMISTORHEATER_3 == 10) || (THERMISTORBED == 10) +#if ANY_THERMISTOR_IS(10) // 100k RS thermistor 198-961 (4.7k pullup) const short temptable_10[][2] PROGMEM = { { 1 * OVERSAMPLENR, 929 }, @@ -589,7 +591,7 @@ const short temptable_10[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 11) || (THERMISTORHEATER_1 == 11) || (THERMISTORHEATER_2 == 11) || (THERMISTORHEATER_3 == 11) || (THERMISTORBED == 11) +#if ANY_THERMISTOR_IS(11) // QU-BD silicone bed QWG-104F-3950 thermistor const short temptable_11[][2] PROGMEM = { { 1 * OVERSAMPLENR, 938 }, @@ -645,7 +647,7 @@ const short temptable_11[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 13) || (THERMISTORHEATER_1 == 13) || (THERMISTORHEATER_2 == 13) || (THERMISTORHEATER_3 == 13) || (THERMISTORBED == 13) +#if ANY_THERMISTOR_IS(13) // Hisens thermistor B25/50 =3950 +/-1% const short temptable_13[][2] PROGMEM = { { 20.04 * OVERSAMPLENR, 300 }, @@ -675,7 +677,7 @@ const short temptable_13[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics +#if ANY_THERMISTOR_IS(20) // PT100 with INA826 amp on Ultimaker v2.0 electronics // The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature. // This does not match the normal thermistor behaviour so we need to set the following defines #if (THERMISTORHEATER_0 == 20) @@ -751,7 +753,7 @@ const short temptable_20[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 51) || (THERMISTORHEATER_1 == 51) || (THERMISTORHEATER_2 == 51) || (THERMISTORHEATER_3 == 51) || (THERMISTORBED == 51) +#if ANY_THERMISTOR_IS(51) // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) // Verified by linagee. // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance @@ -813,7 +815,7 @@ const short temptable_51[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 52) || (THERMISTORHEATER_1 == 52) || (THERMISTORHEATER_2 == 52) || (THERMISTORHEATER_3 == 52) || (THERMISTORBED == 52) +#if ANY_THERMISTOR_IS(52) // 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance @@ -854,7 +856,7 @@ const short temptable_52[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 55) || (THERMISTORHEATER_1 == 55) || (THERMISTORHEATER_2 == 55) || (THERMISTORHEATER_3 == 55) || (THERMISTORBED == 55) +#if ANY_THERMISTOR_IS(55) // 100k ATC Semitec 104GT-2 (Used on ParCan) (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!) // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance @@ -895,7 +897,7 @@ const short temptable_55[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 60) || (THERMISTORHEATER_1 == 60) || (THERMISTORHEATER_2 == 60) || (THERMISTORHEATER_3 == 60) || (THERMISTORBED == 60) // Maker's Tool Works Kapton Bed Thermistor +#if ANY_THERMISTOR_IS(60) // Maker's Tool Works Kapton Bed Thermistor // ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950 // r0: 100000 // t0: 25 @@ -980,7 +982,7 @@ const short temptable_60[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 12) || (THERMISTORHEATER_1 == 12) || (THERMISTORHEATER_2 == 12) || (THERMISTORHEATER_3 == 12) || (THERMISTORBED == 12) +#if ANY_THERMISTOR_IS(12) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) const short temptable_12[][2] PROGMEM = { { 35 * OVERSAMPLENR, 180 }, // top rating 180C @@ -1016,7 +1018,7 @@ const short temptable_12[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 70) || (THERMISTORHEATER_1 == 70) || (THERMISTORHEATER_2 == 70) || (THERMISTORHEATER_3 == 70) || (THERMISTORBED == 70) // bqh2 stock thermistor +#if ANY_THERMISTOR_IS(70) // bqh2 stock thermistor const short temptable_70[][2] PROGMEM = { { 22 * OVERSAMPLENR, 300 }, { 24 * OVERSAMPLENR, 295 }, @@ -1093,7 +1095,7 @@ const short temptable_70[][2] PROGMEM = { #define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1)) #define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T }, -#if (THERMISTORHEATER_0 == 110) || (THERMISTORHEATER_1 == 110) || (THERMISTORHEATER_2 == 110) || (THERMISTORHEATER_3 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup +#if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup const short temptable_110[][2] PROGMEM = { // only few values are needed as the curve is very flat PtLine( 0, 100, 1000) @@ -1105,7 +1107,7 @@ const short temptable_110[][2] PROGMEM = { PtLine(300, 100, 1000) }; #endif -#if (THERMISTORHEATER_0 == 147) || (THERMISTORHEATER_1 == 147) || (THERMISTORHEATER_2 == 147) || (THERMISTORHEATER_3 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup +#if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup const short temptable_147[][2] PROGMEM = { // only few values are needed as the curve is very flat PtLine( 0, 100, 4700) @@ -1117,7 +1119,7 @@ const short temptable_147[][2] PROGMEM = { PtLine(300, 100, 4700) }; #endif -#if (THERMISTORHEATER_0 == 1010) || (THERMISTORHEATER_1 == 1010) || (THERMISTORHEATER_2 == 1010) || (THERMISTORHEATER_3 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup +#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup const short temptable_1010[][2] PROGMEM = { PtLine( 0, 1000, 1000) PtLine( 25, 1000, 1000) @@ -1134,7 +1136,7 @@ const short temptable_1010[][2] PROGMEM = { PtLine(300, 1000, 1000) }; #endif -#if (THERMISTORHEATER_0 == 1047) || (THERMISTORHEATER_1 == 1047) || (THERMISTORHEATER_2 == 1047) || (THERMISTORHEATER_3 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup +#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup const short temptable_1047[][2] PROGMEM = { // only few values are needed as the curve is very flat PtLine( 0, 1000, 4700) @@ -1147,7 +1149,7 @@ const short temptable_1047[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 999) || (THERMISTORHEATER_1 == 999) || (THERMISTORHEATER_2 == 999) || (THERMISTORHEATER_3 == 999) || (THERMISTORBED == 999) //User defined table +#if ANY_THERMISTOR_IS(999) // User-defined table // Dummy Thermistor table.. It will ALWAYS read a fixed value. #ifndef DUMMY_THERMISTOR_999_VALUE #define DUMMY_THERMISTOR_999_VALUE 25 @@ -1158,7 +1160,7 @@ const short temptable_1047[][2] PROGMEM = { }; #endif -#if (THERMISTORHEATER_0 == 998) || (THERMISTORHEATER_1 == 998) || (THERMISTORHEATER_2 == 998) || (THERMISTORHEATER_3 == 998) || (THERMISTORBED == 998) //User defined table +#if ANY_THERMISTOR_IS(998) // User-defined table // Dummy Thermistor table.. It will ALWAYS read a fixed value. #ifndef DUMMY_THERMISTOR_998_VALUE #define DUMMY_THERMISTOR_998_VALUE 25 From 51c9c3fe2c56a7bf89cceb08779b377225f8e83f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 16:51:12 -0700 Subject: [PATCH 281/580] Indentation in MarlinSerial.cpp --- Marlin/MarlinSerial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index 114ec1105..bf7675426 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -243,8 +243,8 @@ void MarlinSerial::flush(void) { // register empty flag ourselves. If it is set, pretend an // interrupt has happened and call the handler to free up // space for us. - if(TEST(M_UCSRxA, M_UDREx)) - _tx_udr_empty_irq(); + if (TEST(M_UCSRxA, M_UDREx)) + _tx_udr_empty_irq(); } else { // nop, the interrupt handler will free up space for us } From 315b4c2153e9ab6c6d29e46ff72e1f9b25033034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Zahradn=C3=ADk=20junior?= Date: Fri, 8 Jul 2016 15:00:39 +0200 Subject: [PATCH 282/580] Runout sensor without SD Card --- Marlin/Marlin_main.cpp | 27 +++++++++++++++++++-------- Marlin/SanityCheck.h | 4 ++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8b419b9e7..0c3d6aab9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4403,6 +4403,8 @@ inline void gcode_M104() { #if ENABLED(PRINTJOB_TIMER_AUTOSTART) /** + * Stop the timer at the end of print, starting is managed by + * 'heat and wait' M109. * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot * stand by mode, for instance in a dual extruder setup, without affecting * the running print timer. @@ -4411,12 +4413,6 @@ inline void gcode_M104() { print_job_timer.stop(); LCD_MESSAGEPGM(WELCOME_MSG); } - /** - * We do not check if the timer is already running because this check will - * be done for us inside the Stopwatch::start() method thus a running timer - * will not restart. - */ - else print_job_timer.start(); #endif if (temp > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING); @@ -4701,7 +4697,22 @@ inline void gcode_M109() { LCD_MESSAGEPGM(MSG_BED_HEATING); bool no_wait_for_cooling = code_seen('S'); - if (no_wait_for_cooling || code_seen('R')) thermalManager.setTargetBed(code_value_temp_abs()); + if (no_wait_for_cooling || code_seen('R')) { + thermalManager.setTargetBed(code_value_temp_abs()); + #if ENABLED(PRINTJOB_TIMER_AUTOSTART) + if(code_value_temp_abs() > BED_MINTEMP) { + /** + * We start the timer when 'heating and waiting' command arrives, LCD + * functions never wait. Cooling down managed by extruders. + * + * We do not check if the timer is already running because this check will + * be done for us inside the Stopwatch::start() method thus a running timer + * will not restart. + */ + print_job_timer.start(); + } + #endif + } #if TEMP_BED_RESIDENCY_TIME > 0 millis_t residency_start_ms = 0; @@ -8112,7 +8123,7 @@ void idle( void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #if ENABLED(FILAMENT_RUNOUT_SENSOR) - if (IS_SD_PRINTING && !(READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING)) + if ((IS_SD_PRINTING || print_job_timer.isRunning()) && !(READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING)) handle_filament_runout(); #endif diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 3200982a0..475d4a8fa 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -111,12 +111,12 @@ #endif /** - * Filament Runout needs a pin and SD Support + * Filament Runout needs a pin and either SD Support or Auto print start detection */ #if ENABLED(FILAMENT_RUNOUT_SENSOR) #if !HAS_FIL_RUNOUT #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." - #elif DISABLED(SDSUPPORT) + #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART) #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT." #endif #endif From a2159cfbc38e56b9788993246fb69db493826f6d Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Sat, 9 Jul 2016 11:34:42 +0200 Subject: [PATCH 283/580] Error message change in SanityCheck.h --- Marlin/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 475d4a8fa..17d6cff5f 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -117,7 +117,7 @@ #if !HAS_FIL_RUNOUT #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART) - #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT." + #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." #endif #endif From e282d69f63b3ea4625a7041946d5e5e95e42c97e Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Sat, 9 Jul 2016 11:38:18 +0200 Subject: [PATCH 284/580] Print job timer comment changed --- Marlin/Configuration.h | 5 ++++- Marlin/example_configurations/Cartesio/Configuration.h | 5 ++++- Marlin/example_configurations/Felix/Configuration.h | 5 ++++- Marlin/example_configurations/Hephestos/Configuration.h | 5 ++++- Marlin/example_configurations/Hephestos_2/Configuration.h | 5 ++++- Marlin/example_configurations/K8200/Configuration.h | 5 ++++- Marlin/example_configurations/K8400/Configuration.h | 5 ++++- .../RepRapWorld/Megatronics/Configuration.h | 5 ++++- Marlin/example_configurations/RigidBot/Configuration.h | 5 ++++- Marlin/example_configurations/SCARA/Configuration.h | 5 ++++- Marlin/example_configurations/TAZ4/Configuration.h | 5 ++++- Marlin/example_configurations/WITBOX/Configuration.h | 5 ++++- .../example_configurations/adafruit/ST7565/Configuration.h | 5 ++++- Marlin/example_configurations/delta/biv2.5/Configuration.h | 5 ++++- Marlin/example_configurations/delta/generic/Configuration.h | 5 ++++- .../example_configurations/delta/kossel_mini/Configuration.h | 5 ++++- .../example_configurations/delta/kossel_pro/Configuration.h | 5 ++++- .../example_configurations/delta/kossel_xl/Configuration.h | 5 ++++- Marlin/example_configurations/makibox/Configuration.h | 5 ++++- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 5 ++++- 20 files changed, 80 insertions(+), 20 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index aa1733cc2..947c9245e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -790,7 +790,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 2fd390eed..1a78e0b5d 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -789,7 +789,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index d8495eb84..b6d798cb4 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -773,7 +773,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index a047e59c5..0e9bf234a 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -782,7 +782,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 4704fa822..c4bd60779 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -784,7 +784,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 5267edcbd..ddf6f7d6c 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -807,7 +807,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index a7c61de56..550f9bd3e 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -790,7 +790,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index e394b6b2a..3de1f0540 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -790,7 +790,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index ad5c40850..367cfcb48 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -788,7 +788,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 1c23794d0..c63171354 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -798,7 +798,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index e5a7dd844..7c50aa0f3 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -811,7 +811,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d3012dbfb..0b9a6a80d 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -782,7 +782,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9c4f23d18..c7592bc8d 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -790,7 +790,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 3dfd2dd93..aca2d8b49 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -885,7 +885,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 396a40671..38798fc9a 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -879,7 +879,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 53f0310b0..fef003f0a 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -882,7 +882,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index ec37272de..f8685d5f3 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -882,7 +882,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 1d17d17f1..2dc46f30c 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -884,7 +884,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 654392558..0b33f909b 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -793,7 +793,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 8d14edadf..2771c366e 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -784,7 +784,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: From 1026e5b071079ac81cbcfc0a7ad7d6a76a3468ed Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 15:20:12 -0700 Subject: [PATCH 285/580] Replace PLA/ABS preheating with generic --- Marlin/Configuration.h | 12 +-- Marlin/Marlin_main.cpp | 12 +-- Marlin/SanityCheck.h | 12 +++ Marlin/configuration_store.cpp | 68 +++++++------- .../Cartesio/Configuration.h | 12 +-- .../Felix/Configuration.h | 12 +-- .../Felix/DUAL/Configuration.h | 12 +-- .../Hephestos/Configuration.h | 12 +-- .../Hephestos_2/Configuration.h | 12 +-- .../K8200/Configuration.h | 12 +-- .../K8400/Configuration.h | 12 +-- .../K8400/Dual Heads/Configuration.h | 12 +-- .../RepRapWorld/Megatronics/Configuration.h | 12 +-- .../RigidBot/Configuration.h | 12 +-- .../SCARA/Configuration.h | 12 +-- .../TAZ4/Configuration.h | 12 +-- .../WITBOX/Configuration.h | 12 +-- .../adafruit/ST7565/Configuration.h | 12 +-- .../delta/biv2.5/Configuration.h | 12 +-- .../delta/generic/Configuration.h | 12 +-- .../delta/kossel_mini/Configuration.h | 12 +-- .../delta/kossel_pro/Configuration.h | 12 +-- .../delta/kossel_xl/Configuration.h | 12 +-- .../makibox/Configuration.h | 12 +-- .../tvrrug/Round2/Configuration.h | 12 +-- Marlin/language_an.h | 20 ++-- Marlin/language_bg.h | 20 ++-- Marlin/language_ca.h | 20 ++-- Marlin/language_cn.h | 20 ++-- Marlin/language_cz.h | 20 ++-- Marlin/language_da.h | 20 ++-- Marlin/language_de.h | 20 ++-- Marlin/language_en.h | 40 ++++---- Marlin/language_es.h | 20 ++-- Marlin/language_eu.h | 20 ++-- Marlin/language_fi.h | 20 ++-- Marlin/language_fr.h | 20 ++-- Marlin/language_gl.h | 20 ++-- Marlin/language_hr.h | 20 ++-- Marlin/language_it.h | 20 ++-- Marlin/language_kana.h | 20 ++-- Marlin/language_kana_utf8.h | 20 ++-- Marlin/language_nl.h | 20 ++-- Marlin/language_pl.h | 20 ++-- Marlin/language_pt-br.h | 20 ++-- Marlin/language_pt-br_utf8.h | 20 ++-- Marlin/language_pt.h | 20 ++-- Marlin/language_pt_utf8.h | 20 ++-- Marlin/language_ru.h | 20 ++-- Marlin/language_test.h | 12 +-- Marlin/ultralcd.cpp | 93 +++++++++---------- Marlin/ultralcd.h | 12 +-- 52 files changed, 490 insertions(+), 483 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index aa1733cc2..2f49a7503 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -778,13 +778,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 110 -#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8b419b9e7..2fe4f2640 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4908,32 +4908,32 @@ inline void gcode_M140() { case 0: if (code_seen('H')) { v = code_value_int(); - plaPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); + preheatHotendTemp1 = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); } if (code_seen('F')) { v = code_value_int(); - plaPreheatFanSpeed = constrain(v, 0, 255); + preheatFanSpeed1 = constrain(v, 0, 255); } #if TEMP_SENSOR_BED != 0 if (code_seen('B')) { v = code_value_int(); - plaPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); + preheatBedTemp1 = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); } #endif break; case 1: if (code_seen('H')) { v = code_value_int(); - absPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); + preheatHotendTemp2 = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); } if (code_seen('F')) { v = code_value_int(); - absPreheatFanSpeed = constrain(v, 0, 255); + preheatFanSpeed2 = constrain(v, 0, 255); } #if TEMP_SENSOR_BED != 0 if (code_seen('B')) { v = code_value_int(); - absPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); + preheatBedTemp2 = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); } #endif break; diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 3200982a0..808bb811d 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -644,6 +644,18 @@ #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." #elif ENABLED(FILAMENTCHANGEENABLE) #error "FILAMENTCHANGEENABLE is now FILAMENT_CHANGE_FEATURE. Please update your configuration." +#elif defined(PLA_PREHEAT_HOTEND_TEMP) + #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." +#elif defined(PLA_PREHEAT_HPB_TEMP) + #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration." +#elif defined(PLA_PREHEAT_FAN_SPEED) + #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration." +#elif defined(ABS_PREHEAT_HOTEND_TEMP) + #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration." +#elif defined(ABS_PREHEAT_HPB_TEMP) + #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." +#elif defined(ABS_PREHEAT_FAN_SPEED) + #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." #endif #endif //SANITYCHECK_H diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 4420a0e1f..9ea428269 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -85,12 +85,12 @@ * 285 M666 Z z_endstop_adj (float) * * ULTIPANEL: - * 289 M145 S0 H plaPreheatHotendTemp (int) - * 291 M145 S0 B plaPreheatHPBTemp (int) - * 293 M145 S0 F plaPreheatFanSpeed (int) - * 295 M145 S1 H absPreheatHotendTemp (int) - * 297 M145 S1 B absPreheatHPBTemp (int) - * 299 M145 S1 F absPreheatFanSpeed (int) + * 289 M145 S0 H preheatHotendTemp1 (int) + * 291 M145 S0 B preheatBedTemp1 (int) + * 293 M145 S0 F preheatFanSpeed1 (int) + * 295 M145 S1 H preheatHotendTemp2 (int) + * 297 M145 S1 B preheatBedTemp2 (int) + * 299 M145 S1 F preheatFanSpeed2 (int) * * PIDTEMP: * 301 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) @@ -262,16 +262,16 @@ void Config_StoreSettings() { #endif #if DISABLED(ULTIPANEL) - int plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP, plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP, plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED, - absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP, absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP, absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED; + int preheatHotendTemp1 = PREHEAT_1_TEMP_HOTEND, preheatBedTemp1 = PREHEAT_1_TEMP_BED, preheatFanSpeed1 = PREHEAT_1_FAN_SPEED, + preheatHotendTemp2 = PREHEAT_2_TEMP_HOTEND, preheatBedTemp2 = PREHEAT_2_TEMP_BED, preheatFanSpeed2 = PREHEAT_2_FAN_SPEED; #endif // !ULTIPANEL - EEPROM_WRITE_VAR(i, plaPreheatHotendTemp); - EEPROM_WRITE_VAR(i, plaPreheatHPBTemp); - EEPROM_WRITE_VAR(i, plaPreheatFanSpeed); - EEPROM_WRITE_VAR(i, absPreheatHotendTemp); - EEPROM_WRITE_VAR(i, absPreheatHPBTemp); - EEPROM_WRITE_VAR(i, absPreheatFanSpeed); + EEPROM_WRITE_VAR(i, preheatHotendTemp1); + EEPROM_WRITE_VAR(i, preheatBedTemp1); + EEPROM_WRITE_VAR(i, preheatFanSpeed1); + EEPROM_WRITE_VAR(i, preheatHotendTemp2); + EEPROM_WRITE_VAR(i, preheatBedTemp2); + EEPROM_WRITE_VAR(i, preheatFanSpeed2); for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { @@ -447,16 +447,16 @@ void Config_RetrieveSettings() { #endif #if DISABLED(ULTIPANEL) - int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed, - absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed; + int preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1, + preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2; #endif - EEPROM_READ_VAR(i, plaPreheatHotendTemp); - EEPROM_READ_VAR(i, plaPreheatHPBTemp); - EEPROM_READ_VAR(i, plaPreheatFanSpeed); - EEPROM_READ_VAR(i, absPreheatHotendTemp); - EEPROM_READ_VAR(i, absPreheatHPBTemp); - EEPROM_READ_VAR(i, absPreheatFanSpeed); + EEPROM_READ_VAR(i, preheatHotendTemp1); + EEPROM_READ_VAR(i, preheatBedTemp1); + EEPROM_READ_VAR(i, preheatFanSpeed1); + EEPROM_READ_VAR(i, preheatHotendTemp2); + EEPROM_READ_VAR(i, preheatBedTemp2); + EEPROM_READ_VAR(i, preheatFanSpeed2); #if ENABLED(PIDTEMP) for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { @@ -604,12 +604,12 @@ void Config_ResetDefault() { #endif #if ENABLED(ULTIPANEL) - plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP; - plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP; - plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED; - absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP; - absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP; - absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED; + preheatHotendTemp1 = PREHEAT_1_TEMP_HOTEND; + preheatBedTemp1 = PREHEAT_1_TEMP_BED; + preheatFanSpeed1 = PREHEAT_1_FAN_SPEED; + preheatHotendTemp2 = PREHEAT_2_TEMP_HOTEND; + preheatBedTemp2 = PREHEAT_2_TEMP_BED; + preheatFanSpeed2 = PREHEAT_2_FAN_SPEED; #endif #if HAS_LCD_CONTRAST @@ -814,14 +814,14 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Material heatup parameters:"); CONFIG_ECHO_START; } - SERIAL_ECHOPAIR(" M145 S0 H", plaPreheatHotendTemp); - SERIAL_ECHOPAIR(" B", plaPreheatHPBTemp); - SERIAL_ECHOPAIR(" F", plaPreheatFanSpeed); + SERIAL_ECHOPAIR(" M145 S0 H", preheatHotendTemp1); + SERIAL_ECHOPAIR(" B", preheatBedTemp1); + SERIAL_ECHOPAIR(" F", preheatFanSpeed1); SERIAL_EOL; CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M145 S1 H", absPreheatHotendTemp); - SERIAL_ECHOPAIR(" B", absPreheatHPBTemp); - SERIAL_ECHOPAIR(" F", absPreheatFanSpeed); + SERIAL_ECHOPAIR(" M145 S1 H", preheatHotendTemp2); + SERIAL_ECHOPAIR(" B", preheatBedTemp2); + SERIAL_ECHOPAIR(" F", preheatFanSpeed2); SERIAL_EOL; #endif // ULTIPANEL diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 2fd390eed..7378e822e 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -777,13 +777,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 190 -#define PLA_PREHEAT_HPB_TEMP 50 -#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 190 +#define PREHEAT_1_TEMP_BED 50 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 110 -#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index d8495eb84..af7c7393c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -761,13 +761,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 731d8ce5e..6bdcbfecb 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -759,13 +759,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index a047e59c5..f6e5934a9 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -770,13 +770,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 200 -#define PLA_PREHEAT_HPB_TEMP 0 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 0 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 220 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 220 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 4704fa822..fcfca317f 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -772,13 +772,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 210 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 210 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 110 -#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 5267edcbd..3173f6849 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -795,13 +795,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 190 -#define PLA_PREHEAT_HPB_TEMP 50 // K8200: set back to 70 if you have an upgraded heatbed power supply -#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 190 +#define PREHEAT_1_TEMP_BED 50 // K8200: set back to 70 if you have an upgraded heatbed power supply +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 60 // K8200: set back to 110 if you have an upgraded heatbed power supply -#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 60 // K8200: set back to 110 if you have an upgraded heatbed power supply +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index a7c61de56..19ae33b7e 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -778,13 +778,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 210 -#define PLA_PREHEAT_HPB_TEMP 0 -#define PLA_PREHEAT_FAN_SPEED 165 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 210 +#define PREHEAT_1_TEMP_BED 0 +#define PREHEAT_1_FAN_SPEED 165 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 245 -#define ABS_PREHEAT_HPB_TEMP 0 -#define ABS_PREHEAT_FAN_SPEED 165 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 245 +#define PREHEAT_2_TEMP_BED 0 +#define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h index c244ea043..88c0edbab 100644 --- a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h @@ -778,13 +778,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 210 -#define PLA_PREHEAT_HPB_TEMP 0 -#define PLA_PREHEAT_FAN_SPEED 165 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 210 +#define PREHEAT_1_TEMP_BED 0 +#define PREHEAT_1_FAN_SPEED 165 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 245 -#define ABS_PREHEAT_HPB_TEMP 0 -#define ABS_PREHEAT_FAN_SPEED 165 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 245 +#define PREHEAT_2_TEMP_BED 0 +#define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index e394b6b2a..308065a37 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -778,13 +778,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 110 -#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index ad5c40850..d50fbd6cf 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -776,13 +776,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 110 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 1c23794d0..9cc81a8c7 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -786,13 +786,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index e5a7dd844..5898a9875 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -799,13 +799,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 230 -#define ABS_PREHEAT_HPB_TEMP 110 -#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 230 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d3012dbfb..8146ca77f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -770,13 +770,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 200 -#define PLA_PREHEAT_HPB_TEMP 0 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 0 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 220 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 220 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9c4f23d18..b48f086ba 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -778,13 +778,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 110 -#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 3dfd2dd93..cf8a52180 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -873,13 +873,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 396a40671..1b5c3c844 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -867,13 +867,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 53f0310b0..1551951bf 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -870,13 +870,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index ec37272de..d258e9ee9 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -870,13 +870,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 1d17d17f1..4af995219 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -872,13 +872,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 654392558..2b3332062 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -781,13 +781,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 8d14edadf..8e60ffeea 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -772,13 +772,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // @section temperature // Preheat Constants -#define PLA_PREHEAT_HOTEND_TEMP 180 -#define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 -#define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 // // Print job timer diff --git a/Marlin/language_an.h b/Marlin/language_an.h index 968fa5168..eb4eb8058 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Set home offsets" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Establir zero" -#define MSG_PREHEAT_PLA "Precalentar PLA" -#define MSG_PREHEAT_PLA_N "Precalentar PLA " -#define MSG_PREHEAT_PLA_ALL "Precalentar PLA a" -#define MSG_PREHEAT_PLA_BEDONLY "Prec. PLA Base" -#define MSG_PREHEAT_PLA_SETTINGS "Achustar tem. PLA" -#define MSG_PREHEAT_ABS "Precalentar ABS" -#define MSG_PREHEAT_ABS_N "Precalentar ABS " -#define MSG_PREHEAT_ABS_ALL "Precalentar ABS a" -#define MSG_PREHEAT_ABS_BEDONLY "Prec. ABS Base" -#define MSG_PREHEAT_ABS_SETTINGS "Achustar tem. ABS" +#define MSG_PREHEAT_1 "Precalentar PLA" +#define MSG_PREHEAT_1_N "Precalentar PLA " +#define MSG_PREHEAT_1_ALL "Precalentar PLA a" +#define MSG_PREHEAT_1_BEDONLY "Prec. PLA Base" +#define MSG_PREHEAT_1_SETTINGS "Achustar tem. PLA" +#define MSG_PREHEAT_2 "Precalentar ABS" +#define MSG_PREHEAT_2_N "Precalentar ABS " +#define MSG_PREHEAT_2_ALL "Precalentar ABS a" +#define MSG_PREHEAT_2_BEDONLY "Prec. ABS Base" +#define MSG_PREHEAT_2_SETTINGS "Achustar tem. ABS" #define MSG_COOLDOWN "Enfriar" #define MSG_SWITCH_PS_ON "Enchegar Fuent" #define MSG_SWITCH_PS_OFF "Desenchegar Fuent" diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index 3fc7a5bee..8b4290467 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Задай Начало" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Изходна точка" -#define MSG_PREHEAT_PLA "Подгряване PLA" -#define MSG_PREHEAT_PLA_N "Подгряване PLA" -#define MSG_PREHEAT_PLA_ALL "Подгр. PLA Всички" -#define MSG_PREHEAT_PLA_BEDONLY "Подгр. PLA Легло" -#define MSG_PREHEAT_PLA_SETTINGS "Настройки PLA" -#define MSG_PREHEAT_ABS "Подгряване ABS" -#define MSG_PREHEAT_ABS_N "Подгряване ABS" -#define MSG_PREHEAT_ABS_ALL "Подгр. ABS Всички" -#define MSG_PREHEAT_ABS_BEDONLY "Подгр. ABS Легло" -#define MSG_PREHEAT_ABS_SETTINGS "Настройки ABS" +#define MSG_PREHEAT_1 "Подгряване PLA" +#define MSG_PREHEAT_1_N "Подгряване PLA" +#define MSG_PREHEAT_1_ALL "Подгр. PLA Всички" +#define MSG_PREHEAT_1_BEDONLY "Подгр. PLA Легло" +#define MSG_PREHEAT_1_SETTINGS "Настройки PLA" +#define MSG_PREHEAT_2 "Подгряване ABS" +#define MSG_PREHEAT_2_N "Подгряване ABS" +#define MSG_PREHEAT_2_ALL "Подгр. ABS Всички" +#define MSG_PREHEAT_2_BEDONLY "Подгр. ABS Легло" +#define MSG_PREHEAT_2_SETTINGS "Настройки ABS" #define MSG_COOLDOWN "Охлаждане" #define MSG_SWITCH_PS_ON "Вкл. захранване" #define MSG_SWITCH_PS_OFF "Изкл. захранване" diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 9c2ba49d3..a7cbb2563 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -50,16 +50,16 @@ #define MSG_SET_HOME_OFFSETS "Set home offsets" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Establir origen" -#define MSG_PREHEAT_PLA "Preescalfar PLA" -#define MSG_PREHEAT_PLA_N "Preescalfar PLA " -#define MSG_PREHEAT_PLA_ALL "Preesc. tot PLA" -#define MSG_PREHEAT_PLA_BEDONLY "Preesc. llit PLA" -#define MSG_PREHEAT_PLA_SETTINGS "Configuració PLA" -#define MSG_PREHEAT_ABS "Preescalfar ABS" -#define MSG_PREHEAT_ABS_N "Preescalfar ABS " -#define MSG_PREHEAT_ABS_ALL "Preesc. tot ABS" -#define MSG_PREHEAT_ABS_BEDONLY "Preesc. llit ABS" -#define MSG_PREHEAT_ABS_SETTINGS "Configuració ABS" +#define MSG_PREHEAT_1 "Preescalfar PLA" +#define MSG_PREHEAT_1_N "Preescalfar PLA " +#define MSG_PREHEAT_1_ALL "Preesc. tot PLA" +#define MSG_PREHEAT_1_BEDONLY "Preesc. llit PLA" +#define MSG_PREHEAT_1_SETTINGS "Configuració PLA" +#define MSG_PREHEAT_2 "Preescalfar ABS" +#define MSG_PREHEAT_2_N "Preescalfar ABS " +#define MSG_PREHEAT_2_ALL "Preesc. tot ABS" +#define MSG_PREHEAT_2_BEDONLY "Preesc. llit ABS" +#define MSG_PREHEAT_2_SETTINGS "Configuració ABS" #define MSG_COOLDOWN "Refredar" #define MSG_SWITCH_PS_ON "Switch power on" #define MSG_SWITCH_PS_OFF "Switch power off" diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index e2306a401..12a66a3c5 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -47,16 +47,16 @@ #define MSG_SET_HOME_OFFSETS "\xbe\xbf\xbb\xbc\xbd\xc0\xc1" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "\xbe\xbf\xbc\xbd" -#define MSG_PREHEAT_PLA "\xc3\xc4 PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " \xc5\xc6" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " \xc4\xc7" -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " \xbe\xbf" -#define MSG_PREHEAT_ABS "\xc3\xc4 ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " \xc5\xc6" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " \xbe\xc6" -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " \xbe\xbf" +#define MSG_PREHEAT_1 "\xc3\xc4 PLA" +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " \xc5\xc6" +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " \xc4\xc7" +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " \xbe\xbf" +#define MSG_PREHEAT_2 "\xc3\xc4 ABS" +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " \xc5\xc6" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " \xbe\xc6" +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " \xbe\xbf" #define MSG_COOLDOWN "\xc8\xc9" #define MSG_SWITCH_PS_ON "\xb9\xcb\xca\xb3" #define MSG_SWITCH_PS_OFF "\xb9\xcb\xb5\xb6" diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index fabaf0e98..ddaf6a77f 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -58,16 +58,16 @@ #define MSG_SET_HOME_OFFSETS "Nastavit ofsety" #define MSG_HOME_OFFSETS_APPLIED "Ofsety nastaveny" #define MSG_SET_ORIGIN "Nastavit pocatek" -#define MSG_PREHEAT_PLA "Zahrat PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " Vse" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Podloz" -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " Nast" -#define MSG_PREHEAT_ABS "Zahrat ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " Vse" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Podloz" -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " Nast" +#define MSG_PREHEAT_1 "Zahrat PLA" +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " Vse" +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " Podloz" +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " Nast" +#define MSG_PREHEAT_2 "Zahrat ABS" +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " Vse" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Podloz" +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " Nast" #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" diff --git a/Marlin/language_da.h b/Marlin/language_da.h index 55c9fd48c..833a6b26a 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -54,16 +54,16 @@ #define MSG_SET_HOME_OFFSETS "Sæt forskyding af home" #define MSG_HOME_OFFSETS_APPLIED "Forskydninger af home pos. er tilføjet" #define MSG_SET_ORIGIN "Sæt origin" -#define MSG_PREHEAT_PLA "Forvarm PLA" -#define MSG_PREHEAT_PLA_N "Forvarm PLA " -#define MSG_PREHEAT_PLA_ALL "Forvarm PLA Alle" -#define MSG_PREHEAT_PLA_BEDONLY "Forvarm PLA Bed" -#define MSG_PREHEAT_PLA_SETTINGS "Forvarm PLA conf" -#define MSG_PREHEAT_ABS "Forvarm ABS" -#define MSG_PREHEAT_ABS_N "Forvarm ABS " -#define MSG_PREHEAT_ABS_ALL "Forvarm ABS Alle" -#define MSG_PREHEAT_ABS_BEDONLY "Forvarm ABS Bed" -#define MSG_PREHEAT_ABS_SETTINGS "Forvarm ABS conf" +#define MSG_PREHEAT_1 "Forvarm PLA" +#define MSG_PREHEAT_1_N "Forvarm PLA " +#define MSG_PREHEAT_1_ALL "Forvarm PLA Alle" +#define MSG_PREHEAT_1_BEDONLY "Forvarm PLA Bed" +#define MSG_PREHEAT_1_SETTINGS "Forvarm PLA conf" +#define MSG_PREHEAT_2 "Forvarm ABS" +#define MSG_PREHEAT_2_N "Forvarm ABS " +#define MSG_PREHEAT_2_ALL "Forvarm ABS Alle" +#define MSG_PREHEAT_2_BEDONLY "Forvarm ABS Bed" +#define MSG_PREHEAT_2_SETTINGS "Forvarm ABS conf" #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" diff --git a/Marlin/language_de.h b/Marlin/language_de.h index 58acd9527..3077e6b45 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Setze Homeoffsets" #define MSG_HOME_OFFSETS_APPLIED "Offsets aktiv" #define MSG_SET_ORIGIN "Setze Nullpunkt" //"G92 X0 Y0 Z0" commented out in ultralcd.cpp -#define MSG_PREHEAT_PLA "Vorwärmen PLA" -#define MSG_PREHEAT_PLA_N "Vorwärmen PLA " -#define MSG_PREHEAT_PLA_ALL "Vorw. PLA Alle" -#define MSG_PREHEAT_PLA_BEDONLY "Vorw. PLA Bett" -#define MSG_PREHEAT_PLA_SETTINGS "Vorw. PLA Einst." -#define MSG_PREHEAT_ABS "Vorwärmen ABS" -#define MSG_PREHEAT_ABS_N "Vorwärmen ABS " -#define MSG_PREHEAT_ABS_ALL "Vorw. ABS Alle" -#define MSG_PREHEAT_ABS_BEDONLY "Vorw. ABS Bett" -#define MSG_PREHEAT_ABS_SETTINGS "Vorw. ABS Einst." +#define MSG_PREHEAT_1 "Vorwärmen PLA" +#define MSG_PREHEAT_1_N "Vorwärmen PLA " +#define MSG_PREHEAT_1_ALL "Vorw. PLA Alle" +#define MSG_PREHEAT_1_BEDONLY "Vorw. PLA Bett" +#define MSG_PREHEAT_1_SETTINGS "Vorw. PLA Einst." +#define MSG_PREHEAT_2 "Vorwärmen ABS" +#define MSG_PREHEAT_2_N "Vorwärmen ABS " +#define MSG_PREHEAT_2_ALL "Vorw. ABS Alle" +#define MSG_PREHEAT_2_BEDONLY "Vorw. ABS Bett" +#define MSG_PREHEAT_2_SETTINGS "Vorw. ABS Einst." #define MSG_COOLDOWN "Abkühlen" #define MSG_SWITCH_PS_ON "Netzteil ein" #define MSG_SWITCH_PS_OFF "Netzteil aus" diff --git a/Marlin/language_en.h b/Marlin/language_en.h index f69ef9ca3..12cf62004 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -97,35 +97,35 @@ #ifndef MSG_SET_ORIGIN #define MSG_SET_ORIGIN "Set origin" #endif -#ifndef MSG_PREHEAT_PLA - #define MSG_PREHEAT_PLA "Preheat PLA" +#ifndef MSG_PREHEAT_1 + #define MSG_PREHEAT_1 "Preheat PLA" #endif -#ifndef MSG_PREHEAT_PLA_N - #define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " +#ifndef MSG_PREHEAT_1_N + #define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " #endif -#ifndef MSG_PREHEAT_PLA_ALL - #define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " All" +#ifndef MSG_PREHEAT_1_ALL + #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " All" #endif -#ifndef MSG_PREHEAT_PLA_BEDONLY - #define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Bed" +#ifndef MSG_PREHEAT_1_BEDONLY + #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " Bed" #endif -#ifndef MSG_PREHEAT_PLA_SETTINGS - #define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " conf" +#ifndef MSG_PREHEAT_1_SETTINGS + #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " conf" #endif -#ifndef MSG_PREHEAT_ABS - #define MSG_PREHEAT_ABS "Preheat ABS" +#ifndef MSG_PREHEAT_2 + #define MSG_PREHEAT_2 "Preheat ABS" #endif -#ifndef MSG_PREHEAT_ABS_N - #define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " +#ifndef MSG_PREHEAT_2_N + #define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " #endif -#ifndef MSG_PREHEAT_ABS_ALL - #define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " All" +#ifndef MSG_PREHEAT_2_ALL + #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " All" #endif -#ifndef MSG_PREHEAT_ABS_BEDONLY - #define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Bed" +#ifndef MSG_PREHEAT_2_BEDONLY + #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Bed" #endif -#ifndef MSG_PREHEAT_ABS_SETTINGS - #define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " conf" +#ifndef MSG_PREHEAT_2_SETTINGS + #define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " conf" #endif #ifndef MSG_H1 #define MSG_H1 "1" diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 9722ccd2e..7b2ba2a00 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -53,16 +53,16 @@ #define MSG_SET_HOME_OFFSETS "Ajustar desfases" #define MSG_HOME_OFFSETS_APPLIED "Desfase aplicado" #define MSG_SET_ORIGIN "Establecer origen" -#define MSG_PREHEAT_PLA "Precalentar PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA "Todo" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA"Plataforma" -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA "Config" -#define MSG_PREHEAT_ABS "Precalentar ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS "Todo" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS "Plataforma" -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS "Config" +#define MSG_PREHEAT_1 "Precalentar PLA" +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 "Todo" +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1"Plataforma" +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 "Config" +#define MSG_PREHEAT_2 "Precalentar ABS" +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 "Todo" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 "Plataforma" +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 "Config" #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index f87ac2f1c..ba8dfe4b3 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Set home offsets" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Hasiera ipini" -#define MSG_PREHEAT_PLA "Aurreberotu PLA" -#define MSG_PREHEAT_PLA_N "Aurreberotu PLA " -#define MSG_PREHEAT_PLA_ALL "Berotu PLA Guztia" -#define MSG_PREHEAT_PLA_BEDONLY "Berotu PLA Ohea" -#define MSG_PREHEAT_PLA_SETTINGS "Berotu PLA Konfig" -#define MSG_PREHEAT_ABS "Aurreberotu ABS" -#define MSG_PREHEAT_ABS_N "Aurreberotu ABS " -#define MSG_PREHEAT_ABS_ALL "Berotu ABS Guztia" -#define MSG_PREHEAT_ABS_BEDONLY "Berotu ABS Ohea" -#define MSG_PREHEAT_ABS_SETTINGS "Berotu ABS Konfig" +#define MSG_PREHEAT_1 "Aurreberotu PLA" +#define MSG_PREHEAT_1_N "Aurreberotu PLA " +#define MSG_PREHEAT_1_ALL "Berotu PLA Guztia" +#define MSG_PREHEAT_1_BEDONLY "Berotu PLA Ohea" +#define MSG_PREHEAT_1_SETTINGS "Berotu PLA Konfig" +#define MSG_PREHEAT_2 "Aurreberotu ABS" +#define MSG_PREHEAT_2_N "Aurreberotu ABS " +#define MSG_PREHEAT_2_ALL "Berotu ABS Guztia" +#define MSG_PREHEAT_2_BEDONLY "Berotu ABS Ohea" +#define MSG_PREHEAT_2_SETTINGS "Berotu ABS Konfig" #define MSG_COOLDOWN "Hoztu" #define MSG_SWITCH_PS_ON "Energia piztu" #define MSG_SWITCH_PS_OFF "Energia itzali" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index be3db646c..f3f4db27e 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Set home offsets" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Aseta origo" -#define MSG_PREHEAT_PLA "Esilämmitä PLA" -#define MSG_PREHEAT_PLA_N "Esilämmitä PLA " -#define MSG_PREHEAT_PLA_ALL "Esilä. PLA Kaikki" -#define MSG_PREHEAT_PLA_BEDONLY "Esilä. PLA Alusta" -#define MSG_PREHEAT_PLA_SETTINGS "Esilämm. PLA konf" -#define MSG_PREHEAT_ABS "Esilämmitä ABS" -#define MSG_PREHEAT_ABS_N "Esilämmitä ABS " -#define MSG_PREHEAT_ABS_ALL "Esilä. ABS Kaikki" -#define MSG_PREHEAT_ABS_BEDONLY "Esilä. ABS Alusta" -#define MSG_PREHEAT_ABS_SETTINGS "Esilämm. ABS konf" +#define MSG_PREHEAT_1 "Esilämmitä PLA" +#define MSG_PREHEAT_1_N "Esilämmitä PLA " +#define MSG_PREHEAT_1_ALL "Esilä. PLA Kaikki" +#define MSG_PREHEAT_1_BEDONLY "Esilä. PLA Alusta" +#define MSG_PREHEAT_1_SETTINGS "Esilämm. PLA konf" +#define MSG_PREHEAT_2 "Esilämmitä ABS" +#define MSG_PREHEAT_2_N "Esilämmitä ABS " +#define MSG_PREHEAT_2_ALL "Esilä. ABS Kaikki" +#define MSG_PREHEAT_2_BEDONLY "Esilä. ABS Alusta" +#define MSG_PREHEAT_2_SETTINGS "Esilämm. ABS konf" #define MSG_COOLDOWN "Jäähdytä" #define MSG_SWITCH_PS_ON "Virta päälle" #define MSG_SWITCH_PS_OFF "Virta pois" diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index f22abce00..d56f77840 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Regler decal. origine" #define MSG_HOME_OFFSETS_APPLIED "Decalages appliques" #define MSG_SET_ORIGIN "Regler origine" -#define MSG_PREHEAT_PLA "Prechauffage PLA" -#define MSG_PREHEAT_PLA_N "Prechauff. PLA " -#define MSG_PREHEAT_PLA_ALL "Prech. PLA Tout" -#define MSG_PREHEAT_PLA_BEDONLY "Prech. PLA Plateau" -#define MSG_PREHEAT_PLA_SETTINGS "Regl. prech. PLA" -#define MSG_PREHEAT_ABS "Prechauffage ABS" -#define MSG_PREHEAT_ABS_N "Prechauff. ABS " -#define MSG_PREHEAT_ABS_ALL "Prech. ABS Tout" -#define MSG_PREHEAT_ABS_BEDONLY "Prech. ABS Plateau" -#define MSG_PREHEAT_ABS_SETTINGS "Regl. prech. ABS" +#define MSG_PREHEAT_1 "Prechauffage PLA" +#define MSG_PREHEAT_1_N "Prechauff. PLA " +#define MSG_PREHEAT_1_ALL "Prech. PLA Tout" +#define MSG_PREHEAT_1_BEDONLY "Prech. PLA Plateau" +#define MSG_PREHEAT_1_SETTINGS "Regl. prech. PLA" +#define MSG_PREHEAT_2 "Prechauffage ABS" +#define MSG_PREHEAT_2_N "Prechauff. ABS " +#define MSG_PREHEAT_2_ALL "Prech. ABS Tout" +#define MSG_PREHEAT_2_BEDONLY "Prech. ABS Plateau" +#define MSG_PREHEAT_2_SETTINGS "Regl. prech. ABS" #define MSG_COOLDOWN "Refroidir" #define MSG_SWITCH_PS_ON "Allumer alim." #define MSG_SWITCH_PS_OFF "Eteindre alim." diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h index f4e4639fc..87453b81c 100644 --- a/Marlin/language_gl.h +++ b/Marlin/language_gl.h @@ -54,16 +54,16 @@ #define MSG_SET_HOME_OFFSETS "Offsets na orixe" #define MSG_HOME_OFFSETS_APPLIED "Offsets fixados" #define MSG_SET_ORIGIN "Fixar orixe" -#define MSG_PREHEAT_PLA "Prequentar PLA" -#define MSG_PREHEAT_PLA_N "Prequentar PLA " -#define MSG_PREHEAT_PLA_ALL "Preque. PLA Todo" -#define MSG_PREHEAT_PLA_BEDONLY "Preque. PLA Cama" -#define MSG_PREHEAT_PLA_SETTINGS "Preque. PLA conf" -#define MSG_PREHEAT_ABS "Prequentar ABS" -#define MSG_PREHEAT_ABS_N "Prequentar ABS " -#define MSG_PREHEAT_ABS_ALL "Preque. ABS Todo" -#define MSG_PREHEAT_ABS_BEDONLY "Preque. ABS Cama" -#define MSG_PREHEAT_ABS_SETTINGS "Preque. ABS conf" +#define MSG_PREHEAT_1 "Prequentar PLA" +#define MSG_PREHEAT_1_N "Prequentar PLA " +#define MSG_PREHEAT_1_ALL "Preque. PLA Todo" +#define MSG_PREHEAT_1_BEDONLY "Preque. PLA Cama" +#define MSG_PREHEAT_1_SETTINGS "Preque. PLA conf" +#define MSG_PREHEAT_2 "Prequentar ABS" +#define MSG_PREHEAT_2_N "Prequentar ABS " +#define MSG_PREHEAT_2_ALL "Preque. ABS Todo" +#define MSG_PREHEAT_2_BEDONLY "Preque. ABS Cama" +#define MSG_PREHEAT_2_SETTINGS "Preque. ABS conf" #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h index d48e58ccb..5886115c6 100644 --- a/Marlin/language_hr.h +++ b/Marlin/language_hr.h @@ -55,16 +55,16 @@ #define MSG_SET_HOME_OFFSETS "Postavi home offsete" #define MSG_HOME_OFFSETS_APPLIED "Offsets postavljeni" #define MSG_SET_ORIGIN "Postavi ishodište" -#define MSG_PREHEAT_PLA "Predgrij PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " Sve" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Bed" -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " conf" -#define MSG_PREHEAT_ABS "Predgrij ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " Sve" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Bed" -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " conf" +#define MSG_PREHEAT_1 "Predgrij PLA" +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " Sve" +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " Bed" +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " conf" +#define MSG_PREHEAT_2 "Predgrij ABS" +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " Sve" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Bed" +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " conf" #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 481b725ab..467a8780f 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -54,16 +54,16 @@ #define MSG_SET_HOME_OFFSETS "Imp. offset home" #define MSG_HOME_OFFSETS_APPLIED "Offset applicato" #define MSG_SET_ORIGIN "Imposta Origine" -#define MSG_PREHEAT_PLA "Preriscalda PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " Tutto" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Piatto" -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " conf" -#define MSG_PREHEAT_ABS "Preriscalda ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " Tutto" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Piatto" -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " conf" +#define MSG_PREHEAT_1 "Preriscalda PLA" +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " Tutto" +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " Piatto" +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " conf" +#define MSG_PREHEAT_2 "Preriscalda ABS" +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " Tutto" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Piatto" +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " conf" #define MSG_COOLDOWN "Raffredda" #define MSG_SWITCH_PS_ON "Accendi aliment." #define MSG_SWITCH_PS_OFF "Spegni aliment." diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 7eb6f592a..196f57f62 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -56,16 +56,16 @@ #define MSG_SET_HOME_OFFSETS "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2" // "キジュンオフセットセッテイ" ("Set home offsets") #define MSG_HOME_OFFSETS_APPLIED "\xb5\xcc\xbe\xaf\xc4\xb6\xde\xc3\xb7\xd6\xb3\xbb\xda\xcf\xbc\xc0" // "オフセットガテキヨウサレマシタ" ("Offsets applied") #define MSG_SET_ORIGIN "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4" // "キジュンセット" ("Set origin") -#define MSG_PREHEAT_PLA "PLA \xd6\xc8\xc2" // "PLA ヨネツ" ("Preheat PLA") -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " \xbd\xcd\xde\xc3" // " スベテ" (" All") -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " \xcd\xde\xaf\xc4\xde" // " ベッド" (" Bed") -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " \xbe\xaf\xc3\xb2" // " セッテイ" (" conf") -#define MSG_PREHEAT_ABS "ABS \xd6\xc8\xc2" // "ABS ヨネツ" ("Preheat ABS") -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " \xbd\xcd\xde\xc3" // " スベテ" (" All") -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " \xcd\xde\xaf\xc4\xde" // " ベッド" (" Bed") -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " \xbe\xaf\xc3\xb2" // " セッテイ" (" conf") +#define MSG_PREHEAT_1 "PLA \xd6\xc8\xc2" // "PLA ヨネツ" ("Preheat PLA") +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " \xbd\xcd\xde\xc3" // " スベテ" (" All") +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " \xcd\xde\xaf\xc4\xde" // " ベッド" (" Bed") +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " \xbe\xaf\xc3\xb2" // " セッテイ" (" conf") +#define MSG_PREHEAT_2 "ABS \xd6\xc8\xc2" // "ABS ヨネツ" ("Preheat ABS") +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " \xbd\xcd\xde\xc3" // " スベテ" (" All") +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " \xcd\xde\xaf\xc4\xde" // " ベッド" (" Bed") +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " \xbe\xaf\xc3\xb2" // " セッテイ" (" conf") #define MSG_COOLDOWN "\xb6\xc8\xc2\xc3\xb2\xbc" // "カネツテイシ" ("Cooldown") #define MSG_SWITCH_PS_ON "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xdd" // "デンゲン オン" ("Switch power on") #define MSG_SWITCH_PS_OFF "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc" // "デンゲン オフ" ("Switch power off") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 8a35e7cef..b91212607 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -59,16 +59,16 @@ #define MSG_SET_HOME_OFFSETS "キジュンオフセットセッテイ" // "Set home offsets" #define MSG_HOME_OFFSETS_APPLIED "オフセットガテキヨウサレマシタ" // "Offsets applied" #define MSG_SET_ORIGIN "キジュンセット" // "Set origin" -#define MSG_PREHEAT_PLA "PLA ヨネツ" // "Preheat PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " スベテ" // " All" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " ベッド" // " Bed" -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " セッテイ" // " conf" -#define MSG_PREHEAT_ABS "ABS ヨネツ" // "Preheat ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " スベテ" // " All" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " ベッド" // " Bed" -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " セッテイ" // " conf" +#define MSG_PREHEAT_1 "PLA ヨネツ" // "Preheat PLA" +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " スベテ" // " All" +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " ベッド" // " Bed" +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " セッテイ" // " conf" +#define MSG_PREHEAT_2 "ABS ヨネツ" // "Preheat ABS" +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " スベテ" // " All" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " ベッド" // " Bed" +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " セッテイ" // " conf" #define MSG_COOLDOWN "カネツテイシ" // "Cooldown" #define MSG_SWITCH_PS_ON "デンゲン オン" // "Switch power on" #define MSG_SWITCH_PS_OFF "デンゲン オフ" // "Switch power off" diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index c74ad8fbd..d291ae6aa 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Zet home offsets" #define MSG_HOME_OFFSETS_APPLIED "H offset toegep." #define MSG_SET_ORIGIN "Nulpunt instellen" -#define MSG_PREHEAT_PLA "PLA voorverwarmen" -#define MSG_PREHEAT_PLA_N "PLA voorverw. " -#define MSG_PREHEAT_PLA_ALL "PLA voorverw. aan" -#define MSG_PREHEAT_PLA_BEDONLY "PLA voorverw. Bed" -#define MSG_PREHEAT_PLA_SETTINGS "PLA verw. conf" -#define MSG_PREHEAT_ABS "ABS voorverwarmen" -#define MSG_PREHEAT_ABS_N "ABS voorverw. " -#define MSG_PREHEAT_ABS_ALL "ABS voorverw. aan" -#define MSG_PREHEAT_ABS_BEDONLY "ABS voorverw. Bed" -#define MSG_PREHEAT_ABS_SETTINGS "ABS verw. conf" +#define MSG_PREHEAT_1 "PLA voorverwarmen" +#define MSG_PREHEAT_1_N "PLA voorverw. " +#define MSG_PREHEAT_1_ALL "PLA voorverw. aan" +#define MSG_PREHEAT_1_BEDONLY "PLA voorverw. Bed" +#define MSG_PREHEAT_1_SETTINGS "PLA verw. conf" +#define MSG_PREHEAT_2 "ABS voorverwarmen" +#define MSG_PREHEAT_2_N "ABS voorverw. " +#define MSG_PREHEAT_2_ALL "ABS voorverw. aan" +#define MSG_PREHEAT_2_BEDONLY "ABS voorverw. Bed" +#define MSG_PREHEAT_2_SETTINGS "ABS verw. conf" #define MSG_COOLDOWN "Afkoelen" #define MSG_SWITCH_PS_ON "Stroom aan" #define MSG_SWITCH_PS_OFF "Stroom uit" diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 9c38a6db5..3b5da73c6 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -51,16 +51,16 @@ #define MSG_SET_HOME_OFFSETS "Ust. poz. zer." #define MSG_HOME_OFFSETS_APPLIED "Poz. zerowa ust." #define MSG_SET_ORIGIN "Ustaw punkt zero" -#define MSG_PREHEAT_PLA "Rozgrzej PLA" -#define MSG_PREHEAT_PLA_N "Rozgrzej PLA " -#define MSG_PREHEAT_PLA_ALL "Roz. PLA Wszystko" -#define MSG_PREHEAT_PLA_BEDONLY "Rozgrzej PLA Loze" -#define MSG_PREHEAT_PLA_SETTINGS "Ustaw. rozg. PLA" -#define MSG_PREHEAT_ABS "Rozgrzej ABS" -#define MSG_PREHEAT_ABS_N "Rozgrzej ABS " -#define MSG_PREHEAT_ABS_ALL "Roz. ABS Wszystko" -#define MSG_PREHEAT_ABS_BEDONLY "Rozgrzej ABS Loze" -#define MSG_PREHEAT_ABS_SETTINGS "Ustaw. rozg. ABS" +#define MSG_PREHEAT_1 "Rozgrzej PLA" +#define MSG_PREHEAT_1_N "Rozgrzej PLA " +#define MSG_PREHEAT_1_ALL "Roz. PLA Wszystko" +#define MSG_PREHEAT_1_BEDONLY "Rozgrzej PLA Loze" +#define MSG_PREHEAT_1_SETTINGS "Ustaw. rozg. PLA" +#define MSG_PREHEAT_2 "Rozgrzej ABS" +#define MSG_PREHEAT_2_N "Rozgrzej ABS " +#define MSG_PREHEAT_2_ALL "Roz. ABS Wszystko" +#define MSG_PREHEAT_2_BEDONLY "Rozgrzej ABS Loze" +#define MSG_PREHEAT_2_SETTINGS "Ustaw. rozg. ABS" #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index cc37f31da..c83f0dd2c 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Ajustar Jogo" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Ajustar orig." -#define MSG_PREHEAT_PLA "Pre-aquecer PLA" -#define MSG_PREHEAT_PLA_N "Pre-aquecer PLA" -#define MSG_PREHEAT_PLA_ALL "Pre-aq.Todo PLA" -#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_PLA_SETTINGS "Ajustar PLA" -#define MSG_PREHEAT_ABS "Pre-aquecer ABS" -#define MSG_PREHEAT_ABS_N "Pre-aquecer ABS" -#define MSG_PREHEAT_ABS_ALL "Pre-aq.Todo ABS" -#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_ABS_SETTINGS "Ajustar ABS" +#define MSG_PREHEAT_1 "Pre-aquecer PLA" +#define MSG_PREHEAT_1_N "Pre-aquecer PLA" +#define MSG_PREHEAT_1_ALL "Pre-aq.Todo PLA" +#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" +#define MSG_PREHEAT_1_SETTINGS "Ajustar PLA" +#define MSG_PREHEAT_2 "Pre-aquecer ABS" +#define MSG_PREHEAT_2_N "Pre-aquecer ABS" +#define MSG_PREHEAT_2_ALL "Pre-aq.Todo ABS" +#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" +#define MSG_PREHEAT_2_SETTINGS "Ajustar ABS" #define MSG_COOLDOWN "Esfriar" #define MSG_SWITCH_PS_ON "Ligar" #define MSG_SWITCH_PS_OFF "Desligar" diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index feb38b496..41aa46756 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Ajustar Jogo" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Ajustar orig." -#define MSG_PREHEAT_PLA "Pre-aquecer PLA" -#define MSG_PREHEAT_PLA_N "Pre-aquecer PLA" -#define MSG_PREHEAT_PLA_ALL "Pre-aq.Todo PLA" -#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_PLA_SETTINGS "Ajustar PLA" -#define MSG_PREHEAT_ABS "Pre-aquecer ABS" -#define MSG_PREHEAT_ABS_N "Pre-aquecer ABS" -#define MSG_PREHEAT_ABS_ALL "Pre-aq.Todo ABS" -#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_ABS_SETTINGS "Ajustar ABS" +#define MSG_PREHEAT_1 "Pre-aquecer PLA" +#define MSG_PREHEAT_1_N "Pre-aquecer PLA" +#define MSG_PREHEAT_1_ALL "Pre-aq.Todo PLA" +#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" +#define MSG_PREHEAT_1_SETTINGS "Ajustar PLA" +#define MSG_PREHEAT_2 "Pre-aquecer ABS" +#define MSG_PREHEAT_2_N "Pre-aquecer ABS" +#define MSG_PREHEAT_2_ALL "Pre-aq.Todo ABS" +#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" +#define MSG_PREHEAT_2_SETTINGS "Ajustar ABS" #define MSG_COOLDOWN "Esfriar" #define MSG_SWITCH_PS_ON "Ligar" #define MSG_SWITCH_PS_OFF "Desligar" diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 4c857a7c1..574e7fe63 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -53,16 +53,16 @@ #define MSG_SET_HOME_OFFSETS "Definir desvio" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Definir origem" -#define MSG_PREHEAT_PLA "Pre-aquecer PLA" -#define MSG_PREHEAT_PLA_N "Pre-aquecer PLA" -#define MSG_PREHEAT_PLA_ALL "Pre-aq. PLA Tudo" -#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_PLA_SETTINGS "Definicoes PLA" -#define MSG_PREHEAT_ABS "Pre-aquecer ABS" -#define MSG_PREHEAT_ABS_N "Pre-aquecer ABS " -#define MSG_PREHEAT_ABS_ALL "Pre-aq. ABS Tudo" -#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_ABS_SETTINGS "Definicoes ABS" +#define MSG_PREHEAT_1 "Pre-aquecer PLA" +#define MSG_PREHEAT_1_N "Pre-aquecer PLA" +#define MSG_PREHEAT_1_ALL "Pre-aq. PLA Tudo" +#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" +#define MSG_PREHEAT_1_SETTINGS "Definicoes PLA" +#define MSG_PREHEAT_2 "Pre-aquecer ABS" +#define MSG_PREHEAT_2_N "Pre-aquecer ABS " +#define MSG_PREHEAT_2_ALL "Pre-aq. ABS Tudo" +#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" +#define MSG_PREHEAT_2_SETTINGS "Definicoes ABS" #define MSG_COOLDOWN "Arrefecer" #define MSG_SWITCH_PS_ON "Ligar" #define MSG_SWITCH_PS_OFF "Desligar" diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h index c2fab4d63..25c4ddc5f 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -53,16 +53,16 @@ #define MSG_SET_HOME_OFFSETS "Definir desvio" #define MSG_HOME_OFFSETS_APPLIED "Offsets aplicados" #define MSG_SET_ORIGIN "Definir origem" -#define MSG_PREHEAT_PLA "Pre-aquecer PLA" -#define MSG_PREHEAT_PLA_N "Pre-aquecer PLA" -#define MSG_PREHEAT_PLA_ALL "Pre-aq. PLA Tudo" -#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_PLA_SETTINGS "Definições PLA" -#define MSG_PREHEAT_ABS "Pre-aquecer ABS" -#define MSG_PREHEAT_ABS_N "Pre-aquecer ABS " -#define MSG_PREHEAT_ABS_ALL "Pre-aq. ABS Tudo" -#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" -#define MSG_PREHEAT_ABS_SETTINGS "Definições ABS" +#define MSG_PREHEAT_1 "Pre-aquecer PLA" +#define MSG_PREHEAT_1_N "Pre-aquecer PLA" +#define MSG_PREHEAT_1_ALL "Pre-aq. PLA Tudo" +#define MSG_PREHEAT_1_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base" +#define MSG_PREHEAT_1_SETTINGS "Definições PLA" +#define MSG_PREHEAT_2 "Pre-aquecer ABS" +#define MSG_PREHEAT_2_N "Pre-aquecer ABS " +#define MSG_PREHEAT_2_ALL "Pre-aq. ABS Tudo" +#define MSG_PREHEAT_2_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base" +#define MSG_PREHEAT_2_SETTINGS "Definições ABS" #define MSG_COOLDOWN "Arrefecer" #define MSG_SWITCH_PS_ON "Ligar" #define MSG_SWITCH_PS_OFF "Desligar" diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 4d0f976c9..c86e34983 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -49,16 +49,16 @@ #define MSG_SET_HOME_OFFSETS "Запомнить парковку" #define MSG_HOME_OFFSETS_APPLIED "Offsets applied" #define MSG_SET_ORIGIN "Запомнить ноль" -#define MSG_PREHEAT_PLA "Преднагрев PLA" -#define MSG_PREHEAT_PLA_N "Греть PLA Сопло " -#define MSG_PREHEAT_PLA_ALL "Греть PLA Все" -#define MSG_PREHEAT_PLA_BEDONLY "Греть PLA Стол" -#define MSG_PREHEAT_PLA_SETTINGS "Настройки PLA" -#define MSG_PREHEAT_ABS "Преднагрев ABS" -#define MSG_PREHEAT_ABS_N "Греть ABS Сопло " -#define MSG_PREHEAT_ABS_ALL "Греть ABS Все" -#define MSG_PREHEAT_ABS_BEDONLY "Греть ABS Стол" -#define MSG_PREHEAT_ABS_SETTINGS "Настройки ABS" +#define MSG_PREHEAT_1 "Преднагрев PLA" +#define MSG_PREHEAT_1_N "Греть PLA Сопло " +#define MSG_PREHEAT_1_ALL "Греть PLA Все" +#define MSG_PREHEAT_1_BEDONLY "Греть PLA Стол" +#define MSG_PREHEAT_1_SETTINGS "Настройки PLA" +#define MSG_PREHEAT_2 "Преднагрев ABS" +#define MSG_PREHEAT_2_N "Греть ABS Сопло " +#define MSG_PREHEAT_2_ALL "Греть ABS Все" +#define MSG_PREHEAT_2_BEDONLY "Греть ABS Стол" +#define MSG_PREHEAT_2_SETTINGS "Настройки ABS" #define MSG_COOLDOWN "Охлаждение" #define MSG_SWITCH_PS_ON "Включить Питание" #define MSG_SWITCH_PS_OFF "Отключить Питание" diff --git a/Marlin/language_test.h b/Marlin/language_test.h index 17ad7bca0..ad284d2f7 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -141,8 +141,8 @@ #define MSG_DISABLE_STEPPERS STRG_C2_8 #define MSG_AUTO_HOME STRG_C2_9 #define MSG_SET_HOME_OFFSETS STRG_C2_a - #define MSG_PREHEAT_PLA STRG_C2_b - #define MSG_PREHEAT_ABS STRG_C3_8 + #define MSG_PREHEAT_1 STRG_C2_b + #define MSG_PREHEAT_2 STRG_C3_8 #define MSG_COOLDOWN STRG_C3_9 #define MSG_SWITCH_PS_OFF STRG_C3_a #define MSG_MOVE_AXIS STRG_C3_b @@ -176,8 +176,8 @@ #define MSG_DISABLE_STEPPERS STRG_D0_8 #define MSG_AUTO_HOME STRG_D0_9 #define MSG_SET_HOME_OFFSETS STRG_D0_a - #define MSG_PREHEAT_PLA STRG_D0_b - #define MSG_PREHEAT_ABS STRG_D1_8 + #define MSG_PREHEAT_1 STRG_D0_b + #define MSG_PREHEAT_2 STRG_D1_8 #define MSG_COOLDOWN STRG_D1_9 #define MSG_SWITCH_PS_OFF STRG_D1_a #define MSG_MOVE_AXIS STRG_D1_b @@ -211,8 +211,8 @@ #define MSG_DISABLE_STEPPERS STRG_E382_8 #define MSG_AUTO_HOME STRG_E382_9 #define MSG_SET_HOME_OFFSETS STRG_E382_a - #define MSG_PREHEAT_PLA STRG_E382_b - #define MSG_PREHEAT_ABS STRG_E383_8 + #define MSG_PREHEAT_1 STRG_E382_b + #define MSG_PREHEAT_2 STRG_E383_8 #define MSG_COOLDOWN STRG_E383_9 #define MSG_SWITCH_PS_OFF STRG_E383_a #define MSG_MOVE_AXIS STRG_E383_b diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 87104d87e..7536ec9af 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -33,13 +33,8 @@ #include "printcounter.h" #endif -int plaPreheatHotendTemp; -int plaPreheatHPBTemp; -int plaPreheatFanSpeed; - -int absPreheatHotendTemp; -int absPreheatHPBTemp; -int absPreheatFanSpeed; +int preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1, + preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2; #if ENABLED(FILAMENT_LCD_DISPLAY) millis_t previous_lcd_status_ms = 0; @@ -849,29 +844,29 @@ static void lcd_status_screen() { } #if TEMP_SENSOR_0 != 0 - void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + void lcd_preheat_pla0() { _lcd_preheat(0, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); } + void lcd_preheat_abs0() { _lcd_preheat(0, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); } #endif #if HOTENDS > 1 - void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + void lcd_preheat_pla1() { _lcd_preheat(1, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); } + void lcd_preheat_abs1() { _lcd_preheat(1, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); } #if HOTENDS > 2 - void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + void lcd_preheat_pla2() { _lcd_preheat(2, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); } + void lcd_preheat_abs2() { _lcd_preheat(2, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); } #if HOTENDS > 3 - void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } + void lcd_preheat_pla3() { _lcd_preheat(3, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); } + void lcd_preheat_abs3() { _lcd_preheat(3, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); } #endif #endif void lcd_preheat_pla0123() { #if HOTENDS > 1 - thermalManager.setTargetHotend(plaPreheatHotendTemp, 1); + thermalManager.setTargetHotend(preheatHotendTemp1, 1); #if HOTENDS > 2 - thermalManager.setTargetHotend(plaPreheatHotendTemp, 2); + thermalManager.setTargetHotend(preheatHotendTemp1, 2); #if HOTENDS > 3 - thermalManager.setTargetHotend(plaPreheatHotendTemp, 3); + thermalManager.setTargetHotend(preheatHotendTemp1, 3); #endif #endif #endif @@ -879,11 +874,11 @@ static void lcd_status_screen() { } void lcd_preheat_abs0123() { #if HOTENDS > 1 - thermalManager.setTargetHotend(absPreheatHotendTemp, 1); + thermalManager.setTargetHotend(preheatHotendTemp2, 1); #if HOTENDS > 2 - thermalManager.setTargetHotend(absPreheatHotendTemp, 2); + thermalManager.setTargetHotend(preheatHotendTemp2, 2); #if HOTENDS > 3 - thermalManager.setTargetHotend(absPreheatHotendTemp, 3); + thermalManager.setTargetHotend(preheatHotendTemp2, 3); #endif #endif #endif @@ -893,8 +888,8 @@ static void lcd_status_screen() { #endif // HOTENDS > 1 #if TEMP_SENSOR_BED != 0 - void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); } - void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, absPreheatHPBTemp, absPreheatFanSpeed); } + void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, preheatBedTemp1, preheatFanSpeed1); } + void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, preheatBedTemp2, preheatFanSpeed2); } #endif #if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0) @@ -903,20 +898,20 @@ static void lcd_status_screen() { START_MENU(); MENU_ITEM(back, MSG_PREPARE); #if HOTENDS == 1 - MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0); + MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_pla0); #else - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0); - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1); + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_pla0); + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_pla1); #if HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2); + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_pla2); #if HOTENDS > 3 - MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3); + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_pla3); #endif #endif - MENU_ITEM(function, MSG_PREHEAT_PLA_ALL, lcd_preheat_pla0123); + MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_pla0123); #endif #if TEMP_SENSOR_BED != 0 - MENU_ITEM(function, MSG_PREHEAT_PLA_BEDONLY, lcd_preheat_pla_bedonly); + MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_pla_bedonly); #endif END_MENU(); } @@ -925,20 +920,20 @@ static void lcd_status_screen() { START_MENU(); MENU_ITEM(back, MSG_PREPARE); #if HOTENDS == 1 - MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0); + MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_abs0); #else - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0); - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1); + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_abs0); + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_abs1); #if HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2); + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_abs2); #if HOTENDS > 3 - MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3); + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_abs3); #endif #endif - MENU_ITEM(function, MSG_PREHEAT_ABS_ALL, lcd_preheat_abs0123); + MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_abs0123); #endif #if TEMP_SENSOR_BED != 0 - MENU_ITEM(function, MSG_PREHEAT_ABS_BEDONLY, lcd_preheat_abs_bedonly); + MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_abs_bedonly); #endif END_MENU(); } @@ -1222,11 +1217,11 @@ static void lcd_status_screen() { // #if TEMP_SENSOR_0 != 0 #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0 - MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu); - MENU_ITEM(submenu, MSG_PREHEAT_ABS, lcd_preheat_abs_menu); + MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_pla_menu); + MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_abs_menu); #else - MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla0); - MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs0); + MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_pla0); + MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_abs0); #endif #endif @@ -1685,12 +1680,12 @@ static void lcd_status_screen() { // // Preheat PLA conf // - MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); + MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); // // Preheat ABS conf // - MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu); + MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu); END_MENU(); } @@ -1702,12 +1697,12 @@ static void lcd_status_screen() { static void lcd_control_temperature_preheat_pla_settings_menu() { START_MENU(); MENU_ITEM(back, MSG_TEMPERATURE); - MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255); + MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed1, 0, 255); #if TEMP_SENSOR_0 != 0 - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &plaPreheatHotendTemp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15); + MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp1, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15); #endif #if TEMP_SENSOR_BED != 0 - MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15); + MENU_ITEM_EDIT(int3, MSG_BED, &preheatBedTemp1, BED_MINTEMP, BED_MAXTEMP - 15); #endif #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); @@ -1723,12 +1718,12 @@ static void lcd_status_screen() { static void lcd_control_temperature_preheat_abs_settings_menu() { START_MENU(); MENU_ITEM(back, MSG_TEMPERATURE); - MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255); + MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed2, 0, 255); #if TEMP_SENSOR_0 != 0 - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &absPreheatHotendTemp, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15); + MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp2, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15); #endif #if TEMP_SENSOR_BED != 0 - MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15); + MENU_ITEM_EDIT(int3, MSG_BED, &preheatBedTemp2, BED_MINTEMP, BED_MAXTEMP - 15); #endif #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 40b09606a..bf5e230fa 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -88,12 +88,12 @@ FORCE_INLINE void lcd_buttons_update() {} #endif - extern int plaPreheatHotendTemp; - extern int plaPreheatHPBTemp; - extern int plaPreheatFanSpeed; - extern int absPreheatHotendTemp; - extern int absPreheatHPBTemp; - extern int absPreheatFanSpeed; + extern int preheatHotendTemp1; + extern int preheatBedTemp1; + extern int preheatFanSpeed1; + extern int preheatHotendTemp2; + extern int preheatBedTemp2; + extern int preheatFanSpeed2; #if ENABLED(FILAMENT_LCD_DISPLAY) extern millis_t previous_lcd_status_ms; From a8538bd7ce25c2febad6866bc9d2f1bdae8bd984 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 17:53:49 -0700 Subject: [PATCH 286/580] General cleanup, code reduction in Marlin_main.cpp --- Marlin/Marlin_main.cpp | 110 ++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 61 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0c3d6aab9..679c56adc 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1323,7 +1323,7 @@ inline bool code_value_bool() { return code_value_byte() > 0; } float code_value_temp_diff() { return code_value_float(); } #endif -inline millis_t code_value_millis() { return code_value_ulong(); } +FORCE_INLINE millis_t code_value_millis() { return code_value_ulong(); } inline millis_t code_value_millis_from_seconds() { return code_value_float() * 1000; } bool code_seen(char code) { @@ -3219,7 +3219,6 @@ inline void gcode_G28() { } int8_t px, py; - float z; switch (state) { case MeshReport: @@ -3317,24 +3316,22 @@ inline void gcode_G28() { return; } if (code_seen('Z')) { - z = code_value_axis_units(Z_AXIS); + mbl.z_values[py][px] = code_value_axis_units(Z_AXIS); } else { SERIAL_PROTOCOLLNPGM("Z not entered."); return; } - mbl.z_values[py][px] = z; break; case MeshSetZOffset: if (code_seen('Z')) { - z = code_value_axis_units(Z_AXIS); + mbl.z_offset = code_value_axis_units(Z_AXIS); } else { SERIAL_PROTOCOLLNPGM("Z not entered."); return; } - mbl.z_offset = z; break; case MeshReset: @@ -3866,15 +3863,12 @@ inline void gcode_G92() { #if ENABLED(ULTIPANEL) /** - * M0: // M0 - Unconditional stop - Wait for user button press on LCD - * M1: // M1 - Conditional stop - Wait for user button press on LCD + * M0: Unconditional stop - Wait for user button press on LCD + * M1: Conditional stop - Wait for user button press on LCD */ inline void gcode_M0_M1() { char* args = current_command_args; - uint8_t test_value = 12; - SERIAL_ECHOPAIR("TEST", test_value); - millis_t codenum = 0; bool hasP = false, hasS = false; if (code_seen('P')) { @@ -4096,35 +4090,34 @@ inline void gcode_M31() { * S Pin status from 0 - 255 */ inline void gcode_M42() { - if (code_seen('S')) { - int pin_status = code_value_int(); - if (pin_status < 0 || pin_status > 255) return; + if (!code_seen('S')) return; - int pin_number = code_seen('P') ? code_value_int() : LED_PIN; - if (pin_number < 0) return; + int pin_status = code_value_int(); + if (pin_status < 0 || pin_status > 255) return; - for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) - if (pin_number == sensitive_pins[i]) return; + int pin_number = code_seen('P') ? code_value_int() : LED_PIN; + if (pin_number < 0) return; - pinMode(pin_number, OUTPUT); - digitalWrite(pin_number, pin_status); - analogWrite(pin_number, pin_status); + for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) + if (pin_number == sensitive_pins[i]) return; - #if FAN_COUNT > 0 - switch (pin_number) { - #if HAS_FAN0 - case FAN_PIN: fanSpeeds[0] = pin_status; break; - #endif - #if HAS_FAN1 - case FAN1_PIN: fanSpeeds[1] = pin_status; break; - #endif - #if HAS_FAN2 - case FAN2_PIN: fanSpeeds[2] = pin_status; break; - #endif - } - #endif + pinMode(pin_number, OUTPUT); + digitalWrite(pin_number, pin_status); + analogWrite(pin_number, pin_status); - } // code_seen('S') + #if FAN_COUNT > 0 + switch (pin_number) { + #if HAS_FAN0 + case FAN_PIN: fanSpeeds[0] = pin_status; break; + #endif + #if HAS_FAN1 + case FAN1_PIN: fanSpeeds[1] = pin_status; break; + #endif + #if HAS_FAN2 + case FAN2_PIN: fanSpeeds[2] = pin_status; break; + #endif + } + #endif } #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) @@ -5534,11 +5527,9 @@ inline void gcode_M220() { * M221: Set extrusion percentage (M221 T0 S95) */ inline void gcode_M221() { - if (code_seen('S')) { - int sval = code_value_int(); - if (get_target_extruder_from_command(221)) return; - extruder_multiplier[target_extruder] = sval; - } + if (get_target_extruder_from_command(221)) return; + if (code_seen('S')) + extruder_multiplier[target_extruder] = code_value_int(); } /** @@ -5590,28 +5581,27 @@ inline void gcode_M226() { #if HAS_SERVOS /** - * M280: Get or set servo position. P S + * M280: Get or set servo position. P [S] */ inline void gcode_M280() { - int servo_index = code_seen('P') ? code_value_int() : -1; - int servo_position = 0; - if (code_seen('S')) { - servo_position = code_value_int(); - if (servo_index >= 0 && servo_index < NUM_SERVOS) - MOVE_SERVO(servo_index, servo_position); + if (!code_seen('P')) return; + int servo_index = code_value_int(); + if (servo_index >= 0 && servo_index < NUM_SERVOS) { + if (code_seen('S')) + MOVE_SERVO(servo_index, code_value_int()); else { - SERIAL_ERROR_START; - SERIAL_ERROR("Servo "); - SERIAL_ERROR(servo_index); - SERIAL_ERRORLN(" out of range"); + SERIAL_ECHO_START; + SERIAL_ECHOPGM(" Servo "); + SERIAL_ECHO(servo_index); + SERIAL_ECHOPGM(": "); + SERIAL_ECHOLN(servo[servo_index].read()); } } - else if (servo_index >= 0) { - SERIAL_ECHO_START; - SERIAL_ECHOPGM(" Servo "); - SERIAL_ECHO(servo_index); - SERIAL_ECHOPGM(": "); - SERIAL_ECHOLN(servo[servo_index].read()); + else { + SERIAL_ERROR_START; + SERIAL_ERROR("Servo "); + SERIAL_ERROR(servo_index); + SERIAL_ERRORLN(" out of range"); } } @@ -5864,11 +5854,9 @@ inline void gcode_M303() { * M365: SCARA calibration: Scaling factor, X, Y, Z axis */ inline void gcode_M365() { - for (int8_t i = X_AXIS; i <= Z_AXIS; i++) { - if (code_seen(axis_codes[i])) { + for (int8_t i = X_AXIS; i <= Z_AXIS; i++) + if (code_seen(axis_codes[i])) axis_scaling[i] = code_value_float(); - } - } } #endif // SCARA From 4cd045791c0b64f36e0bf8110c92f89e845d7f65 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 16:25:48 -0700 Subject: [PATCH 287/580] Reduce code size by trusting the compiler --- Marlin/Marlin_main.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 679c56adc..6fe94a422 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1338,16 +1338,15 @@ bool code_seen(char code) { */ bool get_target_extruder_from_command(int code) { if (code_seen('T')) { - uint8_t t = code_value_byte(); - if (t >= EXTRUDERS) { + if (code_value_byte() >= EXTRUDERS) { SERIAL_ECHO_START; SERIAL_CHAR('M'); SERIAL_ECHO(code); - SERIAL_ECHOPAIR(" " MSG_INVALID_EXTRUDER " ", t); + SERIAL_ECHOPAIR(" " MSG_INVALID_EXTRUDER " ", code_value_byte()); SERIAL_EOL; return true; } - target_extruder = t; + target_extruder = code_value_byte(); } else target_extruder = active_extruder; @@ -2576,10 +2575,8 @@ void gcode_get_destination() { else destination[i] = current_position[i]; } - if (code_seen('F')) { - float next_feedrate = code_value_linear_units(); - if (next_feedrate > 0.0) feedrate = next_feedrate; - } + if (code_seen('F') && code_value_linear_units() > 0.0) + feedrate = code_value_linear_units(); } void unknown_command_error() { @@ -4387,11 +4384,10 @@ inline void gcode_M104() { #endif if (code_seen('S')) { - float temp = code_value_temp_abs(); - thermalManager.setTargetHotend(temp, target_extruder); + thermalManager.setTargetHotend(code_value_temp_abs(), target_extruder); #if ENABLED(DUAL_X_CARRIAGE) if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) - thermalManager.setTargetHotend(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset, 1); + thermalManager.setTargetHotend(code_value_temp_abs() == 0.0 ? 0.0 : code_value_temp_abs() + duplicate_extruder_temp_offset, 1); #endif #if ENABLED(PRINTJOB_TIMER_AUTOSTART) @@ -4402,13 +4398,13 @@ inline void gcode_M104() { * stand by mode, for instance in a dual extruder setup, without affecting * the running print timer. */ - if (temp <= (EXTRUDE_MINTEMP)/2) { + if (code_value_temp_abs() <= (EXTRUDE_MINTEMP)/2) { print_job_timer.stop(); LCD_MESSAGEPGM(WELCOME_MSG); } #endif - if (temp > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING); + if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING); } } @@ -4566,11 +4562,10 @@ inline void gcode_M109() { bool no_wait_for_cooling = code_seen('S'); if (no_wait_for_cooling || code_seen('R')) { - float temp = code_value_temp_abs(); - thermalManager.setTargetHotend(temp, target_extruder); + thermalManager.setTargetHotend(code_value_temp_abs(), target_extruder); #if ENABLED(DUAL_X_CARRIAGE) if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) - thermalManager.setTargetHotend(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset, 1); + thermalManager.setTargetHotend(code_value_temp_abs() == 0.0 ? 0.0 : code_value_temp_abs() + duplicate_extruder_temp_offset, 1); #endif #if ENABLED(PRINTJOB_TIMER_AUTOSTART) @@ -4579,7 +4574,7 @@ inline void gcode_M109() { * stand by mode, for instance in a dual extruder setup, without affecting * the running print timer. */ - if (temp <= (EXTRUDE_MINTEMP)/2) { + if (code_value_temp_abs() <= (EXTRUDE_MINTEMP)/2) { print_job_timer.stop(); LCD_MESSAGEPGM(WELCOME_MSG); } @@ -4693,7 +4688,7 @@ inline void gcode_M109() { if (no_wait_for_cooling || code_seen('R')) { thermalManager.setTargetBed(code_value_temp_abs()); #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - if(code_value_temp_abs() > BED_MINTEMP) { + if (code_value_temp_abs() > BED_MINTEMP) { /** * We start the timer when 'heating and waiting' command arrives, LCD * functions never wait. Cooling down managed by extruders. @@ -5241,13 +5236,12 @@ inline void gcode_M200() { if (get_target_extruder_from_command(200)) return; if (code_seen('D')) { - float diameter = code_value_linear_units(); // setting any extruder filament size disables volumetric on the assumption that // slicers either generate in extruder values as cubic mm or as as filament feeds // for all extruders - volumetric_enabled = (diameter != 0.0); + volumetric_enabled = (code_value_linear_units() != 0.0); if (volumetric_enabled) { - filament_size[target_extruder] = diameter; + filament_size[target_extruder] = code_value_linear_units(); // make sure all extruders have some sane value for the filament size for (int i = 0; i < EXTRUDERS; i++) if (! filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA; From faac2bcfdb6d95805bdffd39ffa0eba210d20098 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 10 Jul 2016 04:50:45 +0200 Subject: [PATCH 288/580] Add a kill-screen --- Marlin/Marlin_main.cpp | 15 ++++++--------- Marlin/dogm_lcd_implementation.h | 10 ++++++++++ Marlin/language_en.h | 6 ++++++ Marlin/ultralcd.cpp | 18 ++++++++++++++++++ Marlin/ultralcd.h | 2 ++ .../ultralcd_implementation_hitachi_HD44780.h | 13 +++++++++++++ 6 files changed, 55 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8b419b9e7..24464e24e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -8265,13 +8265,17 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { } void kill(const char* lcd_msg) { + SERIAL_ERROR_START; + SERIAL_ERRORLNPGM(MSG_ERR_KILLED); + #if ENABLED(ULTRA_LCD) - lcd_init(); - lcd_setalertstatuspgm(lcd_msg); + kill_screen(lcd_msg); #else UNUSED(lcd_msg); #endif + for (int i = 5; i--;) delay(100); // Wait a short time + cli(); // Stop interrupts thermalManager.disable_all_heaters(); disable_all_steppers(); @@ -8280,13 +8284,6 @@ void kill(const char* lcd_msg) { pinMode(PS_ON_PIN, INPUT); #endif - SERIAL_ERROR_START; - SERIAL_ERRORLNPGM(MSG_ERR_KILLED); - - // FMC small patch to update the LCD before ending - sei(); // enable interrupts - for (int i = 5; i--; lcd_update()) delay(200); // Wait a short time - cli(); // disable interrupts suicide(); while (1) { #if ENABLED(USE_WATCHDOG) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index ffe6a52ab..c71213a22 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -290,6 +290,16 @@ static void lcd_implementation_init() { #endif } +void lcd_kill_screen() { + lcd_setFont(FONT_MENU); + u8g.setPrintPos(0, u8g.getHeight()/4*1); + lcd_print(lcd_status_message); + u8g.setPrintPos(0, u8g.getHeight()/4*2); + lcd_printPGM(PSTR(MSG_HALTED)); + u8g.setPrintPos(0, u8g.getHeight()/4*3); + lcd_printPGM(PSTR(MSG_PLEASE_RESET)); +} + static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) { diff --git a/Marlin/language_en.h b/Marlin/language_en.h index f69ef9ca3..a82da89bd 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -487,6 +487,12 @@ #ifndef MSG_ERR_MINTEMP_BED #define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED" #endif +#ifndef MSG_HALTED + #define MSG_HALTED "PRINTER HALTED" +#endif +#ifndef MSG_PLEASE_RESET + #define MSG_PLEASE_RESET "Please reset" +#endif #ifndef MSG_END_HOUR #define MSG_END_HOUR "hours" #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 87104d87e..4d3650d58 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -530,6 +530,24 @@ static void lcd_status_screen() { #endif //ULTIPANEL } +/** + * + * draw the kill screen + * + */ +void kill_screen(const char* lcd_msg) { + lcd_init(); + lcd_setalertstatuspgm(lcd_msg); + #if ENABLED(DOGLCD) + u8g.firstPage(); + do { + lcd_kill_screen(); + } while (u8g.nextPage()); + #else + lcd_kill_screen(); + #endif +} + #if ENABLED(ULTIPANEL) inline void line_to_current(AxisEnum axis) { diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 40b09606a..fde78c0b1 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -40,6 +40,8 @@ void lcd_setalertstatuspgm(const char* message); void lcd_reset_alert_level(); bool lcd_detected(void); + void lcd_kill_screen(); + void kill_screen(const char* lcd_msg); #if ENABLED(LCD_USE_I2C_BUZZER) void lcd_buzz(long duration, uint16_t freq); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index edb496e2e..7f7bee549 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -572,6 +572,19 @@ unsigned lcd_print(char c) { return charset_mapper(c); } #endif // SHOW_BOOTSCREEN +void lcd_kill_screen() { + lcd.setCursor(0, 0); + lcd_print(lcd_status_message); + #if LCD_HEIGHT < 4 + lcd.setCursor(0, 2); + #else + lcd.setCursor(0, 2); + lcd_printPGM(PSTR(MSG_HALTED)); + lcd.setCursor(0, 3); + #endif + lcd_printPGM(PSTR(MSG_PLEASE_RESET)); +} + FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) { if (blink) lcd_printPGM(pstr); From 5832f4b8481a36292e589ad38bb9f67d1c588050 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sun, 10 Jul 2016 14:24:57 +0900 Subject: [PATCH 289/580] Follow-up the PR #4253 (Runout Sensor without SD Card, Print Timer support in M104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update forgotten example configuration files --- Marlin/example_configurations/Felix/DUAL/Configuration.h | 5 ++++- .../example_configurations/K8400/Dual Heads/Configuration.h | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 731d8ce5e..ee80a1a12 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -771,7 +771,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: diff --git a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h index c244ea043..8eb1c40a3 100644 --- a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h @@ -790,7 +790,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // Print job timer // // Enable this option to automatically start and stop the -// print job timer when M104 and M109 commands are received. +// print job timer when M104/M109/M190 commands are received. +// M104 (extruder without wait) - high temp = none, low temp = stop timer +// M109 (extruder with wait) - high temp = start timer, low temp = stop timer +// M190 (bed with wait) - high temp = start timer, low temp = none // // In all cases the timer can be started and stopped using // the following commands: From 9e56d5825e1bab21bacf3280daa4d37c3e926407 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sun, 10 Jul 2016 14:25:29 +0900 Subject: [PATCH 290/580] Adjust spacing --- Marlin/Conditionals.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 844d2a4e5..410801450 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -846,16 +846,16 @@ /** * MIN_Z_HEIGHT_FOR_HOMING / Z_RAISE_BETWEEN_PROBINGS */ - #ifndef MIN_Z_HEIGHT_FOR_HOMING - #ifndef Z_RAISE_BETWEEN_PROBINGS - #define MIN_Z_HEIGHT_FOR_HOMING 0 - #else - #define MIN_Z_HEIGHT_FOR_HOMING Z_RAISE_BETWEEN_PROBINGS - #endif - #endif - #ifndef Z_RAISE_BETWEEN_PROBINGS - #define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING - #endif + #ifndef MIN_Z_HEIGHT_FOR_HOMING + #ifndef Z_RAISE_BETWEEN_PROBINGS + #define MIN_Z_HEIGHT_FOR_HOMING 0 + #else + #define MIN_Z_HEIGHT_FOR_HOMING Z_RAISE_BETWEEN_PROBINGS + #endif + #endif + #ifndef Z_RAISE_BETWEEN_PROBINGS + #define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING + #endif #endif //CONFIGURATION_LCD #endif //CONDITIONALS_H From eaf9e615cec4afd10e9f226a00950e093019524d Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Sun, 10 Jul 2016 13:08:05 +0200 Subject: [PATCH 291/580] Total print time for LCD correction (hours:minutes format) --- Marlin/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d0a9a5dd7..198c04921 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1953,7 +1953,7 @@ void kill_screen(const char* lcd_msg) { printStatistics stats = print_job_counter.getStats(); char printTime[6]; - sprintf(printTime, "%02d:%02d", int(stats.printTime / 60), int(stats.printTime % 60)); + sprintf(printTime, "%02d:%02d", int(stats.printTime / 3600), int(stats.printTime / 60) % 60); if (LCD_CLICKED) lcd_goto_previous_menu(true); START_SCREEN(); From 66602f4af625a13d0fee5461ced536e922461b8d Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Sun, 10 Jul 2016 13:25:50 +0200 Subject: [PATCH 292/580] Update language_cz.h New strings: #define MSG_HALTED #define MSG_PLEASE_RESET Some texts shortened for smaller displays. --- Marlin/language_cz.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index fabaf0e98..a4bfdf933 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -182,12 +182,14 @@ #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_HEATING_FAILED_LCD "Chyba zahrivani" -#define MSG_ERR_REDUNDANT_TEMP "Chyba: REDUNDANTNI TEPLOTA" +#define MSG_ERR_REDUNDANT_TEMP "REDUND. TEPLOTA" #define MSG_THERMAL_RUNAWAY "TEPLOTNI SKOK" -#define MSG_ERR_MAXTEMP "Chyba: VYSOKA TEPLOTA" -#define MSG_ERR_MINTEMP "Chyba: NIZKA TEPLOTA" -#define MSG_ERR_MAXTEMP_BED "Chyba: VYSOKA TEPLOTA PODL." -#define MSG_ERR_MINTEMP_BED "Chyba: NIZKA TEPLOTA PODL." +#define MSG_ERR_MAXTEMP "VYSOKA TEPLOTA" +#define MSG_ERR_MINTEMP "NIZKA TEPLOTA" +#define MSG_ERR_MAXTEMP_BED "VYS. TEPL. PODL." +#define MSG_ERR_MINTEMP_BED "NIZ. TEPL. PODL." +#define MSG_HALTED "TISK. ZASTAVENA" +#define MSG_PLEASE_RESET "Provedte reset" #define MSG_END_HOUR "hod" #define MSG_END_MINUTE "min" #define MSG_HEATING "Zahrivani..." From b72238f4063fcf67f3155fdf732d50f4860d795c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 19:47:11 -0700 Subject: [PATCH 293/580] Invariant get_pid_output with HOTENDS < 2 --- Marlin/temperature.cpp | 84 +++++++++++++++++++++--------------------- Marlin/temperature.h | 27 +++++++++----- 2 files changed, 59 insertions(+), 52 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index fb9b40cf0..2fa6074b2 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -514,88 +514,86 @@ void Temperature::min_temp_error(uint8_t e) { } float Temperature::get_pid_output(int e) { + #if HOTENDS == 1 + UNUSED(e); + #define _HOTEND_TEST true + #define _HOTEND_EXTRUDER active_extruder + #else + #define _HOTEND_TEST e == active_extruder + #define _HOTEND_EXTRUDER e + #endif float pid_output; #if ENABLED(PIDTEMP) #if DISABLED(PID_OPENLOOP) - pid_error[e] = target_temperature[e] - current_temperature[e]; - dTerm[e] = K2 * PID_PARAM(Kd, e) * (current_temperature[e] - temp_dState[e]) + K1 * dTerm[e]; - temp_dState[e] = current_temperature[e]; - if (pid_error[e] > PID_FUNCTIONAL_RANGE) { + pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX]; + dTerm[HOTEND_INDEX] = K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + K1 * dTerm[HOTEND_INDEX]; + temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX]; + if (pid_error[HOTEND_INDEX] > PID_FUNCTIONAL_RANGE) { pid_output = BANG_MAX; - pid_reset[e] = true; + pid_reset[HOTEND_INDEX] = true; } - else if (pid_error[e] < -(PID_FUNCTIONAL_RANGE) || target_temperature[e] == 0) { + else if (pid_error[HOTEND_INDEX] < -(PID_FUNCTIONAL_RANGE) || target_temperature[HOTEND_INDEX] == 0) { pid_output = 0; - pid_reset[e] = true; + pid_reset[HOTEND_INDEX] = true; } else { - if (pid_reset[e]) { - temp_iState[e] = 0.0; - pid_reset[e] = false; + if (pid_reset[HOTEND_INDEX]) { + temp_iState[HOTEND_INDEX] = 0.0; + pid_reset[HOTEND_INDEX] = false; } - pTerm[e] = PID_PARAM(Kp, e) * pid_error[e]; - temp_iState[e] += pid_error[e]; - temp_iState[e] = constrain(temp_iState[e], temp_iState_min[e], temp_iState_max[e]); - iTerm[e] = PID_PARAM(Ki, e) * temp_iState[e]; + pTerm[HOTEND_INDEX] = PID_PARAM(Kp, HOTEND_INDEX) * pid_error[HOTEND_INDEX]; + temp_iState[HOTEND_INDEX] += pid_error[HOTEND_INDEX]; + temp_iState[HOTEND_INDEX] = constrain(temp_iState[HOTEND_INDEX], temp_iState_min[HOTEND_INDEX], temp_iState_max[HOTEND_INDEX]); + iTerm[HOTEND_INDEX] = PID_PARAM(Ki, HOTEND_INDEX) * temp_iState[HOTEND_INDEX]; - pid_output = pTerm[e] + iTerm[e] - dTerm[e]; - - #if ENABLED(SINGLENOZZLE) - #define _NOZZLE_TEST true - #define _NOZZLE_EXTRUDER active_extruder - #define _CTERM_INDEX 0 - #else - #define _NOZZLE_TEST e == active_extruder - #define _NOZZLE_EXTRUDER e - #define _CTERM_INDEX e - #endif + pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX]; #if ENABLED(PID_ADD_EXTRUSION_RATE) - cTerm[_CTERM_INDEX] = 0; - if (_NOZZLE_TEST) { + cTerm[HOTEND_INDEX] = 0; + if (_HOTEND_TEST) { long e_position = stepper.position(E_AXIS); - if (e_position > last_position[_NOZZLE_EXTRUDER]) { - lpq[lpq_ptr++] = e_position - last_position[_NOZZLE_EXTRUDER]; - last_position[_NOZZLE_EXTRUDER] = e_position; + if (e_position > last_position[_HOTEND_EXTRUDER]) { + lpq[lpq_ptr++] = e_position - last_position[_HOTEND_EXTRUDER]; + last_position[_HOTEND_EXTRUDER] = e_position; } else { lpq[lpq_ptr++] = 0; } if (lpq_ptr >= lpq_len) lpq_ptr = 0; - cTerm[_CTERM_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_mm[E_AXIS]) * PID_PARAM(Kc, e); - pid_output += cTerm[e]; + cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX); + pid_output += cTerm[HOTEND_INDEX]; } #endif //PID_ADD_EXTRUSION_RATE if (pid_output > PID_MAX) { - if (pid_error[e] > 0) temp_iState[e] -= pid_error[e]; // conditional un-integration + if (pid_error[HOTEND_INDEX] > 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration pid_output = PID_MAX; } else if (pid_output < 0) { - if (pid_error[e] < 0) temp_iState[e] -= pid_error[e]; // conditional un-integration + if (pid_error[HOTEND_INDEX] < 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration pid_output = 0; } } #else - pid_output = constrain(target_temperature[e], 0, PID_MAX); + pid_output = constrain(target_temperature[HOTEND_INDEX], 0, PID_MAX); #endif //PID_OPENLOOP #if ENABLED(PID_DEBUG) SERIAL_ECHO_START; - SERIAL_ECHOPAIR(MSG_PID_DEBUG, e); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_INPUT, current_temperature[e]); + SERIAL_ECHOPAIR(MSG_PID_DEBUG, HOTEND_INDEX); + SERIAL_ECHOPAIR(MSG_PID_DEBUG_INPUT, current_temperature[HOTEND_INDEX]); SERIAL_ECHOPAIR(MSG_PID_DEBUG_OUTPUT, pid_output); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_PTERM, pTerm[e]); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_ITERM, iTerm[e]); - SERIAL_ECHOPAIR(MSG_PID_DEBUG_DTERM, dTerm[e]); + SERIAL_ECHOPAIR(MSG_PID_DEBUG_PTERM, pTerm[HOTEND_INDEX]); + SERIAL_ECHOPAIR(MSG_PID_DEBUG_ITERM, iTerm[HOTEND_INDEX]); + SERIAL_ECHOPAIR(MSG_PID_DEBUG_DTERM, dTerm[HOTEND_INDEX]); #if ENABLED(PID_ADD_EXTRUSION_RATE) - SERIAL_ECHOPAIR(MSG_PID_DEBUG_CTERM, cTerm[e]); + SERIAL_ECHOPAIR(MSG_PID_DEBUG_CTERM, cTerm[HOTEND_INDEX]); #endif SERIAL_EOL; #endif //PID_DEBUG #else /* PID off */ - pid_output = (current_temperature[e] < target_temperature[e]) ? PID_MAX : 0; + pid_output = (current_temperature[HOTEND_INDEX] < target_temperature[HOTEND_INDEX]) ? PID_MAX : 0; #endif return pid_output; @@ -672,7 +670,7 @@ void Temperature::manage_heater() { #endif // Loop through all hotends - for (int e = 0; e < HOTENDS; e++) { + for (uint8_t e = 0; e < HOTENDS; e++) { #if ENABLED(THERMAL_PROTECTION_HOTENDS) thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 60aa80d6a..f8b190800 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -38,6 +38,16 @@ #define SOFT_PWM_SCALE 0 #endif +#if HOTENDS == 1 + #define HOTEND_ARG 0 + #define HOTEND_INDEX 0 + #define EXTRUDER_ARG 0 +#else + #define HOTEND_ARG hotend + #define HOTEND_INDEX e + #define EXTRUDER_ARG active_extruder +#endif + class Temperature { public: @@ -112,7 +122,12 @@ class Temperature { #if ENABLED(PREVENT_DANGEROUS_EXTRUDE) static float extrude_min_temp; - static bool tooColdToExtrude(uint8_t e) { return degHotend(e) < extrude_min_temp; } + static bool tooColdToExtrude(uint8_t e) { + #if HOTENDS == 1 + UNUSED(e); + #endif + return degHotend(HOTEND_INDEX) < extrude_min_temp; + } #else static bool tooColdToExtrude(uint8_t e) { UNUSED(e); return false; } #endif @@ -230,12 +245,6 @@ class Temperature { //inline so that there is no performance decrease. //deg=degreeCelsius - #if HOTENDS == 1 - #define HOTEND_ARG 0 - #else - #define HOTEND_ARG hotend - #endif - static float degHotend(uint8_t hotend) { #if HOTENDS == 1 UNUSED(hotend); @@ -329,8 +338,8 @@ class Temperature { #if ENABLED(AUTOTEMP) if (planner.autotemp_enabled) { planner.autotemp_enabled = false; - if (degTargetHotend(active_extruder) > planner.autotemp_min) - setTargetHotend(0, active_extruder); + if (degTargetHotend(EXTRUDER_ARG) > planner.autotemp_min) + setTargetHotend(0, EXTRUDER_ARG); } #endif } From 3e1bbd5e2752760f2907e3a6833676851cfb6aa0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 20:11:23 -0700 Subject: [PATCH 294/580] Indentation in gcode_M100 --- Marlin/M100_Free_Mem_Chk.cpp | 125 +++++++++++++++++------------------ 1 file changed, 61 insertions(+), 64 deletions(-) diff --git a/Marlin/M100_Free_Mem_Chk.cpp b/Marlin/M100_Free_Mem_Chk.cpp index c3027794c..8804bab6a 100644 --- a/Marlin/M100_Free_Mem_Chk.cpp +++ b/Marlin/M100_Free_Mem_Chk.cpp @@ -57,9 +57,6 @@ void prt_hex_byte(unsigned int); void prt_hex_word(unsigned int); int how_many_E5s_are_here(unsigned char*); - - - void gcode_M100() { static int m100_not_initialized = 1; unsigned char* sp, *ptr; @@ -73,49 +70,49 @@ void gcode_M100() { // probably caused by bad pointers. Any unexpected values will be flagged in // the right hand column to help spotting them. // -#if ENABLED(M100_FREE_MEMORY_DUMPER) // Disable to remove Dump sub-command - if (code_seen('D')) { - ptr = (unsigned char*) __brkval; - // - // We want to start and end the dump on a nice 16 byte boundry even though - // the values we are using are not 16 byte aligned. - // - SERIAL_ECHOPGM("\n__brkval : "); - prt_hex_word((unsigned int) ptr); - ptr = (unsigned char*)((unsigned long) ptr & 0xfff0); - sp = top_of_stack(); - SERIAL_ECHOPGM("\nStack Pointer : "); - prt_hex_word((unsigned int) sp); - SERIAL_EOL; - sp = (unsigned char*)((unsigned long) sp | 0x000f); - n = sp - ptr; - // - // This is the main loop of the Dump command. - // - while (ptr < sp) { - prt_hex_word((unsigned int) ptr); // Print the address - SERIAL_CHAR(':'); - for (i = 0; i < 16; i++) { // and 16 data bytes - prt_hex_byte(*(ptr + i)); - SERIAL_CHAR(' '); - delay(2); - } - SERIAL_CHAR('|'); // now show where non 0xE5's are - for (i = 0; i < 16; i++) { - delay(2); - if (*(ptr + i) == 0xe5) + #if ENABLED(M100_FREE_MEMORY_DUMPER) // Disable to remove Dump sub-command + if (code_seen('D')) { + ptr = (unsigned char*) __brkval; + // + // We want to start and end the dump on a nice 16 byte boundry even though + // the values we are using are not 16 byte aligned. + // + SERIAL_ECHOPGM("\n__brkval : "); + prt_hex_word((unsigned int) ptr); + ptr = (unsigned char*)((unsigned long) ptr & 0xfff0); + sp = top_of_stack(); + SERIAL_ECHOPGM("\nStack Pointer : "); + prt_hex_word((unsigned int) sp); + SERIAL_EOL; + sp = (unsigned char*)((unsigned long) sp | 0x000f); + n = sp - ptr; + // + // This is the main loop of the Dump command. + // + while (ptr < sp) { + prt_hex_word((unsigned int) ptr); // Print the address + SERIAL_CHAR(':'); + for (i = 0; i < 16; i++) { // and 16 data bytes + prt_hex_byte(*(ptr + i)); SERIAL_CHAR(' '); - else - SERIAL_CHAR('?'); + delay(2); + } + SERIAL_CHAR('|'); // now show where non 0xE5's are + for (i = 0; i < 16; i++) { + delay(2); + if (*(ptr + i) == 0xe5) + SERIAL_CHAR(' '); + else + SERIAL_CHAR('?'); + } + SERIAL_EOL; + ptr += 16; + delay(2); } - SERIAL_EOL; - ptr += 16; - delay(2); + SERIAL_ECHOLNPGM("Done."); + return; } - SERIAL_ECHOLNPGM("Done."); - return; - } -#endif + #endif // // M100 F requests the code to return the number of free bytes in the memory pool along with // other vital statistics that define the memory pool. @@ -158,28 +155,28 @@ void gcode_M100() { // M100 C x Corrupts x locations in the free memory pool and reports the locations of the corruption. // This is useful to check the correctness of the M100 D and the M100 F commands. // -#if ENABLED(M100_FREE_MEMORY_CORRUPTOR) - if (code_seen('C')) { - int x = code_value_int(); // x gets the # of locations to corrupt within the memory pool - SERIAL_ECHOLNPGM("Corrupting free memory block.\n"); - ptr = (unsigned char*) __brkval; - SERIAL_ECHOPAIR("\n__brkval : ", ptr); - ptr += 8; - sp = top_of_stack(); - SERIAL_ECHOPAIR("\nStack Pointer : ", sp); - SERIAL_ECHOLNPGM("\n"); - n = sp - ptr - 64; // -64 just to keep us from finding interrupt activity that - // has altered the stack. - j = n / (x + 1); - for (i = 1; i <= x; i++) { - *(ptr + (i * j)) = i; - SERIAL_ECHOPGM("\nCorrupting address: 0x"); - prt_hex_word((unsigned int)(ptr + (i * j))); + #if ENABLED(M100_FREE_MEMORY_CORRUPTOR) + if (code_seen('C')) { + int x = code_value_int(); // x gets the # of locations to corrupt within the memory pool + SERIAL_ECHOLNPGM("Corrupting free memory block.\n"); + ptr = (unsigned char*) __brkval; + SERIAL_ECHOPAIR("\n__brkval : ", ptr); + ptr += 8; + sp = top_of_stack(); + SERIAL_ECHOPAIR("\nStack Pointer : ", sp); + SERIAL_ECHOLNPGM("\n"); + n = sp - ptr - 64; // -64 just to keep us from finding interrupt activity that + // has altered the stack. + j = n / (x + 1); + for (i = 1; i <= x; i++) { + *(ptr + (i * j)) = i; + SERIAL_ECHOPGM("\nCorrupting address: 0x"); + prt_hex_word((unsigned int)(ptr + (i * j))); + } + SERIAL_ECHOLNPGM("\n"); + return; } - SERIAL_ECHOLNPGM("\n"); - return; - } -#endif + #endif // // M100 I Initializes the free memory pool so it can be watched and prints vital // statistics that define the free memory pool. From ee0983ab5791f6eb45c4d537a70e66cf61207e6d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 21:11:17 -0700 Subject: [PATCH 295/580] Further reduction when HOTENDS == 1 --- Marlin/Marlin_main.cpp | 19 ++++++----- Marlin/configuration_store.cpp | 16 ++++----- Marlin/dogm_lcd_implementation.h | 2 +- Marlin/temperature.cpp | 41 ++++++++++++++--------- Marlin/temperature.h | 56 ++++++++++++++++---------------- 5 files changed, 72 insertions(+), 62 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 38b69dab0..89ab4615a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4365,7 +4365,7 @@ inline void gcode_M104() { SERIAL_PROTOCOL_F(thermalManager.degTargetBed(), 1); #endif #if HOTENDS > 1 - for (int8_t e = 0; e < HOTENDS; ++e) { + HOTEND_LOOP() { SERIAL_PROTOCOLPGM(" T"); SERIAL_PROTOCOL(e); SERIAL_PROTOCOLCHAR(':'); @@ -4391,7 +4391,7 @@ inline void gcode_M104() { SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder)); #endif #if HOTENDS > 1 - for (int8_t e = 0; e < HOTENDS; ++e) { + HOTEND_LOOP() { SERIAL_PROTOCOLPGM(" @"); SERIAL_PROTOCOL(e); SERIAL_PROTOCOLCHAR(':'); @@ -4410,13 +4410,13 @@ inline void gcode_M104() { SERIAL_PROTOCOLPGM("C->"); SERIAL_PROTOCOL_F(thermalManager.rawBedTemp() / OVERSAMPLENR, 0); #endif - for (int8_t cur_hotend = 0; cur_hotend < HOTENDS; ++cur_hotend) { + HOTEND_LOOP() { SERIAL_PROTOCOLPGM(" T"); - SERIAL_PROTOCOL(cur_hotend); + SERIAL_PROTOCOL(e); SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL_F(thermalManager.degHotend(cur_hotend), 1); + SERIAL_PROTOCOL_F(thermalManager.degHotend(e), 1); SERIAL_PROTOCOLPGM("C->"); - SERIAL_PROTOCOL_F(thermalManager.rawHotendTemp(cur_hotend) / OVERSAMPLENR, 0); + SERIAL_PROTOCOL_F(thermalManager.rawHotendTemp(e) / OVERSAMPLENR, 0); } #endif } @@ -5436,7 +5436,7 @@ inline void gcode_M206() { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - for (int e = 0; e < HOTENDS; e++) { + HOTEND_LOOP() { SERIAL_CHAR(' '); SERIAL_ECHO(hotend_offset[X_AXIS][e]); SERIAL_CHAR(','); @@ -7968,8 +7968,9 @@ void prepare_move_to_destination() { float max_temp = 0.0; if (ELAPSED(millis(), next_status_led_update_ms)) { next_status_led_update_ms += 500; // Update every 0.5s - for (int8_t cur_hotend = 0; cur_hotend < HOTENDS; ++cur_hotend) - max_temp = max(max(max_temp, thermalManager.degHotend(cur_hotend)), thermalManager.degTargetHotend(cur_hotend)); + HOTEND_LOOP() { + max_temp = max(max(max_temp, thermalManager.degHotend(e)), thermalManager.degTargetHotend(e)); + } #if HAS_TEMP_BED max_temp = max(max(max_temp, thermalManager.degTargetBed()), thermalManager.degBed()); #endif diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 4420a0e1f..c14e957b2 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -618,7 +618,7 @@ void Config_ResetDefault() { #if ENABLED(PIDTEMP) #if ENABLED(PID_PARAMS_PER_HOTEND) - for (uint8_t e = 0; e < HOTENDS; e++) + HOTEND_LOOP #else int e = 0; UNUSED(e); // only need to write once #endif @@ -834,15 +834,15 @@ void Config_PrintSettings(bool forReplay) { #if ENABLED(PIDTEMP) #if HOTENDS > 1 if (forReplay) { - for (uint8_t i = 0; i < HOTENDS; i++) { + HOTEND_LOOP() { CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M301 E", i); - SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, i)); - SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, i))); - SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, i))); + SERIAL_ECHOPAIR(" M301 E", e); + SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, e)); + SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, e))); + SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, e))); #if ENABLED(PID_ADD_EXTRUSION_RATE) - SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, i)); - if (i == 0) SERIAL_ECHOPAIR(" L", lpq_len); + SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e)); + if (e == 0) SERIAL_ECHOPAIR(" L", lpq_len); #endif SERIAL_EOL; } diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index c71213a22..16c48e7be 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -392,7 +392,7 @@ static void lcd_implementation_status_screen() { #endif // Extruders - for (int i = 0; i < HOTENDS; i++) _draw_heater_status(5 + i * 25, i); + HOTEND_LOOP() _draw_heater_status(5 + e * 25, e); // Heated bed #if HOTENDS < 4 && HAS_TEMP_BED diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 2fa6074b2..f385cd212 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -436,7 +436,7 @@ Temperature::Temperature() { } void Temperature::updatePID() { #if ENABLED(PIDTEMP) - for (int e = 0; e < HOTENDS; e++) { + HOTEND_LOOP() { temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e); #if ENABLED(PID_ADD_EXTRUSION_RATE) last_position[e] = 0; @@ -465,12 +465,12 @@ int Temperature::getHeaterPower(int heater) { EXTRUDER_3_AUTO_FAN_PIN == EXTRUDER_2_AUTO_FAN_PIN ? 2 : 3 }; uint8_t fanState = 0; - for (int f = 0; f < HOTENDS; f++) { - if (current_temperature[f] > EXTRUDER_AUTO_FAN_TEMPERATURE) - SBI(fanState, fanBit[f]); + HOTEND_LOOP() { + if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE) + SBI(fanState, fanBit[e]); } uint8_t fanDone = 0; - for (int f = 0; f <= 3; f++) { + for (int8_t f = 0; f <= 3; f++) { int8_t pin = fanPin[f]; if (pin >= 0 && !TEST(fanDone, fanBit[f])) { unsigned char newFanSpeed = TEST(fanState, fanBit[f]) ? EXTRUDER_AUTO_FAN_SPEED : 0; @@ -507,10 +507,16 @@ void Temperature::_temp_error(int e, const char* serial_msg, const char* lcd_msg } void Temperature::max_temp_error(uint8_t e) { - _temp_error(e, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP)); + #if HOTENDS == 1 + UNUSED(e); + #endif + _temp_error(HOTEND_INDEX, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP)); } void Temperature::min_temp_error(uint8_t e) { - _temp_error(e, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP)); + #if HOTENDS == 1 + UNUSED(e); + #endif + _temp_error(HOTEND_INDEX, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP)); } float Temperature::get_pid_output(int e) { @@ -670,7 +676,7 @@ void Temperature::manage_heater() { #endif // Loop through all hotends - for (uint8_t e = 0; e < HOTENDS; e++) { + HOTEND_LOOP() { #if ENABLED(THERMAL_PROTECTION_HOTENDS) thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); @@ -877,7 +883,7 @@ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(HEATER_0_USES_MAX6675) current_temperature_raw[0] = read_max6675(); #endif - for (uint8_t e = 0; e < HOTENDS; e++) { + HOTEND_LOOP() { current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e); } current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw); @@ -931,7 +937,7 @@ void Temperature::init() { #endif // Finish init of mult hotend arrays - for (int e = 0; e < HOTENDS; e++) { + HOTEND_LOOP() { // populate with the first value maxttemp[e] = maxttemp[0]; #if ENABLED(PIDTEMP) @@ -1138,13 +1144,16 @@ void Temperature::init() { * their target temperature by a configurable margin. * This is called when the temperature is set. (M104, M109) */ - void Temperature::start_watching_heater(int e) { - if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { - watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE; - watch_heater_next_ms[e] = millis() + (WATCH_TEMP_PERIOD) * 1000UL; + void Temperature::start_watching_heater(uint8_t e) { + #if HOTENDS == 1 + UNUSED(e); + #endif + if (degHotend(HOTEND_INDEX) < degTargetHotend(HOTEND_INDEX) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { + watch_target_temp[HOTEND_INDEX] = degHotend(HOTEND_INDEX) + WATCH_TEMP_INCREASE; + watch_heater_next_ms[HOTEND_INDEX] = millis() + (WATCH_TEMP_PERIOD) * 1000UL; } else - watch_heater_next_ms[e] = 0; + watch_heater_next_ms[HOTEND_INDEX] = 0; } #endif @@ -1222,7 +1231,7 @@ void Temperature::init() { #endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED void Temperature::disable_all_heaters() { - for (int i = 0; i < HOTENDS; i++) setTargetHotend(0, i); + HOTEND_LOOP() setTargetHotend(0, e); setTargetBed(0); // If all heaters go down then for sure our print job has stopped diff --git a/Marlin/temperature.h b/Marlin/temperature.h index f8b190800..311fb4a39 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -39,13 +39,13 @@ #endif #if HOTENDS == 1 - #define HOTEND_ARG 0 - #define HOTEND_INDEX 0 - #define EXTRUDER_ARG 0 + #define HOTEND_LOOP() const uint8_t e = 0; + #define HOTEND_INDEX 0 + #define EXTRUDER_IDX 0 #else - #define HOTEND_ARG hotend - #define HOTEND_INDEX e - #define EXTRUDER_ARG active_extruder + #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) + #define HOTEND_INDEX e + #define EXTRUDER_IDX active_extruder #endif class Temperature { @@ -245,47 +245,47 @@ class Temperature { //inline so that there is no performance decrease. //deg=degreeCelsius - static float degHotend(uint8_t hotend) { + static float degHotend(uint8_t e) { #if HOTENDS == 1 - UNUSED(hotend); + UNUSED(e); #endif - return current_temperature[HOTEND_ARG]; + return current_temperature[HOTEND_INDEX]; } static float degBed() { return current_temperature_bed; } #if ENABLED(SHOW_TEMP_ADC_VALUES) - static float rawHotendTemp(uint8_t hotend) { + static float rawHotendTemp(uint8_t e) { #if HOTENDS == 1 - UNUSED(hotend); + UNUSED(e); #endif - return current_temperature_raw[HOTEND_ARG]; + return current_temperature_raw[HOTEND_INDEX]; } static float rawBedTemp() { return current_temperature_bed_raw; } #endif - static float degTargetHotend(uint8_t hotend) { + static float degTargetHotend(uint8_t e) { #if HOTENDS == 1 - UNUSED(hotend); + UNUSED(e); #endif - return target_temperature[HOTEND_ARG]; + return target_temperature[HOTEND_INDEX]; } static float degTargetBed() { return target_temperature_bed; } #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 - static void start_watching_heater(int e = 0); + static void start_watching_heater(uint8_t e = 0); #endif #if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0 static void start_watching_bed(); #endif - static void setTargetHotend(const float& celsius, uint8_t hotend) { + static void setTargetHotend(const float& celsius, uint8_t e) { #if HOTENDS == 1 - UNUSED(hotend); + UNUSED(e); #endif - target_temperature[HOTEND_ARG] = celsius; + target_temperature[HOTEND_INDEX] = celsius; #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 - start_watching_heater(HOTEND_ARG); + start_watching_heater(HOTEND_INDEX); #endif } @@ -296,19 +296,19 @@ class Temperature { #endif } - static bool isHeatingHotend(uint8_t hotend) { + static bool isHeatingHotend(uint8_t e) { #if HOTENDS == 1 - UNUSED(hotend); + UNUSED(e); #endif - return target_temperature[HOTEND_ARG] > current_temperature[HOTEND_ARG]; + return target_temperature[HOTEND_INDEX] > current_temperature[HOTEND_INDEX]; } static bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; } - static bool isCoolingHotend(uint8_t hotend) { + static bool isCoolingHotend(uint8_t e) { #if HOTENDS == 1 - UNUSED(hotend); + UNUSED(e); #endif - return target_temperature[HOTEND_ARG] < current_temperature[HOTEND_ARG]; + return target_temperature[HOTEND_INDEX] < current_temperature[HOTEND_INDEX]; } static bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } @@ -338,8 +338,8 @@ class Temperature { #if ENABLED(AUTOTEMP) if (planner.autotemp_enabled) { planner.autotemp_enabled = false; - if (degTargetHotend(EXTRUDER_ARG) > planner.autotemp_min) - setTargetHotend(0, EXTRUDER_ARG); + if (degTargetHotend(EXTRUDER_IDX) > planner.autotemp_min) + setTargetHotend(0, EXTRUDER_IDX); } #endif } From 182c8d7f8fcdde2a5b9a38c87a09dcd4c13e1d69 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Jul 2016 19:28:37 -0700 Subject: [PATCH 296/580] Dyze High Temp Thermistor Support --- Marlin/Configuration.h | 3 +- Marlin/Configuration_adv.h | 30 ++++++++++- .../Cartesio/Configuration.h | 3 +- .../Cartesio/Configuration_adv.h | 30 ++++++++++- .../Felix/Configuration.h | 3 +- .../Felix/Configuration_adv.h | 30 ++++++++++- .../Felix/DUAL/Configuration.h | 3 +- .../Hephestos/Configuration.h | 3 +- .../Hephestos/Configuration_adv.h | 30 ++++++++++- .../Hephestos_2/Configuration.h | 3 +- .../Hephestos_2/Configuration_adv.h | 30 ++++++++++- .../K8200/Configuration.h | 3 +- .../K8200/Configuration_adv.h | 30 ++++++++++- .../K8400/Configuration.h | 3 +- .../K8400/Configuration_adv.h | 30 ++++++++++- .../K8400/Dual Heads/Configuration.h | 3 +- .../RepRapWorld/Megatronics/Configuration.h | 3 +- .../RigidBot/Configuration.h | 3 +- .../RigidBot/Configuration_adv.h | 30 ++++++++++- .../SCARA/Configuration.h | 3 +- .../SCARA/Configuration_adv.h | 30 ++++++++++- .../TAZ4/Configuration.h | 3 +- .../TAZ4/Configuration_adv.h | 30 ++++++++++- .../WITBOX/Configuration.h | 3 +- .../WITBOX/Configuration_adv.h | 30 ++++++++++- .../adafruit/ST7565/Configuration.h | 3 +- .../delta/biv2.5/Configuration.h | 3 +- .../delta/biv2.5/Configuration_adv.h | 30 ++++++++++- .../delta/generic/Configuration.h | 3 +- .../delta/generic/Configuration_adv.h | 30 ++++++++++- .../delta/kossel_mini/Configuration.h | 3 +- .../delta/kossel_mini/Configuration_adv.h | 30 ++++++++++- .../delta/kossel_pro/Configuration.h | 3 +- .../delta/kossel_pro/Configuration_adv.h | 30 ++++++++++- .../delta/kossel_xl/Configuration.h | 3 +- .../delta/kossel_xl/Configuration_adv.h | 30 ++++++++++- .../makibox/Configuration.h | 3 +- .../makibox/Configuration_adv.h | 30 ++++++++++- .../tvrrug/Round2/Configuration.h | 3 +- .../tvrrug/Round2/Configuration_adv.h | 30 ++++++++++- Marlin/temperature.cpp | 54 +++++++++++++++++-- Marlin/temperature.h | 27 ++++++++++ Marlin/thermistornames.h | 4 ++ Marlin/thermistortables.h | 33 ++++++++++++ 44 files changed, 661 insertions(+), 63 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 947c9245e..a7e77c21c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fdeeba222..82b19dea3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 1a78e0b5d..78c2f263f 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_2 1 diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index c538b3d84..53ee0908e 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 35 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index b6d798cb4..166266b76 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index fddd7c408..77148dc88 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index ee80a1a12..888341fcf 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 0e9bf234a..9d7bff2e0 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -184,6 +184,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -200,7 +201,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index ab000aa4c..e1e6666df 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index c4bd60779..1a5887aae 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 70 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 6c5473560..e08dd26dc 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index ddf6f7d6c..d53607e97 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -188,6 +188,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -204,7 +205,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 8bc16833d..b3b7b26ae 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -147,6 +147,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -196,9 +223,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 550f9bd3e..c8c097164 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index f5056cc05..12a924d1f 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h index 8eb1c40a3..1a9b72423 100644 --- a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 5 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 3de1f0540..103814f86 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 367cfcb48..7bbed23b8 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -184,6 +184,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -200,7 +201,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 // DGlass3D = 5; RigidBot = 1; 3DSv6 = 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 6adeb2b3e..70debaca9 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index c63171354..488f43b4f 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -206,6 +206,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -222,7 +223,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 7dd0ce5bf..81b83c18c 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 7c50aa0f3..8465b6533 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 7 #define TEMP_SENSOR_1 7 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 18994554b..20e7ac19e 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -198,9 +225,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 0b9a6a80d..88c11f7b2 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -184,6 +184,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -200,7 +201,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index ab000aa4c..e1e6666df 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index c7592bc8d..782e907ac 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index aca2d8b49..3b9d7f9cf 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 5 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 525a33a27..8464cc7b0 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 38798fc9a..3305deaf1 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 01f15087c..874031add 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index fef003f0a..486338356 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 7 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 995b6a876..1f130084f 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index f8685d5f3..edb623753 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -187,6 +187,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -203,7 +204,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index ed1a7b04a..db1a8e3c8 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -146,6 +146,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -195,9 +222,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 2dc46f30c..71bd86231 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -174,6 +174,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -190,7 +191,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 92e5616ad..fc309285e 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 0b33f909b..74d8fc564 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index c95c2ec84..960d18630 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 2771c366e..32023a372 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -181,6 +181,7 @@ // 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" // 20 is the PT100 circuit found in the Ultimainboard V2.x // 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 +// 66 is 4.7M High Temperature thermistor from Dyze Design // 70 is the 100K thermistor found in the bq Hephestos 2 // // 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k @@ -197,7 +198,7 @@ // Use it for Testing or Development purposes. NEVER for production machine. //#define DUMMY_THERMISTOR_998_VALUE 25 //#define DUMMY_THERMISTOR_999_VALUE 100 -// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-3': "Thermocouple + MAX31855 (only for sensor 0)", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" } +// :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index fe78f3407..b04440245 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -141,6 +141,33 @@ //The M105 command return, besides traditional information, the ADC value read from temperature sensors. //#define SHOW_TEMP_ADC_VALUES +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + // @section extruder // extruder run-out prevention. @@ -190,9 +217,8 @@ #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed - //=========================================================================== -//=============================Mechanical Settings=========================== +//============================ Mechanical Settings ========================== //=========================================================================== // @section homing diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index f385cd212..1aff9b37e 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -161,6 +161,14 @@ int Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , int Temperature::minttemp[HOTENDS] = { 0 }; int Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383); +#ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + int Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 }; +#endif + +#ifdef MILLISECONDS_PREHEAT_TIME + unsigned long Temperature::preheat_end_time[HOTENDS] = { 0 }; +#endif + #ifdef BED_MINTEMP int Temperature::bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; #endif @@ -685,7 +693,7 @@ void Temperature::manage_heater() { float pid_output = get_pid_output(e); // Check if temperature is within the correct range - soft_pwm[e] = current_temperature[e] > minttemp[e] && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0; + soft_pwm[e] = (current_temperature[e] > minttemp[e] || is_preheating(e)) && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0; // Check if the temperature is failing to increase #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 @@ -1746,7 +1754,16 @@ void Temperature::isr() { #define GE0 >= #endif if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); - if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); + if (minttemp_raw[0] GE0 current_temperature_raw[0] && !is_preheating(0) && target_temperature[0] > 0.0f) { + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + if (++consecutive_low_temperature_error[0] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + #endif + min_temp_error(0); + } + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + else + consecutive_low_temperature_error[0] = 0; + #endif #endif #if HAS_TEMP_1 && HOTENDS > 1 @@ -1756,7 +1773,16 @@ void Temperature::isr() { #define GE1 >= #endif if (current_temperature_raw[1] GE1 maxttemp_raw[1]) max_temp_error(1); - if (minttemp_raw[1] GE1 current_temperature_raw[1]) min_temp_error(1); + if (minttemp_raw[1] GE1 current_temperature_raw[1] && !is_preheating(1) && target_temperature[1] > 0.0f) { + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + if (++consecutive_low_temperature_error[1] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + #endif + min_temp_error(1); + } + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + else + consecutive_low_temperature_error[1] = 0; + #endif #endif // TEMP_SENSOR_1 #if HAS_TEMP_2 && HOTENDS > 2 @@ -1766,7 +1792,16 @@ void Temperature::isr() { #define GE2 >= #endif if (current_temperature_raw[2] GE2 maxttemp_raw[2]) max_temp_error(2); - if (minttemp_raw[2] GE2 current_temperature_raw[2]) min_temp_error(2); + if (minttemp_raw[2] GE2 current_temperature_raw[2] && !is_preheating(2) && target_temperature[2] > 0.0f) { + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + if (++consecutive_low_temperature_error[2] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + #endif + min_temp_error(2); + } + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + else + consecutive_low_temperature_error[2] = 0; + #endif #endif // TEMP_SENSOR_2 #if HAS_TEMP_3 && HOTENDS > 3 @@ -1776,7 +1811,16 @@ void Temperature::isr() { #define GE3 >= #endif if (current_temperature_raw[3] GE3 maxttemp_raw[3]) max_temp_error(3); - if (minttemp_raw[3] GE3 current_temperature_raw[3]) min_temp_error(3); + if (minttemp_raw[3] GE3 current_temperature_raw[3] && !is_preheating(3) && target_temperature[3] > 0.0f) { + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + if (++consecutive_low_temperature_error[3] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + #endif + min_temp_error(3); + } + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + else + consecutive_low_temperature_error[3] = 0; + #endif #endif // TEMP_SENSOR_3 #if HAS_TEMP_BED diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 311fb4a39..dbb434362 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -183,6 +183,14 @@ class Temperature { static int minttemp[HOTENDS]; static int maxttemp[HOTENDS]; + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + static int consecutive_low_temperature_error[HOTENDS]; + #endif + + #ifdef MILLISECONDS_PREHEAT_TIME + static unsigned long preheat_end_time[HOTENDS]; + #endif + #ifdef BED_MINTEMP static int bed_minttemp_raw; #endif @@ -235,6 +243,19 @@ class Temperature { */ static void manage_heater(); + /** + * Preheating hotends + */ + #ifdef MILLISECONDS_PREHEAT_TIME + static bool is_preheating(uint8_t hotend) { + return preheat_end_time[hotend] && PENDING(millis(), preheat_end_time[hotend]); + } + static void start_preheat_time(uint8_t hotend) { preheat_end_time[hotend] = millis() + MILLISECONDS_PREHEAT_TIME; } + static void reset_preheat_time(uint8_t hotend) { preheat_end_time[hotend] = 0; } + #else + #define is_preheating(n) (false) + #endif + #if ENABLED(FILAMENT_WIDTH_SENSOR) static float analog2widthFil(); // Convert raw Filament Width to millimeters static int widthFil_to_size_ratio(); // Convert raw Filament Width to an extrusion ratio @@ -283,6 +304,12 @@ class Temperature { #if HOTENDS == 1 UNUSED(e); #endif + #ifdef MILLISECONDS_PREHEAT_TIME + if (celsius == 0.0f) + reset_preheat_time(hotend); + else if (target_temperature[hotend] == 0.0f) + start_preheat_time(hotend); + #endif target_temperature[HOTEND_INDEX] = celsius; #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 start_watching_heater(HOTEND_INDEX); diff --git a/Marlin/thermistornames.h b/Marlin/thermistornames.h index 4ad13f86b..64829ce74 100644 --- a/Marlin/thermistornames.h +++ b/Marlin/thermistornames.h @@ -82,6 +82,10 @@ #elif THERMISTOR_ID == 110 #define THERMISTOR_NAME "PT100 1K" +// High Temperature thermistors +#elif THERMISTOR_ID == 66 + #define THERMISTOR_NAME "Dyze 4.7M" + // Dummies for dev testing #elif THERMISTOR_ID == 998 #define THERMISTOR_NAME "Dummy 1" diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index a0268e435..7980b7207 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -982,6 +982,39 @@ const short temptable_60[][2] PROGMEM = { }; #endif +#if ANY_THERMISTOR_IS(66) +// DyzeDesign 500°C Thermistor +const short temptable_66[][2] PROGMEM = { + { 17.5 * OVERSAMPLENR, 850 }, + { 17.9 * OVERSAMPLENR, 500 }, + { 21.7 * OVERSAMPLENR, 480 }, + { 26.6 * OVERSAMPLENR, 460 }, + { 33.1 * OVERSAMPLENR, 440 }, + { 41.0 * OVERSAMPLENR, 420 }, + { 52.3 * OVERSAMPLENR, 400 }, + { 67.7 * OVERSAMPLENR, 380 }, + { 86.5 * OVERSAMPLENR, 360 }, + { 112.0 * OVERSAMPLENR, 340 }, + { 147.2 * OVERSAMPLENR, 320 }, + { 194.0 * OVERSAMPLENR, 300 }, + { 254.3 * OVERSAMPLENR, 280 }, + { 330.2 * OVERSAMPLENR, 260 }, + { 427.9 * OVERSAMPLENR, 240 }, + { 533.4 * OVERSAMPLENR, 220 }, + { 646.5 * OVERSAMPLENR, 200 }, + { 754.4 * OVERSAMPLENR, 180 }, + { 844.3 * OVERSAMPLENR, 160 }, + { 911.7 * OVERSAMPLENR, 140 }, + { 958.6 * OVERSAMPLENR, 120 }, + { 988.8 * OVERSAMPLENR, 100 }, + { 1006.6 * OVERSAMPLENR, 80 }, + { 1015.8 * OVERSAMPLENR, 60 }, + { 1021.3 * OVERSAMPLENR, 30 }, + { 1023 * OVERSAMPLENR - 1, 25}, + { 1023 * OVERSAMPLENR, 20} +}; +#endif + #if ANY_THERMISTOR_IS(12) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) const short temptable_12[][2] PROGMEM = { From e92e58df1fd72feda692ef1a4ec5cd4e310f6ac9 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 10 Jul 2016 11:42:49 +0200 Subject: [PATCH 297/580] Adjust wait_for_cooling slope Adjust wait_for_cooling slope and drop mintemp for cooling. See https://github.com/MarlinFirmware/Marlin/pull/4169#issuecomment-231544532 --- Marlin/Marlin_main.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 89ab4615a..31545ab47 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4488,6 +4488,13 @@ inline void gcode_M105() { #endif + #ifndef MIN_COOLING_SLOPE_DEG + #define MIN_COOLING_SLOPE_DEG 1.50 + #endif + #ifndef MIN_COOLING_SLOPE_TIME + #define MIN_COOLING_SLOPE_TIME 60 + #endif + /** * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. * Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling. @@ -4600,11 +4607,11 @@ inline void gcode_M109() { // Prevent a wait-forever situation if R is misused i.e. M109 R0 if (wants_to_cool) { - if (temp < (EXTRUDE_MINTEMP) / 2) break; // always break at (default) 85° - // break after 20 seconds if cooling stalls + // break after MIN_COOLING_SLOPE_TIME seconds + // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < 1.0) break; - next_cool_check_ms = now + 20000; + if (old_temp - temp < MIN_COOLING_SLOPE_DEG) break; + next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME; old_temp = temp; } } @@ -4617,6 +4624,13 @@ inline void gcode_M109() { #if HAS_TEMP_BED + #ifndef MIN_COOLING_SLOPE_DEG_BED + #define MIN_COOLING_SLOPE_DEG_BED 1.50 + #endif + #ifndef MIN_COOLING_SLOPE_TIME_BED + #define MIN_COOLING_SLOPE_TIME_BED 60 + #endif + /** * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling @@ -4709,11 +4723,11 @@ inline void gcode_M109() { // Prevent a wait-forever situation if R is misused i.e. M190 R0 if (wants_to_cool) { - if (temp < 30.0) break; // always break at 30° - // break after 20 seconds if cooling stalls + // break after MIN_COOLING_SLOPE_TIME_BED seconds + // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { - if (old_temp - temp < 1.0) break; - next_cool_check_ms = now + 20000; + if (old_temp - temp < MIN_COOLING_SLOPE_DEG_BED) break; + next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_BED; old_temp = temp; } } From 928ff6487ad88dc05c3039b53a30e7f6a15f609a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Jul 2016 18:59:04 -0700 Subject: [PATCH 298/580] Greek language pack from @psavva --- Marlin/Configuration.h | 6 +- Marlin/dogm_font_data_ISO10646_Greek.h | 206 +++++++++++++++ Marlin/dogm_lcd_implementation.h | 3 + .../Cartesio/Configuration.h | 6 +- .../Felix/Configuration.h | 6 +- .../Felix/DUAL/Configuration.h | 6 +- .../Hephestos/Configuration.h | 6 +- .../Hephestos_2/Configuration.h | 6 +- .../K8200/Configuration.h | 6 +- .../RepRapWorld/Megatronics/Configuration.h | 6 +- .../RigidBot/Configuration.h | 6 +- .../SCARA/Configuration.h | 6 +- .../TAZ4/Configuration.h | 6 +- .../WITBOX/Configuration.h | 6 +- .../adafruit/ST7565/Configuration.h | 6 +- .../delta/biv2.5/Configuration.h | 6 +- .../delta/generic/Configuration.h | 6 +- .../delta/kossel_mini/Configuration.h | 6 +- .../delta/kossel_pro/Configuration.h | 6 +- .../delta/kossel_xl/Configuration.h | 6 +- .../makibox/Configuration.h | 6 +- .../tvrrug/Round2/Configuration.h | 6 +- Marlin/fonts/ISO10646-4_Greek.fon | Bin 0 -> 4224 bytes Marlin/fonts/make_fonts.bat | 1 + Marlin/language.h | 2 + Marlin/language_el-gr.h | 200 ++++++++++++++ Marlin/language_el.h | 247 ++++++++++++++++++ Marlin/language_en.h | 9 +- Marlin/language_test.h | 1 + Marlin/utf_mapper.h | 72 ++++- 30 files changed, 792 insertions(+), 69 deletions(-) create mode 100644 Marlin/dogm_font_data_ISO10646_Greek.h create mode 100644 Marlin/fonts/ISO10646-4_Greek.fon create mode 100644 Marlin/language_el-gr.h create mode 100644 Marlin/language_el.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a7e77c21c..41f3f129e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -827,10 +827,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/dogm_font_data_ISO10646_Greek.h b/Marlin/dogm_font_data_ISO10646_Greek.h new file mode 100644 index 000000000..0abb08d9d --- /dev/null +++ b/Marlin/dogm_font_data_ISO10646_Greek.h @@ -0,0 +1,206 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/* + Fontname: ISO10646_4_Greek + Copyright: A. Hardtung, public domain + Capital A Height: 7, '1' Height: 7 + Calculated Max Values w= 5 h=10 x= 2 y= 6 dx= 6 dy= 0 ascent= 8 len=10 + Font Bounding box w= 6 h= 9 x= 0 y=-2 + Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 + Pure Font ascent = 7 descent=-1 + X Font ascent = 7 descent=-1 + Max Font ascent = 8 descent=-2 +*/ +#include +const u8g_fntpgm_uint8_t ISO10646_Greek_5x7[2728] U8G_SECTION(".progmem.ISO10646_Greek_5x7") = { + 0,6,9,0,254,7,1,145,3,32,32,255,255,8,254,7, + 255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128, + 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, + 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, + 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, + 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, + 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, + 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, + 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, + 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, + 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, + 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, + 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64, + 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, + 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, + 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, + 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, + 48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16, + 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, + 112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5, + 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, + 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, + 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1, + 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, + 8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168, + 112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7, + 7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0, + 0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144, + 136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128, + 128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5, + 7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6, + 0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128, + 128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16, + 16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136, + 5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7, + 6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0, + 136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136, + 136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128, + 128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7, + 7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0, + 0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32, + 32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136, + 136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5, + 7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6, + 0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136, + 136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32, + 64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224, + 5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,1, + 0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,80, + 136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,64, + 5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,0, + 0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,128, + 128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,120, + 5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,0, + 0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,136, + 136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,136, + 136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,8, + 8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,6, + 0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,192, + 64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,168, + 168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,6, + 0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,136, + 240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,5, + 5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,0, + 112,128,112,8,240,5,7,7,6,0,0,64,64,224,64,64, + 72,48,5,5,5,6,0,0,136,136,136,152,104,5,5,5, + 6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,136, + 168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,6, + 6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,0, + 248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,64, + 64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,3, + 7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,6, + 0,3,104,144,0,0,0,6,0,0,0,0,0,6,0,0, + 0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6, + 0,0,2,2,2,6,1,6,64,128,3,3,3,6,1,5, + 32,64,160,5,8,8,6,0,0,64,160,80,80,136,248,136, + 136,2,2,2,6,1,2,192,192,5,8,8,6,0,0,64, + 128,248,128,240,128,128,248,5,8,8,6,0,0,64,128,136, + 136,248,136,136,136,4,8,8,6,0,0,64,128,112,32,32, + 32,32,112,0,0,0,6,0,0,5,8,8,6,0,0,64, + 128,112,136,136,136,136,112,0,0,0,6,0,0,5,8,8, + 6,0,0,64,128,8,136,112,32,32,32,5,8,8,6,0, + 0,64,128,112,136,136,136,80,216,3,8,8,6,1,0,32, + 64,160,0,64,64,64,32,5,7,7,6,0,0,32,80,136, + 136,248,136,136,5,7,7,6,0,0,240,72,72,112,72,72, + 240,5,7,7,6,0,0,248,128,128,128,128,128,128,5,6, + 6,6,0,0,32,80,80,136,136,248,5,7,7,6,0,0, + 248,128,128,240,128,128,248,5,7,7,6,0,0,248,8,16, + 32,64,128,248,5,7,7,6,0,0,136,136,136,248,136,136, + 136,5,7,7,6,0,0,112,136,136,168,136,136,112,3,7, + 7,6,1,0,224,64,64,64,64,64,224,5,7,7,6,0, + 0,136,144,160,192,160,144,136,5,7,7,6,0,0,32,80, + 136,136,136,136,136,5,7,7,6,0,0,136,216,168,168,136, + 136,136,5,7,7,6,0,0,136,200,200,168,152,152,136,5, + 7,7,6,0,0,248,0,0,112,0,0,248,5,7,7,6, + 0,0,112,136,136,136,136,136,112,5,7,7,6,0,0,248, + 80,80,80,80,80,80,5,7,7,6,0,0,240,136,136,240, + 128,128,128,0,0,0,6,0,0,5,7,7,6,0,0,248, + 128,64,32,64,128,248,5,7,7,6,0,0,248,32,32,32, + 32,32,32,5,7,7,6,0,0,136,136,80,32,32,32,32, + 5,7,7,6,0,0,112,32,112,168,112,32,112,5,7,7, + 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, + 168,168,168,168,112,32,32,5,6,6,6,0,0,112,136,136, + 80,80,216,3,8,8,6,1,0,160,0,224,64,64,64,64, + 224,5,8,8,6,0,0,80,0,136,136,136,80,32,32,5, + 8,8,6,0,0,32,64,8,104,152,144,144,104,5,8,8, + 6,0,0,32,64,0,112,136,224,136,112,5,10,10,6,0, + 254,32,64,0,112,136,136,136,136,8,8,2,8,8,6,1, + 0,64,128,0,128,128,128,128,64,5,8,8,6,0,0,16, + 32,80,0,136,136,136,112,5,6,6,6,0,0,8,104,152, + 144,144,104,4,7,7,6,0,254,96,144,240,144,224,128,128, + 5,6,6,6,0,255,136,72,80,32,32,64,5,6,6,6, + 0,0,48,64,112,136,136,112,5,5,5,6,0,0,112,136, + 224,136,112,5,9,9,6,0,254,128,112,64,128,128,128,112, + 8,112,5,7,7,6,0,254,184,200,136,136,136,8,8,5, + 5,5,6,0,0,112,136,248,136,112,3,5,5,6,1,0, + 128,128,128,128,96,4,5,5,6,0,0,144,160,192,160,144, + 5,6,6,6,0,0,64,32,32,80,80,136,5,7,7,6, + 0,254,136,136,136,216,168,128,128,5,5,5,6,0,0,136, + 136,80,96,32,5,10,10,6,0,254,128,224,128,112,32,64, + 128,112,8,112,5,5,5,6,0,0,112,136,136,136,112,5, + 5,5,6,0,0,248,80,80,80,80,5,7,7,6,0,254, + 112,136,136,200,176,128,128,5,7,7,6,0,254,48,64,128, + 64,48,8,112,5,5,5,6,0,0,104,144,144,144,96,4, + 5,5,6,0,0,240,64,64,64,48,5,5,5,6,0,0, + 136,136,144,144,224,5,8,8,6,0,254,48,168,168,168,168, + 112,32,32,5,6,6,6,0,255,136,80,32,32,80,136,5, + 7,7,6,0,254,168,168,168,168,112,32,32,5,5,5,6, + 0,0,80,136,136,168,112,4,7,7,6,0,0,160,0,64, + 64,64,64,48,5,7,7,6,0,0,80,0,136,136,144,144, + 224,4,8,8,6,0,0,32,64,0,96,144,144,144,96,5, + 8,8,6,0,0,32,64,0,136,136,144,144,96,5,8,8, + 6,0,0,32,64,0,80,136,136,168,112,5,7,7,6,0, + 255,144,160,192,160,144,136,16,5,8,8,6,0,0,96,144, + 160,128,240,136,136,112,5,7,7,6,0,0,112,80,56,144, + 144,144,96,5,6,6,6,0,0,152,80,32,32,32,32,5, + 8,8,6,0,0,64,128,152,80,32,32,32,32,5,8,8, + 6,0,0,80,0,152,80,32,32,32,32,5,7,7,6,0, + 255,48,168,168,168,168,112,32,5,5,5,6,0,0,248,80, + 80,80,88,5,6,6,6,0,255,136,80,112,80,136,16,5, + 7,7,6,0,255,112,136,136,136,112,32,112,5,6,6,6, + 0,255,112,136,136,112,32,112,5,6,6,6,0,0,112,136, + 128,112,32,112,5,7,7,6,0,254,8,112,128,128,112,16, + 96,5,6,6,6,0,0,248,128,128,240,128,128,4,5,5, + 6,0,0,240,128,224,128,128,5,6,6,6,0,0,248,0, + 0,112,0,248,4,5,5,6,0,0,64,128,240,16,32,5, + 7,7,6,0,0,224,80,40,40,8,8,16,5,7,7,6, + 0,0,192,32,80,40,8,8,8,5,8,8,6,0,254,168, + 168,168,168,168,88,8,112,5,7,7,6,0,254,168,168,168, + 168,88,8,112,5,6,6,6,0,0,104,136,136,120,8,8, + 5,6,6,6,0,255,104,136,136,120,8,8,4,8,8,6, + 0,254,128,224,144,144,144,144,32,192,5,5,5,6,0,0, + 104,144,112,16,224,5,6,6,6,0,0,96,144,16,96,136, + 112,4,6,6,6,0,0,96,144,16,96,128,112,5,6,6, + 6,0,0,136,80,32,80,136,248,5,5,5,6,0,0,136, + 80,32,80,112,5,6,6,6,0,0,120,128,240,136,136,112, + 4,5,5,6,0,0,240,128,224,144,96,3,6,6,6,1, + 0,64,224,64,64,64,64,3,6,6,6,1,255,64,224,64, + 64,64,128,5,5,5,6,0,0,136,80,112,80,136,5,7, + 7,6,0,254,112,136,136,136,240,128,112,4,5,5,6,0, + 0,112,128,128,128,112,2,8,8,6,1,255,64,0,192,64, + 64,64,64,128,5,7,7,6,0,0,112,136,136,248,136,136, + 112,4,5,5,6,0,0,112,128,224,128,112,4,5,5,6, + 0,0,224,16,112,16,224,5,7,7,6,0,0,128,240,136, + 136,136,240,128,4,7,7,6,0,255,128,224,144,144,144,224, + 128,5,6,6,6,0,0,112,136,128,128,136,112,5,6,6, + 6,0,0,136,216,168,136,136,136,5,7,7,6,0,254,136, + 216,168,136,136,128,128,5,8,8,6,0,254,112,136,136,136, + 112,64,224,64,5,6,6,6,0,0,112,136,8,8,136,112, + 5,6,6,6,0,0,112,136,160,128,136,112,5,6,6,6, + 0,0,112,136,40,8,136,112}; diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 16c48e7be..e5c565e81 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -85,6 +85,9 @@ #elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA) #include "dogm_font_data_ISO10646_Kana.h" #define FONT_MENU_NAME ISO10646_Kana_5x7 + #elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK) + #include "dogm_font_data_ISO10646_Greek.h" + #define FONT_MENU_NAME ISO10646_Greek_5x7 #elif ENABLED(DISPLAY_CHARSET_ISO10646_CN) #include "dogm_font_data_ISO10646_CN.h" #define FONT_MENU_NAME ISO10646_CN diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 78c2f263f..3545e5994 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -826,10 +826,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 166266b76..737aad19b 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -810,10 +810,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 888341fcf..f2b35df5c 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -808,10 +808,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 9d7bff2e0..a8dc026f5 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -819,10 +819,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 1a5887aae..05e6de775 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -821,10 +821,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index d53607e97..0e2a4d2c8 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -844,10 +844,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 103814f86..6b073db8f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -827,10 +827,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 7bbed23b8..d097b0a20 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -825,10 +825,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 488f43b4f..297b31139 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -835,10 +835,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 8465b6533..6db6caf30 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -848,10 +848,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 88c11f7b2..c71f965b1 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -819,10 +819,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 782e907ac..ff9bbf244 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -827,10 +827,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 3b9d7f9cf..01d21032c 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -922,10 +922,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 3305deaf1..ad48fedc9 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -916,10 +916,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 486338356..d7fa60cbb 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -919,10 +919,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index edb623753..f3753c754 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -919,10 +919,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 71bd86231..7c4653552 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -921,10 +921,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 74d8fc564..ac4d1d888 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -830,10 +830,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 32023a372..1d137d3b7 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -821,10 +821,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // //#define LCD_LANGUAGE en diff --git a/Marlin/fonts/ISO10646-4_Greek.fon b/Marlin/fonts/ISO10646-4_Greek.fon new file mode 100644 index 0000000000000000000000000000000000000000..021078e00b77fa94cfcc0acc5f1d0f3018af15f0 GIT binary patch literal 4224 zcmchYe~2B`702&t+)UCKrbQ%3+Fm8dVwdg2h9wOmQ;GH|F%B`|WjQ-qp(!d)~Wxe{b%D z&-?Qa^bbDd`$v9ra;|^mgui|6{{H-l`J)T|S98Y?&;Rzs%;g)mHLmyGeAx{p88{dH z{@d|>s!US1;7a{ASfXTlNz{zIbe&sYpmtZd4KCX>O-Iz|e(3(;lC2X(7`^_MJNEA1 zee1sX);sUmp3Lr;y>G{Tzw945@@wn}8GpH}ks4?f*NMk1eO~UzEVN#Yty_Cfx{r3D-@UW;5IZuYuEW7N+nv zxF6mNd$125fsexqJ_BEXFT-W{7JL`J4~Otm_yznLM(ZuNAHc2fTA09Ha5vlw55Pn4 z7(4|F_yl|!J_l>~3VZ{;4bQ+2;79N?IEJ?8C*3A^CG_w*xC7n@J8&Po2Ofnvd>B3k zpM;C>dH5214X(g<;92+~`~-duzk-t+EVme51-HQ&xD(z4_rSYg7d{9V;G?jFPr+y5 zi|{mj9sU{q1)hU{hyR5ChT#Bh|B5Act03H}Mb z3g3jQ@UQT1@MAcFU&3|YWBhhL6D~;UatkHQi@1)mkalwMldKxYvFVCY6k(C1#i&FY%b%Khb18yOk3kf7 zr6XvFYvIYt;)i+2qkh)(Zh1*k21?yaGO<^Otjcj&mQpFG{n1$z1sM!0^;JXZ#ziq| zvPUYyxaE+QMm1h6VKw#cR3YQ4E2*rOR+cJ@A-`&tS9z|Mk?G2EwO&Nh+|(>9OGE=D znJ%oB>4KL*QRJb1T9zgnrr087UbaYehLriNiB@JIKdWv^F1Z#zO)ajo>P05xmVInG z8Jc3PS@vv|Mw3T_av-@VPOpag$-1du6!kPU>$RDT3-gzBh8E6LHoHM2Ww5n4TAyY{ zv9kAUO*-c+ZphK96?&~&6wnPUMij<{np%E2`!7wEODDmLOc#5t zME$ISHT9EZ1#ElCnSGpEHMC1pPf19R)i;IISoA6$|2rCc8OAyIp%~ z8Jpdi7VS<9(J zwUeTkrj50W!_L0=d}LM*jmUjo>tB*4YoR6CR#Ik?EJ$WG$TUz*<1#x)ves-wH9*Stwz<5x|JRIOQlLu#j{*2F#cSTrz&n9nRa;< z&-9L)aTX&n1J|AkmwHvedB+6Y=&{3%%Dg$iOJ-Rfy9bn~VO<9b!a z&87OTMbkydP3V#f)v~gLz!!9x*4lDka&4wo3~V*!ZtyJ0bY1G#T7(Iev3;W2Z$O^y zY;##uFk6MRXr;`xk}4T8uqoNx4w#@*n`iRJs%n>8TDHJJ%1c!Sm9sBXZeNvf&D$_H zQsoL0*nqbGEc8fU5a)*3)KnCi;}xGtiX^d#>I2lzazW~?T|RD2EQXp<. + * + */ + +/** + * Greek (Greece) + * + * LCD Menu Messages + * See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language + * + */ +#ifndef LANGUAGE_EL_GR_H +#define LANGUAGE_EL_GR_H + +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT + +//#define MAPPER_CECF +//#define DISPLAY_CHARSET_ISO10646_GREEK + +#define WELCOME_MSG MACHINE_NAME " έτοιμο." +#define MSG_SD_INSERTED "Εισαγωγή κάρτας" +#define MSG_SD_REMOVED "Αφαίρεση κάρτας" +#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters +#define MSG_MAIN "Βασική Οθόνη" +#define MSG_AUTOSTART "Αυτόματη εκκίνηση" +#define MSG_DISABLE_STEPPERS "Απενεργοποίηση βηματιστή" +#define MSG_AUTO_HOME "Αυτομ. επαναφορά στο αρχικό σημείο" +#define MSG_AUTO_HOME_X "Αρχικό σημείο X" +#define MSG_AUTO_HOME_Y "Αρχικό σημείο Y" +#define MSG_AUTO_HOME_Z "Αρχικό σημείο Z" +#define MSG_LEVEL_BED_HOMING "Επαναφορά στο αρχικό σημείο ΧΥΖ" +#define MSG_LEVEL_BED_WAITING "Κάντε κλικ για να ξεκινήσετε" +#define MSG_LEVEL_BED_NEXT_POINT "Επόμενο σημείο" +#define MSG_LEVEL_BED_DONE "Ολοκλήρωση επιπεδοποίησης!" +#define MSG_LEVEL_BED_CANCEL "Ακύρωση" +#define MSG_SET_HOME_OFFSETS "Ορισμός βασικών μετατοπίσεων" +#define MSG_HOME_OFFSETS_APPLIED "Εφαρμόστηκαν οι μετατοπίσεις" +#define MSG_SET_ORIGIN "Ορισμός προέλευσης" +#define MSG_PREHEAT_PLA "Προθέρμανση PLA" +#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " +#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " όλα" +#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " κλίνη" +#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " επιβεβαίωση" +#define MSG_PREHEAT_ABS "Προθέρμανση ABS" +#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " +#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " όλα" +#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Bed" +#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " επιβεβαίωση" +#define MSG_H1 "1" +#define MSG_H2 "2" +#define MSG_H3 "3" +#define MSG_H4 "4" +#define MSG_COOLDOWN "Μειωση θερμοκρασιας" +#define MSG_SWITCH_PS_ON "Ενεργοποίηση" +#define MSG_SWITCH_PS_OFF "Απενεργοποίηση" +#define MSG_EXTRUDE "Εξώθηση" +#define MSG_RETRACT "Ανάσυρση" +#define MSG_MOVE_AXIS "Μετακίνηση άξονα" +#define MSG_LEVEL_BED "Επιπεδοποίηση κλίνης" +#define MSG_MOVE_X "Μετακίνηση X" +#define MSG_MOVE_Y "Μετακίνηση Y" +#define MSG_MOVE_Z "Μετακίνηση Z" +#define MSG_MOVE_E "Εξωθητήρας" +#define MSG_MOVE_E1 "1" +#define MSG_MOVE_E2 "2" +#define MSG_MOVE_E3 "3" +#define MSG_MOVE_E4 "4" +#define MSG_MOVE_01MM "Μετακίνηση 0,1 μμ" +#define MSG_MOVE_1MM "Μετακίνηση 1 μμ" +#define MSG_MOVE_10MM "Μετακίνηση 10 μμ" +#define MSG_SPEED "Ταχύτητα" +#define MSG_BED_Z "Κλίνη Z" +#define MSG_NOZZLE "Ακροφύσιο" +#define MSG_N1 " 1" +#define MSG_N2 " 2" +#define MSG_N3 " 3" +#define MSG_N4 " 4" +#define MSG_BED "Κλίνη" +#define MSG_FAN_SPEED "Ταχύτητα ανεμιστήρα" +#define MSG_FLOW "Ροή" +#define MSG_CONTROL "Έλεγχος" +#define MSG_MIN " " LCD_STR_THERMOMETER " Min" +#define MSG_MAX " " LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR " " LCD_STR_THERMOMETER " Fact" +#define MSG_AUTOTEMP "Αυτομ. ρύθμιση θερμοκρασίας" +#define MSG_ON "Ενεργοποιημένο" +#define MSG_OFF "Απενεργοποιημένο" +#define MSG_PID_P "PID-P" +#define MSG_PID_I "PID-I" +#define MSG_PID_D "PID-D" +#define MSG_PID_C "PID-C" +#define MSG_E1 " E1" +#define MSG_E2 " E2" +#define MSG_E3 " E3" +#define MSG_E4 " E4" +#define MSG_ACC "Επιτάχυνση" +#define MSG_VXY_JERK "Vαντίδραση xy" +#define MSG_VZ_JERK "Vαντίδραση z" +#define MSG_VE_JERK "Vαντίδραση e" +#define MSG_VMAX "Vμεγ " +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" +#define MSG_VMIN "Vελαχ" +#define MSG_VTRAV_MIN "Vελάχ. μετατόπιση" +#define MSG_AMAX "Aμεγ " +#define MSG_A_RETRACT "Α-ανάσυρση" +#define MSG_A_TRAVEL "Α-μετατόπιση" +#define MSG_XSTEPS "Bήματα X ανά μμ" +#define MSG_YSTEPS "Bήματα Υ ανά μμ" +#define MSG_ZSTEPS "Bήματα Ζ ανά μμ" +#define MSG_ESTEPS "Bήματα Ε ανά μμ" +#define MSG_TEMPERATURE "Θερμοκρασία" +#define MSG_MOTION "Κίνηση" +#define MSG_VOLUMETRIC "Νήμα" +#define MSG_VOLUMETRIC_ENABLED "Ε σε μμ3" +#define MSG_FILAMENT_DIAM "Διάμετρος νήματος" +#define MSG_DIAM_E1 " 1" +#define MSG_DIAM_E2 " 2" +#define MSG_DIAM_E3 " 3" +#define MSG_DIAM_E4 " 4" +#define MSG_CONTRAST "Κοντράστ LCD" +#define MSG_STORE_EPROM "Αποθήκευση" +#define MSG_LOAD_EPROM "Φόρτωση" +#define MSG_RESTORE_FAILSAFE "Επαναφορά ασφαλούς αντιγράφου" +#define MSG_REFRESH "Ανανέωση" +#define MSG_WATCH "Οθόνη πληροφόρησης" +#define MSG_PREPARE "Προετοιμασία" +#define MSG_TUNE "Συντονισμός" +#define MSG_PAUSE_PRINT "Παύση εκτύπωσης" +#define MSG_RESUME_PRINT "Συνέχιση εκτύπωσης" +#define MSG_STOP_PRINT "Διακοπή εκτύπωσης" +#define MSG_CARD_MENU "Εκτύπωση από SD" +#define MSG_NO_CARD "Δεν βρέθηκε SD" +#define MSG_DWELL "Αναστολή λειτουργίας..." +#define MSG_USERWAIT "Αναμονή για χρήστη…" +#define MSG_RESUMING "Συνεχίζεται η εκτύπωση" +#define MSG_PRINT_ABORTED "Διακόπτεται η εκτύπωση" +#define MSG_NO_MOVE "Καμία κίνηση." +#define MSG_KILLED "ΤΕΡΜΑΤΙΣΜΟΣ. " +#define MSG_STOPPED "ΔΙΑΚΟΠΗ. " +#define MSG_CONTROL_RETRACT "Ανάσυρση μμ" +#define MSG_CONTROL_RETRACT_SWAP "Εναλλαγή ανάσυρσης μμ" +#define MSG_CONTROL_RETRACTF "Ανάσυρση V" +#define MSG_CONTROL_RETRACT_ZLIFT "Μεταπήδηση μμ" +#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" +#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm" +#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" +#define MSG_AUTORETRACT "Αυτόματη ανάσυρση" +#define MSG_FILAMENTCHANGE "Αλλαγή νήματος" +#define MSG_INIT_SDCARD "Προετοιμασία κάρτας SD" +#define MSG_CNG_SDCARD "Αλλαγή κάρτας SD" +#define MSG_ZPROBE_OUT "Διερεύνηση Z εκτός κλίνης" +#define MSG_YX_UNHOMED "Επαναφορά Χ/Υ πριν από Ζ" +#define MSG_XYZ_UNHOMED "Επαναφορά ΧΥΖ πρώτα" +#define MSG_ZPROBE_ZOFFSET "Μετατόπιση Ζ" +#define MSG_BABYSTEP_X "Μικρό βήμα Χ" +#define MSG_BABYSTEP_Y "Μικρό βήμα Υ" +#define MSG_BABYSTEP_Z "Μικρό βήμα Ζ" +#define MSG_ENDSTOP_ABORT "Ματαίωση endstop " +#define MSG_HEATING_FAILED_LCD "Ανεπιτυχής θέρμανση" +#define MSG_ERR_REDUNDANT_TEMP "Λάθος: ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ" +#define MSG_THERMAL_RUNAWAY "ΔΙΑΦΥΓΗ ΘΕΡΜΟΤΗΤΑΣ" +#define MSG_ERR_MAXTEMP "Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ" +#define MSG_ERR_MINTEMP "Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ" +#define MSG_ERR_MAXTEMP_BED "Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ" +#define MSG_ERR_MINTEMP_BED "Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ" +#define MSG_END_HOUR "ώρες" +#define MSG_END_MINUTE "λεπτά" +#define MSG_HEATING "Θερμαίνεται…" +#define MSG_HEATING_COMPLETE "Η θέρμανση ολοκληρώθηκε." +#define MSG_BED_HEATING "Θέρμανση κλίνης." +#define MSG_BED_DONE "Η κλίνη ολοκληρώθηκε." +#define MSG_DELTA_CALIBRATE "Βαθμονόμηση Delta" +#define MSG_DELTA_CALIBRATE_X "Βαθμονόμηση X" +#define MSG_DELTA_CALIBRATE_Y "Βαθμονόμηση Y" +#define MSG_DELTA_CALIBRATE_Z "Βαθμονόμηση Z" +#define MSG_DELTA_CALIBRATE_CENTER "Βαθμονόμηση κέντρου" + +#endif // LANGUAGE_EL_GR_H diff --git a/Marlin/language_el.h b/Marlin/language_el.h new file mode 100644 index 000000000..d1fec26b7 --- /dev/null +++ b/Marlin/language_el.h @@ -0,0 +1,247 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Greek + * + * LCD Menu Messages + * See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language + * + */ +#ifndef LANGUAGE_EL_H +#define LANGUAGE_EL_H + +// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h +//#define SIMULATE_ROMFONT + +#define MAPPER_CECF +#define DISPLAY_CHARSET_ISO10646_GREEK + +#define WELCOME_MSG MACHINE_NAME " έτοιμο." +#define MSG_SD_INSERTED "Εισαγωγή κάρτας" +#define MSG_SD_REMOVED "Αφαίρεση κάρτας" +#define MSG_LCD_ENDSTOPS "Endstops" // Max length 8 characters +#define MSG_MAIN "Βασική Οθόνη" +#define MSG_AUTOSTART "Αυτόματη εκκίνηση" +#define MSG_DISABLE_STEPPERS "Απενεργοποίηση Μοτέρ" +#define MSG_AUTO_HOME "Αυτομ. επαναφορά στο αρχικό σημείο" //SHORTEN +#define MSG_AUTO_HOME_X "Αρχικό σημείο X" +#define MSG_AUTO_HOME_Y "Αρχικό σημείο Y" +#define MSG_AUTO_HOME_Z "Αρχικό σημείο Z" +#define MSG_LEVEL_BED_HOMING "Επαναφορά Επ. Εκτύπωσης" //SHORTEN +#define MSG_LEVEL_BED_WAITING "Επιπεδοποίηση επ. Εκτύπωσης περιμενει" //SHORTEN +#define MSG_LEVEL_BED_NEXT_POINT "Επόμενο σημείο" +#define MSG_LEVEL_BED_DONE "Ολοκλήρωση επιπεδοποίησης!" //SHORTEN +#define MSG_LEVEL_BED_CANCEL "Ακύρωση" +#define MSG_SET_HOME_OFFSETS "Ορισμός βασικών μετατοπίσεων" //SHORTEN +#define MSG_HOME_OFFSETS_APPLIED "Εφαρμόστηκαν οι μετατοπίσεις" //SHORTEN +#define MSG_SET_ORIGIN "Ορισμός προέλευσης" +#define MSG_PREHEAT_PLA "Προθέρμανση PLA" +#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " +#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " όλα" +#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " bed" //SHORTEN +#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " επιβεβαίωση" //SHORTEN +#define MSG_PREHEAT_ABS "Προθέρμανση ABS" +#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " +#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " όλα" +#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " bed" //SHORTEN +#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " επιβεβαίωση" //SHORTEN +#define MSG_H1 "1" +#define MSG_H2 "2" +#define MSG_H3 "3" +#define MSG_H4 "4" +#define MSG_COOLDOWN "Μειωση θερμοκρασιας" +#define MSG_SWITCH_PS_ON "Ενεργοποίηση" +#define MSG_SWITCH_PS_OFF "Απενεργοποίηση" +#define MSG_EXTRUDE "Εξώθηση" +#define MSG_RETRACT "Ανάσυρση" +#define MSG_MOVE_AXIS "Μετακίνηση άξονα" +#define MSG_LEVEL_BED "Επιπεδοποίηση Επ. Εκτύπωσης" //SHORTEN +#define MSG_MOVE_X "Μετακίνηση X" +#define MSG_MOVE_Y "Μετακίνηση Y" +#define MSG_MOVE_Z "Μετακίνηση Z" +#define MSG_MOVE_E "Εξωθητήρας" +#define MSG_MOVE_E1 "1" +#define MSG_MOVE_E2 "2" +#define MSG_MOVE_E3 "3" +#define MSG_MOVE_E4 "4" +#define MSG_MOVE_01MM "Μετακίνηση 0,1μμ" +#define MSG_MOVE_1MM "Μετακίνηση 1μμ" +#define MSG_MOVE_10MM "Μετακίνηση 10μμ" +#define MSG_SPEED "Ταχύτητα" +#define MSG_BED_Z "Επ. Εκτύπωσης Z" +#define MSG_NOZZLE "Ακροφύσιο" +#define MSG_N1 " 1" +#define MSG_N2 " 2" +#define MSG_N3 " 3" +#define MSG_N4 " 4" +#define MSG_BED "Κλίνη" +#define MSG_FAN_SPEED "Ταχύτητα ανεμιστήρα" +#define MSG_FLOW "Ροή" +#define MSG_CONTROL "Έλεγχος" +#define MSG_MIN " " LCD_STR_THERMOMETER " Min" +#define MSG_MAX " " LCD_STR_THERMOMETER " Max" +#define MSG_FACTOR " " LCD_STR_THERMOMETER " Fact" +#define MSG_AUTOTEMP "Αυτομ ρύθμιση θερ/σίας" //SHORTEN +#define MSG_ON "Ενεργοποιημένο" +#define MSG_OFF "Απενεργοποιημένο" +#define MSG_PID_P "PID-P" +#define MSG_PID_I "PID-I" +#define MSG_PID_D "PID-D" +#define MSG_PID_C "PID-C" +#define MSG_E1 " E1" +#define MSG_E2 " E2" +#define MSG_E3 " E3" +#define MSG_E4 " E4" +#define MSG_ACC "Επιτάχυνση" +#define MSG_VXY_JERK "Vαντίδραση xy" +#define MSG_VZ_JERK "Vαντίδραση z" +#define MSG_VE_JERK "Vαντίδραση e" +#define MSG_VMAX "V Μέγιστο" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" +#define MSG_VMIN "V Ελάχιστο" +#define MSG_VTRAV_MIN "Vελάχ. μετατόπιση" +#define MSG_AMAX "Aμεγ " +#define MSG_A_RETRACT "Α-ανάσυρση" +#define MSG_A_TRAVEL "Α-μετατόπιση" +#define MSG_XSTEPS "Bήματα X ανά μμ" +#define MSG_YSTEPS "Bήματα Υ ανά μμ" +#define MSG_ZSTEPS "Bήματα Ζ ανά μμ" +#define MSG_ESTEPS "Bήματα Ε ανά μμ" +#define MSG_TEMPERATURE "Θερμοκρασία" +#define MSG_MOTION "Κίνηση" +#define MSG_VOLUMETRIC "Νήμα" +#define MSG_VOLUMETRIC_ENABLED "Ε σε μμ3" +#define MSG_FILAMENT_DIAM "Διάμετρος νήματος" +#define MSG_DIAM_E1 " 1" +#define MSG_DIAM_E2 " 2" +#define MSG_DIAM_E3 " 3" +#define MSG_DIAM_E4 " 4" +#define MSG_CONTRAST "Κοντράστ LCD" +#define MSG_STORE_EPROM "Αποθήκευση" +#define MSG_LOAD_EPROM "Φόρτωση" +#define MSG_RESTORE_FAILSAFE "Επαναφορά ασφαλούς αντιγράφου" //SHORTEN +#define MSG_REFRESH "Ανανέωση" +#define MSG_WATCH "Οθόνη πληροφόρησης" +#define MSG_PREPARE "Προετοιμασία" +#define MSG_TUNE "Συντονισμός" +#define MSG_PAUSE_PRINT "Παύση εκτύπωσης" +#define MSG_RESUME_PRINT "Συνέχιση εκτύπωσης" +#define MSG_STOP_PRINT "Διακοπή εκτύπωσης" +#define MSG_CARD_MENU "Εκτύπωση από SD" +#define MSG_NO_CARD "Δεν βρέθηκε SD" +#define MSG_DWELL "Αναστολή λειτουργίας" +#define MSG_USERWAIT "Αναμονή για χρήστη" +#define MSG_RESUMING "Συνεχίζεται η εκτύπωση" //SHORTEN +#define MSG_PRINT_ABORTED "Διακόπτεται η εκτύπωση" //SHORTEN +#define MSG_NO_MOVE "Καμία κίνηση." +#define MSG_KILLED "ΤΕΡΜΑΤΙΣΜΟΣ. " +#define MSG_STOPPED "ΔΙΑΚΟΠΗ. " +#define MSG_CONTROL_RETRACT "Ανάσυρση μμ" +#define MSG_CONTROL_RETRACT_SWAP "Εναλλαγή ανάσυρσης μμ" //SHORTEN +#define MSG_CONTROL_RETRACTF "Ανάσυρση V" +#define MSG_CONTROL_RETRACT_ZLIFT "Μεταπήδηση μμ" +#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" +#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm" +#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" +#define MSG_AUTORETRACT "Αυτόματη ανάσυρση" +#define MSG_FILAMENTCHANGE "Αλλαγή νήματος" +#define MSG_INIT_SDCARD "Προετοιμασία κάρτας SD" //SHORTEN +#define MSG_CNG_SDCARD "Αλλαγή κάρτας SD" +#define MSG_ZPROBE_OUT "Διερεύνηση Z εκτός Επ.Εκτύπωσης" //SHORTEN +#define MSG_YX_UNHOMED "Επαναφορά Χ/Υ πριν από Ζ" //SHORTEN +#define MSG_XYZ_UNHOMED "Επαναφορά ΧΥΖ πρώτα" +#define MSG_ZPROBE_ZOFFSET "Μετατόπιση Ζ" +#define MSG_BABYSTEP_X "Μικρό βήμα Χ" +#define MSG_BABYSTEP_Y "Μικρό βήμα Υ" +#define MSG_BABYSTEP_Z "Μικρό βήμα Ζ" +#define MSG_ENDSTOP_ABORT "Ακύρωση endstop " +#define MSG_HEATING_FAILED_LCD "Ανεπιτυχής θέρμανση" +#define MSG_ERR_REDUNDANT_TEMP "ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ" +#define MSG_THERMAL_RUNAWAY "ΔΙΑΦΥΓΗ ΘΕΡΜΟΚΡΑΣΙΑΣ" +#define MSG_ERR_MAXTEMP "ΠΕΡΙΤΗ ΘΕΡΜΟΚΡΑΣΙΑ" +#define MSG_ERR_MINTEMP "ΜΗ ΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑΣ" //SHORTEN +#define MSG_ERR_MAXTEMP_BED "ΜΕΓΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ" //SHORTEN +#define MSG_ERR_MINTEMP_BED "ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ" //SHORTEN +#define MSG_HALTED "H εκτύπωση διακόπηκε" +#define MSG_PLEASE_RESET "PLEASE RESET" //TRANSLATE +#define MSG_END_HOUR "ώρες" +#define MSG_END_MINUTE "λεπτά" +#define MSG_HEATING "Θερμαίνεται…" +#define MSG_HEATING_COMPLETE "Η θέρμανση ολοκληρώθηκε." //SHORTEN +#define MSG_BED_HEATING "Θέρμανση ΕΠ. Εκτύπωσης" //SHORTEN +#define MSG_BED_DONE "Η Επ. Εκτύπωσης ολοκληρώθηκε" //SHORTEN +#define MSG_DELTA_CALIBRATE "Βαθμονόμηση Delta" +#define MSG_DELTA_CALIBRATE_X "Βαθμονόμηση X" +#define MSG_DELTA_CALIBRATE_Y "Βαθμονόμηση Y" +#define MSG_DELTA_CALIBRATE_Z "Βαθμονόμηση Z" +#define MSG_DELTA_CALIBRATE_CENTER "Βαθμονόμηση κέντρου" +#define MSG_INFO_MENU "About Printer" +#define MSG_INFO_PRINTER_MENU "Printer Info" +#define MSG_INFO_STATS_MENU "Printer Stats" +#define MSG_INFO_BOARD_MENU "Board Info" +#define MSG_INFO_THERMISTOR_MENU "Thermistors" +#define MSG_INFO_EXTRUDERS "Extruders" +#define MSG_INFO_BAUDRATE "Baud" +#define MSG_INFO_PROTOCOL "Protocol" +#define MSG_INFO_TOTAL_PRINTS "Total Prints" +#define MSG_INFO_FINISHED_PRINTS "Finished Prints" +#define MSG_INFO_PRINT_TIME "Total Print Time" +#define MSG_INFO_MIN_TEMP "Min Temp" +#define MSG_INFO_MAX_TEMP "Max Temp" +#define MSG_INFO_PSU "Power Supply" +#define MSG_FILAMENT_CHANGE_HEADER "CHANGE FILAMENT" +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Extrude more" +#define MSG_FILAMENT_CHANGE_OPTION_RESUME "Resume print" + +#if LCD_HEIGHT >= 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "Wait for start" + #define MSG_FILAMENT_CHANGE_INIT_2 "of the filament" + #define MSG_FILAMENT_CHANGE_INIT_3 "change" + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Wait for" + #define MSG_FILAMENT_CHANGE_UNLOAD_2 "filament unload" + #define MSG_FILAMENT_CHANGE_UNLOAD_3 "" + #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert filament" + #define MSG_FILAMENT_CHANGE_INSERT_2 "and press button" + #define MSG_FILAMENT_CHANGE_INSERT_3 "to continue..." + #define MSG_FILAMENT_CHANGE_LOAD_1 "Wait for" + #define MSG_FILAMENT_CHANGE_LOAD_2 "filament load" + #define MSG_FILAMENT_CHANGE_LOAD_3 "" + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Wait for" + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "filament extrude" + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "" + #define MSG_FILAMENT_CHANGE_RESUME_1 "Wait for print" + #define MSG_FILAMENT_CHANGE_RESUME_2 "to resume" + #define MSG_FILAMENT_CHANGE_RESUME_3 "" +#else // LCD_HEIGHT < 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "Please wait..." + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Ejecting..." + #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert and Click" + #define MSG_FILAMENT_CHANGE_LOAD_1 "Loading..." + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Extruding..." + #define MSG_FILAMENT_CHANGE_RESUME_1 "Resuming..." +#endif + +#endif // LANGUAGE_EL_H diff --git a/Marlin/language_en.h b/Marlin/language_en.h index a82da89bd..57bc4a5fa 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -30,15 +30,14 @@ #ifndef LANGUAGE_EN_H #define LANGUAGE_EN_H -#if DISABLED(MAPPER_NON) && DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_D0D1) && DISABLED(MAPPER_D0D1_MOD) && DISABLED(MAPPER_E382E383) - #define MAPPER_NON // For direct ascii codes -#endif - //#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays -#if DISABLED(SIMULATE_ROMFONT) && DISABLED(DISPLAY_CHARSET_ISO10646_1) && DISABLED(DISPLAY_CHARSET_ISO10646_5) && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) && DISABLED(DISPLAY_CHARSET_ISO10646_CN) +#if DISABLED(SIMULATE_ROMFONT) && DISABLED(DISPLAY_CHARSET_ISO10646_1) && DISABLED(DISPLAY_CHARSET_ISO10646_5) && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) && DISABLED(DISPLAY_CHARSET_ISO10646_GREEK) && DISABLED(DISPLAY_CHARSET_ISO10646_CN) #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. #endif +#if DISABLED(MAPPER_NON) && DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_D0D1) && DISABLED(MAPPER_D0D1_MOD) && DISABLED(MAPPER_E382E383) && DISABLED(MAPPER_CECF) + #define MAPPER_NON // For direct ascii codes +#endif #ifndef WELCOME_MSG #define WELCOME_MSG MACHINE_NAME " ready." diff --git a/Marlin/language_test.h b/Marlin/language_test.h index 17ad7bca0..d2f99f687 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -58,6 +58,7 @@ // Select the better font for full graphic displays. //#define DISPLAY_CHARSET_ISO10646_1 //#define DISPLAY_CHARSET_ISO10646_5 +//#define DISPLAY_CHARSET_ISO10646_GREEK //#define DISPLAY_CHARSET_ISO10646_KANA diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h index ae599af6b..829741756 100644 --- a/Marlin/utf_mapper.h +++ b/Marlin/utf_mapper.h @@ -38,6 +38,8 @@ #define MAPPER_ONE_TO_ONE #elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA) #define MAPPER_ONE_TO_ONE + #elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK) + #define MAPPER_ONE_TO_ONE #endif #else // SIMULATE_ROMFONT #if DISPLAY_CHARSET_HD44780 == JAPANESE @@ -157,13 +159,44 @@ static uint8_t utf_hi_char; // UTF-8 high part static bool seen_c2 = false; uint8_t d = c; - if ( d >= 0x80 ) { // UTF-8 handling - if ( (d >= 0xc0) && (!seen_c2) ) { - utf_hi_char = d - 0xc2; + if ( d >= 0x80u ) { // UTF-8 handling + if ( (d >= 0xc0u) && (!seen_c2) ) { + utf_hi_char = d - 0xc2u; seen_c2 = true; return 0; } else if (seen_c2) { + d &= 0x3fu; + #ifndef MAPPER_ONE_TO_ONE + HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); + #else + HARDWARE_CHAR_OUT((char)(0x80u + (utf_hi_char << 6) + d)) ; + #endif + } + else { + HARDWARE_CHAR_OUT('?'); + } + } + else { + HARDWARE_CHAR_OUT((char) c ); + } + seen_c2 = false; + return 1; + } + +#elif ENABLED(MAPPER_CECF) + + char charset_mapper(char c) { + static uint8_t utf_hi_char; // UTF-8 high part + static bool seen_ce = false; + uint8_t d = c; + if ( d >= 0x80 ) { // UTF-8 handling + if ( (d >= 0xc0) && (!seen_ce) ) { + utf_hi_char = d - 0xce; + seen_ce = true; + return 0; + } + else if (seen_ce) { d &= 0x3f; #ifndef MAPPER_ONE_TO_ONE HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); @@ -178,7 +211,38 @@ else { HARDWARE_CHAR_OUT((char) c ); } - seen_c2 = false; + seen_ce = false; + return 1; + } + +#elif ENABLED(MAPPER_CECF) + + char charset_mapper(char c) { + static uint8_t utf_hi_char; // UTF-8 high part + static bool seen_ce = false; + uint8_t d = c; + if ( d >= 0x80 ) { // UTF-8 handling + if ( (d >= 0xc0) && (!seen_ce) ) { + utf_hi_char = d - 0xce; + seen_ce = true; + return 0; + } + else if (seen_ce) { + d &= 0x3f; + #ifndef MAPPER_ONE_TO_ONE + HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20)); + #else + HARDWARE_CHAR_OUT((char)(0x80 + (utf_hi_char << 6) + d)) ; + #endif + } + else { + HARDWARE_CHAR_OUT('?'); + } + } + else { + HARDWARE_CHAR_OUT((char) c ); + } + seen_ce = false; return 1; } From 71674059c3af806980a598590da894cee84217e1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Jul 2016 19:25:23 -0700 Subject: [PATCH 299/580] Two strategies to address a stuck buzzer --- Marlin/buzzer.h | 2 +- Marlin/ultralcd.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index c87fe849d..04aadc496 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -124,7 +124,7 @@ class Buzzer { this->state.timestamp = millis() + this->state.tone.duration; if (this->state.tone.frequency > 0) this->on(); } - else if (millis() >= this->state.timestamp) this->reset(); + else if (ELAPSED(millis(), this->state.timestamp)) this->reset(); } }; diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d0a9a5dd7..5cd1252db 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2334,12 +2334,14 @@ void kill_screen(const char* lcd_msg) { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; next_button_update_ms = millis() + 500; + // Buzz and wait. The delay is needed for buttons to settle! #if ENABLED(LCD_USE_I2C_BUZZER) lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + delay(10); #elif PIN_EXISTS(BEEPER) buzzer.tone(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } #endif - delay(10); // needed for buttons to settle } /** From d1dffc7ad10677052229124e0d8fd9f7f80744fb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Jul 2016 19:36:46 -0700 Subject: [PATCH 300/580] timestamp => endtime --- Marlin/buzzer.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index 04aadc496..e967284ea 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -46,7 +46,7 @@ class Buzzer { private: struct state_t { tone_t tone; - uint32_t timestamp; + uint32_t endtime; } state; protected: @@ -82,7 +82,7 @@ class Buzzer { */ void reset() { this->off(); - this->state.timestamp = 0; + this->state.endtime = 0; } public: @@ -97,7 +97,7 @@ class Buzzer { /** * @brief Add a tone to the queue * @details Adds a tone_t structure to the ring buffer, will block IO if the - * queue is full waiting for one slot to get available. + * queue is full waiting for one slot to get available. * * @param duration Duration of the tone in milliseconds * @param frequency Frequency of the tone in hertz @@ -114,17 +114,17 @@ class Buzzer { /** * @brief Loop function * @details This function should be called at loop, it will take care of - * playing the tones in the queue. + * playing the tones in the queue. */ virtual void tick() { - if (!this->state.timestamp) { + if (!this->state.endtime) { if (this->buffer.isEmpty()) return; this->state.tone = this->buffer.dequeue(); - this->state.timestamp = millis() + this->state.tone.duration; + this->state.endtime = millis() + this->state.tone.duration; if (this->state.tone.frequency > 0) this->on(); } - else if (ELAPSED(millis(), this->state.timestamp)) this->reset(); + else if (ELAPSED(millis(), this->state.endtime)) this->reset(); } }; From 91bd6eade701ea1c5e4027d4bee0a245b8391005 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 10:19:01 -0700 Subject: [PATCH 301/580] X_DUAL_STEPPER_DRIVERS configuration option --- Marlin/Configuration_adv.h | 33 ++++++++++++------- Marlin/SanityCheck.h | 18 +++++----- .../Cartesio/Configuration_adv.h | 33 ++++++++++++------- .../Felix/Configuration_adv.h | 33 ++++++++++++------- .../Hephestos/Configuration_adv.h | 33 ++++++++++++------- .../Hephestos_2/Configuration_adv.h | 33 ++++++++++++------- .../K8200/Configuration_adv.h | 33 ++++++++++++------- .../RigidBot/Configuration_adv.h | 33 ++++++++++++------- .../SCARA/Configuration_adv.h | 33 ++++++++++++------- .../TAZ4/Configuration_adv.h | 33 ++++++++++++------- .../WITBOX/Configuration_adv.h | 33 ++++++++++++------- .../delta/biv2.5/Configuration_adv.h | 33 ++++++++++++------- .../delta/generic/Configuration_adv.h | 33 ++++++++++++------- .../delta/kossel_mini/Configuration_adv.h | 33 ++++++++++++------- .../delta/kossel_pro/Configuration_adv.h | 33 ++++++++++++------- .../delta/kossel_xl/Configuration_adv.h | 33 ++++++++++++------- .../makibox/Configuration_adv.h | 33 ++++++++++++------- .../tvrrug/Round2/Configuration_adv.h | 33 ++++++++++++------- 18 files changed, 365 insertions(+), 214 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 82b19dea3..027132d77 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 17d6cff5f..9c48e9e87 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -76,8 +76,14 @@ /** * Dual Stepper Drivers */ -#if ENABLED(Z_DUAL_STEPPER_DRIVERS) && ENABLED(Y_DUAL_STEPPER_DRIVERS) - #error "You cannot have dual stepper drivers for both Y and Z." +#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE) + #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS." +#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR) + #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)." +#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR) + #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)." +#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR) + #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)." #endif /** @@ -152,14 +158,6 @@ #error "EXTRUDERS must be 1 with HEATERS_PARALLEL." #endif - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #error "EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS." - #endif - - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) - #error "EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS." - #endif - #elif ENABLED(SINGLENOZZLE) #error "SINGLENOZZLE requires 2 or more EXTRUDERS." #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 53ee0908e..5fb71efe6 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 77148dc88..05189ecfc 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index e1e6666df..1aa7c218b 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index e08dd26dc..95b8c89b8 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index b3b7b26ae..2d0afdff3 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -235,11 +235,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -261,14 +278,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 70debaca9..e3af83bad 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 81b83c18c..a7285ffd2 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 20e7ac19e..116c99abb 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -237,11 +237,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -263,14 +280,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index e1e6666df..1aa7c218b 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 8464cc7b0..3e9fd8670 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 874031add..1dfeb8c71 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 1f130084f..e2bb76476 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index db1a8e3c8..3baf69390 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -234,11 +234,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -260,14 +277,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index fc309285e..3b82e06fb 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 960d18630..bdf820937 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index b04440245..9c04c4650 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage From 4b4a582c4fe148c1c92a7371d36a1ba81d6030fb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 10:19:07 -0700 Subject: [PATCH 302/580] X_DUAL_STEPPER_DRIVERS implementation --- Marlin/Marlin.h | 72 +++++++++++++++++------------------- Marlin/pins.h | 31 ++++++++++------ Marlin/stepper.cpp | 24 +++++++----- Marlin/stepper_indirection.h | 6 +-- 4 files changed, 70 insertions(+), 63 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 5c698834b..792001bc6 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -134,73 +134,69 @@ void manage_inactivity(bool ignore_stepper_queue = false); extern bool extruder_duplication_enabled; #endif -#if ENABLED(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE - #define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0) - #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0) +#if HAS_X2_ENABLE + #define enable_x() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0) + #define disable_x() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0) #elif HAS_X_ENABLE #define enable_x() X_ENABLE_WRITE( X_ENABLE_ON) - #define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } + #define disable_x() do{ X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0) #else - #define enable_x() ; - #define disable_x() ; + #define enable_x() NOOP + #define disable_x() NOOP #endif -#if HAS_Y_ENABLE - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); } - #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; } - #else - #define enable_y() Y_ENABLE_WRITE( Y_ENABLE_ON) - #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; } - #endif +#if HAS_Y2_ENABLE + #define enable_y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0) + #define disable_y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0) +#elif HAS_Y_ENABLE + #define enable_y() Y_ENABLE_WRITE( Y_ENABLE_ON) + #define disable_y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0) #else - #define enable_y() ; - #define disable_y() ; + #define enable_y() NOOP + #define disable_y() NOOP #endif -#if HAS_Z_ENABLE - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) - #define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); } - #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } - #else - #define enable_z() Z_ENABLE_WRITE( Z_ENABLE_ON) - #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } - #endif +#if HAS_Z2_ENABLE + #define enable_z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0) + #define disable_z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0) +#elif HAS_Z_ENABLE + #define enable_z() Z_ENABLE_WRITE( Z_ENABLE_ON) + #define disable_z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0) #else - #define enable_z() ; - #define disable_z() ; + #define enable_z() NOOP + #define disable_z() NOOP #endif #if HAS_E0_ENABLE - #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON) + #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON) #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON) #else - #define enable_e0() /* nothing */ - #define disable_e0() /* nothing */ + #define enable_e0() NOOP + #define disable_e0() NOOP #endif #if (EXTRUDERS > 1) && HAS_E1_ENABLE - #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON) + #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON) #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON) #else - #define enable_e1() /* nothing */ - #define disable_e1() /* nothing */ + #define enable_e1() NOOP + #define disable_e1() NOOP #endif #if (EXTRUDERS > 2) && HAS_E2_ENABLE - #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON) + #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON) #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON) #else - #define enable_e2() /* nothing */ - #define disable_e2() /* nothing */ + #define enable_e2() NOOP + #define disable_e2() NOOP #endif #if (EXTRUDERS > 3) && HAS_E3_ENABLE - #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON) + #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON) #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON) #else - #define enable_e3() /* nothing */ - #define disable_e3() /* nothing */ + #define enable_e3() NOOP + #define disable_e3() NOOP #endif /** diff --git a/Marlin/pins.h b/Marlin/pins.h index bd251216e..1d4de00f8 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -369,8 +369,8 @@ #define __EPIN(p,q) E##p##_##q##_PIN #define _EPIN(p,q) __EPIN(p,q) -#if ENABLED(DUAL_X_CARRIAGE) - // The X2 axis, if any, should be the next open extruder port +// The X2 axis, if any, should be the next open extruder port +#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS) #ifndef X2_STEP_PIN #define X2_STEP_PIN _EPIN(EXTRUDERS, STEP) #define X2_DIR_PIN _EPIN(EXTRUDERS, DIR) @@ -378,25 +378,32 @@ #endif #undef _X2_PINS #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, - #define Y2_Z2_E_INDEX INCREMENT(EXTRUDERS) + #define Y2_E_INDEX INCREMENT(EXTRUDERS) #else - #define Y2_Z2_E_INDEX EXTRUDERS + #define Y2_E_INDEX EXTRUDERS #endif // The Y2 axis, if any, should be the next open extruder port -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_STEP_PIN) - #define Y2_STEP_PIN _EPIN(Y2_Z2_E_INDEX, STEP) - #define Y2_DIR_PIN _EPIN(Y2_Z2_E_INDEX, DIR) - #define Y2_ENABLE_PIN _EPIN(Y2_Z2_E_INDEX, ENABLE) +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #ifndef Y2_STEP_PIN + #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) + #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) + #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) + #endif #undef _Y2_PINS #define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, + #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) +#else + #define Z2_E_INDEX Y2_E_INDEX #endif // The Z2 axis, if any, should be the next open extruder port -#if ENABLED(Z_DUAL_STEPPER_DRIVERS) && !defined(Z2_STEP_PIN) - #define Z2_STEP_PIN _EPIN(Y2_Z2_E_INDEX, STEP) - #define Z2_DIR_PIN _EPIN(Y2_Z2_E_INDEX, DIR) - #define Z2_ENABLE_PIN _EPIN(Y2_Z2_E_INDEX, ENABLE) +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + #ifndef Z2_STEP_PIN + #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) + #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) + #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) + #endif #undef _Z2_PINS #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, #endif diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 300bd286f..57fa3b5b7 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -120,7 +120,10 @@ unsigned short Stepper::OCR1A_nominal; volatile long Stepper::endstops_trigsteps[3]; -#if ENABLED(DUAL_X_CARRIAGE) +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) != INVERT_X2_VS_X_DIR); }while(0) + #define X_APPLY_STEP(v,Q) do{ X_STEP_WRITE(v); X2_STEP_WRITE(v); }while(0) +#elif ENABLED(DUAL_X_CARRIAGE) #define X_APPLY_DIR(v,ALWAYS) \ if (extruder_duplication_enabled || ALWAYS) { \ X_DIR_WRITE(v); \ @@ -143,15 +146,15 @@ volatile long Stepper::endstops_trigsteps[3]; #endif #if ENABLED(Y_DUAL_STEPPER_DRIVERS) - #define Y_APPLY_DIR(v,Q) { Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); } - #define Y_APPLY_STEP(v,Q) { Y_STEP_WRITE(v); Y2_STEP_WRITE(v); } + #define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); }while(0) + #define Y_APPLY_STEP(v,Q) do{ Y_STEP_WRITE(v); Y2_STEP_WRITE(v); }while(0) #else #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v) #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v) #endif #if ENABLED(Z_DUAL_STEPPER_DRIVERS) - #define Z_APPLY_DIR(v,Q) { Z_DIR_WRITE(v); Z2_DIR_WRITE(v); } + #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }while(0) #if ENABLED(Z_DUAL_ENDSTOPS) #define Z_APPLY_STEP(v,Q) \ if (performing_homing) { \ @@ -169,7 +172,7 @@ volatile long Stepper::endstops_trigsteps[3]; Z2_STEP_WRITE(v); \ } #else - #define Z_APPLY_STEP(v,Q) { Z_STEP_WRITE(v); Z2_STEP_WRITE(v); } + #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); }while(0) #endif #else #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v) @@ -669,14 +672,15 @@ void Stepper::init() { // Initialize Step Pins #if HAS_X_STEP - AXIS_INIT(x, X, X); - #if ENABLED(DUAL_X_CARRIAGE) && HAS_X2_STEP - AXIS_INIT(x, X2, X); + #if ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE) + X2_STEP_INIT; + X2_STEP_WRITE(INVERT_X_STEP_PIN); #endif + AXIS_INIT(x, X, X); #endif #if HAS_Y_STEP - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_STEP + #if ENABLED(Y_DUAL_STEPPER_DRIVERS) Y2_STEP_INIT; Y2_STEP_WRITE(INVERT_Y_STEP_PIN); #endif @@ -684,7 +688,7 @@ void Stepper::init() { #endif #if HAS_Z_STEP - #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && HAS_Z2_STEP + #if ENABLED(Z_DUAL_STEPPER_DRIVERS) Z2_STEP_INIT; Z2_STEP_WRITE(INVERT_Z_STEP_PIN); #endif diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 24e4c7c0a..56c15060e 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -60,7 +60,7 @@ #define X_ENABLE_READ READ(X_ENABLE_PIN) // X2 motor -#if ENABLED(DUAL_X_CARRIAGE) +#if HAS_X2_ENABLE #define X2_STEP_INIT SET_OUTPUT(X2_STEP_PIN) #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE) #define X2_STEP_READ READ(X2_STEP_PIN) @@ -88,7 +88,7 @@ #define Y_ENABLE_READ READ(Y_ENABLE_PIN) // Y2 motor -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) +#if HAS_Y2_ENABLE #define Y2_STEP_INIT SET_OUTPUT(Y2_STEP_PIN) #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE) #define Y2_STEP_READ READ(Y2_STEP_PIN) @@ -116,7 +116,7 @@ #define Z_ENABLE_READ READ(Z_ENABLE_PIN) // Z2 motor -#if ENABLED(Z_DUAL_STEPPER_DRIVERS) +#if HAS_Z2_ENABLE #define Z2_STEP_INIT SET_OUTPUT(Z2_STEP_PIN) #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE) #define Z2_STEP_READ READ(Z2_STEP_PIN) From 23e0134596a04153f6df530104e704b62562e17e Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 11 Jul 2016 20:44:30 +0200 Subject: [PATCH 303/580] Repair M100 M100 D was running too long - caused watchdog resets. M100 I showed more free memory than a Arduino Mega has RAM. --- Marlin/M100_Free_Mem_Chk.cpp | 63 ++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/Marlin/M100_Free_Mem_Chk.cpp b/Marlin/M100_Free_Mem_Chk.cpp index 8804bab6a..82689465a 100644 --- a/Marlin/M100_Free_Mem_Chk.cpp +++ b/Marlin/M100_Free_Mem_Chk.cpp @@ -43,23 +43,23 @@ #include "Marlin.h" #if ENABLED(M100_FREE_MEMORY_WATCHER) -extern void* __brkval; +extern char* __brkval; extern size_t __heap_start, __heap_end, __flp; - +extern char __bss_end; // // Utility functions used by M100 to get its work done. // -unsigned char* top_of_stack(); +char* top_of_stack(); void prt_hex_nibble(unsigned int); void prt_hex_byte(unsigned int); void prt_hex_word(unsigned int); -int how_many_E5s_are_here(unsigned char*); +int how_many_E5s_are_here(char*); void gcode_M100() { - static int m100_not_initialized = 1; - unsigned char* sp, *ptr; + static bool m100_not_initialized = true; + char* sp, *ptr; int i, j, n; // // M100 D dumps the free memory block from __brkval to the stack pointer. @@ -72,19 +72,19 @@ void gcode_M100() { // #if ENABLED(M100_FREE_MEMORY_DUMPER) // Disable to remove Dump sub-command if (code_seen('D')) { - ptr = (unsigned char*) __brkval; + ptr = __brkval ? __brkval : &__bss_end; // // We want to start and end the dump on a nice 16 byte boundry even though // the values we are using are not 16 byte aligned. // - SERIAL_ECHOPGM("\n__brkval : "); + SERIAL_ECHOPGM("\nbss_end : "); prt_hex_word((unsigned int) ptr); - ptr = (unsigned char*)((unsigned long) ptr & 0xfff0); + ptr = (char*)((unsigned long) ptr & 0xfff0); sp = top_of_stack(); SERIAL_ECHOPGM("\nStack Pointer : "); prt_hex_word((unsigned int) sp); SERIAL_EOL; - sp = (unsigned char*)((unsigned long) sp | 0x000f); + sp = (char*)((unsigned long) sp | 0x000f); n = sp - ptr; // // This is the main loop of the Dump command. @@ -95,21 +95,17 @@ void gcode_M100() { for (i = 0; i < 16; i++) { // and 16 data bytes prt_hex_byte(*(ptr + i)); SERIAL_CHAR(' '); - delay(2); } SERIAL_CHAR('|'); // now show where non 0xE5's are for (i = 0; i < 16; i++) { - delay(2); - if (*(ptr + i) == 0xe5) + if (*(ptr + i) == (char)0xe5) SERIAL_CHAR(' '); else SERIAL_CHAR('?'); } SERIAL_EOL; ptr += 16; - delay(2); } - SERIAL_ECHOLNPGM("Done."); return; } #endif @@ -119,17 +115,17 @@ void gcode_M100() { // if (code_seen('F')) { #if 0 - int max_addr = (int) __brkval; + int max_addr = (int) __brkval ? __brkval : &__bss_end; int max_cnt = 0; #endif int block_cnt = 0; - ptr = (unsigned char*) __brkval; + ptr = __brkval ? __brkval : &__bss_end; sp = top_of_stack(); n = sp - ptr; // Scan through the range looking for the biggest block of 0xE5's we can find for (i = 0; i < n; i++) { - if (*(ptr + i) == (unsigned char) 0xe5) { - j = how_many_E5s_are_here((unsigned char*) ptr + i); + if (*(ptr + i) == (char)0xe5) { + j = how_many_E5s_are_here(ptr + i); if (j > 8) { SERIAL_ECHOPAIR("Found ", j); SERIAL_ECHOPGM(" bytes free at 0x"); @@ -148,7 +144,6 @@ void gcode_M100() { } if (block_cnt > 1) SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); - SERIAL_ECHOLNPGM("\nDone."); return; } // @@ -159,8 +154,8 @@ void gcode_M100() { if (code_seen('C')) { int x = code_value_int(); // x gets the # of locations to corrupt within the memory pool SERIAL_ECHOLNPGM("Corrupting free memory block.\n"); - ptr = (unsigned char*) __brkval; - SERIAL_ECHOPAIR("\n__brkval : ", ptr); + ptr = __brkval ? __brkval : &__bss_end; + SERIAL_ECHOPAIR("\nbss_end : ", ptr); ptr += 8; sp = top_of_stack(); SERIAL_ECHOPAIR("\nStack Pointer : ", sp); @@ -181,10 +176,10 @@ void gcode_M100() { // M100 I Initializes the free memory pool so it can be watched and prints vital // statistics that define the free memory pool. // - if (m100_not_initialized || code_seen('I')) { // If no sub-command is specified, the first time - SERIAL_ECHOLNPGM("Initializing free memory block.\n"); // this happens, it will Initialize. - ptr = (unsigned char*) __brkval; // Repeated M100 with no sub-command will not destroy the - SERIAL_ECHOPAIR("\n__brkval : ", ptr); // state of the initialized free memory pool. + if (m100_not_initialized || code_seen('I')) { // If no sub-command is specified, the first time + SERIAL_ECHOLNPGM("Initializing free memory block.\n"); // this happens, it will Initialize. + ptr = __brkval ? __brkval : &__bss_end; // Repeated M100 with no sub-command will not destroy the + SERIAL_ECHOPAIR("\nbss_end : ", ptr); // state of the initialized free memory pool. ptr += 8; sp = top_of_stack(); SERIAL_ECHOPAIR("\nStack Pointer : ", sp); @@ -194,16 +189,15 @@ void gcode_M100() { SERIAL_ECHO(n); SERIAL_ECHOLNPGM(" bytes of memory initialized.\n"); for (i = 0; i < n; i++) - *(ptr + i) = (unsigned char) 0xe5; + *(ptr + i) = (char)0xe5; for (i = 0; i < n; i++) { - if (*(ptr + i) != (unsigned char) 0xe5) { + if (*(ptr + i) != (char)0xe5) { SERIAL_ECHOPAIR("? address : ", ptr + i); SERIAL_ECHOPAIR("=", *(ptr + i)); SERIAL_ECHOLNPGM("\n"); } } - m100_not_initialized = 0; - SERIAL_ECHOLNPGM("Done.\n"); + m100_not_initialized = false; return; } return; @@ -212,8 +206,8 @@ void gcode_M100() { // top_of_stack() returns the location of a variable on its stack frame. The value returned is above // the stack once the function returns to the caller. -unsigned char* top_of_stack() { - unsigned char x; +char* top_of_stack() { + char x; return &x + 1; // x is pulled on return; } @@ -226,7 +220,6 @@ void prt_hex_nibble(unsigned int n) { SERIAL_ECHO(n); else SERIAL_ECHO((char)('A' + n - 10)); - delay(2); } void prt_hex_byte(unsigned int b) { @@ -242,10 +235,10 @@ void prt_hex_word(unsigned int w) { // how_many_E5s_are_here() is a utility function to easily find out how many 0xE5's are // at the specified location. Having this logic as a function simplifies the search code. // -int how_many_E5s_are_here(unsigned char* p) { +int how_many_E5s_are_here(char* p) { int n; for (n = 0; n < 32000; n++) { - if (*(p + n) != (unsigned char) 0xe5) + if (*(p + n) != (char)0xe5) return n - 1; } return -1; From 6af525e2528f1457551a324fe64e7dc642395feb Mon Sep 17 00:00:00 2001 From: esenapaj Date: Tue, 12 Jul 2016 03:48:15 +0900 Subject: [PATCH 304/580] Fix for the PR #4256 (Additional tweaks for HOTENDS == 1) --- Marlin/configuration_store.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index c14e957b2..1af06ecd1 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -618,7 +618,7 @@ void Config_ResetDefault() { #if ENABLED(PIDTEMP) #if ENABLED(PID_PARAMS_PER_HOTEND) - HOTEND_LOOP + HOTEND_LOOP() #else int e = 0; UNUSED(e); // only need to write once #endif From 84ded1f659d095ef8ccd49e45e2be72ae2bca16c Mon Sep 17 00:00:00 2001 From: esenapaj Date: Tue, 12 Jul 2016 04:19:09 +0900 Subject: [PATCH 305/580] Follow-up the PR #4024 (Greek Language by @psavva) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update forgotten Configuration.h of K8400 --- Marlin/example_configurations/K8400/Configuration.h | 6 +++--- .../example_configurations/K8400/Dual Heads/Configuration.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index c8c097164..17e5c2871 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -827,10 +827,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en diff --git a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h index 1a9b72423..2d706afff 100644 --- a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual Heads/Configuration.h @@ -827,10 +827,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // // Here you may choose the language used by Marlin on the LCD menus, the following // list of languages are available: -// en, an, bg, ca, cn, cz, de, es, eu, fi, fr, gl, hr, it, kana, -// kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test +// en, an, bg, ca, cn, cz, de, el, el-gr, es, eu, fi, fr, gl, hr, it, +// kana, kana_utf8, nl, pl, pt, pt_utf8, pt-br, pt-br_utf8, ru, test // -// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} +// :{'en':'English','an':'Aragonese','bg':'Bulgarian','ca':'Catalan','cn':'Chinese','cz':'Czech','de':'German','el':'Greek','el-gr':'Greek (Greece)','es':'Spanish','eu':'Basque-Euskera','fi':'Finnish','fr':'French','gl':'Galician','hr':'Croatian','it':'Italian','kana':'Japanese','kana_utf8':'Japanese (UTF8)','nl':'Dutch','pl':'Polish','pt':'Portuguese','pt-br':'Portuguese (Brazilian)','pt-br_utf8':'Portuguese (Brazilian UTF8)','pt_utf8':'Portuguese (UTF8)','ru':'Russian','test':'TEST'} // #define LCD_LANGUAGE en From 7bcab26f2a094407deb33f6b492a0c9c57ac5709 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 11 Jul 2016 22:01:44 +0200 Subject: [PATCH 306/580] Don't deploy/stow the probe if z-min-endstop is used for homing Don't deploy/stow the probe if z-min-endstop is used for homing. Don't apply `zprobe_zoffset` if probe was not used. --- Marlin/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 31545ab47..9f60855e5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1525,7 +1525,7 @@ static void set_axis_is_at_home(AxisEnum axis) { current_position[axis] = base_home_pos(axis) + home_offset[axis]; update_software_endstops(axis); - #if HAS_BED_PROBE && Z_HOME_DIR < 0 + #if HAS_BED_PROBE && Z_HOME_DIR < 0 && DISABLED(Z_MIN_PROBE_ENDSTOP) if (axis == Z_AXIS) { current_position[Z_AXIS] -= zprobe_zoffset; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2362,7 +2362,7 @@ static void homeaxis(AxisEnum axis) { home_dir(axis); // Homing Z towards the bed? Deploy the Z probe or endstop. - #if HAS_BED_PROBE + #if HAS_BED_PROBE && DISABLED(Z_MIN_PROBE_ENDSTOP) if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); @@ -2463,7 +2463,7 @@ static void homeaxis(AxisEnum axis) { axis_homed[axis] = true; // Put away the Z probe - #if HAS_BED_PROBE + #if HAS_BED_PROBE && DISABLED(Z_MIN_PROBE_ENDSTOP) if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); From 55dc8051d85d2820292bf819482af1c643b28b1e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 15:36:15 -0700 Subject: [PATCH 307/580] Cleanup of RAMPS LCD pins --- Marlin/pins_RAMPS_14.h | 59 +++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 0a63c2495..8731845f5 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -141,22 +141,30 @@ #if ENABLED(ULTRA_LCD) + #if ENABLED(NEWPANEL) && ENABLED(PANEL_ONE) + #define LCD_PINS_RS 40 + #define LCD_PINS_ENABLE 42 + #define LCD_PINS_D4 65 + #define LCD_PINS_D5 66 + #define LCD_PINS_D6 44 + #define LCD_PINS_D7 64 + #else + #define BEEPER_PIN 33 + #define LCD_PINS_RS 16 + #define LCD_PINS_ENABLE 17 + #define LCD_PINS_D4 23 + #define LCD_PINS_D5 25 + #define LCD_PINS_D6 27 + #define LCD_PINS_D7 29 + // Buttons are attached to a shift register + // Not wired yet + //#define SHIFT_CLK 38 + //#define SHIFT_LD 42 + //#define SHIFT_OUT 40 + //#define SHIFT_EN 17 + #endif + #if ENABLED(NEWPANEL) - #if ENABLED(PANEL_ONE) - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 65 - #define LCD_PINS_D5 66 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 64 - #else - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - #endif #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) #define BEEPER_PIN 37 @@ -272,26 +280,7 @@ #endif #endif - #else // !NEWPANEL (Old-style panel with shift register) - - // No Beeper added - #define BEEPER_PIN 33 - - // Buttons are attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 - - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 - - #endif // !NEWPANEL + #endif // NEWPANEL #endif // ULTRA_LCD From 9b1ba1012af4dd8642590b74c70092ca501dadb9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 15:34:37 -0700 Subject: [PATCH 308/580] Support for VIKI2 with MKS Gen 1.3 / 1.4 --- Marlin/pins_MKS_13.h | 86 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index 1b2565337..00da20644 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -37,6 +37,88 @@ #define HEATER_1_PIN 7 // EXTRUDER 2 (-1 on RAMPS 1.4) #if ENABLED(VIKI2) || ENABLED(miniVIKI) - //#undef SD_DETECT_PIN - //#define SD_DETECT_PIN 49 // For easy adapter board + /** + * VIKI2 Has two groups of wires with... + * + * +Vin + Input supply, requires 120ma for LCD and mSD card + * GND Ground Pin + * MOSI Data input for LCD and SD + * MISO Data output for SD + * SCK Clock for LCD and SD + * AO Reg. Sel for LCD + * LCS Chip Select for LCD + * SDCS Chip Select for SD + * SDCD Card Detect pin for SD + * ENCA Encoder output A + * ENCB Encoder output B + * ENCBTN Encoder button switch + * + * BTN Panel mounted button switch + * BUZZER Piezo buzzer + * BLUE-LED Blue LED ring pin (3 to 5v, mosfet buffered) + * RED-LED Red LED ring pin (3 to 5v, mosfet buffered) + * + * This configuration uses the following arrangement: + * + * EXP1 D37 = EN2 D35 = EN1 EXP2 D50 = MISO D52 = SCK + * D17 = BLUE D16 = RED D31 = ENC D53 = SDCS + * D23 = KILL D25 = BUZZ D33 = --- D51 = MOSI + * D27 = A0 D29 = LCS D49 = SDCD RST = --- + * GND = GND 5V = 5V GND = --- D41 = --- + */ + + #undef BTN_EN1 + #undef BTN_EN2 + #undef BTN_ENC + #undef DOGLCD_A0 + #undef DOGLCD_CS + #undef SD_DETECT_PIN + #undef BEEPER_PIN + #undef KILL_PIN + + // + // VIKI2 12-wire lead + // + + // orange/white SDCD + #define SD_DETECT_PIN 49 + + // white ENCA + #define BTN_EN1 35 + + // green ENCB + #define BTN_EN2 37 + + // purple ENCBTN + #define BTN_ENC 31 + + // brown A0 + #define DOGLCD_A0 27 + + // green/white LCS + #define DOGLCD_CS 29 + + // 50 gray MISO + // 51 yellow MOSI + // 52 orange SCK + + // blue SDCS + //#define SDSS 53 + + // + // VIKI2 4-wire lead + // + + // blue BTN + #define KILL_PIN 23 + + // green BUZZER + #define BEEPER_PIN 25 + + // yellow RED-LED + #define STAT_LED_RED 16 + + // white BLUE-LED + #define STAT_LED_BLUE 17 + #endif From 10ebf28ee3ca3fb6aea07d9a3edf0bf17cabad5a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 15:38:04 -0700 Subject: [PATCH 309/580] Allow override of ENCODER_FEEDRATE_DEADZONE, lower default for Viki --- Marlin/ultralcd.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d0a9a5dd7..f7c3b1d90 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -189,9 +189,10 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to static void menu_action_sddirectory(const char* filename, char* longFilename); #endif - #define ENCODER_FEEDRATE_DEADZONE 10 - #if DISABLED(LCD_I2C_VIKI) + #ifndef ENCODER_FEEDRATE_DEADZONE + #define ENCODER_FEEDRATE_DEADZONE 10 + #endif #ifndef ENCODER_STEPS_PER_MENU_ITEM #define ENCODER_STEPS_PER_MENU_ITEM 5 #endif @@ -199,6 +200,9 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to #define ENCODER_PULSES_PER_STEP 1 #endif #else + #ifndef ENCODER_FEEDRATE_DEADZONE + #define ENCODER_FEEDRATE_DEADZONE 4 + #endif #ifndef ENCODER_STEPS_PER_MENU_ITEM #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation #endif From 58177a1602c40f859f67307cdb0b0bf5126d84e6 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 30 Apr 2016 18:51:18 +0900 Subject: [PATCH 310/580] Suppress warnings --- Marlin/MarlinSerial.cpp | 2 ++ Marlin/Marlin_main.cpp | 6 ++++-- Marlin/planner.cpp | 16 ++++++++++++---- Marlin/ultralcd.cpp | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index bf7675426..d0921f470 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -542,6 +542,8 @@ MarlinSerial customizedSerial; case state_M410: quickstop_stepper(); break; + default: + break; } state = state_RESET; } diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 31545ab47..e9bb9c3dc 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5965,7 +5965,7 @@ void quickstop_stepper() { * Use either 'M421 X Y Z' or 'M421 I J Z' */ inline void gcode_M421() { - int8_t px, py; + int8_t px = 0, py = 0; float z = 0; bool hasX, hasY, hasZ, hasI, hasJ; if ((hasX = code_seen('X'))) px = mbl.probe_index_x(code_value_axis_units(X_AXIS)); @@ -6210,7 +6210,9 @@ inline void gcode_M503() { disable_e3(); delay(100); - millis_t next_tick = 0; + #if HAS_BUZZER + millis_t next_tick = 0; + #endif // Wait for filament insert by user and press button lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT); diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index b742dfe6e..00ea8540c 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -397,8 +397,12 @@ void Planner::check_axes_activity() { #endif #if ENABLED(BARICUDA) - unsigned char tail_valve_pressure = baricuda_valve_pressure, - tail_e_to_p_pressure = baricuda_e_to_p_pressure; + #if HAS_HEATER_1 + unsigned char tail_valve_pressure = baricuda_valve_pressure; + #endif + #if HAS_HEATER_2 + unsigned char tail_e_to_p_pressure = baricuda_e_to_p_pressure; + #endif #endif if (blocks_queued()) { @@ -411,8 +415,12 @@ void Planner::check_axes_activity() { #if ENABLED(BARICUDA) block = &block_buffer[block_buffer_tail]; - tail_valve_pressure = block->valve_pressure; - tail_e_to_p_pressure = block->e_to_p_pressure; + #if HAS_HEATER_1 + tail_valve_pressure = block->valve_pressure; + #endif + #if HAS_HEATER_2 + tail_e_to_p_pressure = block->e_to_p_pressure; + #endif #endif for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index ae24461fc..d2b349881 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -230,7 +230,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \ _menuItemNr = 0; - #define START_SCREEN() _START_SCREEN(0) + #define START_SCREEN() _START_SCREEN(NOOP) /** * START_MENU generates the init code for a menu function From 5051723c2e815ca9b166ceb7813b825570eb2960 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Jul 2016 14:02:59 -0700 Subject: [PATCH 311/580] Redraw after cursor correction in STATIC_ITEM --- Marlin/ultralcd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d0a9a5dd7..f50dd32eb 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -282,8 +282,10 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to // Used to print static text with no visible cursor. #define STATIC_ITEM(label, args...) \ if (_menuItemNr == _lineNr) { \ - if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) \ + if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) { \ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ + } \ if (lcdDrawUpdate) \ lcd_implementation_drawmenu_static(_drawLineNr, PSTR(label), ## args); \ } \ From 13dc619f43354ef686f0f9bc3819795a338b4adb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Jul 2016 15:08:56 -0700 Subject: [PATCH 312/580] Scroll static screens more simply --- Marlin/ultralcd.cpp | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index f50dd32eb..40717e218 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -214,18 +214,18 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to * START_SCREEN generates the init code for a screen function * * encoderLine is the position based on the encoder - * currentMenuViewOffset is the top menu line to display + * encoderTopLine is the top menu line to display * _drawLineNr is the index of the LCD line (0-3) * _lineNr is the menu item to draw and process * _menuItemNr is the index of each MENU_ITEM */ - #define _START_SCREEN(CODE) do { \ + #define _START_SCREEN(CODE) \ ENCODER_DIRECTION_MENUS(); \ encoderRateMultiplierEnabled = false; \ if (encoderPosition > 0x8000) encoderPosition = 0; \ uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ - NOMORE(currentMenuViewOffset, encoderLine); \ - uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ + NOMORE(encoderTopLine, encoderLine); \ + uint8_t _lineNr = encoderTopLine, _menuItemNr; \ CODE; \ for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \ _menuItemNr = 0; @@ -292,19 +292,25 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to _menuItemNr++ #define END_SCREEN() \ - if (encoderLine >= _menuItemNr) { \ - encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; \ - encoderLine = _menuItemNr - 1; \ - } \ - if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { \ - currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; \ - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ - _lineNr = currentMenuViewOffset - 1; \ - _drawLineNr = -1; \ - } \ - } } while(0) + } \ + NOMORE(encoderLine, _menuItemNr - LCD_HEIGHT); \ + NOLESS(encoderLine, 0); \ + encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \ + if (encoderTopLine != encoderLine) { \ + encoderTopLine = encoderLine; \ + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ + } - #define END_MENU() END_SCREEN() + #define END_MENU() \ + } \ + if (encoderLine >= _menuItemNr) { \ + encoderLine = _menuItemNr - 1; \ + encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \ + } \ + if (encoderLine >= encoderTopLine + LCD_HEIGHT) { \ + encoderTopLine = encoderLine - (LCD_HEIGHT - 1); \ + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ + } #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -342,7 +348,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to #if ENABLED(LCD_HAS_SLOW_BUTTONS) volatile uint8_t slow_buttons; // Bits of the pressed buttons. #endif - uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ + int8_t encoderTopLine; /* scroll offset in the current menu */ millis_t next_button_update_ms; uint8_t lastEncoderBits; uint32_t encoderPosition; @@ -1888,13 +1894,13 @@ void kill_screen(const char* lcd_msg) { #if !PIN_EXISTS(SD_DETECT) static void lcd_sd_refresh() { card.initsd(); - currentMenuViewOffset = 0; + encoderTopLine = 0; } #endif static void lcd_sd_updir() { card.updir(); - currentMenuViewOffset = 0; + encoderTopLine = 0; } /** From 3a67fb77b08e6b7d51a5aae274f4a6b9ca79158a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Jul 2016 18:14:31 -0700 Subject: [PATCH 313/580] Concatenate LCD static strings --- Marlin/dogm_lcd_implementation.h | 8 ++++---- Marlin/ultralcd_implementation_hitachi_HD44780.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 16c48e7be..bfb18589e 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -494,13 +494,13 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd_print(' '); n--; } } - while (c = pgm_read_byte(pstr)) { + while (n > 0 && (c = pgm_read_byte(pstr))) { n -= lcd_print(c); pstr++; } - if (valstr) { - lcd_print(valstr); - n -= lcd_strlen(valstr); + if (valstr) while (n > 0 && (c = *valstr)) { + n -= lcd_print(c); + valstr++; } while (n-- > 0) lcd_print(' '); } diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 7f7bee549..f1838a6f7 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -838,13 +838,13 @@ static void lcd_implementation_status_screen() { int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd.print(' '); n--; } } - while ((c = pgm_read_byte(pstr)) && n > 0) { + while (n > 0 && (c = pgm_read_byte(pstr))) { n -= lcd_print(c); pstr++; } - if (valstr) { - lcd_print(valstr); - n -= lcd_strlen(valstr); + if (valstr) while (n > 0 && (c = *valstr)) { + n -= lcd_print(c); + valstr++; } while (n-- > 0) lcd.print(' '); } From 85aeb02aa6efbc05bf3de6c5b4d800a02b221b61 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Jul 2016 18:18:40 -0700 Subject: [PATCH 314/580] Invert headings on Graphical LCD --- Marlin/dogm_lcd_implementation.h | 8 ++++--- Marlin/ultralcd.cpp | 24 +++++++++---------- .../ultralcd_implementation_hitachi_HD44780.h | 3 ++- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index bfb18589e..10a52ba38 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -485,11 +485,13 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE) - static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char* valstr=NULL, bool center=true) { + static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) { + + lcd_implementation_mark_as_selected(row, invert); + char c; int8_t n = LCD_WIDTH; - u8g.setPrintPos(0, (row + 1) * (DOG_CHAR_HEIGHT)); - u8g.setColorIndex(1); // normal text + if (center && !valstr) { int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd_print(' '); n--; } diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 40717e218..23e70d245 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1965,9 +1965,9 @@ void kill_screen(const char* lcd_msg) { if (LCD_CLICKED) lcd_goto_previous_menu(true); START_SCREEN(); - STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", itostr3left(stats.totalPrints)); // Print Count : 999 - STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", itostr3left(stats.finishedPrints)); // Finished : 666 - STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", printTime); // Total Time : 12:34 + STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count : 999 + STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", false, false, itostr3left(stats.finishedPrints)); // Finished : 666 + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false, printTime); // Total Time : 12:34 END_SCREEN(); } #endif // PRINTCOUNTER @@ -2032,7 +2032,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_info_board_menu() { if (LCD_CLICKED) lcd_goto_previous_menu(true); START_SCREEN(); - STATIC_ITEM(BOARD_NAME); // MyPrinterController + STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE)); // Baud: 250000 STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION); // Protocol: 1.0 #ifdef POWER_SUPPLY @@ -2053,7 +2053,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_info_printer_menu() { if (LCD_CLICKED) lcd_goto_previous_menu(true); START_SCREEN(); - STATIC_ITEM(MSG_MARLIN); // Marlin + STATIC_ITEM(MSG_MARLIN, true, true); // Marlin STATIC_ITEM(SHORT_BUILD_VERSION); // x.x.x-Branch STATIC_ITEM(STRING_DISTRIBUTION_DATE); // YYYY-MM-DD HH:MM STATIC_ITEM(MACHINE_NAME); // My3DPrinter @@ -2095,7 +2095,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_filament_change_option_menu() { START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); #endif MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_filament_change_resume_print); MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_EXTRUDE, lcd_filament_change_extrude_more); @@ -2104,7 +2104,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_filament_change_init_message() { START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1); #ifdef MSG_FILAMENT_CHANGE_INIT_2 STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2); @@ -2117,7 +2117,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_filament_change_unload_message() { START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1); #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2 STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2); @@ -2130,7 +2130,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_filament_change_insert_message() { START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1); #ifdef MSG_FILAMENT_CHANGE_INSERT_2 STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2); @@ -2143,7 +2143,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_filament_change_load_message() { START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1); #ifdef MSG_FILAMENT_CHANGE_LOAD_2 STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2); @@ -2156,7 +2156,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_filament_change_extrude_message() { START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_1); #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_2 STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_2); @@ -2169,7 +2169,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_filament_change_resume_message() { START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true); STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1); #ifdef MSG_FILAMENT_CHANGE_RESUME_2 STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_2); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index f1838a6f7..24d48b1a9 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -830,7 +830,8 @@ static void lcd_implementation_status_screen() { #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE) - static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char *valstr=NULL, bool center=true) { + static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char *valstr=NULL) { + UNUSED(invert); char c; int8_t n = LCD_WIDTH; lcd.setCursor(0, row); From d2099fef0d57c40347126eb9156ed979217a75c9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Jul 2016 18:20:15 -0700 Subject: [PATCH 315/580] Left-justify thermistor info --- Marlin/ultralcd.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 23e70d245..2aca7d9c1 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1982,44 +1982,44 @@ void kill_screen(const char* lcd_msg) { START_SCREEN(); #define THERMISTOR_ID TEMP_SENSOR_0 #include "thermistornames.h" - STATIC_ITEM("T0: " THERMISTOR_NAME); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP)); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP)); + STATIC_ITEM("T0: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP), false); #if TEMP_SENSOR_1 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_1 #include "thermistornames.h" - STATIC_ITEM("T1: " THERMISTOR_NAME); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP)); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP)); + STATIC_ITEM("T1: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP), false); #endif #if TEMP_SENSOR_2 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_2 #include "thermistornames.h" - STATIC_ITEM("T2: " THERMISTOR_NAME); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP)); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP)); + STATIC_ITEM("T2: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP), false); #endif #if TEMP_SENSOR_3 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_3 #include "thermistornames.h" - STATIC_ITEM("T3: " THERMISTOR_NAME); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP)); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP)); + STATIC_ITEM("T3: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP), false); #endif #if TEMP_SENSOR_BED != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED #include "thermistornames.h" - STATIC_ITEM("TBed:" THERMISTOR_NAME); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP)); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP)); + STATIC_ITEM("TBed:" THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP), false); #endif END_SCREEN(); } From d9f75f62c07146d394ae0201675e55ce29c22e5d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 12:06:47 -0700 Subject: [PATCH 316/580] START_ROW => START_COL --- Marlin/dogm_lcd_implementation.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 10a52ba38..5cf08fd02 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -135,7 +135,7 @@ #define TALL_FONT_CORRECTION 0 #endif -#define START_ROW 0 +#define START_COL 0 // LCD selection #if ENABLED(U8GLIB_ST7920) @@ -480,7 +480,7 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { else { u8g.setColorIndex(1); // unmarked text is black on white } - u8g.setPrintPos((START_ROW) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)); + u8g.setPrintPos((START_COL) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)); } #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE) @@ -490,7 +490,7 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { lcd_implementation_mark_as_selected(row, invert); char c; - int8_t n = LCD_WIDTH; + int8_t n = LCD_WIDTH - (START_COL); if (center && !valstr) { int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2; @@ -513,7 +513,7 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co UNUSED(pre_char); char c; - uint8_t n = LCD_WIDTH - 2; + uint8_t n = LCD_WIDTH - (START_COL) - 2; lcd_implementation_mark_as_selected(row, isSelected); @@ -530,7 +530,7 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) { char c; uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data))); - uint8_t n = LCD_WIDTH - 2 - vallen; + uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen; lcd_implementation_mark_as_selected(row, isSelected); @@ -570,7 +570,7 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) { uint8_t rows = 1; - uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH; + uint8_t lcd_width = LCD_WIDTH - (START_COL), char_width = DOG_CHAR_WIDTH; uint8_t vallen = lcd_strlen(value); #if ENABLED(USE_BIG_EDIT_FONT) @@ -604,7 +604,7 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) { static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char* const longFilename, bool isDir) { UNUSED(pstr); char c; - uint8_t n = LCD_WIDTH - 1; + uint8_t n = LCD_WIDTH - (START_COL) - 1; if (longFilename[0]) { filename = longFilename; From 31f2cf5f6f66d101f29a1ab4d1a6c3210d281527 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 12:25:53 -0700 Subject: [PATCH 317/580] Make encoderLine signed for proper compares --- Marlin/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 2aca7d9c1..21ffdc1fe 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -223,7 +223,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to ENCODER_DIRECTION_MENUS(); \ encoderRateMultiplierEnabled = false; \ if (encoderPosition > 0x8000) encoderPosition = 0; \ - uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ + int8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ NOMORE(encoderTopLine, encoderLine); \ uint8_t _lineNr = encoderTopLine, _menuItemNr; \ CODE; \ From 155af6b861e03c6a836fe083e60c9c708430c178 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 12:26:20 -0700 Subject: [PATCH 318/580] Rename vars, add comments for menu macros --- Marlin/ultralcd.cpp | 66 +++++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 21ffdc1fe..bafe0ca3a 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -215,9 +215,9 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to * * encoderLine is the position based on the encoder * encoderTopLine is the top menu line to display - * _drawLineNr is the index of the LCD line (0-3) - * _lineNr is the menu item to draw and process - * _menuItemNr is the index of each MENU_ITEM + * _lcdLineNr is the index of the LCD line (e.g., 0-3) + * _menuLineNr is the menu item to draw and process + * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM */ #define _START_SCREEN(CODE) \ ENCODER_DIRECTION_MENUS(); \ @@ -225,10 +225,10 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to if (encoderPosition > 0x8000) encoderPosition = 0; \ int8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ NOMORE(encoderTopLine, encoderLine); \ - uint8_t _lineNr = encoderTopLine, _menuItemNr; \ + int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ CODE; \ - for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \ - _menuItemNr = 0; + for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \ + _thisItemNr = 0; #define START_SCREEN() _START_SCREEN(0) @@ -260,40 +260,53 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) * */ - #define _MENU_ITEM_PART_1(type, label, args...) \ - if (_menuItemNr == _lineNr) { \ + #define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \ + if (_menuLineNr == _thisItemNr) { \ if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_ ## type(encoderLine == _menuItemNr, _drawLineNr, PSTR(label), ## args); \ - if (wasClicked && encoderLine == _menuItemNr) { \ + lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## ARGS); \ + if (wasClicked && encoderLine == _thisItemNr) { \ lcd_quick_feedback() - #define _MENU_ITEM_PART_2(type, args...) \ - menu_action_ ## type(args); \ + #define _MENU_ITEM_PART_2(TYPE, ARGS...) \ + menu_action_ ## TYPE(ARGS); \ return; \ } \ } \ - _menuItemNr++ + _thisItemNr++ - #define MENU_ITEM(type, label, args...) do { \ - _MENU_ITEM_PART_1(type, label, ## args); \ - _MENU_ITEM_PART_2(type, ## args); \ + #define MENU_ITEM(TYPE, LABEL, ARGS...) do { \ + _MENU_ITEM_PART_1(TYPE, LABEL, ## ARGS); \ + _MENU_ITEM_PART_2(TYPE, ## ARGS); \ } while(0) // Used to print static text with no visible cursor. - #define STATIC_ITEM(label, args...) \ - if (_menuItemNr == _lineNr) { \ - if (encoderLine == _menuItemNr && _menuItemNr < LCD_HEIGHT - 1) { \ + #define STATIC_ITEM(LABEL, ARGS...) \ + if (_menuLineNr == _thisItemNr) { \ + if (encoderLine == _thisItemNr && _thisItemNr < LCD_HEIGHT - 1) { \ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ } \ if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_static(_drawLineNr, PSTR(label), ## args); \ + lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## ARGS); \ } \ - _menuItemNr++ + _thisItemNr++ + /** + * + * END_SCREEN Closing code for a screen having only static items. + * Do simplified scrolling of the entire screen. + * + * END_MENU Closing code for a screen with menu items. + * Scroll as-needed to keep the selected line in view. + * + * At this point _thisItemNr equals the total number of items. + * + */ + + // Simple-scroll by using encoderLine as encoderTopLine #define END_SCREEN() \ } \ - NOMORE(encoderLine, _menuItemNr - LCD_HEIGHT); \ + NOMORE(encoderLine, _thisItemNr - LCD_HEIGHT); \ NOLESS(encoderLine, 0); \ encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \ if (encoderTopLine != encoderLine) { \ @@ -301,10 +314,11 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ } + // Scroll through menu items, scrolling as-needed to stay in view #define END_MENU() \ } \ - if (encoderLine >= _menuItemNr) { \ - encoderLine = _menuItemNr - 1; \ + if (encoderLine >= _thisItemNr) { \ + encoderLine = _thisItemNr - 1; \ encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \ } \ if (encoderLine >= encoderTopLine + LCD_HEIGHT) { \ @@ -328,7 +342,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to #endif //ENCODER_RATE_MULTIPLIER - #define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0) + #define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0) #define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) #define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1925,7 +1939,7 @@ void kill_screen(const char* lcd_msg) { } for (uint16_t i = 0; i < fileCnt; i++) { - if (_menuItemNr == _lineNr) { + if (_menuLineNr == _thisItemNr) { card.getfilename( #if ENABLED(SDCARD_RATHERRECENTFIRST) fileCnt-1 - From 7ae84d768e14f4c7d710c6adf34e3ab9180b5be2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2016 14:16:57 -0700 Subject: [PATCH 319/580] Tweak conditionals for REPRAPWORLD_KEYPAD --- Marlin/Conditionals.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 410801450..ea7307777 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -118,12 +118,7 @@ #define REPRAP_DISCOUNT_SMART_CONTROLLER #endif - #if ENABLED(ULTIMAKERCONTROLLER) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL) || ENABLED(RIGIDBOT_PANEL) - #define ULTIPANEL - #define NEWPANEL - #endif - - #if ENABLED(REPRAPWORLD_KEYPAD) + #if ENABLED(ULTIMAKERCONTROLLER) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL) || ENABLED(RIGIDBOT_PANEL) || ENABLED(REPRAPWORLD_KEYPAD) #define ULTIPANEL #define NEWPANEL #endif From 096f9981d159cb24c56748ab36a998004abbe9a5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Jul 2016 17:41:53 -0700 Subject: [PATCH 320/580] Scroll to the top when changing screens --- Marlin/ultralcd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index bafe0ca3a..d3e8f2609 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -398,6 +398,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to if (currentScreen != screen) { currentScreen = screen; lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; + encoderTopLine = 0; #if ENABLED(NEWPANEL) encoderPosition = encoder; if (feedback) lcd_quick_feedback(); From d17b161832db2227b534e48ae3a87b83497648ad Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Jul 2016 17:53:11 -0700 Subject: [PATCH 321/580] Don't draw current screen if simply changing screens --- Marlin/ultralcd.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d3e8f2609..bd412bab3 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -677,6 +677,7 @@ void kill_screen(const char* lcd_msg) { long babysteps_done = 0; static void _lcd_babystep(const AxisEnum axis, const char* msg) { + if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR; @@ -689,7 +690,6 @@ void kill_screen(const char* lcd_msg) { lcd_implementation_drawedit(msg, ftostr43sign( ((1000 * babysteps_done) / planner.axis_steps_per_mm[axis]) * 0.001f )); - if (LCD_CLICKED) lcd_goto_previous_menu(true); } #if ENABLED(BABYSTEP_XY) @@ -1344,6 +1344,7 @@ void kill_screen(const char* lcd_msg) { float move_menu_scale; static void _lcd_move_xyz(const char* name, AxisEnum axis, float min, float max) { + if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { refresh_cmd_timeout(); @@ -1355,7 +1356,6 @@ void kill_screen(const char* lcd_msg) { lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr41sign(current_position[axis])); - if (LCD_CLICKED) lcd_goto_previous_menu(true); } #if ENABLED(DELTA) static float delta_clip_radius_2 = (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS); @@ -1372,6 +1372,7 @@ void kill_screen(const char* lcd_msg) { int8_t eindex = -1 #endif ) { + if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale; @@ -1401,7 +1402,6 @@ void kill_screen(const char* lcd_msg) { #endif //EXTRUDERS > 1 lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS])); } - if (LCD_CLICKED) lcd_goto_previous_menu(true); } #if EXTRUDERS > 1 @@ -1860,6 +1860,7 @@ void kill_screen(const char* lcd_msg) { */ #if HAS_LCD_CONTRAST static void lcd_set_contrast() { + if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { set_lcd_contrast(lcd_contrast + encoderPosition); @@ -1875,7 +1876,6 @@ void kill_screen(const char* lcd_msg) { #endif ); } - if (LCD_CLICKED) lcd_goto_previous_menu(true); } #endif // HAS_LCD_CONTRAST @@ -1967,10 +1967,12 @@ void kill_screen(const char* lcd_msg) { #if ENABLED(PRINTCOUNTER) /** * - * About Printer > Stastics submenu + * About Printer > Statistics submenu * */ static void lcd_info_stats_menu() { + if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } + PrintCounter print_job_counter = PrintCounter(); print_job_counter.loadStats(); printStatistics stats = print_job_counter.getStats(); @@ -1978,7 +1980,6 @@ void kill_screen(const char* lcd_msg) { char printTime[6]; sprintf(printTime, "%02d:%02d", int(stats.printTime / 60), int(stats.printTime % 60)); - if (LCD_CLICKED) lcd_goto_previous_menu(true); START_SCREEN(); STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count : 999 STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", false, false, itostr3left(stats.finishedPrints)); // Finished : 666 @@ -1993,7 +1994,7 @@ void kill_screen(const char* lcd_msg) { * */ static void lcd_info_thermistors_menu() { - if (LCD_CLICKED) lcd_goto_previous_menu(true); + if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } START_SCREEN(); #define THERMISTOR_ID TEMP_SENSOR_0 #include "thermistornames.h" @@ -2045,7 +2046,7 @@ void kill_screen(const char* lcd_msg) { * */ static void lcd_info_board_menu() { - if (LCD_CLICKED) lcd_goto_previous_menu(true); + if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } START_SCREEN(); STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE)); // Baud: 250000 @@ -2066,7 +2067,7 @@ void kill_screen(const char* lcd_msg) { * */ static void lcd_info_printer_menu() { - if (LCD_CLICKED) lcd_goto_previous_menu(true); + if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } START_SCREEN(); STATIC_ITEM(MSG_MARLIN, true, true); // Marlin STATIC_ITEM(SHORT_BUILD_VERSION); // x.x.x-Branch From 11dcbae7a2954acc2add6448eda66e848d665fff Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 22:06:44 -0700 Subject: [PATCH 322/580] Only a single E axis. Can tool-change reseed position[E_AXIS]? --- Marlin/temperature.cpp | 26 ++++++++++++++------------ Marlin/temperature.h | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 1aff9b37e..aa0ff7909 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -128,7 +128,7 @@ volatile bool Temperature::temp_meas_ready = false; #if ENABLED(PID_ADD_EXTRUSION_RATE) float Temperature::cTerm[HOTENDS]; - long Temperature::last_position[HOTENDS]; + long Temperature::last_e_position; long Temperature::lpq[LPQ_MAX_LEN]; int Temperature::lpq_ptr = 0; #endif @@ -444,11 +444,11 @@ Temperature::Temperature() { } void Temperature::updatePID() { #if ENABLED(PIDTEMP) + #if ENABLED(PID_ADD_EXTRUSION_RATE) + last_e_position = 0; + #endif HOTEND_LOOP() { temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e); - #if ENABLED(PID_ADD_EXTRUSION_RATE) - last_position[e] = 0; - #endif } #endif #if ENABLED(PIDTEMPBED) @@ -531,10 +531,8 @@ float Temperature::get_pid_output(int e) { #if HOTENDS == 1 UNUSED(e); #define _HOTEND_TEST true - #define _HOTEND_EXTRUDER active_extruder #else #define _HOTEND_TEST e == active_extruder - #define _HOTEND_EXTRUDER e #endif float pid_output; #if ENABLED(PIDTEMP) @@ -566,14 +564,14 @@ float Temperature::get_pid_output(int e) { cTerm[HOTEND_INDEX] = 0; if (_HOTEND_TEST) { long e_position = stepper.position(E_AXIS); - if (e_position > last_position[_HOTEND_EXTRUDER]) { - lpq[lpq_ptr++] = e_position - last_position[_HOTEND_EXTRUDER]; - last_position[_HOTEND_EXTRUDER] = e_position; + if (e_position > last_e_position) { + lpq[lpq_ptr] = e_position - last_e_position; + last_e_position = e_position; } else { - lpq[lpq_ptr++] = 0; + lpq[lpq_ptr] = 0; } - if (lpq_ptr >= lpq_len) lpq_ptr = 0; + if (++lpq_ptr >= lpq_len) lpq_ptr = 0; cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX); pid_output += cTerm[HOTEND_INDEX]; } @@ -952,7 +950,7 @@ void Temperature::init() { temp_iState_min[e] = 0.0; temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e); #if ENABLED(PID_ADD_EXTRUSION_RATE) - last_position[e] = 0; + last_e_position = 0; #endif #endif //PIDTEMP #if ENABLED(PIDTEMPBED) @@ -961,6 +959,10 @@ void Temperature::init() { #endif //PIDTEMPBED } + #if ENABLED(PIDTEMP) && ENABLED(PID_ADD_EXTRUSION_RATE) + last_e_position = 0; + #endif + #if HAS_HEATER_0 SET_OUTPUT(HEATER_0_PIN); #endif diff --git a/Marlin/temperature.h b/Marlin/temperature.h index dbb434362..6c2c3e582 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -150,7 +150,7 @@ class Temperature { #if ENABLED(PID_ADD_EXTRUSION_RATE) static float cTerm[HOTENDS]; - static long last_position[HOTENDS]; + static long last_e_position; static long lpq[LPQ_MAX_LEN]; static int lpq_ptr; #endif From bf9967c65d21a354d0bdbfff76f942beb13037c3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 22:07:43 -0700 Subject: [PATCH 323/580] Apply HOTEND_INDEX in MILLISECONDS_PREHEAT_TIME --- Marlin/temperature.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 6c2c3e582..6e4419aca 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -306,9 +306,9 @@ class Temperature { #endif #ifdef MILLISECONDS_PREHEAT_TIME if (celsius == 0.0f) - reset_preheat_time(hotend); - else if (target_temperature[hotend] == 0.0f) - start_preheat_time(hotend); + reset_preheat_time(HOTEND_INDEX); + else if (target_temperature[HOTEND_INDEX] == 0.0f) + start_preheat_time(HOTEND_INDEX); #endif target_temperature[HOTEND_INDEX] = celsius; #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 From 3d78b690e56bcbc31639297cf3a175c5d50caece Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 22:08:14 -0700 Subject: [PATCH 324/580] Single PID dataset with HOTENDS == 1 --- Marlin/temperature.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 6e4419aca..6fa7821f2 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -76,13 +76,13 @@ class Temperature { #if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_HOTEND) + #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 static float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS]; #if ENABLED(PID_ADD_EXTRUSION_RATE) static float Kc[HOTENDS]; #endif - #define PID_PARAM(param, e) Temperature::param[e] + #define PID_PARAM(param, h) Temperature::param[h] #else @@ -90,7 +90,7 @@ class Temperature { #if ENABLED(PID_ADD_EXTRUSION_RATE) static float Kc; #endif - #define PID_PARAM(param, e) Temperature::param + #define PID_PARAM(param, h) Temperature::param #endif // PID_PARAMS_PER_HOTEND From 809da999dcf16ce54354b420e7828e522dd9339d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Jul 2016 22:08:47 -0700 Subject: [PATCH 325/580] Apply HOTEND_INDEX in preheat methods --- Marlin/temperature.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 6fa7821f2..fd737bc6a 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -247,11 +247,24 @@ class Temperature { * Preheating hotends */ #ifdef MILLISECONDS_PREHEAT_TIME - static bool is_preheating(uint8_t hotend) { - return preheat_end_time[hotend] && PENDING(millis(), preheat_end_time[hotend]); + static bool is_preheating(uint8_t e) { + #if HOTENDS == 1 + UNUSED(e); + #endif + return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]); + } + static void start_preheat_time(uint8_t e) { + #if HOTENDS == 1 + UNUSED(e); + #endif + preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME; + } + static void reset_preheat_time(uint8_t e) { + #if HOTENDS == 1 + UNUSED(e); + #endif + preheat_end_time[HOTEND_INDEX] = 0; } - static void start_preheat_time(uint8_t hotend) { preheat_end_time[hotend] = millis() + MILLISECONDS_PREHEAT_TIME; } - static void reset_preheat_time(uint8_t hotend) { preheat_end_time[hotend] = 0; } #else #define is_preheating(n) (false) #endif From 9b5cbf242399bbf3b4f319a71ccf6cbaeea81b78 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Tue, 12 Jul 2016 17:48:40 +0900 Subject: [PATCH 326/580] Follow-up the PR #4271 (X_DUAL_STEPPER_DRIVERS) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update a forgotten Configuration_adv.h of K8400 --- .../K8400/Configuration_adv.h | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 12a924d1f..ba78a1589 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -229,11 +229,28 @@ //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. +// Dual X Steppers +// Uncomment this option to drive two X axis motors. +// The next unused E driver will be assigned to the second X stepper. +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + // Set true if the two X motors need to rotate in opposite directions + #define INVERT_X2_VS_X_DIR true +#endif + + +// Dual Y Steppers +// Uncomment this option to drive two Y axis motors. +// The next unused E driver will be assigned to the second Y stepper. +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + // Set true if the two Y motors need to rotate in opposite directions + #define INVERT_Y2_VS_Y_DIR true +#endif + // A single Z stepper driver is usually used to drive 2 stepper motors. -// Uncomment this define to utilize a separate stepper driver for each Z axis motor. -// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used -// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards. -// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. +// Uncomment this option to use a separate stepper driver for each Z axis motor. +// The next unused E driver will be assigned to the second Z stepper. //#define Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS) @@ -255,14 +272,6 @@ #endif // Z_DUAL_STEPPER_DRIVERS -// Same again but for Y Axis. -//#define Y_DUAL_STEPPER_DRIVERS - -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - // Define if the two Y drives need to rotate in opposite directions - #define INVERT_Y2_VS_Y_DIR true -#endif - // Enable this for dual x-carriage printers. // A dual x-carriage design has the advantage that the inactive extruder can be parked which // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage From 87957c7b44ea5db4c0f00c33dde184af4510f5f5 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 12 Jul 2016 13:13:04 +0200 Subject: [PATCH 327/580] Finalalize MSG_SD_WRITE_TO_FILE message with a \n Finalalize MSG_SD_WRITE_TO_FILE message with a \n else RH hangs. --- Marlin/cardreader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 4b7aaf676..c7e160481 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -416,6 +416,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { else { saving = true; SERIAL_PROTOCOLPAIR(MSG_SD_WRITE_TO_FILE, name); + SERIAL_EOL; lcd_setstatus(fname); } } From 54d35230df8e89277ece36c708f4be5179c29115 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 12 Jul 2016 19:59:03 +0200 Subject: [PATCH 328/580] Don't use UTF-strlen() if the text is not UTF --- Marlin/ultralcd.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index b39617c15..267fc213a 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2481,7 +2481,11 @@ void lcd_init() { int lcd_strlen(const char* s) { int i = 0, j = 0; while (s[i]) { - if ((s[i] & 0xc0) != 0x80) j++; + #ifdef MAPPER_NON + j++; + #else + if ((s[i] & 0xc0) != 0x80) j++; + #endif i++; } return j; @@ -2490,7 +2494,11 @@ int lcd_strlen(const char* s) { int lcd_strlen_P(const char* s) { int j = 0; while (pgm_read_byte(s)) { - if ((pgm_read_byte(s) & 0xc0) != 0x80) j++; + #ifdef MAPPER_NON + j++; + #else + if ((pgm_read_byte(s) & 0xc0) != 0x80) j++; + #endif s++; } return j; From b27373696261f52ba63418762bc1bb53bf219195 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 12 Jul 2016 19:42:42 +0200 Subject: [PATCH 329/580] Make MAPPER_NON the fall back mapper Make MAPPER_NON the fall back mapper - if no other is defined. One list less to maintain. --- Marlin/language_an.h | 1 - Marlin/language_ca.h | 1 - Marlin/language_cn.h | 2 -- Marlin/language_cz.h | 1 - Marlin/language_en.h | 4 ---- Marlin/language_es.h | 1 - Marlin/language_eu.h | 1 - Marlin/language_fr.h | 1 - Marlin/language_hr.h | 1 - Marlin/language_it.h | 1 - Marlin/language_kana.h | 1 - Marlin/language_nl.h | 1 - Marlin/language_pl.h | 1 - Marlin/language_pt-br.h | 1 - Marlin/language_pt-br_utf8.h | 1 - Marlin/language_pt.h | 1 - Marlin/language_pt_utf8.h | 1 - Marlin/language_test.h | 3 +-- Marlin/utf_mapper.h | 18 ++++++++---------- 19 files changed, 9 insertions(+), 33 deletions(-) diff --git a/Marlin/language_an.h b/Marlin/language_an.h index 968fa5168..37ae982e1 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_AN_H #define LANGUAGE_AN_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 9c2ba49d3..1c2e4924b 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_CA_H #define LANGUAGE_CA_H -//#define MAPPER_NON #define MAPPER_C2C3 // because of "ó" // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index e2306a401..de52af44f 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -29,8 +29,6 @@ */ #ifndef LANGUAGE_CN_H #define LANGUAGE_CN_H - -#define MAPPER_NON // For direct ascii codes #define DISPLAY_CHARSET_ISO10646_CN #define WELCOME_MSG "\xa4\xa5\xa6\xa7" diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index a4bfdf933..030b92e85 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -34,7 +34,6 @@ #ifndef LANGUAGE_CZ_H #define LANGUAGE_CZ_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 57bc4a5fa..a1612bdf2 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -35,10 +35,6 @@ #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. #endif -#if DISABLED(MAPPER_NON) && DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_D0D1) && DISABLED(MAPPER_D0D1_MOD) && DISABLED(MAPPER_E382E383) && DISABLED(MAPPER_CECF) - #define MAPPER_NON // For direct ascii codes -#endif - #ifndef WELCOME_MSG #define WELCOME_MSG MACHINE_NAME " ready." #endif diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 9722ccd2e..c5b3e0e7a 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_ES_H #define LANGUAGE_ES_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index f87ac2f1c..361fe0c45 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_EU_H #define LANGUAGE_EU_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index f22abce00..63bba3c3f 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_FR_H #define LANGUAGE_FR_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h index d48e58ccb..e6ebe7db8 100644 --- a/Marlin/language_hr.h +++ b/Marlin/language_hr.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_HR_H #define LANGUAGE_HR_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 481b725ab..a8e08391f 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_IT_H #define LANGUAGE_IT_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 7eb6f592a..3a824e9ae 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -31,7 +31,6 @@ #ifndef LANGUAGE_KANA_H #define LANGUAGE_KANA_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h #define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_KANA diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index c74ad8fbd..4dd07d82e 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_NL_H #define LANGUAGE_NL_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 9c38a6db5..71d664c3c 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_PL_H #define LANGUAGE_PL_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index cc37f31da..e9f27ecc8 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_PT_BR_H #define LANGUAGE_PT_BR_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index feb38b496..2909b3d55 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_PT_BR_UTF_H #define LANGUAGE_PT_BR_UTF_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 4c857a7c1..2e88f1192 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_PT_H #define LANGUAGE_PT_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h index c2fab4d63..9040951b3 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -30,7 +30,6 @@ #ifndef LANGUAGE_PT_UTF_H #define LANGUAGE_PT_UTF_H -#define MAPPER_NON // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT #define DISPLAY_CHARSET_ISO10646_1 diff --git a/Marlin/language_test.h b/Marlin/language_test.h index d2f99f687..ea1b0c4db 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -46,11 +46,10 @@ // Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not // impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). - -#define MAPPER_NON // For direct ascii codes ( until now all languages except ru, de, fi, kana_utf8, ... ) //#define MAPPER_C2C3 // For most European languages when language file is in utf8 //#define MAPPER_D0D1 // For Cyrillic //#define MAPPER_E382E383 // For Katakana +//#define MAPPER_NON // For direct ascii codes. Fall back mapper - if no other is defined. // Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h //#define SIMULATE_ROMFONT diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h index 829741756..bba85e180 100644 --- a/Marlin/utf_mapper.h +++ b/Marlin/utf_mapper.h @@ -146,14 +146,7 @@ #endif // DISPLAY_CHARSET_HD44780 #endif // SIMULATE_ROMFONT -#if ENABLED(MAPPER_NON) - - char charset_mapper(char c) { - HARDWARE_CHAR_OUT( c ); - return 1; - } - -#elif ENABLED(MAPPER_C2C3) +#if ENABLED(MAPPER_C2C3) char charset_mapper(char c) { static uint8_t utf_hi_char; // UTF-8 high part @@ -353,8 +346,13 @@ #else - #error "You have to define one of the DISPLAY_INPUT_CODE_MAPPERs in your language_xx.h file" // should not occur because (en) will set. + #define MAPPER_NON + + char charset_mapper(char c) { + HARDWARE_CHAR_OUT( c ); + return 1; + } -#endif // code mappers + #endif // code mappers #endif // UTF_MAPPER_H From e974ac63ef3ca13a1d1589d8faf61bf65267f24a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2016 15:55:27 -0700 Subject: [PATCH 330/580] Init matrix in planner.init --- Marlin/planner.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index b742dfe6e..4fab83045 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -129,18 +129,16 @@ float Planner::previous_nominal_speed; * Class and Instance Methods */ -Planner::Planner() { - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - bed_level_matrix.set_to_identity(); - #endif - init(); -} +Planner::Planner() { init(); } void Planner::init() { block_buffer_head = block_buffer_tail = 0; memset(position, 0, sizeof(position)); // clear position for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = 0.0; previous_nominal_speed = 0.0; + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + bed_level_matrix.set_to_identity(); + #endif } /** From db0882d0683f7eb65335daa3f43ed380923f0af4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2016 15:55:45 -0700 Subject: [PATCH 331/580] AUTO_BED_LEVELING_3POINT and DELTA_BED_LEVELING_GRID --- Marlin/Conditionals.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 410801450..7e64118cc 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -818,6 +818,16 @@ #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_3 #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0 #endif + #if ENABLED(AUTO_BED_LEVELING_GRID) + #define DELTA_BED_LEVELING_GRID + #endif + #endif + + /** + * When not using other bed leveling... + */ + #if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(AUTO_BED_LEVELING_GRID) && DISABLED(DELTA_BED_LEVELING_GRID) + #define AUTO_BED_LEVELING_3POINT #endif /** From 655c3fd55f0be533f5a2fb08915716c9f4e4568c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2016 15:57:04 -0700 Subject: [PATCH 332/580] Move delta ABL sanity checks up --- Marlin/SanityCheck.h | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 17d6cff5f..b9d117c46 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -202,11 +202,9 @@ #if ENABLED(MESH_BED_LEVELING) #if ENABLED(DELTA) #error "MESH_BED_LEVELING does not yet support DELTA printers." - #endif - #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #elif ENABLED(AUTO_BED_LEVELING_FEATURE) #error "Select AUTO_BED_LEVELING_FEATURE or MESH_BED_LEVELING, not both." - #endif - #if MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7 + #elif MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7 #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS need to be less than 8." #endif #elif ENABLED(MANUAL_BED_LEVELING) @@ -219,6 +217,10 @@ #if PROBE_SELECTED + #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA) + #error "You cannot use Z_PROBE_SLED with DELTA." + #endif + /** * NUM_SERVOS is required for a Z servo probe */ @@ -326,6 +328,13 @@ */ #if ENABLED(AUTO_BED_LEVELING_FEATURE) + /** + * Delta has limited bed leveling options + */ + #if ENABLED(DELTA) && DISABLED(AUTO_BED_LEVELING_GRID) + #error "You must use AUTO_BED_LEVELING_GRID for DELTA bed leveling." + #endif + /** * Require a Z min pin */ @@ -410,25 +419,6 @@ #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." #endif -/** - * Delta has limited bed leveling options - */ -#if ENABLED(DELTA) - - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - - #if DISABLED(AUTO_BED_LEVELING_GRID) - #error "Only AUTO_BED_LEVELING_GRID is supported with DELTA." - #endif - - #if ENABLED(Z_PROBE_SLED) - #error "You cannot use Z_PROBE_SLED with DELTA." - #endif - - #endif - -#endif - /** * Don't set more than one kinematic type */ From e9f62d8fdb9bbbae39aaf922cafc86692c846eaa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Jul 2016 17:28:58 -0700 Subject: [PATCH 333/580] Remove extraneous conditions for encoder position --- Marlin/ultralcd.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index b39617c15..00c9a05c6 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -398,11 +398,8 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to if (currentScreen != screen) { currentScreen = screen; lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; - encoderTopLine = 0; - #if ENABLED(NEWPANEL) - encoderPosition = encoder; - if (feedback) lcd_quick_feedback(); - #endif + encoderPosition = encoder; + if (feedback) lcd_quick_feedback(); if (screen == lcd_status_screen) { defer_return_to_status = false; screen_history_depth = 0; @@ -419,9 +416,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to inline void lcd_save_previous_menu() { if (screen_history_depth < COUNT(screen_history)) { screen_history[screen_history_depth].menu_function = currentScreen; - #if ENABLED(ULTIPANEL) - screen_history[screen_history_depth].encoder_position = encoderPosition; - #endif + screen_history[screen_history_depth].encoder_position = encoderPosition; ++screen_history_depth; } } @@ -429,10 +424,10 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to static void lcd_goto_previous_menu(bool feedback=false) { if (screen_history_depth > 0) { --screen_history_depth; - lcd_goto_screen(screen_history[screen_history_depth].menu_function, feedback - #if ENABLED(ULTIPANEL) - , screen_history[screen_history_depth].encoder_position - #endif + lcd_goto_screen( + screen_history[screen_history_depth].menu_function, + feedback, + screen_history[screen_history_depth].encoder_position ); } else @@ -2444,7 +2439,7 @@ void lcd_init() { SET_INPUT(BTN_RT); #endif - #else // Not NEWPANEL + #else // !NEWPANEL #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register pinMode(SR_DATA_PIN, OUTPUT); @@ -2459,7 +2454,7 @@ void lcd_init() { WRITE(SHIFT_EN, LOW); #endif // SR_LCD_2W_NL - #endif//!NEWPANEL + #endif // !NEWPANEL #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) SET_INPUT(SD_DETECT_PIN); @@ -2875,6 +2870,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } GET_BUTTON_STATES(buttons); #endif //!NEWPANEL + // Manage encoder rotation #if ENABLED(REVERSE_MENU_DIRECTION) && ENABLED(REVERSE_ENCODER_DIRECTION) #define ENCODER_DIFF_CW (encoderDiff -= encoderDirection) #define ENCODER_DIFF_CCW (encoderDiff += encoderDirection) @@ -2890,7 +2886,6 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } #endif #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: ENCODER_DIFF_CW; break; case _E2: ENCODER_DIFF_CCW; } - //manage encoder rotation uint8_t enc = 0; if (buttons & EN_A) enc |= B01; if (buttons & EN_B) enc |= B10; From ecd5e810accde02b14bbb5e1611da7c05dcdf0dc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2016 17:13:56 -0700 Subject: [PATCH 334/580] No delay for the smallest LCD moves --- Marlin/ultralcd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index b39617c15..d5c1a0479 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1303,12 +1303,14 @@ void kill_screen(const char* lcd_msg) { #endif // DELTA_CALIBRATION_MENU + float move_menu_scale; + /** * If the most recent manual move hasn't been fed to the planner yet, * and the planner can accept one, send immediately */ inline void manage_manual_move() { - if (manual_move_axis != (int8_t)NO_AXIS && millis() >= manual_move_start_time && !planner.is_full()) { + if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { #if ENABLED(DELTA) calculate_delta(current_position); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index); @@ -1331,7 +1333,7 @@ void kill_screen(const char* lcd_msg) { #if EXTRUDERS > 1 if (axis == E_AXIS) manual_move_e_index = eindex >= 0 ? eindex : active_extruder; #endif - manual_move_start_time = millis() + 500UL; // 1/2 second delay + manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves manual_move_axis = (int8_t)axis; } @@ -1341,8 +1343,6 @@ void kill_screen(const char* lcd_msg) { * */ - float move_menu_scale; - static void _lcd_move_xyz(const char* name, AxisEnum axis, float min, float max) { if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } ENCODER_DIRECTION_NORMAL(); From 9e8b3e5ee6bd7e64d05a170fb40721729106abbd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2016 17:39:22 -0700 Subject: [PATCH 335/580] Homing direction is irrelevant in probe raise! --- Marlin/Marlin_main.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5c302ac2f..a9fa8c84f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1707,12 +1707,6 @@ static void clean_up_after_endstop_or_probe_move() { /** * Raise Z to a minimum height to make room for a probe to move - * - * zprobe_zoffset: Negative of the Z height where the probe engages - * z_raise: The probing raise distance - * - * The zprobe_zoffset is negative for a switch below the nozzle, so - * multiply by Z_HOME_DIR (-1) to move enough away from the bed. */ inline void do_probe_raise(float z_raise) { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1723,7 +1717,7 @@ static void clean_up_after_endstop_or_probe_move() { #endif float z_dest = home_offset[Z_AXIS] + z_raise; - if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) + if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; if (z_dest > current_position[Z_AXIS]) From 1e14df876de58560e1f94fe63ab1a6b425a0dabf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2016 18:14:59 -0700 Subject: [PATCH 336/580] Use varname as prefix in DEBUG_POS, string as suffix --- Marlin/Marlin_main.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5c302ac2f..49e8ef2d9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -573,22 +573,23 @@ void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); static void report_current_position(); #if ENABLED(DEBUG_LEVELING_FEATURE) - void print_xyz(const char* suffix, const float x, const float y, const float z) { + void print_xyz(const char* prefix, const char* suffix, const float x, const float y, const float z) { + serialprintPGM(prefix); SERIAL_ECHOPAIR("(", x); SERIAL_ECHOPAIR(", ", y); SERIAL_ECHOPAIR(", ", z); - SERIAL_ECHOLNPGM(") "); - SERIAL_ECHO(suffix); + SERIAL_ECHOPGM(")"); + serialprintPGM(suffix); } - void print_xyz(const char* suffix, const float xyz[]) { - print_xyz(suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); + void print_xyz(const char* prefix,const char* suffix, const float xyz[]) { + print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); } #if ENABLED(AUTO_BED_LEVELING_FEATURE) - void print_xyz(const char* suffix, const vector_3 &xyz) { - print_xyz(suffix, xyz.x, xyz.y, xyz.z); + void print_xyz(const char* prefix,const char* suffix, const vector_3 &xyz) { + print_xyz(prefix, suffix, xyz.x, xyz.y, xyz.z); } #endif - #define DEBUG_POS(PREFIX,VAR) do{ SERIAL_ECHOPGM(PREFIX); print_xyz(" > " STRINGIFY(VAR), VAR); }while(0) + #define DEBUG_POS(SUFFIX,VAR) do{ print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0) #endif #if ENABLED(DELTA) || ENABLED(SCARA) @@ -1540,6 +1541,7 @@ static void set_axis_is_at_home(AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("> home_offset[axis]==", home_offset[axis]); + SERIAL_EOL; DEBUG_POS("", current_position); } #endif @@ -1653,7 +1655,7 @@ static void clean_up_after_endstop_or_probe_move() { float old_feedrate = feedrate; #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z); + if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z); #endif #if ENABLED(DELTA) @@ -4333,7 +4335,7 @@ inline void gcode_M104() { #if ENABLED(PRINTJOB_TIMER_AUTOSTART) /** - * Stop the timer at the end of print, starting is managed by + * Stop the timer at the end of print, starting is managed by * 'heat and wait' M109. * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot * stand by mode, for instance in a dual extruder setup, without affecting @@ -4645,7 +4647,7 @@ inline void gcode_M109() { #if ENABLED(PRINTJOB_TIMER_AUTOSTART) if (code_value_temp_abs() > BED_MINTEMP) { /** - * We start the timer when 'heating and waiting' command arrives, LCD + * We start the timer when 'heating and waiting' command arrives, LCD * functions never wait. Cooling down managed by extruders. * * We do not check if the timer is already running because this check will From d4c68279c8555631663cc341e0f2dad2bc196e65 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 08:28:09 -0700 Subject: [PATCH 337/580] Add "P" parameter to M302 --- Marlin/Marlin_main.cpp | 30 ++++++++++++++++++++++++++++-- Marlin/temperature.cpp | 1 + Marlin/temperature.h | 3 ++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b335f9656..404c2993a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5703,10 +5703,36 @@ inline void gcode_M226() { #if ENABLED(PREVENT_DANGEROUS_EXTRUDE) /** - * M302: Allow cold extrudes, or set the minimum extrude S. + * M302: Allow cold extrudes, or set the minimum extrude temperature + * + * S sets the minimum extrude temperature + * P enables (1) or disables (0) cold extrusion + * + * Examples: + * + * M302 ; report current cold extrusion state + * M302 P0 ; enable cold extrusion checking + * M302 P1 ; disables cold extrusion checking + * M302 S0 ; always allow extrusion (disables checking) + * M302 S170 ; only allow extrusion above 170 + * M302 S170 P1 ; set min extrude temp to 170 but leave disabled */ inline void gcode_M302() { - thermalManager.extrude_min_temp = code_seen('S') ? code_value_temp_abs() : 0; + bool seen_S = code_seen('S'); + if (seen_S) { + thermalManager.extrude_min_temp = code_value_temp_abs(); + thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); + } + + if (code_seen('P')) + thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || code_value_bool(); + else if (!seen_S) { + // Report current state + SERIAL_ECHO_START; + SERIAL_ECHOPAIR("Cold extrudes are ", (thermalManager.allow_cold_extrude ? "en" : "dis")); + SERIAL_ECHOPAIR("abled (min temp ", int(thermalManager.extrude_min_temp + 0.5)); + SERIAL_ECHOLNPGM("C)"); + } } #endif // PREVENT_DANGEROUS_EXTRUDE diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index aa0ff7909..c2bbc81a4 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -107,6 +107,7 @@ unsigned char Temperature::soft_pwm_bed; #endif #if ENABLED(PREVENT_DANGEROUS_EXTRUDE) + bool Temperature::allow_cold_extrude = false; float Temperature::extrude_min_temp = EXTRUDE_MINTEMP; #endif diff --git a/Marlin/temperature.h b/Marlin/temperature.h index fd737bc6a..5a1a7e7e3 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -121,12 +121,13 @@ class Temperature { #endif #if ENABLED(PREVENT_DANGEROUS_EXTRUDE) + static bool allow_cold_extrude; static float extrude_min_temp; static bool tooColdToExtrude(uint8_t e) { #if HOTENDS == 1 UNUSED(e); #endif - return degHotend(HOTEND_INDEX) < extrude_min_temp; + return allow_cold_extrude ? false : degHotend(HOTEND_INDEX) < extrude_min_temp; } #else static bool tooColdToExtrude(uint8_t e) { UNUSED(e); return false; } From cdd77d23bb8b195c6df37740d7c55339a64a37bd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Jul 2016 08:50:41 -0700 Subject: [PATCH 338/580] Neaten up temperature member data --- Marlin/temperature.cpp | 53 +++++++++++++++++++-------------------- Marlin/temperature.h | 57 +++++++++++++++++++++--------------------- 2 files changed, 54 insertions(+), 56 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index c2bbc81a4..76c9dfd9a 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -50,13 +50,12 @@ Temperature thermalManager; // public: -int Temperature::current_temperature_raw[HOTENDS] = { 0 }; -float Temperature::current_temperature[HOTENDS] = { 0.0 }; -int Temperature::target_temperature[HOTENDS] = { 0 }; - -int Temperature::current_temperature_bed_raw = 0; -float Temperature::current_temperature_bed = 0.0; -int Temperature::target_temperature_bed = 0; +float Temperature::current_temperature[HOTENDS] = { 0.0 }, + Temperature::current_temperature_bed = 0.0; +int Temperature::current_temperature_raw[HOTENDS] = { 0 }, + Temperature::target_temperature[HOTENDS] = { 0 }, + Temperature::current_temperature_bed_raw = 0, + Temperature::target_temperature_bed = 0; #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) float Temperature::redundant_temperature = 0.0; @@ -121,11 +120,11 @@ unsigned char Temperature::soft_pwm_bed; volatile bool Temperature::temp_meas_ready = false; #if ENABLED(PIDTEMP) - float Temperature::temp_iState[HOTENDS] = { 0 }; - float Temperature::temp_dState[HOTENDS] = { 0 }; - float Temperature::pTerm[HOTENDS]; - float Temperature::iTerm[HOTENDS]; - float Temperature::dTerm[HOTENDS]; + float Temperature::temp_iState[HOTENDS] = { 0 }, + Temperature::temp_dState[HOTENDS] = { 0 }, + Temperature::pTerm[HOTENDS], + Temperature::iTerm[HOTENDS], + Temperature::dTerm[HOTENDS]; #if ENABLED(PID_ADD_EXTRUSION_RATE) float Temperature::cTerm[HOTENDS]; @@ -134,21 +133,21 @@ volatile bool Temperature::temp_meas_ready = false; int Temperature::lpq_ptr = 0; #endif - float Temperature::pid_error[HOTENDS]; - float Temperature::temp_iState_min[HOTENDS]; - float Temperature::temp_iState_max[HOTENDS]; + float Temperature::pid_error[HOTENDS], + Temperature::temp_iState_min[HOTENDS], + Temperature::temp_iState_max[HOTENDS]; bool Temperature::pid_reset[HOTENDS]; #endif #if ENABLED(PIDTEMPBED) - float Temperature::temp_iState_bed = { 0 }; - float Temperature::temp_dState_bed = { 0 }; - float Temperature::pTerm_bed; - float Temperature::iTerm_bed; - float Temperature::dTerm_bed; - float Temperature::pid_error_bed; - float Temperature::temp_iState_min_bed; - float Temperature::temp_iState_max_bed; + float Temperature::temp_iState_bed = { 0 }, + Temperature::temp_dState_bed = { 0 }, + Temperature::pTerm_bed, + Temperature::iTerm_bed, + Temperature::dTerm_bed, + Temperature::pid_error_bed, + Temperature::temp_iState_min_bed, + Temperature::temp_iState_max_bed; #else millis_t Temperature::next_bed_check_ms; #endif @@ -157,10 +156,10 @@ unsigned long Temperature::raw_temp_value[4] = { 0 }; unsigned long Temperature::raw_temp_bed_value = 0; // Init min and max temp with extreme values to prevent false errors during startup -int Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP); -int Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP); -int Temperature::minttemp[HOTENDS] = { 0 }; -int Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383); +int Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP), + Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP), + Temperature::minttemp[HOTENDS] = { 0 }, + Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383); #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED int Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 }; diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 5a1a7e7e3..8fab0db3d 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -52,13 +52,12 @@ class Temperature { public: - static int current_temperature_raw[HOTENDS]; - static float current_temperature[HOTENDS]; - static int target_temperature[HOTENDS]; - - static int current_temperature_bed_raw; - static float current_temperature_bed; - static int target_temperature_bed; + static float current_temperature[HOTENDS], + current_temperature_bed; + static int current_temperature_raw[HOTENDS], + target_temperature[HOTENDS], + current_temperature_bed_raw, + target_temperature_bed; #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) static float redundant_temperature; @@ -143,11 +142,11 @@ class Temperature { static volatile bool temp_meas_ready; #if ENABLED(PIDTEMP) - static float temp_iState[HOTENDS]; - static float temp_dState[HOTENDS]; - static float pTerm[HOTENDS]; - static float iTerm[HOTENDS]; - static float dTerm[HOTENDS]; + static float temp_iState[HOTENDS], + temp_dState[HOTENDS], + pTerm[HOTENDS], + iTerm[HOTENDS], + dTerm[HOTENDS]; #if ENABLED(PID_ADD_EXTRUSION_RATE) static float cTerm[HOTENDS]; @@ -156,33 +155,33 @@ class Temperature { static int lpq_ptr; #endif - static float pid_error[HOTENDS]; - static float temp_iState_min[HOTENDS]; - static float temp_iState_max[HOTENDS]; + static float pid_error[HOTENDS], + temp_iState_min[HOTENDS], + temp_iState_max[HOTENDS]; static bool pid_reset[HOTENDS]; #endif #if ENABLED(PIDTEMPBED) - static float temp_iState_bed; - static float temp_dState_bed; - static float pTerm_bed; - static float iTerm_bed; - static float dTerm_bed; - static float pid_error_bed; - static float temp_iState_min_bed; - static float temp_iState_max_bed; + static float temp_iState_bed, + temp_dState_bed, + pTerm_bed, + iTerm_bed, + dTerm_bed, + pid_error_bed, + temp_iState_min_bed, + temp_iState_max_bed; #else static millis_t next_bed_check_ms; #endif - static unsigned long raw_temp_value[4]; - static unsigned long raw_temp_bed_value; + static unsigned long raw_temp_value[4], + raw_temp_bed_value; // Init min and max temp with extreme values to prevent false errors during startup - static int minttemp_raw[HOTENDS]; - static int maxttemp_raw[HOTENDS]; - static int minttemp[HOTENDS]; - static int maxttemp[HOTENDS]; + static int minttemp_raw[HOTENDS], + maxttemp_raw[HOTENDS], + minttemp[HOTENDS], + maxttemp[HOTENDS]; #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED static int consecutive_low_temperature_error[HOTENDS]; From c2c8ab46984a84212a93a8a0845c045a22972bb3 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Wed, 13 Jul 2016 22:11:23 +0900 Subject: [PATCH 339/580] Follow-up the PR #4278 (Fixups for PID_ADD_EXTRUSION_RATE and HOTENDS==1) --- Marlin/configuration_store.cpp | 2 +- Marlin/temperature.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index fd8d41b4b..54c96b6e8 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -617,7 +617,7 @@ void Config_ResetDefault() { #endif #if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_HOTEND) + #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 HOTEND_LOOP() #else int e = 0; UNUSED(e); // only need to write once diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 76c9dfd9a..beb4f63e6 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -68,7 +68,7 @@ unsigned char Temperature::soft_pwm_bed; #endif #if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_HOTEND) + #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp), Temperature::Ki[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Ki) * (PID_dT)), Temperature::Kd[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Kd) / (PID_dT)); From 8f03f0be9b38d6c0af941b3a3052b0d056a07baf Mon Sep 17 00:00:00 2001 From: esenapaj Date: Wed, 13 Jul 2016 22:42:16 +0900 Subject: [PATCH 340/580] Follow-up the PR #4252 (Replace PLA/ABS preheating with generic) --- Marlin/language_el-gr.h | 20 ++++++++++---------- Marlin/language_el.h | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Marlin/language_el-gr.h b/Marlin/language_el-gr.h index 9bdb8a678..9a55eb0c8 100644 --- a/Marlin/language_el-gr.h +++ b/Marlin/language_el-gr.h @@ -55,16 +55,16 @@ #define MSG_SET_HOME_OFFSETS "Ορισμός βασικών μετατοπίσεων" #define MSG_HOME_OFFSETS_APPLIED "Εφαρμόστηκαν οι μετατοπίσεις" #define MSG_SET_ORIGIN "Ορισμός προέλευσης" -#define MSG_PREHEAT_PLA "Προθέρμανση PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " όλα" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " κλίνη" -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " επιβεβαίωση" -#define MSG_PREHEAT_ABS "Προθέρμανση ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " όλα" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Bed" -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " επιβεβαίωση" +#define MSG_PREHEAT_1 "Προθέρμανση PLA" +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " όλα" +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " κλίνη" +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " επιβεβαίωση" +#define MSG_PREHEAT_2 "Προθέρμανση ABS" +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " όλα" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " Bed" +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " επιβεβαίωση" #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" diff --git a/Marlin/language_el.h b/Marlin/language_el.h index d1fec26b7..b3ec5344c 100644 --- a/Marlin/language_el.h +++ b/Marlin/language_el.h @@ -55,16 +55,16 @@ #define MSG_SET_HOME_OFFSETS "Ορισμός βασικών μετατοπίσεων" //SHORTEN #define MSG_HOME_OFFSETS_APPLIED "Εφαρμόστηκαν οι μετατοπίσεις" //SHORTEN #define MSG_SET_ORIGIN "Ορισμός προέλευσης" -#define MSG_PREHEAT_PLA "Προθέρμανση PLA" -#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " -#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " όλα" -#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " bed" //SHORTEN -#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " επιβεβαίωση" //SHORTEN -#define MSG_PREHEAT_ABS "Προθέρμανση ABS" -#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " -#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " όλα" -#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " bed" //SHORTEN -#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " επιβεβαίωση" //SHORTEN +#define MSG_PREHEAT_1 "Προθέρμανση PLA" +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " όλα" +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " bed" //SHORTEN +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " επιβεβαίωση" //SHORTEN +#define MSG_PREHEAT_2 "Προθέρμανση ABS" +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " όλα" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " bed" //SHORTEN +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " επιβεβαίωση" //SHORTEN #define MSG_H1 "1" #define MSG_H2 "2" #define MSG_H3 "3" From 005af8414020165b3c2625549a0f9c08b760b197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Wed, 13 Jul 2016 21:06:31 +0100 Subject: [PATCH 341/580] Update the bq Hephestos 2 configuration --- Marlin/example_configurations/Hephestos_2/Configuration.h | 8 ++++---- Marlin/example_configurations/Hephestos_2/README.md | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 0d6252eab..53d522562 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -711,16 +711,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // default settings -#define DEFAULT_AXIS_STEPS_PER_UNIT {160, 160, 8000, 203} // default steps per unit for Ultimaker -#define DEFAULT_MAX_FEEDRATE {250, 250, 2, 200} // (mm/sec) -#define DEFAULT_MAX_ACCELERATION {1000, 1000, 20, 1000} // 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. +#define DEFAULT_AXIS_STEPS_PER_UNIT {160, 160, 8000, 210.02} // Steps per unit +#define DEFAULT_MAX_FEEDRATE {250, 250, 2, 200} // mm/sec +#define DEFAULT_MAX_ACCELERATION {1000, 1000, 20, 1000} // X, Y, Z, E max start speed for accelerated moves #define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) -#define DEFAULT_XYJERK 10.0 // (mm/sec) +#define DEFAULT_XYJERK 20.0 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_EJERK 2.0 // (mm/sec) diff --git a/Marlin/example_configurations/Hephestos_2/README.md b/Marlin/example_configurations/Hephestos_2/README.md index 447022c94..8fcb53c3d 100644 --- a/Marlin/example_configurations/Hephestos_2/README.md +++ b/Marlin/example_configurations/Hephestos_2/README.md @@ -10,3 +10,5 @@ NOTE: The look and feel of the Hephestos 2 while navigating the LCD menu will ch * 2016/06/21 - Disabled hot bed related options Activated software endstops SD printing now disables the heater when finished + * 2016/07/13 - Update the `DEFAULT_AXIS_STEPS_PER_UNIT` for the Z axis + Increased the `DEFAULT_XYJERK` From b05a75655a202518e1cdac412d6af076c943420b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 16 Jun 2016 05:18:44 +0100 Subject: [PATCH 342/580] Implements a nozzle cleaning pattern generator (G12) --- .travis.yml | 6 +++ Marlin/Configuration.h | 38 ++++++++++++++ Marlin/Marlin_main.cpp | 47 +++++++++++------ Marlin/SanityCheck.h | 7 +++ Marlin/clean_nozzle.h | 112 +++++++++++++++++++++++++++++++++++++++++ Marlin/point_t.h | 33 ++++++++++++ 6 files changed, 228 insertions(+), 15 deletions(-) create mode 100644 Marlin/clean_nozzle.h create mode 100644 Marlin/point_t.h diff --git a/.travis.yml b/.travis.yml index eb471fd11..4d003a95d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -211,6 +211,12 @@ script: - opt_enable PRINTCOUNTER - build_marlin # + # Test CLEAN_NOZZLE_FEATURE + # + - restore_configs + - opt_enable AUTO_BED_LEVELING_FEATURE CLEAN_NOZZLE_FEATURE FIX_MOUNTED_PROBE + - build_marlin + # # ######## STANDARD LCD/PANELS ############## # diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 94c1d32e9..6c170ccf3 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -787,6 +787,44 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (Xs, Ys) and (Xe, Ye), "S" +// defines the number of zig-zag triangles to be done. Each "side" +// cannot be less than 5mm. As an example "G12 P1 S3" will execute: +// +// /| /| /| (Xe, Ye) +// / | / | / | +// / | / | / | +// (Xs, Ys) / |/ |/ | +// +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define CLEAN_NOZZLE_FEATURE + +#if ENABLED(CLEAN_NOZZLE_FEATURE) + #define CLEAN_NOZZLE_STROKES 12 + #define CLEAN_NOZZLE_START_PT { 30, 30, (Z_MIN_POS + 1), 0} + #define CLEAN_NOZZLE_END_PT {100, 60, (Z_MIN_POS + 1), 0} + // { X, Y, Z, E} +#endif + // // Print job timer // diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 95b8a5c76..ac7c5f19e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -106,8 +106,9 @@ * G3 - CCW ARC * G4 - Dwell S or P * G5 - Cubic B-spline with XYZE destination and IJPQ offsets - * G10 - retract filament according to settings of M207 - * G11 - retract recover filament according to settings of M208 + * G10 - Retract filament according to settings of M207 + * G11 - Retract recover filament according to settings of M208 + * G12 - Clean tool * G20 - Set input units to inches * G21 - Set input units to millimeters * G28 - Home one or more axes @@ -1703,6 +1704,10 @@ static void clean_up_after_endstop_or_probe_move() { do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate); } + inline void do_blocking_move_to_y(float y) { + do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]); + } + inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate); } @@ -2712,6 +2717,23 @@ inline void gcode_G4() { #endif //FWRETRACT +#if ENABLED(CLEAN_NOZZLE_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE) + #include "clean_nozzle.h" + + inline void gcode_G12() { + // Don't allow nozzle cleaning without homing first + if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) { + axis_unhomed_error(true); + return; + } + + uint8_t const pattern = code_seen('P') ? code_value_ushort() : 0; + uint8_t const strokes = code_seen('S') ? code_value_ushort() : CLEAN_NOZZLE_STROKES; + + CleanNozzle::start(pattern, strokes); + } +#endif + #if ENABLED(INCH_MODE_SUPPORT) /** * G20: Set input mode to inches @@ -6748,12 +6770,10 @@ void process_next_command() { // G2, G3 #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) - case 2: // G2 - CW ARC case 3: // G3 - CCW ARC gcode_G2_G3(codenum == 2); break; - #endif // G4 Dwell @@ -6762,23 +6782,25 @@ void process_next_command() { break; #if ENABLED(BEZIER_CURVE_SUPPORT) - // G5 case 5: // G5 - Cubic B_spline gcode_G5(); break; - #endif // BEZIER_CURVE_SUPPORT #if ENABLED(FWRETRACT) - case 10: // G10: retract case 11: // G11: retract_recover gcode_G10_G11(codenum == 10); break; - #endif // FWRETRACT + #if ENABLED(CLEAN_NOZZLE_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE) + case 12: + gcode_G12(); // G12: Clean Nozzle + break; + #endif // CLEAN_NOZZLE_FEATURE + #if ENABLED(INCH_MODE_SUPPORT) case 20: //G20: Inch Mode gcode_G20(); @@ -6787,7 +6809,7 @@ void process_next_command() { case 21: //G21: MM Mode gcode_G21(); break; - #endif + #endif // INCH_MODE_SUPPORT case 28: // G28: Home all axes, one at a time gcode_G28(); @@ -6797,7 +6819,7 @@ void process_next_command() { case 29: // G29 Detailed Z probe, probes the bed at 3 or more points. gcode_G29(); break; - #endif + #endif // AUTO_BED_LEVELING_FEATURE #if HAS_BED_PROBE @@ -6816,7 +6838,6 @@ void process_next_command() { break; #endif // Z_PROBE_SLED - #endif // HAS_BED_PROBE case 90: // G90 @@ -6845,7 +6866,6 @@ void process_next_command() { break; #if ENABLED(SDSUPPORT) - case 20: // M20 - list SD card gcode_M20(); break; case 21: // M21 - init SD card @@ -6878,7 +6898,6 @@ void process_next_command() { case 928: //M928 - Start SD write gcode_M928(); break; - #endif //SDSUPPORT case 31: //M31 take time since the start of the SD print or an M109 command @@ -6948,11 +6967,9 @@ void process_next_command() { #endif #if ENABLED(HOST_KEEPALIVE_FEATURE) - case 113: // M113: Set Host Keepalive interval gcode_M113(); break; - #endif case 140: // M140: Set bed temp diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 3dc330885..812050066 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -646,4 +646,11 @@ #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." #endif +/** + * Nozzle cleaning + */ +#if ENABLED(CLEAN_NOZZLE_FEATURE) && DISABLED(AUTO_BED_LEVELING_FEATURE) + #error You must enable AUTO_BED_LEVELING_FEATURE for CLEAN_NOZZLE_FEATURE to work +#endif + #endif //SANITYCHECK_H diff --git a/Marlin/clean_nozzle.h b/Marlin/clean_nozzle.h new file mode 100644 index 000000000..9670605b0 --- /dev/null +++ b/Marlin/clean_nozzle.h @@ -0,0 +1,112 @@ +/* + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef __CLEAN_NOZZLE_H__ +#define __CLEAN_NOZZLE_H__ + +#include "Marlin.h" +#include "point_t.h" + +/** + * @brief CleanNozzle class + * + * @todo: Do not ignore the end.z value and allow XYZ movements + * @todo: Currently this feature needs AUTO_BED_LEVELING_FEATURE to be active + * due to the do_blocking_move_to*() functions. + */ +class CleanNozzle { + private: + /** + * @brief Stroke clean pattern + * @details Wipes the nozzle back and forth in a linear movement + * + * @param start point_t defining the starting point + * @param end point_t defining the ending point + * @param strokes number of strokes to execute + */ + static void stroke(point_t const &start, point_t const &end, uint8_t const &strokes) + __attribute__ ((optimize ("Os"))) { + // Move to the starting point + do_blocking_move_to_xy(start.x, start.y); + do_blocking_move_to_z(start.z); + + // Start the stroke pattern + for (uint8_t i = 0; i < (strokes >>1); i++) { + do_blocking_move_to_xy(end.x, end.y); + do_blocking_move_to_xy(start.x, start.y); + } + } + + /** + * @brief Zig-zag clean pattern + * @details Apply a zig-zag cleanning pattern + * + * @param start point_t defining the starting point + * @param end point_t defining the ending point + * @param triangles number of triangles to execute + */ + static void zigzag(point_t const &start, point_t const &end, uint8_t const &triangles) + __attribute__ ((optimize ("Os"))) { + // Move to the starting point + do_blocking_move_to_xy(start.x, start.y); + do_blocking_move_to_z(start.z); + + // Calculate the triangle side + float const a = fabs(end.x - start.x) / triangles; + + // Don't allow the sides (a, b) to be smaller than 5mm + if (a < 5 || fabs(end.y - start.y) < 5) return; + + // Start the zig-zag pattern + for (uint8_t i = 0; i < triangles; i++) { + float const x = start.x + (a * (i + 1)); + do_blocking_move_to_xy(x, end.y); + do_blocking_move_to_y(start.y); + } + } + + public: + /** + * @brief Clean the nozzle + * @details Starts the selected clean procedure pattern + * + * @param pattern one of the available patterns + * @param argument depends on the cleaning pattern + */ + static void start(uint8_t const &pattern, uint8_t const &argument) + __attribute__ ((optimize ("Os"))) { + switch (pattern) { + case 1: + CleanNozzle::zigzag( + CLEAN_NOZZLE_START_PT, + CLEAN_NOZZLE_END_PT, argument); + break; + + default: + CleanNozzle::stroke( + CLEAN_NOZZLE_START_PT, + CLEAN_NOZZLE_END_PT, argument); + } + } +}; + +#endif diff --git a/Marlin/point_t.h b/Marlin/point_t.h new file mode 100644 index 000000000..18dfe09c8 --- /dev/null +++ b/Marlin/point_t.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef __POINT_T__ +#define __POINT_T__ + +struct point_t { + float x; + float y; + float z; + float e; +}; + +#endif From 021544f5721442ba62ac339d91451f6caf2e7c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 23 Jun 2016 00:23:55 +0100 Subject: [PATCH 343/580] Improves G12 zig-zag pattern --- Marlin/Configuration.h | 27 ++++++++----- Marlin/Marlin_main.cpp | 5 ++- Marlin/{clean_nozzle.h => nozzle.h} | 63 +++++++++++++++++++---------- 3 files changed, 61 insertions(+), 34 deletions(-) rename Marlin/{clean_nozzle.h => nozzle.h} (61%) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6c170ccf3..c455c50a6 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -801,15 +801,20 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // "strokes" i.e. back-and-forth movements between the starting and end // points. // -// P1: This starts a zig-zag pattern between (Xs, Ys) and (Xe, Ye), "S" -// defines the number of zig-zag triangles to be done. Each "side" -// cannot be less than 5mm. As an example "G12 P1 S3" will execute: -// -// /| /| /| (Xe, Ye) -// / | / | / | -// / | / | / | -// (Xs, Ys) / |/ |/ | -// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 // // Caveats: End point Z should use the same value as Start point Z. // @@ -820,8 +825,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #if ENABLED(CLEAN_NOZZLE_FEATURE) #define CLEAN_NOZZLE_STROKES 12 - #define CLEAN_NOZZLE_START_PT { 30, 30, (Z_MIN_POS + 1), 0} - #define CLEAN_NOZZLE_END_PT {100, 60, (Z_MIN_POS + 1), 0} + #define CLEAN_NOZZLE_START_PT { 30, 30, (Z_MIN_POS + 5), 0} + #define CLEAN_NOZZLE_END_PT {100, 60, (Z_MIN_POS + 5), 0} // { X, Y, Z, E} #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ac7c5f19e..835b20fcd 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2718,7 +2718,7 @@ inline void gcode_G4() { #endif //FWRETRACT #if ENABLED(CLEAN_NOZZLE_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE) - #include "clean_nozzle.h" + #include "nozzle.h" inline void gcode_G12() { // Don't allow nozzle cleaning without homing first @@ -2729,8 +2729,9 @@ inline void gcode_G4() { uint8_t const pattern = code_seen('P') ? code_value_ushort() : 0; uint8_t const strokes = code_seen('S') ? code_value_ushort() : CLEAN_NOZZLE_STROKES; + uint8_t const objects = code_seen('T') ? code_value_ushort() : 3; - CleanNozzle::start(pattern, strokes); + Nozzle::clean(pattern, strokes, objects); } #endif diff --git a/Marlin/clean_nozzle.h b/Marlin/nozzle.h similarity index 61% rename from Marlin/clean_nozzle.h rename to Marlin/nozzle.h index 9670605b0..796d18b34 100644 --- a/Marlin/clean_nozzle.h +++ b/Marlin/nozzle.h @@ -27,13 +27,13 @@ #include "point_t.h" /** - * @brief CleanNozzle class + * @brief Nozzle class * * @todo: Do not ignore the end.z value and allow XYZ movements * @todo: Currently this feature needs AUTO_BED_LEVELING_FEATURE to be active * due to the do_blocking_move_to*() functions. */ -class CleanNozzle { +class Nozzle { private: /** * @brief Stroke clean pattern @@ -62,26 +62,46 @@ class CleanNozzle { * * @param start point_t defining the starting point * @param end point_t defining the ending point - * @param triangles number of triangles to execute + * @param strokes number of strokes to execute + * @param objects number of objects to create */ - static void zigzag(point_t const &start, point_t const &end, uint8_t const &triangles) + static void zigzag(point_t const &start, + point_t const &end, uint8_t const &strokes, uint8_t const &objects) __attribute__ ((optimize ("Os"))) { - // Move to the starting point - do_blocking_move_to_xy(start.x, start.y); - do_blocking_move_to_z(start.z); + float A = fabs(end.y - start.y); // [twice the] Amplitude + float P = fabs(end.x - start.x) / (objects << 1); // Period - // Calculate the triangle side - float const a = fabs(end.x - start.x) / triangles; + // Don't allow impossible triangles + if (A <= 0.0f || P <= 0.0f ) return; - // Don't allow the sides (a, b) to be smaller than 5mm - if (a < 5 || fabs(end.y - start.y) < 5) return; + // Store the current coords + point_t const home = { + current_position[X_AXIS], + current_position[Y_AXIS], + current_position[Z_AXIS], + current_position[E_AXIS] + }; - // Start the zig-zag pattern - for (uint8_t i = 0; i < triangles; i++) { - float const x = start.x + (a * (i + 1)); - do_blocking_move_to_xy(x, end.y); - do_blocking_move_to_y(start.y); + for (uint8_t j = 0; j < strokes; j++) { + for (uint8_t i = 0; i < (objects << 1); i++) { + float const x = start.x + i * P; + float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)); + + do_blocking_move_to_xy(x, y); + if (i == 0) do_blocking_move_to_z(start.z); + } + + for (int i = (objects << 1); i > -1; i--) { + float const x = start.x + i * P; + float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)); + + do_blocking_move_to_xy(x, y); + } } + + // Move to home/start position + do_blocking_move_to_z(home.z); + do_blocking_move_to_xy(home.x, home.y); } public: @@ -92,19 +112,20 @@ class CleanNozzle { * @param pattern one of the available patterns * @param argument depends on the cleaning pattern */ - static void start(uint8_t const &pattern, uint8_t const &argument) + static void clean(uint8_t const &pattern, + uint8_t const &strokes, uint8_t const &objects = 0) __attribute__ ((optimize ("Os"))) { switch (pattern) { case 1: - CleanNozzle::zigzag( + Nozzle::zigzag( CLEAN_NOZZLE_START_PT, - CLEAN_NOZZLE_END_PT, argument); + CLEAN_NOZZLE_END_PT, strokes, objects); break; default: - CleanNozzle::stroke( + Nozzle::stroke( CLEAN_NOZZLE_START_PT, - CLEAN_NOZZLE_END_PT, argument); + CLEAN_NOZZLE_END_PT, strokes); } } }; From 4937f9ada4b2441cc2d2f84e3acd7f60e35f23f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 14 Jul 2016 00:07:36 +0100 Subject: [PATCH 344/580] Minor G12 tweaks and point_t struct extension --- Marlin/Marlin_main.cpp | 13 ++++------ Marlin/SanityCheck.h | 4 +-- Marlin/nozzle.h | 55 +++++++++++++++++++++++++++++------------- Marlin/point_t.h | 13 ++++++++++ 4 files changed, 58 insertions(+), 27 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 835b20fcd..523f8cf32 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2717,18 +2717,15 @@ inline void gcode_G4() { #endif //FWRETRACT -#if ENABLED(CLEAN_NOZZLE_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE) +#if ENABLED(NOZZLE_CLEAN_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE) #include "nozzle.h" inline void gcode_G12() { // Don't allow nozzle cleaning without homing first - if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) { - axis_unhomed_error(true); - return; - } + if (axis_unhomed_error(true, true, true)) { return; } uint8_t const pattern = code_seen('P') ? code_value_ushort() : 0; - uint8_t const strokes = code_seen('S') ? code_value_ushort() : CLEAN_NOZZLE_STROKES; + uint8_t const strokes = code_seen('S') ? code_value_ushort() : NOZZLE_CLEAN_STROKES; uint8_t const objects = code_seen('T') ? code_value_ushort() : 3; Nozzle::clean(pattern, strokes, objects); @@ -6796,11 +6793,11 @@ void process_next_command() { break; #endif // FWRETRACT - #if ENABLED(CLEAN_NOZZLE_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE) + #if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE case 12: gcode_G12(); // G12: Clean Nozzle break; - #endif // CLEAN_NOZZLE_FEATURE + #endif // NOZZLE_CLEAN_FEATURE #if ENABLED(INCH_MODE_SUPPORT) case 20: //G20: Inch Mode diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 812050066..8334b1289 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -649,8 +649,8 @@ /** * Nozzle cleaning */ -#if ENABLED(CLEAN_NOZZLE_FEATURE) && DISABLED(AUTO_BED_LEVELING_FEATURE) - #error You must enable AUTO_BED_LEVELING_FEATURE for CLEAN_NOZZLE_FEATURE to work +#if ENABLED(NOZZLE_CLEAN_FEATURE) && !HAS_BED_PROBE + #error Due to internal dependencies you must have a bed probe for NOZZLE_CLEAN_FEATURE to work #endif #endif //SANITYCHECK_H diff --git a/Marlin/nozzle.h b/Marlin/nozzle.h index 796d18b34..02771a516 100644 --- a/Marlin/nozzle.h +++ b/Marlin/nozzle.h @@ -20,8 +20,8 @@ * */ -#ifndef __CLEAN_NOZZLE_H__ -#define __CLEAN_NOZZLE_H__ +#ifndef __NOZZLE_H__ +#define __NOZZLE_H__ #include "Marlin.h" #include "point_t.h" @@ -30,7 +30,7 @@ * @brief Nozzle class * * @todo: Do not ignore the end.z value and allow XYZ movements - * @todo: Currently this feature needs AUTO_BED_LEVELING_FEATURE to be active + * @todo: Currently this feature needs HAS_BED_PROBE to be active * due to the do_blocking_move_to*() functions. */ class Nozzle { @@ -45,6 +45,17 @@ class Nozzle { */ static void stroke(point_t const &start, point_t const &end, uint8_t const &strokes) __attribute__ ((optimize ("Os"))) { + + #if ENABLED(NOZZLE_CLEAN_PARK) + // Store the current coords + point_t const initial = { + current_position[X_AXIS], + current_position[Y_AXIS], + current_position[Z_AXIS], + current_position[E_AXIS] + }; + #endif + // Move to the starting point do_blocking_move_to_xy(start.x, start.y); do_blocking_move_to_z(start.z); @@ -54,6 +65,12 @@ class Nozzle { do_blocking_move_to_xy(end.x, end.y); do_blocking_move_to_xy(start.x, start.y); } + + #if ENABLED(NOZZLE_CLEAN_PARK) + // Move the nozzle to the initial point + do_blocking_move_to_z(initial.z); + do_blocking_move_to_xy(initial.x, initial.y); + #endif } /** @@ -74,13 +91,15 @@ class Nozzle { // Don't allow impossible triangles if (A <= 0.0f || P <= 0.0f ) return; - // Store the current coords - point_t const home = { - current_position[X_AXIS], - current_position[Y_AXIS], - current_position[Z_AXIS], - current_position[E_AXIS] - }; + #if ENABLED(NOZZLE_CLEAN_PARK) + // Store the current coords + point_t const initial = { + current_position[X_AXIS], + current_position[Y_AXIS], + current_position[Z_AXIS], + current_position[E_AXIS] + }; + #endif for (uint8_t j = 0; j < strokes; j++) { for (uint8_t i = 0; i < (objects << 1); i++) { @@ -99,9 +118,11 @@ class Nozzle { } } - // Move to home/start position - do_blocking_move_to_z(home.z); - do_blocking_move_to_xy(home.x, home.y); + #if ENABLED(NOZZLE_CLEAN_PARK) + // Move the nozzle to the initial point + do_blocking_move_to_z(initial.z); + do_blocking_move_to_xy(initial.x, initial.y); + #endif } public: @@ -118,14 +139,14 @@ class Nozzle { switch (pattern) { case 1: Nozzle::zigzag( - CLEAN_NOZZLE_START_PT, - CLEAN_NOZZLE_END_PT, strokes, objects); + NOZZLE_CLEAN_START_PT, + NOZZLE_CLEAN_END_PT, strokes, objects); break; default: Nozzle::stroke( - CLEAN_NOZZLE_START_PT, - CLEAN_NOZZLE_END_PT, strokes); + NOZZLE_CLEAN_START_PT, + NOZZLE_CLEAN_END_PT, strokes); } } }; diff --git a/Marlin/point_t.h b/Marlin/point_t.h index 18dfe09c8..dbad66858 100644 --- a/Marlin/point_t.h +++ b/Marlin/point_t.h @@ -28,6 +28,19 @@ struct point_t { float y; float z; float e; + + point_t(float const x, float const y) + : point_t(x, y, NAN, NAN) {} + + point_t(float const x, float const y, float const z) + : point_t(x, y, z, NAN) {} + + point_t(float const x, float const y, float const z, float const e) { + this->x = x; + this->y = y; + this->z = z; + this->e = e; + } }; #endif From 68c343a09a85183aba7c3e47a4b1eecf2cc61236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 14 Jul 2016 00:38:42 +0100 Subject: [PATCH 345/580] Added G12 configuration options to all configs --- Marlin/Configuration.h | 17 +++--- .../Cartesio/Configuration.h | 54 +++++++++++++++++-- .../Felix/Configuration.h | 48 +++++++++++++++++ .../Felix/DUAL/Configuration.h | 48 +++++++++++++++++ .../Hephestos/Configuration.h | 48 +++++++++++++++++ .../Hephestos_2/Configuration.h | 48 +++++++++++++++++ .../K8200/Configuration.h | 48 +++++++++++++++++ .../K8400/Configuration.h | 48 +++++++++++++++++ .../{Dual Heads => Dual-head}/Configuration.h | 48 +++++++++++++++++ .../RepRapWorld/Megatronics/Configuration.h | 48 +++++++++++++++++ .../RigidBot/Configuration.h | 48 +++++++++++++++++ .../SCARA/Configuration.h | 48 +++++++++++++++++ .../TAZ4/Configuration.h | 48 +++++++++++++++++ .../WITBOX/Configuration.h | 48 +++++++++++++++++ .../adafruit/ST7565/Configuration.h | 48 +++++++++++++++++ .../delta/biv2.5/Configuration.h | 48 +++++++++++++++++ .../delta/generic/Configuration.h | 48 +++++++++++++++++ .../delta/kossel_mini/Configuration.h | 48 +++++++++++++++++ .../delta/kossel_pro/Configuration.h | 48 +++++++++++++++++ .../delta/kossel_xl/Configuration.h | 48 +++++++++++++++++ .../makibox/Configuration.h | 48 +++++++++++++++++ .../tvrrug/Round2/Configuration.h | 48 +++++++++++++++++ 22 files changed, 1022 insertions(+), 9 deletions(-) rename Marlin/example_configurations/K8400/{Dual Heads => Dual-head}/Configuration.h (96%) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c455c50a6..96cb58068 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -821,13 +821,18 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments // may change to add new functionality like different wipe patterns. // -//#define CLEAN_NOZZLE_FEATURE +//#define NOZZLE_CLEAN_FEATURE -#if ENABLED(CLEAN_NOZZLE_FEATURE) - #define CLEAN_NOZZLE_STROKES 12 - #define CLEAN_NOZZLE_START_PT { 30, 30, (Z_MIN_POS + 5), 0} - #define CLEAN_NOZZLE_END_PT {100, 60, (Z_MIN_POS + 5), 0} - // { X, Y, Z, E} +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK #endif // diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index a875ecce6..b4d1f0852 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -268,12 +268,12 @@ #define DEFAULT_Kp 18 #define DEFAULT_Ki 1 #define DEFAULT_Kd 100 - + // Cartesio extruderV6 40W Volcano //#define DEFAULT_Kp 50 //#define DEFAULT_Ki 9 //#define DEFAULT_Kd 70 - + // Cartesio extruderV6 40W Cyclops //#define DEFAULT_Kp 18 //#define DEFAULT_Ki 1 @@ -313,7 +313,7 @@ #define DEFAULT_bedKp 390 #define DEFAULT_bedKi 70 #define DEFAULT_bedKd 546 - + //24V 250W silicone heater on to 4mm glass CartesioM //#define DEFAULT_bedKp 303 //#define DEFAULT_bedKi 42 @@ -786,6 +786,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index d3543127f..50ace1c2d 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -770,6 +770,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 097c1e2ee..3c2be5a22 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -768,6 +768,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index ad3d59088..31ac6728f 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -779,6 +779,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 0d6252eab..5e31b0e99 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -781,6 +781,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 2a1ed2981..37fe86722 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -804,6 +804,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 60 // K8200: set back to 110 if you have an upgraded heatbed power supply #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 6cec00cb2..c900fc263 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -787,6 +787,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 0 #define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h similarity index 96% rename from Marlin/example_configurations/K8400/Dual Heads/Configuration.h rename to Marlin/example_configurations/K8400/Dual-head/Configuration.h index 2dc75368a..d69c5bdfe 100644 --- a/Marlin/example_configurations/K8400/Dual Heads/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -787,6 +787,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 0 #define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index ab6c8dcd9..315010fe8 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -787,6 +787,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index f24a4ea07..829c8d8a5 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -785,6 +785,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index b8addb287..4d32f85a7 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -795,6 +795,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index e2782de05..f8f49db47 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -808,6 +808,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 06a5ae8fb..d4102ef99 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -779,6 +779,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index be81a9a2e..2bb90a191 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -787,6 +787,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 5cc2ed9d1..981ae59dd 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -882,6 +882,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 31d6b3551..2fed91a1a 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -876,6 +876,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 2699a97f4..9e97af3c3 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -879,6 +879,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index dddb9c435..2b49bd039 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -879,6 +879,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 58b162635..258ba72c9 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -881,6 +881,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 9a4be404e..c51d75d36 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -790,6 +790,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index a135d4d7b..eeee65304 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -781,6 +781,54 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Clean Nozzle Feature -- EXPERIMENTAL +// +// When enabled allows the user to send G12 to start the nozzle cleaning +// process, the G-Code accepts two parameters: +// "P" for pattern selection +// "S" for defining the number of strokes/repetitions +// +// Available list of patterns: +// P0: This is the default pattern, this process requires a sponge type +// material at a fixed bed location, the cleaning process is based on +// "strokes" i.e. back-and-forth movements between the starting and end +// points. +// +// P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T" +// defines the number of zig-zag triangles to be done. "S" defines the +// number of strokes aka one back-and-forth movement. As an example +// sending "G12 P1 S1 T3" will execute: +// +// -- +// | (X0, Y1) | /\ /\ /\ | (X1, Y1) +// | | / \ / \ / \ | +// A | | / \ / \ / \ | +// | | / \ / \ / \ | +// | (X0, Y0) | / \/ \/ \ | (X1, Y0) +// -- +--------------------------------+ +// |________|_________|_________| +// T1 T2 T3 +// +// Caveats: End point Z should use the same value as Start point Z. +// +// Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments +// may change to add new functionality like different wipe patterns. +// +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // { X, Y, Z} + #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} + #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + + // Moves the nozzle to the parked position + #define NOZZLE_CLEAN_PARK +#endif + // // Print job timer // From e481b79af1b88637faeee6646863010f0d0db24e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2016 19:03:42 -0700 Subject: [PATCH 346/580] Allow stopwatch and printcounter to go over 18 hours --- Marlin/Marlin_main.cpp | 3 +-- Marlin/dogm_lcd_implementation.h | 2 +- Marlin/printcounter.cpp | 17 ++++++++--------- Marlin/printcounter.h | 8 ++++---- Marlin/stopwatch.cpp | 4 ++-- Marlin/stopwatch.h | 8 ++++---- Marlin/ultralcd.cpp | 8 ++++---- 7 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 95b8a5c76..e2937c39e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1172,8 +1172,7 @@ inline void get_serial_commands() { print_job_timer.stop(); char time[30]; millis_t t = print_job_timer.duration(); - int hours = t / 60 / 60, minutes = (t / 60) % 60; - sprintf_P(time, PSTR("%i " MSG_END_HOUR " %i " MSG_END_MINUTE), hours, minutes); + sprintf_P(time, PSTR("%i " MSG_END_HOUR " %i " MSG_END_MINUTE), int(t / 60 / 60), int(t / 60) % 60); SERIAL_ECHO_START; SERIAL_ECHOLN(time); lcd_setstatus(time, true); diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 6d6acb154..be45fb6ca 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -386,7 +386,7 @@ static void lcd_implementation_status_screen() { } u8g.setPrintPos(80,48); - uint16_t time = print_job_timer.duration() / 60; + millis_t time = print_job_timer.duration() / 60; if (time != 0) { lcd_print(itostr2(time/60)); lcd_print(':'); diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp index 78e3630d3..6e875fabc 100644 --- a/Marlin/printcounter.cpp +++ b/Marlin/printcounter.cpp @@ -27,12 +27,12 @@ PrintCounter::PrintCounter(): super() { this->loadStats(); } -uint16_t PrintCounter::deltaDuration() { +millis_t PrintCounter::deltaDuration() { #if ENABLED(DEBUG_PRINTCOUNTER) PrintCounter::debug(PSTR("deltaDuration")); #endif - uint16_t tmp = this->lastDuration; + millis_t tmp = this->lastDuration; this->lastDuration = this->duration(); return this->lastDuration - tmp; } @@ -88,12 +88,12 @@ void PrintCounter::showStats() { SERIAL_ECHO(this->data.totalPrints - this->data.finishedPrints - ((this->isRunning() || this->isPaused()) ? 1 : 0)); // Removes 1 from failures with an active counter - uint32_t t = this->data.printTime / 60; + millis_t t = this->data.printTime / 60; // minutes from seconds SERIAL_ECHOPGM(", Total print time: "); - SERIAL_ECHO(t / 60); + SERIAL_ECHO(t / 60); // hours SERIAL_ECHOPGM("h "); - SERIAL_ECHO(t % 60); + SERIAL_ECHO(t % 60); // minutes SERIAL_ECHOPGM("min"); @@ -110,10 +110,10 @@ void PrintCounter::showStats() { void PrintCounter::tick() { if (!this->isRunning()) return; - static uint32_t update_before = millis(), + static millis_t update_before = millis(), eeprom_before = millis(); - uint32_t now = millis(); + millis_t now = millis(); // Trying to get the amount of calculations down to the bare min const static uint16_t i = this->updateInterval * 1000; @@ -128,8 +128,7 @@ void PrintCounter::tick() { } // Trying to get the amount of calculations down to the bare min - const static uint32_t j = this->saveInterval * 1000; - + const static millis_t j = this->saveInterval * 1000; if (now - eeprom_before >= j) { eeprom_before = now; this->saveStats(); diff --git a/Marlin/printcounter.h b/Marlin/printcounter.h index d6ac80b77..c7742a07b 100644 --- a/Marlin/printcounter.h +++ b/Marlin/printcounter.h @@ -35,8 +35,8 @@ struct printStatistics { // 13 bytes //const uint8_t magic; // Magic header, it will always be 0x16 uint16_t totalPrints; // Number of prints uint16_t finishedPrints; // Number of complete prints - uint32_t printTime; // Total printing time - uint32_t longestPrint; // Longest print job - not in use + millis_t printTime; // Total printing time + millis_t longestPrint; // Longest print job - not in use }; class PrintCounter: public Stopwatch { @@ -74,7 +74,7 @@ class PrintCounter: public Stopwatch { * @details Stores the timestamp of the last deltaDuration(), this is * required due to the updateInterval cycle. */ - uint16_t lastDuration; + millis_t lastDuration; /** * @brief Stats were loaded from EERPROM @@ -90,7 +90,7 @@ class PrintCounter: public Stopwatch { * used internally for print statistics accounting is not intended to be a * user callable function. */ - uint16_t deltaDuration(); + millis_t deltaDuration(); public: /** diff --git a/Marlin/stopwatch.cpp b/Marlin/stopwatch.cpp index 7a9e90d3c..042dbfc08 100644 --- a/Marlin/stopwatch.cpp +++ b/Marlin/stopwatch.cpp @@ -88,9 +88,9 @@ bool Stopwatch::isPaused() { return (this->state == STOPWATCH_PAUSED) ? true : false; } -uint16_t Stopwatch::duration() { +millis_t Stopwatch::duration() { return (((this->isRunning()) ? millis() : this->stopTimestamp) - - this->startTimestamp) / 1000 + this->accumulator; + - this->startTimestamp) / 1000UL + this->accumulator; } #if ENABLED(DEBUG_STOPWATCH) diff --git a/Marlin/stopwatch.h b/Marlin/stopwatch.h index f5ce2335a..173b5efb4 100644 --- a/Marlin/stopwatch.h +++ b/Marlin/stopwatch.h @@ -42,9 +42,9 @@ enum StopwatchState { class Stopwatch { private: StopwatchState state; - uint16_t accumulator; - uint32_t startTimestamp; - uint32_t stopTimestamp; + millis_t accumulator; + millis_t startTimestamp; + millis_t stopTimestamp; public: /** @@ -101,7 +101,7 @@ class Stopwatch { * @details Returns the total number of seconds the timer has been running. * @return the delta since starting the stopwatch */ - uint16_t duration(); + millis_t duration(); #if ENABLED(DEBUG_STOPWATCH) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 94a71102a..4a2e08e9a 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1967,13 +1967,13 @@ void kill_screen(const char* lcd_msg) { print_job_counter.loadStats(); printStatistics stats = print_job_counter.getStats(); - char printTime[6]; - sprintf(printTime, "%02d:%02d", int(stats.printTime / 3600), int(stats.printTime / 60) % 60); + char timeString[8]; + sprintf_P(timeString, PSTR("%i:%02i"), int(stats.printTime / 60 / 60), int(stats.printTime / 60) % 60); - START_SCREEN(); + START_SCREEN(); // 12345678901234567890 STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count : 999 STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", false, false, itostr3left(stats.finishedPrints)); // Finished : 666 - STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false, printTime); // Total Time : 12:34 + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false, timeString); // Total Time : 123:45 END_SCREEN(); } #endif // PRINTCOUNTER From a8d71f0ac6a659b867aa4d36a25fa9ec222cd72f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 13 Jul 2016 12:57:59 -0700 Subject: [PATCH 347/580] Support longer print times in M31 --- Marlin/Marlin_main.cpp | 18 ++++++++++++++---- Marlin/language_en.h | 7 +++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e2937c39e..c5d411cf8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3948,12 +3948,22 @@ inline void gcode_M17() { */ inline void gcode_M31() { millis_t t = print_job_timer.duration(); - int min = t / 60, sec = t % 60; - char time[30]; - sprintf_P(time, PSTR("%i min, %i sec"), min, sec); + int d = int(t / 60 / 60 / 24), + h = int(t / 60 / 60) % 60, + m = int(t / 60) % 60, + s = int(t % 60); + char time[18]; // 123456789012345678 + if (d) + sprintf_P(time, PSTR("%id %ih %im %is"), d, h, m, s); // 99d 23h 59m 59s + else + sprintf_P(time, PSTR("%ih %im %is"), h, m, s); // 23h 59m 59s + + lcd_setstatus(time); + SERIAL_ECHO_START; + SERIAL_ECHOPGM(MSG_PRINT_TIME " "); SERIAL_ECHOLN(time); - lcd_setstatus(time); + thermalManager.autotempShutdown(); } diff --git a/Marlin/language_en.h b/Marlin/language_en.h index ef6022094..eb1450578 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -488,12 +488,18 @@ #ifndef MSG_PLEASE_RESET #define MSG_PLEASE_RESET "Please reset" #endif +#ifndef MSG_END_DAY + #define MSG_END_DAY "days" +#endif #ifndef MSG_END_HOUR #define MSG_END_HOUR "hours" #endif #ifndef MSG_END_MINUTE #define MSG_END_MINUTE "minutes" #endif +#ifndef MSG_PRINT_TIME + #define MSG_PRINT_TIME "Print time" +#endif #ifndef MSG_HEATING #define MSG_HEATING "Heating..." #endif @@ -521,6 +527,7 @@ #ifndef MSG_DELTA_CALIBRATE_CENTER #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #endif + #ifndef MSG_INFO_MENU #define MSG_INFO_MENU "About Printer" #endif From 23d2bc5ab03864c94da277d0ebc19f87bf4cafde Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 13 Jul 2016 12:58:52 -0700 Subject: [PATCH 348/580] Patch Greek for new strings --- Marlin/language_el.h | 63 +++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/Marlin/language_el.h b/Marlin/language_el.h index b3ec5344c..c62366081 100644 --- a/Marlin/language_el.h +++ b/Marlin/language_el.h @@ -198,6 +198,7 @@ #define MSG_DELTA_CALIBRATE_Y "Βαθμονόμηση Y" #define MSG_DELTA_CALIBRATE_Z "Βαθμονόμηση Z" #define MSG_DELTA_CALIBRATE_CENTER "Βαθμονόμηση κέντρου" + #define MSG_INFO_MENU "About Printer" #define MSG_INFO_PRINTER_MENU "Printer Info" #define MSG_INFO_STATS_MENU "Printer Stats" @@ -206,42 +207,50 @@ #define MSG_INFO_EXTRUDERS "Extruders" #define MSG_INFO_BAUDRATE "Baud" #define MSG_INFO_PROTOCOL "Protocol" -#define MSG_INFO_TOTAL_PRINTS "Total Prints" -#define MSG_INFO_FINISHED_PRINTS "Finished Prints" -#define MSG_INFO_PRINT_TIME "Total Print Time" + +#if LCD_WIDTH > 19 + #define MSG_INFO_PRINT_COUNT "Print Count " + #define MSG_INFO_FINISHED_PRINTS "Finished " + #define MSG_INFO_PRINT_TIME "Total Time " +#else + #define MSG_INFO_PRINT_COUNT "Prints " + #define MSG_INFO_FINISHED_PRINTS "Finished " + #define MSG_INFO_PRINT_TIME "Duration " +#endif #define MSG_INFO_MIN_TEMP "Min Temp" #define MSG_INFO_MAX_TEMP "Max Temp" #define MSG_INFO_PSU "Power Supply" + #define MSG_FILAMENT_CHANGE_HEADER "CHANGE FILAMENT" #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Extrude more" #define MSG_FILAMENT_CHANGE_OPTION_RESUME "Resume print" #if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 "Wait for start" - #define MSG_FILAMENT_CHANGE_INIT_2 "of the filament" - #define MSG_FILAMENT_CHANGE_INIT_3 "change" - #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Wait for" - #define MSG_FILAMENT_CHANGE_UNLOAD_2 "filament unload" - #define MSG_FILAMENT_CHANGE_UNLOAD_3 "" - #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert filament" - #define MSG_FILAMENT_CHANGE_INSERT_2 "and press button" - #define MSG_FILAMENT_CHANGE_INSERT_3 "to continue..." - #define MSG_FILAMENT_CHANGE_LOAD_1 "Wait for" - #define MSG_FILAMENT_CHANGE_LOAD_2 "filament load" - #define MSG_FILAMENT_CHANGE_LOAD_3 "" - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Wait for" - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "filament extrude" - #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "" - #define MSG_FILAMENT_CHANGE_RESUME_1 "Wait for print" - #define MSG_FILAMENT_CHANGE_RESUME_2 "to resume" - #define MSG_FILAMENT_CHANGE_RESUME_3 "" + #define MSG_FILAMENT_CHANGE_INIT_1 "Wait for start" + #define MSG_FILAMENT_CHANGE_INIT_2 "of the filament" + #define MSG_FILAMENT_CHANGE_INIT_3 "change" + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Wait for" + #define MSG_FILAMENT_CHANGE_UNLOAD_2 "filament unload" + #define MSG_FILAMENT_CHANGE_UNLOAD_3 "" + #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert filament" + #define MSG_FILAMENT_CHANGE_INSERT_2 "and press button" + #define MSG_FILAMENT_CHANGE_INSERT_3 "to continue..." + #define MSG_FILAMENT_CHANGE_LOAD_1 "Wait for" + #define MSG_FILAMENT_CHANGE_LOAD_2 "filament load" + #define MSG_FILAMENT_CHANGE_LOAD_3 "" + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Wait for" + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "filament extrude" + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "" + #define MSG_FILAMENT_CHANGE_RESUME_1 "Wait for print" + #define MSG_FILAMENT_CHANGE_RESUME_2 "to resume" + #define MSG_FILAMENT_CHANGE_RESUME_3 "" #else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 "Please wait..." - #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Ejecting..." - #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert and Click" - #define MSG_FILAMENT_CHANGE_LOAD_1 "Loading..." - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Extruding..." - #define MSG_FILAMENT_CHANGE_RESUME_1 "Resuming..." + #define MSG_FILAMENT_CHANGE_INIT_1 "Please wait..." + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Ejecting..." + #define MSG_FILAMENT_CHANGE_INSERT_1 "Insert and Click" + #define MSG_FILAMENT_CHANGE_LOAD_1 "Loading..." + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Extruding..." + #define MSG_FILAMENT_CHANGE_RESUME_1 "Resuming..." #endif #endif // LANGUAGE_EL_H From 34da77dad3873ff75f447465d4cca45a464db9cd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 09:59:42 -0700 Subject: [PATCH 349/580] Simply run M31 at the end of an SD print --- Marlin/Marlin_main.cpp | 6 ------ Marlin/cardreader.cpp | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c5d411cf8..e60f66e09 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1170,12 +1170,6 @@ inline void get_serial_commands() { if (card_eof) { SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); print_job_timer.stop(); - char time[30]; - millis_t t = print_job_timer.duration(); - sprintf_P(time, PSTR("%i " MSG_END_HOUR " %i " MSG_END_MINUTE), int(t / 60 / 60), int(t / 60) % 60); - SERIAL_ECHO_START; - SERIAL_ECHOLN(time); - lcd_setstatus(time, true); card.printingHasFinished(); card.checkautostart(true); } diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index c7e160481..dd6ff9f53 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -602,19 +602,19 @@ void CardReader::updir() { void CardReader::printingHasFinished() { stepper.synchronize(); + file.close(); if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure. - file.close(); file_subcall_ctr--; openFile(proc_filenames[file_subcall_ctr], true, true); setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { - file.close(); sdprinting = false; if (SD_FINISHED_STEPPERRELEASE) enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); - thermalManager.autotempShutdown(); + print_job_timer.stop(); + enqueue_and_echo_commands_P(PSTR("M31")); } } From 1618870c84a402cb2dedd40c89a5a63b592cdcb9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 11:19:51 -0700 Subject: [PATCH 350/580] card.printingHasFinished does print_job_timer.stop --- Marlin/Marlin_main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e60f66e09..615d89ec2 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1169,7 +1169,6 @@ inline void get_serial_commands() { ) { if (card_eof) { SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); - print_job_timer.stop(); card.printingHasFinished(); card.checkautostart(true); } From c5e51f6b96c7450a0297afd99bc4780079a862c9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 11:46:35 -0700 Subject: [PATCH 351/580] finished => completed --- Marlin/language_cz.h | 12 ++++++------ Marlin/language_de.h | 13 ++++++++++--- Marlin/language_el.h | 8 ++++---- Marlin/language_en.h | 12 ++++++------ Marlin/ultralcd.cpp | 6 +++--- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index 461c41a05..f8e4cec24 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -209,13 +209,13 @@ #define MSG_INFO_BAUDRATE "Rychlost" #define MSG_INFO_PROTOCOL "Protokol" #if LCD_WIDTH > 19 - #define MSG_INFO_PRINT_COUNT "Pocet tisku " - #define MSG_INFO_FINISHED_PRINTS "Dokonceno " - #define MSG_INFO_PRINT_TIME "Celkovy cas " + #define MSG_INFO_PRINT_COUNT "Pocet tisku" + #define MSG_INFO_COMPLETED_PRINTS "Dokonceno " + #define MSG_INFO_PRINT_TIME "Celkovy cas" #else - #define MSG_INFO_PRINT_COUNT "Tisky " - #define MSG_INFO_FINISHED_PRINTS "Hotovo " - #define MSG_INFO_PRINT_TIME "Cas " + #define MSG_INFO_PRINT_COUNT "Tisky " + #define MSG_INFO_COMPLETED_PRINTS "Hotovo" + #define MSG_INFO_PRINT_TIME "Cas " #endif #define MSG_INFO_MIN_TEMP "Teplota min" #define MSG_INFO_MAX_TEMP "Teplota max" diff --git a/Marlin/language_de.h b/Marlin/language_de.h index f828c4a47..f9e2644aa 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -179,9 +179,16 @@ #define MSG_INFO_EXTRUDERS "Extruders" #define MSG_INFO_BAUDRATE "Baud" #define MSG_INFO_PROTOCOL "Protokol" -#define MSG_INFO_TOTAL_PRINTS "Gesamte Drucke" -#define MSG_INFO_FINISHED_PRINTS "Beendete Drucke" -#define MSG_INFO_PRINT_TIME "Gesamte Druckzeit" + +#if LCD_WIDTH > 19 + #define MSG_INFO_TOTAL_PRINTS "Gesamte Drucke " + #define MSG_INFO_COMPLETED_PRINTS "Beendete Drucke " + #define MSG_INFO_PRINT_TIME "Gesamte Druckzeit" +#else + #define MSG_INFO_PRINT_COUNT "Prints " + #define MSG_INFO_COMPLETED_PRINTS "Completed" + #define MSG_INFO_PRINT_TIME "Duration " +#endif #define MSG_INFO_MIN_TEMP "Min Temp" #define MSG_INFO_MAX_TEMP "Max Temp" #define MSG_INFO_PSU "Stromversorgung" diff --git a/Marlin/language_el.h b/Marlin/language_el.h index c62366081..f0d94db10 100644 --- a/Marlin/language_el.h +++ b/Marlin/language_el.h @@ -209,12 +209,12 @@ #define MSG_INFO_PROTOCOL "Protocol" #if LCD_WIDTH > 19 - #define MSG_INFO_PRINT_COUNT "Print Count " - #define MSG_INFO_FINISHED_PRINTS "Finished " - #define MSG_INFO_PRINT_TIME "Total Time " + #define MSG_INFO_PRINT_COUNT "Print Count" + #define MSG_INFO_COMPLETED_PRINTS "Completed " + #define MSG_INFO_PRINT_TIME "Total Time " #else #define MSG_INFO_PRINT_COUNT "Prints " - #define MSG_INFO_FINISHED_PRINTS "Finished " + #define MSG_INFO_COMPLETED_PRINTS "Completed" #define MSG_INFO_PRINT_TIME "Duration " #endif #define MSG_INFO_MIN_TEMP "Min Temp" diff --git a/Marlin/language_en.h b/Marlin/language_en.h index eb1450578..27444aebd 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -555,20 +555,20 @@ #if LCD_WIDTH > 19 #ifndef MSG_INFO_PRINT_COUNT - #define MSG_INFO_PRINT_COUNT "Print Count " + #define MSG_INFO_PRINT_COUNT "Print Count" #endif - #ifndef MSG_INFO_FINISHED_PRINTS - #define MSG_INFO_FINISHED_PRINTS "Finished " + #ifndef MSG_INFO_COMPLETED_PRINTS + #define MSG_INFO_COMPLETED_PRINTS "Completed " #endif #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME "Total Time " + #define MSG_INFO_PRINT_TIME "Total Time " #endif #else #ifndef MSG_INFO_PRINT_COUNT #define MSG_INFO_PRINT_COUNT "Prints " #endif - #ifndef MSG_INFO_FINISHED_PRINTS - #define MSG_INFO_FINISHED_PRINTS "Finished " + #ifndef MSG_INFO_COMPLETED_PRINTS + #define MSG_INFO_COMPLETED_PRINTS "Completed" #endif #ifndef MSG_INFO_PRINT_TIME #define MSG_INFO_PRINT_TIME "Duration " diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 4a2e08e9a..09c14107a 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1971,9 +1971,9 @@ void kill_screen(const char* lcd_msg) { sprintf_P(timeString, PSTR("%i:%02i"), int(stats.printTime / 60 / 60), int(stats.printTime / 60) % 60); START_SCREEN(); // 12345678901234567890 - STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count : 999 - STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", false, false, itostr3left(stats.finishedPrints)); // Finished : 666 - STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false, timeString); // Total Time : 123:45 + STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 + STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false, timeString); // Total Time : 123:45 END_SCREEN(); } #endif // PRINTCOUNTER From e71a631f8f1f3ca386397d9e7186e1d5de6a43c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 15 Jul 2016 00:26:37 +0100 Subject: [PATCH 352/580] do_blocking_move_*() no longer depend on HAS_BED_PROBE --- Marlin/Marlin_main.cpp | 120 ++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0cb1a31f3..e622d2dcb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1624,86 +1624,86 @@ static void clean_up_after_endstop_or_probe_move() { refresh_cmd_timeout(); } -#if HAS_BED_PROBE - #if ENABLED(DELTA) - /** - * Calculate delta, start a line, and set current_position to destination - */ - void prepare_move_to_destination_raw() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination); - #endif - refresh_cmd_timeout(); - calculate_delta(destination); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder); - set_current_to_destination(); - } - #endif - +#if ENABLED(DELTA) /** - * Plan a move to (X, Y, Z) and set the current_position - * The final current_position may not be the one that was requested + * Calculate delta, start a line, and set current_position to destination */ - static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) { - float old_feedrate = feedrate; - + void prepare_move_to_destination_raw() { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z); + if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination); #endif + refresh_cmd_timeout(); + calculate_delta(destination); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder); + set_current_to_destination(); + } +#endif - #if ENABLED(DELTA) +/** + * Plan a move to (X, Y, Z) and set the current_position + * The final current_position may not be the one that was requested + */ +static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) { + float old_feedrate = feedrate; - feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z); + #endif - destination[X_AXIS] = x; - destination[Y_AXIS] = y; - destination[Z_AXIS] = z; + #if ENABLED(DELTA) - if (x == current_position[X_AXIS] && y == current_position[Y_AXIS]) - prepare_move_to_destination_raw(); // this will also set_current_to_destination - else - prepare_move_to_destination(); // this will also set_current_to_destination + feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE; - #else + destination[X_AXIS] = x; + destination[Y_AXIS] = y; + destination[Z_AXIS] = z; - // If Z needs to raise, do it before moving XY - if (current_position[Z_AXIS] < z) { - feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS]; - current_position[Z_AXIS] = z; - line_to_current_position(); - } + if (x == current_position[X_AXIS] && y == current_position[Y_AXIS]) + prepare_move_to_destination_raw(); // this will also set_current_to_destination + else + prepare_move_to_destination(); // this will also set_current_to_destination - feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE; - current_position[X_AXIS] = x; - current_position[Y_AXIS] = y; + #else + + // If Z needs to raise, do it before moving XY + if (current_position[Z_AXIS] < z) { + feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS]; + current_position[Z_AXIS] = z; line_to_current_position(); + } - // If Z needs to lower, do it after moving XY - if (current_position[Z_AXIS] > z) { - feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS]; - current_position[Z_AXIS] = z; - line_to_current_position(); - } + feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE; + current_position[X_AXIS] = x; + current_position[Y_AXIS] = y; + line_to_current_position(); - #endif + // If Z needs to lower, do it after moving XY + if (current_position[Z_AXIS] > z) { + feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS]; + current_position[Z_AXIS] = z; + line_to_current_position(); + } - stepper.synchronize(); + #endif - feedrate = old_feedrate; - } + stepper.synchronize(); - inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) { - do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate); - } + feedrate = old_feedrate; +} - inline void do_blocking_move_to_y(float y) { - do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]); - } +inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) { + do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate); +} - inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate); - } +inline void do_blocking_move_to_y(float y) { + do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]); +} +inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate); +} + +#if HAS_BED_PROBE /** * Raise Z to a minimum height to make room for a probe to move */ From 7ac0b91a4530cee469a9e5d2a77d3ba57d9c4385 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 18:28:41 -0700 Subject: [PATCH 353/580] Collapsible long comment in gcode_T --- Marlin/Marlin_main.cpp | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0cb1a31f3..05ae8f9c6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6587,29 +6587,29 @@ inline void gcode_T(uint8_t tmp_extruder) { // No extra case for AUTO_BED_LEVELING_FEATURE in DUAL_X_CARRIAGE. Does that mean they don't work together? #else // !DUAL_X_CARRIAGE - // - // Set current_position to the position of the new nozzle. - // Offsets are based on linear distance, so we need to get - // the resulting position in coordinate space. - // - // - With grid or 3-point leveling, offset XYZ by a tilted vector - // - With mesh leveling, update Z for the new position - // - Otherwise, just use the raw linear distance - // - // Software endstops are altered here too. Consider a case where: - // E0 at X=0 ... E1 at X=10 - // When we switch to E1 now X=10, but E1 can't move left. - // To express this we apply the change in XY to the software endstops. - // E1 can move farther right than E0, so the right limit is extended. - // - // Note that we don't adjust the Z software endstops. Why not? - // Consider a case where Z=0 (here) and switching to E1 makes Z=1 - // because the bed is 1mm lower at the new position. As long as - // the first nozzle is out of the way, the carriage should be - // allowed to move 1mm lower. This technically "breaks" the - // Z software endstop. But this is technically correct (and - // there is no viable alternative). - // + /** + * Set current_position to the position of the new nozzle. + * Offsets are based on linear distance, so we need to get + * the resulting position in coordinate space. + * + * - With grid or 3-point leveling, offset XYZ by a tilted vector + * - With mesh leveling, update Z for the new position + * - Otherwise, just use the raw linear distance + * + * Software endstops are altered here too. Consider a case where: + * E0 at X=0 ... E1 at X=10 + * When we switch to E1 now X=10, but E1 can't move left. + * To express this we apply the change in XY to the software endstops. + * E1 can move farther right than E0, so the right limit is extended. + * + * Note that we don't adjust the Z software endstops. Why not? + * Consider a case where Z=0 (here) and switching to E1 makes Z=1 + * because the bed is 1mm lower at the new position. As long as + * the first nozzle is out of the way, the carriage should be + * allowed to move 1mm lower. This technically "breaks" the + * Z software endstop. But this is technically correct (and + * there is no viable alternative). + */ #if ENABLED(AUTO_BED_LEVELING_FEATURE) // Offset extruder, make sure to apply the bed level rotation matrix vector_3 tmp_offset_vec = vector_3(hotend_offset[X_AXIS][tmp_extruder], From 166f19251e252e9775abbda996c1fdd9ef655e9a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 18:34:08 -0700 Subject: [PATCH 354/580] Add more debugging for leveling - Especially in `gcode_T` - In `update_software_endstops` - Some tweaks to observe --- Marlin/Marlin_main.cpp | 136 ++++++++++++++++++++++++++++++++--------- 1 file changed, 107 insertions(+), 29 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 05ae8f9c6..aeb35ca29 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1435,7 +1435,16 @@ static void update_software_endstops(AxisEnum axis) { sw_endstop_min[axis] = base_min_pos(axis) + offs; sw_endstop_max[axis] = base_max_pos(axis) + offs; } - + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("For ", axis_codes[axis]); + SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]); + SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]); + SERIAL_ECHOPAIR("\n sw_endstop_min = ", sw_endstop_min[axis]); + SERIAL_ECHOPAIR("\n sw_endstop_max = ", sw_endstop_max[axis]); + SERIAL_EOL; + } + #endif } /** @@ -1524,7 +1533,7 @@ static void set_axis_is_at_home(AxisEnum axis) { current_position[Z_AXIS] -= zprobe_zoffset; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("> zprobe_zoffset==", zprobe_zoffset); + SERIAL_ECHOPAIR("> zprobe_zoffset = ", zprobe_zoffset); SERIAL_EOL; } #endif @@ -1533,7 +1542,8 @@ static void set_axis_is_at_home(AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("> home_offset[axis]==", home_offset[axis]); + SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]); + SERIAL_ECHOPAIR("] = ", home_offset[axis]); SERIAL_EOL; DEBUG_POS("", current_position); } @@ -1725,7 +1735,7 @@ static void clean_up_after_endstop_or_probe_move() { #endif //HAS_BED_PROBE -#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE +#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE || HOTENDS > 1 static bool axis_unhomed_error(const bool x, const bool y, const bool z) { const bool xx = x && !axis_homed[X_AXIS], yy = y && !axis_homed[Y_AXIS], @@ -6541,11 +6551,37 @@ inline void gcode_T(uint8_t tmp_extruder) { if (tmp_extruder != active_extruder) { bool no_move = code_seen('S') && code_value_bool(); - // Save current position to return to after applying extruder offset - if (!no_move) set_destination_to_current(); + if (!no_move && axis_unhomed_error(true, true, true)) { + SERIAL_ECHOLNPGM("No move on toolchange"); + no_move = true; + } + + // Save current position to destination, for use later + set_destination_to_current(); + #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() && - (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder))) { + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPGM("Dual X Carriage Mode "); + switch (dual_x_carriage_mode) { + case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break; + case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break; + case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break; + } + } + #endif + + if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() + && (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder)) + ) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Raise to ", current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT); SERIAL_EOL; + SERIAL_ECHOPAIR("MoveX to ", x_home_pos(active_extruder)); SERIAL_EOL; + SERIAL_ECHOPAIR("Lower to ", current_position[Z_AXIS]); SERIAL_EOL; + } + #endif // Park old head: 1) raise 2) move to park position 3) lower planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT, current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder); @@ -6564,27 +6600,42 @@ inline void gcode_T(uint8_t tmp_extruder) { // This function resets the max/min values - the current position may be overwritten below. set_axis_is_at_home(X_AXIS); - if (dual_x_carriage_mode == DXC_FULL_CONTROL_MODE) { - current_position[X_AXIS] = inactive_extruder_x_pos; - inactive_extruder_x_pos = destination[X_AXIS]; - } - else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { - active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position - if (active_extruder_parked) + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); + #endif + + switch (dual_x_carriage_mode) { + case DXC_FULL_CONTROL_MODE: current_position[X_AXIS] = inactive_extruder_x_pos; - else - current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset; - inactive_extruder_x_pos = destination[X_AXIS]; - extruder_duplication_enabled = false; - } - else { - // record raised toolhead position for use by unpark - memcpy(raised_parked_position, current_position, sizeof(raised_parked_position)); - raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; - active_extruder_parked = true; - delayed_move_time = 0; + inactive_extruder_x_pos = destination[X_AXIS]; + break; + case DXC_DUPLICATION_MODE: + active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position + if (active_extruder_parked) + current_position[X_AXIS] = inactive_extruder_x_pos; + else + current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset; + inactive_extruder_x_pos = destination[X_AXIS]; + extruder_duplication_enabled = false; + break; + default: + // record raised toolhead position for use by unpark + memcpy(raised_parked_position, current_position, sizeof(raised_parked_position)); + raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; + active_extruder_parked = true; + delayed_move_time = 0; + break; } - // No extra case for AUTO_BED_LEVELING_FEATURE in DUAL_X_CARRIAGE. Does that mean they don't work together? + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); + SERIAL_EOL; + DEBUG_POS("New extruder (parked)", current_position); + } + #endif + + // No extra case for AUTO_BED_LEVELING_FEATURE in DUAL_X_CARRIAGE. Does that mean they don't work together? #else // !DUAL_X_CARRIAGE /** @@ -6648,15 +6699,32 @@ inline void gcode_T(uint8_t tmp_extruder) { #if ENABLED(MESH_BED_LEVELING) if (mbl.active()) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Z before MBL: ", current_position[Z_AXIS]); + #endif float xpos = RAW_CURRENT_POSITION(X_AXIS), ypos = RAW_CURRENT_POSITION(Y_AXIS); current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR(" after: ", current_position[Z_AXIS]); + SERIAL_EOL; + } + #endif } #endif // MESH_BED_LEVELING #endif // !AUTO_BED_LEVELING_FEATURE + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Offset Tool XY by { ", xydiff[X_AXIS]); + SERIAL_ECHOPAIR(", ", xydiff[X_AXIS]); + SERIAL_ECHOLNPGM(" }"); + } + #endif + // The newly-selected extruder XY is actually at... current_position[X_AXIS] += xydiff[X_AXIS]; current_position[Y_AXIS] += xydiff[Y_AXIS]; @@ -6670,16 +6738,26 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif // !DUAL_X_CARRIAGE + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("Sync After Toolchange", current_position); + #endif + // Tell the planner the new "current position" SYNC_PLAN_POSITION_KINEMATIC(); // Move to the "old position" (move the extruder into place) - if (!no_move && IsRunning()) prepare_move_to_destination(); + if (!no_move && IsRunning()) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); + #endif + prepare_move_to_destination(); + } } // (tmp_extruder != active_extruder) + stepper.synchronize(); + #if ENABLED(EXT_SOLENOID) - stepper.synchronize(); disable_all_solenoids(); enable_solenoid_on_active_extruder(); #endif // EXT_SOLENOID From 95ab2fd3ae870ad3182b40b3f915e98bcb5becdd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 19:01:57 -0700 Subject: [PATCH 355/580] Fix skipping of static items --- Marlin/ultralcd.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 09c14107a..37f139dee 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -214,25 +214,26 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to * _menuLineNr is the menu item to draw and process * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM */ - #define _START_SCREEN(CODE) \ + #define _START_SCREEN(CODE, SKIP) \ ENCODER_DIRECTION_MENUS(); \ encoderRateMultiplierEnabled = false; \ if (encoderPosition > 0x8000) encoderPosition = 0; \ int8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ NOMORE(encoderTopLine, encoderLine); \ int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ + bool _skipStatic = SKIP; \ CODE; \ for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \ _thisItemNr = 0; - #define START_SCREEN() _START_SCREEN(NOOP) + #define START_SCREEN() _START_SCREEN(NOOP, false) /** * START_MENU generates the init code for a menu function * * wasClicked indicates the controller was clicked */ - #define START_MENU() _START_SCREEN(bool wasClicked = LCD_CLICKED) + #define START_MENU() _START_SCREEN(bool wasClicked = LCD_CLICKED, true) /** * MENU_ITEM generates draw & handler code for a menu item, potentially calling: @@ -270,6 +271,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to _thisItemNr++ #define MENU_ITEM(TYPE, LABEL, ARGS...) do { \ + _skipStatic = false; \ _MENU_ITEM_PART_1(TYPE, LABEL, ## ARGS); \ _MENU_ITEM_PART_2(TYPE, ## ARGS); \ } while(0) @@ -277,7 +279,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to // Used to print static text with no visible cursor. #define STATIC_ITEM(LABEL, ARGS...) \ if (_menuLineNr == _thisItemNr) { \ - if (encoderLine == _thisItemNr && _thisItemNr < LCD_HEIGHT - 1) { \ + if (_skipStatic && encoderLine <= _thisItemNr) { \ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ } \ From c8f2dd7cd5d6ee50a7b0bef034beb052d6fd0b20 Mon Sep 17 00:00:00 2001 From: Indrek Ardel Date: Mon, 4 Jul 2016 18:31:47 +0300 Subject: [PATCH 356/580] Fix CN Controls 12 styling --- Marlin/pins_CNCONTROLS_12.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/pins_CNCONTROLS_12.h b/Marlin/pins_CNCONTROLS_12.h index f1de6c11a..cb338346d 100644 --- a/Marlin/pins_CNCONTROLS_12.h +++ b/Marlin/pins_CNCONTROLS_12.h @@ -32,13 +32,13 @@ #define E0_STEP_PIN 57 #define E0_DIR_PIN 55 #define HEATER_0_PIN 11 -#define TEMP_0_PIN 0 // ANALOG INPUT !! +#define TEMP_0_PIN 0 // ANALOG INPUT !! #define E1_ENABLE_PIN 60 #define E1_STEP_PIN 61 #define E1_DIR_PIN 62 #define HEATER_1_PIN 9 -#define TEMP_1_PIN 9 // 9 for tool3 -> 13 for chambertemp +#define TEMP_1_PIN 9 // 9 for tool2 -> 13 for chambertemp #define E2_ENABLE_PIN 44 #define E2_STEP_PIN 46 @@ -86,9 +86,9 @@ #define LCD_SCREEN_ROT_180 // The encoder and click button -#define BTN_EN1 36 -#define BTN_EN2 34 -#define BTN_ENC 38 +#define BTN_EN1 36 +#define BTN_EN2 34 +#define BTN_ENC 38 // Hardware buttons for manual movement of XYZ #define SHIFT_OUT 42 From ecb23c1b6529130bef6320767efa1035d5e85fee Mon Sep 17 00:00:00 2001 From: Indrek Ardel Date: Mon, 4 Jul 2016 18:32:52 +0300 Subject: [PATCH 357/580] Add Cartesio CN Controls V11 board --- Marlin/boards.h | 1 + Marlin/dogm_lcd_implementation.h | 9 +- .../Cartesio/Configuration.h | 1 + Marlin/pins.h | 3 +- Marlin/pins_CNCONTROLS_11.h | 101 ++++++++++++++++++ 5 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 Marlin/pins_CNCONTROLS_11.h diff --git a/Marlin/boards.h b/Marlin/boards.h index 07ee68a33..bf7be0edf 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -29,6 +29,7 @@ #define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2 #define BOARD_GEN7_13 12 // Gen7 v1.3 #define BOARD_GEN7_14 13 // Gen7 v1.4 +#define BOARD_CNCONTROLS_11 111 // Cartesio CN Controls V11 #define BOARD_CNCONTROLS_12 112 // Cartesio CN Controls V12 #define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0 #define BOARD_SETHI 20 // Sethi 3D_1 diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index be45fb6ca..df9ea2fb1 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -145,8 +145,13 @@ //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); U8GLIB_ST7920_128X64_RRD u8g(0); #elif defined(CARTESIO_UI) - // The CartesioUI display with SW-SPI - U8GLIB_DOGM128 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); + // The CartesioUI display + #if DOGLCD_MOSI != -1 && DOGLCD_SCK != -1 + // using SW-SPI + U8GLIB_DOGM128 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); + #else + U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); + #endif #elif ENABLED(U8GLIB_LM6059_AF) // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0); diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index b4d1f0852..1f4118999 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -118,6 +118,7 @@ // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD + //#define MOTHERBOARD BOARD_CNCONTROLS_11 #define MOTHERBOARD BOARD_CNCONTROLS_12 #endif diff --git a/Marlin/pins.h b/Marlin/pins.h index 1d4de00f8..880084588 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -31,6 +31,8 @@ #include "pins_GEN7_13.h" #elif MB(GEN7_14) #include "pins_GEN7_14.h" +#elif MB(CNCONTROLS_11) + #include "pins_CNCONTROLS_11.h" #elif MB(CNCONTROLS_12) #include "pins_CNCONTROLS_12.h" #elif MB(CHEAPTRONIC) @@ -422,4 +424,3 @@ #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) #endif //__PINS_H - diff --git a/Marlin/pins_CNCONTROLS_11.h b/Marlin/pins_CNCONTROLS_11.h new file mode 100644 index 000000000..1de35a2c1 --- /dev/null +++ b/Marlin/pins_CNCONTROLS_11.h @@ -0,0 +1,101 @@ +/** + * CartesioV11 pin assignments + */ + +#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) + #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. +#endif + +#define BOARD_NAME "CN Controls V11" + +//#define LARGE_FLASH true + +#define X_ENABLE_PIN 35 +#define X_STEP_PIN 34 +#define X_DIR_PIN 36 +#define X_MIN_PIN 43 +#define X_MAX_PIN -1 + +#define Y_ENABLE_PIN 38 +#define Y_STEP_PIN 37 +#define Y_DIR_PIN 39 +#define Y_MIN_PIN 45 +#define Y_MAX_PIN -1 + +#define Z_ENABLE_PIN 41 +#define Z_STEP_PIN 40 +#define Z_DIR_PIN 48 +#define Z_MIN_PIN 42 +#define Z_MAX_PIN -1 + +#define E0_ENABLE_PIN 3 +#define E0_STEP_PIN 29 +#define E0_DIR_PIN 28 +#define HEATER_0_PIN 5 +#define TEMP_0_PIN 0 // ANALOG INPUT !! + +#define E1_ENABLE_PIN 60 +#define E1_STEP_PIN 61 +#define E1_DIR_PIN 62 +#define HEATER_1_PIN 58 +#define TEMP_1_PIN 3 // 3 for tool2 -> 2 for chambertemp + +#define E2_ENABLE_PIN 16 +#define E2_STEP_PIN 15 +#define E2_DIR_PIN 14 +#define HEATER_2_PIN 64 +#define TEMP_2_PIN 2 // 9 for tool3 -> 2 for chambertemp + +#define E3_ENABLE_PIN 47 +#define E3_STEP_PIN 44 +#define E3_DIR_PIN 49 +#define HEATER_3_PIN 46 +#define TEMP_3_PIN 11 // 11 for tool4 -> 2 for chambertemp + +#define HEATER_BED_PIN 2 +#define TEMP_BED_PIN 1 // ANALOG INPUT !! + +// Tools + +//#define TOOL_0_PIN 4 +//#define TOOL_1_PIN 59 +//#define TOOL_2_PIN 8 +//#define TOOL_3_PIN 30 +//#define TOOL_PWM_PIN 7 // common PWM pin for all tools + +// Common I/O + +//#define TEMP_CHAMBER_PIN 2 // ANALOG INPUT !! +//#define FIL_RUNOUT_PIN -1 +//#define PWM_1_PIN 11 +//#define PWM_2_PIN 10 +//#define SPARE_IO 12 +//#define FAN_PIN 7 // common PWM pin for all tools + +// User interface +#define BEEPER_PIN 6 + +// Pins for DOGM SPI LCD Support +#define DOGLCD_A0 26 +#define DOGLCD_CS 24 +#define DOGLCD_MOSI -1 +#define DOGLCD_SCK -1 + +// The encoder and click button +#define BTN_EN1 23 +#define BTN_EN2 25 +#define BTN_ENC 27 + +// Hardware buttons for manual movement of XYZ +#define SHIFT_OUT 19 +#define SHIFT_LD 18 +#define SHIFT_CLK 17 + +//#define UI1 31 +//#define UI2 22 + +// Other +#define SDSS 53 +#define SD_DETECT_PIN 13 +#define STAT_LED_BLUE -1 +#define STAT_LED_RED 31 From ffbb31b2355f4fc92c436e9c6807a1b888b143db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 15 Jul 2016 11:25:34 +0100 Subject: [PATCH 358/580] Fixes an PSTR overflow with print_xyz() --- Marlin/Marlin_main.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 88502e4a2..f8adcfb2d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -580,17 +580,23 @@ static void report_current_position(); SERIAL_ECHOPAIR(", ", y); SERIAL_ECHOPAIR(", ", z); SERIAL_ECHOPGM(")"); - serialprintPGM(suffix); + + if (suffix) serialprintPGM(suffix); + else SERIAL_EOL; } - void print_xyz(const char* prefix,const char* suffix, const float xyz[]) { + + void print_xyz(const char* prefix, const char* suffix, const float xyz[]) { print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); } + #if ENABLED(AUTO_BED_LEVELING_FEATURE) - void print_xyz(const char* prefix,const char* suffix, const vector_3 &xyz) { + void print_xyz(const char* prefix, const char* suffix, const vector_3 &xyz) { print_xyz(prefix, suffix, xyz.x, xyz.y, xyz.z); } #endif - #define DEBUG_POS(SUFFIX,VAR) do{ print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0) + + #define DEBUG_POS(SUFFIX,VAR) do { \ + print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0) #endif #if ENABLED(DELTA) || ENABLED(SCARA) @@ -1657,7 +1663,7 @@ static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0 float old_feedrate = feedrate; #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z); + if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), NULL, x, y, z); #endif #if ENABLED(DELTA) @@ -6626,7 +6632,7 @@ inline void gcode_T(uint8_t tmp_extruder) { delayed_move_time = 0; break; } - + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); From 46994fd17d738d7915a90bc33e5cefce2d35f95c Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 15 Jul 2016 15:02:15 +0200 Subject: [PATCH 359/580] Use do_blicking_move_to*() in G28 --- Marlin/Marlin_main.cpp | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 88502e4a2..4400bc9de 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1709,6 +1709,10 @@ inline void do_blocking_move_to_y(float y) { do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]); } +inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) { + do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate); +} + inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate); } @@ -2110,10 +2114,6 @@ inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { return current_position[Z_AXIS]; } - inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) { - do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate); - } - // // - Move to the given XY // - Deploy the probe, if not already deployed @@ -2885,20 +2885,17 @@ inline void gcode_G28() { if (home_all_axis || homeX || homeY) { // Raise Z before homing any other axes and z is not already high enough (never lower z) - float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING; - if (z_dest > current_position[Z_AXIS]) { + destination[Z_AXIS] = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING; + if (destination[Z_AXIS] > current_position[Z_AXIS]) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest); + SERIAL_ECHOPAIR("Raise Z (before homing) to ", destination[Z_AXIS]); SERIAL_EOL; } #endif - feedrate = homing_feedrate[Z_AXIS]; - line_to_z(z_dest); - stepper.synchronize(); - destination[Z_AXIS] = current_position[Z_AXIS] = z_dest; + do_blocking_move_to_z(destination[Z_AXIS]); } } @@ -2985,8 +2982,6 @@ inline void gcode_G28() { destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER)); destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height - feedrate = XY_PROBE_FEEDRATE; - #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { DEBUG_POS("> Z_SAFE_HOMING > home_all_axis", current_position); @@ -2995,15 +2990,7 @@ inline void gcode_G28() { #endif // Move in the XY plane - line_to_destination(); - stepper.synchronize(); - - /** - * Update the current positions for XY, Z is still at least at - * MIN_Z_HEIGHT_FOR_HOMING height, no changes there. - */ - current_position[X_AXIS] = destination[X_AXIS]; - current_position[Y_AXIS] = destination[Y_AXIS]; + do_blocking_move_to_xy(destination[X_AXIS], destination[Y_AXIS]); } // Let's see if X and Y are homed From d2a49c016d0dcee290b1be00617fe65a6f7d06ee Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 15 Jul 2016 15:20:54 +0200 Subject: [PATCH 360/580] DELTA: Move out of the clip-zone after G28 Move down to a safe height after G28 for DELTAs. --- Marlin/Marlin.h | 1 + Marlin/Marlin_main.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 792001bc6..ec886b680 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -301,6 +301,7 @@ float code_value_temp_diff(); extern float delta_diagonal_rod_trim_tower_3; void calculate_delta(float cartesian[3]); void recalc_delta_settings(float radius, float diagonal_rod); + float delta_safe_distance_from_top(); #if ENABLED(AUTO_BED_LEVELING_FEATURE) extern int delta_grid_spacing[2]; void adjust_delta(float cartesian[3]); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 88502e4a2..3a5261d4c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -322,6 +322,9 @@ float home_offset[3] = { 0 }; // Software Endstops. Default to configured limits. float sw_endstop_min[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float sw_endstop_max[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; +#if ENABLED(DELTA) + float delta_clip_start_height = Z_MAX_POS; +#endif #if FAN_COUNT > 0 int fanSpeeds[FAN_COUNT] = { 0 }; @@ -1435,6 +1438,7 @@ static void update_software_endstops(AxisEnum axis) { sw_endstop_min[axis] = base_min_pos(axis) + offs; sw_endstop_max[axis] = base_max_pos(axis) + offs; } + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("For ", axis_codes[axis]); @@ -1445,6 +1449,13 @@ static void update_software_endstops(AxisEnum axis) { SERIAL_EOL; } #endif + + #if ENABLED(DELTA) + if (axis == Z_AXIS) { + delta_clip_start_height = sw_endstop_max[axis] - delta_safe_distance_from_top(); + } + #endif + } /** @@ -3095,6 +3106,11 @@ inline void gcode_G28() { } #endif + #if ENABLED(DELTA) + // move to a height where we can use the full xy-area + do_blocking_move_to_z(delta_clip_start_height); + #endif + clean_up_after_endstop_or_probe_move(); #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -7535,6 +7551,15 @@ void clamp_to_software_endstops(float target[3]) { */ } + float delta_safe_distance_from_top() { + float cartesian[3] = { 0 }; + calculate_delta(cartesian); + float distance = delta[TOWER_3]; + cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS; + calculate_delta(cartesian); + return abs(distance - delta[TOWER_3]); + } + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // Adjust print surface height by linear interpolation over the bed_level array. From fdea8b6e6afe7390332a8fb6bd3eb2deb928b551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 16 Jul 2016 03:13:02 +0100 Subject: [PATCH 361/580] Moves do_blocking_move_to_xy() out of the HAS_BED_PROBE define --- Marlin/Marlin_main.cpp | 116 ++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 88502e4a2..778941366 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1606,34 +1606,6 @@ inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[ inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); } inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } -// -// Prepare to do endstop or probe moves -// with custom feedrates. -// -// - Save current feedrates -// - Reset the rate multiplier -// - Reset the command timeout -// - Enable the endstops (for endstop moves) -// -static void setup_for_endstop_or_probe_move() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position); - #endif - saved_feedrate = feedrate; - saved_feedrate_multiplier = feedrate_multiplier; - feedrate_multiplier = 100; - refresh_cmd_timeout(); -} - -static void clean_up_after_endstop_or_probe_move() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position); - #endif - feedrate = saved_feedrate; - feedrate_multiplier = saved_feedrate_multiplier; - refresh_cmd_timeout(); -} - #if ENABLED(DELTA) /** * Calculate delta, start a line, and set current_position to destination @@ -1713,6 +1685,38 @@ inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate); } +inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) { + do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate); +} + +// +// Prepare to do endstop or probe moves +// with custom feedrates. +// +// - Save current feedrates +// - Reset the rate multiplier +// - Reset the command timeout +// - Enable the endstops (for endstop moves) +// +static void setup_for_endstop_or_probe_move() { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position); + #endif + saved_feedrate = feedrate; + saved_feedrate_multiplier = feedrate_multiplier; + feedrate_multiplier = 100; + refresh_cmd_timeout(); +} + +static void clean_up_after_endstop_or_probe_move() { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position); + #endif + feedrate = saved_feedrate; + feedrate_multiplier = saved_feedrate_multiplier; + refresh_cmd_timeout(); +} + #if HAS_BED_PROBE /** * Raise Z to a minimum height to make room for a probe to move @@ -1735,33 +1739,31 @@ inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { #endif //HAS_BED_PROBE -#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE || HOTENDS > 1 - static bool axis_unhomed_error(const bool x, const bool y, const bool z) { - const bool xx = x && !axis_homed[X_AXIS], - yy = y && !axis_homed[Y_AXIS], - zz = z && !axis_homed[Z_AXIS]; - if (xx || yy || zz) { - SERIAL_ECHO_START; - SERIAL_ECHOPGM(MSG_HOME " "); - if (xx) SERIAL_ECHOPGM(MSG_X); - if (yy) SERIAL_ECHOPGM(MSG_Y); - if (zz) SERIAL_ECHOPGM(MSG_Z); - SERIAL_ECHOLNPGM(" " MSG_FIRST); - - #if ENABLED(ULTRA_LCD) - char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1 - strcat_P(message, PSTR(MSG_HOME " ")); - if (xx) strcat_P(message, PSTR(MSG_X)); - if (yy) strcat_P(message, PSTR(MSG_Y)); - if (zz) strcat_P(message, PSTR(MSG_Z)); - strcat_P(message, PSTR(" " MSG_FIRST)); - lcd_setstatus(message); - #endif - return true; - } - return false; +static bool axis_unhomed_error(const bool x, const bool y, const bool z) { + const bool xx = x && !axis_homed[X_AXIS], + yy = y && !axis_homed[Y_AXIS], + zz = z && !axis_homed[Z_AXIS]; + if (xx || yy || zz) { + SERIAL_ECHO_START; + SERIAL_ECHOPGM(MSG_HOME " "); + if (xx) SERIAL_ECHOPGM(MSG_X); + if (yy) SERIAL_ECHOPGM(MSG_Y); + if (zz) SERIAL_ECHOPGM(MSG_Z); + SERIAL_ECHOLNPGM(" " MSG_FIRST); + + #if ENABLED(ULTRA_LCD) + char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1 + strcat_P(message, PSTR(MSG_HOME " ")); + if (xx) strcat_P(message, PSTR(MSG_X)); + if (yy) strcat_P(message, PSTR(MSG_Y)); + if (zz) strcat_P(message, PSTR(MSG_Z)); + strcat_P(message, PSTR(" " MSG_FIRST)); + lcd_setstatus(message); + #endif + return true; } -#endif + return false; +} #if ENABLED(Z_PROBE_SLED) @@ -2110,10 +2112,6 @@ inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { return current_position[Z_AXIS]; } - inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) { - do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate); - } - // // - Move to the given XY // - Deploy the probe, if not already deployed @@ -6626,7 +6624,7 @@ inline void gcode_T(uint8_t tmp_extruder) { delayed_move_time = 0; break; } - + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); From af9b1d79b1e004d95cc95bb01257c605ad0ed97e Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 16 Jul 2016 18:39:22 +0900 Subject: [PATCH 362/580] Follow-up and fix the PR #4287 (Allow stopwatch and printcounter to go over 18:12:15) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Remove MSG_END_HOUR and MSG_END_MINUTE from all the language files ・Change from MSG_INFO_TOTAL_PRINTS to MSG_INFO_PRINT_COUNT in German file --- Marlin/language_an.h | 2 -- Marlin/language_bg.h | 2 -- Marlin/language_ca.h | 2 -- Marlin/language_cn.h | 2 -- Marlin/language_cz.h | 2 -- Marlin/language_da.h | 2 -- Marlin/language_de.h | 4 +--- Marlin/language_el-gr.h | 2 -- Marlin/language_el.h | 2 -- Marlin/language_en.h | 6 ------ Marlin/language_es.h | 2 -- Marlin/language_eu.h | 2 -- Marlin/language_fi.h | 2 -- Marlin/language_fr.h | 2 -- Marlin/language_gl.h | 2 -- Marlin/language_hr.h | 2 -- Marlin/language_it.h | 2 -- Marlin/language_kana.h | 2 -- Marlin/language_kana_utf8.h | 2 -- Marlin/language_nl.h | 2 -- Marlin/language_pl.h | 2 -- Marlin/language_pt-br.h | 2 -- Marlin/language_pt-br_utf8.h | 2 -- Marlin/language_pt.h | 2 -- Marlin/language_pt_utf8.h | 2 -- Marlin/language_ru.h | 2 -- 26 files changed, 1 insertion(+), 57 deletions(-) diff --git a/Marlin/language_an.h b/Marlin/language_an.h index 2423275d9..bfabc0a57 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -148,8 +148,6 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" -#define MSG_END_HOUR "hours" -#define MSG_END_MINUTE "minutes" #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index 8b4290467..51606947c 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -150,8 +150,6 @@ #define MSG_BABYSTEP_Y "Министъпка Y" #define MSG_BABYSTEP_Z "Министъпка Z" #define MSG_ENDSTOP_ABORT "Стоп Кр.Изключватели" -#define MSG_END_HOUR "часа" -#define MSG_END_MINUTE "минути" #define MSG_DELTA_CALIBRATE "Делта Калибровка" #define MSG_DELTA_CALIBRATE_X "Калибровка X" #define MSG_DELTA_CALIBRATE_Y "Калибровка Y" diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 27f9ff475..b90f1c395 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -149,8 +149,6 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" -#define MSG_END_HOUR "hours" -#define MSG_END_MINUTE "minutes" #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index dc102d7bf..86c639dfa 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -153,8 +153,6 @@ #define MSG_ERR_MAXTEMP "Err: MAXTEMP" #define MSG_ERR_MINTEMP "Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" -#define MSG_END_HOUR "hours" -#define MSG_END_MINUTE "minutes" #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index f8e4cec24..54a8ae5de 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -189,8 +189,6 @@ #define MSG_ERR_MINTEMP_BED "NIZ. TEPL. PODL." #define MSG_HALTED "TISK. ZASTAVENA" #define MSG_PLEASE_RESET "Provedte reset" -#define MSG_END_HOUR "hod" -#define MSG_END_MINUTE "min" #define MSG_HEATING "Zahrivani..." #define MSG_HEATING_COMPLETE "Zahrati hotovo." #define MSG_BED_HEATING "Zahrivani podl." diff --git a/Marlin/language_da.h b/Marlin/language_da.h index 833a6b26a..b107ca05d 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -184,8 +184,6 @@ #define MSG_ERR_MINTEMP "Fejl: Min temp" #define MSG_ERR_MAXTEMP_BED "Fejl: Maks Plsde temp" #define MSG_ERR_MINTEMP_BED "Fejl: Min Plade temp" -#define MSG_END_HOUR "Timer" -#define MSG_END_MINUTE "Minutter" #define MSG_HEATING "Opvarmer..." #define MSG_HEATING_COMPLETE "Opvarmet" #define MSG_BED_HEATING "Opvarmer plade" diff --git a/Marlin/language_de.h b/Marlin/language_de.h index f9e2644aa..9744378fc 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -159,8 +159,6 @@ #define MSG_ERR_MINTEMP LCD_STR_THERMOMETER " UNTERSCHRITTEN" #define MSG_ERR_MAXTEMP_BED "BETT " LCD_STR_THERMOMETER " ÜBERSCHRITTEN" #define MSG_ERR_MINTEMP_BED "BETT " LCD_STR_THERMOMETER " UNTERSCHRITTEN" -#define MSG_END_HOUR "Stunden" -#define MSG_END_MINUTE "Minuten" #define MSG_HEATING "Aufheizen..." #define MSG_HEATING_COMPLETE "Aufgeheizt" #define MSG_BED_HEATING "Bett aufheizen" @@ -181,7 +179,7 @@ #define MSG_INFO_PROTOCOL "Protokol" #if LCD_WIDTH > 19 - #define MSG_INFO_TOTAL_PRINTS "Gesamte Drucke " + #define MSG_INFO_PRINT_COUNT "Gesamte Drucke " #define MSG_INFO_COMPLETED_PRINTS "Beendete Drucke " #define MSG_INFO_PRINT_TIME "Gesamte Druckzeit" #else diff --git a/Marlin/language_el-gr.h b/Marlin/language_el-gr.h index 9a55eb0c8..510e8aae3 100644 --- a/Marlin/language_el-gr.h +++ b/Marlin/language_el-gr.h @@ -185,8 +185,6 @@ #define MSG_ERR_MINTEMP "Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ" #define MSG_ERR_MAXTEMP_BED "Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ" #define MSG_ERR_MINTEMP_BED "Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ" -#define MSG_END_HOUR "ώρες" -#define MSG_END_MINUTE "λεπτά" #define MSG_HEATING "Θερμαίνεται…" #define MSG_HEATING_COMPLETE "Η θέρμανση ολοκληρώθηκε." #define MSG_BED_HEATING "Θέρμανση κλίνης." diff --git a/Marlin/language_el.h b/Marlin/language_el.h index f0d94db10..9d1c8555a 100644 --- a/Marlin/language_el.h +++ b/Marlin/language_el.h @@ -187,8 +187,6 @@ #define MSG_ERR_MINTEMP_BED "ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ" //SHORTEN #define MSG_HALTED "H εκτύπωση διακόπηκε" #define MSG_PLEASE_RESET "PLEASE RESET" //TRANSLATE -#define MSG_END_HOUR "ώρες" -#define MSG_END_MINUTE "λεπτά" #define MSG_HEATING "Θερμαίνεται…" #define MSG_HEATING_COMPLETE "Η θέρμανση ολοκληρώθηκε." //SHORTEN #define MSG_BED_HEATING "Θέρμανση ΕΠ. Εκτύπωσης" //SHORTEN diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 27444aebd..a1b38a1a9 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -491,12 +491,6 @@ #ifndef MSG_END_DAY #define MSG_END_DAY "days" #endif -#ifndef MSG_END_HOUR - #define MSG_END_HOUR "hours" -#endif -#ifndef MSG_END_MINUTE - #define MSG_END_MINUTE "minutes" -#endif #ifndef MSG_PRINT_TIME #define MSG_PRINT_TIME "Print time" #endif diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 8647a50fa..2943fcf96 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -182,8 +182,6 @@ #define MSG_ERR_MINTEMP "Error: Temp Minima" #define MSG_ERR_MAXTEMP_BED "Error: Temp Max Plataforma" #define MSG_ERR_MINTEMP_BED "Error: Temp Min Plataforma" -#define MSG_END_HOUR "horas" -#define MSG_END_MINUTE "minutos" #define MSG_HEATING "Calentando..." #define MSG_HEATING_COMPLETE "Calentamiento Completo" #define MSG_BED_HEATING "Calentando plataforma ..." diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 2b246e20d..909d6c85d 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -148,8 +148,6 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop deuseztat" -#define MSG_END_HOUR "hours" -#define MSG_END_MINUTE "minutes" #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index f3f4db27e..b73a207e2 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -149,8 +149,6 @@ #define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Z "Babystep Z" #define MSG_ENDSTOP_ABORT "Endstop abort" -#define MSG_END_HOUR "hours" -#define MSG_END_MINUTE "minutes" #define MSG_DELTA_CALIBRATE "Delta Kalibrointi" #define MSG_DELTA_CALIBRATE_X "Kalibroi X" #define MSG_DELTA_CALIBRATE_Y "Kalibroi Y" diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 30c45e78a..52adbcba0 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -158,8 +158,6 @@ #define MSG_ERR_MINTEMP "Err: TEMP. MIN" #define MSG_ERR_MAXTEMP_BED "Err: TEMP. MAX PLATEAU" #define MSG_ERR_MINTEMP_BED "Err: TEMP. MIN PLATEAU" -#define MSG_END_HOUR "heures" -#define MSG_END_MINUTE "minutes" #define MSG_HEATING "En chauffe..." #define MSG_HEATING_COMPLETE "Chauffe terminee" #define MSG_BED_HEATING "Plateau en chauffe..." diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h index 87453b81c..c899c63fd 100644 --- a/Marlin/language_gl.h +++ b/Marlin/language_gl.h @@ -184,8 +184,6 @@ #define MSG_ERR_MINTEMP "Err: temp. min." #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED" -#define MSG_END_HOUR "horas" -#define MSG_END_MINUTE "minutos" #define MSG_HEATING "Quentando..." #define MSG_HEATING_COMPLETE "Xa esta quente" #define MSG_BED_HEATING "Quentando cama" diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h index 83742ded9..603521506 100644 --- a/Marlin/language_hr.h +++ b/Marlin/language_hr.h @@ -184,8 +184,6 @@ #define MSG_ERR_MINTEMP "Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED" -#define MSG_END_HOUR "sati" -#define MSG_END_MINUTE "minuta" #define MSG_HEATING "Grijanje..." #define MSG_HEATING_COMPLETE "Grijanje gotovo." #define MSG_BED_HEATING "Grijanje Bed-a." diff --git a/Marlin/language_it.h b/Marlin/language_it.h index e393f5911..2bf9a5f0f 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -163,8 +163,6 @@ #define MSG_ERR_MINTEMP "Err: TEMP MINIMA" #define MSG_ERR_MAXTEMP_BED "Err: TEMP MASSIMA PIATTO" #define MSG_ERR_MINTEMP_BED "Err: TEMP MINIMA PIATTO" -#define MSG_END_HOUR "ore" -#define MSG_END_MINUTE "minuti" #define MSG_HEATING "Riscaldamento.." #define MSG_HEATING_COMPLETE "Risc. completato" #define MSG_BED_HEATING "Risc. Piatto.." diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 894bda043..81c020ac9 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -220,8 +220,6 @@ #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:ベッド サイコウオンチョウカ" ("Err: MAXTEMP BED") #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:ベッド サイテイオンミマン" ("Err: MINTEMP BED") #endif -#define MSG_END_HOUR "\xbc\xde\xb6\xdd" // "ジカン" ("hours") -#define MSG_END_MINUTE "\xcc\xdd" // "フン" ("minutes") #define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3" // "カネツチュウ" ("Heating...") #define MSG_HEATING_COMPLETE "\xb6\xc8\xc2\xb6\xdd\xd8\xae\xb3" // "カネツカンリョウ" ("Heating done.") #define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xc1\xad\xb3" // "ベッド カネツチュウ" ("Bed Heating.") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index b91212607..46aba87d2 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -169,8 +169,6 @@ #define MSG_ERR_MINTEMP "エラー:サイテイオンミマン" // "Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED "エラー:ベッド サイコウオンチョウカ" // "Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED "エラー:ベッド サイテイオンミマン" // "Err: MINTEMP BED" -#define MSG_END_HOUR "ジカン" // "hours" -#define MSG_END_MINUTE "フン" // "minutes" #define MSG_HEATING "カネツチュウ" // "Heating..." #define MSG_HEATING_COMPLETE "カネツカンリョウ" // "Heating done." #define MSG_BED_HEATING "ベッド カネツチュウ" // "Bed Heating." diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 1b1f91877..5f682bd90 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -157,8 +157,6 @@ #define MSG_ERR_MINTEMP "Err: Min. temp" #define MSG_ERR_MAXTEMP_BED "Err: Max.tmp bed" #define MSG_ERR_MINTEMP_BED "Err: Min.tmp bed" -#define MSG_END_HOUR "uur" -#define MSG_END_MINUTE "minuten" #define MSG_HEATING "Voorwarmen..." #define MSG_HEATING_COMPLETE "Voorverw. kompl." #define MSG_BED_HEATING "Bed voorverw." diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 8df809b62..b1559c4a4 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -180,8 +180,6 @@ #define MSG_ERR_MINTEMP "Err: min. temp." #define MSG_ERR_MAXTEMP_BED "Err: max. temp. loza" #define MSG_ERR_MINTEMP_BED "Err: min. temp. loza" -#define MSG_END_HOUR "godzin" -#define MSG_END_MINUTE "minut" #define MSG_HEATING "Rozgrzewanie..." #define MSG_HEATING_COMPLETE "Rozgrzano" #define MSG_BED_HEATING "Rozgrzewanie loza..." diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index c8914fc4e..3db6e15c7 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -157,8 +157,6 @@ #define MSG_ERR_MINTEMP "Err: T Minima" #define MSG_ERR_MAXTEMP_BED "Err: T Base Maxima" #define MSG_ERR_MINTEMP_BED "Err: T Base Minima" -#define MSG_END_HOUR "Horas" -#define MSG_END_MINUTE "Minutos" #define MSG_HEATING "Aquecendo..." #define MSG_HEATING_COMPLETE "Aquecida." #define MSG_BED_HEATING "Aquecendo base.." diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index 48731438b..a556c2430 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -157,8 +157,6 @@ #define MSG_ERR_MINTEMP "Err: T Mínima" #define MSG_ERR_MAXTEMP_BED "Err: T Base Máxima" #define MSG_ERR_MINTEMP_BED "Err: T Base Mínima" -#define MSG_END_HOUR "Horas" -#define MSG_END_MINUTE "Minutos" #define MSG_HEATING "Aquecendo..." #define MSG_HEATING_COMPLETE "Aquecida." #define MSG_BED_HEATING "Aquecendo base.." diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index b7c562c20..a0df879fc 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -165,8 +165,6 @@ #define MSG_ERR_MINTEMP "Err: T Minima" #define MSG_ERR_MAXTEMP_BED "Err: T Base Maxima" #define MSG_ERR_MINTEMP_BED "Err: T Base Minima" -#define MSG_END_HOUR "horas" -#define MSG_END_MINUTE "minutos" #define MSG_HEATING "Aquecendo..." #define MSG_HEATING_COMPLETE "Aquecida." #define MSG_BED_HEATING "Aquecendo base.." diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h index ac8b2440c..24ce828b5 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -165,8 +165,6 @@ #define MSG_ERR_MINTEMP "Err: T Mínima" #define MSG_ERR_MAXTEMP_BED "Err: T Base Máxima" #define MSG_ERR_MINTEMP_BED "Err: T Base Mínima" -#define MSG_END_HOUR "horas" -#define MSG_END_MINUTE "minutos" #define MSG_HEATING "Aquecendo..." #define MSG_HEATING_COMPLETE "Aquecida." #define MSG_BED_HEATING "Aquecendo base.." diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index c86e34983..aa381c88f 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -156,8 +156,6 @@ #define MSG_ERR_MINTEMP "Ошибка: Т мин." #define MSG_ERR_MAXTEMP_BED "Ошибка:Т макс.стол" #define MSG_ERR_MINTEMP_BED "Ошибка:Т мин.стол" -#define MSG_END_HOUR "часов" -#define MSG_END_MINUTE "минут" #define MSG_HEATING "Нагреваю сопло..." #define MSG_HEATING_COMPLETE "Нагрев выполнен" #define MSG_BED_HEATING "Нагреваю стол" From 5f368d1bc30c6542bc86f45e981330ed9ad6ead4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 16 Jul 2016 11:57:35 +0100 Subject: [PATCH 363/580] Followup for #4320 --- Marlin/Marlin_main.cpp | 54 ++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d4c7846f2..5091c421c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1706,10 +1706,6 @@ inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate); } -inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) { - do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate); -} - // // Prepare to do endstop or probe moves // with custom feedrates. @@ -1760,31 +1756,33 @@ static void clean_up_after_endstop_or_probe_move() { #endif //HAS_BED_PROBE -static bool axis_unhomed_error(const bool x, const bool y, const bool z) { - const bool xx = x && !axis_homed[X_AXIS], - yy = y && !axis_homed[Y_AXIS], - zz = z && !axis_homed[Z_AXIS]; - if (xx || yy || zz) { - SERIAL_ECHO_START; - SERIAL_ECHOPGM(MSG_HOME " "); - if (xx) SERIAL_ECHOPGM(MSG_X); - if (yy) SERIAL_ECHOPGM(MSG_Y); - if (zz) SERIAL_ECHOPGM(MSG_Z); - SERIAL_ECHOLNPGM(" " MSG_FIRST); - - #if ENABLED(ULTRA_LCD) - char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1 - strcat_P(message, PSTR(MSG_HOME " ")); - if (xx) strcat_P(message, PSTR(MSG_X)); - if (yy) strcat_P(message, PSTR(MSG_Y)); - if (zz) strcat_P(message, PSTR(MSG_Z)); - strcat_P(message, PSTR(" " MSG_FIRST)); - lcd_setstatus(message); - #endif - return true; +#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) + static bool axis_unhomed_error(const bool x, const bool y, const bool z) { + const bool xx = x && !axis_homed[X_AXIS], + yy = y && !axis_homed[Y_AXIS], + zz = z && !axis_homed[Z_AXIS]; + if (xx || yy || zz) { + SERIAL_ECHO_START; + SERIAL_ECHOPGM(MSG_HOME " "); + if (xx) SERIAL_ECHOPGM(MSG_X); + if (yy) SERIAL_ECHOPGM(MSG_Y); + if (zz) SERIAL_ECHOPGM(MSG_Z); + SERIAL_ECHOLNPGM(" " MSG_FIRST); + + #if ENABLED(ULTRA_LCD) + char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1 + strcat_P(message, PSTR(MSG_HOME " ")); + if (xx) strcat_P(message, PSTR(MSG_X)); + if (yy) strcat_P(message, PSTR(MSG_Y)); + if (zz) strcat_P(message, PSTR(MSG_Z)); + strcat_P(message, PSTR(" " MSG_FIRST)); + lcd_setstatus(message); + #endif + return true; + } + return false; } - return false; -} +#endif #if ENABLED(Z_PROBE_SLED) From c711701626d9309f391065b99aa78115a4d7f177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 14 Jul 2016 16:29:04 +0100 Subject: [PATCH 364/580] Implements a nozzle parking command (G27) --- .travis.yml | 10 +- Marlin/Configuration.h | 24 +++++ Marlin/Marlin_main.cpp | 27 +++++- Marlin/nozzle.h | 203 +++++++++++++++++++++++++---------------- 4 files changed, 179 insertions(+), 85 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4d003a95d..5d7b7b6f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -211,10 +211,16 @@ script: - opt_enable PRINTCOUNTER - build_marlin # - # Test CLEAN_NOZZLE_FEATURE + # Test NOZZLE_PARK_FEATURE # - restore_configs - - opt_enable AUTO_BED_LEVELING_FEATURE CLEAN_NOZZLE_FEATURE FIX_MOUNTED_PROBE + - opt_enable NOZZLE_PARK_FEATURE + - build_marlin + # + # Test NOZZLE_CLEAN_FEATURE + # + - restore_configs + - opt_enable AUTO_BED_LEVELING_FEATURE NOZZLE_CLEAN_FEATURE FIX_MOUNTED_PROBE - build_marlin # # diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 96cb58068..27be90b7c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -787,6 +787,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5091c421c..9960c02f2 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2736,9 +2736,12 @@ inline void gcode_G4() { #endif //FWRETRACT -#if ENABLED(NOZZLE_CLEAN_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE) +#if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE #include "nozzle.h" + /** + * G12: Clean the nozzle + */ inline void gcode_G12() { // Don't allow nozzle cleaning without homing first if (axis_unhomed_error(true, true, true)) { return; } @@ -2795,6 +2798,20 @@ inline void gcode_G4() { #endif // QUICK_HOME +#if ENABLED(NOZZLE_PARK_FEATURE) + #include "nozzle.h" + + /** + * G27: Park the nozzle + */ + inline void gcode_G27() { + // Don't allow nozzle parking without homing first + if (axis_unhomed_error(true, true, true)) { return; } + uint8_t const z_action = code_seen('P') ? code_value_ushort() : 0; + Nozzle::park(z_action); + } +#endif // NOZZLE_PARK_FEATURE + /** * G28: Home all axes according to settings * @@ -6884,7 +6901,7 @@ void process_next_command() { #if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE case 12: - gcode_G12(); // G12: Clean Nozzle + gcode_G12(); // G12: Nozzle Clean break; #endif // NOZZLE_CLEAN_FEATURE @@ -6898,6 +6915,12 @@ void process_next_command() { break; #endif // INCH_MODE_SUPPORT + #if ENABLED(NOZZLE_PARK_FEATURE) + case 27: // G27: Nozzle Park + gcode_G27(); + break; + #endif // NOZZLE_PARK_FEATURE + case 28: // G28: Home all axes, one at a time gcode_G28(); break; diff --git a/Marlin/nozzle.h b/Marlin/nozzle.h index 02771a516..3e9ae879c 100644 --- a/Marlin/nozzle.h +++ b/Marlin/nozzle.h @@ -30,8 +30,6 @@ * @brief Nozzle class * * @todo: Do not ignore the end.z value and allow XYZ movements - * @todo: Currently this feature needs HAS_BED_PROBE to be active - * due to the do_blocking_move_to*() functions. */ class Nozzle { private: @@ -43,34 +41,40 @@ class Nozzle { * @param end point_t defining the ending point * @param strokes number of strokes to execute */ - static void stroke(point_t const &start, point_t const &end, uint8_t const &strokes) - __attribute__ ((optimize ("Os"))) { - - #if ENABLED(NOZZLE_CLEAN_PARK) - // Store the current coords - point_t const initial = { - current_position[X_AXIS], - current_position[Y_AXIS], - current_position[Z_AXIS], - current_position[E_AXIS] - }; - #endif - - // Move to the starting point - do_blocking_move_to_xy(start.x, start.y); - do_blocking_move_to_z(start.z); - - // Start the stroke pattern - for (uint8_t i = 0; i < (strokes >>1); i++) { - do_blocking_move_to_xy(end.x, end.y); + static void stroke( + __attribute__((unused)) point_t const &start, + __attribute__((unused)) point_t const &end, + __attribute__((unused)) uint8_t const &strokes + ) __attribute__((optimize ("Os"))) { + #if ENABLED(NOZZLE_CLEAN_FEATURE) + + #if ENABLED(NOZZLE_CLEAN_PARK) + // Store the current coords + point_t const initial = { + current_position[X_AXIS], + current_position[Y_AXIS], + current_position[Z_AXIS], + current_position[E_AXIS] + }; + #endif // NOZZLE_CLEAN_PARK + + // Move to the starting point do_blocking_move_to_xy(start.x, start.y); - } + do_blocking_move_to_z(start.z); - #if ENABLED(NOZZLE_CLEAN_PARK) - // Move the nozzle to the initial point - do_blocking_move_to_z(initial.z); - do_blocking_move_to_xy(initial.x, initial.y); - #endif + // Start the stroke pattern + for (uint8_t i = 0; i < (strokes >>1); i++) { + do_blocking_move_to_xy(end.x, end.y); + do_blocking_move_to_xy(start.x, start.y); + } + + #if ENABLED(NOZZLE_CLEAN_PARK) + // Move the nozzle to the initial point + do_blocking_move_to_z(initial.z); + do_blocking_move_to_xy(initial.x, initial.y); + #endif // NOZZLE_CLEAN_PARK + + #endif // NOZZLE_CLEAN_FEATURE } /** @@ -82,47 +86,53 @@ class Nozzle { * @param strokes number of strokes to execute * @param objects number of objects to create */ - static void zigzag(point_t const &start, - point_t const &end, uint8_t const &strokes, uint8_t const &objects) - __attribute__ ((optimize ("Os"))) { - float A = fabs(end.y - start.y); // [twice the] Amplitude - float P = fabs(end.x - start.x) / (objects << 1); // Period - - // Don't allow impossible triangles - if (A <= 0.0f || P <= 0.0f ) return; - - #if ENABLED(NOZZLE_CLEAN_PARK) - // Store the current coords - point_t const initial = { - current_position[X_AXIS], - current_position[Y_AXIS], - current_position[Z_AXIS], - current_position[E_AXIS] - }; - #endif - - for (uint8_t j = 0; j < strokes; j++) { - for (uint8_t i = 0; i < (objects << 1); i++) { - float const x = start.x + i * P; - float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)); - - do_blocking_move_to_xy(x, y); - if (i == 0) do_blocking_move_to_z(start.z); + static void zigzag( + __attribute__((unused)) point_t const &start, + __attribute__((unused)) point_t const &end, + __attribute__((unused)) uint8_t const &strokes, + __attribute__((unused)) uint8_t const &objects + ) __attribute__((optimize ("Os"))) { + #if ENABLED(NOZZLE_CLEAN_FEATURE) + float A = fabs(end.y - start.y); // [twice the] Amplitude + float P = fabs(end.x - start.x) / (objects << 1); // Period + + // Don't allow impossible triangles + if (A <= 0.0f || P <= 0.0f ) return; + + #if ENABLED(NOZZLE_CLEAN_PARK) + // Store the current coords + point_t const initial = { + current_position[X_AXIS], + current_position[Y_AXIS], + current_position[Z_AXIS], + current_position[E_AXIS] + }; + #endif // NOZZLE_CLEAN_PARK + + for (uint8_t j = 0; j < strokes; j++) { + for (uint8_t i = 0; i < (objects << 1); i++) { + float const x = start.x + i * P; + float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)); + + do_blocking_move_to_xy(x, y); + if (i == 0) do_blocking_move_to_z(start.z); + } + + for (int i = (objects << 1); i > -1; i--) { + float const x = start.x + i * P; + float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)); + + do_blocking_move_to_xy(x, y); + } } - for (int i = (objects << 1); i > -1; i--) { - float const x = start.x + i * P; - float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)); + #if ENABLED(NOZZLE_CLEAN_PARK) + // Move the nozzle to the initial point + do_blocking_move_to_z(initial.z); + do_blocking_move_to_xy(initial.x, initial.y); + #endif // NOZZLE_CLEAN_PARK - do_blocking_move_to_xy(x, y); - } - } - - #if ENABLED(NOZZLE_CLEAN_PARK) - // Move the nozzle to the initial point - do_blocking_move_to_z(initial.z); - do_blocking_move_to_xy(initial.x, initial.y); - #endif + #endif // NOZZLE_CLEAN_FEATURE } public: @@ -133,21 +143,52 @@ class Nozzle { * @param pattern one of the available patterns * @param argument depends on the cleaning pattern */ - static void clean(uint8_t const &pattern, - uint8_t const &strokes, uint8_t const &objects = 0) - __attribute__ ((optimize ("Os"))) { - switch (pattern) { - case 1: - Nozzle::zigzag( - NOZZLE_CLEAN_START_PT, - NOZZLE_CLEAN_END_PT, strokes, objects); - break; - - default: - Nozzle::stroke( - NOZZLE_CLEAN_START_PT, - NOZZLE_CLEAN_END_PT, strokes); - } + static void clean( + __attribute__((unused)) uint8_t const &pattern, + __attribute__((unused)) uint8_t const &strokes, + __attribute__((unused)) uint8_t const &objects = 0 + ) __attribute__((optimize ("Os"))) { + #if ENABLED(NOZZLE_CLEAN_FEATURE) + switch (pattern) { + case 1: + Nozzle::zigzag( + NOZZLE_CLEAN_START_PT, + NOZZLE_CLEAN_END_PT, strokes, objects); + break; + + default: + Nozzle::stroke( + NOZZLE_CLEAN_START_PT, + NOZZLE_CLEAN_END_PT, strokes); + } + #endif // NOZZLE_CLEAN_FEATURE + } + + static void park( + __attribute__((unused)) uint8_t const &z_action + ) __attribute__((optimize ("Os"))) { + #if ENABLED(NOZZLE_PARK_FEATURE) + float const z = current_position[Z_AXIS]; + point_t const park = NOZZLE_PARK_POINT; + + switch(z_action) { + case 1: // force Z-park height + do_blocking_move_to_z(park.z); + break; + + case 2: // Raise by Z-park height + do_blocking_move_to_z( + (z + park.z > Z_MAX_POS) ? Z_MAX_POS : z + park.z); + break; + + default: // Raise to Z-park height if lower + if (current_position[Z_AXIS] < park.z) + do_blocking_move_to_z(park.z); + } + + do_blocking_move_to_xy(park.x, park.y); + + #endif // NOZZLE_PARK_FEATURE } }; From 336481ea8130daff6ebfe208b53a3e07807a6ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 14 Jul 2016 16:42:58 +0100 Subject: [PATCH 365/580] Added G27 configuration options to all configs --- .../Cartesio/Configuration.h | 24 +++++++++++++++++++ .../Felix/Configuration.h | 24 +++++++++++++++++++ .../Felix/DUAL/Configuration.h | 24 +++++++++++++++++++ .../Hephestos/Configuration.h | 24 +++++++++++++++++++ .../Hephestos_2/Configuration.h | 24 +++++++++++++++++++ .../K8200/Configuration.h | 24 +++++++++++++++++++ .../K8400/Configuration.h | 24 +++++++++++++++++++ .../K8400/Dual-head/Configuration.h | 24 +++++++++++++++++++ .../RepRapWorld/Megatronics/Configuration.h | 24 +++++++++++++++++++ .../RigidBot/Configuration.h | 24 +++++++++++++++++++ .../SCARA/Configuration.h | 24 +++++++++++++++++++ .../TAZ4/Configuration.h | 24 +++++++++++++++++++ .../WITBOX/Configuration.h | 24 +++++++++++++++++++ .../adafruit/ST7565/Configuration.h | 24 +++++++++++++++++++ .../delta/biv2.5/Configuration.h | 24 +++++++++++++++++++ .../delta/generic/Configuration.h | 24 +++++++++++++++++++ .../delta/kossel_mini/Configuration.h | 24 +++++++++++++++++++ .../delta/kossel_pro/Configuration.h | 24 +++++++++++++++++++ .../delta/kossel_xl/Configuration.h | 24 +++++++++++++++++++ .../makibox/Configuration.h | 24 +++++++++++++++++++ .../tvrrug/Round2/Configuration.h | 24 +++++++++++++++++++ 21 files changed, 504 insertions(+) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index b4d1f0852..8cad9204e 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -786,6 +786,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 50ace1c2d..eb9553f9e 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -770,6 +770,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 3c2be5a22..996205cb1 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -768,6 +768,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 31ac6728f..5c7f504fe 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -779,6 +779,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 648df90a0..020f98be4 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -781,6 +781,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 37fe86722..8a34167bd 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -804,6 +804,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 60 // K8200: set back to 110 if you have an upgraded heatbed power supply #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index c900fc263..656e8c2ec 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -787,6 +787,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 0 #define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index d69c5bdfe..f69fd3b5b 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -787,6 +787,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 0 #define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 315010fe8..7e2abad98 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -787,6 +787,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 829c8d8a5..67277b9ad 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -785,6 +785,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 4d32f85a7..5db09f202 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -795,6 +795,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index f8f49db47..f864675f0 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -808,6 +808,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d4102ef99..f45dde22c 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -779,6 +779,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 2bb90a191..6d954811b 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -787,6 +787,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 981ae59dd..dc65d382d 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -882,6 +882,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 2fed91a1a..ba2bda57f 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -876,6 +876,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 9e97af3c3..5dc35adcd 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -879,6 +879,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 2b49bd039..cfb5ec178 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -879,6 +879,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 258ba72c9..7125ceeb4 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -881,6 +881,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index c51d75d36..2477d981e 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -790,6 +790,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index eeee65304..531dc7069 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -781,6 +781,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 +// +// Nozzle Park -- EXPERIMENTAL +// +// When enabled allows the user to define a special XYZ position, inside the +// machine's topology, to park the nozzle when idle or when receiving the G27 +// command. +// +// The "P" paramenter controls what is the action applied to the Z axis: +// P0: (Default) If current Z-pos is lower than Z-park then the nozzle will +// be raised to reach Z-park height. +// +// P1: No matter the current Z-pos, the nozzle will be raised/lowered to +// reach Z-park height. +// +// P2: The nozzle height will be raised by Z-park amount but never going over +// the machine's limit of Z_MAX_POS. +// +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } +#endif + // // Clean Nozzle Feature -- EXPERIMENTAL // From 2f26bc2153de22693ae7df67dd83eb3928567492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 14 Jul 2016 02:18:59 +0100 Subject: [PATCH 366/580] Adds filamentUsed and longestPrint stats to PrintCounter --- Marlin/Marlin_main.cpp | 6 +++ Marlin/language.h | 1 + Marlin/printcounter.cpp | 86 ++++++++++++++++++++++++++++++++--------- Marlin/printcounter.h | 14 ++++++- 4 files changed, 87 insertions(+), 20 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5091c421c..016502bc0 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2564,8 +2564,14 @@ void gcode_get_destination() { else destination[i] = current_position[i]; } + if (code_seen('F') && code_value_linear_units() > 0.0) feedrate = code_value_linear_units(); + + #if ENABLED(PRINTCOUNTER) + if(!DEBUGGING(DRYRUN)) + print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]); + #endif } void unknown_command_error() { diff --git a/Marlin/language.h b/Marlin/language.h index 2e74e42d2..093368333 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -119,6 +119,7 @@ #define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: " #define MSG_OK "ok" #define MSG_WAIT "wait" +#define MSG_STATS "Stats: " #define MSG_FILE_SAVED "Done saving file." #define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: " #define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: " diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp index 6e875fabc..489503c3a 100644 --- a/Marlin/printcounter.cpp +++ b/Marlin/printcounter.cpp @@ -41,13 +41,25 @@ bool PrintCounter::isLoaded() { return this->loaded; } +void PrintCounter::incFilamentUsed(double const &amount) { + #if ENABLED(DEBUG_PRINTCOUNTER) + PrintCounter::debug(PSTR("incFilamentUsed")); + #endif + + // Refuses to update data if object is not loaded + if (!this->isLoaded()) return; + + this->data.filamentUsed += amount; // mm +} + + void PrintCounter::initStats() { #if ENABLED(DEBUG_PRINTCOUNTER) PrintCounter::debug(PSTR("initStats")); #endif this->loaded = true; - this->data = { 0, 0, 0, 0 }; + this->data = { 0, 0, 0, 0, 0.0 }; this->saveStats(); eeprom_write_byte((uint8_t *) this->address, 0x16); @@ -60,7 +72,8 @@ void PrintCounter::loadStats() { // Checks if the EEPROM block is initialized if (eeprom_read_byte((uint8_t *) this->address) != 0x16) this->initStats(); - else eeprom_read_block(&this->data, (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics)); + else eeprom_read_block(&this->data, + (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics)); this->loaded = true; } @@ -70,31 +83,40 @@ void PrintCounter::saveStats() { PrintCounter::debug(PSTR("saveStats")); #endif - // Refuses to save data is object is not loaded + // Refuses to save data if object is not loaded if (!this->isLoaded()) return; // Saves the struct to EEPROM - eeprom_update_block(&this->data, (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics)); + eeprom_update_block(&this->data, + (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics)); } void PrintCounter::showStats() { - SERIAL_ECHOPGM("Print statistics: Total: "); + SERIAL_PROTOCOLPGM(MSG_STATS); + + SERIAL_ECHOPGM("Prints: "); SERIAL_ECHO(this->data.totalPrints); SERIAL_ECHOPGM(", Finished: "); SERIAL_ECHO(this->data.finishedPrints); - SERIAL_ECHOPGM(", Failed: "); + SERIAL_ECHOPGM(", Failed: "); // Note: Removes 1 from failures with an active counter SERIAL_ECHO(this->data.totalPrints - this->data.finishedPrints - - ((this->isRunning() || this->isPaused()) ? 1 : 0)); // Removes 1 from failures with an active counter + - ((this->isRunning() || this->isPaused()) ? 1 : 0)); + + SERIAL_EOL; + SERIAL_PROTOCOLPGM(MSG_STATS); - millis_t t = this->data.printTime / 60; // minutes from seconds - SERIAL_ECHOPGM(", Total print time: "); - SERIAL_ECHO(t / 60); // hours + uint32_t t = this->data.printTime / 60; + SERIAL_ECHOPGM("Total time: "); + SERIAL_ECHO(t / 60 / 24); + SERIAL_ECHOPGM("d "); + + SERIAL_ECHO((t / 60) % 24); SERIAL_ECHOPGM("h "); - SERIAL_ECHO(t % 60); // minutes + SERIAL_ECHO(t % 60); SERIAL_ECHOPGM("min"); #if ENABLED(DEBUG_PRINTCOUNTER) @@ -103,34 +125,58 @@ void PrintCounter::showStats() { SERIAL_ECHOPGM(")"); #endif - // @todo longestPrint missing implementation + uint32_t l = this->data.longestPrint / 60; + SERIAL_ECHOPGM(", Longest job: "); + + SERIAL_ECHO(l / 60 / 24); + SERIAL_ECHOPGM("d "); + + SERIAL_ECHO((l / 60) % 24); + SERIAL_ECHOPGM("h "); + + SERIAL_ECHO(l % 60); + SERIAL_ECHOPGM("min"); + + #if ENABLED(DEBUG_PRINTCOUNTER) + SERIAL_ECHOPGM(" ("); + SERIAL_ECHO(this->data.longestPrint); + SERIAL_ECHOPGM(")"); + #endif + + SERIAL_EOL; + SERIAL_PROTOCOLPGM(MSG_STATS); + + SERIAL_ECHOPGM("Filament used: "); + SERIAL_ECHO(this->data.filamentUsed / 1000); + SERIAL_ECHOPGM("m"); + SERIAL_EOL; } void PrintCounter::tick() { if (!this->isRunning()) return; - static millis_t update_before = millis(), - eeprom_before = millis(); + static uint32_t update_last = millis(), + eeprom_last = millis(); millis_t now = millis(); // Trying to get the amount of calculations down to the bare min const static uint16_t i = this->updateInterval * 1000; - if (now - update_before >= i) { + if (now - update_last >= i) { #if ENABLED(DEBUG_PRINTCOUNTER) PrintCounter::debug(PSTR("tick")); #endif this->data.printTime += this->deltaDuration(); - update_before = now; + update_last = now; } // Trying to get the amount of calculations down to the bare min const static millis_t j = this->saveInterval * 1000; - if (now - eeprom_before >= j) { - eeprom_before = now; + if (now - eeprom_last >= j) { + eeprom_last = now; this->saveStats(); } } @@ -162,6 +208,10 @@ bool PrintCounter::stop() { if (super::stop()) { this->data.finishedPrints++; this->data.printTime += this->deltaDuration(); + + if (this->duration() > this->data.longestPrint) + this->data.longestPrint = this->duration(); + this->saveStats(); return true; } diff --git a/Marlin/printcounter.h b/Marlin/printcounter.h index c7742a07b..0e9d06f45 100644 --- a/Marlin/printcounter.h +++ b/Marlin/printcounter.h @@ -24,6 +24,7 @@ #define PRINTCOUNTER_H #include "macros.h" +#include "language.h" #include "stopwatch.h" #include @@ -35,8 +36,9 @@ struct printStatistics { // 13 bytes //const uint8_t magic; // Magic header, it will always be 0x16 uint16_t totalPrints; // Number of prints uint16_t finishedPrints; // Number of complete prints - millis_t printTime; // Total printing time - millis_t longestPrint; // Longest print job - not in use + uint32_t printTime; // Accumulated printing time + uint32_t longestPrint; // Longest successfull print job + double filamentUsed; // Accumulated filament consumed in mm }; class PrintCounter: public Stopwatch { @@ -105,6 +107,14 @@ class PrintCounter: public Stopwatch { */ bool isLoaded(); + /** + * @brief Increments the total filament used + * @details The total filament used counter will be incremented by "amount". + * + * @param amount The amount of filament used in mm + */ + void incFilamentUsed(double const &amount); + /** * @brief Resets the Print Statistics * @details Resets the statistics to zero and saves them to EEPROM creating From f5234b0695cd0a1d4c4c0a999974a4de6577ba4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 14 Jul 2016 18:28:15 +0100 Subject: [PATCH 367/580] Adds a customizable screen timeout for the default boot screen --- Marlin/Conditionals.h | 6 +++++- Marlin/Marlin_main.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 1d0e02519..bfd485f9e 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -55,7 +55,7 @@ #define LCD_CONTRAST_MIN 60 #define LCD_CONTRAST_MAX 140 #endif - + #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL) #define DOGLCD #define ULTIPANEL @@ -269,6 +269,10 @@ #endif #endif + #ifndef BOOTSCREEN_TIMEOUT + #define BOOTSCREEN_TIMEOUT 2500 + #endif + #else // CONFIGURATION_LCD #define CONDITIONALS_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5091c421c..ac6d852a8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -946,7 +946,7 @@ void setup() { lcd_init(); #if ENABLED(SHOW_BOOTSCREEN) #if ENABLED(DOGLCD) - delay(1000); + delay(BOOTSCREEN_TIMEOUT); #elif ENABLED(ULTRA_LCD) bootscreen(); lcd_init(); From 9a00108cb62c5bec97f1f5e8bac47d28ba68ba77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 14 Jul 2016 18:34:27 +0100 Subject: [PATCH 368/580] Adds the WEBSITE_URL as the boot screen line 2 --- Marlin/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/DUAL/Configuration.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/Hephestos_2/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- Marlin/example_configurations/K8400/Configuration.h | 2 +- Marlin/example_configurations/K8400/Dual-head/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- Marlin/example_configurations/RigidBot/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/TAZ4/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 96cb58068..465b327ca 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 50ace1c2d..78b2088c1 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 3c2be5a22..8f7bc9736 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 31ac6728f..266e85766 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 648df90a0..264f21ab9 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "@jbrazio" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 37fe86722..b2b448c4c 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -105,7 +105,7 @@ #define STRING_CONFIG_H_AUTHOR "(K8200, @CONSULitAS)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index c900fc263..241d405ab 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index d69c5bdfe..b91a7b7a4 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 315010fe8..184b29c56 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "RepRapWorld.com" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 829c8d8a5..7a9e413ca 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 4d32f85a7..da9efefad 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -123,7 +123,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index f8f49db47..a217bb596 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(Aleph Objects, Inc, TAZ config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d4102ef99..f28a13f1e 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(bq Witbox)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 2bb90a191..9e4f9c5b8 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 981ae59dd..d4c1ee194 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 2fed91a1a..aec39fb68 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 9e97af3c3..d966b8fdb 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 2b49bd039..6ae4dc80d 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -104,7 +104,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 258ba72c9..32abee517 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -91,7 +91,7 @@ #define STRING_CONFIG_H_AUTHOR "(oxivanisher)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index c51d75d36..0e823d1fc 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index eeee65304..f61484dec 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -98,7 +98,7 @@ #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 // @section machine From a8758619ec535adde3d48c3a7c4e0efdd1e1b9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 14 Jul 2016 21:40:11 +0100 Subject: [PATCH 369/580] The safe_delay() is now globaly accessible --- Marlin/Marlin.h | 2 ++ Marlin/Marlin_main.cpp | 2 +- .../ultralcd_implementation_hitachi_HD44780.h | 9 ----- Marlin/utility.cpp | 33 +++++++++++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 Marlin/utility.cpp diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index ec886b680..d7c14d29a 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -389,4 +389,6 @@ void calculate_volumetric_multipliers(); #endif #endif +void safe_delay(uint16_t del); + #endif //MARLIN_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ac6d852a8..15c27a43c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -946,7 +946,7 @@ void setup() { lcd_init(); #if ENABLED(SHOW_BOOTSCREEN) #if ENABLED(DOGLCD) - delay(BOOTSCREEN_TIMEOUT); + safe_delay(BOOTSCREEN_TIMEOUT); #elif ENABLED(ULTRA_LCD) bootscreen(); lcd_init(); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 24d48b1a9..b5342bd3b 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -443,15 +443,6 @@ unsigned lcd_print(char c) { return charset_mapper(c); } lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" )); lcd.print('\x03'); } - void safe_delay(uint16_t del){ - while (del > 50) { - del -= 50; - delay(50); - thermalManager.manage_heater(); - } - delay(del); - } - void bootscreen() { byte top_left[8] = { B00000, diff --git a/Marlin/utility.cpp b/Marlin/utility.cpp new file mode 100644 index 000000000..385fe3d39 --- /dev/null +++ b/Marlin/utility.cpp @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "Marlin.h" +#include "temperature.h" + +void safe_delay(uint16_t ms) { + while (ms > 50) { + ms -= 50; + delay(50); + thermalManager.manage_heater(); + } + delay(ms); +} From dfa1c45075acf5ccd6955224f2b4cde92bf44abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 15 Jul 2016 00:03:55 +0100 Subject: [PATCH 370/580] Adds a notice to vendors about the SHOW_CUSTOM_BOOTSCREEN directive --- .../Cartesio/Configuration.h | 20 +++++++++++++++++-- .../Felix/Configuration.h | 20 +++++++++++++++++-- .../Felix/DUAL/Configuration.h | 20 +++++++++++++++++-- .../Hephestos/Configuration.h | 20 +++++++++++++++++-- .../Hephestos_2/Configuration.h | 20 +++++++++++++++++-- .../K8200/Configuration.h | 20 +++++++++++++++++-- .../K8400/Configuration.h | 20 +++++++++++++++++-- .../K8400/Dual-head/Configuration.h | 20 +++++++++++++++++-- .../RepRapWorld/Megatronics/Configuration.h | 20 +++++++++++++++++-- .../RigidBot/Configuration.h | 20 +++++++++++++++++-- .../SCARA/Configuration.h | 20 +++++++++++++++++-- .../TAZ4/Configuration.h | 20 +++++++++++++++++-- .../WITBOX/Configuration.h | 20 +++++++++++++++++-- .../adafruit/ST7565/Configuration.h | 20 +++++++++++++++++-- .../delta/biv2.5/Configuration.h | 20 +++++++++++++++++-- .../delta/generic/Configuration.h | 20 +++++++++++++++++-- .../delta/kossel_mini/Configuration.h | 20 +++++++++++++++++-- .../delta/kossel_pro/Configuration.h | 20 +++++++++++++++++-- .../delta/kossel_xl/Configuration.h | 20 +++++++++++++++++-- .../makibox/Configuration.h | 20 +++++++++++++++++-- .../tvrrug/Round2/Configuration.h | 20 +++++++++++++++++-- 21 files changed, 378 insertions(+), 42 deletions(-) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index b4d1f0852..945df7491 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(MaukCC, CartesioE)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 "Cartesio" // will be shown during bootup in line1 -#define STRING_SPLASH_LINE2 "Marlin " SHORT_BUILD_VERSION // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 78b2088c1..576b2715c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 8f7bc9736..072f74c7f 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 266e85766..747dcbdda 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 264f21ab9..62098fba4 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "@jbrazio" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index b2b448c4c..b7ed47584 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -104,8 +104,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(K8200, @CONSULitAS)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 241d405ab..602f490ae 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index b91a7b7a4..3f5644dd8 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 184b29c56..3817fcb98 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "RepRapWorld.com" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 7a9e413ca..26e46c666 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index da9efefad..758c4514a 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -122,8 +122,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index a217bb596..4e2dee37c 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(Aleph Objects, Inc, TAZ config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index f28a13f1e..bce118532 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(bq Witbox)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_Bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9e4f9c5b8..63ffcf2ae 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index d4c1ee194..4c0c46f95 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index aec39fb68..beab01f55 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index d966b8fdb..ac5b6ba44 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 6ae4dc80d..a10a8a847 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -103,8 +103,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 32abee517..5eee789c2 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -90,8 +90,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(oxivanisher)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 0e823d1fc..b0c210ff5 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_bootscreen.h" +#endif // @section machine diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index f61484dec..697f426d0 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -97,8 +97,24 @@ // build by the user have been successfully uploaded into firmware. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2 + +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_Bootscreen.h" +#endif // @section machine From 1f3283e3a56f5b5131882b787bad2704a6831f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 15 Jul 2016 00:05:56 +0100 Subject: [PATCH 371/580] Adds custom boot logos for bq Hephestos 2 and Cartesio --- .../Cartesio/Configuration.h | 4 +- .../Cartesio/_Bootscreen.h | 95 +++++++++++++++++++ .../Hephestos_2/Configuration.h | 4 +- .../Hephestos_2/_Bootscreen.h | 95 +++++++++++++++++++ 4 files changed, 194 insertions(+), 4 deletions(-) create mode 100644 Marlin/example_configurations/Cartesio/_Bootscreen.h create mode 100644 Marlin/example_configurations/Hephestos_2/_Bootscreen.h diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 945df7491..a97ec341c 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -111,9 +111,9 @@ // boot image unmodified. For an example have a look at the bq Hephestos 2 // example configuration folder. // -//#define SHOW_CUSTOM_BOOTSCREEN +#define SHOW_CUSTOM_BOOTSCREEN #if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" + #include "_Bootscreen.h" #endif // @section machine diff --git a/Marlin/example_configurations/Cartesio/_Bootscreen.h b/Marlin/example_configurations/Cartesio/_Bootscreen.h new file mode 100644 index 000000000..254fbdf06 --- /dev/null +++ b/Marlin/example_configurations/Cartesio/_Bootscreen.h @@ -0,0 +1,95 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include + +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 + #define CUSTOM_BOOTSCREEN_BMPWIDTH 63 + #define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 + + const unsigned char 81x0i84fkcmoqbu7vte29[512] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, + 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x0f, 0x07, 0x87, 0xff, 0xff, 0xe0, 0x00, + 0x00, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x00, + 0x01, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80, + 0x03, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80, + 0x07, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xc0, + 0x07, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0, + 0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0, + 0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0, + 0x1f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0, + 0x1f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf0, + 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, + 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, + 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, + 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf8, + 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, + 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, + 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, + 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, + 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, + 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, + 0x3f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, + 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, + 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, + 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, + 0x1f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0, + 0x1f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0, + 0x1f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0, + 0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0, + 0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xc0, + 0x07, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xc0, + 0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x80, + 0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x00, + 0x01, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00, + 0x00, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00, + 0x00, 0x0f, 0xff, 0xff, 0xc3, 0xc1, 0xe0, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, + 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, + 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, + 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; +#endif diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 62098fba4..3146c9245 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -111,9 +111,9 @@ // boot image unmodified. For an example have a look at the bq Hephestos 2 // example configuration folder. // -//#define SHOW_CUSTOM_BOOTSCREEN +#define SHOW_CUSTOM_BOOTSCREEN #if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" + #include "_Bootscreen.h" #endif // @section machine diff --git a/Marlin/example_configurations/Hephestos_2/_Bootscreen.h b/Marlin/example_configurations/Hephestos_2/_Bootscreen.h new file mode 100644 index 000000000..7e7f8f4c4 --- /dev/null +++ b/Marlin/example_configurations/Hephestos_2/_Bootscreen.h @@ -0,0 +1,95 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include + +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 + #define CUSTOM_BOOTSCREEN_BMPWIDTH 62 + #define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 + + const unsigned char custom_start_bmp[512] PROGMEM = { + 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xc0, 0x0f, 0xf0, 0x07, 0x80, 0x00, + 0x00, 0x07, 0xe0, 0x07, 0xe0, 0x0f, 0xc0, 0x00, + 0x00, 0x0f, 0xf0, 0x03, 0xc0, 0x1f, 0xe0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x1f, 0xe0, 0x00, + 0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x00, + 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x3f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x7f, 0x80, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0xf7, 0xc0, 0x1f, 0x80, + 0xff, 0xc0, 0x00, 0x00, 0xff, 0xf0, 0x7f, 0xc0, + 0x7f, 0x80, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xe0, + 0x3f, 0x00, 0x00, 0x00, 0xfc, 0xf8, 0xf0, 0xf8, + 0x1e, 0x00, 0x00, 0x00, 0xf8, 0x7d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x79, 0xf0, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x7f, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x3f, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x0e, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + }; +#endif From fa4274cf4c064b783bbe214e64b191f3ba2d25da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 15 Jul 2016 00:07:34 +0100 Subject: [PATCH 372/580] Improves the custom bootscreen logo feature --- Marlin/Configuration.h | 16 +++++++ Marlin/dogm_custom_bitmaps.h | 77 -------------------------------- Marlin/dogm_lcd_implementation.h | 38 +++++++--------- Marlin/macros.h | 4 +- 4 files changed, 36 insertions(+), 99 deletions(-) delete mode 100644 Marlin/dogm_custom_bitmaps.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 465b327ca..9e8662a11 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -100,6 +100,22 @@ #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +// +// *** VENDORS PLEASE READ ***************************************************** +// +// Marlin now allow you to have a vendor boot image to be displayed on machine +// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your +// custom boot image and them the default Marlin boot image is shown. +// +// We suggest for you to take advantage of this new feature and keep the Marlin +// boot image unmodified. For an example have a look at the bq Hephestos 2 +// example configuration folder. +// +//#define SHOW_CUSTOM_BOOTSCREEN +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_Bootscreen.h" +#endif + // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. diff --git a/Marlin/dogm_custom_bitmaps.h b/Marlin/dogm_custom_bitmaps.h deleted file mode 100644 index 4f3030599..000000000 --- a/Marlin/dogm_custom_bitmaps.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * BitMap for custom splashscreen - * Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php - */ - -//#define CUSTOM_START_BMP - -#if ENABLED(CUSTOM_START_BMP) - - #define CUSTOM_START_BMP_DELAY 2000 - #define CUSTOM_START_BMPWIDTH 112 - #define CUSTOM_START_BMPHEIGHT 38 - #define CUSTOM_START_BMPBYTEWIDTH 14 - #define CUSTOM_START_BMPBYTES 532 // CUSTOM_START_BMPWIDTH * CUSTOM_START_BMPHEIGHT / 8 - - const unsigned char custom_start_bmp[CUSTOM_START_BMPBYTES] PROGMEM = { - 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, - 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, - 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, - 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x3F, 0xFF, - 0xC0, 0x0F, 0xC0, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x18, 0x00, 0x1F, 0xFF, - 0xC0, 0x3F, 0xE1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x0F, 0xFF, - 0xC0, 0x7F, 0xF3, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x07, 0xFF, - 0xC0, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x03, 0xFF, - 0xC1, 0xF8, 0x7F, 0x87, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x01, 0xFF, - 0xC1, 0xF0, 0x3F, 0x03, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xFF, - 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x1F, 0x00, 0x03, 0xE0, 0x78, 0x3C, 0x03, 0xF0, 0x7F, - 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x7F, 0xC0, 0x0F, 0xF8, 0x78, 0x3C, 0x07, 0xFC, 0x3F, - 0xC1, 0xE0, 0x1E, 0x01, 0xE1, 0xFF, 0xE0, 0x1F, 0xFC, 0x78, 0x3C, 0x0F, 0xFE, 0x1F, - 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xFF, 0xF0, 0x3F, 0xFE, 0x78, 0x3C, 0x1F, 0xFE, 0x0F, - 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xF3, 0xF8, 0x3F, 0x3E, 0x78, 0x3C, 0x3F, 0x3F, 0x07, - 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xE0, 0xFC, 0x7C, 0x1F, 0x78, 0x3C, 0x3E, 0x1F, 0x07, - 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xC0, 0x7C, 0x7C, 0x0F, 0x78, 0x3C, 0x3C, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x7C, 0x78, 0x0F, 0x78, 0x3C, 0x3C, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0x80, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE7, 0xC0, 0x3C, 0x78, 0x00, 0x78, 0x3C, 0x3C, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xE0, 0x3C, 0x78, 0x00, 0x7C, 0x3C, 0x3C, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE3, 0xFF, 0x3F, 0xF8, 0x00, 0x7F, 0xBC, 0x3C, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE1, 0xFF, 0x3F, 0xF8, 0x00, 0x3F, 0xBF, 0xFC, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0xFF, 0x3F, 0xF8, 0x00, 0x1F, 0xBF, 0xFC, 0x0F, 0x03, - 0xC1, 0xE0, 0x1E, 0x01, 0xE0, 0x7F, 0x3F, 0xF8, 0x00, 0x0F, 0xBF, 0xFC, 0x0F, 0x03, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, - 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, - 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, - 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, - 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, - 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80 }; -#endif diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index be45fb6ca..257eae5ba 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -53,8 +53,6 @@ #include #include "dogm_bitmaps.h" -#include "dogm_custom_bitmaps.h" - #include "ultralcd.h" #include "ultralcd_st7920_u8glib_rrd.h" @@ -220,10 +218,6 @@ char lcd_printPGM(const char* str) { return n; } -#if ENABLED(SHOW_BOOTSCREEN) - static bool show_bootscreen = true; -#endif - /* Warning: This function is called from interrupt context */ static void lcd_implementation_init() { @@ -241,11 +235,6 @@ static void lcd_implementation_init() { u8g.setContrast(lcd_contrast); #endif - // FIXME: remove this workaround - // Uncomment this if you have the first generation (V1.10) of STBs board - // pinMode(17, OUTPUT); // Enable LCD backlight - // digitalWrite(17, HIGH); - #if ENABLED(LCD_SCREEN_ROT_90) u8g.setRot90(); // Rotate screen by 90° #elif ENABLED(LCD_SCREEN_ROT_180) @@ -255,16 +244,23 @@ static void lcd_implementation_init() { #endif #if ENABLED(SHOW_BOOTSCREEN) - #if ENABLED(CUSTOM_START_BMP) + static bool show_bootscreen = true; + + #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) if (show_bootscreen) { u8g.firstPage(); do { - u8g.drawBitmapP((128-(CUSTOM_START_BMPWIDTH))/2, (64 - (CUSTOM_START_BMPHEIGHT))/2, CUSTOM_START_BMPBYTEWIDTH, CUSTOM_START_BMPHEIGHT, custom_start_bmp); + u8g.drawBitmapP( + (128 - (CUSTOM_BOOTSCREEN_BMPWIDTH)) /2, + ( 64 - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) /2, + CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8), CUSTOM_BOOTSCREEN_BMPHEIGHT, custom_start_bmp); } while (u8g.nextPage()); - delay(CUSTOM_START_BMP_DELAY); + safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); } - #endif + #endif // SHOW_CUSTOM_BOOTSCREEN + int offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2; + #if ENABLED(START_BMPHIGH) int offy = 0; #else @@ -273,9 +269,9 @@ static void lcd_implementation_init() { int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2; - u8g.firstPage(); - do { - if (show_bootscreen) { + if (show_bootscreen) { + u8g.firstPage(); + do { u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); lcd_setFont(FONT_MENU); #ifndef STRING_SPLASH_LINE2 @@ -285,12 +281,12 @@ static void lcd_implementation_init() { u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 3 / 2, STRING_SPLASH_LINE1); u8g.drawStr(txt2X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 1 / 2, STRING_SPLASH_LINE2); #endif - } - } while (u8g.nextPage()); + } while (u8g.nextPage()); + } show_bootscreen = false; - #endif + #endif // SHOW_BOOTSCREEN } void lcd_kill_screen() { diff --git a/Marlin/macros.h b/Marlin/macros.h index 2b535bbdd..7dbadee08 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -97,6 +97,8 @@ #define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) -#define NOOP do{}while(0) +#define NOOP do{} while(0) + +#define CEILING(x,y) (((x) + (y) - 1) / (y)) #endif //__MACROS_H From 9775af0c24000194dfe10043dc8de391e270435e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 16 Jul 2016 13:00:43 +0100 Subject: [PATCH 373/580] Update travis to handle custom_bootscreen.h files --- buildroot/bin/restore_configs | 4 ++++ buildroot/bin/use_example_configs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/buildroot/bin/restore_configs b/buildroot/bin/restore_configs index ca77e556a..ba7a72cd8 100755 --- a/buildroot/bin/restore_configs +++ b/buildroot/bin/restore_configs @@ -3,3 +3,7 @@ cp Marlin/Configuration.h.backup Marlin/Configuration.h cp Marlin/Configuration_adv.h.backup Marlin/Configuration_adv.h cp Marlin/pins_RAMPS_14.h.backup Marlin/pins_RAMPS_14.h + +if [ -f Marlin/_Bootscreen.h ]; then + rm Marlin/_Bootscreen.h +fi diff --git a/buildroot/bin/use_example_configs b/buildroot/bin/use_example_configs index d1e6e468f..9f55c52e1 100755 --- a/buildroot/bin/use_example_configs +++ b/buildroot/bin/use_example_configs @@ -1,3 +1,7 @@ #!/usr/bin/env bash -eval "cp Marlin/example_configurations/$1/Configuration* Marlin/" +eval "cp Marlin/example_configurations/${1}/Configuration* Marlin/" + +if [ -f "Marlin/example_configurations/${1}/_Bootscreen.h" ]; then + cp "Marlin/example_configurations/${1}/_Bootscreen.h" Marlin/ +fi From d53dcaa79696e149e38233a6c54de4ba3e989e29 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2016 17:59:01 -0700 Subject: [PATCH 374/580] Suppress some compiler warnings --- Marlin/ultralcd.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 37f139dee..16608f66b 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -321,7 +321,8 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to if (encoderLine >= encoderTopLine + LCD_HEIGHT) { \ encoderTopLine = encoderLine - (LCD_HEIGHT - 1); \ lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ - } + } \ + UNUSED(_skipStatic) #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1382,7 +1383,7 @@ void kill_screen(const char* lcd_msg) { pos_label = PSTR(MSG_MOVE_E); #else switch (eindex) { - case 0: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; + default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; #if EXTRUDERS > 2 case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; @@ -1543,14 +1544,14 @@ void kill_screen(const char* lcd_msg) { // Helpers for editing PID Ki & Kd values // grab the PID value out of the temp variable; scale it; then update the PID driver void copy_and_scalePID_i(int e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) + #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 UNUSED(e); #endif PID_PARAM(Ki, e) = scalePID_i(raw_Ki); thermalManager.updatePID(); } void copy_and_scalePID_d(int e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) + #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 UNUSED(e); #endif PID_PARAM(Kd, e) = scalePID_d(raw_Kd); From eee903bd4be71e029fe6664f4e42791f1c1da721 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2016 17:59:13 -0700 Subject: [PATCH 375/580] Format some DAC lines --- Marlin/dac_mcp4728.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/dac_mcp4728.h b/Marlin/dac_mcp4728.h index 18d22f21f..26c54840f 100644 --- a/Marlin/dac_mcp4728.h +++ b/Marlin/dac_mcp4728.h @@ -33,19 +33,19 @@ #if ENABLED(DAC_STEPPER_CURRENT) #include "Wire.h" -#define defaultVDD 5000 -#define BASE_ADDR 0x60 -#define RESET 0B00000110 -#define WAKE 0B00001001 -#define UPDATE 0B00001000 -#define MULTIWRITE 0B01000000 -#define SINGLEWRITE 0B01011000 -#define SEQWRITE 0B01010000 -#define VREFWRITE 0B10000000 -#define GAINWRITE 0B11000000 +#define defaultVDD 5000 +#define BASE_ADDR 0x60 +#define RESET 0B00000110 +#define WAKE 0B00001001 +#define UPDATE 0B00001000 +#define MULTIWRITE 0B01000000 +#define SINGLEWRITE 0B01011000 +#define SEQWRITE 0B01010000 +#define VREFWRITE 0B10000000 +#define GAINWRITE 0B11000000 #define POWERDOWNWRITE 0B10100000 -#define GENERALCALL 0B0000000 -#define GAINWRITE 0B11000000 +#define GENERALCALL 0B00000000 +#define GAINWRITE 0B11000000 // This is taken from the original lib, makes it easy to edit if needed // DAC_OR_ADDRESS defined in pins_BOARD.h file From 2d7fe9dc7828db2370693a3bae123e81582d139f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Zahradn=C3=ADk=20junior?= Date: Fri, 15 Jul 2016 13:17:27 +0200 Subject: [PATCH 376/580] LCD Longer print --- Marlin/language_cz.h | 3 +++ Marlin/language_en.h | 10 ++++++++-- Marlin/ultralcd.cpp | 12 +++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index 54a8ae5de..3b53d90a2 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -189,6 +189,9 @@ #define MSG_ERR_MINTEMP_BED "NIZ. TEPL. PODL." #define MSG_HALTED "TISK. ZASTAVENA" #define MSG_PLEASE_RESET "Provedte reset" +#define MSG_SHORT_DAY "d" +#define MSG_SHORT_HOUR "h" +#define MSG_SHORT_MINUTE "m" #define MSG_HEATING "Zahrivani..." #define MSG_HEATING_COMPLETE "Zahrati hotovo." #define MSG_BED_HEATING "Zahrivani podl." diff --git a/Marlin/language_en.h b/Marlin/language_en.h index a1b38a1a9..efb48f553 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -488,8 +488,14 @@ #ifndef MSG_PLEASE_RESET #define MSG_PLEASE_RESET "Please reset" #endif -#ifndef MSG_END_DAY - #define MSG_END_DAY "days" +#ifndef MSG_SHORT_DAY + #define MSG_SHORT_DAY "d" // One character only +#endif +#ifndef MSG_SHORT_HOUR + #define MSG_SHORT_HOUR "h" // One character only +#endif +#ifndef MSG_SHORT_MINUTE + #define MSG_SHORT_MINUTE "m" // One character only #endif #ifndef MSG_PRINT_TIME #define MSG_PRINT_TIME "Print time" diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 37f139dee..e637c780e 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1969,13 +1969,19 @@ void kill_screen(const char* lcd_msg) { print_job_counter.loadStats(); printStatistics stats = print_job_counter.getStats(); - char timeString[8]; - sprintf_P(timeString, PSTR("%i:%02i"), int(stats.printTime / 60 / 60), int(stats.printTime / 60) % 60); + char timeString[14]; + sprintf_P(timeString, + PSTR("%i" MSG_SHORT_DAY " %i" MSG_SHORT_HOUR " %i" MSG_SHORT_MINUTE), + int(stats.printTime / 60 / 60 / 24), + int((stats.printTime / 60 / 60) % 24), + int((stats.printTime / 60) % 60) + ); START_SCREEN(); // 12345678901234567890 STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 - STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false, timeString); // Total Time : 123:45 + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total Time : + STATIC_ITEM(" ", false, false, timeString); // 12345d 12h 34m END_SCREEN(); } #endif // PRINTCOUNTER From 32e0d717291879acae42dd070ca5e8ec783a3897 Mon Sep 17 00:00:00 2001 From: Silvio Didonna Date: Thu, 14 Jul 2016 18:19:13 +0200 Subject: [PATCH 377/580] Added missing translations --- Marlin/language_it.h | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 2bf9a5f0f..acb4e8a5a 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -163,6 +163,8 @@ #define MSG_ERR_MINTEMP "Err: TEMP MINIMA" #define MSG_ERR_MAXTEMP_BED "Err: TEMP MASSIMA PIATTO" #define MSG_ERR_MINTEMP_BED "Err: TEMP MINIMA PIATTO" +#define MSG_HALTED "STAMPANTE FERMATA" +#define MSG_PLEASE_RESET "Riavviare prego" #define MSG_HEATING "Riscaldamento.." #define MSG_HEATING_COMPLETE "Risc. completato" #define MSG_BED_HEATING "Risc. Piatto.." @@ -172,5 +174,57 @@ #define MSG_DELTA_CALIBRATE_Y "Calibra Y" #define MSG_DELTA_CALIBRATE_Z "Calibra Z" #define MSG_DELTA_CALIBRATE_CENTER "Calibra Center" +#define MSG_INFO_MENU "Riguardo stampante" +#define MSG_INFO_PRINTER_MENU "Info. stampante" +#define MSG_INFO_STATS_MENU "Statistiche" +#define MSG_INFO_BOARD_MENU "Info. scheda" +#define MSG_INFO_THERMISTOR_MENU "Termistori" +#define MSG_INFO_EXTRUDERS "Estrusori" +#define MSG_INFO_BAUDRATE "Baud" +#define MSG_INFO_PROTOCOL "Protocollo" +#if LCD_WIDTH > 19 + #define MSG_INFO_PRINT_COUNT "Contat. stampa" + #define MSG_INFO_FINISHED_PRINTS "Finiti " + #define MSG_INFO_PRINT_TIME "Tempo totale " +#else + #define MSG_INFO_PRINT_COUNT "Stampe " + #define MSG_INFO_FINISHED_PRINTS "Finiti " + #define MSG_INFO_PRINT_TIME "Durata " +#endif +#define MSG_INFO_MIN_TEMP "Temp min" +#define MSG_INFO_MAX_TEMP "Temp max" +#define MSG_INFO_PSU "Alimentatore" + +#define MSG_FILAMENT_CHANGE_HEADER "CAMBIA FILAMENTO" +#define MSG_FILAMENT_CHANGE_OPTION_HEADER "CAMBIA OPZIONI:" +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "Estrusione" +#define MSG_FILAMENT_CHANGE_OPTION_RESUME "Riprendi stampa" +#if LCD_HEIGHT >= 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "Attendere avvio" + #define MSG_FILAMENT_CHANGE_INIT_2 "del cambio" + #define MSG_FILAMENT_CHANGE_INIT_3 "di filamento" + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Attendere" + #define MSG_FILAMENT_CHANGE_UNLOAD_2 "l'espulsione" + #define MSG_FILAMENT_CHANGE_UNLOAD_3 "del filamento" + #define MSG_FILAMENT_CHANGE_INSERT_1 "Inserisci il" + #define MSG_FILAMENT_CHANGE_INSERT_2 "filamento e" + #define MSG_FILAMENT_CHANGE_INSERT_3 "premi per cont" + #define MSG_FILAMENT_CHANGE_LOAD_1 "Attendere" + #define MSG_FILAMENT_CHANGE_LOAD_2 "il caricamento" + #define MSG_FILAMENT_CHANGE_LOAD_3 "del filamento" + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Attendere" + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "l'estrusione" + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "del filamento" + #define MSG_FILAMENT_CHANGE_RESUME_1 "Attendere" + #define MSG_FILAMENT_CHANGE_RESUME_2 "la ripresa" + #define MSG_FILAMENT_CHANGE_RESUME_3 "della stampa" +#else // LCD_HEIGHT < 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "Attendere..." + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "Espulsione..." + #define MSG_FILAMENT_CHANGE_INSERT_1 "Inserisci e premi" + #define MSG_FILAMENT_CHANGE_LOAD_1 "Caricamento..." + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "Estrusione..." + #define MSG_FILAMENT_CHANGE_RESUME_1 "Ripresa..." +#endif // LCD_HEIGHT < 4 #endif // LANGUAGE_IT_H From 601015b73e039a7ff860df68c948bcad5bf6fb69 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 2 Jul 2016 09:31:37 +0900 Subject: [PATCH 378/580] Update Japanese translation --- Marlin/language_kana.h | 165 ++++++++++++++++++++++++------------ Marlin/language_kana_utf8.h | 58 +++++++++++-- 2 files changed, 162 insertions(+), 61 deletions(-) diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 81c020ac9..8dee6aa2f 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -57,14 +57,14 @@ #define MSG_SET_ORIGIN "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4" // "キジュンセット" ("Set origin") #define MSG_PREHEAT_1 "PLA \xd6\xc8\xc2" // "PLA ヨネツ" ("Preheat PLA") #define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " \xbd\xcd\xde\xc3" // " スベテ" (" All") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " \xcd\xde\xaf\xc4\xde" // " ベッド" (" Bed") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " \xbe\xaf\xc3\xb2" // " セッテイ" (" conf") +#define MSG_PREHEAT_1_ALL "PLA \xbd\xcd\xde\xc3\xd6\xc8\xc2" // "PLA スベテヨネツ" (" All") +#define MSG_PREHEAT_1_BEDONLY "PLA \xcd\xde\xaf\xc4\xde\xd6\xc8\xc2" // "PLA ベッドヨネツ" (" Bed") +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 "\xbe\xaf\xc3\xb2" // "セッテイ" (" conf") #define MSG_PREHEAT_2 "ABS \xd6\xc8\xc2" // "ABS ヨネツ" ("Preheat ABS") #define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " \xbd\xcd\xde\xc3" // " スベテ" (" All") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " \xcd\xde\xaf\xc4\xde" // " ベッド" (" Bed") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " \xbe\xaf\xc3\xb2" // " セッテイ" (" conf") +#define MSG_PREHEAT_2_ALL "ABS \xbd\xcd\xde\xc3\xd6\xc8\xc2" // "ABS スベテヨネツ" (" All") +#define MSG_PREHEAT_2_BEDONLY "ABS \xcd\xde\xaf\xc4\xde\xd6\xc8\xc2" // "ABS ベッドヨネツ" (" Bed") +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 "\xbe\xaf\xc3\xb2" // "セッテイ" (" conf") #define MSG_COOLDOWN "\xb6\xc8\xc2\xc3\xb2\xbc" // "カネツテイシ" ("Cooldown") #define MSG_SWITCH_PS_ON "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xdd" // "デンゲン オン" ("Switch power on") #define MSG_SWITCH_PS_OFF "\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc" // "デンゲン オフ" ("Switch power off") @@ -89,10 +89,10 @@ #define MSG_MIN LCD_STR_THERMOMETER " \xbb\xb2\xc3\xb2" // " サイテイ" (" Min") #define MSG_MAX LCD_STR_THERMOMETER " \xbb\xb2\xba\xb3" // " サイコウ" (" Max") #define MSG_FACTOR LCD_STR_THERMOMETER " \xcc\xa7\xb8\xc0\xb0" // " ファクター" (" Fact") -#if LCD_WIDTH < 20 - #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde" // "ジドウオンド" ("Autotemp") -#else +#if LCD_WIDTH > 19 #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde\xbe\xb2\xb7\xde\xae" // "ジドウオンドセイギョ" ("Autotemp") +#else + #define MSG_AUTOTEMP "\xbc\xde\xc4\xde\xb3\xb5\xdd\xc4\xde" // "ジドウオンド" ("Autotemp") #endif #define MSG_ON "\xb5\xdd " // "オン " ("On ") #define MSG_OFF "\xb5\xcc " // "オフ " ("Off") @@ -100,31 +100,31 @@ #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" -#if LCD_WIDTH < 20 - #define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "カソクド" ("Accel") - #define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vxy-jerk") - #define MSG_VZ_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "Zジク ヤクド" ("Vz-jerk") - #define MSG_VE_JERK "E\x20\xd4\xb8\xc4\xde" // "E ヤクド" ("Ve-jerk") - #define MSG_VMAX "max\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "maxオクリソクド" ("Vmax ") -#else +#if LCD_WIDTH > 19 #define MSG_ACC "\xb6\xbf\xb8\xc4\xde mm/s2" // "カソクド mm/s2" ("Accel") #define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "XYジク ヤクド mm/s" ("Vxy-jerk") #define MSG_VZ_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "Zジク ヤクド mm/s" ("Vz-jerk") #define MSG_VE_JERK "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\x20\xd4\xb8\xc4\xde" // "エクストルーダー ヤクド" ("Ve-jerk") #define MSG_VMAX "\xbb\xb2\xc0\xde\xb2\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "サイダイオクリソクド " ("Vmax ") +#else + #define MSG_ACC "\xb6\xbf\xb8\xc4\xde" // "カソクド" ("Accel") + #define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "XYジク ヤクド" ("Vxy-jerk") + #define MSG_VZ_JERK "Z\xbc\xde\xb8\x20\xd4\xb8\xc4\xde" // "Zジク ヤクド" ("Vz-jerk") + #define MSG_VE_JERK "E\x20\xd4\xb8\xc4\xde" // "E ヤクド" ("Ve-jerk") + #define MSG_VMAX "max\xb5\xb8\xd8\xbf\xb8\xc4\xde " // "maxオクリソクド" ("Vmax ") #endif #define MSG_X "X" #define MSG_Y "Y" #define MSG_Z "Z" #define MSG_E "E" -#if LCD_WIDTH < 20 - #define MSG_VMIN "min\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "minオクリソクド" ("Vmin") - #define MSG_VTRAV_MIN "min\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "minイドウソクド" ("VTrav min") - #define MSG_AMAX "max\xb6\xbf\xb8 " // "maxカソク " ("Amax ") -#else +#if LCD_WIDTH > 19 #define MSG_VMIN "\xbb\xb2\xbc\xae\xb3\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "サイショウオクリソクド" ("Vmin") #define MSG_VTRAV_MIN "\xbb\xb2\xbc\xae\xb3\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "サイショウイドウソクド" ("VTrav min") #define MSG_AMAX "\xbb\xb2\xc0\xde\xb2\xb6\xbf\xb8\xc4\xde " // "サイダイカソクド " ("Amax ") +#else + #define MSG_VMIN "min\xb5\xb8\xd8\xbf\xb8\xc4\xde" // "minオクリソクド" ("Vmin") + #define MSG_VTRAV_MIN "min\xb2\xc4\xde\xb3\xbf\xb8\xc4\xde" // "minイドウソクド" ("VTrav min") + #define MSG_AMAX "max\xb6\xbf\xb8 " // "maxカソク " ("Amax ") #endif #define MSG_A_RETRACT "\xcb\xb7\xba\xd0\xb6\xbf\xb8\xc4\xde" // "ヒキコミカソクド" ("A-retract") #define MSG_A_TRAVEL "\xb2\xc4\xde\xb3\xb6\xbf\xb8\xc4\xde" // "イドウカソクド" ("A-travel") @@ -136,10 +136,10 @@ #define MSG_MOTION "\xb3\xba\xde\xb7\xbe\xaf\xc3\xb2" // "ウゴキセッテイ" ("Motion") #define MSG_VOLUMETRIC "\xcc\xa8\xd7\xd2\xdd\xc4" // "フィラメント" ("Filament") #define MSG_VOLUMETRIC_ENABLED "E in mm3" -#if LCD_WIDTH < 20 - #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xb9\xb2" // "フィラメントケイ" ("Fil. Dia.") -#else +#if LCD_WIDTH > 19 #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xc1\xae\xaf\xb9\xb2" // "フィラメントチョッケイ" ("Fil. Dia.") +#else + #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xb9\xb2" // "フィラメントケイ" ("Fil. Dia.") #endif #define MSG_CONTRAST "LCD\xba\xdd\xc4\xd7\xbd\xc4" // "LCDコントラスト" ("LCD contrast") #define MSG_STORE_EPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "メモリヘカクノウ" ("Store memory") @@ -161,15 +161,7 @@ #define MSG_NO_MOVE "\xb3\xba\xde\xb7\xcf\xbe\xdd" // "ウゴキマセン" ("No move.") #define MSG_KILLED "\xcb\xbc\xde\xae\xb3\xc3\xb2\xbc" // "ヒジョウテイシ" ("KILLED. ") #define MSG_STOPPED "\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "テイシシマシタ" ("STOPPED. ") -#if LCD_WIDTH < 20 - #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3" // "ヒキコミリョウ" ("Retract mm") - #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S" // "ヒキコミリョウS" ("Swap Re.mm") - #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde" // "ヒキコミソクド" ("Retract V") - #define MSG_CONTROL_RETRACT_ZLIFT "\xc9\xbd\xde\xd9\xc0\xb2\xcb" // "ノズルタイヒ" ("Hop mm") - #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3" // "ホショウリョウ" ("UnRet +mm") - #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S" // "ホショウリョウS" ("S UnRet+mm") - #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde" // "ホショウソクド" ("UnRet V") -#else +#if LCD_WIDTH > 19 #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3 mm" // "ヒキコミリョウ mm" ("Retract mm") #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S mm" // "ヒキコミリョウS mm" ("Swap Re.mm") #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde mm/s" // "ヒキコミソクド mm/s" ("Retract V") @@ -177,49 +169,57 @@ #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3 mm" // "ホショウリョウ mm" ("UnRet +mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S mm" // "ホショウリョウS mm" ("S UnRet+mm") #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde mm/s" // "ホショウソクド mm/s" ("UnRet V") +#else + #define MSG_CONTROL_RETRACT "\xcb\xb7\xba\xd0\xd8\xae\xb3" // "ヒキコミリョウ" ("Retract mm") + #define MSG_CONTROL_RETRACT_SWAP "\xcb\xb7\xba\xd0\xd8\xae\xb3S" // "ヒキコミリョウS" ("Swap Re.mm") + #define MSG_CONTROL_RETRACTF "\xcb\xb7\xba\xd0\xbf\xb8\xc4\xde" // "ヒキコミソクド" ("Retract V") + #define MSG_CONTROL_RETRACT_ZLIFT "\xc9\xbd\xde\xd9\xc0\xb2\xcb" // "ノズルタイヒ" ("Hop mm") + #define MSG_CONTROL_RETRACT_RECOVER "\xce\xbc\xae\xb3\xd8\xae\xb3" // "ホショウリョウ" ("UnRet +mm") + #define MSG_CONTROL_RETRACT_RECOVER_SWAP "\xce\xbc\xae\xb3\xd8\xae\xb3S" // "ホショウリョウS" ("S UnRet+mm") + #define MSG_CONTROL_RETRACT_RECOVERF "\xce\xbc\xae\xb3\xbf\xb8\xc4\xde" // "ホショウソクド" ("UnRet V") #endif #define MSG_AUTORETRACT "\xbc\xde\xc4\xde\xb3\xcb\xb7\xba\xd0" // "ジドウヒキコミ" ("AutoRetr.") #define MSG_FILAMENTCHANGE "\xcc\xa8\xd7\xd2\xdd\xc4\xba\xb3\xb6\xdd" // "フィラメントコウカン" ("Change filament") #define MSG_INIT_SDCARD "SD\xb6\xb0\xc4\xde\xbb\xb2\xd6\xd0\xba\xd0" // "SDカードサイヨミコミ" ("Init. SD card") #define MSG_CNG_SDCARD "SD\xb6\xb0\xc4\xde\xba\xb3\xb6\xdd" // "SDカードコウカン" ("Change SD card") #define MSG_ZPROBE_OUT "Z\xcc\xdf\xdb\xb0\xcc\xde\x20\xcd\xde\xaf\xc4\xde\xb6\xde\xb2" // "Zプローブ ベッドガイ" ("Z probe out. bed") - -#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST "first" -/* -#if LCD_WIDTH < 20 - #define MSG_YX_UNHOMED "\xbb\xb7\xc6X/Y\xa6\xcc\xaf\xb7\xbb\xbe\xd6" // "サキニX/Yヲフッキサセヨ" ("Home X/Y before Z") - #define MSG_XYZ_UNHOMED "\xbb\xb7\xc6\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xa6\xbe\xd6" // "サキニゲンテンフッキヲセヨ" ("Home XYZ first") +#define MSG_HOME "\xbb\xb7\xc6" // "サキニ" ("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#if LCD_WIDTH > 19 + #define MSG_FIRST "\xa6\xcc\xaf\xb7\xbb\xbe\xc3\xb8\xc0\xde\xbb\xb2" // "ヲフッキサセテクダサイ" ("first") #else - #define MSG_YX_UNHOMED "\xbb\xb7\xc6X/Y\xa6\xcc\xaf\xb7\xbb\xbe\xc3\xb8\xc0\xde\xbb\xb2" // "サキニX/Yヲフッキサセテクダサイ" ("Home X/Y before Z") - #define MSG_XYZ_UNHOMED "\xbb\xb7\xc6\xb9\xde\xdd\xc3\xdd\xcc\xaf\xb7\xa6\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "サキニゲンテンフッキヲシテクダサイ" ("Home XYZ first") + #define MSG_FIRST "\xa6\xcc\xaf\xb7\xbb\xbe\xd6" // "ヲフッキサセヨ" ("first") #endif -*/ #define MSG_ZPROBE_ZOFFSET "Z\xb5\xcc\xbe\xaf\xc4" // "Zオフセット" ("Z Offset") #define MSG_BABYSTEP_X "X\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Xジク ビドウ" ("Babystep X") #define MSG_BABYSTEP_Y "Y\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Yジク ビドウ" ("Babystep Y") #define MSG_BABYSTEP_Z "Z\xbc\xde\xb8\x20\xcb\xde\xc4\xde\xb3" // "Zジク ビドウ" ("Babystep Z") -#if LCD_WIDTH < 20 - #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1" // "イドウゲンカイケンチ" ("Endstop abort") -#else +#if LCD_WIDTH > 19 #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1\xb7\xc9\xb3" // "イドウゲンカイケンチキノウ" ("Endstop abort") +#else + #define MSG_ENDSTOP_ABORT "\xb2\xc4\xde\xb3\xb9\xde\xdd\xb6\xb2\xb9\xdd\xc1" // "イドウゲンカイケンチ" ("Endstop abort") #endif #define MSG_HEATING_FAILED_LCD "\xb6\xc8\xc2\xbc\xaf\xca\xdf\xb2" // "カネツシッパイ" ("Heating failed") -#if LCD_WIDTH < 20 - #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0" // "エラー:ジョウチョウサーミスタ" ("Err: REDUNDANT TEMP") -#else +#if LCD_WIDTH > 19 #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0\xb0\xb7\xc9\xb3" // "エラー:ジョウチョウサーミスターキノウ" ("Err: REDUNDANT TEMP") +#else + #define MSG_ERR_REDUNDANT_TEMP "\xb4\xd7\xb0:\xbc\xde\xae\xb3\xc1\xae\xb3\xbb\xb0\xd0\xbd\xc0" // "エラー:ジョウチョウサーミスタ" ("Err: REDUNDANT TEMP") #endif #define MSG_THERMAL_RUNAWAY "\xc8\xc2\xce\xde\xb3\xbf\xb3" // "ネツボウソウ" ("THERMAL RUNAWAY") #define MSG_ERR_MAXTEMP "\xb4\xd7\xb0:\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:サイコウオンチョウカ" ("Err: MAXTEMP") #define MSG_ERR_MINTEMP "\xb4\xd7\xb0:\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:サイテイオンミマン" ("Err: MINTEMP") -#if LCD_WIDTH < 20 - #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd" // "エラー:ベッド サイコウオン" ("Err: MAXTEMP BED") - #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd" // "エラー:ベッド サイテイオン" ("Err: MINTEMP BED") -#else +#if LCD_WIDTH > 19 #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd\xc1\xae\xb3\xb6" // "エラー:ベッド サイコウオンチョウカ" ("Err: MAXTEMP BED") #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd\xd0\xcf\xdd" // "エラー:ベッド サイテイオンミマン" ("Err: MINTEMP BED") +#else + #define MSG_ERR_MAXTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xba\xb3\xb5\xdd" // "エラー:ベッド サイコウオン" ("Err: MAXTEMP BED") + #define MSG_ERR_MINTEMP_BED "\xb4\xd7\xb0:\xcd\xde\xaf\xc4\xde\x20\xbb\xb2\xc3\xb2\xb5\xdd" // "エラー:ベッド サイテイオン" ("Err: MINTEMP BED") #endif +#define MSG_HALTED "\xcc\xdf\xd8\xdd\xc0\xb0\xca\xc3\xb2\xbc\xbc\xcf\xbc\xc0" // "プリンターハテイシシマシタ" ("PRINTER HALTED") +#define MSG_PLEASE_RESET "\xd8\xbe\xaf\xc4\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "リセットシテクダサイ" ("Please reset") +#define MSG_SHORT_DAY "d" // One character only +#define MSG_SHORT_HOUR "h" // One character only +#define MSG_SHORT_MINUTE "m" // One character only +#define MSG_PRINT_TIME "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd" // "プリントジカン" ("Print time") #define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3" // "カネツチュウ" ("Heating...") #define MSG_HEATING_COMPLETE "\xb6\xc8\xc2\xb6\xdd\xd8\xae\xb3" // "カネツカンリョウ" ("Heating done.") #define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xc1\xad\xb3" // "ベッド カネツチュウ" ("Bed Heating.") @@ -229,5 +229,64 @@ #define MSG_DELTA_CALIBRATE_Y "Y\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Yジク コウセイ" ("Calibrate Y") #define MSG_DELTA_CALIBRATE_Z "Z\xbc\xde\xb8\x20\xba\xb3\xbe\xb2" // "Zジク コウセイ" ("Calibrate Z") #define MSG_DELTA_CALIBRATE_CENTER "\xc1\xad\xb3\xbc\xdd\x20\xba\xb3\xbe\xb2" // "チュウシン コウセイ" ("Calibrate Center") +#define MSG_INFO_MENU "\xba\xc9\xcc\xdf\xd8\xdd\xc0\xb0\xc6\xc2\xb2\xc3" // "コノプリンターニツイテ" ("About Printer") +#define MSG_INFO_PRINTER_MENU "\xcc\xdf\xd8\xdd\xc0\xb0\xbc\xde\xae\xb3\xce\xb3" // "プリンタージョウホウ" ("Printer Info") +#define MSG_INFO_STATS_MENU "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xae\xb3\xb7\xae\xb3" // "プリントジョウキョウ" ("Printer Stats") +#define MSG_INFO_BOARD_MENU "\xbe\xb2\xb7\xde\xae\xb9\xb2\xbc\xde\xae\xb3\xce\xb3" // "セイギョケイジョウホウ" ("Board Info") +#define MSG_INFO_THERMISTOR_MENU "\xbb\xb0\xd0\xbd\xc0\xb0" // "サーミスター" ("Thermistors") +#define MSG_INFO_EXTRUDERS "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\xbd\xb3" // "エクストルーダースウ" ("Extruders") +#define MSG_INFO_BAUDRATE "\xce\xde\xb0\xda\xb0\xc4" // "ボーレート" ("Baud") +#define MSG_INFO_PROTOCOL "\xcc\xdf\xdb\xc4\xba\xd9" // "プロトコル" ("Protocol") +#if LCD_WIDTH > 19 + #define MSG_INFO_PRINT_COUNT "\xcc\xdf\xd8\xdd\xc4\xbd\xb3 " // "プリントスウ " ("Print Count") + #define MSG_INFO_COMPLETED_PRINTS "\xb6\xdd\xd8\xae\xb3\xbd\xb3 " // "カンリョウスウ " ("Completed ") + #define MSG_INFO_PRINT_TIME "\xba\xde\xb3\xb9\xb2\xbc\xde\xb6\xdd" // "ゴウケイジカン" ("Total Time ") +#else + #define MSG_INFO_PRINT_COUNT "\xcc\xdf\xd8\xdd\xc4\xbd\xb3" // "プリントスウ" ("Print Count") + #define MSG_INFO_COMPLETED_PRINTS "\xb6\xdd\xd8\xae\xb3\xbd\xb3" // "カンリョウスウ" ("Completed ") + #define MSG_INFO_PRINT_TIME "\xb9\xb2\xb6\xbc\xde\xb6\xdd" // "ケイカジカン" ("Duration ") +#endif +#define MSG_INFO_MIN_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xc3\xb2\xb5\xdd" // "セッテイサイテイオン" ("Min Temp") +#define MSG_INFO_MAX_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xba\xb3\xb5\xdd" // "セッテイサイコウオン" ("Max Temp") +#if LCD_WIDTH > 19 + #define MSG_INFO_PSU "\xc3\xde\xdd\xb9\xde\xdd\xbc\xad\xcd\xde\xc2" // "デンゲンシュベツ" ("Power Supply") +#else + #define MSG_INFO_PSU "\xc3\xde\xdd\xb9\xde\xdd" // "デンゲン" ("Power Supply") +#endif +#define MSG_FILAMENT_CHANGE_HEADER "\xcc\xa8\xd7\xd2\xdd\xc4\xba\xb3\xb6\xdd" // "フィラメントコウカン" ("CHANGE FILAMENT") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER "\xc4\xde\xb3\xbb\xa6\xbe\xdd\xc0\xb8\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "ドウサヲセンタクシテクダサイ" ("CHANGE OPTIONS:") +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "\xbb\xd7\xc6\xb5\xbc\xc0\xde\xbd" // "サラニオシダス" ("Extrude more") +#define MSG_FILAMENT_CHANGE_OPTION_RESUME "\xcc\xdf\xd8\xdd\xc4\xbb\xb2\xb6\xb2" // "プリントサイカイ" ("Resume print") +#if LCD_HEIGHT >= 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "\xba\xb3\xb6\xdd\xa6\xb6\xb2\xbc\xbc\xcf\xbd" // "コウカンヲカイシシマス" ("Wait for start") + #define MSG_FILAMENT_CHANGE_INIT_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("of the filament") + #define MSG_FILAMENT_CHANGE_INIT_3 "" // "" ("change") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xc7\xb7\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントヌキダシチュウ" ("Wait for") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament unload") + #define MSG_FILAMENT_CHANGE_UNLOAD_3 "" + #define MSG_FILAMENT_CHANGE_INSERT_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xa6\xbf\xb3\xc6\xad\xb3\xbc," // "フィラメントヲソウニュウシ," ("Insert filament") + #define MSG_FILAMENT_CHANGE_INSERT_2 "\xb8\xd8\xaf\xb8\xbd\xd9\xc4\xbf\xde\xaf\xba\xb3\xbc\xcf\xbd" // "クリックスルトゾッコウシマス" ("and press button") + #define MSG_FILAMENT_CHANGE_INSERT_3 "" // "" ("to continue...") + #define MSG_FILAMENT_CHANGE_LOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xc3\xdd\xc1\xad\xb3" // "フィラメントソウテンチュウ" ("Wait for") + #define MSG_FILAMENT_CHANGE_LOAD_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament load") + #define MSG_FILAMENT_CHANGE_LOAD_3 "" + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xb5\xbc\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントオシダシチュウ" ("Wait for") + #define MSG_FILAMENT_CHANGE_EXTRUDE_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("filament extrude") + #define MSG_FILAMENT_CHANGE_EXTRUDE_3 "" + #define MSG_FILAMENT_CHANGE_RESUME_1 "\xcc\xdf\xd8\xdd\xc4\xa6\xbb\xb2\xb6\xb2\xbc\xcf\xbd" // "プリントヲサイカイシマス" ("Wait for print") + #define MSG_FILAMENT_CHANGE_RESUME_2 "\xbc\xca\xde\xd7\xb8\xb5\xcf\xc1\xb8\xc0\xde\xbb\xb2" // "シバラクオマチクダサイ" ("to resume") + #define MSG_FILAMENT_CHANGE_RESUME_3 "" +#else // LCD_HEIGHT < 4 + #define MSG_FILAMENT_CHANGE_INIT_1 "\xba\xb3\xb6\xdd\xa6\xb6\xb2\xbc\xbc\xcf\xbd" // "コウカンヲカイシシマス" ("Please wait...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xc7\xb7\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントヌキダシチュウ" ("Ejecting...") + #if LCD_WIDTH > 19 + #define MSG_FILAMENT_CHANGE_INSERT_1 "\xbf\xb3\xc6\xad\xb3\xbc\x2c\xb8\xd8\xaf\xb8\xbc\xc3\xb8\xc0\xde\xbb\xb2" // "ソウニュウシ,クリックシテクダサイ" ("Insert and Click") + #else + #define MSG_FILAMENT_CHANGE_INSERT_1 "\xbf\xb3\xc6\xad\xb3\xbc\x2c\xb8\xd8\xaf\xb8\xbe\xd6" // "ソウニュウシ,クリックセヨ" ("Insert and Click") + #endif + #define MSG_FILAMENT_CHANGE_LOAD_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xc3\xdd\xc1\xad\xb3" // "フィラメントソウテンチュウ" ("Loading...") + #define MSG_FILAMENT_CHANGE_EXTRUDE_1 "\xcc\xa8\xd7\xd2\xdd\xc4\xb5\xbc\xc0\xde\xbc\xc1\xad\xb3" // "フィラメントオシダシチュウ" ("Extruding...") + #define MSG_FILAMENT_CHANGE_RESUME_1 "\xcc\xdf\xd8\xdd\xc4\xa6\xbb\xb2\xb6\xb2\xbc\xcf\xbd" // "プリントヲサイカイシマス" ("Resuming...") +#endif // LCD_HEIGHT < 4 #endif // LANGUAGE_KANA_H diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 46aba87d2..dd2a8e5fb 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -61,14 +61,14 @@ #define MSG_SET_ORIGIN "キジュンセット" // "Set origin" #define MSG_PREHEAT_1 "PLA ヨネツ" // "Preheat PLA" #define MSG_PREHEAT_1_N MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 " スベテ" // " All" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 " ベッド" // " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 " セッテイ" // " conf" +#define MSG_PREHEAT_1_ALL "PLA スベテヨネツ" // " All" +#define MSG_PREHEAT_1_BEDONLY "PLA ベッドヨネツ" // " Bed" +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 "セッテイ" // " conf" #define MSG_PREHEAT_2 "ABS ヨネツ" // "Preheat ABS" #define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " スベテ" // " All" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " ベッド" // " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " セッテイ" // " conf" +#define MSG_PREHEAT_2_ALL "ABS スベテヨネツ" // " All" +#define MSG_PREHEAT_2_BEDONLY "ABS ベッドヨネツ" // " Bed" +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 "セッテイ" // " conf" #define MSG_COOLDOWN "カネツテイシ" // "Cooldown" #define MSG_SWITCH_PS_ON "デンゲン オン" // "Switch power on" #define MSG_SWITCH_PS_OFF "デンゲン オフ" // "Switch power off" @@ -155,8 +155,8 @@ #define MSG_INIT_SDCARD "SDカードサイヨミコミ" // "Init. SD card" #define MSG_CNG_SDCARD "SDカードコウカン" // "Change SD card" #define MSG_ZPROBE_OUT "Zプローブ ベッドガイ" // "Z probe out. bed" -#define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST "first" +#define MSG_HOME "サキニ" // "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +#define MSG_FIRST "ヲフッキサセテクダサイ" // "first" #define MSG_ZPROBE_ZOFFSET "Zオフセット" // "Z Offset" #define MSG_BABYSTEP_X "Xジク ビドウ" // "Babystep X" #define MSG_BABYSTEP_Y "Yジク ビドウ" // "Babystep Y" @@ -169,6 +169,12 @@ #define MSG_ERR_MINTEMP "エラー:サイテイオンミマン" // "Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED "エラー:ベッド サイコウオンチョウカ" // "Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED "エラー:ベッド サイテイオンミマン" // "Err: MINTEMP BED" +#define MSG_HALTED "プリンターハテイシシマシタ" // "PRINTER HALTED" +#define MSG_PLEASE_RESET "リセットシテクダサイ" // "Please reset" +#define MSG_SHORT_DAY "d" // One character only +#define MSG_SHORT_HOUR "h" // One character only +#define MSG_SHORT_MINUTE "m" // One character only +#define MSG_PRINT_TIME "プリントジカン" // "Print time" #define MSG_HEATING "カネツチュウ" // "Heating..." #define MSG_HEATING_COMPLETE "カネツカンリョウ" // "Heating done." #define MSG_BED_HEATING "ベッド カネツチュウ" // "Bed Heating." @@ -178,5 +184,41 @@ #define MSG_DELTA_CALIBRATE_Y "Yジク コウセイ" // "Calibrate Y" #define MSG_DELTA_CALIBRATE_Z "Zジク コウセイ" // "Calibrate Z" #define MSG_DELTA_CALIBRATE_CENTER "チュウシン コウセイ" // "Calibrate Center" +#define MSG_INFO_MENU "コノプリンターニツイテ" // "About Printer" +#define MSG_INFO_PRINTER_MENU "プリンタージョウホウ" // "Printer Info" +#define MSG_INFO_STATS_MENU "プリントジョウキョウ" // "Printer Stats" +#define MSG_INFO_BOARD_MENU "セイギョケイジョウホウ" // "Board Info" +#define MSG_INFO_THERMISTOR_MENU "サーミスター" // "Thermistors" +#define MSG_INFO_EXTRUDERS "エクストルーダースウ" // "Extruders" +#define MSG_INFO_BAUDRATE "ボーレート" // "Baud" +#define MSG_INFO_PROTOCOL "プロトコル" // "Protocol" +#define MSG_INFO_PRINT_COUNT "プリントスウ " // "Print Count " +#define MSG_INFO_COMPLETED_PRINTS "カンリョウスウ" // "Finished " +#define MSG_INFO_PRINT_TIME "ゴウケイジカン" // "Total Time " +#define MSG_INFO_MIN_TEMP "セッテイサイテイオン" // "Min Temp" +#define MSG_INFO_MAX_TEMP "セッテイサイコウオン" // "Max Temp" +#define MSG_INFO_PSU "デンゲンシュベツ" // "Power Supply" +#define MSG_FILAMENT_CHANGE_HEADER "フィラメントコウカン" // "CHANGE FILAMENT" +#define MSG_FILAMENT_CHANGE_OPTION_HEADER "ドウサヲセンタクシテクダサイ" // "CHANGE OPTIONS:" +#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE "サラニオシダス" // "Extrude more" +#define MSG_FILAMENT_CHANGE_OPTION_RESUME "プリントサイカイ" // "Resume print" +#define MSG_FILAMENT_CHANGE_INIT_1 "コウカンヲカイシシマス" // "Wait for start" +#define MSG_FILAMENT_CHANGE_INIT_2 "シバラクオマチクダサイ" // "of the filament" +#define MSG_FILAMENT_CHANGE_INIT_3 "" // "change" +#define MSG_FILAMENT_CHANGE_UNLOAD_1 "フィラメントヌキダシチュウ" // "Wait for" +#define MSG_FILAMENT_CHANGE_UNLOAD_2 "シバラクオマチクダサイ" // "filament unload" +#define MSG_FILAMENT_CHANGE_UNLOAD_3 "" +#define MSG_FILAMENT_CHANGE_INSERT_1 "フィラメントヲソウニュウシ," // "Insert filament" +#define MSG_FILAMENT_CHANGE_INSERT_2 "クリックスルトゾッコウシマス" // "and press button" +#define MSG_FILAMENT_CHANGE_INSERT_3 "" // "to continue..." +#define MSG_FILAMENT_CHANGE_LOAD_1 "フィラメントソウテンチュウ" // "Wait for" +#define MSG_FILAMENT_CHANGE_LOAD_2 "シバラクオマチクダサイ" // "filament load" +#define MSG_FILAMENT_CHANGE_LOAD_3 "" +#define MSG_FILAMENT_CHANGE_EXTRUDE_1 "フィラメントオシダシチュウ" // "Wait for" +#define MSG_FILAMENT_CHANGE_EXTRUDE_2 "シバラクオマチクダサイ" // "filament extrude" +#define MSG_FILAMENT_CHANGE_EXTRUDE_3 "" +#define MSG_FILAMENT_CHANGE_RESUME_1 "プリントヲサイカイシマス" // "Wait for print" +#define MSG_FILAMENT_CHANGE_RESUME_2 "シバラクオマチクダサイ" // "to resume" +#define MSG_FILAMENT_CHANGE_RESUME_3 "" #endif // LANGUAGE_KANA_UTF_H From 9730a9355cdef66f4b91eb6eff19c6097f7206e9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jun 2016 15:34:34 -0700 Subject: [PATCH 379/580] Travis test for Mixing and Switching extruders --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5d7b7b6f7..8d6f5fc46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -136,6 +136,13 @@ script: - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT - build_marlin # + # Mixing Extruder + # + - restore_configs + - opt_enable MIXING_EXTRUDER + - opt_set MIXING_STEPPERS 2 + - build_marlin + # # Test DUAL_X_CARRIAGE # - restore_configs @@ -153,6 +160,16 @@ script: - opt_set LCD_FEEDBACK_FREQUENCY_DURATION_MS 10 - opt_set LCD_FEEDBACK_FREQUENCY_HZ 100 - opt_enable BQ_LCD_SMART_CONTROLLER SPEAKER + # + # Test SWITCHING_EXTRUDER + # + - restore_configs + - opt_set MOTHERBOARD BOARD_RUMBA + - opt_set EXTRUDERS 2 + - opt_enable NUM_SERVOS + - opt_set NUM_SERVOS 1 + - opt_set TEMP_SENSOR_1 1 + - opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER - build_marlin # # Test MINIRAMBO for PWM_MOTOR_CURRENT From 22b4cff423e836146d3f2874f62911c7c9e312cd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jun 2016 14:13:49 -0700 Subject: [PATCH 380/580] New extruder type configuration options --- Marlin/Conditionals.h | 50 ++++++++++++++++--- Marlin/Configuration.h | 25 +++++++++- Marlin/SanityCheck.h | 36 +++++++++++++ .../Cartesio/Configuration.h | 25 +++++++++- .../Felix/Configuration.h | 25 +++++++++- .../Felix/DUAL/Configuration.h | 25 +++++++++- .../Hephestos/Configuration.h | 25 +++++++++- .../Hephestos_2/Configuration.h | 25 +++++++++- .../K8200/Configuration.h | 25 +++++++++- .../RepRapWorld/Megatronics/Configuration.h | 25 +++++++++- .../RigidBot/Configuration.h | 25 +++++++++- .../SCARA/Configuration.h | 25 +++++++++- .../TAZ4/Configuration.h | 25 +++++++++- .../WITBOX/Configuration.h | 25 +++++++++- .../adafruit/ST7565/Configuration.h | 25 +++++++++- .../delta/biv2.5/Configuration.h | 25 +++++++++- .../delta/generic/Configuration.h | 25 +++++++++- .../delta/kossel_mini/Configuration.h | 25 +++++++++- .../delta/kossel_pro/Configuration.h | 25 +++++++++- .../delta/kossel_xl/Configuration.h | 25 +++++++++- .../makibox/Configuration.h | 25 +++++++++- .../tvrrug/Round2/Configuration.h | 25 +++++++++- 22 files changed, 558 insertions(+), 28 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index bfd485f9e..a70c44923 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -540,18 +540,52 @@ #define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED)) /** - * SINGLENOZZLE needs to differentiate EXTRUDERS and HOTENDS - * And all "extruders" are in the same place. + * Extruders have some combination of stepper motors and hotends + * so we separate these concepts into the defines: + * + * EXTRUDERS - Number of Selectable Tools + * HOTENDS - Number of hotends, whether connected or separate + * E_STEPPERS - Number of actual E stepper motors + * TOOL_E_INDEX - Index to use when getting/setting the tool state + * */ - #if ENABLED(SINGLENOZZLE) - #define HOTENDS 1 + #if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder + #define HOTENDS 1 + #define E_STEPPERS EXTRUDERS + #define TOOL_E_INDEX current_block->active_extruder #undef TEMP_SENSOR_1_AS_REDUNDANT #undef HOTEND_OFFSET_X #undef HOTEND_OFFSET_Y - #define HOTEND_OFFSET_X { 0 } - #define HOTEND_OFFSET_Y { 0 } - #else - #define HOTENDS EXTRUDERS + #elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends + #define HOTENDS EXTRUDERS + #define E_STEPPERS 1 + #define TOOL_E_INDEX 0 + #ifndef HOTEND_OFFSET_Z + #define HOTEND_OFFSET_Z { 0 } + #endif + #elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend + #define HOTENDS 1 + #define E_STEPPERS MIXING_STEPPERS + #define TOOL_E_INDEX 0 + #else // One stepper, E axis, and hotend per tool + #define HOTENDS EXTRUDERS + #define E_STEPPERS EXTRUDERS + #define TOOL_E_INDEX current_block->active_extruder + #endif + + /** + * Default hotend offsets, if not defined + */ + #if HOTENDS > 1 + #ifndef HOTEND_OFFSET_X + #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder + #endif + #ifndef HOTEND_OFFSET_Y + #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder + #endif + #if !defined(HOTEND_OFFSET_Z) && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER)) + #define HOTEND_OFFSET_Z { 0 } + #endif #endif /** diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d55bbe9dc..fb59131b2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 8334b1289..98abffa0a 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -162,6 +162,42 @@ #error "SINGLENOZZLE requires 2 or more EXTRUDERS." #endif +/** + * Only one type of extruder allowed + */ +#if (ENABLED(SWITCHING_EXTRUDER) && (ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER))) \ + || (ENABLED(SINGLENOZZLE) && ENABLED(MIXING_EXTRUDER)) + #error "Please define only one type of extruder: SINGLENOZZLE, SWITCHING_EXTRUDER, or MIXING_EXTRUDER." +#endif + +/** + * Single Stepper Dual Extruder with switching servo + */ +#if ENABLED(SWITCHING_EXTRUDER) + #if ENABLED(DUAL_X_CARRIAGE) + #error "SINGLENOZZLE and DUAL_X_CARRIAGE are incompatible." + #elif EXTRUDERS != 2 + #error "SWITCHING_EXTRUDER requires exactly 2 EXTRUDERS." + #elif NUM_SERVOS < 1 + #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1." + #endif +#endif + +/** + * Mixing Extruder requirements + */ +#if ENABLED(MIXING_EXTRUDER) + #if EXTRUDERS > 1 + #error "MIXING_EXTRUDER currently only supports one extruder." + #endif + #if MIXING_STEPPERS < 2 + #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." + #endif + #if ENABLED(FILAMENT_SENSOR) + #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway." + #endif +#endif + /** * Limited number of servos */ diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index e0df707bc..a61f51b29 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -153,6 +153,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -163,7 +187,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 3915da6e4..4ad34b019 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 066aca30f..c1467c53f 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index f09190f76..9d132ad05 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -155,6 +155,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -165,7 +189,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 2e0fcfd92..012df0680 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 3a330d6cd..a4252f496 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -159,6 +159,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -169,7 +193,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 36ddde3de..59b2c9db9 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 944384dcd..14c454780 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -155,6 +155,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -165,7 +189,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index dccb892ba..92708015b 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -177,6 +177,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -187,7 +211,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 864c37b61..700bc69c2 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 21b765bae..7110d30ea 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -155,6 +155,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -165,7 +189,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index fff7140ff..95428fc67 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 208bd586d..5a8faef98 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index bead6d4cd..3118bf3af 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index a2bf73855..3d237ec2d 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index c04ffa18b..96c143f21 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -158,6 +158,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -168,7 +192,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 17fdbfd2f..a7e3f4edc 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -145,6 +145,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -155,7 +179,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 2 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 02ec298f4..6a5a8c24c 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 37ae010f9..5f27ebd05 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. From ce2814ed606d89d7e03e50e70a99f47a92d12121 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sun, 17 Jul 2016 21:08:09 +0900 Subject: [PATCH 381/580] Update URL in createTemperatureLookupMarlin.py --- buildroot/share/scripts/createTemperatureLookupMarlin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/scripts/createTemperatureLookupMarlin.py b/buildroot/share/scripts/createTemperatureLookupMarlin.py index 3a3ed91a3..9859caaaa 100755 --- a/buildroot/share/scripts/createTemperatureLookupMarlin.py +++ b/buildroot/share/scripts/createTemperatureLookupMarlin.py @@ -5,7 +5,7 @@ Generates lookup to temperature values for use in a microcontroller in C format http://en.wikipedia.org/wiki/Steinhart-Hart_equation The main use is for Arduino programs that read data from the circuit board described here: -http://make.rrrf.org/ts-1.0 +http://reprap.org/wiki/Temperature_Sensor_v2.0 Usage: python createTemperatureLookup.py [options] From 05da02f0a29fdd3a36c4883ef8ac591b4b9dcbf9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Jun 2016 15:06:56 -0700 Subject: [PATCH 382/580] Implement MIXING_EXTRUDER and SWITCHING_EXTRUDER --- Marlin/Marlin.h | 80 ++-- Marlin/Marlin_main.cpp | 691 +++++++++++++++++++++------------ Marlin/configuration_store.cpp | 4 +- Marlin/language_en.h | 3 + Marlin/pins.h | 21 +- Marlin/pins_MEGACONTROLLER.h | 4 +- Marlin/pins_RUMBA.h | 4 +- Marlin/planner.cpp | 6 + Marlin/planner.h | 4 + Marlin/stepper.cpp | 207 +++++++--- Marlin/stepper.h | 35 +- Marlin/stepper_indirection.h | 48 ++- Marlin/ultralcd.cpp | 41 +- 13 files changed, 779 insertions(+), 369 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index d7c14d29a..bc1f567fe 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -167,37 +167,63 @@ void manage_inactivity(bool ignore_stepper_queue = false); #define disable_z() NOOP #endif -#if HAS_E0_ENABLE - #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON) - #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON) -#else - #define enable_e0() NOOP - #define disable_e0() NOOP -#endif - -#if (EXTRUDERS > 1) && HAS_E1_ENABLE - #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON) - #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON) -#else +#if ENABLED(MIXING_EXTRUDER) + + /** + * Mixing steppers synchronize their enable (and direction) together + */ + #if MIXING_STEPPERS > 3 + #define enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); } + #elif MIXING_STEPPERS > 2 + #define enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); } + #else + #define enable_e0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_e0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); } + #endif #define enable_e1() NOOP #define disable_e1() NOOP -#endif - -#if (EXTRUDERS > 2) && HAS_E2_ENABLE - #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON) - #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON) -#else #define enable_e2() NOOP #define disable_e2() NOOP -#endif - -#if (EXTRUDERS > 3) && HAS_E3_ENABLE - #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON) - #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON) -#else #define enable_e3() NOOP #define disable_e3() NOOP -#endif + +#else // !MIXING_EXTRUDER + + #if HAS_E0_ENABLE + #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON) + #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_e0() NOOP + #define disable_e0() NOOP + #endif + + #if E_STEPPERS > 1 && HAS_E1_ENABLE + #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON) + #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_e1() NOOP + #define disable_e1() NOOP + #endif + + #if E_STEPPERS > 2 && HAS_E2_ENABLE + #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON) + #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_e2() NOOP + #define disable_e2() NOOP + #endif + + #if E_STEPPERS > 3 && HAS_E3_ENABLE + #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON) + #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_e3() NOOP + #define disable_e3() NOOP + #endif + +#endif // !MIXING_EXTRUDER /** * The axis order in all axis related arrays is X, Y, Z, E @@ -376,6 +402,10 @@ extern uint8_t active_extruder; void print_heaterstates(); #endif +#if ENABLED(MIXING_EXTRUDER) + extern float mixing_factor[MIXING_STEPPERS]; +#endif + void calculate_volumetric_multipliers(); // Buzzer diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 14c427be4..837550e8f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -183,6 +183,9 @@ * M145 - Set the heatup state H B F for S (0=PLA, 1=ABS) * M149 - Set temperature units * M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. + * M163 - Set a single proportion for a mixing extruder. Requires MIXING_EXTRUDER. + * M164 - Save the mix as a virtual extruder. Requires MIXING_EXTRUDER and MIXING_VIRTUAL_TOOLS. + * M165 - Set the proportions for a mixing extruder. Use parameters ABCDHI to set the mixing factors. Requires MIXING_EXTRUDER. * M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling * M200 - Set filament diameter, D, setting E axis units to cubic. (Use S0 to revert to linear units.) @@ -397,17 +400,11 @@ static uint8_t target_extruder; // Extruder offsets #if HOTENDS > 1 - #ifndef HOTEND_OFFSET_X - #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Y - #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder - #endif float hotend_offset[][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y - #if ENABLED(DUAL_X_CARRIAGE) - , { 0 } // Z offsets for each extruder + #ifdef HOTEND_OFFSET_Z + , HOTEND_OFFSET_Z #endif }; #endif @@ -507,6 +504,13 @@ static uint8_t target_extruder; FilamentChangeMenuResponse filament_change_menu_response; #endif +#if ENABLED(MIXING_EXTRUDER) + float mixing_factor[MIXING_STEPPERS]; + #if MIXING_VIRTUAL_TOOLS > 1 + float mixing_virtual_tool_mix[MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; + #endif +#endif + static bool send_ok[BUFSIZE]; #if HAS_SERVOS @@ -952,6 +956,15 @@ void setup() { lcd_init(); #endif #endif + + #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 + // Initialize mixing to 100% color 1 + for (uint8_t i = 0; i < MIXING_STEPPERS; i++) + mixing_factor[i] = (i == 0) ? 1 : 0; + for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS; t++) + for (uint8_t i = 0; i < MIXING_STEPPERS; i++) + mixing_virtual_tool_mix[t][i] = mixing_factor[i]; + #endif } /** @@ -2544,6 +2557,39 @@ static void homeaxis(AxisEnum axis) { #endif // FWRETRACT +#if ENABLED(MIXING_EXTRUDER) + + void normalize_mix() { + float mix_total = 0.0; + for (int i = 0; i < MIXING_STEPPERS; i++) { + float v = mixing_factor[i]; + if (v < 0) v = mixing_factor[i] = 0; + mix_total += v; + } + // Scale all values if they don't add up to ~1.0 + if (mix_total < 0.9999 || mix_total > 1.0001) { + SERIAL_PROTOCOLLNPGM("Warning: Mix factors must add up to 1.0. Scaling."); + float mix_scale = 1.0 / mix_total; + for (int i = 0; i < MIXING_STEPPERS; i++) + mixing_factor[i] *= mix_scale; + } + } + + #if ENABLED(DIRECT_MIXING_IN_G1) + // Get mixing parameters from the GCode + // Factors that are left out are set to 0 + // The total "must" be 1.0 (but it will be normalized) + void gcode_get_mix() { + const char* mixing_codes = "ABCDHI"; + for (int i = 0; i < MIXING_STEPPERS; i++) + mixing_factor[i] = code_seen(mixing_codes[i]) ? code_value_float() : 0; + + normalize_mix(); + } + #endif + +#endif + /** * *************************************************************************** * ***************************** G-CODE HANDLING ***************************** @@ -2572,6 +2618,11 @@ void gcode_get_destination() { if(!DEBUGGING(DRYRUN)) print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]); #endif + + // Get ABCDHI mixing factors + #if ENABLED(MIXING_EXTRUDER) && ENABLED(DIRECT_MIXING_IN_G1) + gcode_get_mix(); + #endif } void unknown_command_error() { @@ -4733,6 +4784,8 @@ inline void gcode_M109() { KEEPALIVE_STATE(NOT_BUSY); + target_extruder = active_extruder; // for print_heaterstates + do { // Target temperature might be changed during the loop if (theTarget != thermalManager.degTargetBed()) { @@ -5258,7 +5311,7 @@ inline void gcode_M200() { if (volumetric_enabled) { filament_size[target_extruder] = code_value_linear_units(); // make sure all extruders have some sane value for the filament size - for (int i = 0; i < EXTRUDERS; i++) + for (int i = 0; i < COUNT(filament_size); i++) if (! filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA; } } @@ -5496,7 +5549,7 @@ inline void gcode_M206() { * T * X * Y - * Z - Available with DUAL_X_CARRIAGE + * Z - Available with DUAL_X_CARRIAGE and SWITCHING_EXTRUDER */ inline void gcode_M218() { if (get_target_extruder_from_command(218)) return; @@ -5504,7 +5557,7 @@ inline void gcode_M206() { if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value_axis_units(X_AXIS); if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value_axis_units(Y_AXIS); - #if ENABLED(DUAL_X_CARRIAGE) + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER) if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value_axis_units(Z_AXIS); #endif @@ -5515,7 +5568,7 @@ inline void gcode_M206() { SERIAL_ECHO(hotend_offset[X_AXIS][e]); SERIAL_CHAR(','); SERIAL_ECHO(hotend_offset[Y_AXIS][e]); - #if ENABLED(DUAL_X_CARRIAGE) + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER) SERIAL_CHAR(','); SERIAL_ECHO(hotend_offset[Z_AXIS][e]); #endif @@ -6528,6 +6581,60 @@ inline void gcode_M907() { #endif // HAS_MICROSTEPS +#if ENABLED(MIXING_EXTRUDER) + + /** + * M163: Set a single mix factor for a mixing extruder + * This is called "weight" by some systems. + * + * S[index] The channel index to set + * P[float] The mix value + * + */ + inline void gcode_M163() { + int mix_index = code_seen('S') ? code_value_int() : 0; + float mix_value = code_seen('P') ? code_value_float() : 0.0; + if (mix_index < MIXING_STEPPERS) mixing_factor[mix_index] = mix_value; + } + + #if MIXING_VIRTUAL_TOOLS > 1 + + /** + * M164: Store the current mix factors as a virtual tool. + * + * S[index] The virtual tool to store + * + */ + inline void gcode_M164() { + int tool_index = code_seen('S') ? code_value_int() : 0; + if (tool_index < MIXING_VIRTUAL_TOOLS) { + normalize_mix(); + for (uint8_t i = 0; i < MIXING_STEPPERS; i++) + mixing_virtual_tool_mix[tool_index][i] = mixing_factor[i]; + } + } + + #endif + + #if ENABLED(DIRECT_MIXING_IN_G1) + /** + * M165: Set multiple mix factors for a mixing extruder. + * Factors that are left out will be set to 0. + * All factors together must add up to 1.0. + * + * A[factor] Mix factor for extruder stepper 1 + * B[factor] Mix factor for extruder stepper 2 + * C[factor] Mix factor for extruder stepper 3 + * D[factor] Mix factor for extruder stepper 4 + * H[factor] Mix factor for extruder stepper 5 + * I[factor] Mix factor for extruder stepper 6 + * + */ + inline void gcode_M165() { gcode_get_mix(); } + #endif + +#endif // MIXING_EXTRUDER + /** * M999: Restart after being stopped * @@ -6548,6 +6655,20 @@ inline void gcode_M999() { FlushSerialRequestResend(); } +#if ENABLED(SWITCHING_EXTRUDER) + inline void move_extruder_servo(uint8_t e) { + const int angles[2] = SWITCHING_EXTRUDER_SERVO_ANGLES; + MOVE_SERVO(SWITCHING_EXTRUDER_SERVO_NR, angles[e]); + } +#endif + +inline void invalid_extruder_error(const uint8_t &e) { + SERIAL_ECHO_START; + SERIAL_CHAR('T'); + SERIAL_PROTOCOL_F(e, DEC); + SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); +} + /** * T0-T3: Switch tool, usually switching extruders * @@ -6555,264 +6676,314 @@ inline void gcode_M999() { * S1 Don't move the tool in XY after change */ inline void gcode_T(uint8_t tmp_extruder) { - if (tmp_extruder >= EXTRUDERS) { - SERIAL_ECHO_START; - SERIAL_CHAR('T'); - SERIAL_PROTOCOL_F(tmp_extruder, DEC); - SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); - return; - } - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM(">>> gcode_T"); - DEBUG_POS("BEFORE", current_position); + #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 + + if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) { + invalid_extruder_error(tmp_extruder); + return; } - #endif - #if HOTENDS > 1 + // T0-Tnnn: Switch virtual tool by changing the mix + for (uint8_t j = 0; j < MIXING_STEPPERS; j++) + mixing_factor[j] = mixing_virtual_tool_mix[tmp_extruder][j]; - float old_feedrate = feedrate; + #else //!MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 - if (code_seen('F')) { - float next_feedrate = code_value_axis_units(X_AXIS); - if (next_feedrate > 0.0) old_feedrate = feedrate = next_feedrate; - } - else - feedrate = XY_PROBE_FEEDRATE; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOLNPGM(">>> gcode_T"); + DEBUG_POS("BEFORE", current_position); + } + #endif - if (tmp_extruder != active_extruder) { - bool no_move = code_seen('S') && code_value_bool(); - if (!no_move && axis_unhomed_error(true, true, true)) { - SERIAL_ECHOLNPGM("No move on toolchange"); - no_move = true; + #if HOTENDS > 1 + + if (tmp_extruder >= EXTRUDERS) { + invalid_extruder_error(tmp_extruder); + return; } - // Save current position to destination, for use later - set_destination_to_current(); + float old_feedrate = feedrate; - #if ENABLED(DUAL_X_CARRIAGE) + if (code_seen('F')) { + float next_feedrate = code_value_axis_units(X_AXIS); + if (next_feedrate > 0.0) old_feedrate = feedrate = next_feedrate; + } + else + feedrate = XY_PROBE_FEEDRATE; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("Dual X Carriage Mode "); - switch (dual_x_carriage_mode) { - case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break; - case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break; - case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break; - } - } - #endif + if (tmp_extruder != active_extruder) { + bool no_move = code_seen('S') && code_value_bool(); + + if (!no_move && axis_unhomed_error(true, true, true)) { + SERIAL_ECHOLNPGM("No move on toolchange"); + no_move = true; + } + + // Save current position to destination, for use later + set_destination_to_current(); + + #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() - && (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder)) - ) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise to ", current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT); SERIAL_EOL; - SERIAL_ECHOPAIR("MoveX to ", x_home_pos(active_extruder)); SERIAL_EOL; - SERIAL_ECHOPAIR("Lower to ", current_position[Z_AXIS]); SERIAL_EOL; + SERIAL_ECHOPGM("Dual X Carriage Mode "); + switch (dual_x_carriage_mode) { + case DXC_DUPLICATION_MODE: SERIAL_ECHOLNPGM("DXC_DUPLICATION_MODE"); break; + case DXC_AUTO_PARK_MODE: SERIAL_ECHOLNPGM("DXC_AUTO_PARK_MODE"); break; + case DXC_FULL_CONTROL_MODE: SERIAL_ECHOLNPGM("DXC_FULL_CONTROL_MODE"); break; + } } #endif - // Park old head: 1) raise 2) move to park position 3) lower - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT, - current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder); - planner.buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT, - current_position[E_AXIS], planner.max_feedrate[X_AXIS], active_extruder); - planner.buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder); - stepper.synchronize(); - } - // apply Y & Z extruder offset (x offset is already used in determining home pos) - current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder]; - current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - active_extruder = tmp_extruder; + if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() && + (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder)) + ) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Raise to ", current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT); SERIAL_EOL; + SERIAL_ECHOPAIR("MoveX to ", x_home_pos(active_extruder)); SERIAL_EOL; + SERIAL_ECHOPAIR("Lower to ", current_position[Z_AXIS]); SERIAL_EOL; + } + #endif + // Park old head: 1) raise 2) move to park position 3) lower + for (uint8_t i = 0; i < 3; i++) + planner.buffer_line( + i == 0 ? current_position[X_AXIS] : x_home_pos(active_extruder), + current_position[Y_AXIS], + current_position[Z_AXIS] + (i == 2 ? 0 : TOOLCHANGE_PARK_ZLIFT), + current_position[E_AXIS], + planner.max_feedrate[i == 1 ? X_AXIS : Z_AXIS], + active_extruder + ); + stepper.synchronize(); + } - // This function resets the max/min values - the current position may be overwritten below. - set_axis_is_at_home(X_AXIS); + // apply Y & Z extruder offset (x offset is already used in determining home pos) + current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder]; + current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; + active_extruder = tmp_extruder; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); - #endif + // This function resets the max/min values - the current position may be overwritten below. + set_axis_is_at_home(X_AXIS); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: - current_position[X_AXIS] = inactive_extruder_x_pos; - inactive_extruder_x_pos = destination[X_AXIS]; - break; - case DXC_DUPLICATION_MODE: - active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position - if (active_extruder_parked) - current_position[X_AXIS] = inactive_extruder_x_pos; - else - current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset; - inactive_extruder_x_pos = destination[X_AXIS]; - extruder_duplication_enabled = false; - break; - default: - // record raised toolhead position for use by unpark - memcpy(raised_parked_position, current_position, sizeof(raised_parked_position)); - raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; - active_extruder_parked = true; - delayed_move_time = 0; - break; - } + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); + #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); - SERIAL_EOL; - DEBUG_POS("New extruder (parked)", current_position); + switch (dual_x_carriage_mode) { + case DXC_FULL_CONTROL_MODE: + current_position[X_AXIS] = inactive_extruder_x_pos; + inactive_extruder_x_pos = destination[X_AXIS]; + break; + case DXC_DUPLICATION_MODE: + active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position + if (active_extruder_parked) + current_position[X_AXIS] = inactive_extruder_x_pos; + else + current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset; + inactive_extruder_x_pos = destination[X_AXIS]; + extruder_duplication_enabled = false; + break; + default: + // record raised toolhead position for use by unpark + memcpy(raised_parked_position, current_position, sizeof(raised_parked_position)); + raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; + active_extruder_parked = true; + delayed_move_time = 0; + break; } - #endif - - // No extra case for AUTO_BED_LEVELING_FEATURE in DUAL_X_CARRIAGE. Does that mean they don't work together? - #else // !DUAL_X_CARRIAGE - - /** - * Set current_position to the position of the new nozzle. - * Offsets are based on linear distance, so we need to get - * the resulting position in coordinate space. - * - * - With grid or 3-point leveling, offset XYZ by a tilted vector - * - With mesh leveling, update Z for the new position - * - Otherwise, just use the raw linear distance - * - * Software endstops are altered here too. Consider a case where: - * E0 at X=0 ... E1 at X=10 - * When we switch to E1 now X=10, but E1 can't move left. - * To express this we apply the change in XY to the software endstops. - * E1 can move farther right than E0, so the right limit is extended. - * - * Note that we don't adjust the Z software endstops. Why not? - * Consider a case where Z=0 (here) and switching to E1 makes Z=1 - * because the bed is 1mm lower at the new position. As long as - * the first nozzle is out of the way, the carriage should be - * allowed to move 1mm lower. This technically "breaks" the - * Z software endstop. But this is technically correct (and - * there is no viable alternative). - */ - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - // Offset extruder, make sure to apply the bed level rotation matrix - vector_3 tmp_offset_vec = vector_3(hotend_offset[X_AXIS][tmp_extruder], - hotend_offset[Y_AXIS][tmp_extruder], - 0), - act_offset_vec = vector_3(hotend_offset[X_AXIS][active_extruder], - hotend_offset[Y_AXIS][active_extruder], - 0), - offset_vec = tmp_offset_vec - act_offset_vec; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - tmp_offset_vec.debug("tmp_offset_vec"); - act_offset_vec.debug("act_offset_vec"); - offset_vec.debug("offset_vec (BEFORE)"); + SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); + SERIAL_EOL; + DEBUG_POS("New extruder (parked)", current_position); } #endif - offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix)); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) offset_vec.debug("offset_vec (AFTER)"); + // No extra case for AUTO_BED_LEVELING_FEATURE in DUAL_X_CARRIAGE. Does that mean they don't work together? + #else // !DUAL_X_CARRIAGE + + #if ENABLED(SWITCHING_EXTRUDER) + // <0 if the new nozzle is higher, >0 if lower. A bigger raise when lower. + float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder], + z_raise = 0.3 + (z_diff > 0.0 ? z_diff : 0.0); + + // Always raise by some amount + planner.buffer_line( + current_position[X_AXIS], + current_position[Y_AXIS], + current_position[Z_AXIS] + z_raise, + current_position[E_AXIS], + planner.max_feedrate[Z_AXIS], + active_extruder + ); + stepper.synchronize(); + + move_extruder_servo(active_extruder); + delay(500); + + // Move back down, if needed + if (z_raise != z_diff) { + planner.buffer_line( + current_position[X_AXIS], + current_position[Y_AXIS], + current_position[Z_AXIS] + z_diff, + current_position[E_AXIS], + planner.max_feedrate[Z_AXIS], + active_extruder + ); + stepper.synchronize(); + } #endif + + /** + * Set current_position to the position of the new nozzle. + * Offsets are based on linear distance, so we need to get + * the resulting position in coordinate space. + * + * - With grid or 3-point leveling, offset XYZ by a tilted vector + * - With mesh leveling, update Z for the new position + * - Otherwise, just use the raw linear distance + * + * Software endstops are altered here too. Consider a case where: + * E0 at X=0 ... E1 at X=10 + * When we switch to E1 now X=10, but E1 can't move left. + * To express this we apply the change in XY to the software endstops. + * E1 can move farther right than E0, so the right limit is extended. + * + * Note that we don't adjust the Z software endstops. Why not? + * Consider a case where Z=0 (here) and switching to E1 makes Z=1 + * because the bed is 1mm lower at the new position. As long as + * the first nozzle is out of the way, the carriage should be + * allowed to move 1mm lower. This technically "breaks" the + * Z software endstop. But this is technically correct (and + * there is no viable alternative). + */ + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + // Offset extruder, make sure to apply the bed level rotation matrix + vector_3 tmp_offset_vec = vector_3(hotend_offset[X_AXIS][tmp_extruder], + hotend_offset[Y_AXIS][tmp_extruder], + 0), + act_offset_vec = vector_3(hotend_offset[X_AXIS][active_extruder], + hotend_offset[Y_AXIS][active_extruder], + 0), + offset_vec = tmp_offset_vec - act_offset_vec; - // Adjustments to the current position - float xydiff[2] = { offset_vec.x, offset_vec.y }; - current_position[Z_AXIS] += offset_vec.z; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + tmp_offset_vec.debug("tmp_offset_vec"); + act_offset_vec.debug("act_offset_vec"); + offset_vec.debug("offset_vec (BEFORE)"); + } + #endif - #else // !AUTO_BED_LEVELING_FEATURE + offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix)); - float xydiff[2] = { - hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], - hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder] - }; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) offset_vec.debug("offset_vec (AFTER)"); + #endif - #if ENABLED(MESH_BED_LEVELING) + // Adjustments to the current position + float xydiff[2] = { offset_vec.x, offset_vec.y }; + current_position[Z_AXIS] += offset_vec.z; - if (mbl.active()) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Z before MBL: ", current_position[Z_AXIS]); - #endif - float xpos = RAW_CURRENT_POSITION(X_AXIS), - ypos = RAW_CURRENT_POSITION(Y_AXIS); - current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos); - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(" after: ", current_position[Z_AXIS]); - SERIAL_EOL; - } - #endif - } + #else // !AUTO_BED_LEVELING_FEATURE + + float xydiff[2] = { + hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], + hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder] + }; - #endif // MESH_BED_LEVELING + #if ENABLED(MESH_BED_LEVELING) - #endif // !AUTO_BED_LEVELING_FEATURE + if (mbl.active()) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Z before MBL: ", current_position[Z_AXIS]); + #endif + float xpos = RAW_CURRENT_POSITION(X_AXIS), + ypos = RAW_CURRENT_POSITION(Y_AXIS); + current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR(" after: ", current_position[Z_AXIS]); + SERIAL_EOL; + } + #endif + } - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Offset Tool XY by { ", xydiff[X_AXIS]); - SERIAL_ECHOPAIR(", ", xydiff[X_AXIS]); - SERIAL_ECHOLNPGM(" }"); - } - #endif + #endif // MESH_BED_LEVELING + + #endif // !AUTO_BED_LEVELING_FEATURE - // The newly-selected extruder XY is actually at... - current_position[X_AXIS] += xydiff[X_AXIS]; - current_position[Y_AXIS] += xydiff[Y_AXIS]; - for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) { - position_shift[i] += xydiff[i]; - update_software_endstops((AxisEnum)i); - } + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("Offset Tool XY by { ", xydiff[X_AXIS]); + SERIAL_ECHOPAIR(", ", xydiff[X_AXIS]); + SERIAL_ECHOLNPGM(" }"); + } + #endif - // Set the new active extruder - active_extruder = tmp_extruder; + // The newly-selected extruder XY is actually at... + current_position[X_AXIS] += xydiff[X_AXIS]; + current_position[Y_AXIS] += xydiff[Y_AXIS]; + for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) { + position_shift[i] += xydiff[i]; + update_software_endstops((AxisEnum)i); + } - #endif // !DUAL_X_CARRIAGE + // Set the new active extruder + active_extruder = tmp_extruder; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Sync After Toolchange", current_position); - #endif - - // Tell the planner the new "current position" - SYNC_PLAN_POSITION_KINEMATIC(); + #endif // !DUAL_X_CARRIAGE - // Move to the "old position" (move the extruder into place) - if (!no_move && IsRunning()) { #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); + if (DEBUGGING(LEVELING)) DEBUG_POS("Sync After Toolchange", current_position); #endif - prepare_move_to_destination(); - } - } // (tmp_extruder != active_extruder) + // Tell the planner the new "current position" + SYNC_PLAN_POSITION_KINEMATIC(); - stepper.synchronize(); + // Move to the "old position" (move the extruder into place) + if (!no_move && IsRunning()) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); + #endif + prepare_move_to_destination(); + } - #if ENABLED(EXT_SOLENOID) - disable_all_solenoids(); - enable_solenoid_on_active_extruder(); - #endif // EXT_SOLENOID + } // (tmp_extruder != active_extruder) - feedrate = old_feedrate; + stepper.synchronize(); - #else // !HOTENDS > 1 + #if ENABLED(EXT_SOLENOID) + disable_all_solenoids(); + enable_solenoid_on_active_extruder(); + #endif // EXT_SOLENOID - // Set the new active extruder - active_extruder = tmp_extruder; + feedrate = old_feedrate; - #endif + #else // HOTENDS <= 1 - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - DEBUG_POS("AFTER", current_position); - SERIAL_ECHOLNPGM("<<< gcode_T"); - } - #endif + // Set the new active extruder + active_extruder = tmp_extruder; - SERIAL_ECHO_START; - SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER); - SERIAL_PROTOCOLLN((int)active_extruder); + #endif // HOTENDS <= 1 + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + DEBUG_POS("AFTER", current_position); + SERIAL_ECHOLNPGM("<<< gcode_T"); + } + #endif + + SERIAL_ECHO_START; + SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER); + SERIAL_PROTOCOLLN((int)active_extruder); + + #endif //!MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 } /** @@ -7219,6 +7390,22 @@ void process_next_command() { #endif //EXPERIMENTAL_I2CBUS + #if ENABLED(MIXING_EXTRUDER) + case 163: // M163 S P set weight for a mixing extruder + gcode_M163(); + break; + #if MIXING_VIRTUAL_TOOLS > 1 + case 164: // M164 S save current mix as a virtual extruder + gcode_M164(); + break; + #endif + #if ENABLED(DIRECT_MIXING_IN_G1) + case 165: // M165 [ABCDHI] set multiple mix weights + gcode_M165(); + break; + #endif + #endif + case 200: // M200 D Set filament diameter and set E axis units to cubic. (Use S0 to revert to linear units.) gcode_M200(); break; @@ -8033,14 +8220,14 @@ void prepare_move_to_destination() { nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s if (X_ENABLE_READ == X_ENABLE_ON || Y_ENABLE_READ == Y_ENABLE_ON || Z_ENABLE_READ == Z_ENABLE_ON || thermalManager.soft_pwm_bed > 0 || E0_ENABLE_READ == E_ENABLE_ON // If any of the drivers are enabled... - #if EXTRUDERS > 1 + #if E_STEPPERS > 1 || E1_ENABLE_READ == E_ENABLE_ON #if HAS_X2_ENABLE || X2_ENABLE_READ == X_ENABLE_ON #endif - #if EXTRUDERS > 2 + #if E_STEPPERS > 2 || E2_ENABLE_READ == E_ENABLE_ON - #if EXTRUDERS > 3 + #if E_STEPPERS > 3 || E3_ENABLE_READ == E_ENABLE_ON #endif #endif @@ -8303,25 +8490,29 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(EXTRUDER_RUNOUT_PREVENT) - if (ELAPSED(ms, previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)) - if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) { + if (ELAPSED(ms, previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) + && thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) { + #if ENABLED(SWITCHING_EXTRUDER) + bool oldstatus = E0_ENABLE_READ; + enable_e0(); + #else // !SWITCHING_EXTRUDER bool oldstatus; switch (active_extruder) { case 0: oldstatus = E0_ENABLE_READ; enable_e0(); break; - #if EXTRUDERS > 1 + #if E_STEPPERS > 1 case 1: oldstatus = E1_ENABLE_READ; enable_e1(); break; - #if EXTRUDERS > 2 + #if E_STEPPERS > 2 case 2: oldstatus = E2_ENABLE_READ; enable_e2(); break; - #if EXTRUDERS > 3 + #if E_STEPPERS > 3 case 3: oldstatus = E3_ENABLE_READ; enable_e3(); @@ -8330,37 +8521,43 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #endif #endif } - float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS]; - planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], - destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], - (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder); + #endif // !SWITCHING_EXTRUDER + + float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS]; + planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], + destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], + (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder); current_position[E_AXIS] = oldepos; destination[E_AXIS] = oldedes; planner.set_e_position_mm(oldepos); previous_cmd_ms = ms; // refresh_cmd_timeout() stepper.synchronize(); - switch (active_extruder) { - case 0: - E0_ENABLE_WRITE(oldstatus); - break; - #if EXTRUDERS > 1 - case 1: - E1_ENABLE_WRITE(oldstatus); + #if ENABLED(SWITCHING_EXTRUDER) + E0_ENABLE_WRITE(oldstatus); + #else + switch (active_extruder) { + case 0: + E0_ENABLE_WRITE(oldstatus); break; - #if EXTRUDERS > 2 - case 2: - E2_ENABLE_WRITE(oldstatus); + #if E_STEPPERS > 1 + case 1: + E1_ENABLE_WRITE(oldstatus); break; - #if EXTRUDERS > 3 - case 3: - E3_ENABLE_WRITE(oldstatus); + #if E_STEPPERS > 2 + case 2: + E2_ENABLE_WRITE(oldstatus); break; + #if E_STEPPERS > 3 + case 3: + E3_ENABLE_WRITE(oldstatus); + break; + #endif #endif #endif - #endif - } + } + #endif // !SWITCHING_EXTRUDER } - #endif + #endif // EXTRUDER_RUNOUT_PREVENT #if ENABLED(DUAL_X_CARRIAGE) // handle delayed move timeout @@ -8498,6 +8695,6 @@ float calculate_volumetric_multiplier(float diameter) { } void calculate_volumetric_multipliers() { - for (int i = 0; i < EXTRUDERS; i++) + for (int i = 0; i < COUNT(filament_size); i++) volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]); } diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 54c96b6e8..4cf9f5d36 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -349,7 +349,7 @@ void Config_StoreSettings() { // Save filament sizes for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - if (q < EXTRUDERS) dummy = filament_size[q]; + if (q < COUNT(filament_size)) dummy = filament_size[q]; EEPROM_WRITE_VAR(i, dummy); } @@ -531,7 +531,7 @@ void Config_RetrieveSettings() { for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { EEPROM_READ_VAR(i, dummy); - if (q < EXTRUDERS) filament_size[q] = dummy; + if (q < COUNT(filament_size)) filament_size[q] = dummy; } if (eeprom_checksum == stored_checksum) { diff --git a/Marlin/language_en.h b/Marlin/language_en.h index efb48f553..eba87d3df 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -251,6 +251,9 @@ #ifndef MSG_PID_C #define MSG_PID_C "PID-C" #endif +#ifndef MSG_SELECT + #define MSG_SELECT "Select" +#endif #ifndef MSG_E1 #define MSG_E1 " E1" #endif diff --git a/Marlin/pins.h b/Marlin/pins.h index 880084588..cc18289bd 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -285,6 +285,17 @@ #define _H3_PINS HEATER_3_PIN, EXTRUDER_3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN), #endif #endif +#elif ENABLED(MIXING_EXTRUDER) + #undef _E1_PINS + #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, + #if MIXING_STEPPERS > 2 + #undef _E2_PINS + #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, + #if MIXING_STEPPERS > 3 + #undef _E3_PINS + #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, + #endif + #endif #endif #define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN), @@ -374,15 +385,15 @@ // The X2 axis, if any, should be the next open extruder port #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS) #ifndef X2_STEP_PIN - #define X2_STEP_PIN _EPIN(EXTRUDERS, STEP) - #define X2_DIR_PIN _EPIN(EXTRUDERS, DIR) - #define X2_ENABLE_PIN _EPIN(EXTRUDERS, ENABLE) + #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP) + #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR) + #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE) #endif #undef _X2_PINS #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, - #define Y2_E_INDEX INCREMENT(EXTRUDERS) + #define Y2_E_INDEX INCREMENT(E_STEPPERS) #else - #define Y2_E_INDEX EXTRUDERS + #define Y2_E_INDEX E_STEPPERS #endif // The Y2 axis, if any, should be the next open extruder port diff --git a/Marlin/pins_MEGACONTROLLER.h b/Marlin/pins_MEGACONTROLLER.h index 600f2f528..f21a80518 100644 --- a/Marlin/pins_MEGACONTROLLER.h +++ b/Marlin/pins_MEGACONTROLLER.h @@ -28,8 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if EXTRUDERS > 2 || HOTENDS > 2 - #error "Mega Controller supports up to 2 extruders. Comment this line to keep going." +#if E_STEPPERS > 2 || HOTENDS > 2 + #error "Mega Controller supports up to 2 hotends / E-steppers. Comment this line to keep going." #endif #define BOARD_NAME "Mega Controller" diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h index a0fe01360..642deb292 100644 --- a/Marlin/pins_RUMBA.h +++ b/Marlin/pins_RUMBA.h @@ -28,8 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if EXTRUDERS > 3 || HOTENDS > 3 - #error "RUMBA supports up to 3 extruders. Comment this line to keep going." +#if E_STEPPERS > 3 || HOTENDS > 3 + #error "RUMBA supports up to 3 hotends / E-steppers. Comment this line to keep going." #endif #define DEFAULT_MACHINE_NAME "Rumba" diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index aacc041ef..900866e63 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -629,6 +629,12 @@ void Planner::check_axes_activity() { // Bail if this is a zero-length block if (block->step_event_count <= dropsegments) return; + // For a mixing extruder, get a magnified step_event_count for each + #if ENABLED(MIXING_EXTRUDER) + for (uint8_t i = 0; i < MIXING_STEPPERS; i++) + block->mix_event_count[i] = (mixing_factor[i] < 0.0001) ? 0 : block->step_event_count / mixing_factor[i]; + #endif + #if FAN_COUNT > 0 for (uint8_t i = 0; i < FAN_COUNT; i++) block->fan_speed[i] = fanSpeeds[i]; #endif diff --git a/Marlin/planner.h b/Marlin/planner.h index 71e6b8119..d963fba4c 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -58,6 +58,10 @@ typedef struct { long steps[NUM_AXIS]; // Step count along each axis unsigned long step_event_count; // The number of step events required to complete this block + #if ENABLED(MIXING_EXTRUDER) + unsigned long mix_event_count[MIXING_STEPPERS]; // Scaled step_event_count for the mixing steppers + #endif + long accelerate_until, // The index of the step event on which to stop acceleration decelerate_after, // The index of the step event on which to start decelerating acceleration_rate; // The acceleration rate used for acceleration calculation diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 57fa3b5b7..63159a304 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -95,13 +95,13 @@ volatile unsigned long Stepper::step_events_completed = 0; // The number of step volatile unsigned char Stepper::eISR_Rate = 200; // Keep the ISR at a low rate until needed #if ENABLED(LIN_ADVANCE) - volatile int Stepper::e_steps[EXTRUDERS]; + volatile int Stepper::e_steps[E_STEPPERS]; int Stepper::extruder_advance_k = LIN_ADVANCE_K, Stepper::final_estep_rate, - Stepper::current_estep_rate[EXTRUDERS], - Stepper::current_adv_steps[EXTRUDERS]; + Stepper::current_estep_rate[E_STEPPERS], + Stepper::current_adv_steps[E_STEPPERS]; #else - long Stepper::e_steps[EXTRUDERS], + long Stepper::e_steps[E_STEPPERS], Stepper::final_advance = 0, Stepper::old_advance = 0, Stepper::advance_rate, @@ -114,6 +114,10 @@ long Stepper::acceleration_time, Stepper::deceleration_time; volatile long Stepper::count_position[NUM_AXIS] = { 0 }; volatile signed char Stepper::count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; +#if ENABLED(MIXING_EXTRUDER) + long Stepper::counter_M[MIXING_STEPPERS]; +#endif + unsigned short Stepper::acc_step_rate; // needed for deceleration start point uint8_t Stepper::step_loops, Stepper::step_loops_nominal; unsigned short Stepper::OCR1A_nominal; @@ -179,7 +183,9 @@ volatile long Stepper::endstops_trigsteps[3]; #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v) #endif -#define E_APPLY_STEP(v,Q) E_STEP_WRITE(v) +#if DISABLED(MIXING_EXTRUDER) + #define E_APPLY_STEP(v,Q) E_STEP_WRITE(v) +#endif // intRes = longIn1 * longIn2 >> 24 // uses: @@ -322,8 +328,15 @@ void Stepper::isr() { if (current_block) { current_block->busy = true; trapezoid_generator_reset(); - counter_X = -(current_block->step_event_count >> 1); - counter_Y = counter_Z = counter_E = counter_X; + + // Initialize Bresenham counters to 1/2 the ceiling + counter_X = counter_Y = counter_Z = counter_E = -(current_block->step_event_count >> 1); + + #if ENABLED(MIXING_EXTRUDER) + MIXING_STEPPERS_LOOP(i) + counter_M[i] = -(current_block->mix_event_count[i] >> 1); + #endif + step_events_completed = 0; #if ENABLED(Z_LATE_ENABLE) @@ -335,7 +348,7 @@ void Stepper::isr() { #endif // #if ENABLED(ADVANCE) - // e_steps[current_block->active_extruder] = 0; + // e_steps[TOOL_E_INDEX] = 0; // #endif } else { @@ -343,7 +356,7 @@ void Stepper::isr() { } } - if (current_block != NULL) { + if (current_block) { // Update endstops state, if enabled #if HAS_BED_PROBE @@ -363,25 +376,67 @@ void Stepper::isr() { counter_E += current_block->steps[E_AXIS]; if (counter_E > 0) { counter_E -= current_block->step_event_count; - count_position[E_AXIS] += count_direction[E_AXIS]; - e_steps[current_block->active_extruder] += motor_direction(E_AXIS) ? -1 : 1; + #if DISABLED(MIXING_EXTRUDER) + // Don't step E here for mixing extruder + count_position[E_AXIS] += count_direction[E_AXIS]; + e_steps[TOOL_E_INDEX] += motor_direction(E_AXIS) ? -1 : 1; + #endif } + #if ENABLED(MIXING_EXTRUDER) + // Step mixing steppers proportionally + long dir = motor_direction(E_AXIS) ? -1 : 1; + MIXING_STEPPERS_LOOP(j) { + counter_m[j] += current_block->steps[E_AXIS]; + if (counter_m[j] > 0) { + counter_m[j] -= current_block->mix_event_count[j]; + e_steps[j] += dir; + } + } + #endif + if (current_block->use_advance_lead) { - int delta_adv_steps; //Maybe a char would be enough? - delta_adv_steps = (((long)extruder_advance_k * current_estep_rate[current_block->active_extruder]) >> 9) - current_adv_steps[current_block->active_extruder]; - e_steps[current_block->active_extruder] += delta_adv_steps; - current_adv_steps[current_block->active_extruder] += delta_adv_steps; + int delta_adv_steps = (((long)extruder_advance_k * current_estep_rate[TOOL_E_INDEX]) >> 9) - current_adv_steps[TOOL_E_INDEX]; + #if ENABLED(MIXING_EXTRUDER) + // Mixing extruders apply advance lead proportionally + MIXING_STEPPERS_LOOP(j) { + int steps = delta_adv_steps * current_block->step_event_count / current_block->mix_event_count[j]; + e_steps[j] += steps; + current_adv_steps[j] += steps; + } + #else + // For most extruders, advance the single E stepper + e_steps[TOOL_E_INDEX] += delta_adv_steps; + current_adv_steps[TOOL_E_INDEX] += delta_adv_steps; + #endif } #elif ENABLED(ADVANCE) + // Always count the unified E axis counter_E += current_block->steps[E_AXIS]; if (counter_E > 0) { counter_E -= current_block->step_event_count; - e_steps[current_block->active_extruder] += motor_direction(E_AXIS) ? -1 : 1; + #if DISABLED(MIXING_EXTRUDER) + // Don't step E here for mixing extruder + e_steps[TOOL_E_INDEX] += motor_direction(E_AXIS) ? -1 : 1; + #endif } + #if ENABLED(MIXING_EXTRUDER) + + // Step mixing steppers proportionally + long dir = motor_direction(E_AXIS) ? -1 : 1; + MIXING_STEPPERS_LOOP(j) { + counter_m[j] += current_block->steps[E_AXIS]; + if (counter_m[j] > 0) { + counter_m[j] -= current_block->mix_event_count[j]; + e_steps[j] += dir; + } + } + + #endif // MIXING_EXTRUDER + #endif // ADVANCE or LIN_ADVANCE #define _COUNTER(AXIS) counter_## AXIS @@ -395,9 +450,22 @@ void Stepper::isr() { STEP_ADD(X); STEP_ADD(Y); STEP_ADD(Z); + #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) - STEP_ADD(E); - #endif + #if ENABLED(MIXING_EXTRUDER) + // Keep updating the single E axis + counter_E += current_block->steps[E_AXIS]; + // Tick the counters used for this mix + MIXING_STEPPERS_LOOP(j) { + // Step mixing steppers (proportionally) + counter_M[j] += current_block->steps[E_AXIS]; + // Step when the counter goes over zero + if (counter_M[j] > 0) En_STEP_WRITE(j, !INVERT_E_STEP_PIN); + } + #else // !MIXING_EXTRUDER + STEP_ADD(E); + #endif + #endif // !ADVANCE && !LIN_ADVANCE #define STEP_IF_COUNTER(AXIS) \ if (_COUNTER(AXIS) > 0) { \ @@ -409,17 +477,32 @@ void Stepper::isr() { STEP_IF_COUNTER(X); STEP_IF_COUNTER(Y); STEP_IF_COUNTER(Z); + #if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE) - STEP_IF_COUNTER(E); - #endif + #if ENABLED(MIXING_EXTRUDER) + // Always step the single E axis + if (counter_E > 0) { + counter_E -= current_block->step_event_count; + count_position[E_AXIS] += count_direction[E_AXIS]; + } + MIXING_STEPPERS_LOOP(j) { + if (counter_M[j] > 0) { + counter_M[j] -= current_block->mix_event_count[j]; + En_STEP_WRITE(j, INVERT_E_STEP_PIN); + } + } + #else // !MIXING_EXTRUDER + STEP_IF_COUNTER(E); + #endif + #endif // !ADVANCE && !LIN_ADVANCE step_events_completed++; if (step_events_completed >= current_block->step_event_count) break; } - #if ENABLED(LIN_ADVANCE) + #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) // If we have esteps to execute, fire the next ISR "now" - if (e_steps[current_block->active_extruder]) OCR0A = TCNT0 + 2; + if (e_steps[TOOL_E_INDEX]) OCR0A = TCNT0 + 2; #endif // Calculate new timer value @@ -440,21 +523,41 @@ void Stepper::isr() { #if ENABLED(LIN_ADVANCE) if (current_block->use_advance_lead) - current_estep_rate[current_block->active_extruder] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8; + current_estep_rate[TOOL_E_INDEX] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8; + + if (current_block->use_advance_lead) { + #if ENABLED(MIXING_EXTRUDER) + MIXING_STEPPERS_LOOP(j) + current_estep_rate[j] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8 * current_block->step_event_count / current_block->mix_event_count[j]) >> 8; + #else + current_estep_rate[TOOL_E_INDEX] = ((unsigned long)acc_step_rate * current_block->e_speed_multiplier8) >> 8; + #endif + } #elif ENABLED(ADVANCE) advance += advance_rate * step_loops; //NOLESS(advance, current_block->advance); + long advance_whole = advance >> 8, + advance_factor = advance_whole - old_advance; + // Do E steps + advance steps - e_steps[current_block->active_extruder] += ((advance >> 8) - old_advance); - old_advance = advance >> 8; + #if ENABLED(MIXING_EXTRUDER) + // ...for mixing steppers proportionally + MIXING_STEPPERS_LOOP(j) + e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j]; + #else + // ...for the active extruder + e_steps[TOOL_E_INDEX] += advance_factor; + #endif + + old_advance = advance_whole; #endif // ADVANCE or LIN_ADVANCE #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) - eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[current_block->active_extruder]); + eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[TOOL_E_INDEX]); #endif } else if (step_events_completed > (unsigned long)current_block->decelerate_after) { @@ -474,8 +577,14 @@ void Stepper::isr() { #if ENABLED(LIN_ADVANCE) - if (current_block->use_advance_lead) - current_estep_rate[current_block->active_extruder] = ((unsigned long)step_rate * current_block->e_speed_multiplier8) >> 8; + if (current_block->use_advance_lead) { + #if ENABLED(MIXING_EXTRUDER) + MIXING_STEPPERS_LOOP(j) + current_estep_rate[j] = ((unsigned long)step_rate * current_block->e_speed_multiplier8 * current_block->step_event_count / current_block->mix_event_count[j]) >> 8; + #else + current_estep_rate[TOOL_E_INDEX] = ((unsigned long)step_rate * current_block->e_speed_multiplier8) >> 8; + #endif + } #elif ENABLED(ADVANCE) @@ -483,14 +592,22 @@ void Stepper::isr() { NOLESS(advance, final_advance); // Do E steps + advance steps - uint32_t advance_whole = advance >> 8; - e_steps[current_block->active_extruder] += advance_whole - old_advance; + long advance_whole = advance >> 8, + advance_factor = advance_whole - old_advance; + + #if ENABLED(MIXING_EXTRUDER) + MIXING_STEPPERS_LOOP(j) + e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j]; + #else + e_steps[TOOL_E_INDEX] += advance_factor; + #endif + old_advance = advance_whole; #endif // ADVANCE or LIN_ADVANCE #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) - eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[current_block->active_extruder]); + eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[TOOL_E_INDEX]); #endif } else { @@ -498,9 +615,9 @@ void Stepper::isr() { #if ENABLED(LIN_ADVANCE) if (current_block->use_advance_lead) - current_estep_rate[current_block->active_extruder] = final_estep_rate; + current_estep_rate[TOOL_E_INDEX] = final_estep_rate; - eISR_Rate = (OCR1A_nominal >> 2) * step_loops_nominal / abs(e_steps[current_block->active_extruder]); + eISR_Rate = (OCR1A_nominal >> 2) * step_loops_nominal / abs(e_steps[TOOL_E_INDEX]); #endif @@ -537,7 +654,7 @@ void Stepper::isr() { E## INDEX ##_DIR_WRITE(INVERT_E## INDEX ##_DIR); \ e_steps[INDEX]++; \ } \ - else if (e_steps[INDEX] > 0) { \ + else { \ E## INDEX ##_DIR_WRITE(!INVERT_E## INDEX ##_DIR); \ e_steps[INDEX]--; \ } \ @@ -547,11 +664,11 @@ void Stepper::isr() { // Step all E steppers that have steps for (uint8_t i = 0; i < step_loops; i++) { STEP_E_ONCE(0); - #if EXTRUDERS > 1 + #if E_STEPPERS > 1 STEP_E_ONCE(1); - #if EXTRUDERS > 2 + #if E_STEPPERS > 2 STEP_E_ONCE(2); - #if EXTRUDERS > 3 + #if E_STEPPERS > 3 STEP_E_ONCE(3); #endif #endif @@ -730,18 +847,12 @@ void Stepper::init() { #if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE) - #if ENABLED(LIN_ADVANCE) - - for (int i = 0; i < EXTRUDERS; i++) { - e_steps[i] = 0; + for (int i = 0; i < E_STEPPERS; i++) { + e_steps[i] = 0; + #if ENABLED(LIN_ADVANCE) current_adv_steps[i] = 0; - } - - #elif ENABLED(ADVANCE) - - for (uint8_t i = 0; i < EXTRUDERS; i++) e_steps[i] = 0; - - #endif + #endif + } #if defined(TCCR0A) && defined(WGM01) CBI(TCCR0A, WGM01); diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 6ad55216d..45c8753aa 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -107,15 +107,15 @@ class Stepper { static unsigned char old_OCR0A; static volatile unsigned char eISR_Rate; #if ENABLED(LIN_ADVANCE) - static volatile int e_steps[EXTRUDERS]; + static volatile int e_steps[E_STEPPERS]; static int extruder_advance_k; static int final_estep_rate; - static int current_estep_rate[EXTRUDERS]; // Actual extruder speed [steps/s] - static int current_adv_steps[EXTRUDERS]; // The amount of current added esteps due to advance. + static int current_estep_rate[E_STEPPERS]; // Actual extruder speed [steps/s] + static int current_adv_steps[E_STEPPERS]; // The amount of current added esteps due to advance. // i.e., the current amount of pressure applied // to the spring (=filament). #else - static long e_steps[EXTRUDERS]; + static long e_steps[E_STEPPERS]; static long advance_rate, advance, final_advance; static long old_advance; #endif @@ -147,6 +147,16 @@ class Stepper { // static volatile signed char count_direction[NUM_AXIS]; + // + // Mixing extruder mix counters + // + #if ENABLED(MIXING_EXTRUDER) + static long counter_M[MIXING_STEPPERS]; + #define MIXING_STEPPERS_LOOP(VAR) \ + for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) \ + if (current_block->mix_event_count[VAR]) + #endif + public: // @@ -315,12 +325,25 @@ class Stepper { } #if ENABLED(ADVANCE) + advance = current_block->initial_advance; final_advance = current_block->final_advance; + // Do E steps + advance steps - e_steps[current_block->active_extruder] += ((advance >>8) - old_advance); - old_advance = advance >>8; + #if ENABLED(MIXING_EXTRUDER) + long advance_factor = (advance >> 8) - old_advance; + // ...for mixing steppers proportionally + MIXING_STEPPERS_LOOP(j) + e_steps[j] += advance_factor * current_block->step_event_count / current_block->mix_event_count[j]; + #else + // ...for the active extruder + e_steps[TOOL_E_INDEX] += ((advance >> 8) - old_advance); + #endif + + old_advance = advance >> 8; + #endif + deceleration_time = 0; // step_rate to timer interval OCR1A_nominal = calc_timer(current_block->nominal_rate); diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 56c15060e..65fde23c1 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -182,26 +182,42 @@ #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) #define E3_ENABLE_READ READ(E3_ENABLE_PIN) -#if EXTRUDERS > 3 - #define E_STEP_WRITE(v) {switch(current_block->active_extruder){case 3:E3_STEP_WRITE(v);break;case 2:E2_STEP_WRITE(v);break;case 1:E1_STEP_WRITE(v);break;default:E0_STEP_WRITE(v);}} - #define NORM_E_DIR() {switch(current_block->active_extruder){case 3:E3_DIR_WRITE(!INVERT_E3_DIR);break;case 2:E2_DIR_WRITE(!INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(!INVERT_E1_DIR);break;default:E0_DIR_WRITE(!INVERT_E0_DIR);}} - #define REV_E_DIR() {switch(current_block->active_extruder){case 3:E3_DIR_WRITE(INVERT_E3_DIR);break;case 2:E2_DIR_WRITE(INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(INVERT_E1_DIR);break;default:E0_DIR_WRITE(INVERT_E0_DIR);}} +#if ENABLED(SWITCHING_EXTRUDER) + #define E_STEP_WRITE(v) E0_STEP_WRITE(v) + #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? INVERT_E0_DIR : !INVERT_E0_DIR) + #define REV_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? !INVERT_E0_DIR : INVERT_E0_DIR) +#elif EXTRUDERS > 3 + #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } } + #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); } } + #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(INVERT_E3_DIR); } } #elif EXTRUDERS > 2 - #define E_STEP_WRITE(v) {switch(current_block->active_extruder){case 2:E2_STEP_WRITE(v);break;case 1:E1_STEP_WRITE(v);break;default:E0_STEP_WRITE(v);}} - #define NORM_E_DIR() {switch(current_block->active_extruder){case 2:E2_DIR_WRITE(!INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(!INVERT_E1_DIR);break;default:E0_DIR_WRITE(!INVERT_E0_DIR);}} - #define REV_E_DIR() {switch(current_block->active_extruder){case 2:E2_DIR_WRITE(INVERT_E2_DIR);break;case 1:E1_DIR_WRITE(INVERT_E1_DIR);break;default:E0_DIR_WRITE(INVERT_E0_DIR);}} + #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); } } + #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } } + #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); } } #elif EXTRUDERS > 1 - #define _E_STEP_WRITE(v) {if(current_block->active_extruder==1){E1_STEP_WRITE(v);}else{E0_STEP_WRITE(v);}} - #define _NORM_E_DIR() {if(current_block->active_extruder==1){E1_DIR_WRITE(!INVERT_E1_DIR);}else{E0_DIR_WRITE(!INVERT_E0_DIR);}} - #define _REV_E_DIR() {if(current_block->active_extruder==1){E1_DIR_WRITE(INVERT_E1_DIR);}else{E0_DIR_WRITE(INVERT_E0_DIR);}} #if DISABLED(DUAL_X_CARRIAGE) - #define E_STEP_WRITE(v) _E_STEP_WRITE(v) - #define NORM_E_DIR() _NORM_E_DIR() - #define REV_E_DIR() _REV_E_DIR() + #define E_STEP_WRITE(v) { if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } } + #define NORM_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } } + #define REV_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } } + #else + #define E_STEP_WRITE(v) { if (extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } } + #define NORM_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } } + #define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } } + #endif +#elif ENABLED(MIXING_EXTRUDER) + #define E_STEP_WRITE(v) NOOP /* not used for mixing extruders! */ + #if MIXING_STEPPERS > 3 + #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } } + #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); E3_DIR_WRITE(!INVERT_E3_DIR); } + #define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); E3_DIR_WRITE( INVERT_E3_DIR); } + #elif MIXING_STEPPERS > 2 + #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); } } + #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); } + #define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); } #else - #define E_STEP_WRITE(v) {if(extruder_duplication_enabled){E0_STEP_WRITE(v);E1_STEP_WRITE(v);}else _E_STEP_WRITE(v);} - #define NORM_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(!INVERT_E0_DIR);E1_DIR_WRITE(!INVERT_E1_DIR);}else _NORM_E_DIR();} - #define REV_E_DIR() {if(extruder_duplication_enabled){E0_DIR_WRITE(INVERT_E0_DIR);E1_DIR_WRITE(INVERT_E1_DIR);}else _REV_E_DIR();} + #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); } } + #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } + #define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); } #endif #else #define E_STEP_WRITE(v) E0_STEP_WRITE(v) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 543724814..bd8d6c393 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1365,7 +1365,7 @@ void kill_screen(const char* lcd_msg) { #endif static void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); } static void lcd_move_e( - #if EXTRUDERS > 1 + #if E_STEPPERS > 1 int8_t eindex = -1 #endif ) { @@ -1375,7 +1375,7 @@ void kill_screen(const char* lcd_msg) { current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale; encoderPosition = 0; manual_move_to_current(E_AXIS - #if EXTRUDERS > 1 + #if E_STEPPERS > 1 , eindex #endif ); @@ -1383,34 +1383,34 @@ void kill_screen(const char* lcd_msg) { } if (lcdDrawUpdate) { PGM_P pos_label; - #if EXTRUDERS == 1 + #if E_STEPPERS == 1 pos_label = PSTR(MSG_MOVE_E); #else switch (eindex) { default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; - #if EXTRUDERS > 2 + #if E_STEPPERS > 2 case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; - #if EXTRUDERS > 3 + #if E_STEPPERS > 3 case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; - #endif //EXTRUDERS > 3 - #endif //EXTRUDERS > 2 + #endif + #endif } - #endif //EXTRUDERS > 1 + #endif lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS])); } } - #if EXTRUDERS > 1 + #if E_STEPPERS > 1 static void lcd_move_e0() { lcd_move_e(0); } static void lcd_move_e1() { lcd_move_e(1); } - #if EXTRUDERS > 2 + #if E_STEPPERS > 2 static void lcd_move_e2() { lcd_move_e(2); } - #if EXTRUDERS > 3 + #if E_STEPPERS > 3 static void lcd_move_e3() { lcd_move_e(3); } #endif #endif - #endif // EXTRUDERS > 1 + #endif /** * @@ -1432,20 +1432,29 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); } + if (move_menu_scale < 10.0) { if (_MOVE_XYZ_ALLOWED) MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z); - #if EXTRUDERS == 1 + + #if ENABLED(SWITCHING_EXTRUDER) + if (active_extruder) + MENU_ITEM(gcode, MSG_SELECT MSG_E1, PSTR("T0")); + else + MENU_ITEM(gcode, MSG_SELECT MSG_E2, PSTR("T1")); + #endif + + #if E_STEPPERS == 1 MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); #else MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0); MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1); - #if EXTRUDERS > 2 + #if E_STEPPERS > 2 MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_e2); - #if EXTRUDERS > 3 + #if E_STEPPERS > 3 MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_e3); #endif #endif - #endif // EXTRUDERS > 1 + #endif } END_MENU(); } From 8f24e0a556bbd8448a00fd8e54e8f92ea0f49b76 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2016 23:35:15 -0700 Subject: [PATCH 383/580] Debugging of MBL in G28 --- Marlin/Marlin_main.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 837550e8f..e7355292f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2908,6 +2908,9 @@ inline void gcode_G28() { #if ENABLED(MESH_BED_LEVELING) float pre_home_z = MESH_HOME_SEARCH_Z; if (mbl.active()) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL was active"); + #endif // Save known Z position if already homed if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) { pre_home_z = current_position[Z_AXIS]; @@ -2915,6 +2918,9 @@ inline void gcode_G28() { } mbl.set_active(false); current_position[Z_AXIS] = pre_home_z; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("Set Z to pre_home_z", current_position); + #endif } #endif @@ -3140,7 +3146,13 @@ inline void gcode_G28() { // Enable mesh leveling again #if ENABLED(MESH_BED_LEVELING) if (mbl.has_mesh()) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL has mesh"); + #endif if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("MBL Z homing"); + #endif current_position[Z_AXIS] = MESH_HOME_SEARCH_Z #if Z_HOME_DIR > 0 + Z_MAX_POS @@ -3154,6 +3166,9 @@ inline void gcode_G28() { feedrate = homing_feedrate[Z_AXIS]; line_to_destination(); stepper.synchronize(); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("MBL Rest Origin", current_position); + #endif #else current_position[Z_AXIS] = MESH_HOME_SEARCH_Z - mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS)) @@ -3161,6 +3176,9 @@ inline void gcode_G28() { + Z_MAX_POS #endif ; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("MBL adjusted MESH_HOME_SEARCH_Z", current_position); + #endif #endif } else if ((axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) && (homeX || homeY)) { @@ -3169,6 +3187,9 @@ inline void gcode_G28() { mbl.set_active(true); current_position[Z_AXIS] = pre_home_z - mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS)); + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("MBL Home X or Y", current_position); + #endif } } #endif From 21ee0612e337bbb16ca532f25c016d918efba22d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Jul 2016 01:57:02 -0700 Subject: [PATCH 384/580] Debug char --- Marlin/Marlin.h | 1 + Marlin/Marlin_main.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index bc1f567fe..3c0ab801b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -105,6 +105,7 @@ extern const char echomagic[] PROGMEM; #define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value))) +void serial_echopair_P(const char* s_P, char v); void serial_echopair_P(const char* s_P, int v); void serial_echopair_P(const char* s_P, long v); void serial_echopair_P(const char* s_P, float v); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e7355292f..df947a62b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -572,6 +572,7 @@ void prepare_move_to_destination(); void plan_cubic_move(const float offset[4]); #endif +void serial_echopair_P(const char* s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); } void serial_echopair_P(const char* s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serial_echopair_P(const char* s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serial_echopair_P(const char* s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } From 94955a8bf750b08932a60d54c161b12c3e8366f4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Jul 2016 11:33:01 -0700 Subject: [PATCH 385/580] pad string in lcd_finishstatus --- Marlin/ultralcd.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index bd8d6c393..2b415cc3e 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2738,7 +2738,18 @@ void lcd_update() { } } +void set_utf_strlen(char* s, uint8_t n) { + uint8_t i = 0, j = 0; + while (s[i] && (j < n)) { + if ((s[i] & 0xC0u) != 0x80u) j++; + i++; + } + while (j++ < n) s[i++] = ' '; + s[i] = '\0'; +} + void lcd_finishstatus(bool persist=false) { + set_utf_strlen(lcd_status_message, LCD_WIDTH); #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) UNUSED(persist); #endif @@ -2760,32 +2771,19 @@ void lcd_finishstatus(bool persist=false) { void dontExpireStatus() { expire_status_ms = 0; } #endif -void set_utf_strlen(char* s, uint8_t n) { - uint8_t i = 0, j = 0; - while (s[i] && (j < n)) { - if ((s[i] & 0xc0u) != 0x80u) j++; - i++; - } - while (j++ < n) s[i++] = ' '; - s[i] = '\0'; -} - bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); } void lcd_setstatus(const char* message, bool persist) { if (lcd_status_message_level > 0) return; strncpy(lcd_status_message, message, 3 * (LCD_WIDTH)); - set_utf_strlen(lcd_status_message, LCD_WIDTH); lcd_finishstatus(persist); } void lcd_setstatuspgm(const char* message, uint8_t level) { - if (level >= lcd_status_message_level) { - strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH)); - set_utf_strlen(lcd_status_message, LCD_WIDTH); - lcd_status_message_level = level; - lcd_finishstatus(level > 0); - } + if (level < lcd_status_message_level) return; + lcd_status_message_level = level; + strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH)); + lcd_finishstatus(level > 0); } void lcd_setalertstatuspgm(const char* message) { From 5e3d3918b6fe50d87cbb9f229522f762445847af Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Jul 2016 12:04:43 -0700 Subject: [PATCH 386/580] Patch compile error for RAMPS LCD pins --- Marlin/pins_RAMPS_14.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 8731845f5..c51a8d02a 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -149,19 +149,21 @@ #define LCD_PINS_D6 44 #define LCD_PINS_D7 64 #else - #define BEEPER_PIN 33 #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 17 #define LCD_PINS_D4 23 #define LCD_PINS_D5 25 #define LCD_PINS_D6 27 #define LCD_PINS_D7 29 - // Buttons are attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + #if DISABLED(NEWPANEL) + #define BEEPER_PIN 33 + // Buttons are attached to a shift register + // Not wired yet + //#define SHIFT_CLK 38 + //#define SHIFT_LD 42 + //#define SHIFT_OUT 40 + //#define SHIFT_EN 17 + #endif #endif #if ENABLED(NEWPANEL) From 93ba5bddd76b9dc2b26659cf9cce5e456f540737 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Jul 2016 18:49:34 -0700 Subject: [PATCH 387/580] Append units to feedrate variables --- Marlin/Marlin.h | 14 +- Marlin/Marlin_main.cpp | 199 +++++++++--------- Marlin/configuration_store.cpp | 48 ++--- Marlin/dogm_lcd_implementation.h | 2 +- Marlin/planner.cpp | 22 +- Marlin/planner.h | 12 +- Marlin/planner_bezier.cpp | 6 +- Marlin/planner_bezier.h | 2 +- Marlin/ultralcd.cpp | 58 ++--- .../ultralcd_implementation_hitachi_HD44780.h | 2 +- 10 files changed, 189 insertions(+), 176 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index bc1f567fe..f471e13f9 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -296,8 +296,18 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); } #define CRITICAL_SECTION_END SREG = _sreg; #endif +/** + * Feedrate scaling and conversion + */ +extern int feedrate_percentage; + +#define MMM_TO_MMS(MM_M) ((MM_M)/60.0) +#define MMS_TO_MMM(MM_S) ((MM_S)*60.0) +#define MMM_SCALED(MM_M) ((MM_M)*feedrate_percentage/100.0) +#define MMS_SCALED(MM_S) MMM_SCALED(MM_S) +#define MMM_TO_MMS_SCALED(MM_M) (MMS_SCALED(MMM_TO_MMS(MM_M))) + extern bool axis_relative_modes[]; -extern int feedrate_multiplier; extern bool volumetric_enabled; extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. @@ -385,7 +395,7 @@ float code_value_temp_diff(); extern bool autoretract_enabled; extern bool retracted[EXTRUDERS]; // extruder[n].retracted extern float retract_length, retract_length_swap, retract_feedrate_mm_s, retract_zlift; - extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate; + extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate_mm_s; #endif // Print job timer diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e7355292f..140dd5def 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -280,7 +280,6 @@ bool Running = true; uint8_t marlin_debug_flags = DEBUG_NONE; -static float feedrate = 1500.0, saved_feedrate; float current_position[NUM_AXIS] = { 0.0 }; static float destination[NUM_AXIS] = { 0.0 }; bool axis_known_position[3] = { false }; @@ -302,11 +301,15 @@ static uint8_t cmd_queue_index_r = 0, TempUnit input_temp_units = TEMPUNIT_C; #endif -const float homing_feedrate[] = HOMING_FEEDRATE; +/** + * Feed rates are often configured with mm/m + * but the planner and stepper like mm/s units. + */ +const float homing_feedrate_mm_m[] = HOMING_FEEDRATE; +static float feedrate_mm_m = 1500.0, saved_feedrate_mm_m; +int feedrate_percentage = 100, saved_feedrate_percentage; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; -int feedrate_multiplier = 100; //100->1 200->2 -int saved_feedrate_multiplier; int extruder_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); bool volumetric_enabled = false; float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA); @@ -382,16 +385,16 @@ static uint8_t target_extruder; float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; #endif -#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS])) +#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS])) #if ENABLED(AUTO_BED_LEVELING_FEATURE) - int xy_probe_speed = XY_PROBE_SPEED; + int xy_probe_feedrate_mm_m = XY_PROBE_SPEED; bool bed_leveling_in_progress = false; - #define XY_PROBE_FEEDRATE xy_probe_speed + #define XY_PROBE_FEEDRATE_MM_M xy_probe_feedrate_mm_m #elif defined(XY_PROBE_SPEED) - #define XY_PROBE_FEEDRATE XY_PROBE_SPEED + #define XY_PROBE_FEEDRATE_MM_M XY_PROBE_SPEED #else - #define XY_PROBE_FEEDRATE (PLANNER_XY_FEEDRATE() * 60) + #define XY_PROBE_FEEDRATE_MM_M MMS_TO_MMM(PLANNER_XY_FEEDRATE()) #endif #if ENABLED(Z_DUAL_ENDSTOPS) && DISABLED(DELTA) @@ -430,7 +433,7 @@ static uint8_t target_extruder; float retract_zlift = RETRACT_ZLIFT; float retract_recover_length = RETRACT_RECOVER_LENGTH; float retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP; - float retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE; + float retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE; #endif // FWRETRACT @@ -1598,7 +1601,7 @@ inline void set_homing_bump_feedrate(AxisEnum axis) { SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1"); } - feedrate = homing_feedrate[axis] / hbd; + feedrate_mm_m = homing_feedrate_mm_m[axis] / hbd; } // // line_to_current_position @@ -1606,19 +1609,19 @@ inline void set_homing_bump_feedrate(AxisEnum axis) { // (or from wherever it has been told it is located). // inline void line_to_current_position() { - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate / 60, active_extruder); + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder); } inline void line_to_z(float zPosition) { - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate / 60, active_extruder); + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder); } // // line_to_destination // Move the planner, not necessarily synced with current_position // -inline void line_to_destination(float mm_m) { - planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], mm_m / 60, active_extruder); +inline void line_to_destination(float fr_mm_m) { + planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS(fr_mm_m), active_extruder); } -inline void line_to_destination() { line_to_destination(feedrate); } +inline void line_to_destination() { line_to_destination(feedrate_mm_m); } /** * sync_plan_position @@ -1646,7 +1649,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, #endif refresh_cmd_timeout(); calculate_delta(destination); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); set_current_to_destination(); } #endif @@ -1655,8 +1658,8 @@ inline void set_destination_to_current() { memcpy(destination, current_position, * Plan a move to (X, Y, Z) and set the current_position * The final current_position may not be the one that was requested */ -static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) { - float old_feedrate = feedrate; +static void do_blocking_move_to(float x, float y, float z, float fr_mm_m = 0.0) { + float old_feedrate_mm_m = feedrate_mm_m; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), NULL, x, y, z); @@ -1664,7 +1667,7 @@ static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0 #if ENABLED(DELTA) - feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE; + feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M; destination[X_AXIS] = x; destination[Y_AXIS] = y; @@ -1679,19 +1682,19 @@ static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0 // If Z needs to raise, do it before moving XY if (current_position[Z_AXIS] < z) { - feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS]; + feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[Z_AXIS]; current_position[Z_AXIS] = z; line_to_current_position(); } - feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE; + feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M; current_position[X_AXIS] = x; current_position[Y_AXIS] = y; line_to_current_position(); // If Z needs to lower, do it after moving XY if (current_position[Z_AXIS] > z) { - feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS]; + feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[Z_AXIS]; current_position[Z_AXIS] = z; line_to_current_position(); } @@ -1700,23 +1703,23 @@ static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0 stepper.synchronize(); - feedrate = old_feedrate; + feedrate_mm_m = old_feedrate_mm_m; } -inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) { - do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate); +inline void do_blocking_move_to_x(float x, float fr_mm_m = 0.0) { + do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); } inline void do_blocking_move_to_y(float y) { do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]); } -inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) { - do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate); +inline void do_blocking_move_to_xy(float x, float y, float fr_mm_m = 0.0) { + do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_m); } -inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate); +inline void do_blocking_move_to_z(float z, float fr_mm_m = 0.0) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_m); } // @@ -1732,9 +1735,9 @@ static void setup_for_endstop_or_probe_move() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position); #endif - saved_feedrate = feedrate; - saved_feedrate_multiplier = feedrate_multiplier; - feedrate_multiplier = 100; + saved_feedrate_mm_m = feedrate_mm_m; + saved_feedrate_percentage = feedrate_percentage; + feedrate_percentage = 100; refresh_cmd_timeout(); } @@ -1742,8 +1745,8 @@ static void clean_up_after_endstop_or_probe_move() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position); #endif - feedrate = saved_feedrate; - feedrate_multiplier = saved_feedrate_multiplier; + feedrate_mm_m = saved_feedrate_mm_m; + feedrate_percentage = saved_feedrate_percentage; refresh_cmd_timeout(); } @@ -2061,7 +2064,7 @@ static void clean_up_after_endstop_or_probe_move() { // at the height where the probe triggered. static float run_z_probe() { - float old_feedrate = feedrate; + float old_feedrate_mm_m = feedrate_mm_m; // Prevent stepper_inactive_time from running out and EXTRUDER_RUNOUT_PREVENT from extruding refresh_cmd_timeout(); @@ -2076,7 +2079,7 @@ static void clean_up_after_endstop_or_probe_move() { #endif // move down slowly until you find the bed - feedrate = homing_feedrate[Z_AXIS] / 4; + feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS] / 4; destination[Z_AXIS] = -10; prepare_move_to_destination_raw(); // this will also set_current_to_destination stepper.synchronize(); @@ -2100,7 +2103,7 @@ static void clean_up_after_endstop_or_probe_move() { planner.bed_level_matrix.set_to_identity(); #endif - feedrate = homing_feedrate[Z_AXIS]; + feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS]; // Move down until the Z probe (or endstop?) is triggered float zPosition = -(Z_MAX_LENGTH + 10); @@ -2139,7 +2142,7 @@ static void clean_up_after_endstop_or_probe_move() { SYNC_PLAN_POSITION_KINEMATIC(); - feedrate = old_feedrate; + feedrate_mm_m = old_feedrate_mm_m; return current_position[Z_AXIS]; } @@ -2164,7 +2167,7 @@ static void clean_up_after_endstop_or_probe_move() { } #endif - float old_feedrate = feedrate; + float old_feedrate_mm_m = feedrate_mm_m; // Ensure a minimum height before moving the probe do_probe_raise(Z_RAISE_BETWEEN_PROBINGS); @@ -2177,7 +2180,7 @@ static void clean_up_after_endstop_or_probe_move() { SERIAL_ECHOLNPGM(")"); } #endif - feedrate = XY_PROBE_FEEDRATE; + feedrate_mm_m = XY_PROBE_FEEDRATE_MM_M; do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2214,7 +2217,7 @@ static void clean_up_after_endstop_or_probe_move() { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt"); #endif - feedrate = old_feedrate; + feedrate_mm_m = old_feedrate_mm_m; return measured_z; } @@ -2415,7 +2418,7 @@ static void homeaxis(AxisEnum axis) { // Move towards the endstop until an endstop is triggered destination[axis] = 1.5 * max_length(axis) * axis_home_dir; - feedrate = homing_feedrate[axis]; + feedrate_mm_m = homing_feedrate_mm_m[axis]; line_to_destination(); stepper.synchronize(); @@ -2455,7 +2458,7 @@ static void homeaxis(AxisEnum axis) { sync_plan_position(); // Move to the adjusted endstop height - feedrate = homing_feedrate[axis]; + feedrate_mm_m = homing_feedrate_mm_m[axis]; destination[Z_AXIS] = adj; line_to_destination(); stepper.synchronize(); @@ -2519,13 +2522,13 @@ static void homeaxis(AxisEnum axis) { if (retracting == retracted[active_extruder]) return; - float old_feedrate = feedrate; + float old_feedrate_mm_m = feedrate_mm_m; set_destination_to_current(); if (retracting) { - feedrate = retract_feedrate_mm_s * 60; + feedrate_mm_m = MMS_TO_MMM(retract_feedrate_mm_s); current_position[E_AXIS] += (swapping ? retract_length_swap : retract_length) / volumetric_multiplier[active_extruder]; sync_plan_position_e(); prepare_move_to_destination(); @@ -2543,14 +2546,14 @@ static void homeaxis(AxisEnum axis) { SYNC_PLAN_POSITION_KINEMATIC(); } - feedrate = retract_recover_feedrate * 60; + feedrate_mm_m = MMM_TO_MMS(retract_recover_feedrate_mm_s); float move_e = swapping ? retract_length_swap + retract_recover_length_swap : retract_length + retract_recover_length; current_position[E_AXIS] -= move_e / volumetric_multiplier[active_extruder]; sync_plan_position_e(); prepare_move_to_destination(); } - feedrate = old_feedrate; + feedrate_mm_m = old_feedrate_mm_m; retracted[active_extruder] = retracting; } // retract() @@ -2612,10 +2615,10 @@ void gcode_get_destination() { } if (code_seen('F') && code_value_linear_units() > 0.0) - feedrate = code_value_linear_units(); + feedrate_mm_m = code_value_linear_units(); #if ENABLED(PRINTCOUNTER) - if(!DEBUGGING(DRYRUN)) + if (!DEBUGGING(DRYRUN)) print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]); #endif @@ -2845,7 +2848,7 @@ inline void gcode_G4() { destination[X_AXIS] = 1.5 * mlx * x_axis_home_dir; destination[Y_AXIS] = 1.5 * mly * home_dir(Y_AXIS); - feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1); + feedrate_mm_m = min(homing_feedrate_mm_m[X_AXIS], homing_feedrate_mm_m[Y_AXIS]) * sqrt(sq(mlratio) + 1); line_to_destination(); stepper.synchronize(); endstops.hit_on_purpose(); // clear endstop hit flags @@ -2942,7 +2945,7 @@ inline void gcode_G28() { // Move all carriages up together until the first endstop is hit. for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * (Z_MAX_LENGTH); - feedrate = 1.732 * homing_feedrate[X_AXIS]; + feedrate_mm_m = 1.732 * homing_feedrate_mm_m[X_AXIS]; line_to_destination(); stepper.synchronize(); endstops.hit_on_purpose(); // clear endstop hit flags @@ -3163,7 +3166,7 @@ inline void gcode_G28() { #if ENABLED(MESH_G28_REST_ORIGIN) current_position[Z_AXIS] = 0.0; set_destination_to_current(); - feedrate = homing_feedrate[Z_AXIS]; + feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS]; line_to_destination(); stepper.synchronize(); #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3223,8 +3226,8 @@ inline void gcode_G28() { enum MeshLevelingState { MeshReport, MeshStart, MeshNext, MeshSet, MeshSetZOffset, MeshReset }; inline void _mbl_goto_xy(float x, float y) { - float old_feedrate = feedrate; - feedrate = homing_feedrate[X_AXIS]; + float old_feedrate_mm_m = feedrate_mm_m; + feedrate_mm_m = homing_feedrate_mm_m[X_AXIS]; current_position[Z_AXIS] = MESH_HOME_SEARCH_Z #if Z_RAISE_BETWEEN_PROBINGS > MIN_Z_HEIGHT_FOR_HOMING @@ -3244,7 +3247,7 @@ inline void gcode_G28() { line_to_current_position(); #endif - feedrate = old_feedrate; + feedrate_mm_m = old_feedrate_mm_m; stepper.synchronize(); } @@ -3491,7 +3494,7 @@ inline void gcode_G28() { } #endif - xy_probe_speed = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED; + xy_probe_feedrate_mm_m = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED; int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LEFT_PROBE_BED_POSITION, right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : RIGHT_PROBE_BED_POSITION, @@ -5162,7 +5165,7 @@ inline void gcode_M92() { if (value < 20.0) { float factor = planner.axis_steps_per_mm[i] / value; // increase e constants if M92 E14 is given for netfab. planner.max_e_jerk *= factor; - planner.max_feedrate[i] *= factor; + planner.max_feedrate_mm_s[i] *= factor; planner.max_acceleration_steps_per_s2[i] *= factor; } planner.axis_steps_per_mm[i] = value; @@ -5371,7 +5374,7 @@ inline void gcode_M201() { inline void gcode_M203() { for (int8_t i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) - planner.max_feedrate[i] = code_value_axis_units(i); + planner.max_feedrate_mm_s[i] = code_value_axis_units(i); } /** @@ -5417,8 +5420,8 @@ inline void gcode_M204() { * E = Max E Jerk (units/sec^2) */ inline void gcode_M205() { - if (code_seen('S')) planner.min_feedrate = code_value_linear_units(); - if (code_seen('T')) planner.min_travel_feedrate = code_value_linear_units(); + if (code_seen('S')) planner.min_feedrate_mm_s = code_value_linear_units(); + if (code_seen('T')) planner.min_travel_feedrate_mm_s = code_value_linear_units(); if (code_seen('B')) planner.min_segment_time = code_value_millis(); if (code_seen('X')) planner.max_xy_jerk = code_value_linear_units(); if (code_seen('Z')) planner.max_z_jerk = code_value_axis_units(Z_AXIS); @@ -5516,7 +5519,7 @@ inline void gcode_M206() { */ inline void gcode_M207() { if (code_seen('S')) retract_length = code_value_axis_units(E_AXIS); - if (code_seen('F')) retract_feedrate_mm_s = code_value_axis_units(E_AXIS) / 60; + if (code_seen('F')) retract_feedrate_mm_s = MMM_TO_MMS(code_value_axis_units(E_AXIS)); if (code_seen('Z')) retract_zlift = code_value_axis_units(Z_AXIS); #if EXTRUDERS > 1 if (code_seen('W')) retract_length_swap = code_value_axis_units(E_AXIS); @@ -5528,11 +5531,11 @@ inline void gcode_M206() { * * S[+units] retract_recover_length (in addition to M207 S*) * W[+units] retract_recover_length_swap (multi-extruder) - * F[units/min] retract_recover_feedrate + * F[units/min] retract_recover_feedrate_mm_s */ inline void gcode_M208() { if (code_seen('S')) retract_recover_length = code_value_axis_units(E_AXIS); - if (code_seen('F')) retract_recover_feedrate = code_value_axis_units(E_AXIS) / 60; + if (code_seen('F')) retract_recover_feedrate_mm_s = MMM_TO_MMS(code_value_axis_units(E_AXIS)); #if EXTRUDERS > 1 if (code_seen('W')) retract_recover_length_swap = code_value_axis_units(E_AXIS); #endif @@ -5603,7 +5606,7 @@ inline void gcode_M206() { * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) */ inline void gcode_M220() { - if (code_seen('S')) feedrate_multiplier = code_value_int(); + if (code_seen('S')) feedrate_percentage = code_value_int(); } /** @@ -6307,10 +6310,10 @@ inline void gcode_M503() { // Define runplan for move axes #if ENABLED(DELTA) - #define RUNPLAN(RATE) calculate_delta(destination); \ - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], RATE, active_extruder); + #define RUNPLAN(RATE_MM_S) calculate_delta(destination); \ + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], RATE_MM_S, active_extruder); #else - #define RUNPLAN(RATE) line_to_destination(RATE * 60); + #define RUNPLAN(RATE_MM_S) line_to_destination(MMS_TO_MMM(RATE_MM_S)); #endif KEEPALIVE_STATE(IN_HANDLER); @@ -6725,14 +6728,14 @@ inline void gcode_T(uint8_t tmp_extruder) { return; } - float old_feedrate = feedrate; + float old_feedrate_mm_m = feedrate_mm_m; if (code_seen('F')) { - float next_feedrate = code_value_axis_units(X_AXIS); - if (next_feedrate > 0.0) old_feedrate = feedrate = next_feedrate; + float next_feedrate_mm_m = code_value_axis_units(X_AXIS); + if (next_feedrate_mm_m > 0.0) old_feedrate_mm_m = feedrate_mm_m = next_feedrate_mm_m; } else - feedrate = XY_PROBE_FEEDRATE; + feedrate_mm_m = XY_PROBE_FEEDRATE_MM_M; if (tmp_extruder != active_extruder) { bool no_move = code_seen('S') && code_value_bool(); @@ -6775,7 +6778,7 @@ inline void gcode_T(uint8_t tmp_extruder) { current_position[Y_AXIS], current_position[Z_AXIS] + (i == 2 ? 0 : TOOLCHANGE_PARK_ZLIFT), current_position[E_AXIS], - planner.max_feedrate[i == 1 ? X_AXIS : Z_AXIS], + planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS], active_extruder ); stepper.synchronize(); @@ -6838,7 +6841,7 @@ inline void gcode_T(uint8_t tmp_extruder) { current_position[Y_AXIS], current_position[Z_AXIS] + z_raise, current_position[E_AXIS], - planner.max_feedrate[Z_AXIS], + planner.max_feedrate_mm_s[Z_AXIS], active_extruder ); stepper.synchronize(); @@ -6853,7 +6856,7 @@ inline void gcode_T(uint8_t tmp_extruder) { current_position[Y_AXIS], current_position[Z_AXIS] + z_diff, current_position[E_AXIS], - planner.max_feedrate[Z_AXIS], + planner.max_feedrate_mm_s[Z_AXIS], active_extruder ); stepper.synchronize(); @@ -6984,7 +6987,7 @@ inline void gcode_T(uint8_t tmp_extruder) { enable_solenoid_on_active_extruder(); #endif // EXT_SOLENOID - feedrate = old_feedrate; + feedrate_mm_m = old_feedrate_mm_m; #else // HOTENDS <= 1 @@ -7837,9 +7840,9 @@ void clamp_to_software_endstops(float target[3]) { #if ENABLED(MESH_BED_LEVELING) // This function is used to split lines on mesh borders so each segment is only part of one mesh area -void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { +void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { if (!mbl.active()) { - planner.buffer_line(x, y, z, e, feed_rate, extruder); + planner.buffer_line(x, y, z, e, fr_mm_s, extruder); set_current_to_destination(); return; } @@ -7853,7 +7856,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, NOMORE(cy, MESH_NUM_Y_POINTS - 2); if (pcx == cx && pcy == cy) { // Start and end on same mesh square - planner.buffer_line(x, y, z, e, feed_rate, extruder); + planner.buffer_line(x, y, z, e, fr_mm_s, extruder); set_current_to_destination(); return; } @@ -7892,7 +7895,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, } else { // Already split on a border - planner.buffer_line(x, y, z, e, feed_rate, extruder); + planner.buffer_line(x, y, z, e, fr_mm_s, extruder); set_current_to_destination(); return; } @@ -7901,12 +7904,12 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, destination[Y_AXIS] = ny; destination[Z_AXIS] = nz; destination[E_AXIS] = ne; - mesh_buffer_line(nx, ny, nz, ne, feed_rate, extruder, x_splits, y_splits); + mesh_buffer_line(nx, ny, nz, ne, fr_mm_s, extruder, x_splits, y_splits); destination[X_AXIS] = x; destination[Y_AXIS] = y; destination[Z_AXIS] = z; destination[E_AXIS] = e; - mesh_buffer_line(x, y, z, e, feed_rate, extruder, x_splits, y_splits); + mesh_buffer_line(x, y, z, e, fr_mm_s, extruder, x_splits, y_splits); } #endif // MESH_BED_LEVELING @@ -7919,8 +7922,8 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, float cartesian_mm = sqrt(sq(difference[X_AXIS]) + sq(difference[Y_AXIS]) + sq(difference[Z_AXIS])); if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]); if (cartesian_mm < 0.000001) return false; - float _feedrate = feedrate * feedrate_multiplier / 6000.0; - float seconds = cartesian_mm / _feedrate; + float _feedrate_mm_s = MMM_TO_MMS_SCALED(feedrate_mm_m); + float seconds = cartesian_mm / _feedrate_mm_s; int steps = max(1, int(delta_segments_per_second * seconds)); float inv_steps = 1.0/steps; @@ -7944,7 +7947,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, //DEBUG_POS("prepare_delta_move_to", target); //DEBUG_POS("prepare_delta_move_to", delta); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], _feedrate, active_extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], _feedrate_mm_s, active_extruder); } return true; } @@ -7963,7 +7966,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, // move duplicate extruder into correct duplication position. planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, - current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[X_AXIS], 1); + current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1); SYNC_PLAN_POSITION_KINEMATIC(); stepper.synchronize(); extruder_duplication_enabled = true; @@ -7983,9 +7986,9 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, } delayed_move_time = 0; // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower - planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder); + planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder); planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], PLANNER_XY_FEEDRATE(), active_extruder); - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate[Z_AXIS], active_extruder); + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder); active_extruder_parked = false; } } @@ -7997,16 +8000,16 @@ void mesh_buffer_line(float x, float y, float z, const float e, float feed_rate, #if DISABLED(DELTA) && DISABLED(SCARA) inline bool prepare_move_to_destination_cartesian() { - // Do not use feedrate_multiplier for E or Z only moves + // Do not use feedrate_percentage for E or Z only moves if (current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS]) { line_to_destination(); } else { #if ENABLED(MESH_BED_LEVELING) - mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder); + mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); return false; #else - line_to_destination(feedrate * feedrate_multiplier / 100.0); + line_to_destination(MMM_SCALED(feedrate_mm_m)); #endif } return true; @@ -8150,7 +8153,7 @@ void prepare_move_to_destination() { // Initialize the extruder axis arc_target[E_AXIS] = current_position[E_AXIS]; - float feed_rate = feedrate * feedrate_multiplier / 60 / 100.0; + float fr_mm_s = MMM_TO_MMS_SCALED(feedrate_mm_m); millis_t next_idle_ms = millis() + 200UL; @@ -8194,9 +8197,9 @@ void prepare_move_to_destination() { #if ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(arc_target); #endif - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], feed_rate, active_extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], fr_mm_s, active_extruder); #else - planner.buffer_line(arc_target[X_AXIS], arc_target[Y_AXIS], arc_target[Z_AXIS], arc_target[E_AXIS], feed_rate, active_extruder); + planner.buffer_line(arc_target[X_AXIS], arc_target[Y_AXIS], arc_target[Z_AXIS], arc_target[E_AXIS], fr_mm_s, active_extruder); #endif } @@ -8206,9 +8209,9 @@ void prepare_move_to_destination() { #if ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(target); #endif - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], feed_rate, active_extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], fr_mm_s, active_extruder); #else - planner.buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], feed_rate, active_extruder); + planner.buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], fr_mm_s, active_extruder); #endif // As far as the parser is concerned, the position is now == target. In reality the @@ -8221,7 +8224,7 @@ void prepare_move_to_destination() { #if ENABLED(BEZIER_CURVE_SUPPORT) void plan_cubic_move(const float offset[4]) { - cubic_b_spline(current_position, destination, offset, feedrate * feedrate_multiplier / 60 / 100.0, active_extruder); + cubic_b_spline(current_position, destination, offset, MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); // As far as the parser is concerned, the position is now == target. In reality the // motion control system might still be processing the action and the real tool position @@ -8547,7 +8550,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS]; planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], - (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder); + MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder); current_position[E_AXIS] = oldepos; destination[E_AXIS] = oldedes; planner.set_e_position_mm(oldepos); diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 4cf9f5d36..937e105b3 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -49,13 +49,13 @@ * 104 EEPROM Checksum (uint16_t) * * 106 M92 XYZE planner.axis_steps_per_mm (float x4) - * 122 M203 XYZE planner.max_feedrate (float x4) + * 122 M203 XYZE planner.max_feedrate_mm_s (float x4) * 138 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4) * 154 M204 P planner.acceleration (float) * 158 M204 R planner.retract_acceleration (float) * 162 M204 T planner.travel_acceleration (float) - * 166 M205 S planner.min_feedrate (float) - * 170 M205 T planner.min_travel_feedrate (float) + * 166 M205 S planner.min_feedrate_mm_s (float) + * 170 M205 T planner.min_travel_feedrate_mm_s (float) * 174 M205 B planner.min_segment_time (ulong) * 178 M205 X planner.max_xy_jerk (float) * 182 M205 Z planner.max_z_jerk (float) @@ -116,7 +116,7 @@ * 406 M207 Z retract_zlift (float) * 410 M208 S retract_recover_length (float) * 414 M208 W retract_recover_length_swap (float) - * 418 M208 F retract_recover_feedrate (float) + * 418 M208 F retract_recover_feedrate_mm_s (float) * * Volumetric Extrusion: * 422 M200 D volumetric_enabled (bool) @@ -201,13 +201,13 @@ void Config_StoreSettings() { eeprom_checksum = 0; // clear before first "real data" EEPROM_WRITE_VAR(i, planner.axis_steps_per_mm); - EEPROM_WRITE_VAR(i, planner.max_feedrate); + EEPROM_WRITE_VAR(i, planner.max_feedrate_mm_s); EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2); EEPROM_WRITE_VAR(i, planner.acceleration); EEPROM_WRITE_VAR(i, planner.retract_acceleration); EEPROM_WRITE_VAR(i, planner.travel_acceleration); - EEPROM_WRITE_VAR(i, planner.min_feedrate); - EEPROM_WRITE_VAR(i, planner.min_travel_feedrate); + EEPROM_WRITE_VAR(i, planner.min_feedrate_mm_s); + EEPROM_WRITE_VAR(i, planner.min_travel_feedrate_mm_s); EEPROM_WRITE_VAR(i, planner.min_segment_time); EEPROM_WRITE_VAR(i, planner.max_xy_jerk); EEPROM_WRITE_VAR(i, planner.max_z_jerk); @@ -342,7 +342,7 @@ void Config_StoreSettings() { dummy = 0.0f; EEPROM_WRITE_VAR(i, dummy); #endif - EEPROM_WRITE_VAR(i, retract_recover_feedrate); + EEPROM_WRITE_VAR(i, retract_recover_feedrate_mm_s); #endif // FWRETRACT EEPROM_WRITE_VAR(i, volumetric_enabled); @@ -388,14 +388,14 @@ void Config_RetrieveSettings() { // version number match EEPROM_READ_VAR(i, planner.axis_steps_per_mm); - EEPROM_READ_VAR(i, planner.max_feedrate); + EEPROM_READ_VAR(i, planner.max_feedrate_mm_s); EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2); EEPROM_READ_VAR(i, planner.acceleration); EEPROM_READ_VAR(i, planner.retract_acceleration); EEPROM_READ_VAR(i, planner.travel_acceleration); - EEPROM_READ_VAR(i, planner.min_feedrate); - EEPROM_READ_VAR(i, planner.min_travel_feedrate); + EEPROM_READ_VAR(i, planner.min_feedrate_mm_s); + EEPROM_READ_VAR(i, planner.min_travel_feedrate_mm_s); EEPROM_READ_VAR(i, planner.min_segment_time); EEPROM_READ_VAR(i, planner.max_xy_jerk); EEPROM_READ_VAR(i, planner.max_z_jerk); @@ -524,7 +524,7 @@ void Config_RetrieveSettings() { #else EEPROM_READ_VAR(i, dummy); #endif - EEPROM_READ_VAR(i, retract_recover_feedrate); + EEPROM_READ_VAR(i, retract_recover_feedrate_mm_s); #endif // FWRETRACT EEPROM_READ_VAR(i, volumetric_enabled); @@ -564,7 +564,7 @@ void Config_ResetDefault() { long tmp3[] = DEFAULT_MAX_ACCELERATION; for (uint8_t i = 0; i < NUM_AXIS; i++) { planner.axis_steps_per_mm[i] = tmp1[i]; - planner.max_feedrate[i] = tmp2[i]; + planner.max_feedrate_mm_s[i] = tmp2[i]; planner.max_acceleration_mm_per_s2[i] = tmp3[i]; #if ENABLED(SCARA) if (i < COUNT(axis_scaling)) @@ -575,9 +575,9 @@ void Config_ResetDefault() { planner.acceleration = DEFAULT_ACCELERATION; planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION; planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION; - planner.min_feedrate = DEFAULT_MINIMUMFEEDRATE; + planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE; planner.min_segment_time = DEFAULT_MINSEGMENTTIME; - planner.min_travel_feedrate = DEFAULT_MINTRAVELFEEDRATE; + planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE; planner.max_xy_jerk = DEFAULT_XYJERK; planner.max_z_jerk = DEFAULT_ZJERK; planner.max_e_jerk = DEFAULT_EJERK; @@ -653,7 +653,7 @@ void Config_ResetDefault() { #if EXTRUDERS > 1 retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP; #endif - retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE; + retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE; #endif volumetric_enabled = false; @@ -706,10 +706,10 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):"); CONFIG_ECHO_START; } - SERIAL_ECHOPAIR(" M203 X", planner.max_feedrate[X_AXIS]); - SERIAL_ECHOPAIR(" Y", planner.max_feedrate[Y_AXIS]); - SERIAL_ECHOPAIR(" Z", planner.max_feedrate[Z_AXIS]); - SERIAL_ECHOPAIR(" E", planner.max_feedrate[E_AXIS]); + SERIAL_ECHOPAIR(" M203 X", planner.max_feedrate_mm_s[X_AXIS]); + SERIAL_ECHOPAIR(" Y", planner.max_feedrate_mm_s[Y_AXIS]); + SERIAL_ECHOPAIR(" Z", planner.max_feedrate_mm_s[Z_AXIS]); + SERIAL_ECHOPAIR(" E", planner.max_feedrate_mm_s[E_AXIS]); SERIAL_EOL; CONFIG_ECHO_START; @@ -737,8 +737,8 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)"); CONFIG_ECHO_START; } - SERIAL_ECHOPAIR(" M205 S", planner.min_feedrate); - SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate); + SERIAL_ECHOPAIR(" M205 S", planner.min_feedrate_mm_s); + SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate_mm_s); SERIAL_ECHOPAIR(" B", planner.min_segment_time); SERIAL_ECHOPAIR(" X", planner.max_xy_jerk); SERIAL_ECHOPAIR(" Z", planner.max_z_jerk); @@ -894,7 +894,7 @@ void Config_PrintSettings(bool forReplay) { #if EXTRUDERS > 1 SERIAL_ECHOPAIR(" W", retract_length_swap); #endif - SERIAL_ECHOPAIR(" F", retract_feedrate_mm_s * 60); + SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_feedrate_mm_s)); SERIAL_ECHOPAIR(" Z", retract_zlift); SERIAL_EOL; CONFIG_ECHO_START; @@ -906,7 +906,7 @@ void Config_PrintSettings(bool forReplay) { #if EXTRUDERS > 1 SERIAL_ECHOPAIR(" W", retract_recover_length_swap); #endif - SERIAL_ECHOPAIR(" F", retract_recover_feedrate * 60); + SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_recover_feedrate_mm_s)); SERIAL_EOL; CONFIG_ECHO_START; if (!forReplay) { diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index b1dd40311..8edb204bd 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -450,7 +450,7 @@ static void lcd_implementation_status_screen() { lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(12, 49); - lcd_print(itostr3(feedrate_multiplier)); + lcd_print(itostr3(feedrate_percentage)); lcd_print('%'); // Status line diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 900866e63..deda9f3df 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -80,20 +80,20 @@ block_t Planner::block_buffer[BLOCK_BUFFER_SIZE]; volatile uint8_t Planner::block_buffer_head = 0; // Index of the next block to be pushed volatile uint8_t Planner::block_buffer_tail = 0; -float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per second +float Planner::max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second float Planner::axis_steps_per_mm[NUM_AXIS]; unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS]; unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software millis_t Planner::min_segment_time; -float Planner::min_feedrate; +float Planner::min_feedrate_mm_s; float Planner::acceleration; // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX float Planner::retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX float Planner::travel_acceleration; // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX float Planner::max_xy_jerk; // The largest speed change requiring no acceleration float Planner::max_z_jerk; float Planner::max_e_jerk; -float Planner::min_travel_feedrate; +float Planner::min_travel_feedrate_mm_s; #if ENABLED(AUTO_BED_LEVELING_FEATURE) matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level @@ -527,14 +527,14 @@ void Planner::check_axes_activity() { * Add a new linear movement to the buffer. * * x,y,z,e - target position in mm - * feed_rate - (target) speed of the move + * fr_mm_s - (target) speed of the move * extruder - target extruder */ #if ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(MESH_BED_LEVELING) - void Planner::buffer_line(float x, float y, float z, const float& e, float feed_rate, const uint8_t extruder) + void Planner::buffer_line(float x, float y, float z, const float& e, float fr_mm_s, const uint8_t extruder) #else - void Planner::buffer_line(const float& x, const float& y, const float& z, const float& e, float feed_rate, const uint8_t extruder) + void Planner::buffer_line(const float& x, const float& y, const float& z, const float& e, float fr_mm_s, const uint8_t extruder) #endif // AUTO_BED_LEVELING_FEATURE { // Calculate the buffer head after we push this byte @@ -768,9 +768,9 @@ void Planner::check_axes_activity() { } if (block->steps[E_AXIS]) - NOLESS(feed_rate, min_feedrate); + NOLESS(fr_mm_s, min_feedrate_mm_s); else - NOLESS(feed_rate, min_travel_feedrate); + NOLESS(fr_mm_s, min_travel_feedrate_mm_s); /** * This part of the code calculates the total length of the movement. @@ -828,7 +828,7 @@ void Planner::check_axes_activity() { float inverse_millimeters = 1.0 / block->millimeters; // Inverse millimeters to remove multiple divides // Calculate moves/second for this move. No divide by zero due to previous checks. - float inverse_second = feed_rate * inverse_millimeters; + float inverse_second = fr_mm_s * inverse_millimeters; int moves_queued = movesplanned(); @@ -836,7 +836,7 @@ void Planner::check_axes_activity() { #if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN) bool mq = moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2; #if ENABLED(OLD_SLOWDOWN) - if (mq) feed_rate *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE); + if (mq) fr_mm_s *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE); #endif #if ENABLED(SLOWDOWN) // segment time im micro seconds @@ -895,7 +895,7 @@ void Planner::check_axes_activity() { float speed_factor = 1.0; //factor <=1 do decrease speed for (int i = 0; i < NUM_AXIS; i++) { current_speed[i] = delta_mm[i] * inverse_second; - float cs = fabs(current_speed[i]), mf = max_feedrate[i]; + float cs = fabs(current_speed[i]), mf = max_feedrate_mm_s[i]; if (cs > mf) speed_factor = min(speed_factor, mf / cs); } diff --git a/Marlin/planner.h b/Marlin/planner.h index d963fba4c..74fa3592e 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -119,20 +119,20 @@ class Planner { static volatile uint8_t block_buffer_head; // Index of the next block to be pushed static volatile uint8_t block_buffer_tail; - static float max_feedrate[NUM_AXIS]; // Max speeds in mm per second + static float max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second static float axis_steps_per_mm[NUM_AXIS]; static unsigned long max_acceleration_steps_per_s2[NUM_AXIS]; static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software static millis_t min_segment_time; - static float min_feedrate; + static float min_feedrate_mm_s; static float acceleration; // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX static float retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX static float travel_acceleration; // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX static float max_xy_jerk; // The largest speed change requiring no acceleration static float max_z_jerk; static float max_e_jerk; - static float min_travel_feedrate; + static float min_travel_feedrate_mm_s; #if ENABLED(AUTO_BED_LEVELING_FEATURE) static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level @@ -211,10 +211,10 @@ class Planner { * Add a new linear movement to the buffer. * * x,y,z,e - target position in mm - * feed_rate - (target) speed of the move + * fr_mm_s - (target) speed of the move (mm/s) * extruder - target extruder */ - static void buffer_line(float x, float y, float z, const float& e, float feed_rate, const uint8_t extruder); + static void buffer_line(float x, float y, float z, const float& e, float fr_mm_s, const uint8_t extruder); /** * Set the planner.position and individual stepper positions. @@ -229,7 +229,7 @@ class Planner { #else - static void buffer_line(const float& x, const float& y, const float& z, const float& e, float feed_rate, const uint8_t extruder); + static void buffer_line(const float& x, const float& y, const float& z, const float& e, float fr_mm_s, const uint8_t extruder); static void set_position_mm(const float& x, const float& y, const float& z, const float& e); #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING diff --git a/Marlin/planner_bezier.cpp b/Marlin/planner_bezier.cpp index b789b3db5..ad3319a49 100644 --- a/Marlin/planner_bezier.cpp +++ b/Marlin/planner_bezier.cpp @@ -105,7 +105,7 @@ inline static float dist1(float x1, float y1, float x2, float y2) { return fabs( * the mitigation offered by MIN_STEP and the small computational * power available on Arduino, I think it is not wise to implement it. */ -void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS], const float offset[4], float feed_rate, uint8_t extruder) { +void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS], const float offset[4], float fr_mm_s, uint8_t extruder) { // Absolute first and second control points are recovered. float first0 = position[X_AXIS] + offset[0]; float first1 = position[Y_AXIS] + offset[1]; @@ -193,9 +193,9 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] #if ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(bez_target); #endif - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], bez_target[E_AXIS], feed_rate, extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], bez_target[E_AXIS], fr_mm_s, extruder); #else - planner.buffer_line(bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS], bez_target[E_AXIS], feed_rate, extruder); + planner.buffer_line(bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS], bez_target[E_AXIS], fr_mm_s, extruder); #endif } } diff --git a/Marlin/planner_bezier.h b/Marlin/planner_bezier.h index 61026b8f6..d17e7c80a 100644 --- a/Marlin/planner_bezier.h +++ b/Marlin/planner_bezier.h @@ -36,7 +36,7 @@ void cubic_b_spline( const float position[NUM_AXIS], // current position const float target[NUM_AXIS], // target position const float offset[4], // a pair of offsets - float feed_rate, + float fr_mm_s, uint8_t extruder ); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index bd8d6c393..4fd6d5eb8 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -104,7 +104,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to #if HAS_POWER_SWITCH extern bool powersupply; #endif - const float manual_feedrate[] = MANUAL_FEEDRATE; + const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE; static void lcd_main_menu(); static void lcd_tune_menu(); static void lcd_prepare_menu(); @@ -254,10 +254,10 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) * menu_action_function(lcd_sdcard_pause) * - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999) - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) - * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) + * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) + * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) * */ #define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \ @@ -523,29 +523,29 @@ static void lcd_status_screen() { } #if ENABLED(ULTIPANEL_FEEDMULTIPLY) - int new_frm = feedrate_multiplier + (int32_t)encoderPosition; + int new_frm = feedrate_percentage + (int32_t)encoderPosition; // Dead zone at 100% feedrate - if ((feedrate_multiplier < 100 && new_frm > 100) || (feedrate_multiplier > 100 && new_frm < 100)) { - feedrate_multiplier = 100; + if ((feedrate_percentage < 100 && new_frm > 100) || (feedrate_percentage > 100 && new_frm < 100)) { + feedrate_percentage = 100; encoderPosition = 0; } - else if (feedrate_multiplier == 100) { + else if (feedrate_percentage == 100) { if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) { - feedrate_multiplier += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE); + feedrate_percentage += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE); encoderPosition = 0; } else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) { - feedrate_multiplier += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE; + feedrate_percentage += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; } } else { - feedrate_multiplier = new_frm; + feedrate_percentage = new_frm; encoderPosition = 0; } #endif // ULTIPANEL_FEEDMULTIPLY - feedrate_multiplier = constrain(feedrate_multiplier, 10, 999); + feedrate_percentage = constrain(feedrate_percentage, 10, 999); #endif //ULTIPANEL } @@ -573,9 +573,9 @@ void kill_screen(const char* lcd_msg) { inline void line_to_current(AxisEnum axis) { #if ENABLED(DELTA) calculate_delta(current_position); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder); #else // !DELTA - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder); #endif // !DELTA } @@ -757,7 +757,7 @@ void kill_screen(const char* lcd_msg) { // // Speed: // - MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999); + MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999); // Manual bed leveling, Bed Z: #if ENABLED(MANUAL_BED_LEVELING) @@ -1020,7 +1020,7 @@ void kill_screen(const char* lcd_msg) { line_to_current(Z_AXIS); current_position[X_AXIS] = x + home_offset[X_AXIS]; current_position[Y_AXIS] = y + home_offset[Y_AXIS]; - line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS); + line_to_current(manual_feedrate_mm_m[X_AXIS] <= manual_feedrate_mm_m[Y_AXIS] ? X_AXIS : Y_AXIS); #if MIN_Z_HEIGHT_FOR_HOMING > 0 current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; // How do condition and action match? line_to_current(Z_AXIS); @@ -1310,9 +1310,9 @@ void kill_screen(const char* lcd_msg) { if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { #if ENABLED(DELTA) calculate_delta(current_position); - planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index); + planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index); #else - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[manual_move_axis]/60, manual_move_e_index); + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index); #endif manual_move_axis = (int8_t)NO_AXIS; } @@ -1800,12 +1800,12 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &planner.max_z_jerk, 0.1, 990); #endif MENU_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_e_jerk, 1, 990); - MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate[X_AXIS], 1, 999); - MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate[Y_AXIS], 1, 999); - MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate[Z_AXIS], 1, 999); - MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate[E_AXIS], 1, 999); - MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate, 0, 999); - MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate, 0, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &planner.max_feedrate_mm_s[X_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &planner.max_feedrate_mm_s[Y_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &planner.max_feedrate_mm_s[Z_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate_mm_s[E_AXIS], 1, 999); + MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate_mm_s, 0, 999); + MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate_mm_s, 0, 999); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates); @@ -1905,7 +1905,7 @@ void kill_screen(const char* lcd_msg) { #if EXTRUDERS > 1 MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT_RECOVER_SWAP, &retract_recover_length_swap, 0, 100); #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999); + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate_mm_s, 1, 999); END_MENU(); } #endif // FWRETRACT @@ -2257,15 +2257,15 @@ void kill_screen(const char* lcd_msg) { * static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, screenFunc_t callback); // edit int with callback * * You can then use one of the menu macros to present the edit interface: - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999) + * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) * * This expands into a more primitive menu item: - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) + * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) * * * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK * - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999) + * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) */ #define menu_edit_type(_type, _name, _strFunc, scale) \ bool _menu_edit_ ## _name () { \ diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index b5342bd3b..d1d047fca 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -742,7 +742,7 @@ static void lcd_implementation_status_screen() { lcd.setCursor(0, 2); lcd.print(LCD_STR_FEEDRATE[0]); - lcd.print(itostr3(feedrate_multiplier)); + lcd.print(itostr3(feedrate_percentage)); lcd.print('%'); #if LCD_WIDTH > 19 && ENABLED(SDSUPPORT) From 9f9fe043ba46361a4ff6a04c695cf1f3cb159c7f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Jul 2016 18:50:25 -0700 Subject: [PATCH 388/580] Apply sq macro throughout --- Marlin/Marlin_main.cpp | 17 ++++++++--------- Marlin/macros.h | 1 + Marlin/planner.cpp | 16 ++++++++-------- Marlin/planner.h | 6 +++--- Marlin/ultralcd.cpp | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 140dd5def..93854b629 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3596,7 +3596,7 @@ inline void gcode_G28() { * so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z */ - int abl2 = auto_bed_leveling_grid_points * auto_bed_leveling_grid_points; + int abl2 = sq(auto_bed_leveling_grid_points); double eqnAMatrix[abl2 * 3], // "A" matrix of the linear system of equations eqnBVector[abl2], // "B" vector of Z points @@ -3629,7 +3629,7 @@ inline void gcode_G28() { #if ENABLED(DELTA) // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. - float distance_from_center = sqrt(xProbe * xProbe + yProbe * yProbe); + float distance_from_center = HYPOT(xProbe, yProbe); if (distance_from_center > DELTA_PROBEABLE_RADIUS) continue; #endif //DELTA @@ -4252,7 +4252,7 @@ inline void gcode_M42() { return; } #else - if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) { + if (HYPOT(X_probe_location, Y_probe_location) > DELTA_PROBEABLE_RADIUS) { SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius."); return; } @@ -4342,7 +4342,7 @@ inline void gcode_M42() { #else // If we have gone out too far, we can do a simple fix and scale the numbers // back in closer to the origin. - while (sqrt(X_current * X_current + Y_current * Y_current) > DELTA_PROBEABLE_RADIUS) { + while (HYPOT(X_current, Y_current) > DELTA_PROBEABLE_RADIUS) { X_current /= 1.25; Y_current /= 1.25; if (verbose_level > 3) { @@ -4378,10 +4378,9 @@ inline void gcode_M42() { * data points we have so far */ sum = 0.0; - for (uint8_t j = 0; j <= n; j++) { - float ss = sample_set[j] - mean; - sum += ss * ss; - } + for (uint8_t j = 0; j <= n; j++) + sum += sq(sample_set[j] - mean); + sigma = sqrt(sum / (n + 1)); if (verbose_level > 0) { if (verbose_level > 1) { @@ -8139,7 +8138,7 @@ void prepare_move_to_destination() { * This is important when there are successive arc motions. */ // Vector rotation matrix values - float cos_T = 1 - 0.5 * theta_per_segment * theta_per_segment; // Small angle approximation + float cos_T = 1 - 0.5 * sq(theta_per_segment); // Small angle approximation float sin_T = theta_per_segment; float arc_target[NUM_AXIS]; diff --git a/Marlin/macros.h b/Marlin/macros.h index 7dbadee08..bf2d07180 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -36,6 +36,7 @@ // Macros for maths shortcuts #define RADIANS(d) ((d)*M_PI/180.0) #define DEGREES(r) ((r)*180.0/M_PI) +#define HYPOT(x,y) sqrt(sq(x)+sq(y)) // Macros to contrain values #define NOLESS(v,n) do{ if (v < n) v = n; }while(0) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index deda9f3df..03796100e 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -171,8 +171,8 @@ void Planner::calculate_trapezoid_for_block(block_t* block, float entry_factor, } #if ENABLED(ADVANCE) - volatile long initial_advance = block->advance * entry_factor * entry_factor; - volatile long final_advance = block->advance * exit_factor * exit_factor; + volatile long initial_advance = block->advance * sq(entry_factor); + volatile long final_advance = block->advance * sq(exit_factor); #endif // ADVANCE // block->accelerate_until = accelerate_steps; @@ -815,13 +815,13 @@ void Planner::check_axes_activity() { else { block->millimeters = sqrt( #if ENABLED(COREXY) - square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS]) + sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_AXIS]) #elif ENABLED(COREXZ) - square(delta_mm[X_HEAD]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_HEAD]) + sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD]) #elif ENABLED(COREYZ) - square(delta_mm[X_AXIS]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_HEAD]) + sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD]) #else - square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS]) + sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS]) #endif ); } @@ -1030,7 +1030,7 @@ void Planner::check_axes_activity() { dsy = current_speed[Y_AXIS] - previous_speed[Y_AXIS], dsz = fabs(csz - previous_speed[Z_AXIS]), dse = fabs(cse - previous_speed[E_AXIS]), - jerk = sqrt(dsx * dsx + dsy * dsy); + jerk = HYPOT(dsx, dsy); // if ((fabs(previous_speed[X_AXIS]) > 0.0001) || (fabs(previous_speed[Y_AXIS]) > 0.0001)) { vmax_junction = block->nominal_speed; @@ -1086,7 +1086,7 @@ void Planner::check_axes_activity() { } else { long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_steps_per_s2); - float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * (cse * cse * (EXTRUSION_AREA) * (EXTRUSION_AREA)) * 256; + float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * HYPOT(cse, EXTRUSION_AREA) * 256; block->advance = advance; block->advance_rate = acc_dist ? advance / (float)acc_dist : 0; } diff --git a/Marlin/planner.h b/Marlin/planner.h index 74fa3592e..74abd1cb2 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -290,7 +290,7 @@ class Planner { */ static float estimate_acceleration_distance(float initial_rate, float target_rate, float accel) { if (accel == 0) return 0; // accel was 0, set acceleration distance to 0 - return (target_rate * target_rate - initial_rate * initial_rate) / (accel * 2); + return (sq(target_rate) - sq(initial_rate)) / (accel * 2); } /** @@ -303,7 +303,7 @@ class Planner { */ static float intersection_distance(float initial_rate, float final_rate, float accel, float distance) { if (accel == 0) return 0; // accel was 0, set intersection distance to 0 - return (accel * 2 * distance - initial_rate * initial_rate + final_rate * final_rate) / (accel * 4); + return (accel * 2 * distance - sq(initial_rate) + sq(final_rate)) / (accel * 4); } /** @@ -312,7 +312,7 @@ class Planner { * 'distance'. */ static float max_allowable_speed(float accel, float target_velocity, float distance) { - return sqrt(target_velocity * target_velocity - 2 * accel * distance); + return sqrt(sq(target_velocity) - 2 * accel * distance); } static void calculate_trapezoid_for_block(block_t* block, float entry_factor, float exit_factor); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 4fd6d5eb8..3e933ee89 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1356,7 +1356,7 @@ void kill_screen(const char* lcd_msg) { } #if ENABLED(DELTA) static float delta_clip_radius_2 = (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS); - static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); } + static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - sq(a)); } static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS, max(sw_endstop_min[X_AXIS], -clip), min(sw_endstop_max[X_AXIS], clip)); } static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS, max(sw_endstop_min[Y_AXIS], -clip), min(sw_endstop_max[Y_AXIS], clip)); } #else From 3d78b8f92982b6a3ccec426936e6ddd11b28805f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Jul 2016 18:55:09 -0700 Subject: [PATCH 389/580] Use HYPOT macro instead of hypot function --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 93854b629..015c7d200 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -8083,7 +8083,7 @@ void prepare_move_to_destination() { uint8_t clockwise // Clockwise? ) { - float radius = hypot(offset[X_AXIS], offset[Y_AXIS]), + float radius = HYPOT(offset[X_AXIS], offset[Y_AXIS]), center_X = current_position[X_AXIS] + offset[X_AXIS], center_Y = current_position[Y_AXIS] + offset[Y_AXIS], linear_travel = target[Z_AXIS] - current_position[Z_AXIS], @@ -8102,7 +8102,7 @@ void prepare_move_to_destination() { if (angular_travel == 0 && current_position[X_AXIS] == target[X_AXIS] && current_position[Y_AXIS] == target[Y_AXIS]) angular_travel += RADIANS(360); - float mm_of_travel = hypot(angular_travel * radius, fabs(linear_travel)); + float mm_of_travel = HYPOT(angular_travel * radius, fabs(linear_travel)); if (mm_of_travel < 0.001) return; uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT)); if (segments == 0) segments = 1; From f38553b48215e7e5fa3b2351dd928a9cc3c9e3bd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Jul 2016 19:26:23 -0700 Subject: [PATCH 390/580] fix a debug message --- Marlin/Marlin_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 015c7d200..387777ae5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2005,6 +2005,7 @@ static void clean_up_after_endstop_or_probe_move() { if (DEBUGGING(LEVELING)) { DEBUG_POS("set_probe_deployed", current_position); SERIAL_ECHOPAIR("deploy: ", deploy); + SERIAL_EOL; } #endif From 671634bf1111ab0cf3bf06f9284a791a46472882 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 16:05:37 -0700 Subject: [PATCH 391/580] Fix spacing after section header --- Marlin/Configuration.h | 1 + Marlin/example_configurations/Cartesio/Configuration.h | 1 + Marlin/example_configurations/Felix/Configuration.h | 1 + Marlin/example_configurations/Felix/DUAL/Configuration.h | 1 + Marlin/example_configurations/Hephestos/Configuration.h | 1 + Marlin/example_configurations/Hephestos_2/Configuration.h | 1 + Marlin/example_configurations/K8200/Configuration.h | 1 + Marlin/example_configurations/K8400/Configuration.h | 1 + Marlin/example_configurations/K8400/Dual-head/Configuration.h | 1 + .../RepRapWorld/Megatronics/Configuration.h | 1 + Marlin/example_configurations/RigidBot/Configuration.h | 1 + Marlin/example_configurations/SCARA/Configuration.h | 1 + Marlin/example_configurations/TAZ4/Configuration.h | 1 + Marlin/example_configurations/WITBOX/Configuration.h | 1 + Marlin/example_configurations/adafruit/ST7565/Configuration.h | 1 + Marlin/example_configurations/delta/biv2.5/Configuration.h | 1 + Marlin/example_configurations/delta/generic/Configuration.h | 1 + Marlin/example_configurations/delta/kossel_mini/Configuration.h | 1 + Marlin/example_configurations/delta/kossel_pro/Configuration.h | 1 + Marlin/example_configurations/delta/kossel_xl/Configuration.h | 1 + Marlin/example_configurations/makibox/Configuration.h | 1 + Marlin/example_configurations/tvrrug/Round2/Configuration.h | 1 + 22 files changed, 22 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index fb59131b2..0a6d77417 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index a61f51b29..5d23fb537 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 4ad34b019..2bb499f0c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -578,6 +578,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index c1467c53f..5fc495f24 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -576,6 +576,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 9d132ad05..fa58bb394 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -588,6 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 012df0680..ebdd18cb3 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -590,6 +590,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + #define MIN_Z_HEIGHT_FOR_HOMING 5 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index a4252f496..c20173daf 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -613,6 +613,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR true // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 3addb541c..e9e7a6b54 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -573,6 +573,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 992912eb7..48f7f6008 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -573,6 +573,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 59b2c9db9..11a5a07f7 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 14c454780..c080bd9fc 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -593,6 +593,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 92708015b..7a9f0d37c 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -604,6 +604,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 700bc69c2..f51bc4841 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -617,6 +617,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR true // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 7110d30ea..5abe59e1c 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -588,6 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 95428fc67..9f3fa954a 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 5a8faef98..d599e9a50 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -685,6 +685,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 3118bf3af..cf5e08126 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -679,6 +679,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 3d237ec2d..f2fdc54b0 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -682,6 +682,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 15// (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 96c143f21..aca8ede55 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -676,6 +676,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index a7e3f4edc..b59312fce 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -677,6 +677,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 6a5a8c24c..4d05e5cb7 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -599,6 +599,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 5f27ebd05..787de288b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -586,6 +586,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. From 0fcd3706dd3365b66efda7d3ba8a6a0edb121a3a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 16:11:53 -0700 Subject: [PATCH 392/580] Replace ENDSTOPS_ONLY_FOR_HOMING with ENDSTOPS_ALWAYS_ON_DEFAULT --- Marlin/Configuration_adv.h | 5 +++-- Marlin/SanityCheck.h | 2 ++ Marlin/endstops.cpp | 12 ++++++------ .../Cartesio/Configuration_adv.h | 5 +++-- .../example_configurations/Felix/Configuration_adv.h | 5 +++-- .../Hephestos/Configuration_adv.h | 5 +++-- .../Hephestos_2/Configuration_adv.h | 5 +++-- .../example_configurations/K8200/Configuration_adv.h | 5 +++-- .../example_configurations/K8400/Configuration_adv.h | 5 +++-- .../RigidBot/Configuration_adv.h | 5 +++-- .../example_configurations/SCARA/Configuration_adv.h | 5 +++-- .../example_configurations/TAZ4/Configuration_adv.h | 5 +++-- .../WITBOX/Configuration_adv.h | 5 +++-- .../delta/biv2.5/Configuration_adv.h | 5 +++-- .../delta/generic/Configuration_adv.h | 5 +++-- .../delta/kossel_mini/Configuration_adv.h | 5 +++-- .../delta/kossel_pro/Configuration_adv.h | 5 +++-- .../delta/kossel_xl/Configuration_adv.h | 5 +++-- .../makibox/Configuration_adv.h | 5 +++-- .../tvrrug/Round2/Configuration_adv.h | 5 +++-- 20 files changed, 62 insertions(+), 42 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 027132d77..930e931d3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 98abffa0a..086634491 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -680,6 +680,8 @@ #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." #elif defined(ABS_PREHEAT_FAN_SPEED) #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." +#elif defined(ENDSTOPS_ONLY_FOR_HOMING) + #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." #endif /** diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 3bfb67a11..9eec4a579 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -40,10 +40,10 @@ Endstops endstops; bool Endstops::enabled = true, Endstops::enabled_globally = - #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING) - false + #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) + (true) #else - true + (false) #endif ; volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value @@ -66,10 +66,10 @@ volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_P Endstops::Endstops() { enable_globally( - #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING) - false + #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) + (true) #else - true + (false) #endif ); enable(true); diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 5fb71efe6..9207b5703 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 05189ecfc..3f0729b6c 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 1aa7c218b..af6bce805 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -//#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 95b8c89b8..bfb6b16c7 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 2d0afdff3..3703ce1cc 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -229,7 +229,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -445,7 +447,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index ba78a1589..11fdbdb3c 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index e3af83bad..3c0968260 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index a7285ffd2..6a0dea802 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 116c99abb..fe9b6ba36 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -231,7 +231,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -447,7 +449,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 1aa7c218b..af6bce805 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -//#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 3e9fd8670..173cacf4d 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -441,7 +443,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 1dfeb8c71..51a2d2b0b 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -441,7 +443,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index e2bb76476..90b3c68f0 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -440,7 +442,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 3baf69390..b8b94f8d4 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -228,7 +228,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -445,7 +447,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 3b82e06fb..74bb7c5dc 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -441,7 +443,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index bdf820937..6e8c6e671 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 9c04c4650..f72daabc8 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT From 69d60169419bb31756c96c047bcaf7b4d0df5f03 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 16:12:20 -0700 Subject: [PATCH 393/580] Revert default state of endstops in M502 --- Marlin/configuration_store.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 4cf9f5d36..b74cc8d35 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -127,6 +127,7 @@ */ #include "Marlin.h" #include "language.h" +#include "endstops.h" #include "planner.h" #include "temperature.h" #include "ultralcd.h" @@ -660,6 +661,14 @@ void Config_ResetDefault() { for (uint8_t q = 0; q < COUNT(filament_size); q++) filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA; + endstops.enable_globally( + #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) + (true) + #else + (false) + #endif + ); + Config_Postprocess(); SERIAL_ECHO_START; From 5ed1e7a464561d4d54ad9c408a4f7ac0a345232a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 16:39:49 -0700 Subject: [PATCH 394/580] codenum => dwell_ms --- Marlin/Marlin_main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e7355292f..8162d3ab1 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2728,18 +2728,18 @@ inline void gcode_G0_G1() { * G4: Dwell S or P */ inline void gcode_G4() { - millis_t codenum = 0; + millis_t dwell_ms = 0; - if (code_seen('P')) codenum = code_value_millis(); // milliseconds to wait - if (code_seen('S')) codenum = code_value_millis_from_seconds(); // seconds to wait + if (code_seen('P')) dwell_ms = code_value_millis(); // milliseconds to wait + if (code_seen('S')) dwell_ms = code_value_millis_from_seconds(); // seconds to wait stepper.synchronize(); refresh_cmd_timeout(); - codenum += previous_cmd_ms; // keep track of when we started waiting + dwell_ms += previous_cmd_ms; // keep track of when we started waiting if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL); - while (PENDING(millis(), codenum)) idle(); + while (PENDING(millis(), dwell_ms)) idle(); } #if ENABLED(BEZIER_CURVE_SUPPORT) From 7242d4481061c5749aaf2f40ae26c6440239c6d2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Jul 2016 13:34:30 -0700 Subject: [PATCH 395/580] Endstops vars already initialized --- Marlin/endstops.cpp | 14 -------------- Marlin/endstops.h | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 9eec4a579..751296d40 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -64,20 +64,6 @@ volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_P * Class and Instance Methods */ -Endstops::Endstops() { - enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - (true) - #else - (false) - #endif - ); - enable(true); - #if HAS_BED_PROBE - enable_z_probe(false); - #endif -} // Endstops::Endstops - void Endstops::init() { #if HAS_X_MIN diff --git a/Marlin/endstops.h b/Marlin/endstops.h index 76b34862c..e5d541cf1 100644 --- a/Marlin/endstops.h +++ b/Marlin/endstops.h @@ -43,7 +43,7 @@ class Endstops { #endif current_endstop_bits, old_endstop_bits; - Endstops(); + Endstops() {}; /** * Initialize the endstop pins From 39706f3e573c1e4d9258f8242502bdc3a75fe934 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 1 Jun 2016 01:14:58 -0700 Subject: [PATCH 396/580] Endstop invert flags as macros instead of const bool --- Marlin/Conditionals.h | 56 +++++++++---------- Marlin/Configuration.h | 14 ++--- .../Cartesio/Configuration.h | 14 ++--- .../Felix/Configuration.h | 14 ++--- .../Felix/DUAL/Configuration.h | 14 ++--- .../Hephestos/Configuration.h | 14 ++--- .../Hephestos_2/Configuration.h | 14 ++--- .../K8200/Configuration.h | 14 ++--- .../K8400/Configuration.h | 14 ++--- .../K8400/Dual-head/Configuration.h | 14 ++--- .../RepRapWorld/Megatronics/Configuration.h | 14 ++--- .../RigidBot/Configuration.h | 14 ++--- .../SCARA/Configuration.h | 14 ++--- .../TAZ4/Configuration.h | 14 ++--- .../WITBOX/Configuration.h | 14 ++--- .../adafruit/ST7565/Configuration.h | 14 ++--- .../delta/biv2.5/Configuration.h | 14 ++--- .../delta/generic/Configuration.h | 14 ++--- .../delta/kossel_mini/Configuration.h | 14 ++--- .../delta/kossel_pro/Configuration.h | 14 ++--- .../delta/kossel_xl/Configuration.h | 14 ++--- .../makibox/Configuration.h | 14 ++--- .../tvrrug/Round2/Configuration.h | 14 ++--- 23 files changed, 181 insertions(+), 183 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index a70c44923..18a3defd8 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -610,35 +610,33 @@ #define _XMAX_ 101 #define _YMAX_ 201 #define _ZMAX_ 301 - const bool Z2_MAX_ENDSTOP_INVERTING = - #if Z2_USE_ENDSTOP == _XMAX_ - X_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MAX_PIN - #undef USE_XMAX_PLUG - #elif Z2_USE_ENDSTOP == _YMAX_ - Y_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MAX_PIN - #undef USE_YMAX_PLUG - #elif Z2_USE_ENDSTOP == _ZMAX_ - Z_MAX_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MAX_PIN - #undef USE_ZMAX_PLUG - #elif Z2_USE_ENDSTOP == _XMIN_ - X_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN X_MIN_PIN - #undef USE_XMIN_PLUG - #elif Z2_USE_ENDSTOP == _YMIN_ - Y_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Y_MIN_PIN - #undef USE_YMIN_PLUG - #elif Z2_USE_ENDSTOP == _ZMIN_ - Z_MIN_ENDSTOP_INVERTING - #define Z2_MAX_PIN Z_MIN_PIN - #undef USE_ZMIN_PLUG - #else - 0 - #endif - ; + #if Z2_USE_ENDSTOP == _XMAX_ + #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN X_MAX_PIN + #undef USE_XMAX_PLUG + #elif Z2_USE_ENDSTOP == _YMAX_ + #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN Y_MAX_PIN + #undef USE_YMAX_PLUG + #elif Z2_USE_ENDSTOP == _ZMAX_ + #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN Z_MAX_PIN + #undef USE_ZMAX_PLUG + #elif Z2_USE_ENDSTOP == _XMIN_ + #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN X_MIN_PIN + #undef USE_XMIN_PLUG + #elif Z2_USE_ENDSTOP == _YMIN_ + #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN Y_MIN_PIN + #undef USE_YMIN_PLUG + #elif Z2_USE_ENDSTOP == _ZMIN_ + #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN Z_MIN_PIN + #undef USE_ZMIN_PLUG + #else + #define Z2_MAX_ENDSTOP_INVERTING false + #endif #endif /** diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0a6d77417..10173f97e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -437,13 +437,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 5d23fb537..07172d608 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -437,13 +437,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 2bb499f0c..0951d1b9a 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -419,13 +419,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 5fc495f24..78c7e5045 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -417,13 +417,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index fa58bb394..60431e93a 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -429,13 +429,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index ebdd18cb3..e70988552 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -431,13 +431,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index c20173daf..289f16ce1 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -454,13 +454,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index e9e7a6b54..edf8466a8 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -414,13 +414,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 48f7f6008..1e1e2ce9c 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -414,13 +414,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 11a5a07f7..158dc950c 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -437,13 +437,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index c080bd9fc..e97b60bfa 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -434,13 +434,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 7a9f0d37c..fecfa0515 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -445,13 +445,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index f51bc4841..1509de3a0 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -458,13 +458,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 5abe59e1c..5470f361e 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -429,13 +429,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9f3fa954a..59f37347e 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -437,13 +437,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index d599e9a50..c916957db 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -479,13 +479,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index cf5e08126..a27eab203 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -479,13 +479,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index f2fdc54b0..aabf9a8e1 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -479,13 +479,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index aca8ede55..5c390a573 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -468,13 +468,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index b59312fce..df483309a 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -477,13 +477,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 4d05e5cb7..c3d6cb8c8 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -440,13 +440,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 787de288b..d2bbc6c70 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -427,13 +427,13 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. //=========================================================================== //============================= Z Probe Options ============================= From 176b9627c7c3235fc344236c906c6884a63d48ef Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 1 Jun 2016 01:15:37 -0700 Subject: [PATCH 397/580] Some cleanup ahead of BLTOUCH support --- Marlin/stepper.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 63159a304..90a1ddf65 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -359,11 +359,11 @@ void Stepper::isr() { if (current_block) { // Update endstops state, if enabled - #if HAS_BED_PROBE - if (endstops.enabled || endstops.z_probe_enabled) endstops.update(); - #else - if (endstops.enabled) endstops.update(); - #endif + if (endstops.enabled + #if HAS_BED_PROBE + || endstops.z_probe_enabled + #endif + ) endstops.update(); // Take multiple steps per interrupt (For high speed moves) for (int8_t i = 0; i < step_loops; i++) { From 1583177ef4dad2eb29b030a43131e98be833110b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Jul 2016 13:14:12 -0700 Subject: [PATCH 398/580] BLTOUCH probe config option --- Marlin/Conditionals.h | 15 +++++++++++++++ Marlin/Configuration.h | 3 +++ .../Cartesio/Configuration.h | 3 +++ .../example_configurations/Felix/Configuration.h | 3 +++ .../Felix/DUAL/Configuration.h | 3 +++ .../Hephestos/Configuration.h | 3 +++ .../Hephestos_2/Configuration.h | 3 +++ .../example_configurations/K8200/Configuration.h | 3 +++ .../example_configurations/K8400/Configuration.h | 3 +++ .../K8400/Dual-head/Configuration.h | 3 +++ .../RepRapWorld/Megatronics/Configuration.h | 3 +++ .../RigidBot/Configuration.h | 3 +++ .../example_configurations/SCARA/Configuration.h | 3 +++ .../example_configurations/TAZ4/Configuration.h | 3 +++ .../example_configurations/WITBOX/Configuration.h | 3 +++ .../adafruit/ST7565/Configuration.h | 3 +++ .../delta/biv2.5/Configuration.h | 3 +++ .../delta/generic/Configuration.h | 3 +++ .../delta/kossel_mini/Configuration.h | 3 +++ .../delta/kossel_pro/Configuration.h | 3 +++ .../delta/kossel_xl/Configuration.h | 3 +++ .../makibox/Configuration.h | 3 +++ .../tvrrug/Round2/Configuration.h | 3 +++ 23 files changed, 81 insertions(+) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index a70c44923..1ab37d453 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -368,6 +368,21 @@ #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS) #endif //!MANUAL_HOME_POSITIONS + /** + * The BLTouch Probe emulates a servo probe + */ + #if ENABLED(BLTOUCH) + #undef Z_ENDSTOP_SERVO_NR + #undef Z_SERVO_ANGLES + #define Z_ENDSTOP_SERVO_NR 0 + #define Z_SERVO_ANGLES {10,90} // For BLTouch 10=deploy, 90=retract + #undef DEACTIVATE_SERVOS_AFTER_MOVE + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #undef Z_MIN_ENDSTOP_INVERTING + #define Z_MIN_ENDSTOP_INVERTING false + #endif + #endif + /** * Auto Bed Leveling and Z Probe Repeatability Test */ diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0a6d77417..ea55ac37b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -465,6 +465,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 5d23fb537..6571b7391 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -465,6 +465,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 2bb499f0c..89689618e 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -447,6 +447,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 5fc495f24..bdf7faf7d 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -445,6 +445,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index fa58bb394..4f2d4ea88 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -457,6 +457,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index ebdd18cb3..d8c679ef5 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -459,6 +459,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. #define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index c20173daf..c6fb40ad9 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -482,6 +482,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index e9e7a6b54..c213480ab 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -442,6 +442,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 48f7f6008..79cfae385 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -442,6 +442,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 11a5a07f7..52ec100ab 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -465,6 +465,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index c080bd9fc..aadc23dac 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -462,6 +462,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 7a9f0d37c..1c0aac1c3 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -473,6 +473,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index f51bc4841..6f80c2282 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -486,6 +486,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 5abe59e1c..412549bf9 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -457,6 +457,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9f3fa954a..4f99be9ae 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -465,6 +465,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index d599e9a50..a3e28ebe6 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -507,6 +507,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index cf5e08126..a7c58d992 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -507,6 +507,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index f2fdc54b0..017cf245e 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -507,6 +507,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index aca8ede55..089f7df32 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -496,6 +496,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index b59312fce..df95a42e7 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -505,6 +505,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. #define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 4d05e5cb7..a521d8871 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -468,6 +468,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 787de288b..b73bb8c48 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -455,6 +455,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // its trigger-point if hardware endstops are active. //#define FIX_MOUNTED_PROBE +// The BLTouch probe emulates a servo probe. +//#define BLTOUCH + // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles From 799a31cd30297c5436bc11724b2a04ba216f85d7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 22:56:44 -0700 Subject: [PATCH 399/580] Include the position_shift when splitting mesh lines --- Marlin/Marlin_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ad163d77d..a1f454df6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7863,7 +7863,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c } float nx, ny, nz, ne, normalized_dist; if (cx > pcx && TEST(x_splits, cx)) { - nx = mbl.get_probe_x(cx) + home_offset[X_AXIS]; + nx = mbl.get_probe_x(cx) + home_offset[X_AXIS] + position_shift[X_AXIS]; normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]); ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist; nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; @@ -7871,7 +7871,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c CBI(x_splits, cx); } else if (cx < pcx && TEST(x_splits, pcx)) { - nx = mbl.get_probe_x(pcx) + home_offset[X_AXIS]; + nx = mbl.get_probe_x(pcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]); ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist; nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; @@ -7879,7 +7879,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c CBI(x_splits, pcx); } else if (cy > pcy && TEST(y_splits, cy)) { - ny = mbl.get_probe_y(cy) + home_offset[Y_AXIS]; + ny = mbl.get_probe_y(cy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]); nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist; nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; @@ -7887,7 +7887,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c CBI(y_splits, cy); } else if (cy < pcy && TEST(y_splits, pcy)) { - ny = mbl.get_probe_y(pcy) + home_offset[Y_AXIS]; + ny = mbl.get_probe_y(pcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]); nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist; nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; From f4a69281fc17835558755ae76ab8cfedcb52da5d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 23:40:48 -0700 Subject: [PATCH 400/580] Only call mesh_buffer_line when MBL is active --- Marlin/Marlin_main.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a1f454df6..389818c58 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7842,11 +7842,6 @@ void clamp_to_software_endstops(float target[3]) { // This function is used to split lines on mesh borders so each segment is only part of one mesh area void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { - if (!mbl.active()) { - planner.buffer_line(x, y, z, e, fr_mm_s, extruder); - set_current_to_destination(); - return; - } int pcx = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)), pcy = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), cx = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)), @@ -8007,11 +8002,13 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c } else { #if ENABLED(MESH_BED_LEVELING) - mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); - return false; - #else - line_to_destination(MMM_SCALED(feedrate_mm_m)); + if (mbl.active()) { + mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); + return false; + } + else #endif + line_to_destination(MMM_SCALED(feedrate_mm_m)); } return true; } From 103d312f6dbd4904cc06b6133fe7b8266b7872db Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 23:44:55 -0700 Subject: [PATCH 401/580] MBL can actually do up to 9 x 9 --- Marlin/SanityCheck.h | 4 ++-- Marlin/configuration_store.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 086634491..a8f238810 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -238,8 +238,8 @@ #error "MESH_BED_LEVELING does not yet support DELTA printers." #elif ENABLED(AUTO_BED_LEVELING_FEATURE) #error "Select AUTO_BED_LEVELING_FEATURE or MESH_BED_LEVELING, not both." - #elif MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7 - #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS need to be less than 8." + #elif MESH_NUM_X_POINTS > 9 || MESH_NUM_Y_POINTS > 9 + #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS must be less than 10." #endif #elif ENABLED(MANUAL_BED_LEVELING) #error "MESH_BED_LEVELING is required for MANUAL_BED_LEVELING." diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index ab5af8064..b203bbb62 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -67,7 +67,7 @@ * 203 z_offset (float) * 207 mesh_num_x (uint8 as set in firmware) * 208 mesh_num_y (uint8 as set in firmware) - * 209 G29 S3 XYZ z_values[][] (float x9, by default) + * 209 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81) * * AUTO BED LEVELING * 245 M851 zprobe_zoffset (float) From 697373b071191d4faa4a3acb44fbabfb5bd7b1af Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2016 19:08:54 -0700 Subject: [PATCH 402/580] Reduce code size of mesh_buffer_line --- Marlin/Marlin_main.cpp | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 389818c58..67d42c310 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7848,46 +7848,33 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c cy = mbl.cell_index_y(RAW_POSITION(y, Y_AXIS)); NOMORE(pcx, MESH_NUM_X_POINTS - 2); NOMORE(pcy, MESH_NUM_Y_POINTS - 2); - NOMORE(cx, MESH_NUM_X_POINTS - 2); - NOMORE(cy, MESH_NUM_Y_POINTS - 2); + NOMORE(cx, MESH_NUM_X_POINTS - 2); + NOMORE(cy, MESH_NUM_Y_POINTS - 2); + if (pcx == cx && pcy == cy) { // Start and end on same mesh square planner.buffer_line(x, y, z, e, fr_mm_s, extruder); set_current_to_destination(); return; } + float nx, ny, nz, ne, normalized_dist; - if (cx > pcx && TEST(x_splits, cx)) { - nx = mbl.get_probe_x(cx) + home_offset[X_AXIS] + position_shift[X_AXIS]; - normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]); - ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist; - nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; - ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; - CBI(x_splits, cx); - } - else if (cx < pcx && TEST(x_splits, pcx)) { - nx = mbl.get_probe_x(pcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; + int8_t gcx = max(pcx, cx), gcy = max(pcy, cy); + if (cx != pcx && TEST(x_splits, gcx)) { + nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]); ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist; nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; - CBI(x_splits, pcx); - } - else if (cy > pcy && TEST(y_splits, cy)) { - ny = mbl.get_probe_y(cy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; - normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]); - nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist; - nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; - ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; - CBI(y_splits, cy); + CBI(x_splits, gcx); } - else if (cy < pcy && TEST(y_splits, pcy)) { - ny = mbl.get_probe_y(pcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; + else if (cy != pcy && TEST(y_splits, gcy)) { + ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]); nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist; nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; - CBI(y_splits, pcy); + CBI(y_splits, gcy); } else { // Already split on a border From d0009e013bd35f16ffdaf8f8c124ce999efa0074 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2016 19:11:56 -0700 Subject: [PATCH 403/580] Rename cell index vars --- Marlin/Marlin_main.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 67d42c310..5fe4462e6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7842,16 +7842,16 @@ void clamp_to_software_endstops(float target[3]) { // This function is used to split lines on mesh borders so each segment is only part of one mesh area void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { - int pcx = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)), - pcy = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), - cx = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)), - cy = mbl.cell_index_y(RAW_POSITION(y, Y_AXIS)); - NOMORE(pcx, MESH_NUM_X_POINTS - 2); - NOMORE(pcy, MESH_NUM_Y_POINTS - 2); - NOMORE(cx, MESH_NUM_X_POINTS - 2); - NOMORE(cy, MESH_NUM_Y_POINTS - 2); - - if (pcx == cx && pcy == cy) { + int cx1 = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)), + cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), + cx2 = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)), + cy2 = mbl.cell_index_y(RAW_POSITION(y, Y_AXIS)); + NOMORE(cx1, MESH_NUM_X_POINTS - 2); + NOMORE(cy1, MESH_NUM_Y_POINTS - 2); + NOMORE(cx2, MESH_NUM_X_POINTS - 2); + NOMORE(cy2, MESH_NUM_Y_POINTS - 2); + + if (cx1 == cx2 && cy1 == cy2) { // Start and end on same mesh square planner.buffer_line(x, y, z, e, fr_mm_s, extruder); set_current_to_destination(); @@ -7859,8 +7859,8 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c } float nx, ny, nz, ne, normalized_dist; - int8_t gcx = max(pcx, cx), gcy = max(pcy, cy); - if (cx != pcx && TEST(x_splits, gcx)) { + int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); + if (cx2 != cx1 && TEST(x_splits, gcx)) { nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]); ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist; @@ -7868,7 +7868,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; CBI(x_splits, gcx); } - else if (cy != pcy && TEST(y_splits, gcy)) { + else if (cy2 != cy1 && TEST(y_splits, gcy)) { ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]); nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist; From f6a3a1da09146cd3339647ea86582f64cf4927a2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2016 19:16:12 -0700 Subject: [PATCH 404/580] nz and ne are always set, so drop them down --- Marlin/Marlin_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5fe4462e6..72bba0b44 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7864,16 +7864,12 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]); ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist; - nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; - ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; CBI(x_splits, gcx); } else if (cy2 != cy1 && TEST(y_splits, gcy)) { ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]); nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist; - nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; - ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; CBI(y_splits, gcy); } else { @@ -7882,6 +7878,10 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c set_current_to_destination(); return; } + + nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; + ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; + // Do the split and look for more borders destination[X_AXIS] = nx; destination[Y_AXIS] = ny; From 1e57a6af73866c8e05c2972e17b5a2576bfcc9c2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Jul 2016 16:30:28 -0700 Subject: [PATCH 405/580] Use blocking_move, current_position in G28 homing --- Marlin/Marlin_main.cpp | 49 ++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ad163d77d..8a8c58cee 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1594,7 +1594,7 @@ static void set_axis_is_at_home(AxisEnum axis) { /** * Some planner shorthand inline functions */ -inline void set_homing_bump_feedrate(AxisEnum axis) { +inline float set_homing_bump_feedrate(AxisEnum axis) { const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; int hbd = homing_bump_divisor[axis]; if (hbd < 1) { @@ -1603,6 +1603,7 @@ inline void set_homing_bump_feedrate(AxisEnum axis) { SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1"); } feedrate_mm_m = homing_feedrate_mm_m[axis] / hbd; + return feedrate_mm_m; } // // line_to_current_position @@ -1707,6 +1708,11 @@ static void do_blocking_move_to(float x, float y, float z, float fr_mm_m = 0.0) feedrate_mm_m = old_feedrate_mm_m; } +inline void do_blocking_move_to_axis_pos(AxisEnum axis, float where, float fr_mm_m = 0.0) { + current_position[axis] = where; + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); +} + inline void do_blocking_move_to_x(float x, float fr_mm_m = 0.0) { do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); } @@ -2419,27 +2425,19 @@ static void homeaxis(AxisEnum axis) { #endif // Move towards the endstop until an endstop is triggered - destination[axis] = 1.5 * max_length(axis) * axis_home_dir; - feedrate_mm_m = homing_feedrate_mm_m[axis]; - line_to_destination(); - stepper.synchronize(); + do_blocking_move_to_axis_pos(axis, 1.5 * max_length(axis) * axis_home_dir, homing_feedrate_mm_m[axis]); // Set the axis position as setup for the move current_position[axis] = 0; sync_plan_position(); // Move away from the endstop by the axis HOME_BUMP_MM - destination[axis] = -home_bump_mm(axis) * axis_home_dir; - line_to_destination(); - stepper.synchronize(); + do_blocking_move_to_axis_pos(axis, -home_bump_mm(axis) * axis_home_dir, homing_feedrate_mm_m[axis]); // Slow down the feedrate for the next move - set_homing_bump_feedrate(axis); // Move slowly towards the endstop until triggered - destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir; - line_to_destination(); - stepper.synchronize(); + do_blocking_move_to_axis_pos(axis, 2 * home_bump_mm(axis) * axis_home_dir, set_homing_bump_feedrate(axis)); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position); @@ -2460,10 +2458,7 @@ static void homeaxis(AxisEnum axis) { sync_plan_position(); // Move to the adjusted endstop height - feedrate_mm_m = homing_feedrate_mm_m[axis]; - destination[Z_AXIS] = adj; - line_to_destination(); - stepper.synchronize(); + do_blocking_move_to_z(adj, homing_feedrate_mm_m[axis]); if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false); stepper.set_homing_flag(false); @@ -2474,15 +2469,13 @@ static void homeaxis(AxisEnum axis) { // retrace by the amount specified in endstop_adj if (endstop_adj[axis] * axis_home_dir < 0) { sync_plan_position(); - destination[axis] = endstop_adj[axis]; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]); - DEBUG_POS("", destination); + DEBUG_POS("", current_position); } #endif - line_to_destination(); - stepper.synchronize(); + do_blocking_move_to_axis_pos(axis, endstop_adj[axis], set_homing_bump_feedrate(axis)); } #endif @@ -2836,8 +2829,6 @@ inline void gcode_G4() { static void quick_home_xy() { - current_position[X_AXIS] = current_position[Y_AXIS] = 0; - #if ENABLED(DUAL_X_CARRIAGE) int x_axis_home_dir = x_home_dir(active_extruder); extruder_duplication_enabled = false; @@ -2845,17 +2836,15 @@ inline void gcode_G4() { int x_axis_home_dir = home_dir(X_AXIS); #endif - float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), - mlratio = mlx > mly ? mly / mlx : mlx / mly; + float mlx = max_length(X_AXIS), + mly = max_length(Y_AXIS), + mlratio = mlx > mly ? mly / mlx : mlx / mly, + fr_mm_m = min(homing_feedrate_mm_m[X_AXIS], homing_feedrate_mm_m[Y_AXIS]) * sqrt(sq(mlratio) + 1); - destination[X_AXIS] = 1.5 * mlx * x_axis_home_dir; - destination[Y_AXIS] = 1.5 * mly * home_dir(Y_AXIS); - feedrate_mm_m = min(homing_feedrate_mm_m[X_AXIS], homing_feedrate_mm_m[Y_AXIS]) * sqrt(sq(mlratio) + 1); - line_to_destination(); - stepper.synchronize(); + do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_m); endstops.hit_on_purpose(); // clear endstop hit flags + current_position[X_AXIS] = current_position[Y_AXIS] = 0; - destination[X_AXIS] = destination[Y_AXIS] = 0; } #endif // QUICK_HOME From 86eb5251c55b505fc76c6dbf8eca8033129d280c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Jul 2016 17:04:32 -0700 Subject: [PATCH 406/580] Fix some debug messages --- Marlin/Marlin_main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8a8c58cee..0cadef03c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6706,7 +6706,8 @@ inline void gcode_T(uint8_t tmp_extruder) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM(">>> gcode_T"); + SERIAL_ECHOPAIR(">>> gcode_T(", tmp_extruder); + SERIAL_ECHOLNPGM(")"); DEBUG_POS("BEFORE", current_position); } #endif @@ -6935,7 +6936,7 @@ inline void gcode_T(uint8_t tmp_extruder) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("Offset Tool XY by { ", xydiff[X_AXIS]); - SERIAL_ECHOPAIR(", ", xydiff[X_AXIS]); + SERIAL_ECHOPAIR(", ", xydiff[Y_AXIS]); SERIAL_ECHOLNPGM(" }"); } #endif From 5c8e87a8665c26a85c22f46aef028667c5f66d4d Mon Sep 17 00:00:00 2001 From: esenapaj Date: Mon, 18 Jul 2016 09:48:13 +0900 Subject: [PATCH 407/580] Follow-up the PR #4163 (Mixing and Switching Extruders) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update forgotten K8400 files --- .../K8400/Configuration.h | 25 ++++++++++++++++++- .../K8400/Dual-head/Configuration.h | 25 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 316a2c078..8be33d78d 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 4024761c8..158f6add1 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -152,6 +152,30 @@ // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE +// A dual extruder that uses a single stepper motor +// Don't forget to set SSDE_SERVO_ANGLES and HOTEND_OFFSET_X/Y/Z +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 + //#define HOTEND_OFFSET_Z {0.0, 0.0} +#endif + +/** + * "Mixing Extruder" + * - Adds a new code, M165, to set the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Host M163, M164, and virtual extruder. + * - This implementation supports only a single extruder. + * - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. @@ -162,7 +186,6 @@ // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // :{1:'ATX',2:'X-Box 360'} - #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. From 04a5b7b25728b73fb869d898b84c55b34b448c45 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2016 19:20:16 -0700 Subject: [PATCH 408/580] A macro to normalize positions --- Marlin/Marlin_main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 72bba0b44..d069253c2 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7858,18 +7858,20 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c return; } + #define MBL_SEGMENT_END(axis,AXIS) (current_position[AXIS ##_AXIS] + (axis - current_position[AXIS ##_AXIS]) * normalized_dist) + float nx, ny, nz, ne, normalized_dist; int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); if (cx2 != cx1 && TEST(x_splits, gcx)) { nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]); - ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist; + ny = MBL_SEGMENT_END(y, Y); CBI(x_splits, gcx); } else if (cy2 != cy1 && TEST(y_splits, gcy)) { ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]); - nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist; + nx = MBL_SEGMENT_END(x, X); CBI(y_splits, gcy); } else { @@ -7879,8 +7881,8 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c return; } - nz = current_position[Z_AXIS] + (z - current_position[Z_AXIS]) * normalized_dist; - ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist; + nz = MBL_SEGMENT_END(z, Z); + ne = MBL_SEGMENT_END(e, E); // Do the split and look for more borders destination[X_AXIS] = nx; From 07a735ad22384a337e815bfdd2729bbf589e35b1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2016 19:28:13 -0700 Subject: [PATCH 409/580] We always use `destination` so modify mesh_buffer_line --- Marlin/Marlin_main.cpp | 47 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d069253c2..9bcedbe91 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7841,11 +7841,11 @@ void clamp_to_software_endstops(float target[3]) { #if ENABLED(MESH_BED_LEVELING) // This function is used to split lines on mesh borders so each segment is only part of one mesh area -void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { +void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { int cx1 = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)), cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), - cx2 = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)), - cy2 = mbl.cell_index_y(RAW_POSITION(y, Y_AXIS)); + cx2 = mbl.cell_index_x(RAW_POSITION(destination[X_AXIS], X_AXIS)), + cy2 = mbl.cell_index_y(RAW_POSITION(destination[Y_AXIS], Y_AXIS)); NOMORE(cx1, MESH_NUM_X_POINTS - 2); NOMORE(cy1, MESH_NUM_Y_POINTS - 2); NOMORE(cx2, MESH_NUM_X_POINTS - 2); @@ -7853,48 +7853,49 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c if (cx1 == cx2 && cy1 == cy2) { // Start and end on same mesh square - planner.buffer_line(x, y, z, e, fr_mm_s, extruder); + line_to_destination(fr_mm_m); set_current_to_destination(); return; } - #define MBL_SEGMENT_END(axis,AXIS) (current_position[AXIS ##_AXIS] + (axis - current_position[AXIS ##_AXIS]) * normalized_dist) + #define MBL_SEGMENT_END(A) (current_position[A ##_AXIS] + (destination[A ##_AXIS] - current_position[A ##_AXIS]) * normalized_dist) - float nx, ny, nz, ne, normalized_dist; + float nx, ny, normalized_dist; int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); if (cx2 != cx1 && TEST(x_splits, gcx)) { nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; - normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]); - ny = MBL_SEGMENT_END(y, Y); + normalized_dist = (nx - current_position[X_AXIS]) / (destination[X_AXIS] - current_position[X_AXIS]); + ny = MBL_SEGMENT_END(Y); CBI(x_splits, gcx); } else if (cy2 != cy1 && TEST(y_splits, gcy)) { ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; - normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]); - nx = MBL_SEGMENT_END(x, X); + normalized_dist = (ny - current_position[Y_AXIS]) / (destination[Y_AXIS] - current_position[Y_AXIS]); + nx = MBL_SEGMENT_END(X); CBI(y_splits, gcy); } else { // Already split on a border - planner.buffer_line(x, y, z, e, fr_mm_s, extruder); + line_to_destination(fr_mm_m); set_current_to_destination(); return; } - nz = MBL_SEGMENT_END(z, Z); - ne = MBL_SEGMENT_END(e, E); + // Save given destination for after recursion + float end[NUM_AXIS]; + memcpy(end, destination, sizeof(end)); - // Do the split and look for more borders destination[X_AXIS] = nx; destination[Y_AXIS] = ny; - destination[Z_AXIS] = nz; - destination[E_AXIS] = ne; - mesh_buffer_line(nx, ny, nz, ne, fr_mm_s, extruder, x_splits, y_splits); - destination[X_AXIS] = x; - destination[Y_AXIS] = y; - destination[Z_AXIS] = z; - destination[E_AXIS] = e; - mesh_buffer_line(x, y, z, e, fr_mm_s, extruder, x_splits, y_splits); + destination[Z_AXIS] = MBL_SEGMENT_END(Z); + destination[E_AXIS] = MBL_SEGMENT_END(E); + + // Do the split and look for more borders + mesh_line_to_destination(fr_mm_m, x_splits, y_splits); + + // Restore destination from stack + memcpy(destination, end, sizeof(end)); + mesh_line_to_destination(fr_mm_m, x_splits, y_splits); } #endif // MESH_BED_LEVELING @@ -7992,7 +7993,7 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c else { #if ENABLED(MESH_BED_LEVELING) if (mbl.active()) { - mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); + mesh_line_to_destination(MMM_SCALED(feedrate_mm_m)); return false; } else From 493d30cd976f0432c7d8bafda9ed36958a1706aa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Jul 2016 12:21:28 -0700 Subject: [PATCH 410/580] Drop intermediate nx, ny, and set destination directly --- Marlin/Marlin_main.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9bcedbe91..74ec068a0 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7860,18 +7860,22 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ #define MBL_SEGMENT_END(A) (current_position[A ##_AXIS] + (destination[A ##_AXIS] - current_position[A ##_AXIS]) * normalized_dist) - float nx, ny, normalized_dist; + float normalized_dist, end[NUM_AXIS]; + + // Split at the left/front border of the right/top square int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); if (cx2 != cx1 && TEST(x_splits, gcx)) { - nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; - normalized_dist = (nx - current_position[X_AXIS]) / (destination[X_AXIS] - current_position[X_AXIS]); - ny = MBL_SEGMENT_END(Y); + memcpy(end, destination, sizeof(end)); + destination[X_AXIS] = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; + normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); + destination[Y_AXIS] = MBL_SEGMENT_END(Y); CBI(x_splits, gcx); } else if (cy2 != cy1 && TEST(y_splits, gcy)) { - ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; - normalized_dist = (ny - current_position[Y_AXIS]) / (destination[Y_AXIS] - current_position[Y_AXIS]); - nx = MBL_SEGMENT_END(X); + memcpy(end, destination, sizeof(end)); + destination[Y_AXIS] = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; + normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); + destination[X_AXIS] = MBL_SEGMENT_END(X); CBI(y_splits, gcy); } else { @@ -7881,12 +7885,6 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ return; } - // Save given destination for after recursion - float end[NUM_AXIS]; - memcpy(end, destination, sizeof(end)); - - destination[X_AXIS] = nx; - destination[Y_AXIS] = ny; destination[Z_AXIS] = MBL_SEGMENT_END(Z); destination[E_AXIS] = MBL_SEGMENT_END(E); From ff48bbb86aced472280b10c8e2115670981a0b79 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Mon, 18 Jul 2016 17:00:07 +0900 Subject: [PATCH 411/580] Update Japanese translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Add new translation --- Marlin/language_kana.h | 1 + Marlin/language_kana_utf8.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 8dee6aa2f..c1244d6ac 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -100,6 +100,7 @@ #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" +#define MSG_SELECT "\xbe\xdd\xc0\xb8" // "センタク" ("Select") #if LCD_WIDTH > 19 #define MSG_ACC "\xb6\xbf\xb8\xc4\xde mm/s2" // "カソクド mm/s2" ("Accel") #define MSG_VXY_JERK "XY\xbc\xde\xb8\x20\xd4\xb8\xc4\xde mm/s" // "XYジク ヤクド mm/s" ("Vxy-jerk") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index dd2a8e5fb..f598f8aaa 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -100,6 +100,7 @@ #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" +#define MSG_SELECT "センタク" // "Select" #define MSG_ACC "カソクド mm/s2" // "Accel" #define MSG_VXY_JERK "XYジク ヤクド mm/s" // "Vxy-jerk" #define MSG_VZ_JERK "Zジク ヤクド mm/s" // "Vz-jerk" From 361307831ebaa30c63c8f6e83d657f208c73f7ab Mon Sep 17 00:00:00 2001 From: esenapaj Date: Mon, 18 Jul 2016 14:12:55 +0900 Subject: [PATCH 412/580] Follow-up the PR #4335 (Debug char, fix compile errors for lcd pins) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Solve a flickering when SD card is inserted or removed at using a ASCII LCD + language_kana.h --- Marlin/ultralcd.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index f96d74c91..f1f71b3f0 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2741,7 +2741,11 @@ void lcd_update() { void set_utf_strlen(char* s, uint8_t n) { uint8_t i = 0, j = 0; while (s[i] && (j < n)) { - if ((s[i] & 0xC0u) != 0x80u) j++; + #if ENABLED(MAPPER_NON) + j++; + #else + if ((s[i] & 0xC0u) != 0x80u) j++; + #endif i++; } while (j++ < n) s[i++] = ' '; From f4d63796b283fb893de9e36591192a45b9c20cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 02:55:23 +0100 Subject: [PATCH 413/580] Adds utility.h --- Marlin/Marlin.h | 5 ++--- Marlin/utility.h | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 Marlin/utility.h diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index a2143ca2b..25995c9f3 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -39,11 +39,12 @@ #include #include - #include "fastio.h" #include "Configuration.h" #include "pins.h" +#include "utility.h" + #ifndef SANITYCHECK_H #error "Your Configuration.h and Configuration_adv.h files are outdated!" #endif @@ -430,6 +431,4 @@ void calculate_volumetric_multipliers(); #endif #endif -void safe_delay(uint16_t del); - #endif //MARLIN_H diff --git a/Marlin/utility.h b/Marlin/utility.h new file mode 100644 index 000000000..8bb3a9b8b --- /dev/null +++ b/Marlin/utility.h @@ -0,0 +1,23 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +void safe_delay(uint16_t ms); From 79e7721b763d3ca2ee05b10afa71b47f9d697579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 03:03:11 +0100 Subject: [PATCH 414/580] Removes some minor GCC warnings --- Marlin/Marlin_main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a4fbec095..a615ea5f4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5325,7 +5325,7 @@ inline void gcode_M200() { if (volumetric_enabled) { filament_size[target_extruder] = code_value_linear_units(); // make sure all extruders have some sane value for the filament size - for (int i = 0; i < COUNT(filament_size); i++) + for (uint8_t i = 0; i < COUNT(filament_size); i++) if (! filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA; } } @@ -6825,7 +6825,7 @@ inline void gcode_T(uint8_t tmp_extruder) { // <0 if the new nozzle is higher, >0 if lower. A bigger raise when lower. float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder], z_raise = 0.3 + (z_diff > 0.0 ? z_diff : 0.0); - + // Always raise by some amount planner.buffer_line( current_position[X_AXIS], @@ -6836,10 +6836,10 @@ inline void gcode_T(uint8_t tmp_extruder) { active_extruder ); stepper.synchronize(); - + move_extruder_servo(active_extruder); delay(500); - + // Move back down, if needed if (z_raise != z_diff) { planner.buffer_line( @@ -6853,7 +6853,7 @@ inline void gcode_T(uint8_t tmp_extruder) { stepper.synchronize(); } #endif - + /** * Set current_position to the position of the new nozzle. * Offsets are based on linear distance, so we need to get @@ -6906,7 +6906,7 @@ inline void gcode_T(uint8_t tmp_extruder) { current_position[Z_AXIS] += offset_vec.z; #else // !AUTO_BED_LEVELING_FEATURE - + float xydiff[2] = { hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder] @@ -6930,7 +6930,7 @@ inline void gcode_T(uint8_t tmp_extruder) { } #endif // MESH_BED_LEVELING - + #endif // !AUTO_BED_LEVELING_FEATURE #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -6993,7 +6993,7 @@ inline void gcode_T(uint8_t tmp_extruder) { SERIAL_ECHOLNPGM("<<< gcode_T"); } #endif - + SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER); SERIAL_PROTOCOLLN((int)active_extruder); @@ -8695,6 +8695,6 @@ float calculate_volumetric_multiplier(float diameter) { } void calculate_volumetric_multipliers() { - for (int i = 0; i < COUNT(filament_size); i++) + for (uint8_t i = 0; i < COUNT(filament_size); i++) volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]); } From 8ecee431c41721420184edf503c1079ac860c34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 03:16:30 +0100 Subject: [PATCH 415/580] Updates u8glib's bmp2hex converter --- Marlin/dogm_bitmaps.h | 10 +- .../Cartesio/_Bootscreen.h | 150 +++++++++--------- .../Hephestos_2/_Bootscreen.h | 150 +++++++++--------- 3 files changed, 166 insertions(+), 144 deletions(-) diff --git a/Marlin/dogm_bitmaps.h b/Marlin/dogm_bitmaps.h index 6b6541bb3..e020d2436 100644 --- a/Marlin/dogm_bitmaps.h +++ b/Marlin/dogm_bitmaps.h @@ -21,8 +21,14 @@ */ /** - * BitMap for splashscreen - * Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php + * Standard Marlin Bitmap for splashscreen + * + * You may use one of the following tools to generate the C++ bitmap array from + * a black and white image: + * + * - http://www.marlinfw.org/tools/u8glib/converter.html + * - http://www.digole.com/tools/PicturetoC_Hex_converter.php + * * Please note that using the high-res version takes 402Bytes of PROGMEM. */ diff --git a/Marlin/example_configurations/Cartesio/_Bootscreen.h b/Marlin/example_configurations/Cartesio/_Bootscreen.h index 254fbdf06..93de4f143 100644 --- a/Marlin/example_configurations/Cartesio/_Bootscreen.h +++ b/Marlin/example_configurations/Cartesio/_Bootscreen.h @@ -19,77 +19,85 @@ * along with this program. If not, see . * */ + +/** + * Custom Bitmap for splashscreen + * + * You may use one of the following tools to generate the C++ bitmap array from + * a black and white image: + * + * - http://www.marlinfw.org/tools/u8glib/converter.html + * - http://www.digole.com/tools/PicturetoC_Hex_converter.php + */ #include -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #define CUSTOM_BOOTSCREEN_BMPWIDTH 63 - #define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 +#define CUSTOM_BOOTSCREEN_TIMEOUT 2500 +#define CUSTOM_BOOTSCREEN_BMPWIDTH 63 +#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 - const unsigned char 81x0i84fkcmoqbu7vte29[512] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, - 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, - 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x0f, 0x07, 0x87, 0xff, 0xff, 0xe0, 0x00, - 0x00, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x00, - 0x01, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80, - 0x03, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80, - 0x07, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xc0, - 0x07, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0, - 0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0, - 0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0, - 0x1f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0, - 0x1f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf0, - 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, - 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, - 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, - 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf8, - 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, - 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, - 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, - 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, - 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, - 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, - 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, - 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, - 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, - 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, - 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, - 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, - 0x3f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, - 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, - 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, - 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, - 0x1f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0, - 0x1f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0, - 0x1f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0, - 0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0, - 0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xc0, - 0x07, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xc0, - 0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x80, - 0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x00, - 0x01, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00, - 0x00, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00, - 0x00, 0x0f, 0xff, 0xff, 0xc3, 0xc1, 0xe0, 0x00, - 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, - 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, - 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00, - 0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; -#endif +const unsigned char 81x0i84fkcmoqbu7vte29[512] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, + 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x0f, 0x07, 0x87, 0xff, 0xff, 0xe0, 0x00, + 0x00, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x00, + 0x01, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80, + 0x03, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80, + 0x07, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xc0, + 0x07, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0, + 0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0, + 0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0, + 0x1f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0, + 0x1f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf0, + 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, + 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, + 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8, + 0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf8, + 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, + 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, + 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, + 0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, + 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, + 0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc, + 0x3f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, + 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, + 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, + 0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8, + 0x1f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0, + 0x1f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0, + 0x1f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0, + 0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0, + 0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xc0, + 0x07, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xc0, + 0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x80, + 0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x00, + 0x01, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00, + 0x00, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00, + 0x00, 0x0f, 0xff, 0xff, 0xc3, 0xc1, 0xe0, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, + 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, + 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, + 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/Marlin/example_configurations/Hephestos_2/_Bootscreen.h b/Marlin/example_configurations/Hephestos_2/_Bootscreen.h index 7e7f8f4c4..981926422 100644 --- a/Marlin/example_configurations/Hephestos_2/_Bootscreen.h +++ b/Marlin/example_configurations/Hephestos_2/_Bootscreen.h @@ -19,77 +19,85 @@ * along with this program. If not, see . * */ + +/** + * Custom Bitmap for splashscreen + * + * You may use one of the following tools to generate the C++ bitmap array from + * a black and white image: + * + * - http://www.marlinfw.org/tools/u8glib/converter.html + * - http://www.digole.com/tools/PicturetoC_Hex_converter.php + */ #include -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #define CUSTOM_BOOTSCREEN_BMPWIDTH 62 - #define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 +#define CUSTOM_BOOTSCREEN_TIMEOUT 2500 +#define CUSTOM_BOOTSCREEN_BMPWIDTH 62 +#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 - const unsigned char custom_start_bmp[512] PROGMEM = { - 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x03, 0xc0, 0x0f, 0xf0, 0x07, 0x80, 0x00, - 0x00, 0x07, 0xe0, 0x07, 0xe0, 0x0f, 0xc0, 0x00, - 0x00, 0x0f, 0xf0, 0x03, 0xc0, 0x1f, 0xe0, 0x00, - 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, - 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, - 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, - 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, - 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, - 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x1f, 0xe0, 0x00, - 0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x00, - 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, - 0x3f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, - 0x7f, 0x80, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, - 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, - 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, - 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, - 0xff, 0xc0, 0x00, 0x00, 0xf7, 0xc0, 0x1f, 0x80, - 0xff, 0xc0, 0x00, 0x00, 0xff, 0xf0, 0x7f, 0xc0, - 0x7f, 0x80, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xe0, - 0x3f, 0x00, 0x00, 0x00, 0xfc, 0xf8, 0xf0, 0xf8, - 0x1e, 0x00, 0x00, 0x00, 0xf8, 0x7d, 0xe0, 0x78, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, - 0x00, 0x00, 0x00, 0x00, 0xf8, 0x79, 0xf0, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x7f, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x3f, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x0e, 0x78, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, - }; -#endif +const unsigned char custom_start_bmp[512] PROGMEM = { + 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xc0, 0x0f, 0xf0, 0x07, 0x80, 0x00, + 0x00, 0x07, 0xe0, 0x07, 0xe0, 0x0f, 0xc0, 0x00, + 0x00, 0x0f, 0xf0, 0x03, 0xc0, 0x1f, 0xe0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00, + 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x1f, 0xe0, 0x00, + 0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x00, + 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x3f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x7f, 0x80, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xff, 0xc0, 0x00, 0x00, 0xf7, 0xc0, 0x1f, 0x80, + 0xff, 0xc0, 0x00, 0x00, 0xff, 0xf0, 0x7f, 0xc0, + 0x7f, 0x80, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xe0, + 0x3f, 0x00, 0x00, 0x00, 0xfc, 0xf8, 0xf0, 0xf8, + 0x1e, 0x00, 0x00, 0x00, 0xf8, 0x7d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x79, 0xf0, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x7f, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x3f, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x0e, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, +}; From 30ac0782a9a55546a3b44e7c51b2bfc7f7b4b8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 03:27:42 +0100 Subject: [PATCH 416/580] Comment section style correction --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a615ea5f4..653d2273d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4427,7 +4427,7 @@ inline void gcode_M76() { print_job_timer.pause(); } inline void gcode_M77() { print_job_timer.stop(); } #if ENABLED(PRINTCOUNTER) - /*+ + /** * M78: Show print statistics */ inline void gcode_M78() { From 238fefcb006bb866687b1adb2d93bce12fa595eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 14:30:44 +0100 Subject: [PATCH 417/580] Updates Stopwatch class to use internal state enum --- Marlin/stopwatch.cpp | 12 ++++++------ Marlin/stopwatch.h | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/stopwatch.cpp b/Marlin/stopwatch.cpp index 042dbfc08..ef701a11b 100644 --- a/Marlin/stopwatch.cpp +++ b/Marlin/stopwatch.cpp @@ -33,7 +33,7 @@ bool Stopwatch::stop() { #endif if (this->isRunning() || this->isPaused()) { - this->state = STOPWATCH_STOPPED; + this->state = STOPPED; this->stopTimestamp = millis(); return true; } @@ -46,7 +46,7 @@ bool Stopwatch::pause() { #endif if (this->isRunning()) { - this->state = STOPWATCH_PAUSED; + this->state = PAUSED; this->stopTimestamp = millis(); return true; } @@ -62,7 +62,7 @@ bool Stopwatch::start() { if (this->isPaused()) this->accumulator = this->duration(); else this->reset(); - this->state = STOPWATCH_RUNNING; + this->state = RUNNING; this->startTimestamp = millis(); return true; } @@ -74,18 +74,18 @@ void Stopwatch::reset() { Stopwatch::debug(PSTR("reset")); #endif - this->state = STOPWATCH_STOPPED; + this->state = STOPPED; this->startTimestamp = 0; this->stopTimestamp = 0; this->accumulator = 0; } bool Stopwatch::isRunning() { - return (this->state == STOPWATCH_RUNNING) ? true : false; + return (this->state == RUNNING) ? true : false; } bool Stopwatch::isPaused() { - return (this->state == STOPWATCH_PAUSED) ? true : false; + return (this->state == PAUSED) ? true : false; } millis_t Stopwatch::duration() { diff --git a/Marlin/stopwatch.h b/Marlin/stopwatch.h index 173b5efb4..709482884 100644 --- a/Marlin/stopwatch.h +++ b/Marlin/stopwatch.h @@ -28,12 +28,6 @@ // Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM) //#define DEBUG_STOPWATCH -enum StopwatchState { - STOPWATCH_STOPPED, - STOPWATCH_RUNNING, - STOPWATCH_PAUSED -}; - /** * @brief Stopwatch class * @details This class acts as a timer proving stopwatch functionality including @@ -41,7 +35,13 @@ enum StopwatchState { */ class Stopwatch { private: - StopwatchState state; + enum State { + STOPPED, + RUNNING, + PAUSED + }; + + Stopwatch::State state; millis_t accumulator; millis_t startTimestamp; millis_t stopTimestamp; From 3ebad4e020a4f49f422a41d5504aafc8b0fac772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 14:31:09 +0100 Subject: [PATCH 418/580] Moves all global enums to a central file --- Marlin/Marlin.h | 31 +----- Marlin/MarlinSerial.cpp | 15 --- Marlin/Marlin_main.cpp | 28 ++---- Marlin/cardreader.h | 2 +- Marlin/endstops.h | 4 +- Marlin/enum.h | 190 +++++++++++++++++++++++++++++++++++++ Marlin/mesh_bed_leveling.h | 3 - Marlin/temperature.cpp | 19 ---- Marlin/ultralcd.cpp | 16 +--- Marlin/ultralcd.h | 10 -- 10 files changed, 206 insertions(+), 112 deletions(-) create mode 100644 Marlin/enum.h diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index a2143ca2b..c2c277ad9 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -50,6 +50,8 @@ #include "Arduino.h" +#include "enum.h" + typedef unsigned long millis_t; #ifdef USBCON @@ -230,20 +232,8 @@ void manage_inactivity(bool ignore_stepper_queue = false); * The axis order in all axis related arrays is X, Y, Z, E */ #define NUM_AXIS 4 - -/** - * Axis indices as enumerated constants - * - * A_AXIS and B_AXIS are used by COREXY printers - * X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots. - */ -enum AxisEnum {NO_AXIS = -1, X_AXIS = 0, A_AXIS = 0, Y_AXIS = 1, B_AXIS = 1, Z_AXIS = 2, C_AXIS = 2, E_AXIS = 3, X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 5}; - #define _AXIS(AXIS) AXIS ##_AXIS -typedef enum { LINEARUNIT_MM = 0, LINEARUNIT_INCH = 1 } LinearUnit; -typedef enum { TEMPUNIT_C = 0, TEMPUNIT_K = 1, TEMPUNIT_F = 2 } TempUnit; - void enable_all_steppers(); void disable_all_steppers(); @@ -259,18 +249,6 @@ void quickstop_stepper(); void handle_filament_runout(); #endif -/** - * Debug flags - not yet widely applied - */ -enum DebugFlags { - DEBUG_NONE = 0, - DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed - DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output - DEBUG_ERRORS = _BV(2), ///< Not implemented - DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands - DEBUG_COMMUNICATION = _BV(4), ///< Not implemented - DEBUG_LEVELING = _BV(5) ///< Print detailed output for homing and leveling -}; extern uint8_t marlin_debug_flags; #define DEBUGGING(F) (marlin_debug_flags & (DEBUG_## F)) @@ -380,11 +358,6 @@ float code_value_temp_diff(); #endif #if ENABLED(FILAMENT_CHANGE_FEATURE) - enum FilamentChangeMenuResponse { - FILAMENT_CHANGE_RESPONSE_WAIT_FOR, - FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE, - FILAMENT_CHANGE_RESPONSE_RESUME_PRINT - }; extern FilamentChangeMenuResponse filament_change_menu_response; #endif diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index d0921f470..d2f5623cb 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -455,21 +455,6 @@ MarlinSerial customizedSerial; FORCE_INLINE void emergency_parser(unsigned char c) { - enum e_parser_state { - state_RESET, - state_N, - state_M, - state_M1, - state_M10, - state_M108, - state_M11, - state_M112, - state_M4, - state_M41, - state_M410, - state_IGNORE // to '\n' - }; - static e_parser_state state = state_RESET; switch (state) { diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a4fbec095..df17ca6e6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -535,17 +535,6 @@ static bool send_ok[BUFSIZE]; #endif #if ENABLED(HOST_KEEPALIVE_FEATURE) - - // States for managing Marlin and host communication - // Marlin sends messages if blocked or busy - enum MarlinBusyState { - NOT_BUSY, // Not in a handler - IN_HANDLER, // Processing a GCode - IN_PROCESS, // Known to be blocking command input (as in G29) - PAUSED_FOR_USER, // Blocking pending any input - PAUSED_FOR_INPUT // Blocking pending text input (concept) - }; - static MarlinBusyState busy_state = NOT_BUSY; static millis_t next_busy_signal_ms = 0; uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL; @@ -3213,9 +3202,6 @@ inline void gcode_G28() { #endif #if ENABLED(MESH_BED_LEVELING) - - enum MeshLevelingState { MeshReport, MeshStart, MeshNext, MeshSet, MeshSetZOffset, MeshReset }; - inline void _mbl_goto_xy(float x, float y) { float old_feedrate_mm_m = feedrate_mm_m; feedrate_mm_m = homing_feedrate_mm_m[X_AXIS]; @@ -6825,7 +6811,7 @@ inline void gcode_T(uint8_t tmp_extruder) { // <0 if the new nozzle is higher, >0 if lower. A bigger raise when lower. float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder], z_raise = 0.3 + (z_diff > 0.0 ? z_diff : 0.0); - + // Always raise by some amount planner.buffer_line( current_position[X_AXIS], @@ -6836,10 +6822,10 @@ inline void gcode_T(uint8_t tmp_extruder) { active_extruder ); stepper.synchronize(); - + move_extruder_servo(active_extruder); delay(500); - + // Move back down, if needed if (z_raise != z_diff) { planner.buffer_line( @@ -6853,7 +6839,7 @@ inline void gcode_T(uint8_t tmp_extruder) { stepper.synchronize(); } #endif - + /** * Set current_position to the position of the new nozzle. * Offsets are based on linear distance, so we need to get @@ -6906,7 +6892,7 @@ inline void gcode_T(uint8_t tmp_extruder) { current_position[Z_AXIS] += offset_vec.z; #else // !AUTO_BED_LEVELING_FEATURE - + float xydiff[2] = { hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder], hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder] @@ -6930,7 +6916,7 @@ inline void gcode_T(uint8_t tmp_extruder) { } #endif // MESH_BED_LEVELING - + #endif // !AUTO_BED_LEVELING_FEATURE #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -6993,7 +6979,7 @@ inline void gcode_T(uint8_t tmp_extruder) { SERIAL_ECHOLNPGM("<<< gcode_T"); } #endif - + SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER); SERIAL_PROTOCOLLN((int)active_extruder); diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h index 78280fc8d..31b82386c 100644 --- a/Marlin/cardreader.h +++ b/Marlin/cardreader.h @@ -28,7 +28,7 @@ #define MAX_DIR_DEPTH 10 // Maximum folder depth #include "SdFile.h" -enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename }; +#include "enum.h" class CardReader { public: diff --git a/Marlin/endstops.h b/Marlin/endstops.h index e5d541cf1..22c2468b8 100644 --- a/Marlin/endstops.h +++ b/Marlin/endstops.h @@ -27,7 +27,7 @@ #ifndef ENDSTOPS_H #define ENDSTOPS_H -enum EndstopEnum {X_MIN = 0, Y_MIN = 1, Z_MIN = 2, Z_MIN_PROBE = 3, X_MAX = 4, Y_MAX = 5, Z_MAX = 6, Z2_MIN = 7, Z2_MAX = 8}; +#include "enum.h" class Endstops { @@ -42,7 +42,7 @@ class Endstops { static byte #endif current_endstop_bits, old_endstop_bits; - + Endstops() {}; /** diff --git a/Marlin/enum.h b/Marlin/enum.h new file mode 100644 index 000000000..fe369c23f --- /dev/null +++ b/Marlin/enum.h @@ -0,0 +1,190 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef __ENUM_H__ +#define __ENUM_H__ + +/** + * Axis indices as enumerated constants + * + * Special axis: + * - A_AXIS and B_AXIS are used by COREXY printers + * - X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship + * between X_AXIS and X Head movement, like CoreXY bots + */ +enum AxisEnum { + NO_AXIS = -1, + X_AXIS = 0, + A_AXIS = 0, + Y_AXIS = 1, + B_AXIS = 1, + Z_AXIS = 2, + C_AXIS = 2, + E_AXIS = 3, + X_HEAD = 4, + Y_HEAD = 5, + Z_HEAD = 5 +}; + +typedef enum { + LINEARUNIT_MM, + LINEARUNIT_INCH +} LinearUnit; + +typedef enum { + TEMPUNIT_C, + TEMPUNIT_K, + TEMPUNIT_F +} TempUnit; + +/** + * Debug flags + * Not yet widely applied + */ +enum DebugFlags { + DEBUG_NONE = 0, + DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed + DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output + DEBUG_ERRORS = _BV(2), ///< Not implemented + DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands + DEBUG_COMMUNICATION = _BV(4), ///< Not implemented + DEBUG_LEVELING = _BV(5) ///< Print detailed output for homing and leveling +}; + +enum EndstopEnum { + X_MIN, + Y_MIN, + Z_MIN, + Z_MIN_PROBE, + X_MAX, + Y_MAX, + Z_MAX, + Z2_MIN, + Z2_MAX +}; + +/** + * Temperature + * Stages in the ISR loop + */ +enum TempState { + PrepareTemp_0, + MeasureTemp_0, + PrepareTemp_BED, + MeasureTemp_BED, + PrepareTemp_1, + MeasureTemp_1, + PrepareTemp_2, + MeasureTemp_2, + PrepareTemp_3, + MeasureTemp_3, + Prepare_FILWIDTH, + Measure_FILWIDTH, + StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle +}; + +#if ENABLED(EMERGENCY_PARSER) + enum e_parser_state { + state_RESET, + state_N, + state_M, + state_M1, + state_M10, + state_M108, + state_M11, + state_M112, + state_M4, + state_M41, + state_M410, + state_IGNORE // to '\n' + }; +#endif + +#if ENABLED(FILAMENT_CHANGE_FEATURE) + enum FilamentChangeMenuResponse { + FILAMENT_CHANGE_RESPONSE_WAIT_FOR, + FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE, + FILAMENT_CHANGE_RESPONSE_RESUME_PRINT + }; + + #if ENABLED(ULTIPANEL) + enum FilamentChangeMessage { + FILAMENT_CHANGE_MESSAGE_INIT, + FILAMENT_CHANGE_MESSAGE_UNLOAD, + FILAMENT_CHANGE_MESSAGE_INSERT, + FILAMENT_CHANGE_MESSAGE_LOAD, + FILAMENT_CHANGE_MESSAGE_EXTRUDE, + FILAMENT_CHANGE_MESSAGE_OPTION, + FILAMENT_CHANGE_MESSAGE_RESUME, + FILAMENT_CHANGE_MESSAGE_STATUS + }; + #endif +#endif + +/** + * States for managing Marlin and host communication + * Marlin sends messages if blocked or busy + */ +#if ENABLED(HOST_KEEPALIVE_FEATURE) + enum MarlinBusyState { + NOT_BUSY, // Not in a handler + IN_HANDLER, // Processing a GCode + IN_PROCESS, // Known to be blocking command input (as in G29) + PAUSED_FOR_USER, // Blocking pending any input + PAUSED_FOR_INPUT // Blocking pending text input (concept) + }; +#endif + +#if ENABLED(MESH_BED_LEVELING) + enum MeshLevelingState { + MeshReport, + MeshStart, + MeshNext, + MeshSet, + MeshSetZOffset, + MeshReset + }; + + enum MBLStatus { + MBL_STATUS_NONE = 0, + MBL_STATUS_HAS_MESH_BIT = 0, + MBL_STATUS_ACTIVE_BIT = 1 + }; +#endif + +/** + * SD Card + */ +enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename }; + +/** + * Ultra LCD + */ +enum LCDViewAction { + LCDVIEW_NONE, + LCDVIEW_REDRAW_NOW, + LCDVIEW_CALL_REDRAW_NEXT, + LCDVIEW_CLEAR_CALL_REDRAW, + LCDVIEW_CALL_NO_REDRAW +}; + +#endif // __ENUM_H__ diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h index 3aa2e4ace..eb668e1c8 100644 --- a/Marlin/mesh_bed_leveling.h +++ b/Marlin/mesh_bed_leveling.h @@ -23,9 +23,6 @@ #include "Marlin.h" #if ENABLED(MESH_BED_LEVELING) - - enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_ACTIVE_BIT = 1 }; - #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X))/(MESH_NUM_X_POINTS - 1)) #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y))/(MESH_NUM_Y_POINTS - 1)) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index beb4f63e6..db2805285 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1342,25 +1342,6 @@ void Temperature::disable_all_heaters() { #endif //HEATER_0_USES_MAX6675 -/** - * Stages in the ISR loop - */ -enum TempState { - PrepareTemp_0, - MeasureTemp_0, - PrepareTemp_BED, - MeasureTemp_BED, - PrepareTemp_1, - MeasureTemp_1, - PrepareTemp_2, - MeasureTemp_2, - PrepareTemp_3, - MeasureTemp_3, - Prepare_FILWIDTH, - Measure_FILWIDTH, - StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle -}; - /** * Get raw temperatures */ diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index f96d74c91..fbb50c362 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -54,14 +54,6 @@ static void lcd_status_screen(); millis_t next_lcd_update_ms; -enum LCDViewAction { - LCDVIEW_NONE, - LCDVIEW_REDRAW_NOW, - LCDVIEW_CALL_REDRAW_NEXT, - LCDVIEW_CLEAR_CALL_REDRAW, - LCDVIEW_CALL_NO_REDRAW -}; - uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) #if ENABLED(ULTIPANEL) @@ -133,7 +125,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to static void lcd_filament_change_load_message(); static void lcd_filament_change_extrude_message(); static void lcd_filament_change_resume_message(); - #endif + #endif #if HAS_LCD_CONTRAST static void lcd_set_contrast(); @@ -301,7 +293,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to * Scroll as-needed to keep the selected line in view. * * At this point _thisItemNr equals the total number of items. - * + * */ // Simple-scroll by using encoderLine as encoderTopLine @@ -2207,7 +2199,7 @@ void kill_screen(const char* lcd_msg) { #endif END_SCREEN(); } - + void lcd_filament_change_show_message(FilamentChangeMessage message) { switch (message) { case FILAMENT_CHANGE_MESSAGE_INIT: @@ -2507,7 +2499,7 @@ int lcd_strlen_P(const char* s) { int j = 0; while (pgm_read_byte(s)) { #ifdef MAPPER_NON - j++; + j++; #else if ((pgm_read_byte(s) & 0xc0) != 0x80) j++; #endif diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 7a0080698..ccb6f504d 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -73,16 +73,6 @@ void lcd_ignore_click(bool b=true); #if ENABLED(FILAMENT_CHANGE_FEATURE) - enum FilamentChangeMessage { - FILAMENT_CHANGE_MESSAGE_INIT, - FILAMENT_CHANGE_MESSAGE_UNLOAD, - FILAMENT_CHANGE_MESSAGE_INSERT, - FILAMENT_CHANGE_MESSAGE_LOAD, - FILAMENT_CHANGE_MESSAGE_EXTRUDE, - FILAMENT_CHANGE_MESSAGE_OPTION, - FILAMENT_CHANGE_MESSAGE_RESUME, - FILAMENT_CHANGE_MESSAGE_STATUS - }; void lcd_filament_change_show_message(FilamentChangeMessage message); #endif // FILAMENT_CHANGE_FEATURE From 11c075c6b2a2d78ce63ed63357519f8e3ee695a1 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 19 Jul 2016 17:24:44 +0200 Subject: [PATCH 419/580] Introduce line_to_axis_pos(axis_codes axis, float where, float feed_rate = 0.0) and use it in `homeaxis()` instead of `do_blocking_move_to_axis_pos()`. `do_blocking_move_to_axis_pos` was wrong because it performed subdivided, delta-corrected moves for x- and y-axis. The first common move for delta homing is like quick_home but for 3 towers. Fix two warnings. --- Marlin/Marlin_main.cpp | 81 +++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a4fbec095..701a20394 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1613,9 +1613,20 @@ inline float set_homing_bump_feedrate(AxisEnum axis) { inline void line_to_current_position() { planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder); } + inline void line_to_z(float zPosition) { planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder); } + +inline void line_to_axis_pos(AxisEnum axis, float where, float fr_mm_m = 0.0) { + float old_feedrate_mm_m = feedrate_mm_m; + current_position[axis] = where; + feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[axis]; + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder); + stepper.synchronize(); // The lost one + feedrate_mm_m = old_feedrate_mm_m; +} + // // line_to_destination // Move the planner, not necessarily synced with current_position @@ -1708,11 +1719,6 @@ static void do_blocking_move_to(float x, float y, float z, float fr_mm_m = 0.0) feedrate_mm_m = old_feedrate_mm_m; } -inline void do_blocking_move_to_axis_pos(AxisEnum axis, float where, float fr_mm_m = 0.0) { - current_position[axis] = where; - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); -} - inline void do_blocking_move_to_x(float x, float fr_mm_m = 0.0) { do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); } @@ -2425,19 +2431,17 @@ static void homeaxis(AxisEnum axis) { #endif // Move towards the endstop until an endstop is triggered - do_blocking_move_to_axis_pos(axis, 1.5 * max_length(axis) * axis_home_dir, homing_feedrate_mm_m[axis]); + line_to_axis_pos(axis, 1.5 * max_length(axis) * axis_home_dir); // Set the axis position as setup for the move current_position[axis] = 0; sync_plan_position(); // Move away from the endstop by the axis HOME_BUMP_MM - do_blocking_move_to_axis_pos(axis, -home_bump_mm(axis) * axis_home_dir, homing_feedrate_mm_m[axis]); - - // Slow down the feedrate for the next move + line_to_axis_pos(axis, -home_bump_mm(axis) * axis_home_dir); // Move slowly towards the endstop until triggered - do_blocking_move_to_axis_pos(axis, 2 * home_bump_mm(axis) * axis_home_dir, set_homing_bump_feedrate(axis)); + line_to_axis_pos(axis, 2 * home_bump_mm(axis) * axis_home_dir, set_homing_bump_feedrate(axis)); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position); @@ -2458,7 +2462,7 @@ static void homeaxis(AxisEnum axis) { sync_plan_position(); // Move to the adjusted endstop height - do_blocking_move_to_z(adj, homing_feedrate_mm_m[axis]); + line_to_axis_pos(axis, adj); if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false); stepper.set_homing_flag(false); @@ -2475,7 +2479,7 @@ static void homeaxis(AxisEnum axis) { DEBUG_POS("", current_position); } #endif - do_blocking_move_to_axis_pos(axis, endstop_adj[axis], set_homing_bump_feedrate(axis)); + line_to_axis_pos(axis, endstop_adj[axis]); } #endif @@ -2825,10 +2829,28 @@ inline void gcode_G4() { } #endif +#if ENABLED(NOZZLE_PARK_FEATURE) + #include "nozzle.h" + + /** + * G27: Park the nozzle + */ + inline void gcode_G27() { + // Don't allow nozzle parking without homing first + if (axis_unhomed_error(true, true, true)) { return; } + uint8_t const z_action = code_seen('P') ? code_value_ushort() : 0; + Nozzle::park(z_action); + } +#endif // NOZZLE_PARK_FEATURE + #if ENABLED(QUICK_HOME) static void quick_home_xy() { + // Pretend the current position is 0,0 + current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; + sync_plan_position(); + #if ENABLED(DUAL_X_CARRIAGE) int x_axis_home_dir = x_home_dir(active_extruder); extruder_duplication_enabled = false; @@ -2839,30 +2861,16 @@ inline void gcode_G4() { float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), mlratio = mlx > mly ? mly / mlx : mlx / mly, - fr_mm_m = min(homing_feedrate_mm_m[X_AXIS], homing_feedrate_mm_m[Y_AXIS]) * sqrt(sq(mlratio) + 1); + fr_mm_m = min(homing_feedrate_mm_m[X_AXIS], homing_feedrate_mm_m[Y_AXIS]) * sqrt(sq(mlratio) + 1.0); do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_m); endstops.hit_on_purpose(); // clear endstop hit flags - current_position[X_AXIS] = current_position[Y_AXIS] = 0; + current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; } #endif // QUICK_HOME -#if ENABLED(NOZZLE_PARK_FEATURE) - #include "nozzle.h" - - /** - * G27: Park the nozzle - */ - inline void gcode_G27() { - // Don't allow nozzle parking without homing first - if (axis_unhomed_error(true, true, true)) { return; } - uint8_t const z_action = code_seen('P') ? code_value_ushort() : 0; - Nozzle::park(z_action); - } -#endif // NOZZLE_PARK_FEATURE - /** * G28: Home all axes according to settings * @@ -2931,20 +2939,19 @@ inline void gcode_G28() { */ // Pretend the current position is 0,0,0 - for (int i = X_AXIS; i <= Z_AXIS; i++) current_position[i] = 0; + // This is like quick_home_xy() but for 3 towers. + current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = 0.0; sync_plan_position(); // Move all carriages up together until the first endstop is hit. - for (int i = X_AXIS; i <= Z_AXIS; i++) destination[i] = 3 * (Z_MAX_LENGTH); + current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = 3.0 * (Z_MAX_LENGTH); feedrate_mm_m = 1.732 * homing_feedrate_mm_m[X_AXIS]; - line_to_destination(); + line_to_current_position(); stepper.synchronize(); endstops.hit_on_purpose(); // clear endstop hit flags + current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = 0.0; - // Destination reached - for (int i = X_AXIS; i <= Z_AXIS; i++) current_position[i] = destination[i]; - - // take care of back off and rehome now we are all at the top + // take care of back off and rehome. Now one carriage is at the top. HOMEAXIS(X); HOMEAXIS(Y); HOMEAXIS(Z); @@ -5325,7 +5332,7 @@ inline void gcode_M200() { if (volumetric_enabled) { filament_size[target_extruder] = code_value_linear_units(); // make sure all extruders have some sane value for the filament size - for (int i = 0; i < COUNT(filament_size); i++) + for (uint8_t i = 0; i < COUNT(filament_size); i++) if (! filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA; } } @@ -8695,6 +8702,6 @@ float calculate_volumetric_multiplier(float diameter) { } void calculate_volumetric_multipliers() { - for (int i = 0; i < COUNT(filament_size); i++) + for (uint8_t i = 0; i < COUNT(filament_size); i++) volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]); } From 5cdd6f02ec733d25d3ebdd67a388876640729974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 01:45:13 +0100 Subject: [PATCH 420/580] Update travis config not to send email notifications --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8d6f5fc46..245ff15a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ --- language: c # +notifications: + email: false + # before_install: # # Fetch the tag information for the current branch From 47fef80848ad6ccda97a2732da1161cde3902f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 01:56:14 +0100 Subject: [PATCH 421/580] Nozzle::clean() no longer requires HAS_BED_PROBE --- Marlin/Configuration.h | 10 +++++----- Marlin/Marlin.h | 10 ++++++++++ Marlin/Marlin_main.cpp | 34 ++++++++++++---------------------- Marlin/SanityCheck.h | 7 ------- Marlin/nozzle.h | 24 ++++++++++++------------ 5 files changed, 39 insertions(+), 46 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index aa5c3be87..8947af157 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -894,12 +894,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 3b4cf8342..3ad5512f2 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -404,4 +404,14 @@ void calculate_volumetric_multipliers(); #endif #endif +/** + * Blocking movement and shorthand functions + */ +static void do_blocking_move_to(float x, float y, float z, float fr_mm_m=0.0); +static void do_blocking_move_to_axis_pos(AxisEnum axis, float where, float fr_mm_m=0.0); +static void do_blocking_move_to_x(float x, float fr_mm_m=0.0); +static void do_blocking_move_to_y(float y); +static void do_blocking_move_to_z(float z, float fr_mm_m=0.0); +static void do_blocking_move_to_xy(float x, float y, float fr_mm_m=0.0); + #endif //MARLIN_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1e324dff2..d6f3077aa 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -59,6 +59,7 @@ #include "language.h" #include "pins_arduino.h" #include "math.h" +#include "nozzle.h" #if ENABLED(USE_WATCHDOG) #include "watchdog.h" @@ -1660,7 +1661,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, * Plan a move to (X, Y, Z) and set the current_position * The final current_position may not be the one that was requested */ -static void do_blocking_move_to(float x, float y, float z, float fr_mm_m = 0.0) { +void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { float old_feedrate_mm_m = feedrate_mm_m; #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1708,21 +1709,14 @@ static void do_blocking_move_to(float x, float y, float z, float fr_mm_m = 0.0) feedrate_mm_m = old_feedrate_mm_m; } -inline void do_blocking_move_to_x(float x, float fr_mm_m = 0.0) { - do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); -} - -inline void do_blocking_move_to_y(float y) { - do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]); -} - -inline void do_blocking_move_to_xy(float x, float y, float fr_mm_m = 0.0) { - do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_m); -} - -inline void do_blocking_move_to_z(float z, float fr_mm_m = 0.0) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_m); +void do_blocking_move_to_axis_pos(AxisEnum axis, float where, float fr_mm_m/*=0.0*/) { + current_position[axis] = where; + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); } +void do_blocking_move_to_x(float x, float fr_mm_m/*=0.0*/) { do_blocking_move_to_axis_pos(X_AXIS, x, fr_mm_m); } +void do_blocking_move_to_y(float y) { do_blocking_move_to_axis_pos(Y_AXIS, y); } +void do_blocking_move_to_z(float z, float fr_mm_m/*=0.0*/) { do_blocking_move_to_axis_pos(Z_AXIS, z, fr_mm_m); } +void do_blocking_move_to_xy(float x, float y, float fr_mm_m/*=0.0*/) { do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_m); } // // Prepare to do endstop or probe moves @@ -2784,9 +2778,7 @@ inline void gcode_G4() { #endif //FWRETRACT -#if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE - #include "nozzle.h" - +#if ENABLED(NOZZLE_CLEAN_FEATURE) /** * G12: Clean the nozzle */ @@ -2819,8 +2811,6 @@ inline void gcode_G4() { #endif #if ENABLED(NOZZLE_PARK_FEATURE) - #include "nozzle.h" - /** * G27: Park the nozzle */ @@ -3301,7 +3291,7 @@ inline void gcode_G28() { } // For each G29 S2... if (probe_point == 0) { - // For the intial G29 S2 make Z a positive value (e.g., 4.0) + // For the initial G29 S2 make Z a positive value (e.g., 4.0) current_position[Z_AXIS] = MESH_HOME_SEARCH_Z #if Z_HOME_DIR > 0 + Z_MAX_POS @@ -7084,7 +7074,7 @@ void process_next_command() { break; #endif // FWRETRACT - #if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE + #if ENABLED(NOZZLE_CLEAN_FEATURE) case 12: gcode_G12(); // G12: Nozzle Clean break; diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index a8f238810..bd5f96208 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -684,11 +684,4 @@ #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." #endif -/** - * Nozzle cleaning - */ -#if ENABLED(NOZZLE_CLEAN_FEATURE) && !HAS_BED_PROBE - #error Due to internal dependencies you must have a bed probe for NOZZLE_CLEAN_FEATURE to work -#endif - #endif //SANITYCHECK_H diff --git a/Marlin/nozzle.h b/Marlin/nozzle.h index 3e9ae879c..cce22db41 100644 --- a/Marlin/nozzle.h +++ b/Marlin/nozzle.h @@ -48,7 +48,7 @@ class Nozzle { ) __attribute__((optimize ("Os"))) { #if ENABLED(NOZZLE_CLEAN_FEATURE) - #if ENABLED(NOZZLE_CLEAN_PARK) + #if ENABLED(NOZZLE_CLEAN_GOBACK) // Store the current coords point_t const initial = { current_position[X_AXIS], @@ -56,7 +56,7 @@ class Nozzle { current_position[Z_AXIS], current_position[E_AXIS] }; - #endif // NOZZLE_CLEAN_PARK + #endif // NOZZLE_CLEAN_GOBACK // Move to the starting point do_blocking_move_to_xy(start.x, start.y); @@ -68,11 +68,11 @@ class Nozzle { do_blocking_move_to_xy(start.x, start.y); } - #if ENABLED(NOZZLE_CLEAN_PARK) + #if ENABLED(NOZZLE_CLEAN_GOBACK) // Move the nozzle to the initial point do_blocking_move_to_z(initial.z); do_blocking_move_to_xy(initial.x, initial.y); - #endif // NOZZLE_CLEAN_PARK + #endif // NOZZLE_CLEAN_GOBACK #endif // NOZZLE_CLEAN_FEATURE } @@ -99,7 +99,7 @@ class Nozzle { // Don't allow impossible triangles if (A <= 0.0f || P <= 0.0f ) return; - #if ENABLED(NOZZLE_CLEAN_PARK) + #if ENABLED(NOZZLE_CLEAN_GOBACK) // Store the current coords point_t const initial = { current_position[X_AXIS], @@ -107,7 +107,7 @@ class Nozzle { current_position[Z_AXIS], current_position[E_AXIS] }; - #endif // NOZZLE_CLEAN_PARK + #endif // NOZZLE_CLEAN_GOBACK for (uint8_t j = 0; j < strokes; j++) { for (uint8_t i = 0; i < (objects << 1); i++) { @@ -126,11 +126,11 @@ class Nozzle { } } - #if ENABLED(NOZZLE_CLEAN_PARK) + #if ENABLED(NOZZLE_CLEAN_GOBACK) // Move the nozzle to the initial point do_blocking_move_to_z(initial.z); do_blocking_move_to_xy(initial.x, initial.y); - #endif // NOZZLE_CLEAN_PARK + #endif // NOZZLE_CLEAN_GOBACK #endif // NOZZLE_CLEAN_FEATURE } @@ -152,14 +152,14 @@ class Nozzle { switch (pattern) { case 1: Nozzle::zigzag( - NOZZLE_CLEAN_START_PT, - NOZZLE_CLEAN_END_PT, strokes, objects); + NOZZLE_CLEAN_START_POINT, + NOZZLE_CLEAN_END_POINT, strokes, objects); break; default: Nozzle::stroke( - NOZZLE_CLEAN_START_PT, - NOZZLE_CLEAN_END_PT, strokes); + NOZZLE_CLEAN_START_POINT, + NOZZLE_CLEAN_END_POINT, strokes); } #endif // NOZZLE_CLEAN_FEATURE } From b869fbc05e789ae79d6ee889155aee4a6aba9a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 02:46:34 +0100 Subject: [PATCH 422/580] Update all config files with the new G12 options --- Marlin/example_configurations/Cartesio/Configuration.h | 10 +++++----- Marlin/example_configurations/Felix/Configuration.h | 10 +++++----- .../example_configurations/Felix/DUAL/Configuration.h | 10 +++++----- .../example_configurations/Hephestos/Configuration.h | 10 +++++----- .../example_configurations/Hephestos_2/Configuration.h | 10 +++++----- Marlin/example_configurations/K8200/Configuration.h | 10 +++++----- Marlin/example_configurations/K8400/Configuration.h | 10 +++++----- .../K8400/Dual-head/Configuration.h | 10 +++++----- .../RepRapWorld/Megatronics/Configuration.h | 10 +++++----- Marlin/example_configurations/RigidBot/Configuration.h | 10 +++++----- Marlin/example_configurations/SCARA/Configuration.h | 10 +++++----- Marlin/example_configurations/TAZ4/Configuration.h | 10 +++++----- Marlin/example_configurations/WITBOX/Configuration.h | 10 +++++----- .../adafruit/ST7565/Configuration.h | 10 +++++----- .../delta/biv2.5/Configuration.h | 10 +++++----- .../delta/generic/Configuration.h | 10 +++++----- .../delta/kossel_mini/Configuration.h | 10 +++++----- .../delta/kossel_pro/Configuration.h | 10 +++++----- .../delta/kossel_xl/Configuration.h | 10 +++++----- Marlin/example_configurations/makibox/Configuration.h | 10 +++++----- .../tvrrug/Round2/Configuration.h | 10 +++++----- 21 files changed, 105 insertions(+), 105 deletions(-) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index cceaf1ad0..2aa864fa3 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -894,12 +894,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index e55dc3347..c3765b909 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -877,12 +877,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index d2edb9a53..943b5483f 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -875,12 +875,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 72e65de65..1834986c1 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -886,12 +886,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 18e9679a7..f08207385 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -888,12 +888,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index efcd1f858..a46c98f08 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -911,12 +911,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 8be33d78d..2e822c619 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -894,12 +894,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 158f6add1..1bf429e0f 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -894,12 +894,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 3ac1feef4..a48370e5f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -894,12 +894,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index b1ec73669..bf8de78bd 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -892,12 +892,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index e538ff010..970ee8015 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -902,12 +902,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 201dcadf9..b9264323d 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -915,12 +915,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index b5eba2cfb..8de68af4f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -886,12 +886,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 707146f0a..6b5546eff 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -894,12 +894,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 7b9e5e516..0e6ab7cef 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -989,12 +989,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 8790185e1..7e27d294c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -983,12 +983,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index d677ea174..906a33e63 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -986,12 +986,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 41d48fc77..d36d8246b 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -986,12 +986,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 5ac9c8c84..d164dc72c 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -988,12 +988,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 421683f31..6ba372f05 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -897,12 +897,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 0499e024b..2a723f23f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -888,12 +888,12 @@ // Number of pattern repetitions #define NOZZLE_CLEAN_STROKES 12 - // { X, Y, Z} - #define NOZZLE_CLEAN_START_PT { 30, 30, (Z_MIN_POS + 5)} - #define NOZZLE_CLEAN_END_PT {100, 60, (Z_MIN_POS + 5)} + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} - // Moves the nozzle to the parked position - #define NOZZLE_CLEAN_PARK + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK #endif // From 0149fc189a5d831c9a402912de27fda4b91c0123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Tue, 19 Jul 2016 01:47:11 +0100 Subject: [PATCH 423/580] Update travis config so NOZZLE_CLEAN_FEATURE no longer depends on AUTO_BED_LEVELING_FEATURE --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 245ff15a9..8d1b0ef56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -240,7 +240,7 @@ script: # Test NOZZLE_CLEAN_FEATURE # - restore_configs - - opt_enable AUTO_BED_LEVELING_FEATURE NOZZLE_CLEAN_FEATURE FIX_MOUNTED_PROBE + - opt_enable NOZZLE_CLEAN_FEATURE - build_marlin # # From 8a2efd11550745d0816dfa7679347ed3e792368c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Jul 2016 15:26:14 -0700 Subject: [PATCH 424/580] Rename ultralcd implementation files for consistency --- Marlin/fonts/README.md | 2 +- Marlin/ultralcd.cpp | 4 ++-- Marlin/{dogm_lcd_implementation.h => ultralcd_impl_DOGM.h} | 2 +- ...plementation_hitachi_HD44780.h => ultralcd_impl_HD44780.h} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename Marlin/{dogm_lcd_implementation.h => ultralcd_impl_DOGM.h} (99%) rename Marlin/{ultralcd_implementation_hitachi_HD44780.h => ultralcd_impl_HD44780.h} (100%) diff --git a/Marlin/fonts/README.md b/Marlin/fonts/README.md index 86e54929b..d41899391 100644 --- a/Marlin/fonts/README.md +++ b/Marlin/fonts/README.md @@ -17,7 +17,7 @@ For the second half of the font we now support up to 11x11 pixel. - Export as a `*.bdf` file - Use `bdf2u8g.exe` to produce the `.h` file. Examples for the existing fonts are in `make_fonts.bat`. - Edit the produced `.h` file to match our needs. Find hints in the `dogm_font_data_.h` files. -- Make a new entry in the font list in `dogm_lcd_implementation.h` before the `#else // fall-back` line: +- Make a new entry in the font list in `ultralcd_impl_DOGM.h` before the `#else // fall-back` line: ```cpp #elif ENABLED(DISPLAY_CHARSET_NEWNAME) #include "dogm_font_data_yourfont.h" diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 4a4180ae2..fbdcb8a40 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -44,9 +44,9 @@ uint8_t lcd_status_message_level; char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1 #if ENABLED(DOGLCD) - #include "dogm_lcd_implementation.h" + #include "ultralcd_impl_DOGM.h" #else - #include "ultralcd_implementation_hitachi_HD44780.h" + #include "ultralcd_impl_HD44780.h" #endif // The main status screen diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/ultralcd_impl_DOGM.h similarity index 99% rename from Marlin/dogm_lcd_implementation.h rename to Marlin/ultralcd_impl_DOGM.h index 8edb204bd..6290bb393 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -21,7 +21,7 @@ */ /** - * dogm_lcd_implementation.h + * ultralcd_impl_DOGM.h * * Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin * Demonstrator: http://www.reprap.org/wiki/STB_Electronics diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_impl_HD44780.h similarity index 100% rename from Marlin/ultralcd_implementation_hitachi_HD44780.h rename to Marlin/ultralcd_impl_HD44780.h From 06ac1f3bcfa4d4b44fa1127829a489cd738b040a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Jun 2016 01:09:59 -0700 Subject: [PATCH 425/580] Reduce Reprapworld Keypad move code size --- Marlin/ultralcd.cpp | 48 ++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index fbdcb8a40..baf04a14f 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2310,42 +2310,24 @@ void kill_screen(const char* lcd_msg) { * */ #if ENABLED(REPRAPWORLD_KEYPAD) - static void reprapworld_keypad_move_z_up() { - encoderPosition = 1; + static void _reprapworld_keypad_move(AxisEnum axis, int dir) { move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_z(); - } - static void reprapworld_keypad_move_z_down() { - encoderPosition = -1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_z(); - } - static void reprapworld_keypad_move_x_left() { - encoderPosition = -1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_x(); - } - static void reprapworld_keypad_move_x_right() { - encoderPosition = 1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_x(); - } - static void reprapworld_keypad_move_y_down() { - encoderPosition = 1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_y(); - } - static void reprapworld_keypad_move_y_up() { - encoderPosition = -1; - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - lcd_move_y(); - } - static void reprapworld_keypad_move_home() { - enqueue_and_echo_commands_P(PSTR("G28")); // move all axes home + encoderPosition = dir; + switch (axis) { + case X_AXIS: lcd_move_x(); break; + case Y_AXIS: lcd_move_y(); break; + case Z_AXIS: lcd_move_z(); + } } + static void reprapworld_keypad_move_z_up() { _reprapworld_keypad_move(Z_AXIS, 1); } + static void reprapworld_keypad_move_z_down() { _reprapworld_keypad_move(Z_AXIS, -1); } + static void reprapworld_keypad_move_x_left() { _reprapworld_keypad_move(X_AXIS, -1); } + static void reprapworld_keypad_move_x_right() { _reprapworld_keypad_move(X_AXIS, 1); } + static void reprapworld_keypad_move_y_up() { _reprapworld_keypad_move(Y_AXIS, -1); } + static void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); } + static void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait #endif // REPRAPWORLD_KEYPAD - /** * * Audio feedback for controller clicks @@ -2657,7 +2639,7 @@ void lcd_update() { return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } - #endif //ULTIPANEL + #endif // ULTIPANEL // We arrive here every ~100ms when idling often enough. // Instead of tracking the changes simply redraw the Info Screen ~1 time a second. From 6abf9165759d76ca27d5f71dda549a63f522d12c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Jun 2016 17:13:56 -0700 Subject: [PATCH 426/580] Reprapworld Keypad move step is 1mm --- Marlin/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/DUAL/Configuration.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/Hephestos_2/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- Marlin/example_configurations/RigidBot/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/TAZ4/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8947af157..ac93cb453 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1160,7 +1160,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index c3765b909..00662171c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1143,7 +1143,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 943b5483f..29cc3b051 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -1141,7 +1141,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 1834986c1..7b659c0bf 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1152,7 +1152,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index f08207385..9ce056a90 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1154,7 +1154,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index a46c98f08..0c4a27162 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1177,7 +1177,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index a48370e5f..8dab9e945 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -1160,7 +1160,7 @@ // is pressed, a value of 10.0 means 10mm per click. // #define REPRAPWORLD_KEYPAD -#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index bf8de78bd..1568ed873 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -1160,7 +1160,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 970ee8015..9123b2016 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1168,7 +1168,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index b9264323d..a4db05cb0 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -1181,7 +1181,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 8de68af4f..d700848b5 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1152,7 +1152,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 6b5546eff..9c690416d 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -1160,7 +1160,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 0e6ab7cef..d0e8c37a1 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1255,7 +1255,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 7e27d294c..1b81a1e54 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1249,7 +1249,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 906a33e63..b26f2bd54 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1252,7 +1252,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index d36d8246b..b9b0eff1c 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1252,7 +1252,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index d164dc72c..5739ac3da 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1254,7 +1254,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 6ba372f05..a87caff14 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1163,7 +1163,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 2a723f23f..251fae1f1 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1154,7 +1154,7 @@ // is pressed, a value of 10.0 means 10mm per click. // //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // // RigidBot Panel V1.0 From eaa6f568ee380c122129fc8142c2c928d520bc5b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Jun 2016 01:10:51 -0700 Subject: [PATCH 427/580] Prevent re-entrant call of Reprapworld Keypad handler --- Marlin/ultralcd.cpp | 39 +++++++++++++++++++++++++-------------- Marlin/ultralcd.h | 11 +++++++++++ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index baf04a14f..a68e61ebe 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2584,22 +2584,33 @@ void lcd_update() { #if ENABLED(REPRAPWORLD_KEYPAD) - #if ENABLED(DELTA) || ENABLED(SCARA) - #define _KEYPAD_MOVE_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) - #else - #define _KEYPAD_MOVE_ALLOWED true - #endif + static uint8_t keypad_debounce = 0; - if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home(); - if (_KEYPAD_MOVE_ALLOWED) { - if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); - if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down(); - if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left(); - if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right(); - if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down(); - if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up(); + if (!REPRAPWORLD_KEYPAD_PRESSED) { + if (keypad_debounce > 0) keypad_debounce--; } - #endif + else if (!keypad_debounce) { + keypad_debounce = 2; + + #if DISABLED(DELTA) && Z_HOME_DIR == -1 + if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); + #endif + + if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) { + #if ENABLED(DELTA) || Z_HOME_DIR != -1 + if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); + #endif + if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down(); + if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left(); + if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right(); + if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down(); + if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up(); + } + else { + if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home(); + } + } + #endif // REPRAPWORLD_KEYPAD bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP); if (encoderPastThreshold || LCD_CLICKED) { diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index ccb6f504d..d9b6c3c0f 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -123,6 +123,17 @@ #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) + #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \ + EN_REPRAPWORLD_KEYPAD_F3 | \ + EN_REPRAPWORLD_KEYPAD_F2 | \ + EN_REPRAPWORLD_KEYPAD_F1 | \ + EN_REPRAPWORLD_KEYPAD_DOWN | \ + EN_REPRAPWORLD_KEYPAD_RIGHT | \ + EN_REPRAPWORLD_KEYPAD_MIDDLE | \ + EN_REPRAPWORLD_KEYPAD_UP | \ + EN_REPRAPWORLD_KEYPAD_LEFT) \ + ) + #endif // REPRAPWORLD_KEYPAD #if ENABLED(NEWPANEL) From 2bad02e60d4e10a0b25e01d0c1775a6b952c61b5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 7 Jun 2016 17:29:34 -0700 Subject: [PATCH 428/580] Reprapworld Keypad: F1 opens the Move Axis menu --- Marlin/ultralcd.cpp | 4 ++++ Marlin/ultralcd.h | 1 + 2 files changed, 5 insertions(+) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index a68e61ebe..02a0e3a22 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2295,6 +2295,7 @@ void kill_screen(const char* lcd_msg) { currentScreen = menu_edit_callback_ ## _name; \ callbackFunc = callback; \ } + menu_edit_type(int, int3, itostr3, 1); menu_edit_type(float, float3, ftostr3, 1); menu_edit_type(float, float32, ftostr32, 100); @@ -2326,6 +2327,7 @@ void kill_screen(const char* lcd_msg) { static void reprapworld_keypad_move_y_up() { _reprapworld_keypad_move(Y_AXIS, -1); } static void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); } static void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait + static void reprapworld_keypad_move_menu() { lcd_goto_screen(lcd_move_menu); } #endif // REPRAPWORLD_KEYPAD /** @@ -2592,6 +2594,8 @@ void lcd_update() { else if (!keypad_debounce) { keypad_debounce = 2; + if (REPRAPWORLD_KEYPAD_MOVE_MENU) reprapworld_keypad_move_menu(); + #if DISABLED(DELTA) && Z_HOME_DIR == -1 if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); #endif diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index d9b6c3c0f..457a70f51 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -117,6 +117,7 @@ #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3) #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2) + #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1) #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE) From 204fd6ec444a2251373ccb18f53030e6c9579877 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Jul 2016 17:11:57 -0700 Subject: [PATCH 429/580] Set homing feedrates individually --- Marlin/Conditionals.h | 4 ++-- Marlin/Configuration.h | 4 +++- Marlin/Marlin_main.cpp | 9 ++++++++- Marlin/SanityCheck.h | 2 ++ Marlin/example_configurations/Cartesio/Configuration.h | 4 +++- Marlin/example_configurations/Felix/Configuration.h | 4 +++- Marlin/example_configurations/Felix/DUAL/Configuration.h | 4 +++- Marlin/example_configurations/Hephestos/Configuration.h | 4 +++- .../example_configurations/Hephestos_2/Configuration.h | 4 +++- Marlin/example_configurations/K8200/Configuration.h | 4 +++- Marlin/example_configurations/K8400/Configuration.h | 4 +++- .../K8400/Dual-head/Configuration.h | 4 +++- .../RepRapWorld/Megatronics/Configuration.h | 4 +++- Marlin/example_configurations/RigidBot/Configuration.h | 4 +++- Marlin/example_configurations/SCARA/Configuration.h | 4 +++- Marlin/example_configurations/TAZ4/Configuration.h | 4 +++- Marlin/example_configurations/WITBOX/Configuration.h | 4 +++- .../adafruit/ST7565/Configuration.h | 4 +++- .../example_configurations/delta/biv2.5/Configuration.h | 6 ++---- .../example_configurations/delta/generic/Configuration.h | 6 ++---- .../delta/kossel_mini/Configuration.h | 6 ++---- .../delta/kossel_pro/Configuration.h | 6 ++---- .../delta/kossel_xl/Configuration.h | 6 ++---- Marlin/example_configurations/makibox/Configuration.h | 4 +++- .../example_configurations/tvrrug/Round2/Configuration.h | 4 +++- 25 files changed, 73 insertions(+), 40 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 88bcec511..29d643909 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -829,8 +829,8 @@ #define Z_PROBE_OFFSET_RANGE_MAX 20 #endif #ifndef XY_PROBE_SPEED - #ifdef HOMING_FEEDRATE_XYZ - #define XY_PROBE_SPEED HOMING_FEEDRATE_XYZ + #ifdef HOMING_FEEDRATE_XY + #define XY_PROBE_SPEED HOMING_FEEDRATE_XY #else #define XY_PROBE_SPEED 4000 #endif diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ac93cb453..febe8e055 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -756,7 +756,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) // default settings diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d6f3077aa..2f5c5d911 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -306,7 +306,14 @@ static uint8_t cmd_queue_index_r = 0, * Feed rates are often configured with mm/m * but the planner and stepper like mm/s units. */ -const float homing_feedrate_mm_m[] = HOMING_FEEDRATE; +const float homing_feedrate_mm_m[] = { + #if ENABLED(DELTA) + HOMING_FEEDRATE_Z, HOMING_FEEDRATE_Z, + #else + HOMING_FEEDRATE_XY, HOMING_FEEDRATE_XY, + #endif + HOMING_FEEDRATE_Z, 0 +}; static float feedrate_mm_m = 1500.0, saved_feedrate_mm_m; int feedrate_percentage = 100, saved_feedrate_percentage; diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index bd5f96208..174f3b430 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -682,6 +682,8 @@ #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." #elif defined(ENDSTOPS_ONLY_FOR_HOMING) #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." +#elif defined(HOMING_FEEDRATE) + #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 2aa864fa3..d77924273 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -756,7 +756,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {3000, 3000, 600, 20} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (10*60) // default settings diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 00662171c..7a6ab42dc 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -738,7 +738,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) // default settings diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 29cc3b051..15a0efb37 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -736,7 +736,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) // default settings diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 7b659c0bf..fe4764137 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -748,7 +748,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {2000, 2000, 150, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY 2000 +#define HOMING_FEEDRATE_Z 150 // default settings diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 9ce056a90..f932c76d7 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -750,7 +750,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {150*60, 150*60, 3.3*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (150*60) +#define HOMING_FEEDRATE_Z 200 // default settings diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 0c4a27162..23458714b 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -773,7 +773,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) // default settings diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 2e822c619..a1e901e68 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -756,7 +756,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 8*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (8*60) // default settings diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 1bf429e0f..a62265d70 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -756,7 +756,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 8*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (8*60) // default settings diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 8dab9e945..ffd83bb05 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -756,7 +756,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) // default settings diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 1568ed873..222d2d321 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -753,7 +753,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 15*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (15*60) // default settings diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 9123b2016..304a14f42 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -764,7 +764,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (40*60) +#define HOMING_FEEDRATE_Z (10*60) // default settings diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index a4db05cb0..6f8e767e4 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -777,7 +777,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 8*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (8*60) // default settings diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d700848b5..2c06910a2 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -748,7 +748,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {120*60, 120*60, 7.2*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (120*60) +#define HOMING_FEEDRATE_Z 432 // default settings diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9c690416d..d3f596052 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -756,7 +756,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) // default settings diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index d0e8c37a1..03448692a 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -848,10 +848,8 @@ * MOVEMENT SETTINGS */ -// delta homing speeds must be the same on xyz -#define HOMING_FEEDRATE_XYZ (200*30) -#define HOMING_FEEDRATE_E 0 -#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E } +// Delta only homes to Z +#define HOMING_FEEDRATE_Z (200*30) // default settings // delta speeds must be the same on xyz diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 1b81a1e54..c5190cbda 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -842,10 +842,8 @@ * MOVEMENT SETTINGS */ -// delta homing speeds must be the same on xyz -#define HOMING_FEEDRATE_XYZ (200*60) -#define HOMING_FEEDRATE_E 0 -#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E } +// Delta only homes to Z +#define HOMING_FEEDRATE_Z (200*60) // default settings // delta speeds must be the same on xyz diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index b26f2bd54..276397aa2 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -845,10 +845,8 @@ * MOVEMENT SETTINGS */ -// delta homing speeds must be the same on xyz -#define HOMING_FEEDRATE_XYZ (200*60) -#define HOMING_FEEDRATE_E 0 -#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E } +// Delta only homes to Z +#define HOMING_FEEDRATE_Z (200*60) // default settings // delta speeds must be the same on xyz diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index b9b0eff1c..d18501075 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -839,10 +839,8 @@ * MOVEMENT SETTINGS */ -// delta homing speeds must be the same on xyz -#define HOMING_FEEDRATE_XYZ (200*60) -#define HOMING_FEEDRATE_E 0 -#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E } +// Delta only homes to Z +#define HOMING_FEEDRATE_Z (200*60) #define XYZ_FULL_STEPS_PER_ROTATION 200 #define XYZ_MICROSTEPS 32 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 5739ac3da..db33a6f1c 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -840,10 +840,8 @@ * MOVEMENT SETTINGS */ -// delta homing speeds must be the same on xyz -#define HOMING_FEEDRATE_XYZ (60*60) -#define HOMING_FEEDRATE_E 0 -#define HOMING_FEEDRATE { HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_XYZ, HOMING_FEEDRATE_E } +// Delta only homes to Z +#define HOMING_FEEDRATE_Z (60*60) // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index a87caff14..e8ca319bc 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -759,7 +759,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {1500, 1500, 120, 0} // set the homing speeds (mm/min) ***** MakiBox A6 ***** +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY 1500 +#define HOMING_FEEDRATE_Z (2*60) // default settings diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 251fae1f1..7d60a7e9e 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -746,7 +746,9 @@ * MOVEMENT SETTINGS */ -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) // default settings From e44b37cdc22e6b51e105fc2a2ec72e17a93eed92 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Jul 2016 17:31:03 -0700 Subject: [PATCH 430/580] motion section marker below homing speeds --- Marlin/Configuration.h | 12 +++++------- .../Cartesio/Configuration.h | 12 +++++------- .../example_configurations/Felix/Configuration.h | 12 +++++------- .../Felix/DUAL/Configuration.h | 12 +++++------- .../Hephestos/Configuration.h | 12 +++++------- .../Hephestos_2/Configuration.h | 12 +++++------- .../example_configurations/K8200/Configuration.h | 12 +++++------- .../example_configurations/K8400/Configuration.h | 12 +++++------- .../K8400/Dual-head/Configuration.h | 12 +++++------- .../RepRapWorld/Megatronics/Configuration.h | 12 +++++------- .../RigidBot/Configuration.h | 12 +++++------- .../example_configurations/SCARA/Configuration.h | 12 +++++------- Marlin/example_configurations/TAZ4/Configuration.h | 12 +++++------- .../example_configurations/WITBOX/Configuration.h | 12 +++++------- .../adafruit/ST7565/Configuration.h | 12 +++++------- .../delta/biv2.5/Configuration.h | 11 +++++------ .../delta/generic/Configuration.h | 11 +++++------ .../delta/kossel_mini/Configuration.h | 11 +++++------ .../delta/kossel_pro/Configuration.h | 11 +++++------ .../delta/kossel_xl/Configuration.h | 14 +++++++------- .../example_configurations/makibox/Configuration.h | 12 +++++------- .../tvrrug/Round2/Configuration.h | 12 +++++------- 22 files changed, 112 insertions(+), 150 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index febe8e055..084b6290b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -749,17 +749,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,4000,500} // default steps per unit for Ultimaker diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index d77924273..db188b82e 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -749,17 +749,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (10*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {71.128,71.128,640,152} diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 7a6ab42dc..d486589a1 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -731,17 +731,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings // default steps per unit for Felix 2.0/3.0: 0.00249mm x/y rounding error with 3mm pitch HTD belt and 14 tooth pulleys. 0 z error. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 15a0efb37..b751dee80 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -729,17 +729,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings // default steps per unit for Felix 2.0/3.0: 0.00249mm x/y rounding error with 3mm pitch HTD belt and 14 tooth pulleys. 0 z error. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index fe4764137..96a4287cc 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -741,17 +741,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY 2000 #define HOMING_FEEDRATE_Z 150 +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,4000,100.47095761381482} // default steps per unit for Ultimaker diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index f932c76d7..9027007c8 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -743,17 +743,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (150*60) #define HOMING_FEEDRATE_Z 200 +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {160, 160, 8000, 210.02} // Steps per unit diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 23458714b..f0b30f861 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -766,17 +766,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {64.25,64.25,2560,600} // default steps per unit for K8200 diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index a1e901e68..c9c649a66 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -749,17 +749,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (8*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {134.74,134.74,4266.66,148.7} // default steps per unit for Ultimaker diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index a62265d70..4212cddc8 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -749,17 +749,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (8*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {134.74,134.74,4266.66,148.7} // default steps per unit for Ultimaker diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index ffd83bb05..38c1d546c 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -749,17 +749,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402*2,78.7402*2,5120.00,760*1*1.5} // default steps per unit for Ultimaker diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 222d2d321..540b3f696 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -746,17 +746,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (15*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {44.3090, 22.1545, 1600, 53.5} // default steps per unit for RigidBot with standard hardware diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 304a14f42..3d534f72e 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -757,17 +757,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (40*60) #define HOMING_FEEDRATE_Z (10*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {103.69,106.65,200/1.25,1000} // default steps per unit for SCARA diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 6f8e767e4..9e56cdd3c 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -770,17 +770,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (8*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {100.5,100.5,400,850} // default steps per unit for Ultimaker diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 2c06910a2..650a21c01 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -741,17 +741,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (120*60) #define HOMING_FEEDRATE_Z 432 +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,600.0*8/3,102.073} // default steps per unit for Ultimaker diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index d3f596052..179cbb999 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -749,17 +749,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,4000,500} // default steps per unit for Ultimaker diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 03448692a..ff70e8ce9 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -842,15 +842,14 @@ #endif -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Delta only homes to Z #define HOMING_FEEDRATE_Z (200*30) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings // delta speeds must be the same on xyz #define DEFAULT_AXIS_STEPS_PER_UNIT {72.9, 72.9, 72.9, 291} // default steps per unit for BI v2.5 (cable drive) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index c5190cbda..a623e984c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -836,15 +836,14 @@ #endif -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Delta only homes to Z #define HOMING_FEEDRATE_Z (200*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings // delta speeds must be the same on xyz #define DEFAULT_AXIS_STEPS_PER_UNIT {80, 80, 80, 760*1.1} // default steps per unit for Kossel (GT2, 20 tooth) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 276397aa2..3f35411f4 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -839,15 +839,14 @@ #endif -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Delta only homes to Z #define HOMING_FEEDRATE_Z (200*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings // delta speeds must be the same on xyz #define DEFAULT_AXIS_STEPS_PER_UNIT {80, 80, 80, 760*1.1} // default steps per unit for Kossel (GT2, 20 tooth) diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index d18501075..7dc141227 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -833,15 +833,14 @@ #endif -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Delta only homes to Z #define HOMING_FEEDRATE_Z (200*60) +// +// MOVEMENT SETTINGS +// @section motion +// + #define XYZ_FULL_STEPS_PER_ROTATION 200 #define XYZ_MICROSTEPS 32 #define XYZ_BELT_PITCH 2 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index db33a6f1c..939210591 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -833,16 +833,14 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Delta only homes to Z #define HOMING_FEEDRATE_Z (60*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 #define XYZ_MICROSTEPS 16 @@ -852,6 +850,8 @@ // delta speeds must be the same on xyz #define XYZ_STEPS (XYZ_FULL_STEPS_PER_ROTATION * XYZ_MICROSTEPS / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) +// default settings + #define DEFAULT_AXIS_STEPS_PER_UNIT {XYZ_STEPS, XYZ_STEPS, XYZ_STEPS, 158} // default steps per unit for PowerWasp #define DEFAULT_MAX_FEEDRATE {200, 200, 200, 25} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {9000,9000,9000,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. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index e8ca319bc..d26549afb 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -752,17 +752,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY 1500 #define HOMING_FEEDRATE_Z (2*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings #define DEFAULT_AXIS_STEPS_PER_UNIT {400, 400, 400, 163} // default steps per unit for ***** MakiBox A6 ***** diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 7d60a7e9e..9d3f10201 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -739,17 +739,15 @@ #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28). #endif - -// @section motion - -/** - * MOVEMENT SETTINGS - */ - // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) +// +// MOVEMENT SETTINGS +// @section motion +// + // default settings //#define DEFAULT_AXIS_STEPS_PER_UNIT {79.87, 79.87, 2566, 563,78} // Al's TVRR From 0432613ad794b1fca2d3b38c0693aa19663cdbc3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 18 Jul 2016 12:42:41 -0700 Subject: [PATCH 431/580] use enabled macro for mapper setting --- Marlin/ultralcd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 02a0e3a22..7264f7b40 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -2469,10 +2469,10 @@ void lcd_init() { int lcd_strlen(const char* s) { int i = 0, j = 0; while (s[i]) { - #ifdef MAPPER_NON + #if ENABLED(MAPPER_NON) j++; #else - if ((s[i] & 0xc0) != 0x80) j++; + if ((s[i] & 0xC0u) != 0x80u) j++; #endif i++; } @@ -2482,10 +2482,10 @@ int lcd_strlen(const char* s) { int lcd_strlen_P(const char* s) { int j = 0; while (pgm_read_byte(s)) { - #ifdef MAPPER_NON + #if ENABLED(MAPPER_NON) j++; #else - if ((pgm_read_byte(s) & 0xc0) != 0x80) j++; + if ((pgm_read_byte(s) & 0xC0u) != 0x80u) j++; #endif s++; } From 09a3cc33e6b6771411b7c65870c0f14f9cccdb4a Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 18 Jul 2016 15:52:41 +0200 Subject: [PATCH 432/580] Unify run_z_probe Unify run_z_probe Add double touch for DELTAs. Introduce Z_PROBE_SPEED_FAST and Z_PROBE_SPEED_SLOW defaulting to homing_feedrate_mm_m[Z_AXIS] and homing_feedrate_mm_m[Z_AXIS]/2 --- Marlin/Configuration.h | 4 + Marlin/Marlin_main.cpp | 103 +++++------------- .../Cartesio/Configuration.h | 4 + .../Felix/Configuration.h | 4 + .../Felix/DUAL/Configuration.h | 4 + .../Hephestos/Configuration.h | 4 + .../Hephestos_2/Configuration.h | 4 + .../K8200/Configuration.h | 4 + .../K8400/Configuration.h | 4 + .../K8400/Dual-head/Configuration.h | 4 + .../RepRapWorld/Megatronics/Configuration.h | 4 + .../RigidBot/Configuration.h | 4 + .../SCARA/Configuration.h | 4 + .../TAZ4/Configuration.h | 4 + .../WITBOX/Configuration.h | 4 + .../adafruit/ST7565/Configuration.h | 4 + .../delta/biv2.5/Configuration.h | 4 + .../delta/generic/Configuration.h | 4 + .../delta/kossel_mini/Configuration.h | 4 + .../delta/kossel_pro/Configuration.h | 4 + .../delta/kossel_xl/Configuration.h | 4 + .../makibox/Configuration.h | 4 + .../tvrrug/Round2/Configuration.h | 4 + 23 files changed, 114 insertions(+), 77 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ac93cb453..68d117f4f 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -499,6 +499,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d6f3077aa..605b52788 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1584,7 +1584,7 @@ static void set_axis_is_at_home(AxisEnum axis) { /** * Some planner shorthand inline functions */ -inline float set_homing_bump_feedrate(AxisEnum axis) { +inline float get_homing_bump_feedrate(AxisEnum axis) { const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; int hbd = homing_bump_divisor[axis]; if (hbd < 1) { @@ -1592,8 +1592,7 @@ inline float set_homing_bump_feedrate(AxisEnum axis) { SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1"); } - feedrate_mm_m = homing_feedrate_mm_m[axis] / hbd; - return feedrate_mm_m; + return homing_feedrate_mm_m[axis] / hbd; } // // line_to_current_position @@ -1613,7 +1612,7 @@ inline void line_to_axis_pos(AxisEnum axis, float where, float fr_mm_m = 0.0) { current_position[axis] = where; feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : homing_feedrate_mm_m[axis]; planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(feedrate_mm_m), active_extruder); - stepper.synchronize(); // The lost one + stepper.synchronize(); feedrate_mm_m = old_feedrate_mm_m; } @@ -2061,85 +2060,35 @@ static void clean_up_after_endstop_or_probe_move() { // at the height where the probe triggered. static float run_z_probe() { - float old_feedrate_mm_m = feedrate_mm_m; - // Prevent stepper_inactive_time from running out and EXTRUDER_RUNOUT_PREVENT from extruding refresh_cmd_timeout(); - #if ENABLED(DELTA) - - float start_z = current_position[Z_AXIS]; - long start_steps = stepper.position(Z_AXIS); - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 1", current_position); - #endif - - // move down slowly until you find the bed - feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS] / 4; - destination[Z_AXIS] = -10; - prepare_move_to_destination_raw(); // this will also set_current_to_destination - stepper.synchronize(); - endstops.hit_on_purpose(); // clear endstop hit flags - - /** - * We have to let the planner know where we are right now as it - * is not where we said to go. - */ - long stop_steps = stepper.position(Z_AXIS); - float mm = start_z - float(start_steps - stop_steps) / planner.axis_steps_per_mm[Z_AXIS]; - current_position[Z_AXIS] = mm; - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position); - #endif - - #else // !DELTA - - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - planner.bed_level_matrix.set_to_identity(); - #endif - - feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS]; - - // Move down until the Z probe (or endstop?) is triggered - float zPosition = -(Z_MAX_LENGTH + 10); - line_to_z(zPosition); - stepper.synchronize(); - - // Tell the planner where we ended up - Get this from the stepper handler - zPosition = stepper.get_axis_position_mm(Z_AXIS); - planner.set_position_mm( - current_position[X_AXIS], current_position[Y_AXIS], zPosition, - current_position[E_AXIS] - ); - - // move up the retract distance - zPosition += home_bump_mm(Z_AXIS); - line_to_z(zPosition); - stepper.synchronize(); - endstops.hit_on_purpose(); // clear endstop hit flags - - // move back down slowly to find bed - set_homing_bump_feedrate(Z_AXIS); - - zPosition -= home_bump_mm(Z_AXIS) * 2; - line_to_z(zPosition); - stepper.synchronize(); - endstops.hit_on_purpose(); // clear endstop hit flags - - // Get the current stepper position after bumping an endstop - current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + planner.bed_level_matrix.set_to_identity(); + #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position); - #endif + current_position[Z_AXIS] = -(Z_MAX_LENGTH + 10); + do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_FAST); + endstops.hit_on_purpose(); // clear endstop hit flags + // Get the current stepper position after bumping an endstop + current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); + SYNC_PLAN_POSITION_KINEMATIC(); // tell the planner where we are feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS]; - #endif // !DELTA + // move up the retract distance + current_position[Z_AXIS] += home_bump_mm(Z_AXIS); + do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_FAST); - SYNC_PLAN_POSITION_KINEMATIC(); + // move back down slowly to find bed + current_position[Z_AXIS] -= home_bump_mm(Z_AXIS) * 2; + do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_SLOW); + endstops.hit_on_purpose(); // clear endstop hit flags + // Get the current stepper position after bumping an endstop + current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); + SYNC_PLAN_POSITION_KINEMATIC(); // tell the planner where we are - feedrate_mm_m = old_feedrate_mm_m; + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position); + #endif return current_position[Z_AXIS]; } @@ -2424,7 +2373,7 @@ static void homeaxis(AxisEnum axis) { line_to_axis_pos(axis, -home_bump_mm(axis) * axis_home_dir); // Move slowly towards the endstop until triggered - line_to_axis_pos(axis, 2 * home_bump_mm(axis) * axis_home_dir, set_homing_bump_feedrate(axis)); + line_to_axis_pos(axis, 2 * home_bump_mm(axis) * axis_home_dir, get_homing_bump_feedrate(axis)); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position); diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 2aa864fa3..14641bbb8 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -499,6 +499,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 00662171c..7fa9c3dd2 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -481,6 +481,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 29cc3b051..b9eadd04d 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -479,6 +479,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 7b659c0bf..80a3eabab 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -491,6 +491,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 9ce056a90..7e62f2caa 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -493,6 +493,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 0c4a27162..3db1bc4d8 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -516,6 +516,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 2e822c619..32ebd1914 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -499,6 +499,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 1bf429e0f..d4090f958 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -499,6 +499,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 8dab9e945..c7875a4d9 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -499,6 +499,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 1568ed873..7e3e0cb09 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -496,6 +496,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 9123b2016..01ec60e67 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -507,6 +507,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index a4db05cb0..8f18e4e4d 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -520,6 +520,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d700848b5..12f117566 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -491,6 +491,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 9c690416d..641d18f8d 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -499,6 +499,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index d0e8c37a1..81cdce731 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -541,6 +541,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 1b81a1e54..20f5ee8fd 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -541,6 +541,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index b26f2bd54..c24447b12 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -541,6 +541,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index b9b0eff1c..317ab54d0 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -532,6 +532,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 5739ac3da..c5e6c2aeb 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -539,6 +539,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index a87caff14..6d6b0bb25 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -502,6 +502,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 251fae1f1..48c54569a 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -489,6 +489,10 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 +// Speed for the first approach when probing +#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +// Speed for the second approach when probing +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) // // Allen Key Probe is defined in the Delta example configurations. From 4a6ed5e22170d26b8c4eb907a32b46830ba46f2b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Jul 2016 18:21:38 -0700 Subject: [PATCH 433/580] Use HOMING_FEEDRATE_Z for Z_PROBE_SPEED_FAST --- Marlin/Configuration.h | 2 +- Marlin/example_configurations/Cartesio/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/DUAL/Configuration.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/Hephestos_2/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- Marlin/example_configurations/K8400/Configuration.h | 2 +- Marlin/example_configurations/K8400/Dual-head/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- Marlin/example_configurations/RigidBot/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/TAZ4/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 2 +- Marlin/example_configurations/delta/biv2.5/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 68d117f4f..d934986bd 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -500,7 +500,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 14641bbb8..212e9f00f 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -500,7 +500,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 7fa9c3dd2..fb0634db7 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -482,7 +482,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index b9eadd04d..3608f2148 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -480,7 +480,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 80a3eabab..44913e138 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -492,7 +492,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 7e62f2caa..acbe2377d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -494,7 +494,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 3db1bc4d8..a19b23e17 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -517,7 +517,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 32ebd1914..caab77699 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -500,7 +500,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index d4090f958..399f42699 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -500,7 +500,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index c7875a4d9..7f4af7eb7 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -500,7 +500,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 7e3e0cb09..26ca4d746 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -497,7 +497,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 01ec60e67..2848d8974 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -508,7 +508,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 8f18e4e4d..e1b15532f 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -521,7 +521,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 12f117566..4182d2e04 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -492,7 +492,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 641d18f8d..7c41be3f0 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -500,7 +500,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 81cdce731..69c2e068a 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -542,7 +542,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 20f5ee8fd..cbaa2a58c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -542,7 +542,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index c24447b12..a9b717bab 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -542,7 +542,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 317ab54d0..36e913110 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -533,7 +533,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index c5e6c2aeb..809d77ca1 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -540,7 +540,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 6d6b0bb25..2092bf198 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -503,7 +503,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 48c54569a..264bb5534 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -490,7 +490,7 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // Speed for the first approach when probing -#define Z_PROBE_SPEED_FAST (homing_feedrate_mm_m[Z_AXIS]) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the second approach when probing #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) From d2e9a9c18837c192e0fafd132afb1146099d2ff8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Jul 2016 19:37:31 -0700 Subject: [PATCH 434/580] Always switch to tool 0 for G28 --- Marlin/Marlin_main.cpp | 82 ++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d6f3077aa..8990e49a5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -572,6 +572,7 @@ void serial_echopair_P(const char* s_P, float v) { serialprintPGM(s_P); void serial_echopair_P(const char* s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void tool_change(const uint8_t tmp_extruder, const float fr_mm_m=0.0, bool no_move=false); static void report_current_position(); #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -2882,6 +2883,12 @@ inline void gcode_G28() { #endif #endif + // Always home with tool 0 active + #if HOTENDS > 1 + uint8_t old_tool_index = active_extruder; + tool_change(0, 0, true); + #endif + /** * For mesh bed leveling deactivate the mesh calculations, will be turned * on again when homing all axis @@ -3185,6 +3192,11 @@ inline void gcode_G28() { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28"); #endif + // Restore the active tool after homing + #if HOTENDS > 1 + tool_change(old_tool_index, 0, true); + #endif + report_current_position(); } @@ -6666,13 +6678,7 @@ inline void invalid_extruder_error(const uint8_t &e) { SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); } -/** - * T0-T3: Switch tool, usually switching extruders - * - * F[units/min] Set the movement feedrate - * S1 Don't move the tool in XY after change - */ -inline void gcode_T(uint8_t tmp_extruder) { +void tool_change(const uint8_t tmp_extruder, const float fr_mm_m/*=0.0*/, bool no_move/*=false*/) { #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 @@ -6687,14 +6693,6 @@ inline void gcode_T(uint8_t tmp_extruder) { #else //!MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> gcode_T(", tmp_extruder); - SERIAL_ECHOLNPGM(")"); - DEBUG_POS("BEFORE", current_position); - } - #endif - #if HOTENDS > 1 if (tmp_extruder >= EXTRUDERS) { @@ -6704,16 +6702,9 @@ inline void gcode_T(uint8_t tmp_extruder) { float old_feedrate_mm_m = feedrate_mm_m; - if (code_seen('F')) { - float next_feedrate_mm_m = code_value_axis_units(X_AXIS); - if (next_feedrate_mm_m > 0.0) old_feedrate_mm_m = feedrate_mm_m = next_feedrate_mm_m; - } - else - feedrate_mm_m = XY_PROBE_FEEDRATE_MM_M; + feedrate_mm_m = fr_mm_m > 0.0 ? (old_feedrate_mm_m = fr_mm_m) : XY_PROBE_FEEDRATE_MM_M; if (tmp_extruder != active_extruder) { - bool no_move = code_seen('S') && code_value_bool(); - if (!no_move && axis_unhomed_error(true, true, true)) { SERIAL_ECHOLNPGM("No move on toolchange"); no_move = true; @@ -6970,13 +6961,6 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif // HOTENDS <= 1 - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - DEBUG_POS("AFTER", current_position); - SERIAL_ECHOLNPGM("<<< gcode_T"); - } - #endif - SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER); SERIAL_PROTOCOLLN((int)active_extruder); @@ -6984,6 +6968,44 @@ inline void gcode_T(uint8_t tmp_extruder) { #endif //!MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 } +/** + * T0-T3: Switch tool, usually switching extruders + * + * F[units/min] Set the movement feedrate + * S1 Don't move the tool in XY after change + */ +inline void gcode_T(uint8_t tmp_extruder) { + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR(">>> gcode_T(", tmp_extruder); + SERIAL_ECHOLNPGM(")"); + DEBUG_POS("BEFORE", current_position); + } + #endif + + #if HOTENDS == 1 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1) + + tool_change(tmp_extruder); + + #elif HOTENDS > 1 + + tool_change( + tmp_extruder, + code_seen('F') ? code_value_axis_units(X_AXIS) : 0.0, + (tmp_extruder == active_extruder) || (code_seen('S') && code_value_bool()) + ); + + #endif + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + DEBUG_POS("AFTER", current_position); + SERIAL_ECHOLNPGM("<<< gcode_T"); + } + #endif +} + /** * Process a single command and dispatch it to its handler * This is called from the main loop() From 62ecd107ba09a14150602046fe7ddc1affde673a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Jul 2016 20:10:16 -0700 Subject: [PATCH 435/580] Patch ultralcd_impl header conditional names --- Marlin/ultralcd_impl_DOGM.h | 6 +++--- Marlin/ultralcd_impl_HD44780.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 6290bb393..3ab0b17e7 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -33,8 +33,8 @@ * License: http://opensource.org/licenses/BSD-3-Clause */ -#ifndef DOGM_LCD_IMPLEMENTATION_H -#define DOGM_LCD_IMPLEMENTATION_H +#ifndef ULTRALCD_IMPL_DOGM_H +#define ULTRALCD_IMPL_DOGM_H /** * Implementation of the LCD display routines for a DOGM128 graphic display. @@ -635,4 +635,4 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) { #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') -#endif //__DOGM_LCD_IMPLEMENTATION_H +#endif //__ULTRALCD_IMPL_DOGM_H diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index d1d047fca..16159b1fc 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -20,8 +20,8 @@ * */ -#ifndef ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H -#define ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H +#ifndef ULTRALCD_IMPL_HD44780_H +#define ULTRALCD_IMPL_HD44780_H /** * Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays. @@ -1006,4 +1006,4 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) { #endif // LCD_HAS_SLOW_BUTTONS -#endif // ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H +#endif // ULTRALCD_IMPL_HD44780_H From 209f5c03d0205c5a11b5516312bc67b13c3c4423 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 20 Jul 2016 18:29:29 -0700 Subject: [PATCH 436/580] Fewer temporary vars in planner accel limit --- Marlin/planner.cpp | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 03796100e..2e97c7e47 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -946,28 +946,23 @@ void Planner::check_axes_activity() { // Compute and limit the acceleration rate for the trapezoid generator. float steps_per_mm = block->step_event_count / block->millimeters; - long bsx = block->steps[X_AXIS], bsy = block->steps[Y_AXIS], bsz = block->steps[Z_AXIS], bse = block->steps[E_AXIS]; - if (bsx == 0 && bsy == 0 && bsz == 0) { - block->acceleration_steps_per_s2 = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 - } - else if (bse == 0) { - block->acceleration_steps_per_s2 = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 - } - else { - block->acceleration_steps_per_s2 = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 - } + block->acceleration_steps_per_s2 = ceil(( + (block->steps[X_AXIS] == 0 && block->steps[Y_AXIS] == 0 && block->steps[Z_AXIS] == 0) ? + retract_acceleration : block->steps[E_AXIS] == 0 ? + travel_acceleration : + acceleration + ) * steps_per_mm + ); // Limit acceleration per axis - unsigned long acc_st = block->acceleration_steps_per_s2, - x_acc_st = max_acceleration_steps_per_s2[X_AXIS], - y_acc_st = max_acceleration_steps_per_s2[Y_AXIS], - z_acc_st = max_acceleration_steps_per_s2[Z_AXIS], - e_acc_st = max_acceleration_steps_per_s2[E_AXIS], - allsteps = block->step_event_count; - if (x_acc_st < (acc_st * bsx) / allsteps) acc_st = (x_acc_st * allsteps) / bsx; - if (y_acc_st < (acc_st * bsy) / allsteps) acc_st = (y_acc_st * allsteps) / bsy; - if (z_acc_st < (acc_st * bsz) / allsteps) acc_st = (z_acc_st * allsteps) / bsz; - if (e_acc_st < (acc_st * bse) / allsteps) acc_st = (e_acc_st * allsteps) / bse; - + long acc_st = block->acceleration_steps_per_s2; + if (max_acceleration_steps_per_s2[X_AXIS] < (acc_st * block->steps[X_AXIS]) / block->step_event_count) + acc_st = (max_acceleration_steps_per_s2[X_AXIS] * block->step_event_count) / block->steps[X_AXIS]; + if (max_acceleration_steps_per_s2[Y_AXIS] < (acc_st * block->steps[Y_AXIS]) / block->step_event_count) + acc_st = (max_acceleration_steps_per_s2[Y_AXIS] * block->step_event_count) / block->steps[Y_AXIS]; + if (max_acceleration_steps_per_s2[Z_AXIS] < (acc_st * block->steps[Z_AXIS]) / block->step_event_count) + acc_st = (max_acceleration_steps_per_s2[Z_AXIS] * block->step_event_count) / block->steps[Z_AXIS]; + if (max_acceleration_steps_per_s2[E_AXIS] < (acc_st * block->steps[E_AXIS]) / block->step_event_count) + acc_st = (max_acceleration_steps_per_s2[E_AXIS] * block->step_event_count) / block->steps[E_AXIS]; block->acceleration_steps_per_s2 = acc_st; block->acceleration = acc_st / steps_per_mm; block->acceleration_rate = (long)(acc_st * 16777216.0 / (F_CPU / 8.0)); @@ -1064,12 +1059,12 @@ void Planner::check_axes_activity() { #if ENABLED(LIN_ADVANCE) - // bse == allsteps: A problem occurs when there's a very tiny move before a retract. + // block->steps[E_AXIS] == block->step_event_count: A problem occurs when there's a very tiny move before a retract. // In this case, the retract and the move will be executed together. // This leads to an enormous number of advance steps due to a huge e_acceleration. // The math is correct, but you don't want a retract move done with advance! // So this situation is filtered out here. - if (!bse || (!bsx && !bsy && !bsz) || stepper.get_advance_k() == 0 || (uint32_t) bse == allsteps) { + if (!block->steps[E_AXIS] || (!block->steps[X_AXIS] && !block->steps[Y_AXIS] && !block->steps[Z_AXIS]) || stepper.get_advance_k() == 0 || (uint32_t) block->steps[E_AXIS] == block->step_event_count) { block->use_advance_lead = false; } else { @@ -1080,7 +1075,7 @@ void Planner::check_axes_activity() { #elif ENABLED(ADVANCE) // Calculate advance rate - if (!bse || (!bsx && !bsy && !bsz)) { + if (!block->steps[E_AXIS] || (!block->steps[X_AXIS] && !block->steps[Y_AXIS] && !block->steps[Z_AXIS])) { block->advance_rate = 0; block->advance = 0; } From 4226f56f53eb6b3947c79295920c411b097a9e10 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 20 Jul 2016 19:19:47 -0700 Subject: [PATCH 437/580] Revert the planner acceleration logic somewhat --- Marlin/planner.cpp | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 2e97c7e47..f7455253b 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -946,26 +946,23 @@ void Planner::check_axes_activity() { // Compute and limit the acceleration rate for the trapezoid generator. float steps_per_mm = block->step_event_count / block->millimeters; - block->acceleration_steps_per_s2 = ceil(( - (block->steps[X_AXIS] == 0 && block->steps[Y_AXIS] == 0 && block->steps[Z_AXIS] == 0) ? - retract_acceleration : block->steps[E_AXIS] == 0 ? - travel_acceleration : - acceleration - ) * steps_per_mm - ); - // Limit acceleration per axis - long acc_st = block->acceleration_steps_per_s2; - if (max_acceleration_steps_per_s2[X_AXIS] < (acc_st * block->steps[X_AXIS]) / block->step_event_count) - acc_st = (max_acceleration_steps_per_s2[X_AXIS] * block->step_event_count) / block->steps[X_AXIS]; - if (max_acceleration_steps_per_s2[Y_AXIS] < (acc_st * block->steps[Y_AXIS]) / block->step_event_count) - acc_st = (max_acceleration_steps_per_s2[Y_AXIS] * block->step_event_count) / block->steps[Y_AXIS]; - if (max_acceleration_steps_per_s2[Z_AXIS] < (acc_st * block->steps[Z_AXIS]) / block->step_event_count) - acc_st = (max_acceleration_steps_per_s2[Z_AXIS] * block->step_event_count) / block->steps[Z_AXIS]; - if (max_acceleration_steps_per_s2[E_AXIS] < (acc_st * block->steps[E_AXIS]) / block->step_event_count) - acc_st = (max_acceleration_steps_per_s2[E_AXIS] * block->step_event_count) / block->steps[E_AXIS]; - block->acceleration_steps_per_s2 = acc_st; - block->acceleration = acc_st / steps_per_mm; - block->acceleration_rate = (long)(acc_st * 16777216.0 / (F_CPU / 8.0)); + if (!block->steps[X_AXIS] && !block->steps[Y_AXIS] && !block->steps[Z_AXIS]) { + block->acceleration_steps_per_s2 = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 + } + else { + // Limit acceleration per axis + block->acceleration_steps_per_s2 = ceil((block->steps[E_AXIS] ? acceleration : travel_acceleration) * steps_per_mm); + if (max_acceleration_steps_per_s2[X_AXIS] < (block->acceleration_steps_per_s2 * block->steps[X_AXIS]) / block->step_event_count) + block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[X_AXIS] * block->step_event_count) / block->steps[X_AXIS]; + if (max_acceleration_steps_per_s2[Y_AXIS] < (block->acceleration_steps_per_s2 * block->steps[Y_AXIS]) / block->step_event_count) + block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[Y_AXIS] * block->step_event_count) / block->steps[Y_AXIS]; + if (max_acceleration_steps_per_s2[Z_AXIS] < (block->acceleration_steps_per_s2 * block->steps[Z_AXIS]) / block->step_event_count) + block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[Z_AXIS] * block->step_event_count) / block->steps[Z_AXIS]; + if (max_acceleration_steps_per_s2[E_AXIS] < (block->acceleration_steps_per_s2 * block->steps[E_AXIS]) / block->step_event_count) + block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[E_AXIS] * block->step_event_count) / block->steps[E_AXIS]; + } + block->acceleration = block->acceleration_steps_per_s2 / steps_per_mm; + block->acceleration_rate = (long)(block->acceleration_steps_per_s2 * 16777216.0 / ((F_CPU) / 8.0)); #if 0 // Use old jerk for now From 6ef26a85d861f7b72f1f7388179117e85aa51665 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 21 Jul 2016 18:16:38 +0200 Subject: [PATCH 438/580] Back to the differences method in run_z_probe() --- Marlin/Marlin_main.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ac7c6fcc1..35c31c252 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2064,6 +2064,12 @@ static void clean_up_after_endstop_or_probe_move() { return false; } + #if ENABLED(DELTA) + #define SET_CURRENT_FROM_STEPPERS() current_position[Z_AXIS] = z_before - stepper.get_axis_position_mm(Z_AXIS) + z_mm + #else + #define SET_CURRENT_FROM_STEPPERS() current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS) + #endif + // Do a single Z probe and return with current_position[Z_AXIS] // at the height where the probe triggered. static float run_z_probe() { @@ -2075,23 +2081,31 @@ static void clean_up_after_endstop_or_probe_move() { planner.bed_level_matrix.set_to_identity(); #endif + #if ENABLED(DELTA) + float z_before = current_position[Z_AXIS]; + float z_mm = stepper.get_axis_position_mm(Z_AXIS); + #endif current_position[Z_AXIS] = -(Z_MAX_LENGTH + 10); do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_FAST); endstops.hit_on_purpose(); // clear endstop hit flags // Get the current stepper position after bumping an endstop - current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); - SYNC_PLAN_POSITION_KINEMATIC(); // tell the planner where we are feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS]; + SET_CURRENT_FROM_STEPPERS(); + SYNC_PLAN_POSITION_KINEMATIC(); // tell the planner where we are // move up the retract distance current_position[Z_AXIS] += home_bump_mm(Z_AXIS); do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_FAST); + #if ENABLED(DELTA) + z_before = current_position[Z_AXIS]; + z_mm = stepper.get_axis_position_mm(Z_AXIS); + #endif // move back down slowly to find bed current_position[Z_AXIS] -= home_bump_mm(Z_AXIS) * 2; do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_SLOW); endstops.hit_on_purpose(); // clear endstop hit flags // Get the current stepper position after bumping an endstop - current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); + SET_CURRENT_FROM_STEPPERS(); SYNC_PLAN_POSITION_KINEMATIC(); // tell the planner where we are #if ENABLED(DEBUG_LEVELING_FEATURE) From 976c31235d242c76b757d6cb959993480ddebf9f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Jul 2016 13:49:37 -0700 Subject: [PATCH 439/580] inline to fix warnings, smaller build size (sometimes) --- Marlin/Marlin.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 3ad5512f2..4a07513b0 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -407,11 +407,11 @@ void calculate_volumetric_multipliers(); /** * Blocking movement and shorthand functions */ -static void do_blocking_move_to(float x, float y, float z, float fr_mm_m=0.0); -static void do_blocking_move_to_axis_pos(AxisEnum axis, float where, float fr_mm_m=0.0); -static void do_blocking_move_to_x(float x, float fr_mm_m=0.0); -static void do_blocking_move_to_y(float y); -static void do_blocking_move_to_z(float z, float fr_mm_m=0.0); -static void do_blocking_move_to_xy(float x, float y, float fr_mm_m=0.0); +inline void do_blocking_move_to(float x, float y, float z, float fr_mm_m=0.0); +inline void do_blocking_move_to_axis_pos(AxisEnum axis, float where, float fr_mm_m=0.0); +inline void do_blocking_move_to_x(float x, float fr_mm_m=0.0); +inline void do_blocking_move_to_y(float y); +inline void do_blocking_move_to_z(float z, float fr_mm_m=0.0); +inline void do_blocking_move_to_xy(float x, float y, float fr_mm_m=0.0); #endif //MARLIN_H From 376a57232e8136f846546a2e1b9117acdc8c61b8 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Fri, 22 Jul 2016 03:12:46 +0200 Subject: [PATCH 440/580] DELTA do_blocking_move_to() more like the Chartesian one --- Marlin/Marlin_main.cpp | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 35c31c252..c07c48dbf 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1679,14 +1679,36 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M; + // when in the danger zone + if (current_position[Z_AXIS] > delta_clip_start_height) { + if (delta_clip_start_height < z) { // staying in the danger zone + destination[X_AXIS] = x; // move directly + destination[Y_AXIS] = y; + destination[Z_AXIS] = z; + prepare_move_to_destination_raw(); // this will also set_current_to_destination + return; + } else { // leave the danger zone + destination[X_AXIS] = current_position[X_AXIS]; + destination[Y_AXIS] = current_position[Y_AXIS]; + destination[Z_AXIS] = delta_clip_start_height; + prepare_move_to_destination_raw(); // this will also set_current_to_destination + } + } + if (current_position[Z_AXIS] < z) { // raise + destination[X_AXIS] = current_position[X_AXIS]; + destination[Y_AXIS] = current_position[Y_AXIS]; + destination[Z_AXIS] = z; + prepare_move_to_destination_raw(); // this will also set_current_to_destination + } destination[X_AXIS] = x; destination[Y_AXIS] = y; - destination[Z_AXIS] = z; + destination[Z_AXIS] = current_position[Z_AXIS]; + prepare_move_to_destination(); // this will also set_current_to_destination - if (x == current_position[X_AXIS] && y == current_position[Y_AXIS]) + if (current_position[Z_AXIS] > z) { // lower + destination[Z_AXIS] = z; prepare_move_to_destination_raw(); // this will also set_current_to_destination - else - prepare_move_to_destination(); // this will also set_current_to_destination + } #else From efd3aabda8b33de7c0d55c2a60b386a101810401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 22 Jul 2016 15:19:20 +0100 Subject: [PATCH 441/580] Adds missing documentation to the point_t structure --- Marlin/point_t.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Marlin/point_t.h b/Marlin/point_t.h index dbad66858..360abce64 100644 --- a/Marlin/point_t.h +++ b/Marlin/point_t.h @@ -23,18 +23,49 @@ #ifndef __POINT_T__ #define __POINT_T__ +/** + * @brief Cartesian Point + * @details Represents a three dimensional point on Cartesian coordinate system, + * using an additional fourth dimension for the extrusion length. + * + * @param x The x-coordinate of the point. + * @param y The y-coordinate of the point. + * @param z The z-coordinate of the point. + * @param e The e-coordinate of the point. + */ struct point_t { float x; float y; float z; float e; + /** + * @brief Two dimensional point constructor + * + * @param x The x-coordinate of the point. + * @param y The y-coordinate of the point. + */ point_t(float const x, float const y) : point_t(x, y, NAN, NAN) {} + /** + * @brief Three dimensional point constructor + * + * @param x The x-coordinate of the point. + * @param y The y-coordinate of the point. + * @param z The z-coordinate of the point. + */ point_t(float const x, float const y, float const z) : point_t(x, y, z, NAN) {} + /** + * @brief Tree dimensional point constructor with extrusion length + * + * @param x The x-coordinate of the point. + * @param y The y-coordinate of the point. + * @param z The z-coordinate of the point. + * @param e The e-coordinate of the point. + */ point_t(float const x, float const y, float const z, float const e) { this->x = x; this->y = y; @@ -43,4 +74,4 @@ struct point_t { } }; -#endif +#endif // __POINT_T__ From 2f7716987d8d0520a49131168a07de30da1186c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 22 Jul 2016 16:08:56 +0100 Subject: [PATCH 442/580] Fix minor gcc warning --- Marlin/Marlin_main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c07c48dbf..9ffd1ec9f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6671,7 +6671,6 @@ inline void invalid_extruder_error(const uint8_t &e) { } void tool_change(const uint8_t tmp_extruder, const float fr_mm_m/*=0.0*/, bool no_move/*=false*/) { - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) { @@ -6951,6 +6950,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_m/*=0.0*/, bool n // Set the new active extruder active_extruder = tmp_extruder; + UNUSED(fr_mm_m); + UNUSED(no_move); + #endif // HOTENDS <= 1 SERIAL_ECHO_START; From b78590e63dad80ccee6e0e623f57ab534429f2e6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 13:50:31 -0700 Subject: [PATCH 443/580] Patch and cleanup run_z_probe --- Marlin/Marlin_main.cpp | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c07c48dbf..4ddf8cddc 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2087,9 +2087,9 @@ static void clean_up_after_endstop_or_probe_move() { } #if ENABLED(DELTA) - #define SET_CURRENT_FROM_STEPPERS() current_position[Z_AXIS] = z_before - stepper.get_axis_position_mm(Z_AXIS) + z_mm + #define Z_FROM_STEPPERS() z_before + stepper.get_axis_position_mm(Z_AXIS) - z_mm #else - #define SET_CURRENT_FROM_STEPPERS() current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS) + #define Z_FROM_STEPPERS() stepper.get_axis_position_mm(Z_AXIS) #endif // Do a single Z probe and return with current_position[Z_AXIS] @@ -2104,31 +2104,28 @@ static void clean_up_after_endstop_or_probe_move() { #endif #if ENABLED(DELTA) - float z_before = current_position[Z_AXIS]; - float z_mm = stepper.get_axis_position_mm(Z_AXIS); + float z_before = current_position[Z_AXIS], // Current Z + z_mm = stepper.get_axis_position_mm(Z_AXIS); // Some tower's current position #endif - current_position[Z_AXIS] = -(Z_MAX_LENGTH + 10); - do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_FAST); - endstops.hit_on_purpose(); // clear endstop hit flags - // Get the current stepper position after bumping an endstop - SET_CURRENT_FROM_STEPPERS(); - SYNC_PLAN_POSITION_KINEMATIC(); // tell the planner where we are + + do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST); + endstops.hit_on_purpose(); + current_position[Z_AXIS] = Z_FROM_STEPPERS(); + SYNC_PLAN_POSITION_KINEMATIC(); // move up the retract distance - current_position[Z_AXIS] += home_bump_mm(Z_AXIS); - do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_FAST); + do_blocking_move_to_z(current_position[Z_AXIS] + home_bump_mm(Z_AXIS), Z_PROBE_SPEED_FAST); #if ENABLED(DELTA) z_before = current_position[Z_AXIS]; z_mm = stepper.get_axis_position_mm(Z_AXIS); #endif + // move back down slowly to find bed - current_position[Z_AXIS] -= home_bump_mm(Z_AXIS) * 2; - do_blocking_move_to_z(current_position[Z_AXIS], Z_PROBE_SPEED_SLOW); - endstops.hit_on_purpose(); // clear endstop hit flags - // Get the current stepper position after bumping an endstop - SET_CURRENT_FROM_STEPPERS(); - SYNC_PLAN_POSITION_KINEMATIC(); // tell the planner where we are + do_blocking_move_to_z(current_position[Z_AXIS] - home_bump_mm(Z_AXIS) * 2, Z_PROBE_SPEED_SLOW); + endstops.hit_on_purpose(); + current_position[Z_AXIS] = Z_FROM_STEPPERS(); + SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position); From 311c7dadb60ef1e862a76198fc36f5262b4b9dbd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 14:18:08 -0700 Subject: [PATCH 444/580] Cleanup do_blocking_move_to for DELTA --- Marlin/Marlin_main.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4ddf8cddc..b4e0a5b26 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1679,35 +1679,35 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M; + set_destination_to_current(); // sync destination at the start + // when in the danger zone if (current_position[Z_AXIS] > delta_clip_start_height) { - if (delta_clip_start_height < z) { // staying in the danger zone - destination[X_AXIS] = x; // move directly + if (z > delta_clip_start_height) { // staying in the danger zone + destination[X_AXIS] = x; // move directly (uninterpolated) destination[Y_AXIS] = y; destination[Z_AXIS] = z; - prepare_move_to_destination_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // set_current_to_destination return; - } else { // leave the danger zone - destination[X_AXIS] = current_position[X_AXIS]; - destination[Y_AXIS] = current_position[Y_AXIS]; + } + else { destination[Z_AXIS] = delta_clip_start_height; - prepare_move_to_destination_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // set_current_to_destination } } - if (current_position[Z_AXIS] < z) { // raise - destination[X_AXIS] = current_position[X_AXIS]; - destination[Y_AXIS] = current_position[Y_AXIS]; + + if (z > current_position[Z_AXIS]) { // raising? destination[Z_AXIS] = z; - prepare_move_to_destination_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // set_current_to_destination } + destination[X_AXIS] = x; destination[Y_AXIS] = y; - destination[Z_AXIS] = current_position[Z_AXIS]; - prepare_move_to_destination(); // this will also set_current_to_destination + prepare_move_to_destination(); // set_current_to_destination - if (current_position[Z_AXIS] > z) { // lower + if (z < current_position[Z_AXIS]) { // lowering? destination[Z_AXIS] = z; - prepare_move_to_destination_raw(); // this will also set_current_to_destination + prepare_move_to_destination_raw(); // set_current_to_destination } #else From 9388dcfa49528f20482ffe092aa5c1f718f210f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 22 Jul 2016 15:45:47 +0100 Subject: [PATCH 445/580] Implements timestamp_t structure --- Marlin/timestamp_t.h | 118 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 Marlin/timestamp_t.h diff --git a/Marlin/timestamp_t.h b/Marlin/timestamp_t.h new file mode 100644 index 000000000..2a18eb00f --- /dev/null +++ b/Marlin/timestamp_t.h @@ -0,0 +1,118 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef __TIMESTAMP_T__ +#define __TIMESTAMP_T__ + +struct timestamp_t { + /** + * @brief Number of seconds + */ + uint32_t timestamp; + + /** + * @brief Date time blank constructor + */ + timestamp_t() + : timestamp_t(0) {}; + + /** + * @brief Date time constructor + * @details Initializes the timestamp_t structure based on a number of seconds + * + * @param seconds The number of seconds + */ + timestamp_t(uint32_t const &seconds) { + this->timestamp = seconds; + } + + /** + * @brief Formats the date as number of years + * @return The number of years + */ + inline uint8_t year() const { + return this->day() / 365; + } + + /** + * @brief Formats the date as number of days + * @return The number of days + */ + inline uint16_t day() const { + return this->hour() / 24; + } + + /** + * @brief Formats the date as number of hours + * @return The number of hours + */ + inline uint32_t hour() const { + return this->minute() / 60; + } + + /** + * @brief Formats the date as number of minutes + * @return The number of minutes + */ + inline uint32_t minute() const { + return this->second() / 60; + } + + /** + * @brief Formats the date as number of seconds + * @return The number of seconds + */ + inline uint32_t second() const { + return this->timestamp; + } + + /** + * @brief Formats the date as a string + * @details Returns the timestamp formated as a string + * + * @param buffer The array pointed to must be able to accommodate 21 bytes + * + * String output examples: + * 123456789012345678901 (strlen) + * 135y 364d 23h 59m 59s + * 364d 23h 59m 59s + * 23h 59m 59s + * 59m 59s + * 59s + * + */ + void toString(char *buffer) const { + int y = this->year(), + d = this->day() % 365, + h = this->hour() % 24, + m = this->minute() % 60, + s = this->second() % 60; + + if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); + else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); + else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); + else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); + else sprintf_P(buffer, PSTR("%is"), s); + } +}; + +#endif // __TIMESTAMP_T__ From 23043a1e057df3831f369452956a43efa3fdaab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 22 Jul 2016 15:47:56 +0100 Subject: [PATCH 446/580] Rework some code to use timestamp_t struct (saves 72 bytes) --- Marlin/Marlin_main.cpp | 18 ++++++------------ Marlin/printcounter.cpp | 32 ++++++++++++-------------------- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c07c48dbf..ad859237a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -60,6 +60,7 @@ #include "pins_arduino.h" #include "math.h" #include "nozzle.h" +#include "timestamp_t.h" #if ENABLED(USE_WATCHDOG) #include "watchdog.h" @@ -4055,22 +4056,15 @@ inline void gcode_M17() { * M31: Get the time since the start of SD Print (or last M109) */ inline void gcode_M31() { - millis_t t = print_job_timer.duration(); - int d = int(t / 60 / 60 / 24), - h = int(t / 60 / 60) % 60, - m = int(t / 60) % 60, - s = int(t % 60); - char time[18]; // 123456789012345678 - if (d) - sprintf_P(time, PSTR("%id %ih %im %is"), d, h, m, s); // 99d 23h 59m 59s - else - sprintf_P(time, PSTR("%ih %im %is"), h, m, s); // 23h 59m 59s + char buffer[21]; + timestamp_t time(print_job_timer.duration()); + time.toString(buffer); - lcd_setstatus(time); + lcd_setstatus(buffer); SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_PRINT_TIME " "); - SERIAL_ECHOLN(time); + SERIAL_ECHOLN(buffer); thermalManager.autotempShutdown(); } diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp index 489503c3a..9bfb0f755 100644 --- a/Marlin/printcounter.cpp +++ b/Marlin/printcounter.cpp @@ -22,6 +22,7 @@ #include "Marlin.h" #include "printcounter.h" +#include "timestamp_t.h" PrintCounter::PrintCounter(): super() { this->loadStats(); @@ -92,6 +93,9 @@ void PrintCounter::saveStats() { } void PrintCounter::showStats() { + char buffer[21]; + timestamp_t time; + SERIAL_PROTOCOLPGM(MSG_STATS); SERIAL_ECHOPGM("Prints: "); @@ -107,17 +111,11 @@ void PrintCounter::showStats() { SERIAL_EOL; SERIAL_PROTOCOLPGM(MSG_STATS); - uint32_t t = this->data.printTime / 60; - SERIAL_ECHOPGM("Total time: "); - - SERIAL_ECHO(t / 60 / 24); - SERIAL_ECHOPGM("d "); + time.timestamp = this->data.printTime; + time.toString(buffer); - SERIAL_ECHO((t / 60) % 24); - SERIAL_ECHOPGM("h "); - - SERIAL_ECHO(t % 60); - SERIAL_ECHOPGM("min"); + SERIAL_ECHOPGM("Total time: "); + SERIAL_ECHO(buffer); #if ENABLED(DEBUG_PRINTCOUNTER) SERIAL_ECHOPGM(" ("); @@ -125,17 +123,11 @@ void PrintCounter::showStats() { SERIAL_ECHOPGM(")"); #endif - uint32_t l = this->data.longestPrint / 60; - SERIAL_ECHOPGM(", Longest job: "); - - SERIAL_ECHO(l / 60 / 24); - SERIAL_ECHOPGM("d "); + time.timestamp = this->data.longestPrint; + time.toString(buffer); - SERIAL_ECHO((l / 60) % 24); - SERIAL_ECHOPGM("h "); - - SERIAL_ECHO(l % 60); - SERIAL_ECHOPGM("min"); + SERIAL_ECHOPGM(", Longest job: "); + SERIAL_ECHO(buffer); #if ENABLED(DEBUG_PRINTCOUNTER) SERIAL_ECHOPGM(" ("); From 499e404fbfd23acc7c1ef007ebff960991a880cf Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 7 Jun 2016 01:44:14 +0200 Subject: [PATCH 447/580] forwardKinematics for Delta printers --- Marlin/Marlin_main.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3e2c641ac..50ce09371 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7780,6 +7780,76 @@ void clamp_to_software_endstops(float target[3]) { return abs(distance - delta[TOWER_3]); } + float cartesian[3]; // result + void forwardKinematics(float z1, float z2, float z3) { + //As discussed in Wikipedia "Trilateration" + //we are establishing a new coordinate + //system in the plane of the three carriage points. + //This system will have the origin at tower1 and + //tower2 is on the x axis. tower3 is in the X-Y + //plane with a Z component of zero. We will define unit + //vectors in this coordinate system in our original + //coordinate system. Then when we calculate the + //Xnew, Ynew and Znew values, we can translate back into + //the original system by moving along those unit vectors + //by the corresponding values. + // https://en.wikipedia.org/wiki/Trilateration + + // Variable names matched to Marlin, c-version + // and avoiding a vector library + // by Andreas Hardtung 2016-06-7 + // based on a Java function from + // "Delta Robot Kinematics by Steve Graves" V3 + + // Result is in cartesian[]. + + //Create a vector in old coords along x axis of new coord + float p12[3] = { delta_tower2_x - delta_tower1_x, delta_tower2_y - delta_tower1_y, z2 - z1 }; + + //Get the Magnitude of vector. + float d = sqrt( p12[0]*p12[0] + p12[1]*p12[1] + p12[2]*p12[2] ); + + //Create unit vector by dividing by magnitude. + float ex[3] = { p12[0]/d, p12[1]/d, p12[2]/d }; + + //Now find vector from the origin of the new system to the third point. + float p13[3] = { delta_tower3_x - delta_tower1_x, delta_tower3_y - delta_tower1_y, z3 - z1 }; + + //Now use dot product to find the component of this vector on the X axis. + float i = ex[0]*p13[0] + ex[1]*p13[1] + ex[2]*p13[2]; + + //Now create a vector along the x axis that represents the x component of p13. + float iex[3] = { ex[0]*i, ex[1]*i, ex[2]*i }; + + //Now subtract the X component away from the original vector leaving only the Y component. We use the + //variable that will be the unit vector after we scale it. + float ey[3] = { p13[0] - iex[0], p13[1] - iex[1], p13[2] - iex[2]}; + + //The magnitude of Y component + float j = sqrt(sq(ey[0]) + sq(ey[1]) + sq(ey[2])); + + //Now make vector a unit vector + ey[0] /= j; ey[1] /= j; ey[2] /= j; + + //The cross product of the unit x and y is the unit z + //float[] ez = vectorCrossProd(ex, ey); + float ez[3] = { ex[1]*ey[2] - ex[2]*ey[1], ex[2]*ey[0] - ex[0]*ey[2], ex[0]*ey[1] - ex[1]*ey[0] }; + + //Now we have the d, i and j values defined in Wikipedia. + //We can plug them into the equations defined in + //Wikipedia for Xnew, Ynew and Znew + float Xnew = (delta_diagonal_rod_2_tower_1 - delta_diagonal_rod_2_tower_2 + d*d)/(d*2); + float Ynew = ((delta_diagonal_rod_2_tower_1 - delta_diagonal_rod_2_tower_3 + i*i + j*j)/2 - i*Xnew) /j; + float Znew = sqrt(delta_diagonal_rod_2_tower_1 - Xnew*Xnew - Ynew*Ynew); + + //Now we can start from the origin in the old coords and + //add vectors in the old coords that represent the + //Xnew, Ynew and Znew to find the point in the old system + cartesian[X_AXIS] = delta_tower1_x + ex[0]*Xnew + ey[0]*Ynew - ez[0]*Znew; + cartesian[Y_AXIS] = delta_tower1_y + ex[1]*Xnew + ey[1]*Ynew - ez[1]*Znew; + cartesian[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew; + }; + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // Adjust print surface height by linear interpolation over the bed_level array. From 260bbb310964ffdcfb2ad8b3715f1fa9211a8930 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 20 Jul 2016 10:24:33 -0700 Subject: [PATCH 448/580] Fix a couple of simple typos --- Marlin/SanityCheck.h | 2 +- Marlin/stepper_indirection.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 174f3b430..b183d0bf7 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -175,7 +175,7 @@ */ #if ENABLED(SWITCHING_EXTRUDER) #if ENABLED(DUAL_X_CARRIAGE) - #error "SINGLENOZZLE and DUAL_X_CARRIAGE are incompatible." + #error "SWITCHING_EXTRUDER and DUAL_X_CARRIAGE are incompatible." #elif EXTRUDERS != 2 #error "SWITCHING_EXTRUDER requires exactly 2 EXTRUDERS." #elif NUM_SERVOS < 1 diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 65fde23c1..08d33b176 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -72,7 +72,7 @@ #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE) #define X2_ENABLE_READ READ(X_ENABLE_PIN) -#endif // DUAL_X_CARRIAGE +#endif // Y motor #define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN) From 91777dd76c34ac742ba29c60fdfa774d17ea06ac Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 20 Jul 2016 10:25:06 -0700 Subject: [PATCH 449/580] Add DUAL_NOZZLE_DUPLICATION_MODE option --- Marlin/Configuration_adv.h | 5 ++++- Marlin/SanityCheck.h | 17 +++++++++++++++++ .../Cartesio/Configuration_adv.h | 5 ++++- .../Felix/Configuration_adv.h | 5 ++++- .../Hephestos/Configuration_adv.h | 5 ++++- .../Hephestos_2/Configuration_adv.h | 5 ++++- .../K8200/Configuration_adv.h | 5 ++++- .../K8400/Configuration_adv.h | 5 ++++- .../RigidBot/Configuration_adv.h | 5 ++++- .../SCARA/Configuration_adv.h | 5 ++++- .../TAZ4/Configuration_adv.h | 5 ++++- .../WITBOX/Configuration_adv.h | 5 ++++- .../delta/biv2.5/Configuration_adv.h | 5 ++++- .../delta/generic/Configuration_adv.h | 5 ++++- .../delta/kossel_mini/Configuration_adv.h | 5 ++++- .../delta/kossel_pro/Configuration_adv.h | 5 ++++- .../delta/kossel_xl/Configuration_adv.h | 5 ++++- .../makibox/Configuration_adv.h | 5 ++++- .../tvrrug/Round2/Configuration_adv.h | 5 ++++- 19 files changed, 89 insertions(+), 18 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 930e931d3..c8d657739 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index b183d0bf7..5eea066a6 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -572,6 +572,23 @@ #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." #endif +/** + * Basic 2-nozzle duplication mode + */ +#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + #if HOTENDS != 2 + #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends." + #elif ENABLED(DUAL_X_CARRIAGE) + #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE." + #elif ENABLED(SINGLENOZZLE) + #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE." + #elif ENABLED(MIXING_EXTRUDER) + #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER." + #elif ENABLED(SWITCHING_EXTRUDER) + #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER." + #endif +#endif + /** * Test Extruder Pins */ diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 9207b5703..86a14793c 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 3f0729b6c..d4eed80f3 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index af6bce805..6dc51d6b1 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index bfb6b16c7..501541bd9 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 3703ce1cc..a822c9bf5 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -335,7 +335,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 11fdbdb3c..8b0fd6d38 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 3c0968260..c2fcf9268 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 6a0dea802..42045d7b8 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index fe9b6ba36..9a7dcf602 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -337,7 +337,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index af6bce805..6dc51d6b1 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 173cacf4d..9dc856be7 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 51a2d2b0b..66877a67e 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 90b3c68f0..24cf11fab 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index b8b94f8d4..6ee22d84a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -334,7 +334,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 74bb7c5dc..bd5577078 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 6e8c6e671..9413d9b0c 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index f72daabc8..752c24f69 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -329,7 +329,10 @@ #define AXIS_RELATIVE_MODES {false, false, false, false} -//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false #define INVERT_Z_STEP_PIN false From cbc7f22ad92597258dceff26b0e59ebd5f71c85c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 20 Jul 2016 10:30:10 -0700 Subject: [PATCH 450/580] Implement DUAL_NOZZLE_DUPLICATION_MODE --- Marlin/Marlin.h | 2 +- Marlin/Marlin_main.cpp | 35 ++++++++++++++++++++++++++--------- Marlin/language.h | 1 + Marlin/stepper_indirection.h | 2 +- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 4a07513b0..271948969 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -134,7 +134,7 @@ void idle( void manage_inactivity(bool ignore_stepper_queue = false); -#if ENABLED(DUAL_X_CARRIAGE) +#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) extern bool extruder_duplication_enabled; #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3e2c641ac..2966162dc 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1392,6 +1392,10 @@ XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm, HOME_BUMP_MM); XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); +#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + bool extruder_duplication_enabled = false; // Used in Dual X mode 2 +#endif + #if ENABLED(DUAL_X_CARRIAGE) #define DXC_FULL_CONTROL_MODE 0 @@ -1423,7 +1427,6 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static millis_t delayed_move_time = 0; // used in mode 1 static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2 static float duplicate_extruder_temp_offset = 0; // used in mode 2 - bool extruder_duplication_enabled = false; // used in mode 2 #endif //DUAL_X_CARRIAGE @@ -2820,12 +2823,13 @@ inline void gcode_G4() { current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; sync_plan_position(); - #if ENABLED(DUAL_X_CARRIAGE) - int x_axis_home_dir = x_home_dir(active_extruder); - extruder_duplication_enabled = false; - #else - int x_axis_home_dir = home_dir(X_AXIS); - #endif + int x_axis_home_dir = + #if ENABLED(DUAL_X_CARRIAGE) + x_home_dir(active_extruder) + #else + home_dir(X_AXIS) + #endif + ; float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS), @@ -2878,6 +2882,10 @@ inline void gcode_G28() { tool_change(0, 0, true); #endif + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + extruder_duplication_enabled = false; + #endif + /** * For mesh bed leveling deactivate the mesh calculations, will be turned * on again when homing all axis @@ -2996,7 +3004,6 @@ inline void gcode_G28() { if (home_all_axis || homeX) { #if ENABLED(DUAL_X_CARRIAGE) int tmp_extruder = active_extruder; - extruder_duplication_enabled = false; active_extruder = !active_extruder; HOMEAXIS(X); inactive_extruder_x_pos = current_position[X_AXIS]; @@ -6473,7 +6480,17 @@ inline void gcode_M503() { delayed_move_time = 0; } -#endif // DUAL_X_CARRIAGE +#elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + + inline void gcode_M605() { + stepper.synchronize(); + extruder_duplication_enabled = code_seen('S') && code_value_int() == 2; + SERIAL_ECHO_START; + SERIAL_ECHOPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF); + SERIAL_EOL; + } + +#endif // M605 #if ENABLED(LIN_ADVANCE) /** diff --git a/Marlin/language.h b/Marlin/language.h index 093368333..4e53c4890 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -159,6 +159,7 @@ #define MSG_ENDSTOP_HIT "TRIGGERED" #define MSG_ENDSTOP_OPEN "open" #define MSG_HOTEND_OFFSET "Hotend offsets:" +#define MSG_DUPLICATION_MODE "Duplication mode: " #define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir " #define MSG_SD_INIT_FAIL "SD init fail" diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 08d33b176..b14dde795 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -195,7 +195,7 @@ #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } } #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); } } #elif EXTRUDERS > 1 - #if DISABLED(DUAL_X_CARRIAGE) + #if DISABLED(DUAL_X_CARRIAGE) && DISABLED(DUAL_NOZZLE_DUPLICATION_MODE) #define E_STEP_WRITE(v) { if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } } #define NORM_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } } #define REV_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } } From b5a9647fec067c048fdfa3e9f5ec900c5b45f08d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 16:26:06 -0700 Subject: [PATCH 451/580] Use `ENABLED` in `stepper_indirection.h` --- Marlin/stepper_indirection.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index b14dde795..4052e395f 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -195,14 +195,14 @@ #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } } #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); } } #elif EXTRUDERS > 1 - #if DISABLED(DUAL_X_CARRIAGE) && DISABLED(DUAL_NOZZLE_DUPLICATION_MODE) - #define E_STEP_WRITE(v) { if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } } - #define NORM_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } } - #define REV_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } } - #else + #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) #define E_STEP_WRITE(v) { if (extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } } #define NORM_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } } #define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } } + #else + #define E_STEP_WRITE(v) { if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } } + #define NORM_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } } + #define REV_E_DIR() { if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } } #endif #elif ENABLED(MIXING_EXTRUDER) #define E_STEP_WRITE(v) NOOP /* not used for mixing extruders! */ From 5db9b940eeda60cbf2f5abb7abde28d214450ee7 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 21 Jul 2016 18:05:48 +0200 Subject: [PATCH 452/580] Use forwardKinematics in DELTA run_z_probe() --- Marlin/Marlin.h | 4 ++++ Marlin/Marlin_main.cpp | 29 +++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 4a07513b0..252aa9681 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -318,6 +318,10 @@ float code_value_temp_diff(); void calculate_delta(float cartesian[3]); void recalc_delta_settings(float radius, float diagonal_rod); float delta_safe_distance_from_top(); + void set_current_from_steppers(); + void set_cartesian_from_steppers(); + void forwardKinematics(float point[3]); + void forwardKinematics(float z1, float z2, float z3); #if ENABLED(AUTO_BED_LEVELING_FEATURE) extern int delta_grid_spacing[2]; void adjust_delta(float cartesian[3]); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 50ce09371..9c37bfcb8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -462,6 +462,7 @@ static uint8_t target_extruder; #define TOWER_3 Z_AXIS float delta[3] = { 0 }; + float cartesian[3] = { 0 }; #define SIN_60 0.8660254037844386 #define COS_60 0.5 float endstop_adj[3] = { 0 }; @@ -2087,9 +2088,9 @@ static void clean_up_after_endstop_or_probe_move() { } #if ENABLED(DELTA) - #define Z_FROM_STEPPERS() z_before + stepper.get_axis_position_mm(Z_AXIS) - z_mm + #define SET_Z_FROM_STEPPERS() set_current_from_steppers() #else - #define Z_FROM_STEPPERS() stepper.get_axis_position_mm(Z_AXIS) + #define SET_Z_FROM_STEPPERS() current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS) #endif // Do a single Z probe and return with current_position[Z_AXIS] @@ -2110,7 +2111,7 @@ static void clean_up_after_endstop_or_probe_move() { do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST); endstops.hit_on_purpose(); - current_position[Z_AXIS] = Z_FROM_STEPPERS(); + SET_Z_FROM_STEPPERS(); SYNC_PLAN_POSITION_KINEMATIC(); // move up the retract distance @@ -2124,7 +2125,7 @@ static void clean_up_after_endstop_or_probe_move() { // move back down slowly to find bed do_blocking_move_to_z(current_position[Z_AXIS] - home_bump_mm(Z_AXIS) * 2, Z_PROBE_SPEED_SLOW); endstops.hit_on_purpose(); - current_position[Z_AXIS] = Z_FROM_STEPPERS(); + SET_Z_FROM_STEPPERS(); SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -7780,7 +7781,6 @@ void clamp_to_software_endstops(float target[3]) { return abs(distance - delta[TOWER_3]); } - float cartesian[3]; // result void forwardKinematics(float z1, float z2, float z3) { //As discussed in Wikipedia "Trilateration" //we are establishing a new coordinate @@ -7803,7 +7803,7 @@ void clamp_to_software_endstops(float target[3]) { // Result is in cartesian[]. - //Create a vector in old coords along x axis of new coord + //Create a vector in old coordinates along x axis of new coordinate float p12[3] = { delta_tower2_x - delta_tower1_x, delta_tower2_y - delta_tower1_y, z2 - z1 }; //Get the Magnitude of vector. @@ -7850,6 +7850,23 @@ void clamp_to_software_endstops(float target[3]) { cartesian[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew; }; + void forwardKinematics(float point[3]) { + forwardKinematics(point[X_AXIS], point[Y_AXIS], point[Z_AXIS]); + } + + void set_cartesian_from_steppers() { + forwardKinematics(stepper.get_axis_position_mm(X_AXIS), + stepper.get_axis_position_mm(Y_AXIS), + stepper.get_axis_position_mm(Z_AXIS)); + } + + void set_current_from_steppers() { + set_cartesian_from_steppers(); + current_position[X_AXIS] = cartesian[X_AXIS]; + current_position[Y_AXIS] = cartesian[Y_AXIS]; + current_position[Z_AXIS] = cartesian[Z_AXIS]; + } + #if ENABLED(AUTO_BED_LEVELING_FEATURE) // Adjust print surface height by linear interpolation over the bed_level array. From 9f30cc84cebc11a51aee54228b9d3c46a259dde7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Jul 2016 14:35:48 -0700 Subject: [PATCH 453/580] Use set_current_from_steppers for other kinematics --- Marlin/Marlin.h | 1 - Marlin/Marlin_main.cpp | 36 ++++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 252aa9681..0c36168df 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -318,7 +318,6 @@ float code_value_temp_diff(); void calculate_delta(float cartesian[3]); void recalc_delta_settings(float radius, float diagonal_rod); float delta_safe_distance_from_top(); - void set_current_from_steppers(); void set_cartesian_from_steppers(); void forwardKinematics(float point[3]); void forwardKinematics(float z1, float z2, float z3); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9c37bfcb8..ea52c0ad3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -462,7 +462,7 @@ static uint8_t target_extruder; #define TOWER_3 Z_AXIS float delta[3] = { 0 }; - float cartesian[3] = { 0 }; + float cartesian_position[3] = { 0 }; #define SIN_60 0.8660254037844386 #define COS_60 0.5 float endstop_adj[3] = { 0 }; @@ -564,6 +564,7 @@ void stop(); void get_available_commands(); void process_next_command(); void prepare_move_to_destination(); +void set_current_from_steppers(); #if ENABLED(ARC_SUPPORT) void plan_arc(float target[NUM_AXIS], float* offset, uint8_t clockwise); @@ -7801,7 +7802,7 @@ void clamp_to_software_endstops(float target[3]) { // based on a Java function from // "Delta Robot Kinematics by Steve Graves" V3 - // Result is in cartesian[]. + // Result is in cartesian_position[]. //Create a vector in old coordinates along x axis of new coordinate float p12[3] = { delta_tower2_x - delta_tower1_x, delta_tower2_y - delta_tower1_y, z2 - z1 }; @@ -7845,9 +7846,9 @@ void clamp_to_software_endstops(float target[3]) { //Now we can start from the origin in the old coords and //add vectors in the old coords that represent the //Xnew, Ynew and Znew to find the point in the old system - cartesian[X_AXIS] = delta_tower1_x + ex[0]*Xnew + ey[0]*Ynew - ez[0]*Znew; - cartesian[Y_AXIS] = delta_tower1_y + ex[1]*Xnew + ey[1]*Ynew - ez[1]*Znew; - cartesian[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew; + cartesian_position[X_AXIS] = delta_tower1_x + ex[0]*Xnew + ey[0]*Ynew - ez[0]*Znew; + cartesian_position[Y_AXIS] = delta_tower1_y + ex[1]*Xnew + ey[1]*Ynew - ez[1]*Znew; + cartesian_position[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew; }; void forwardKinematics(float point[3]) { @@ -7860,13 +7861,6 @@ void clamp_to_software_endstops(float target[3]) { stepper.get_axis_position_mm(Z_AXIS)); } - void set_current_from_steppers() { - set_cartesian_from_steppers(); - current_position[X_AXIS] = cartesian[X_AXIS]; - current_position[Y_AXIS] = cartesian[Y_AXIS]; - current_position[Z_AXIS] = cartesian[Z_AXIS]; - } - #if ENABLED(AUTO_BED_LEVELING_FEATURE) // Adjust print surface height by linear interpolation over the bed_level array. @@ -7911,6 +7905,24 @@ void clamp_to_software_endstops(float target[3]) { #endif // DELTA +void set_current_from_steppers() { + #if ENABLED(DELTA) + set_cartesian_from_steppers(); + current_position[X_AXIS] = cartesian_position[X_AXIS]; + current_position[Y_AXIS] = cartesian_position[Y_AXIS]; + current_position[Z_AXIS] = cartesian_position[Z_AXIS]; + #elif ENABLED(AUTO_BED_LEVELING_FEATURE) + vector_3 pos = planner.adjusted_position(); // values directly from steppers... + current_position[X_AXIS] = pos.x; + current_position[Y_AXIS] = pos.y; + current_position[Z_AXIS] = pos.z; + #else + current_position[X_AXIS] = stepper.get_axis_position_mm(X_AXIS); // CORE handled transparently + current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS); + current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); + #endif +} + #if ENABLED(MESH_BED_LEVELING) // This function is used to split lines on mesh borders so each segment is only part of one mesh area From cde068ea42041897c088ddf796f676d1f1ea92ad Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Jul 2016 14:36:10 -0700 Subject: [PATCH 454/580] Use set_current_from_steppers in quickstop_stepper --- Marlin/Marlin_main.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ea52c0ad3..b8cf3f735 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6076,18 +6076,9 @@ inline void gcode_M400() { stepper.synchronize(); } void quickstop_stepper() { stepper.quick_stop(); - #if DISABLED(DELTA) && DISABLED(SCARA) + #if DISABLED(SCARA) stepper.synchronize(); - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - vector_3 pos = planner.adjusted_position(); // values directly from steppers... - current_position[X_AXIS] = pos.x; - current_position[Y_AXIS] = pos.y; - current_position[Z_AXIS] = pos.z; - #else - current_position[X_AXIS] = stepper.get_axis_position_mm(X_AXIS); - current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS); - current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); - #endif + set_current_from_steppers(); sync_plan_position(); // ...re-apply to planner position #endif } From 4b1725628be3353fa09fbd283a8cf3a0144404c9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Jul 2016 14:37:10 -0700 Subject: [PATCH 455/580] Move kinematic functions to "private" scope --- Marlin/Marlin.h | 4 ---- Marlin/Marlin_main.cpp | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 0c36168df..b1e656b67 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -317,10 +317,6 @@ float code_value_temp_diff(); extern float delta_diagonal_rod_trim_tower_3; void calculate_delta(float cartesian[3]); void recalc_delta_settings(float radius, float diagonal_rod); - float delta_safe_distance_from_top(); - void set_cartesian_from_steppers(); - void forwardKinematics(float point[3]); - void forwardKinematics(float z1, float z2, float z3); #if ENABLED(AUTO_BED_LEVELING_FEATURE) extern int delta_grid_spacing[2]; void adjust_delta(float cartesian[3]); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b8cf3f735..900f3a32c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -487,6 +487,7 @@ static uint8_t target_extruder; int delta_grid_spacing[2] = { 0, 0 }; float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS]; #endif + float delta_safe_distance_from_top(); #else static bool home_all_axis = true; #endif From 9c4ad7d7efa8015b88eb56fe1a7721e4f1626514 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Jul 2016 14:37:52 -0700 Subject: [PATCH 456/580] Clean up delta declarations in Marlin_main.cpp --- Marlin/Marlin_main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 900f3a32c..e2e62a9ed 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -336,9 +336,6 @@ float home_offset[3] = { 0 }; // Software Endstops. Default to configured limits. float sw_endstop_min[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float sw_endstop_max[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; -#if ENABLED(DELTA) - float delta_clip_start_height = Z_MAX_POS; -#endif #if FAN_COUNT > 0 int fanSpeeds[FAN_COUNT] = { 0 }; @@ -481,8 +478,8 @@ static uint8_t target_extruder; float delta_diagonal_rod_2_tower_1 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_1); float delta_diagonal_rod_2_tower_2 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_2); float delta_diagonal_rod_2_tower_3 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_3); - //float delta_diagonal_rod_2 = sq(delta_diagonal_rod); float delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; + float delta_clip_start_height = Z_MAX_POS; #if ENABLED(AUTO_BED_LEVELING_FEATURE) int delta_grid_spacing[2] = { 0, 0 }; float bed_level[AUTO_BED_LEVELING_GRID_POINTS][AUTO_BED_LEVELING_GRID_POINTS]; From d5e2d523c7d7e7a32c3867848711a54abe7f79da Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Jul 2016 15:46:22 -0700 Subject: [PATCH 457/580] Generalize kinematics function names --- Marlin/Marlin.h | 6 ++-- Marlin/Marlin_main.cpp | 61 ++++++++++++++++++--------------------- Marlin/planner_bezier.cpp | 2 +- Marlin/ultralcd.cpp | 4 +-- 4 files changed, 34 insertions(+), 39 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index b1e656b67..7ed7d37cb 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -315,7 +315,7 @@ float code_value_temp_diff(); extern float delta_diagonal_rod_trim_tower_1; extern float delta_diagonal_rod_trim_tower_2; extern float delta_diagonal_rod_trim_tower_3; - void calculate_delta(float cartesian[3]); + void inverse_kinematics(float cartesian[3]); void recalc_delta_settings(float radius, float diagonal_rod); #if ENABLED(AUTO_BED_LEVELING_FEATURE) extern int delta_grid_spacing[2]; @@ -323,8 +323,8 @@ float code_value_temp_diff(); #endif #elif ENABLED(SCARA) extern float axis_scaling[3]; // Build size scaling - void calculate_delta(float cartesian[3]); - void calculate_SCARA_forward_Transform(float f_scara[3]); + void inverse_kinematics(float cartesian[3]); + void forward_kinematics_SCARA(float f_scara[3]); #endif #if ENABLED(Z_DUAL_ENDSTOPS) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e2e62a9ed..faef1820f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -613,7 +613,7 @@ static void report_current_position(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_delta", current_position); #endif - calculate_delta(current_position); + inverse_kinematics(current_position); planner.set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); } #define SYNC_PLAN_POSITION_KINEMATIC() sync_plan_position_delta() @@ -1528,7 +1528,7 @@ static void set_axis_is_at_home(AxisEnum axis) { * Works out real Homeposition angles using inverse kinematics, * and calculates homing offset using forward kinematics */ - calculate_delta(homeposition); + inverse_kinematics(homeposition); // SERIAL_ECHOPGM("base Theta= "); SERIAL_ECHO(delta[X_AXIS]); // SERIAL_ECHOPGM(" base Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]); @@ -1540,7 +1540,7 @@ static void set_axis_is_at_home(AxisEnum axis) { // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]); // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]); - calculate_SCARA_forward_Transform(delta); + forward_kinematics_SCARA(delta); // SERIAL_ECHOPGM("Delta X="); SERIAL_ECHO(delta[X_AXIS]); // SERIAL_ECHOPGM(" Delta Y="); SERIAL_ECHOLN(delta[Y_AXIS]); @@ -1658,7 +1658,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination); #endif refresh_cmd_timeout(); - calculate_delta(destination); + inverse_kinematics(destination); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); set_current_to_destination(); } @@ -5886,7 +5886,7 @@ inline void gcode_M303() { //gcode_get_destination(); // For X Y Z E F delta[X_AXIS] = delta_x; delta[Y_AXIS] = delta_y; - calculate_SCARA_forward_Transform(delta); + forward_kinematics_SCARA(delta); destination[X_AXIS] = delta[X_AXIS] / axis_scaling[X_AXIS]; destination[Y_AXIS] = delta[Y_AXIS] / axis_scaling[Y_AXIS]; prepare_move_to_destination(); @@ -6275,7 +6275,7 @@ inline void gcode_M503() { // Define runplan for move axes #if ENABLED(DELTA) - #define RUNPLAN(RATE_MM_S) calculate_delta(destination); \ + #define RUNPLAN(RATE_MM_S) inverse_kinematics(destination); \ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], RATE_MM_S, active_extruder); #else #define RUNPLAN(RATE_MM_S) line_to_destination(MMS_TO_MMM(RATE_MM_S)); @@ -6397,7 +6397,7 @@ inline void gcode_M503() { #if ENABLED(DELTA) // Move XYZ to starting position, then E - calculate_delta(lastpos); + inverse_kinematics(lastpos); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], FILAMENT_CHANGE_XY_FEEDRATE, active_extruder); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], lastpos[E_AXIS], FILAMENT_CHANGE_XY_FEEDRATE, active_extruder); #else @@ -7737,7 +7737,7 @@ void clamp_to_software_endstops(float target[3]) { delta_diagonal_rod_2_tower_3 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_3); } - void calculate_delta(float cartesian[3]) { + void inverse_kinematics(float cartesian[3]) { delta[TOWER_1] = sqrt(delta_diagonal_rod_2_tower_1 - sq(delta_tower1_x - cartesian[X_AXIS]) @@ -7764,14 +7764,14 @@ void clamp_to_software_endstops(float target[3]) { float delta_safe_distance_from_top() { float cartesian[3] = { 0 }; - calculate_delta(cartesian); + inverse_kinematics(cartesian); float distance = delta[TOWER_3]; cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS; - calculate_delta(cartesian); + inverse_kinematics(cartesian); return abs(distance - delta[TOWER_3]); } - void forwardKinematics(float z1, float z2, float z3) { + void forward_kinematics_DELTA(float z1, float z2, float z3) { //As discussed in Wikipedia "Trilateration" //we are establishing a new coordinate //system in the plane of the three carriage points. @@ -7840,12 +7840,12 @@ void clamp_to_software_endstops(float target[3]) { cartesian_position[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew; }; - void forwardKinematics(float point[3]) { - forwardKinematics(point[X_AXIS], point[Y_AXIS], point[Z_AXIS]); + void forward_kinematics_DELTA(float point[3]) { + forward_kinematics_DELTA(point[X_AXIS], point[Y_AXIS], point[Z_AXIS]); } void set_cartesian_from_steppers() { - forwardKinematics(stepper.get_axis_position_mm(X_AXIS), + forward_kinematics_DELTA(stepper.get_axis_position_mm(X_AXIS), stepper.get_axis_position_mm(Y_AXIS), stepper.get_axis_position_mm(Z_AXIS)); } @@ -7973,7 +7973,7 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ #if ENABLED(DELTA) || ENABLED(SCARA) - inline bool prepare_delta_move_to(float target[NUM_AXIS]) { + inline bool prepare_kinematic_move_to(float target[NUM_AXIS]) { float difference[NUM_AXIS]; for (int8_t i = 0; i < NUM_AXIS; i++) difference[i] = target[i] - current_position[i]; @@ -7996,14 +7996,14 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ for (int8_t i = 0; i < NUM_AXIS; i++) target[i] = current_position[i] + difference[i] * fraction; - calculate_delta(target); + inverse_kinematics(target); #if ENABLED(AUTO_BED_LEVELING_FEATURE) if (!bed_leveling_in_progress) adjust_delta(target); #endif - //DEBUG_POS("prepare_delta_move_to", target); - //DEBUG_POS("prepare_delta_move_to", delta); + //DEBUG_POS("prepare_kinematic_move_to", target); + //DEBUG_POS("prepare_kinematic_move_to", delta); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], _feedrate_mm_s, active_extruder); } @@ -8012,10 +8012,6 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ #endif // DELTA || SCARA -#if ENABLED(SCARA) - inline bool prepare_scara_move_to(float target[NUM_AXIS]) { return prepare_delta_move_to(target); } -#endif - #if ENABLED(DUAL_X_CARRIAGE) inline bool prepare_move_to_destination_dualx() { @@ -8114,10 +8110,8 @@ void prepare_move_to_destination() { prevent_dangerous_extrude(current_position[E_AXIS], destination[E_AXIS]); #endif - #if ENABLED(SCARA) - if (!prepare_scara_move_to(destination)) return; - #elif ENABLED(DELTA) - if (!prepare_delta_move_to(destination)) return; + #if ENABLED(DELTA) || ENABLED(SCARA) + if (!prepare_kinematic_move_to(destination)) return; #else #if ENABLED(DUAL_X_CARRIAGE) if (!prepare_move_to_destination_dualx()) return; @@ -8253,7 +8247,7 @@ void prepare_move_to_destination() { clamp_to_software_endstops(arc_target); #if ENABLED(DELTA) || ENABLED(SCARA) - calculate_delta(arc_target); + inverse_kinematics(arc_target); #if ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(arc_target); #endif @@ -8265,7 +8259,7 @@ void prepare_move_to_destination() { // Ensure last segment arrives at target location. #if ENABLED(DELTA) || ENABLED(SCARA) - calculate_delta(target); + inverse_kinematics(target); #if ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(target); #endif @@ -8333,7 +8327,7 @@ void prepare_move_to_destination() { #if ENABLED(SCARA) - void calculate_SCARA_forward_Transform(float f_scara[3]) { + void forward_kinematics_SCARA(float f_scara[3]) { // Perform forward kinematics, and place results in delta[3] // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014 @@ -8359,10 +8353,11 @@ void prepare_move_to_destination() { //SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); } - void calculate_delta(float cartesian[3]) { - //reverse kinematics. - // Perform reversed kinematics, and place results in delta[3] - // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014 + void inverse_kinematics(float cartesian[3]) { + // Inverse kinematics. + // Perform SCARA IK and place results in delta[3]. + // The maths and first version were done by QHARLEY. + // Integrated, tweaked by Joachim Cerny in June 2014. float SCARA_pos[2]; static float SCARA_C2, SCARA_S2, SCARA_K1, SCARA_K2, SCARA_theta, SCARA_psi; diff --git a/Marlin/planner_bezier.cpp b/Marlin/planner_bezier.cpp index ad3319a49..9ad57fbc0 100644 --- a/Marlin/planner_bezier.cpp +++ b/Marlin/planner_bezier.cpp @@ -189,7 +189,7 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] clamp_to_software_endstops(bez_target); #if ENABLED(DELTA) || ENABLED(SCARA) - calculate_delta(bez_target); + inverse_kinematics(bez_target); #if ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(bez_target); #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 7264f7b40..17d41cd3d 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -564,7 +564,7 @@ void kill_screen(const char* lcd_msg) { inline void line_to_current(AxisEnum axis) { #if ENABLED(DELTA) - calculate_delta(current_position); + inverse_kinematics(current_position); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder); #else // !DELTA planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder); @@ -1301,7 +1301,7 @@ void kill_screen(const char* lcd_msg) { inline void manage_manual_move() { if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { #if ENABLED(DELTA) - calculate_delta(current_position); + inverse_kinematics(current_position); planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index); #else planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_e_index); From b6afa028f4701d3844001e899b1d61f159bcaaa3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 16:19:41 -0700 Subject: [PATCH 458/580] Don't call adjust_delta on SCARA --- Marlin/Marlin_main.cpp | 6 +++--- Marlin/planner_bezier.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index faef1820f..3677ad2d8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7998,7 +7998,7 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ inverse_kinematics(target); - #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #if ENABLED(DELTA) && ENABLED(AUTO_BED_LEVELING_FEATURE) if (!bed_leveling_in_progress) adjust_delta(target); #endif @@ -8248,7 +8248,7 @@ void prepare_move_to_destination() { #if ENABLED(DELTA) || ENABLED(SCARA) inverse_kinematics(arc_target); - #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #if ENABLED(DELTA) && ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(arc_target); #endif planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], fr_mm_s, active_extruder); @@ -8260,7 +8260,7 @@ void prepare_move_to_destination() { // Ensure last segment arrives at target location. #if ENABLED(DELTA) || ENABLED(SCARA) inverse_kinematics(target); - #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #if ENABLED(DELTA) && ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(target); #endif planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], fr_mm_s, active_extruder); diff --git a/Marlin/planner_bezier.cpp b/Marlin/planner_bezier.cpp index 9ad57fbc0..6ca7afd1d 100644 --- a/Marlin/planner_bezier.cpp +++ b/Marlin/planner_bezier.cpp @@ -190,7 +190,7 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] #if ENABLED(DELTA) || ENABLED(SCARA) inverse_kinematics(bez_target); - #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #if ENABLED(DELTA) && ENABLED(AUTO_BED_LEVELING_FEATURE) adjust_delta(bez_target); #endif planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], bez_target[E_AXIS], fr_mm_s, extruder); From ecd48027faca4cd153fc11fb7e6393e24e77e7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 23 Jul 2016 01:41:25 +0100 Subject: [PATCH 459/580] Adds short timestamp format to timestamp_t --- Marlin/timestamp_t.h | 52 ++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/Marlin/timestamp_t.h b/Marlin/timestamp_t.h index 2a18eb00f..8295360d1 100644 --- a/Marlin/timestamp_t.h +++ b/Marlin/timestamp_t.h @@ -30,13 +30,13 @@ struct timestamp_t { uint32_t timestamp; /** - * @brief Date time blank constructor + * @brief Timestamp blank constructor */ timestamp_t() : timestamp_t(0) {}; /** - * @brief Date time constructor + * @briefTimestamp constructor * @details Initializes the timestamp_t structure based on a number of seconds * * @param seconds The number of seconds @@ -46,7 +46,7 @@ struct timestamp_t { } /** - * @brief Formats the date as number of years + * @brief Formats the timestamp in years * @return The number of years */ inline uint8_t year() const { @@ -54,7 +54,7 @@ struct timestamp_t { } /** - * @brief Formats the date as number of days + * @brief Formats the timestamp in days * @return The number of days */ inline uint16_t day() const { @@ -62,7 +62,7 @@ struct timestamp_t { } /** - * @brief Formats the date as number of hours + * @brief Formats the timestamp in hours * @return The number of hours */ inline uint32_t hour() const { @@ -70,7 +70,7 @@ struct timestamp_t { } /** - * @brief Formats the date as number of minutes + * @brief Formats the timestamp in minutes * @return The number of minutes */ inline uint32_t minute() const { @@ -78,7 +78,7 @@ struct timestamp_t { } /** - * @brief Formats the date as number of seconds + * @brief Formats the timestamp in seconds * @return The number of seconds */ inline uint32_t second() const { @@ -86,12 +86,14 @@ struct timestamp_t { } /** - * @brief Formats the date as a string + * @brief Formats the timestamp as a string * @details Returns the timestamp formated as a string * - * @param buffer The array pointed to must be able to accommodate 21 bytes + * @param buffer The array pointed to must be able to accommodate 21 bytes when + * on standard mode or 10 bytes otherwise. + * @param shorty If true a short representation will be returned. * - * String output examples: + * Standard toString() output examples: * 123456789012345678901 (strlen) * 135y 364d 23h 59m 59s * 364d 23h 59m 59s @@ -99,19 +101,27 @@ struct timestamp_t { * 59m 59s * 59s * + * Short toString() output examples: + * 1234567890 (strlen) + * 1193046:59 + * */ - void toString(char *buffer) const { - int y = this->year(), - d = this->day() % 365, - h = this->hour() % 24, - m = this->minute() % 60, - s = this->second() % 60; + void toString(char *buffer, bool const &shorty = false) const { + int h = this->hour() % 24, + m = this->minute() % 60; + + if (shorty) sprintf_P(buffer, PSTR("%02i:%02i"), h, m); + else { + int y = this->year(), + d = this->day() % 365, + s = this->second() % 60; - if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); - else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); - else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); - else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); - else sprintf_P(buffer, PSTR("%is"), s); + if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); + else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); + else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); + else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); + else sprintf_P(buffer, PSTR("%is"), s); + } } }; From b4aad85c9ae3729711b55912ce2aeda8c59cad8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 23 Jul 2016 01:42:21 +0100 Subject: [PATCH 460/580] Rework stats menu to use timestamp_t --- Marlin/ultralcd.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 7264f7b40..cdb75b870 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -31,6 +31,7 @@ #if ENABLED(PRINTCOUNTER) #include "printcounter.h" + #include "timestamp_t.h" #endif int preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1, @@ -1971,23 +1972,17 @@ void kill_screen(const char* lcd_msg) { static void lcd_info_stats_menu() { if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } - PrintCounter print_job_counter = PrintCounter(); - print_job_counter.loadStats(); - printStatistics stats = print_job_counter.getStats(); + printStatistics stats = print_job_timer.getStats(); + timestamp_t time(stats.printTime); - char timeString[14]; - sprintf_P(timeString, - PSTR("%i" MSG_SHORT_DAY " %i" MSG_SHORT_HOUR " %i" MSG_SHORT_MINUTE), - int(stats.printTime / 60 / 60 / 24), - int((stats.printTime / 60 / 60) % 24), - int((stats.printTime / 60) % 60) - ); + char buffer[21]; + time.toString(buffer); START_SCREEN(); // 12345678901234567890 STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total Time : - STATIC_ITEM(" ", false, false, timeString); // 12345d 12h 34m + STATIC_ITEM(" ", false, false, buffer); // 12345d 12h 34m END_SCREEN(); } #endif // PRINTCOUNTER From 35a610abf96ddbd8a0bf09a8cd91580a63753c2f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 17:42:48 -0700 Subject: [PATCH 461/580] const arg to inverse_kinematics --- Marlin/Marlin.h | 4 ++-- Marlin/Marlin_main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 7ed7d37cb..428531885 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -315,7 +315,7 @@ float code_value_temp_diff(); extern float delta_diagonal_rod_trim_tower_1; extern float delta_diagonal_rod_trim_tower_2; extern float delta_diagonal_rod_trim_tower_3; - void inverse_kinematics(float cartesian[3]); + void inverse_kinematics(const float cartesian[3]); void recalc_delta_settings(float radius, float diagonal_rod); #if ENABLED(AUTO_BED_LEVELING_FEATURE) extern int delta_grid_spacing[2]; @@ -323,7 +323,7 @@ float code_value_temp_diff(); #endif #elif ENABLED(SCARA) extern float axis_scaling[3]; // Build size scaling - void inverse_kinematics(float cartesian[3]); + void inverse_kinematics(const float cartesian[3]); void forward_kinematics_SCARA(float f_scara[3]); #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3677ad2d8..f36c175b4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7737,7 +7737,7 @@ void clamp_to_software_endstops(float target[3]) { delta_diagonal_rod_2_tower_3 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_3); } - void inverse_kinematics(float cartesian[3]) { + void inverse_kinematics(const float in_cartesian[3]) { delta[TOWER_1] = sqrt(delta_diagonal_rod_2_tower_1 - sq(delta_tower1_x - cartesian[X_AXIS]) @@ -8353,7 +8353,7 @@ void prepare_move_to_destination() { //SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]); } - void inverse_kinematics(float cartesian[3]) { + void inverse_kinematics(const float cartesian[3]) { // Inverse kinematics. // Perform SCARA IK and place results in delta[3]. // The maths and first version were done by QHARLEY. From b3eb0c8569f399fbcf1ad2739669d9ed6be9b1db Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 17:46:05 -0700 Subject: [PATCH 462/580] Add LOGICAL_POSITION macro, apply to kinematics --- Marlin/Marlin_main.cpp | 92 ++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f36c175b4..699331e9d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -330,6 +330,7 @@ float position_shift[3] = { 0 }; // Set by M206, M428, or menu item. Saved to EEPROM. float home_offset[3] = { 0 }; +#define LOGICAL_POSITION(POS, AXIS) (POS + home_offset[AXIS] + position_shift[AXIS]) #define RAW_POSITION(POS, AXIS) (POS - home_offset[AXIS] - position_shift[AXIS]) #define RAW_CURRENT_POSITION(AXIS) (RAW_POSITION(current_position[AXIS], AXIS)) @@ -1402,7 +1403,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static float x_home_pos(int extruder) { if (extruder == 0) - return base_home_pos(X_AXIS) + home_offset[X_AXIS]; + return LOGICAL_POSITION(base_home_pos(X_AXIS), X_AXIS); else /** * In dual carriage mode the extruder offset provides an override of the @@ -1437,7 +1438,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); * at the same positions relative to the machine. */ static void update_software_endstops(AxisEnum axis) { - float offs = home_offset[axis] + position_shift[axis]; + float offs = LOGICAL_POSITION(0, axis); #if ENABLED(DUAL_X_CARRIAGE) if (axis == X_AXIS) { @@ -1508,7 +1509,7 @@ static void set_axis_is_at_home(AxisEnum axis) { if (active_extruder != 0) current_position[X_AXIS] = x_home_pos(active_extruder); else - current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS]; + current_position[X_AXIS] = LOGICAL_POSITION(base_home_pos(X_AXIS), X_AXIS); update_software_endstops(X_AXIS); return; } @@ -1519,7 +1520,8 @@ static void set_axis_is_at_home(AxisEnum axis) { if (axis == X_AXIS || axis == Y_AXIS) { float homeposition[3]; - for (int i = 0; i < 3; i++) homeposition[i] = base_home_pos(i); + for (uint8_t i = X_AXIS; i <= Z_AXIS; i++) + homeposition[i] = LOGICAL_POSITION(base_home_pos(i), i); // SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]); // SERIAL_ECHOPGM("homeposition[y]= "); SERIAL_ECHOLN(homeposition[1]); @@ -1529,23 +1531,12 @@ static void set_axis_is_at_home(AxisEnum axis) { * and calculates homing offset using forward kinematics */ inverse_kinematics(homeposition); - - // SERIAL_ECHOPGM("base Theta= "); SERIAL_ECHO(delta[X_AXIS]); - // SERIAL_ECHOPGM(" base Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]); - - for (int i = 0; i < 2; i++) delta[i] -= home_offset[i]; - - // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(home_offset[X_AXIS]); - // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(home_offset[Y_AXIS]); - // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]); - // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]); - forward_kinematics_SCARA(delta); - // SERIAL_ECHOPGM("Delta X="); SERIAL_ECHO(delta[X_AXIS]); + // SERIAL_ECHOPAIR("Delta X=", delta[X_AXIS]); // SERIAL_ECHOPGM(" Delta Y="); SERIAL_ECHOLN(delta[Y_AXIS]); - current_position[axis] = delta[axis]; + current_position[axis] = LOGICAL_POSITION(delta[axis], axis); /** * SCARA home positions are based on configuration since the actual @@ -1557,7 +1548,7 @@ static void set_axis_is_at_home(AxisEnum axis) { else #endif { - current_position[axis] = base_home_pos(axis) + home_offset[axis]; + current_position[axis] = LOGICAL_POSITION(base_home_pos(axis), axis); update_software_endstops(axis); #if HAS_BED_PROBE && Z_HOME_DIR < 0 && DISABLED(Z_MIN_PROBE_ENDSTOP) @@ -1786,7 +1777,7 @@ static void clean_up_after_endstop_or_probe_move() { SERIAL_ECHOLNPGM(")"); } #endif - float z_dest = home_offset[Z_AXIS] + z_raise; + float z_dest = LOGICAL_POSITION(z_raise, Z_AXIS); if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; @@ -2089,7 +2080,7 @@ static void clean_up_after_endstop_or_probe_move() { #if ENABLED(DELTA) #define SET_Z_FROM_STEPPERS() set_current_from_steppers() #else - #define SET_Z_FROM_STEPPERS() current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS) + #define SET_Z_FROM_STEPPERS() current_position[Z_AXIS] = LOGICAL_POSITION(stepper.get_axis_position_mm(Z_AXIS), Z_AXIS) #endif // Do a single Z probe and return with current_position[Z_AXIS] @@ -2958,7 +2949,7 @@ inline void gcode_G28() { if (home_all_axis || homeX || homeY) { // Raise Z before homing any other axes and z is not already high enough (never lower z) - destination[Z_AXIS] = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING; + destination[Z_AXIS] = LOGICAL_POSITION(MIN_Z_HEIGHT_FOR_HOMING, Z_AXIS); if (destination[Z_AXIS] > current_position[Z_AXIS]) { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3213,12 +3204,12 @@ inline void gcode_G28() { ; line_to_current_position(); - current_position[X_AXIS] = x + home_offset[X_AXIS]; - current_position[Y_AXIS] = y + home_offset[Y_AXIS]; + current_position[X_AXIS] = LOGICAL_POSITION(x, X_AXIS); + current_position[Y_AXIS] = LOGICAL_POSITION(y, Y_AXIS); line_to_current_position(); #if Z_RAISE_BETWEEN_PROBINGS > 0 || MIN_Z_HEIGHT_FOR_HOMING > 0 - current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; + current_position[Z_AXIS] = LOGICAL_POSITION(MESH_HOME_SEARCH_Z, Z_AXIS); line_to_current_position(); #endif @@ -3636,14 +3627,14 @@ inline void gcode_G28() { #endif // Probe at 3 arbitrary points - float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS], - ABL_PROBE_PT_1_Y + home_offset[Y_AXIS], + float z_at_pt_1 = probe_pt( LOGICAL_POSITION(ABL_PROBE_PT_1_X, X_AXIS), + LOGICAL_POSITION(ABL_PROBE_PT_1_Y, Y_AXIS), stow_probe_after_each, verbose_level), - z_at_pt_2 = probe_pt( ABL_PROBE_PT_2_X + home_offset[X_AXIS], - ABL_PROBE_PT_2_Y + home_offset[Y_AXIS], + z_at_pt_2 = probe_pt( LOGICAL_POSITION(ABL_PROBE_PT_2_X, X_AXIS), + LOGICAL_POSITION(ABL_PROBE_PT_2_Y, Y_AXIS), stow_probe_after_each, verbose_level), - z_at_pt_3 = probe_pt( ABL_PROBE_PT_3_X + home_offset[X_AXIS], - ABL_PROBE_PT_3_Y + home_offset[Y_AXIS], + z_at_pt_3 = probe_pt( LOGICAL_POSITION(ABL_PROBE_PT_3_X, X_AXIS), + LOGICAL_POSITION(ABL_PROBE_PT_3_Y, Y_AXIS), stow_probe_after_each, verbose_level); if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); @@ -5174,9 +5165,9 @@ static void report_current_position() { SERIAL_EOL; SERIAL_PROTOCOLPGM("SCARA Cal - Theta:"); - SERIAL_PROTOCOL(delta[X_AXIS] + home_offset[X_AXIS]); + SERIAL_PROTOCOL(delta[X_AXIS]); SERIAL_PROTOCOLPGM(" Psi+Theta (90):"); - SERIAL_PROTOCOL(delta[Y_AXIS] - delta[X_AXIS] - 90 + home_offset[Y_AXIS]); + SERIAL_PROTOCOL(delta[Y_AXIS] - delta[X_AXIS] - 90); SERIAL_EOL; SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:"); @@ -6143,7 +6134,7 @@ inline void gcode_M428() { for (int8_t i = X_AXIS; i <= Z_AXIS; i++) { if (axis_homed[i]) { float base = (current_position[i] > (sw_endstop_min[i] + sw_endstop_max[i]) / 2) ? base_home_pos(i) : 0, - diff = current_position[i] - base; + diff = current_position[i] - LOGICAL_POSITION(base, i); if (diff > -20 && diff < 20) { set_home_offset((AxisEnum)i, home_offset[i] - diff); } @@ -7739,6 +7730,12 @@ void clamp_to_software_endstops(float target[3]) { void inverse_kinematics(const float in_cartesian[3]) { + const float cartesian[3] = { + RAW_POSITION(in_cartesian[X_AXIS], X_AXIS), + RAW_POSITION(in_cartesian[Y_AXIS], Y_AXIS), + RAW_POSITION(in_cartesian[Z_AXIS], Z_AXIS) + }; + delta[TOWER_1] = sqrt(delta_diagonal_rod_2_tower_1 - sq(delta_tower1_x - cartesian[X_AXIS]) - sq(delta_tower1_y - cartesian[Y_AXIS]) @@ -7763,10 +7760,14 @@ void clamp_to_software_endstops(float target[3]) { } float delta_safe_distance_from_top() { - float cartesian[3] = { 0 }; + float cartesian[3] = { + LOGICAL_POSITION(0, X_AXIS), + LOGICAL_POSITION(0, Y_AXIS), + LOGICAL_POSITION(0, Z_AXIS) + }; inverse_kinematics(cartesian); float distance = delta[TOWER_3]; - cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS; + cartesian[Y_AXIS] = LOGICAL_POSITION(DELTA_PRINTABLE_RADIUS, Y_AXIS); inverse_kinematics(cartesian); return abs(distance - delta[TOWER_3]); } @@ -7846,8 +7847,8 @@ void clamp_to_software_endstops(float target[3]) { void set_cartesian_from_steppers() { forward_kinematics_DELTA(stepper.get_axis_position_mm(X_AXIS), - stepper.get_axis_position_mm(Y_AXIS), - stepper.get_axis_position_mm(Z_AXIS)); + stepper.get_axis_position_mm(Y_AXIS), + stepper.get_axis_position_mm(Z_AXIS)); } #if ENABLED(AUTO_BED_LEVELING_FEATURE) @@ -7858,8 +7859,8 @@ void clamp_to_software_endstops(float target[3]) { int half = (AUTO_BED_LEVELING_GRID_POINTS - 1) / 2; float h1 = 0.001 - half, h2 = half - 0.001, - grid_x = max(h1, min(h2, cartesian[X_AXIS] / delta_grid_spacing[0])), - grid_y = max(h1, min(h2, cartesian[Y_AXIS] / delta_grid_spacing[1])); + grid_x = max(h1, min(h2, RAW_POSITION(cartesian[X_AXIS], X_AXIS) / delta_grid_spacing[0])), + grid_y = max(h1, min(h2, RAW_POSITION(cartesian[Y_AXIS], Y_AXIS) / delta_grid_spacing[1])); int floor_x = floor(grid_x), floor_y = floor(grid_y); float ratio_x = grid_x - floor_x, ratio_y = grid_y - floor_y, z1 = bed_level[floor_x + half][floor_y + half], @@ -7910,6 +7911,9 @@ void set_current_from_steppers() { current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS); current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); #endif + + for (uint8_t i = X_AXIS; i <= Z_AXIS; i++) + current_position[i] += LOGICAL_POSITION(0, i); } #if ENABLED(MESH_BED_LEVELING) @@ -7940,14 +7944,14 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); if (cx2 != cx1 && TEST(x_splits, gcx)) { memcpy(end, destination, sizeof(end)); - destination[X_AXIS] = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS]; + destination[X_AXIS] = LOGICAL_POSITION(mbl.get_probe_x(gcx), X_AXIS); normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); destination[Y_AXIS] = MBL_SEGMENT_END(Y); CBI(x_splits, gcx); } else if (cy2 != cy1 && TEST(y_splits, gcy)) { memcpy(end, destination, sizeof(end)); - destination[Y_AXIS] = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS]; + destination[Y_AXIS] = LOGICAL_POSITION(mbl.get_probe_y(gcy), Y_AXIS); normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); destination[X_AXIS] = MBL_SEGMENT_END(X); CBI(y_splits, gcy); @@ -8362,8 +8366,8 @@ void prepare_move_to_destination() { float SCARA_pos[2]; static float SCARA_C2, SCARA_S2, SCARA_K1, SCARA_K2, SCARA_theta, SCARA_psi; - SCARA_pos[X_AXIS] = cartesian[X_AXIS] * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y - SCARA_pos[Y_AXIS] = cartesian[Y_AXIS] * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor. + SCARA_pos[X_AXIS] = RAW_POSITION(cartesian[X_AXIS], X_AXIS) * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y + SCARA_pos[Y_AXIS] = RAW_POSITION(cartesian[Y_AXIS], Y_AXIS) * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor. #if (Linkage_1 == Linkage_2) SCARA_C2 = ((sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS])) / (2 * (float)L1_2)) - 1; @@ -8381,7 +8385,7 @@ void prepare_move_to_destination() { delta[X_AXIS] = SCARA_theta * SCARA_RAD2DEG; // Multiply by 180/Pi - theta is support arm angle delta[Y_AXIS] = (SCARA_theta + SCARA_psi) * SCARA_RAD2DEG; // - equal to sub arm angle (inverted motor) - delta[Z_AXIS] = cartesian[Z_AXIS]; + delta[Z_AXIS] = RAW_POSITION(cartesian[Z_AXIS], Z_AXIS); /** SERIAL_ECHOPGM("cartesian x="); SERIAL_ECHO(cartesian[X_AXIS]); From 86d9311495c93fa658fa2668eb0a7443166df9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 23 Jul 2016 01:42:48 +0100 Subject: [PATCH 463/580] Rework LCD implementation to use timestamp_t --- Marlin/ultralcd_impl_DOGM.h | 14 ++++++++------ Marlin/ultralcd_impl_HD44780.h | 16 +++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 3ab0b17e7..22a86a5da 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -58,6 +58,8 @@ #include "ultralcd_st7920_u8glib_rrd.h" #include "Configuration.h" +#include "timestamp_t.h" + #if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT) #undef USE_BIG_EDIT_FONT #endif @@ -387,12 +389,12 @@ static void lcd_implementation_status_screen() { } u8g.setPrintPos(80,48); - millis_t time = print_job_timer.duration() / 60; - if (time != 0) { - lcd_print(itostr2(time/60)); - lcd_print(':'); - lcd_print(itostr2(time%60)); - } + + char buffer[10]; + timestamp_t time(print_job_timer.duration()); + time.toString(buffer, true); + if (time.timestamp != 0) lcd_print(buffer); + else lcd_printPGM(PSTR("--:--")); #endif // Extruders diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index 16159b1fc..271cb3ff9 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -27,6 +27,8 @@ * Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays. **/ +#include "timestamp_t.h" + extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array. //////////////////////////////////// @@ -760,15 +762,11 @@ static void lcd_implementation_status_screen() { lcd.setCursor(LCD_WIDTH - 6, 2); lcd.print(LCD_STR_CLOCK[0]); - uint16_t time = print_job_timer.duration() / 60; - if (time != 0) { - lcd.print(itostr2(time / 60)); - lcd.print(':'); - lcd.print(itostr2(time % 60)); - } - else { - lcd_printPGM(PSTR("--:--")); - } + char buffer[10]; + timestamp_t time(print_job_timer.duration()); + time.toString(buffer, true); + if (time.timestamp != 0) lcd_print(buffer); + else lcd_printPGM(PSTR("--:--")); #endif // LCD_HEIGHT > 3 From 9e5dbf67e8dc1d0d10d053c47e76a4a162105ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 23 Jul 2016 02:48:21 +0100 Subject: [PATCH 464/580] Update the stats menu to include longest job and extruded filament --- Marlin/language_en.h | 21 +++++++++++++++++---- Marlin/ultralcd.cpp | 21 +++++++++++++++------ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Marlin/language_en.h b/Marlin/language_en.h index eba87d3df..f59981082 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -561,22 +561,35 @@ #define MSG_INFO_PRINT_COUNT "Print Count" #endif #ifndef MSG_INFO_COMPLETED_PRINTS - #define MSG_INFO_COMPLETED_PRINTS "Completed " + #define MSG_INFO_COMPLETED_PRINTS "Completed" #endif #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME "Total Time " + #define MSG_INFO_PRINT_TIME "Total print time" + #endif + #ifndef MSG_INFO_PRINT_LONGEST + #define MSG_INFO_PRINT_LONGEST "Longest job time" + #endif + #ifndef MSG_INFO_PRINT_FILAMENT + #define MSG_INFO_PRINT_FILAMENT "Extruded total" #endif #else #ifndef MSG_INFO_PRINT_COUNT - #define MSG_INFO_PRINT_COUNT "Prints " + #define MSG_INFO_PRINT_COUNT "Prints" #endif #ifndef MSG_INFO_COMPLETED_PRINTS #define MSG_INFO_COMPLETED_PRINTS "Completed" #endif #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME "Duration " + #define MSG_INFO_PRINT_TIME "Total" + #endif + #ifndef MSG_INFO_PRINT_LONGEST + #define MSG_INFO_PRINT_LONGEST "Longest" + #endif + #ifndef MSG_INFO_PRINT_FILAMENT + #define MSG_INFO_PRINT_FILAMENT "Extruded" #endif #endif + #ifndef MSG_INFO_MIN_TEMP #define MSG_INFO_MIN_TEMP "Min Temp" #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index cdb75b870..95d5c3070 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1972,17 +1972,26 @@ void kill_screen(const char* lcd_msg) { static void lcd_info_stats_menu() { if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } + char buffer[21]; printStatistics stats = print_job_timer.getStats(); + + START_SCREEN(); // 12345678901234567890 + STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 + STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS" : ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 + timestamp_t time(stats.printTime); + time.toString(buffer); + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total print Time: + STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s - char buffer[21]; + time.timestamp = stats.longestPrint; time.toString(buffer); + STATIC_ITEM(MSG_INFO_PRINT_LONGEST ": ", false, false); // Longest job time: + STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s - START_SCREEN(); // 12345678901234567890 - STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 - STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 - STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total Time : - STATIC_ITEM(" ", false, false, buffer); // 12345d 12h 34m + sprintf_P(buffer, PSTR("%im"), stats.filamentUsed / 1000); + STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ": ", false, false); // Extruded total: + STATIC_ITEM("", false, false, buffer); // 125m END_SCREEN(); } #endif // PRINTCOUNTER From 6b8b45810628e4ee33119d70abf0cd8c272596c3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 20:35:39 -0700 Subject: [PATCH 465/580] Travis for ABL+SCARA, Z_MIN_PROBE_REPEATABILITY_TEST --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d1b0ef56..75dc16926 100644 --- a/.travis.yml +++ b/.travis.yml @@ -99,9 +99,9 @@ script: - opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING - build_marlin # - # ...with AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE + # ...with AUTO_BED_LEVELING_FEATURE, Z_MIN_PROBE_REPEATABILITY_TEST, & DEBUG_LEVELING_FEATURE # - - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE + - opt_enable AUTO_BED_LEVELING_FEATURE Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE - build_marlin # # Test a Sled Z Probe @@ -365,6 +365,7 @@ script: # SCARA Config # - use_example_configs SCARA + - opt_enable AUTO_BED_LEVELING_FEATURE FIX_MOUNTED_PROBE USE_ZMIN_PLUG - build_marlin # # tvrrug Config need to check board type for sanguino atmega644p From bb9da6ebdd62b2e400dfc8e1f4cf7cffc1937c09 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 23:37:41 -0700 Subject: [PATCH 466/580] Document DEBUG_LEVELING_FEATURE --- Marlin/Configuration.h | 4 ++++ Marlin/example_configurations/Cartesio/Configuration.h | 4 ++++ Marlin/example_configurations/Felix/Configuration.h | 4 ++++ Marlin/example_configurations/Felix/DUAL/Configuration.h | 4 ++++ Marlin/example_configurations/Hephestos/Configuration.h | 4 ++++ Marlin/example_configurations/Hephestos_2/Configuration.h | 4 ++++ Marlin/example_configurations/K8200/Configuration.h | 4 ++++ Marlin/example_configurations/K8400/Configuration.h | 4 ++++ Marlin/example_configurations/K8400/Dual-head/Configuration.h | 4 ++++ .../RepRapWorld/Megatronics/Configuration.h | 4 ++++ Marlin/example_configurations/RigidBot/Configuration.h | 4 ++++ Marlin/example_configurations/SCARA/Configuration.h | 4 ++++ Marlin/example_configurations/TAZ4/Configuration.h | 4 ++++ Marlin/example_configurations/WITBOX/Configuration.h | 4 ++++ Marlin/example_configurations/adafruit/ST7565/Configuration.h | 4 ++++ Marlin/example_configurations/delta/biv2.5/Configuration.h | 4 ++++ Marlin/example_configurations/delta/generic/Configuration.h | 4 ++++ .../example_configurations/delta/kossel_mini/Configuration.h | 4 ++++ .../example_configurations/delta/kossel_pro/Configuration.h | 4 ++++ Marlin/example_configurations/delta/kossel_xl/Configuration.h | 4 ++++ Marlin/example_configurations/makibox/Configuration.h | 4 ++++ Marlin/example_configurations/tvrrug/Round2/Configuration.h | 4 ++++ 22 files changed, 88 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index fe77dd00e..f810fcd0c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -669,6 +669,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index c0e1d3369..feaaefa17 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -669,6 +669,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index a70ee1340..0fc856308 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -651,6 +651,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index fe9068244..602a1b55e 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -649,6 +649,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 5013b505b..f6a2f1def 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -661,6 +661,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 98d2d4ffa..73878728d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -663,6 +663,10 @@ // @section bedlevel #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index f562b8a78..61d704467 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -686,6 +686,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index bc106ea47..b86d146f0 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -669,6 +669,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index e49bac657..a1d4d7d61 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -669,6 +669,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 93331357a..d09a46314 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -669,6 +669,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index b3a35bf11..57f0f455e 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -666,6 +666,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index d9fa05ae2..6c3e2de8f 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -677,6 +677,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index fbcd5e77b..6cac78e91 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -690,6 +690,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 014f85fc8..8f15e51e6 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -661,6 +661,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index a5718d6e1..0ec16f57b 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -669,6 +669,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index b745d4f80..67c55aaad 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -758,6 +758,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 4db009181..cb84cb96c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -752,6 +752,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 8599d74bb..fa7aabddc 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -755,6 +755,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 8cfd21994..13898efc0 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -749,6 +749,10 @@ // @section bedlevel #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 97e656aeb..f7a5d8474 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -750,6 +750,10 @@ // @section bedlevel #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 693c95119..6c91f2888 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -672,6 +672,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index f516ff978..a7e3f04f8 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -659,6 +659,10 @@ // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) + +// Enable this feature to get detailed logging of G28, G29, M48, etc. +// Logging is off by default. Enable this logging feature with 'M111 S32'. +// NOTE: Requires a huge amount of PROGMEM. //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) From ad16d5019ecb13e89a9e925689e873a8e596ec4d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Jul 2016 23:52:42 -0700 Subject: [PATCH 467/580] Additional logging of do_blocking_move_to --- Marlin/Marlin_main.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3e2c641ac..d6ed31d7d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1672,7 +1672,7 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { float old_feedrate_mm_m = feedrate_mm_m; #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), NULL, x, y, z); + if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, x, y, z); #endif #if ENABLED(DELTA) @@ -1681,6 +1681,10 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { set_destination_to_current(); // sync destination at the start + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("set_destination_to_current"), destination); + #endif + // when in the danger zone if (current_position[Z_AXIS] > delta_clip_start_height) { if (z > delta_clip_start_height) { // staying in the danger zone @@ -1688,28 +1692,47 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { destination[Y_AXIS] = y; destination[Z_AXIS] = z; prepare_move_to_destination_raw(); // set_current_to_destination + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("danger zone move"), current_position); + #endif return; } else { destination[Z_AXIS] = delta_clip_start_height; prepare_move_to_destination_raw(); // set_current_to_destination + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("zone border move"), current_position); + #endif } } if (z > current_position[Z_AXIS]) { // raising? destination[Z_AXIS] = z; prepare_move_to_destination_raw(); // set_current_to_destination + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("z raise move"), current_position); + #endif } destination[X_AXIS] = x; destination[Y_AXIS] = y; prepare_move_to_destination(); // set_current_to_destination + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("xy move"), current_position); + #endif if (z < current_position[Z_AXIS]) { // lowering? destination[Z_AXIS] = z; prepare_move_to_destination_raw(); // set_current_to_destination + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("z lower move"), current_position); + #endif } + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to"); + #endif + #else // If Z needs to raise, do it before moving XY From d32c4056ada91894d7587506d5b48c7ac49e4228 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 23 Jul 2016 16:37:46 +0900 Subject: [PATCH 468/580] Fix for the PR #4379 (Additional logging of do_blocking_move_to) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Remove unneeded PSTR() --- Marlin/Marlin_main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0b6531ea8..72613a1aa 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1677,7 +1677,7 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { set_destination_to_current(); // sync destination at the start #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("set_destination_to_current"), destination); + if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_to_current", destination); #endif // when in the danger zone @@ -1688,7 +1688,7 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { destination[Z_AXIS] = z; prepare_move_to_destination_raw(); // set_current_to_destination #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("danger zone move"), current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position); #endif return; } @@ -1696,7 +1696,7 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { destination[Z_AXIS] = delta_clip_start_height; prepare_move_to_destination_raw(); // set_current_to_destination #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("zone border move"), current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position); #endif } } @@ -1705,7 +1705,7 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { destination[Z_AXIS] = z; prepare_move_to_destination_raw(); // set_current_to_destination #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("z raise move"), current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position); #endif } @@ -1713,14 +1713,14 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { destination[Y_AXIS] = y; prepare_move_to_destination(); // set_current_to_destination #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("xy move"), current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position); #endif if (z < current_position[Z_AXIS]) { // lowering? destination[Z_AXIS] = z; prepare_move_to_destination_raw(); // set_current_to_destination #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("z lower move"), current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position); #endif } From 08459a003fbc3bf38e1128e047999c649347ef56 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Jul 2016 00:58:53 -0700 Subject: [PATCH 469/580] Undo the self-sabotage that is do_blocking_move_to_axis_pos --- Marlin/Marlin.h | 2 -- Marlin/Marlin_main.cpp | 16 ++++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 251df9982..3d097235e 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -407,9 +407,7 @@ void calculate_volumetric_multipliers(); * Blocking movement and shorthand functions */ inline void do_blocking_move_to(float x, float y, float z, float fr_mm_m=0.0); -inline void do_blocking_move_to_axis_pos(AxisEnum axis, float where, float fr_mm_m=0.0); inline void do_blocking_move_to_x(float x, float fr_mm_m=0.0); -inline void do_blocking_move_to_y(float y); inline void do_blocking_move_to_z(float z, float fr_mm_m=0.0); inline void do_blocking_move_to_xy(float x, float y, float fr_mm_m=0.0); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 72613a1aa..f8b8e0df3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1755,15 +1755,15 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) { feedrate_mm_m = old_feedrate_mm_m; } - -void do_blocking_move_to_axis_pos(AxisEnum axis, float where, float fr_mm_m/*=0.0*/) { - current_position[axis] = where; - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); +void do_blocking_move_to_x(float x, float fr_mm_m/*=0.0*/) { + do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_m); +} +void do_blocking_move_to_z(float z, float fr_mm_m/*=0.0*/) { + do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_m); +} +void do_blocking_move_to_xy(float x, float y, float fr_mm_m/*=0.0*/) { + do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_m); } -void do_blocking_move_to_x(float x, float fr_mm_m/*=0.0*/) { do_blocking_move_to_axis_pos(X_AXIS, x, fr_mm_m); } -void do_blocking_move_to_y(float y) { do_blocking_move_to_axis_pos(Y_AXIS, y); } -void do_blocking_move_to_z(float z, float fr_mm_m/*=0.0*/) { do_blocking_move_to_axis_pos(Z_AXIS, z, fr_mm_m); } -void do_blocking_move_to_xy(float x, float y, float fr_mm_m/*=0.0*/) { do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_m); } // // Prepare to do endstop or probe moves From 3c11977558d3f4291d34847ecd3cdb252072ed37 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 23 Jul 2016 22:06:10 +0900 Subject: [PATCH 470/580] Update Japanese translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Add translation ・Change translation ・Remove translation --- Marlin/language_kana.h | 12 ++++++------ Marlin/language_kana_utf8.h | 8 +++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index c1244d6ac..9b406e5fc 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -238,14 +238,14 @@ #define MSG_INFO_EXTRUDERS "\xb4\xb8\xbd\xc4\xd9\xb0\xc0\xde\xb0\xbd\xb3" // "エクストルーダースウ" ("Extruders") #define MSG_INFO_BAUDRATE "\xce\xde\xb0\xda\xb0\xc4" // "ボーレート" ("Baud") #define MSG_INFO_PROTOCOL "\xcc\xdf\xdb\xc4\xba\xd9" // "プロトコル" ("Protocol") +#define MSG_INFO_PRINT_COUNT "\xcc\xdf\xd8\xdd\xc4\xbd\xb3 " // "プリントスウ " ("Print Count") +#define MSG_INFO_COMPLETED_PRINTS "\xb6\xdd\xd8\xae\xb3\xbd\xb3" // "カンリョウスウ" ("Completed") +#define MSG_INFO_PRINT_TIME "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd\xd9\xb2\xb9\xb2" // "プリントジカンルイケイ" ("Total print time") +#define MSG_INFO_PRINT_LONGEST "\xbb\xb2\xc1\xae\xb3\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd" // "サイチョウプリントジカン" ("Longest job time") #if LCD_WIDTH > 19 - #define MSG_INFO_PRINT_COUNT "\xcc\xdf\xd8\xdd\xc4\xbd\xb3 " // "プリントスウ " ("Print Count") - #define MSG_INFO_COMPLETED_PRINTS "\xb6\xdd\xd8\xae\xb3\xbd\xb3 " // "カンリョウスウ " ("Completed ") - #define MSG_INFO_PRINT_TIME "\xba\xde\xb3\xb9\xb2\xbc\xde\xb6\xdd" // "ゴウケイジカン" ("Total Time ") + #define MSG_INFO_PRINT_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4\xbc\xd6\xb3\xd8\xae\xb3\xd9\xb2\xb9\xb2" // "フィラメントシヨウリョウルイケイ" ("Extruded total") #else - #define MSG_INFO_PRINT_COUNT "\xcc\xdf\xd8\xdd\xc4\xbd\xb3" // "プリントスウ" ("Print Count") - #define MSG_INFO_COMPLETED_PRINTS "\xb6\xdd\xd8\xae\xb3\xbd\xb3" // "カンリョウスウ" ("Completed ") - #define MSG_INFO_PRINT_TIME "\xb9\xb2\xb6\xbc\xde\xb6\xdd" // "ケイカジカン" ("Duration ") + #define MSG_INFO_PRINT_FILAMENT "\xcc\xa8\xd7\xd2\xdd\xc4\xbf\xb3\xbc\xd6\xb3\xd8\xae\xb3" // "フィラメントソウシヨウリョウ" ("Extruded") #endif #define MSG_INFO_MIN_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xc3\xb2\xb5\xdd" // "セッテイサイテイオン" ("Min Temp") #define MSG_INFO_MAX_TEMP "\xbe\xaf\xc3\xb2\xbb\xb2\xba\xb3\xb5\xdd" // "セッテイサイコウオン" ("Max Temp") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index f598f8aaa..ed521aaea 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -193,9 +193,11 @@ #define MSG_INFO_EXTRUDERS "エクストルーダースウ" // "Extruders" #define MSG_INFO_BAUDRATE "ボーレート" // "Baud" #define MSG_INFO_PROTOCOL "プロトコル" // "Protocol" -#define MSG_INFO_PRINT_COUNT "プリントスウ " // "Print Count " -#define MSG_INFO_COMPLETED_PRINTS "カンリョウスウ" // "Finished " -#define MSG_INFO_PRINT_TIME "ゴウケイジカン" // "Total Time " +#define MSG_INFO_PRINT_COUNT "プリントスウ " // "Print Count" +#define MSG_INFO_COMPLETED_PRINTS "カンリョウスウ" // "Completed" +#define MSG_INFO_PRINT_TIME "プリントジカンルイケイ" // "Total print time" +#define MSG_INFO_PRINT_LONGEST "サイチョウプリントジカン" // "Longest job time" +#define MSG_INFO_PRINT_FILAMENT "フィラメントシヨウリョウルイケイ" // "Extruded total" #define MSG_INFO_MIN_TEMP "セッテイサイテイオン" // "Min Temp" #define MSG_INFO_MAX_TEMP "セッテイサイコウオン" // "Max Temp" #define MSG_INFO_PSU "デンゲンシュベツ" // "Power Supply" From 784be56e994b85d015424c48b6f84a931732ed8c Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sun, 24 Jul 2016 00:53:35 +0900 Subject: [PATCH 471/580] Follow-up the PR #4353 (General cleanup: enum) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Update description of M111 --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f8b8e0df3..4f2db6d6c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -168,7 +168,7 @@ * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling * IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F * M110 - Set the current line number - * M111 - Set debug flags with S. See flag bits defined in Marlin.h. + * M111 - Set debug flags with S. See flag bits defined in enum.h. * M112 - Emergency stop * M113 - Get or set the timeout interval for Host Keepalive "busy" messages * M114 - Output current position to serial port From 4e67a85a5dea4ae0db7bb233e5ec71847315ede3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Jul 2016 13:07:23 -0700 Subject: [PATCH 472/580] Macros to loop over axes --- Marlin/Marlin_main.cpp | 41 +++++++++++++++++----------------- Marlin/configuration_store.cpp | 2 +- Marlin/enum.h | 3 +++ Marlin/planner.cpp | 16 ++++++------- 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4f2db6d6c..4286e67b3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1524,8 +1524,7 @@ static void set_axis_is_at_home(AxisEnum axis) { if (axis == X_AXIS || axis == Y_AXIS) { float homeposition[3]; - for (uint8_t i = X_AXIS; i <= Z_AXIS; i++) - homeposition[i] = LOGICAL_POSITION(base_home_pos(i), i); + LOOP_XYZ(i) homeposition[i] = LOGICAL_POSITION(base_home_pos(i), i); // SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]); // SERIAL_ECHOPGM("homeposition[y]= "); SERIAL_ECHOLN(homeposition[1]); @@ -2597,7 +2596,7 @@ static void homeaxis(AxisEnum axis) { * - Set the feedrate, if included */ void gcode_get_destination() { - for (int i = 0; i < NUM_AXIS; i++) { + LOOP_XYZE(i) { if (code_seen(axis_codes[i])) destination[i] = code_value_axis_units(i) + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0); else @@ -3900,7 +3899,7 @@ inline void gcode_G92() { if (!didE) stepper.synchronize(); bool didXYZ = false; - for (int i = 0; i < NUM_AXIS; i++) { + LOOP_XYZE(i) { if (code_seen(axis_codes[i])) { float p = current_position[i], v = code_value_axis_units(i); @@ -5147,7 +5146,7 @@ inline void gcode_M85() { * (Follows the same syntax as G92) */ inline void gcode_M92() { - for (int8_t i = 0; i < NUM_AXIS; i++) { + LOOP_XYZE(i) { if (code_seen(axis_codes[i])) { if (i == E_AXIS) { float value = code_value_per_axis_unit(i); @@ -5339,7 +5338,7 @@ inline void gcode_M200() { * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) */ inline void gcode_M201() { - for (int8_t i = 0; i < NUM_AXIS; i++) { + LOOP_XYZE(i) { if (code_seen(axis_codes[i])) { planner.max_acceleration_mm_per_s2[i] = code_value_axis_units(i); } @@ -5350,7 +5349,7 @@ inline void gcode_M201() { #if 0 // Not used for Sprinter/grbl gen6 inline void gcode_M202() { - for (int8_t i = 0; i < NUM_AXIS; i++) { + LOOP_XYZE(i) { if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units(i) * planner.axis_steps_per_mm[i]; } } @@ -5361,7 +5360,7 @@ inline void gcode_M201() { * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec */ inline void gcode_M203() { - for (int8_t i = 0; i < NUM_AXIS; i++) + LOOP_XYZE(i) if (code_seen(axis_codes[i])) planner.max_feedrate_mm_s[i] = code_value_axis_units(i); } @@ -5421,7 +5420,7 @@ inline void gcode_M205() { * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y */ inline void gcode_M206() { - for (int8_t i = X_AXIS; i <= Z_AXIS; i++) + LOOP_XYZ(i) if (code_seen(axis_codes[i])) set_home_offset((AxisEnum)i, code_value_axis_units(i)); @@ -5463,7 +5462,7 @@ inline void gcode_M206() { SERIAL_ECHOLNPGM(">>> gcode_M666"); } #endif - for (int8_t i = X_AXIS; i <= Z_AXIS; i++) { + LOOP_XYZ(i) { if (code_seen(axis_codes[i])) { endstop_adj[i] = code_value_axis_units(i); #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -5955,7 +5954,7 @@ inline void gcode_M303() { * M365: SCARA calibration: Scaling factor, X, Y, Z axis */ inline void gcode_M365() { - for (int8_t i = X_AXIS; i <= Z_AXIS; i++) + LOOP_XYZ(i) if (code_seen(axis_codes[i])) axis_scaling[i] = code_value_float(); } @@ -6155,7 +6154,7 @@ void quickstop_stepper() { */ inline void gcode_M428() { bool err = false; - for (int8_t i = X_AXIS; i <= Z_AXIS; i++) { + LOOP_XYZ(i) { if (axis_homed[i]) { float base = (current_position[i] > (sw_endstop_min[i] + sw_endstop_max[i]) / 2) ? base_home_pos(i) : 0, diff = current_position[i] - LOGICAL_POSITION(base, i); @@ -6285,7 +6284,7 @@ inline void gcode_M503() { float lastpos[NUM_AXIS]; // Save current position of all axes - for (uint8_t i = 0; i < NUM_AXIS; i++) + LOOP_XYZE(i) lastpos[i] = destination[i] = current_position[i]; // Define runplan for move axes @@ -6506,7 +6505,7 @@ inline void gcode_M503() { */ inline void gcode_M907() { #if HAS_DIGIPOTSS - for (int i = 0; i < NUM_AXIS; i++) + LOOP_XYZE(i) if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int()); if (code_seen('B')) stepper.digipot_current(4, code_value_int()); if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value_int()); @@ -6522,7 +6521,7 @@ inline void gcode_M907() { #endif #if ENABLED(DIGIPOT_I2C) // this one uses actual amps in floating point - for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value_float()); + LOOP_XYZE(i) if (code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value_float()); // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...) for (int i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (code_seen('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, code_value_float()); #endif @@ -6531,7 +6530,7 @@ inline void gcode_M907() { float dac_percent = code_value_float(); for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent); } - for (uint8_t i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) dac_current_percent(i, code_value_float()); + LOOP_XYZE(i) if (code_seen(axis_codes[i])) dac_current_percent(i, code_value_float()); #endif } @@ -6570,7 +6569,7 @@ inline void gcode_M907() { // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. inline void gcode_M350() { if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.microstep_mode(i, code_value_byte()); - for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_mode(i, code_value_byte()); + LOOP_XYZE(i) if (code_seen(axis_codes[i])) stepper.microstep_mode(i, code_value_byte()); if (code_seen('B')) stepper.microstep_mode(4, code_value_byte()); stepper.microstep_readings(); } @@ -6582,11 +6581,11 @@ inline void gcode_M907() { inline void gcode_M351() { if (code_seen('S')) switch (code_value_byte()) { case 1: - for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, code_value_byte(), -1); + LOOP_XYZE(i) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, code_value_byte(), -1); if (code_seen('B')) stepper.microstep_ms(4, code_value_byte(), -1); break; case 2: - for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, -1, code_value_byte()); + LOOP_XYZE(i) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, -1, code_value_byte()); if (code_seen('B')) stepper.microstep_ms(4, -1, code_value_byte()); break; } @@ -8013,7 +8012,7 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ inline bool prepare_kinematic_move_to(float target[NUM_AXIS]) { float difference[NUM_AXIS]; - for (int8_t i = 0; i < NUM_AXIS; i++) difference[i] = target[i] - current_position[i]; + LOOP_XYZE(i) difference[i] = target[i] - current_position[i]; float cartesian_mm = sqrt(sq(difference[X_AXIS]) + sq(difference[Y_AXIS]) + sq(difference[Z_AXIS])); if (cartesian_mm < 0.000001) cartesian_mm = abs(difference[E_AXIS]); @@ -8031,7 +8030,7 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ float fraction = float(s) * inv_steps; - for (int8_t i = 0; i < NUM_AXIS; i++) + LOOP_XYZE(i) target[i] = current_position[i] + difference[i] * fraction; inverse_kinematics(target); diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index b203bbb62..6a581ee1f 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -563,7 +563,7 @@ void Config_ResetDefault() { float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT; float tmp2[] = DEFAULT_MAX_FEEDRATE; long tmp3[] = DEFAULT_MAX_ACCELERATION; - for (uint8_t i = 0; i < NUM_AXIS; i++) { + LOOP_XYZE(i) { planner.axis_steps_per_mm[i] = tmp1[i]; planner.max_feedrate_mm_s[i] = tmp2[i]; planner.max_acceleration_mm_per_s2[i] = tmp3[i]; diff --git a/Marlin/enum.h b/Marlin/enum.h index fe369c23f..cbdfd4a41 100644 --- a/Marlin/enum.h +++ b/Marlin/enum.h @@ -45,6 +45,9 @@ enum AxisEnum { Z_HEAD = 5 }; +#define LOOP_XYZ(VAR) for (uint8_t VAR=X_AXIS; VAR<=Z_AXIS; VAR++) +#define LOOP_XYZE(VAR) for (uint8_t VAR=X_AXIS; VAR<=E_AXIS; VAR++) + typedef enum { LINEARUNIT_MM, LINEARUNIT_INCH diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index f7455253b..35e5d3bd9 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -134,7 +134,7 @@ Planner::Planner() { init(); } void Planner::init() { block_buffer_head = block_buffer_tail = 0; memset(position, 0, sizeof(position)); // clear position - for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = 0.0; + LOOP_XYZE(i) previous_speed[i] = 0.0; previous_nominal_speed = 0.0; #if ENABLED(AUTO_BED_LEVELING_FEATURE) bed_level_matrix.set_to_identity(); @@ -423,7 +423,7 @@ void Planner::check_axes_activity() { for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { block = &block_buffer[b]; - for (int i = 0; i < NUM_AXIS; i++) if (block->steps[i]) axis_active[i]++; + LOOP_XYZE(i) if (block->steps[i]) axis_active[i]++; } } #if ENABLED(DISABLE_X) @@ -893,7 +893,7 @@ void Planner::check_axes_activity() { // Calculate and limit speed in mm/sec for each axis float current_speed[NUM_AXIS]; float speed_factor = 1.0; //factor <=1 do decrease speed - for (int i = 0; i < NUM_AXIS; i++) { + LOOP_XYZE(i) { current_speed[i] = delta_mm[i] * inverse_second; float cs = fabs(current_speed[i]), mf = max_feedrate_mm_s[i]; if (cs > mf) speed_factor = min(speed_factor, mf / cs); @@ -939,7 +939,7 @@ void Planner::check_axes_activity() { // Correct the speed if (speed_factor < 1.0) { - for (unsigned char i = 0; i < NUM_AXIS; i++) current_speed[i] *= speed_factor; + LOOP_XYZE(i) current_speed[i] *= speed_factor; block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } @@ -1051,7 +1051,7 @@ void Planner::check_axes_activity() { block->recalculate_flag = true; // Always calculate trapezoid for new block // Update previous path unit_vector and nominal speed - for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = current_speed[i]; + LOOP_XYZE(i) previous_speed[i] = current_speed[i]; previous_nominal_speed = block->nominal_speed; #if ENABLED(LIN_ADVANCE) @@ -1098,7 +1098,7 @@ void Planner::check_axes_activity() { block_buffer_head = next_buffer_head; // Update position - for (int i = 0; i < NUM_AXIS; i++) position[i] = target[i]; + LOOP_XYZE(i) position[i] = target[i]; recalculate(); @@ -1155,7 +1155,7 @@ void Planner::check_axes_activity() { stepper.set_position(nx, ny, nz, ne); previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. - for (int i = 0; i < NUM_AXIS; i++) previous_speed[i] = 0.0; + LOOP_XYZE(i) previous_speed[i] = 0.0; } /** @@ -1168,7 +1168,7 @@ void Planner::set_e_position_mm(const float& e) { // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 void Planner::reset_acceleration_rates() { - for (int i = 0; i < NUM_AXIS; i++) + LOOP_XYZE(i) max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i]; } From 96a162bedad94aa50f7e952545d2b0674161f4cd Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 23 Jul 2016 14:02:14 +0200 Subject: [PATCH 473/580] Use implications from #4370 in run_z_probe() See also https://github.com/MarlinFirmware/Marlin/pull/4370#issuecomment-234713680 --- Marlin/Marlin_main.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4286e67b3..b1cfad4bb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2103,12 +2103,6 @@ static void clean_up_after_endstop_or_probe_move() { return false; } - #if ENABLED(DELTA) - #define SET_Z_FROM_STEPPERS() set_current_from_steppers() - #else - #define SET_Z_FROM_STEPPERS() current_position[Z_AXIS] = LOGICAL_POSITION(stepper.get_axis_position_mm(Z_AXIS), Z_AXIS) - #endif - // Do a single Z probe and return with current_position[Z_AXIS] // at the height where the probe triggered. static float run_z_probe() { @@ -2120,28 +2114,18 @@ static void clean_up_after_endstop_or_probe_move() { planner.bed_level_matrix.set_to_identity(); #endif - #if ENABLED(DELTA) - float z_before = current_position[Z_AXIS], // Current Z - z_mm = stepper.get_axis_position_mm(Z_AXIS); // Some tower's current position - #endif - do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST); endstops.hit_on_purpose(); - SET_Z_FROM_STEPPERS(); + set_current_from_steppers(); SYNC_PLAN_POSITION_KINEMATIC(); // move up the retract distance do_blocking_move_to_z(current_position[Z_AXIS] + home_bump_mm(Z_AXIS), Z_PROBE_SPEED_FAST); - #if ENABLED(DELTA) - z_before = current_position[Z_AXIS]; - z_mm = stepper.get_axis_position_mm(Z_AXIS); - #endif - // move back down slowly to find bed do_blocking_move_to_z(current_position[Z_AXIS] - home_bump_mm(Z_AXIS) * 2, Z_PROBE_SPEED_SLOW); endstops.hit_on_purpose(); - SET_Z_FROM_STEPPERS(); + set_current_from_steppers(); SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) From bb93b6822a0eb86acab8fcf97ae4eeacf3b0e4d4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Jul 2016 13:11:18 -0700 Subject: [PATCH 474/580] Use set_current_from_steppers_for_axis --- Marlin/Marlin_main.cpp | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b1cfad4bb..b92a22242 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -564,7 +564,7 @@ void stop(); void get_available_commands(); void process_next_command(); void prepare_move_to_destination(); -void set_current_from_steppers(); +void set_current_from_steppers_for_axis(AxisEnum axis); #if ENABLED(ARC_SUPPORT) void plan_arc(float target[NUM_AXIS], float* offset, uint8_t clockwise); @@ -2116,7 +2116,7 @@ static void clean_up_after_endstop_or_probe_move() { do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST); endstops.hit_on_purpose(); - set_current_from_steppers(); + set_current_from_steppers_for_axis(Z_AXIS); SYNC_PLAN_POSITION_KINEMATIC(); // move up the retract distance @@ -2125,7 +2125,7 @@ static void clean_up_after_endstop_or_probe_move() { // move back down slowly to find bed do_blocking_move_to_z(current_position[Z_AXIS] - home_bump_mm(Z_AXIS) * 2, Z_PROBE_SPEED_SLOW); endstops.hit_on_purpose(); - set_current_from_steppers(); + set_current_from_steppers_for_axis(Z_AXIS); SYNC_PLAN_POSITION_KINEMATIC(); #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -6074,8 +6074,8 @@ void quickstop_stepper() { stepper.quick_stop(); #if DISABLED(SCARA) stepper.synchronize(); - set_current_from_steppers(); - sync_plan_position(); // ...re-apply to planner position + LOOP_XYZ(i) set_current_from_steppers_for_axis((AxisEnum)i); + SYNC_PLAN_POSITION_KINEMATIC(); #endif } @@ -7912,25 +7912,16 @@ void clamp_to_software_endstops(float target[3]) { #endif // DELTA -void set_current_from_steppers() { +void set_current_from_steppers_for_axis(AxisEnum axis) { #if ENABLED(DELTA) set_cartesian_from_steppers(); - current_position[X_AXIS] = cartesian_position[X_AXIS]; - current_position[Y_AXIS] = cartesian_position[Y_AXIS]; - current_position[Z_AXIS] = cartesian_position[Z_AXIS]; + current_position[axis] = LOGICAL_POSITION(cartesian_position[axis], axis); #elif ENABLED(AUTO_BED_LEVELING_FEATURE) - vector_3 pos = planner.adjusted_position(); // values directly from steppers... - current_position[X_AXIS] = pos.x; - current_position[Y_AXIS] = pos.y; - current_position[Z_AXIS] = pos.z; + vector_3 pos = planner.adjusted_position(); + current_position[axis] = LOGICAL_POSITION(axis == X_AXIS ? pos.x : axis == Y_AXIS ? pos.y : pos.z, axis); #else - current_position[X_AXIS] = stepper.get_axis_position_mm(X_AXIS); // CORE handled transparently - current_position[Y_AXIS] = stepper.get_axis_position_mm(Y_AXIS); - current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); + current_position[axis] = LOGICAL_POSITION(stepper.get_axis_position_mm(axis), axis); // CORE handled transparently #endif - - for (uint8_t i = X_AXIS; i <= Z_AXIS; i++) - current_position[i] += LOGICAL_POSITION(0, i); } #if ENABLED(MESH_BED_LEVELING) From 3e2b3353b083d4fe9927912c5f98f9aa0c3fceb3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Jul 2016 19:02:14 -0700 Subject: [PATCH 475/580] Fix axis indices for COREYZ --- Marlin/planner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 35e5d3bd9..3d6278918 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -795,8 +795,8 @@ void Planner::check_axes_activity() { delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_mm[A_AXIS]; delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_mm[C_AXIS]; #elif ENABLED(COREYZ) - delta_mm[X_AXIS] = dx / axis_steps_per_mm[A_AXIS]; - delta_mm[Y_HEAD] = dy / axis_steps_per_mm[Y_AXIS]; + delta_mm[X_AXIS] = dx / axis_steps_per_mm[X_AXIS]; + delta_mm[Y_HEAD] = dy / axis_steps_per_mm[B_AXIS]; delta_mm[Z_HEAD] = dz / axis_steps_per_mm[C_AXIS]; delta_mm[B_AXIS] = (dy + dz) / axis_steps_per_mm[B_AXIS]; delta_mm[C_AXIS] = (dy - dz) / axis_steps_per_mm[C_AXIS]; From 62d96d72f39f3de2796a08fe7a67978074e5d183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sun, 24 Jul 2016 03:13:35 +0100 Subject: [PATCH 476/580] Renamed timestamp_t to duration_t --- Marlin/Marlin_main.cpp | 6 +- Marlin/duration_t.h | 155 +++++++++++++++++++++++++++++++++ Marlin/printcounter.cpp | 12 +-- Marlin/timestamp_t.h | 128 --------------------------- Marlin/ultralcd.cpp | 12 +-- Marlin/ultralcd_impl_DOGM.h | 10 +-- Marlin/ultralcd_impl_HD44780.h | 9 +- 7 files changed, 180 insertions(+), 152 deletions(-) create mode 100644 Marlin/duration_t.h delete mode 100644 Marlin/timestamp_t.h diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b92a22242..2f9863ccd 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -60,7 +60,7 @@ #include "pins_arduino.h" #include "math.h" #include "nozzle.h" -#include "timestamp_t.h" +#include "duration_t.h" #if ENABLED(USE_WATCHDOG) #include "watchdog.h" @@ -4058,8 +4058,8 @@ inline void gcode_M17() { */ inline void gcode_M31() { char buffer[21]; - timestamp_t time(print_job_timer.duration()); - time.toString(buffer); + duration_t elapsed = print_job_timer.duration(); + elapsed.toString(buffer); lcd_setstatus(buffer); diff --git a/Marlin/duration_t.h b/Marlin/duration_t.h new file mode 100644 index 000000000..25ea9bb98 --- /dev/null +++ b/Marlin/duration_t.h @@ -0,0 +1,155 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef __DURATION_T__ +#define __DURATION_T__ + +struct duration_t { + /** + * @brief Duration is stored in seconds + */ + uint32_t value; + + /** + * @brief Constructor + */ + duration_t() + : duration_t(0) {}; + + /** + * @brief Constructor + * + * @param seconds The number of seconds + */ + duration_t(uint32_t const &seconds) { + this->value = seconds; + } + + /** + * @brief Equality comparison + * @details Overloads the equality comparison operator + * + * @param value The number of seconds to compare to + * @return True if both durations are equal + */ + bool operator==(const uint32_t &value) const { + return (this->value == value); + } + + /** + * @brief Inequality comparison + * @details Overloads the inequality comparison operator + * + * @param value The number of seconds to compare to + * @return False if both durations are equal + */ + bool operator!=(const uint32_t &value) const { + return ! this->operator==(value); + } + + /** + * @brief Formats the duration as years + * @return The number of years + */ + inline uint8_t year() const { + return this->day() / 365; + } + + /** + * @brief Formats the duration as days + * @return The number of days + */ + inline uint16_t day() const { + return this->hour() / 24; + } + + /** + * @brief Formats the duration as hours + * @return The number of hours + */ + inline uint32_t hour() const { + return this->minute() / 60; + } + + /** + * @brief Formats the duration as minutes + * @return The number of minutes + */ + inline uint32_t minute() const { + return this->second() / 60; + } + + /** + * @brief Formats the duration as seconds + * @return The number of seconds + */ + inline uint32_t second() const { + return this->value; + } + + /** + * @brief Formats the duration as a string + * @details String will be formated using a "full" representation of duration + * + * @param buffer The array pointed to must be able to accommodate 21 bytes + * + * Output examples: + * 123456789012345678901 (strlen) + * 135y 364d 23h 59m 59s + * 364d 23h 59m 59s + * 23h 59m 59s + * 59m 59s + * 59s + */ + void toString(char *buffer) const { + int y = this->year(), + d = this->day() % 365, + h = this->hour() % 24, + m = this->minute() % 60, + s = this->second() % 60; + + if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); + else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); + else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); + else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); + else sprintf_P(buffer, PSTR("%is"), s); + } + + /** + * @brief Formats the duration as a string + * @details String will be formated using a "digital" representation of duration + * + * @param buffer The array pointed to must be able to accommodate 10 bytes + * + * Output examples: + * 1234567890 (strlen) + * 1193046:59 + */ + void toDigital(char *buffer) const { + int h = this->hour() % 24, + m = this->minute() % 60; + + sprintf_P(buffer, PSTR("%02i:%02i"), h, m); + } +}; + +#endif // __DURATION_T__ diff --git a/Marlin/printcounter.cpp b/Marlin/printcounter.cpp index 9bfb0f755..b6cef6e71 100644 --- a/Marlin/printcounter.cpp +++ b/Marlin/printcounter.cpp @@ -22,7 +22,7 @@ #include "Marlin.h" #include "printcounter.h" -#include "timestamp_t.h" +#include "duration_t.h" PrintCounter::PrintCounter(): super() { this->loadStats(); @@ -94,7 +94,7 @@ void PrintCounter::saveStats() { void PrintCounter::showStats() { char buffer[21]; - timestamp_t time; + duration_t elapsed; SERIAL_PROTOCOLPGM(MSG_STATS); @@ -111,8 +111,8 @@ void PrintCounter::showStats() { SERIAL_EOL; SERIAL_PROTOCOLPGM(MSG_STATS); - time.timestamp = this->data.printTime; - time.toString(buffer); + elapsed = this->data.printTime; + elapsed.toString(buffer); SERIAL_ECHOPGM("Total time: "); SERIAL_ECHO(buffer); @@ -123,8 +123,8 @@ void PrintCounter::showStats() { SERIAL_ECHOPGM(")"); #endif - time.timestamp = this->data.longestPrint; - time.toString(buffer); + elapsed = this->data.longestPrint; + elapsed.toString(buffer); SERIAL_ECHOPGM(", Longest job: "); SERIAL_ECHO(buffer); diff --git a/Marlin/timestamp_t.h b/Marlin/timestamp_t.h deleted file mode 100644 index 8295360d1..000000000 --- a/Marlin/timestamp_t.h +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __TIMESTAMP_T__ -#define __TIMESTAMP_T__ - -struct timestamp_t { - /** - * @brief Number of seconds - */ - uint32_t timestamp; - - /** - * @brief Timestamp blank constructor - */ - timestamp_t() - : timestamp_t(0) {}; - - /** - * @briefTimestamp constructor - * @details Initializes the timestamp_t structure based on a number of seconds - * - * @param seconds The number of seconds - */ - timestamp_t(uint32_t const &seconds) { - this->timestamp = seconds; - } - - /** - * @brief Formats the timestamp in years - * @return The number of years - */ - inline uint8_t year() const { - return this->day() / 365; - } - - /** - * @brief Formats the timestamp in days - * @return The number of days - */ - inline uint16_t day() const { - return this->hour() / 24; - } - - /** - * @brief Formats the timestamp in hours - * @return The number of hours - */ - inline uint32_t hour() const { - return this->minute() / 60; - } - - /** - * @brief Formats the timestamp in minutes - * @return The number of minutes - */ - inline uint32_t minute() const { - return this->second() / 60; - } - - /** - * @brief Formats the timestamp in seconds - * @return The number of seconds - */ - inline uint32_t second() const { - return this->timestamp; - } - - /** - * @brief Formats the timestamp as a string - * @details Returns the timestamp formated as a string - * - * @param buffer The array pointed to must be able to accommodate 21 bytes when - * on standard mode or 10 bytes otherwise. - * @param shorty If true a short representation will be returned. - * - * Standard toString() output examples: - * 123456789012345678901 (strlen) - * 135y 364d 23h 59m 59s - * 364d 23h 59m 59s - * 23h 59m 59s - * 59m 59s - * 59s - * - * Short toString() output examples: - * 1234567890 (strlen) - * 1193046:59 - * - */ - void toString(char *buffer, bool const &shorty = false) const { - int h = this->hour() % 24, - m = this->minute() % 60; - - if (shorty) sprintf_P(buffer, PSTR("%02i:%02i"), h, m); - else { - int y = this->year(), - d = this->day() % 365, - s = this->second() % 60; - - if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s); - else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s); - else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); - else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); - else sprintf_P(buffer, PSTR("%is"), s); - } - } -}; - -#endif // __TIMESTAMP_T__ diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 2a9e6e90e..7d687acea 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -31,7 +31,7 @@ #if ENABLED(PRINTCOUNTER) #include "printcounter.h" - #include "timestamp_t.h" + #include "duration_t.h" #endif int preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1, @@ -1979,13 +1979,15 @@ void kill_screen(const char* lcd_msg) { STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS" : ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 - timestamp_t time(stats.printTime); - time.toString(buffer); + duration_t elapsed = stats.printTime; + elapsed.toString(buffer); + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total print Time: STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s - time.timestamp = stats.longestPrint; - time.toString(buffer); + elapsed = stats.longestPrint; + elapsed.toString(buffer); + STATIC_ITEM(MSG_INFO_PRINT_LONGEST ": ", false, false); // Longest job time: STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 22a86a5da..ff9cc6223 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -58,7 +58,7 @@ #include "ultralcd_st7920_u8glib_rrd.h" #include "Configuration.h" -#include "timestamp_t.h" +#include "duration_t.h" #if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT) #undef USE_BIG_EDIT_FONT @@ -391,10 +391,10 @@ static void lcd_implementation_status_screen() { u8g.setPrintPos(80,48); char buffer[10]; - timestamp_t time(print_job_timer.duration()); - time.toString(buffer, true); - if (time.timestamp != 0) lcd_print(buffer); - else lcd_printPGM(PSTR("--:--")); + duration_t elapsed = print_job_timer.duration(); + elapsed.toDigital(buffer); + lcd_print(buffer); + #endif // Extruders diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index 271cb3ff9..fa942d8a1 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -27,7 +27,7 @@ * Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays. **/ -#include "timestamp_t.h" +#include "duration_t.h" extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array. @@ -763,10 +763,9 @@ static void lcd_implementation_status_screen() { lcd.print(LCD_STR_CLOCK[0]); char buffer[10]; - timestamp_t time(print_job_timer.duration()); - time.toString(buffer, true); - if (time.timestamp != 0) lcd_print(buffer); - else lcd_printPGM(PSTR("--:--")); + duration_t elapsed = print_job_timer.duration(); + elapsed.toDigital(buffer); + lcd_print(buffer); #endif // LCD_HEIGHT > 3 From 50fb0f7cecd6322e24240e8408015640506cc2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sun, 24 Jul 2016 15:52:03 +0100 Subject: [PATCH 477/580] M31 serial output is now always in EN --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2f9863ccd..ef4bd32b6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4064,7 +4064,7 @@ inline void gcode_M31() { lcd_setstatus(buffer); SERIAL_ECHO_START; - SERIAL_ECHOPGM(MSG_PRINT_TIME " "); + SERIAL_ECHOPGM("Print time: "); SERIAL_ECHOLN(buffer); thermalManager.autotempShutdown(); From 950397f2a0c7fee352ac4581efc363cca291f6cf Mon Sep 17 00:00:00 2001 From: Silvio Didonna Date: Sun, 24 Jul 2016 17:22:30 +0200 Subject: [PATCH 478/580] Added missing translations. Removed trailing spaces for consistency (#4376) --- Marlin/language_it.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Marlin/language_it.h b/Marlin/language_it.h index acb4e8a5a..82bece181 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -94,6 +94,7 @@ #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" +#define MSG_SELECT "Seleziona" #define MSG_ACC "Accel" #define MSG_VXY_JERK "Vxy-jerk" #define MSG_VZ_JERK "Vz-jerk" @@ -165,6 +166,10 @@ #define MSG_ERR_MINTEMP_BED "Err: TEMP MINIMA PIATTO" #define MSG_HALTED "STAMPANTE FERMATA" #define MSG_PLEASE_RESET "Riavviare prego" +#define MSG_SHORT_DAY "g" // One character only +#define MSG_SHORT_HOUR "h" // One character only +#define MSG_SHORT_MINUTE "m" // One character only +#define MSG_PRINT_TIME "Durata stampa" #define MSG_HEATING "Riscaldamento.." #define MSG_HEATING_COMPLETE "Risc. completato" #define MSG_BED_HEATING "Risc. Piatto.." @@ -184,12 +189,16 @@ #define MSG_INFO_PROTOCOL "Protocollo" #if LCD_WIDTH > 19 #define MSG_INFO_PRINT_COUNT "Contat. stampa" - #define MSG_INFO_FINISHED_PRINTS "Finiti " - #define MSG_INFO_PRINT_TIME "Tempo totale " + #define MSG_INFO_COMPLETED_PRINTS "Completati" + #define MSG_INFO_PRINT_TIME "Tempo totale" + #define MSG_INFO_PRINT_LONGEST "Lavoro piu lungo" + #define MSG_INFO_PRINT_FILAMENT "Totale estruso" #else - #define MSG_INFO_PRINT_COUNT "Stampe " - #define MSG_INFO_FINISHED_PRINTS "Finiti " - #define MSG_INFO_PRINT_TIME "Durata " + #define MSG_INFO_PRINT_COUNT "Stampe" + #define MSG_INFO_COMPLETED_PRINTS "Completati" + #define MSG_INFO_PRINT_TIME "Durata" + #define MSG_INFO_PRINT_LONGEST "Piu lungo" + #define MSG_INFO_PRINT_FILAMENT "Estruso" #endif #define MSG_INFO_MIN_TEMP "Temp min" #define MSG_INFO_MAX_TEMP "Temp max" From bbe5b80492d4a5b04995ca43d3258838f8cd8faf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 10:53:58 -0700 Subject: [PATCH 479/580] Always define probe limits if there is a probe --- Marlin/Conditionals.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 29d643909..e5e072a22 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -388,13 +388,11 @@ */ #define HAS_PROBING_PROCEDURE (ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) - #if HAS_PROBING_PROCEDURE - // Boundaries for probing based on set limits - #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - #endif + // Boundaries for probing based on set limits + #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) + #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) + #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) From a6203366b60014469225740b2e3606c7f9538b46 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 10:54:25 -0700 Subject: [PATCH 480/580] Sanitycheck: Z_SAFE_HOMING requires a probe --- Marlin/SanityCheck.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 5eea066a6..45a9d29c0 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -353,6 +353,8 @@ #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #elif ENABLED(Z_SAFE_HOMING) + #error "Z_SAFE_HOMING currently requires a probe." #endif #endif From d6c50671d3550252ff47ce27c8c7924733ec6347 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 10:54:47 -0700 Subject: [PATCH 481/580] Sanitycheck: Z_SAFE_HOMING points are reachable --- Marlin/SanityCheck.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 45a9d29c0..9ed8caaff 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -359,6 +359,17 @@ #endif +/** + * Make sure Z_SAFE_HOMING point is reachable + */ +#if ENABLED(Z_SAFE_HOMING) + #if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X + #error "The given Z_SAFE_HOMING_X_POINT can't be reached by the Z probe." + #elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y + #error "The given Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe." + #endif +#endif // Z_SAFE_HOMING + /** * Auto Bed Leveling */ From db5df9500b902f44759418a2906ef45c3a122133 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 13:27:09 -0700 Subject: [PATCH 482/580] Move sync_plan_position closer to the top --- Marlin/Marlin_main.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b92a22242..1ad4b8011 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -610,6 +610,20 @@ static void report_current_position(); print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0) #endif +/** + * sync_plan_position + * Set planner / stepper positions to the cartesian current_position. + * The stepper code translates these coordinates into step units. + * Allows translation between steps and millimeters for cartesian & core robots + */ +inline void sync_plan_position() { + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position); + #endif + planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); +} +inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); } + #if ENABLED(DELTA) || ENABLED(SCARA) inline void sync_plan_position_delta() { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1627,19 +1641,6 @@ inline void line_to_destination(float fr_mm_m) { } inline void line_to_destination() { line_to_destination(feedrate_mm_m); } -/** - * sync_plan_position - * Set planner / stepper positions to the cartesian current_position. - * The stepper code translates these coordinates into step units. - * Allows translation between steps and millimeters for cartesian & core robots - */ -inline void sync_plan_position() { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position); - #endif - planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); -} -inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); } inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); } inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } From b921f6b69d5ac5aa62650863b1af2947b01868c3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Jul 2016 19:03:38 -0700 Subject: [PATCH 483/580] Optimize calculation of block->millimeters for DELTA --- Marlin/planner.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 3d6278918..26ffd5e80 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -803,9 +803,15 @@ void Planner::check_axes_activity() { #endif #else float delta_mm[4]; - delta_mm[X_AXIS] = dx / axis_steps_per_mm[X_AXIS]; - delta_mm[Y_AXIS] = dy / axis_steps_per_mm[Y_AXIS]; - delta_mm[Z_AXIS] = dz / axis_steps_per_mm[Z_AXIS]; + #if ENABLED(DELTA) + // On delta all axes (should!) have the same steps-per-mm + // so calculate distance in steps first, then do one division + // at the end to get millimeters + #else + delta_mm[X_AXIS] = dx / axis_steps_per_mm[X_AXIS]; + delta_mm[Y_AXIS] = dy / axis_steps_per_mm[Y_AXIS]; + delta_mm[Z_AXIS] = dz / axis_steps_per_mm[Z_AXIS]; + #endif #endif delta_mm[E_AXIS] = (de / axis_steps_per_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0; @@ -820,10 +826,16 @@ void Planner::check_axes_activity() { sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD]) #elif ENABLED(COREYZ) sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD]) + #elif ENABLED(DELTA) + sq(dx) + sq(dy) + sq(dz) #else sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS]) #endif - ); + ) + #if ENABLED(DELTA) + / axis_steps_per_mm[X_AXIS] + #endif + ; } float inverse_millimeters = 1.0 / block->millimeters; // Inverse millimeters to remove multiple divides From f8b5749235eea19134a58656095e2a0f499a2fc7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Jul 2016 19:36:26 -0700 Subject: [PATCH 484/580] Replace division in planner with multiplication --- Marlin/Marlin_main.cpp | 10 +++---- Marlin/configuration_store.cpp | 6 +++++ Marlin/planner.cpp | 49 ++++++++++++++++++++-------------- Marlin/planner.h | 4 ++- Marlin/stepper.cpp | 2 +- Marlin/stepper.h | 2 +- Marlin/temperature.cpp | 2 +- Marlin/ultralcd.cpp | 13 ++++----- 8 files changed, 53 insertions(+), 35 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1ad4b8011..70b23a4d3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -911,16 +911,15 @@ void setup() { // Send "ok" after commands by default for (int8_t i = 0; i < BUFSIZE; i++) send_ok[i] = true; - // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) + // Load data from EEPROM if available (or use defaults) + // This also updates variables in the planner, elsewhere Config_RetrieveSettings(); // Initialize current position based on home_offset memcpy(current_position, home_offset, sizeof(home_offset)); - #if ENABLED(DELTA) || ENABLED(SCARA) - // Vital to init kinematic equivalent for X0 Y0 Z0 - SYNC_PLAN_POSITION_KINEMATIC(); - #endif + // Vital to init stepper/planner equivalent for current_position + SYNC_PLAN_POSITION_KINEMATIC(); thermalManager.init(); // Initialize temperature loop @@ -5148,6 +5147,7 @@ inline void gcode_M92() { } } } + planner.refresh_positioning(); } /** diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 6a581ee1f..233a28cd5 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -171,10 +171,16 @@ void Config_Postprocess() { // steps per s2 needs to be updated to agree with units per s2 planner.reset_acceleration_rates(); + // Make sure delta kinematics are updated before refreshing the + // planner position so the stepper counts will be set correctly. #if ENABLED(DELTA) recalc_delta_settings(delta_radius, delta_diagonal_rod); #endif + // Refresh steps_to_mm with the reciprocal of axis_steps_per_mm + // and init stepper.count[], planner.position[] with current_position + planner.refresh_positioning(); + #if ENABLED(PIDTEMP) thermalManager.updatePID(); #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 26ffd5e80..decea1576 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -82,6 +82,7 @@ volatile uint8_t Planner::block_buffer_tail = 0; float Planner::max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second float Planner::axis_steps_per_mm[NUM_AXIS]; +float Planner::steps_to_mm[NUM_AXIS]; unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS]; unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software @@ -783,23 +784,23 @@ void Planner::check_axes_activity() { #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ) float delta_mm[6]; #if ENABLED(COREXY) - delta_mm[X_HEAD] = dx / axis_steps_per_mm[A_AXIS]; - delta_mm[Y_HEAD] = dy / axis_steps_per_mm[B_AXIS]; - delta_mm[Z_AXIS] = dz / axis_steps_per_mm[Z_AXIS]; - delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_mm[A_AXIS]; - delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_mm[B_AXIS]; + delta_mm[X_HEAD] = dx * steps_to_mm[A_AXIS]; + delta_mm[Y_HEAD] = dy * steps_to_mm[B_AXIS]; + delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS]; + delta_mm[A_AXIS] = (dx + dy) * steps_to_mm[A_AXIS]; + delta_mm[B_AXIS] = (dx - dy) * steps_to_mm[B_AXIS]; #elif ENABLED(COREXZ) - delta_mm[X_HEAD] = dx / axis_steps_per_mm[A_AXIS]; - delta_mm[Y_AXIS] = dy / axis_steps_per_mm[Y_AXIS]; - delta_mm[Z_HEAD] = dz / axis_steps_per_mm[C_AXIS]; - delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_mm[A_AXIS]; - delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_mm[C_AXIS]; + delta_mm[X_HEAD] = dx * steps_to_mm[A_AXIS]; + delta_mm[Y_AXIS] = dy * steps_to_mm[Y_AXIS]; + delta_mm[Z_HEAD] = dz * steps_to_mm[C_AXIS]; + delta_mm[A_AXIS] = (dx + dz) * steps_to_mm[A_AXIS]; + delta_mm[C_AXIS] = (dx - dz) * steps_to_mm[C_AXIS]; #elif ENABLED(COREYZ) - delta_mm[X_AXIS] = dx / axis_steps_per_mm[X_AXIS]; - delta_mm[Y_HEAD] = dy / axis_steps_per_mm[B_AXIS]; - delta_mm[Z_HEAD] = dz / axis_steps_per_mm[C_AXIS]; - delta_mm[B_AXIS] = (dy + dz) / axis_steps_per_mm[B_AXIS]; - delta_mm[C_AXIS] = (dy - dz) / axis_steps_per_mm[C_AXIS]; + delta_mm[X_AXIS] = dx * steps_to_mm[X_AXIS]; + delta_mm[Y_HEAD] = dy * steps_to_mm[B_AXIS]; + delta_mm[Z_HEAD] = dz * steps_to_mm[C_AXIS]; + delta_mm[B_AXIS] = (dy + dz) * steps_to_mm[B_AXIS]; + delta_mm[C_AXIS] = (dy - dz) * steps_to_mm[C_AXIS]; #endif #else float delta_mm[4]; @@ -808,12 +809,12 @@ void Planner::check_axes_activity() { // so calculate distance in steps first, then do one division // at the end to get millimeters #else - delta_mm[X_AXIS] = dx / axis_steps_per_mm[X_AXIS]; - delta_mm[Y_AXIS] = dy / axis_steps_per_mm[Y_AXIS]; - delta_mm[Z_AXIS] = dz / axis_steps_per_mm[Z_AXIS]; + delta_mm[X_AXIS] = dx * steps_to_mm[X_AXIS]; + delta_mm[Y_AXIS] = dy * steps_to_mm[Y_AXIS]; + delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS]; #endif #endif - delta_mm[E_AXIS] = (de / axis_steps_per_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0; + delta_mm[E_AXIS] = (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0; if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { block->millimeters = fabs(delta_mm[E_AXIS]); @@ -833,7 +834,7 @@ void Planner::check_axes_activity() { #endif ) #if ENABLED(DELTA) - / axis_steps_per_mm[X_AXIS] + * steps_to_mm[X_AXIS] #endif ; } @@ -1176,6 +1177,7 @@ void Planner::check_axes_activity() { void Planner::set_e_position_mm(const float& e) { position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]); stepper.set_e_position(position[E_AXIS]); + previous_speed[E_AXIS] = 0.0; } // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 @@ -1184,6 +1186,13 @@ void Planner::reset_acceleration_rates() { max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i]; } +// Recalculate position, steps_to_mm if axis_steps_per_mm changes! +void Planner::refresh_positioning() { + LOOP_XYZE(i) planner.steps_to_mm[i] = 1.0 / planner.axis_steps_per_mm[i]; + set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + reset_acceleration_rates(); +} + #if ENABLED(AUTOTEMP) void Planner::autotemp_M109() { diff --git a/Marlin/planner.h b/Marlin/planner.h index 74abd1cb2..eac1ae5c6 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -121,6 +121,7 @@ class Planner { static float max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second static float axis_steps_per_mm[NUM_AXIS]; + static float steps_to_mm[NUM_AXIS]; static unsigned long max_acceleration_steps_per_s2[NUM_AXIS]; static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software @@ -142,7 +143,7 @@ class Planner { /** * The current position of the tool in absolute steps - * Reclculated if any axis_steps_per_mm are changed by gcode + * Recalculated if any axis_steps_per_mm are changed by gcode */ static long position[NUM_AXIS]; @@ -187,6 +188,7 @@ class Planner { */ static void reset_acceleration_rates(); + static void refresh_positioning(); // Manage fans, paste pressure, etc. static void check_axes_activity(); diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 90a1ddf65..63a5d0b31 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -951,7 +951,7 @@ float Stepper::get_axis_position_mm(AxisEnum axis) { #else axis_steps = position(axis); #endif - return axis_steps / planner.axis_steps_per_mm[axis]; + return axis_steps * planner.steps_to_mm[axis]; } void Stepper::finish_and_disable() { diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 45c8753aa..3ecf93a71 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -262,7 +262,7 @@ class Stepper { // Triggered position of an axis in mm (not core-savvy) // static FORCE_INLINE float triggered_position_mm(AxisEnum axis) { - return endstops_trigsteps[axis] / planner.axis_steps_per_mm[axis]; + return endstops_trigsteps[axis] * planner.steps_to_mm[axis]; } #if ENABLED(LIN_ADVANCE) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index db2805285..82d6477b8 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -572,7 +572,7 @@ float Temperature::get_pid_output(int e) { lpq[lpq_ptr] = 0; } if (++lpq_ptr >= lpq_len) lpq_ptr = 0; - cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX); + cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX); pid_output += cTerm[HOTEND_INDEX]; } #endif //PID_ADD_EXTRUSION_RATE diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 2a9e6e90e..65c3ba9cc 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -678,7 +678,7 @@ void kill_screen(const char* lcd_msg) { } if (lcdDrawUpdate) lcd_implementation_drawedit(msg, ftostr43sign( - ((1000 * babysteps_done) / planner.axis_steps_per_mm[axis]) * 0.001f + ((1000 * babysteps_done) * planner.steps_to_mm[axis]) * 0.001f )); } @@ -1769,6 +1769,7 @@ void kill_screen(const char* lcd_msg) { } static void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } + static void _planner_refresh_positioning() { planner.refresh_positioning(); } /** * @@ -1805,14 +1806,14 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000); MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000); - MENU_ITEM_EDIT(float52, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999); - MENU_ITEM_EDIT(float52, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_XSTEPS, &planner.axis_steps_per_mm[X_AXIS], 5, 9999, _planner_refresh_positioning); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_YSTEPS, &planner.axis_steps_per_mm[Y_AXIS], 5, 9999, _planner_refresh_positioning); #if ENABLED(DELTA) - MENU_ITEM_EDIT(float52, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999, _planner_refresh_positioning); #else - MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999); + MENU_ITEM_EDIT_CALLBACK(float51, MSG_ZSTEPS, &planner.axis_steps_per_mm[Z_AXIS], 5, 9999, _planner_refresh_positioning); #endif - MENU_ITEM_EDIT(float51, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999); + MENU_ITEM_EDIT_CALLBACK(float51, MSG_ESTEPS, &planner.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit); #endif From ddde785b37dafeb1463822dc16cec20eae7d90b1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Jul 2016 19:49:13 -0700 Subject: [PATCH 485/580] Code formatting in planner.cpp --- Marlin/planner.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index decea1576..8bb9a6ac0 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -80,30 +80,31 @@ block_t Planner::block_buffer[BLOCK_BUFFER_SIZE]; volatile uint8_t Planner::block_buffer_head = 0; // Index of the next block to be pushed volatile uint8_t Planner::block_buffer_tail = 0; -float Planner::max_feedrate_mm_s[NUM_AXIS]; // Max speeds in mm per second -float Planner::axis_steps_per_mm[NUM_AXIS]; -float Planner::steps_to_mm[NUM_AXIS]; -unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS]; -unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software +float Planner::max_feedrate_mm_s[NUM_AXIS], // Max speeds in mm per second + Planner::axis_steps_per_mm[NUM_AXIS], + Planner::steps_to_mm[NUM_AXIS]; + +unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS], + Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software millis_t Planner::min_segment_time; -float Planner::min_feedrate_mm_s; -float Planner::acceleration; // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX -float Planner::retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX -float Planner::travel_acceleration; // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX -float Planner::max_xy_jerk; // The largest speed change requiring no acceleration -float Planner::max_z_jerk; -float Planner::max_e_jerk; -float Planner::min_travel_feedrate_mm_s; +float Planner::min_feedrate_mm_s, + Planner::acceleration, // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX + Planner::retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX + Planner::travel_acceleration, // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX + Planner::max_xy_jerk, // The largest speed change requiring no acceleration + Planner::max_z_jerk, + Planner::max_e_jerk, + Planner::min_travel_feedrate_mm_s; #if ENABLED(AUTO_BED_LEVELING_FEATURE) matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level #endif #if ENABLED(AUTOTEMP) - float Planner::autotemp_max = 250; - float Planner::autotemp_min = 210; - float Planner::autotemp_factor = 0.1; + float Planner::autotemp_max = 250, + Planner::autotemp_min = 210, + Planner::autotemp_factor = 0.1; bool Planner::autotemp_enabled = false; #endif @@ -111,9 +112,8 @@ float Planner::min_travel_feedrate_mm_s; long Planner::position[NUM_AXIS] = { 0 }; -float Planner::previous_speed[NUM_AXIS]; - -float Planner::previous_nominal_speed; +float Planner::previous_speed[NUM_AXIS], + Planner::previous_nominal_speed; #if ENABLED(DISABLE_INACTIVE_EXTRUDER) uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 }; From d8f2876753b05c6c73ba1412631789fcb7db7ad8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 11:50:54 -0700 Subject: [PATCH 486/580] Replace some float division with multiplication --- Marlin/Marlin_main.cpp | 6 +++--- Marlin/planner.cpp | 16 +++++++++------- Marlin/stepper.cpp | 6 +++--- Marlin/temperature.cpp | 8 ++++---- Marlin/ultralcd_impl_DOGM.h | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 70b23a4d3..ec0fc51d2 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1332,7 +1332,7 @@ inline bool code_value_bool() { return code_value_byte() > 0; } case TEMPUNIT_C: return code_value_float(); case TEMPUNIT_F: - return (code_value_float() - 32) / 1.8; + return (code_value_float() - 32) * 0.5555555556; case TEMPUNIT_K: return code_value_float() - 272.15; default: @@ -1346,7 +1346,7 @@ inline bool code_value_bool() { return code_value_byte() > 0; } case TEMPUNIT_K: return code_value_float(); case TEMPUNIT_F: - return code_value_float() / 1.8; + return code_value_float() * 0.5555555556; default: return code_value_float(); } @@ -6141,7 +6141,7 @@ inline void gcode_M428() { bool err = false; LOOP_XYZ(i) { if (axis_homed[i]) { - float base = (current_position[i] > (sw_endstop_min[i] + sw_endstop_max[i]) / 2) ? base_home_pos(i) : 0, + float base = (current_position[i] > (sw_endstop_min[i] + sw_endstop_max[i]) * 0.5) ? base_home_pos(i) : 0, diff = current_position[i] - LOGICAL_POSITION(base, i); if (diff > -20 && diff < 20) { set_home_offset((AxisEnum)i, home_offset[i] - diff); diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 8bb9a6ac0..d59f6c8e9 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -814,7 +814,7 @@ void Planner::check_axes_activity() { delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS]; #endif #endif - delta_mm[E_AXIS] = (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0; + delta_mm[E_AXIS] = 0.01 * (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder]; if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { block->millimeters = fabs(delta_mm[E_AXIS]); @@ -888,7 +888,7 @@ void Planner::check_axes_activity() { while (filwidth_delay_dist >= MMD_MM) filwidth_delay_dist -= MMD_MM; // Convert into an index into the measurement array - filwidth_delay_index1 = (int)(filwidth_delay_dist / 10.0 + 0.0001); + filwidth_delay_index1 = (int)(filwidth_delay_dist * 0.1 + 0.0001); // If the index has changed (must have gone forward)... if (filwidth_delay_index1 != filwidth_delay_index2) { @@ -975,7 +975,7 @@ void Planner::check_axes_activity() { block->acceleration_steps_per_s2 = (max_acceleration_steps_per_s2[E_AXIS] * block->step_event_count) / block->steps[E_AXIS]; } block->acceleration = block->acceleration_steps_per_s2 / steps_per_mm; - block->acceleration_rate = (long)(block->acceleration_steps_per_s2 * 16777216.0 / ((F_CPU) / 8.0)); + block->acceleration_rate = (long)(block->acceleration_steps_per_s2 * 16777216.0 / ((F_CPU) * 0.125)); #if 0 // Use old jerk for now @@ -1021,10 +1021,12 @@ void Planner::check_axes_activity() { #endif // Start with a safe speed - float vmax_junction = max_xy_jerk / 2; - float vmax_junction_factor = 1.0; - float mz2 = max_z_jerk / 2, me2 = max_e_jerk / 2; - float csz = current_speed[Z_AXIS], cse = current_speed[E_AXIS]; + float vmax_junction = max_xy_jerk * 0.5, + vmax_junction_factor = 1.0, + mz2 = max_z_jerk * 0.5, + me2 = max_e_jerk * 0.5, + csz = current_speed[Z_AXIS], + cse = current_speed[E_AXIS]; if (fabs(csz) > mz2) vmax_junction = min(vmax_junction, mz2); if (fabs(cse) > me2) vmax_junction = min(vmax_junction, me2); vmax_junction = min(vmax_junction, block->nominal_speed); diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 63a5d0b31..88e8cd560 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -944,7 +944,7 @@ float Stepper::get_axis_position_mm(AxisEnum axis) { CRITICAL_SECTION_END; // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1 // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2 - axis_steps = (pos1 + ((axis == CORE_AXIS_1) ? pos2 : -pos2)) / 2.0f; + axis_steps = (pos1 + ((axis == CORE_AXIS_1) ? pos2 : -pos2)) * 0.5f; } else axis_steps = position(axis); @@ -973,9 +973,9 @@ void Stepper::endstop_triggered(AxisEnum axis) { float axis_pos = count_position[axis]; if (axis == CORE_AXIS_1) - axis_pos = (axis_pos + count_position[CORE_AXIS_2]) / 2; + axis_pos = (axis_pos + count_position[CORE_AXIS_2]) * 0.5; else if (axis == CORE_AXIS_2) - axis_pos = (count_position[CORE_AXIS_1] - axis_pos) / 2; + axis_pos = (count_position[CORE_AXIS_1] - axis_pos) * 0.5; endstops_trigsteps[axis] = axis_pos; #else // !COREXY && !COREXZ && !COREYZ diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 82d6477b8..666edd90f 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -319,13 +319,13 @@ unsigned char Temperature::soft_pwm[HOTENDS]; SERIAL_PROTOCOLPAIR(MSG_T_MIN, min); SERIAL_PROTOCOLPAIR(MSG_T_MAX, max); if (cycles > 2) { - Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0); - Tu = ((float)(t_low + t_high) / 1000.0); + Ku = (4.0 * d) / (3.14159265 * (max - min) * 0.5); + Tu = ((float)(t_low + t_high) * 0.001); SERIAL_PROTOCOLPAIR(MSG_KU, Ku); SERIAL_PROTOCOLPAIR(MSG_TU, Tu); workKp = 0.6 * Ku; workKi = 2 * workKp / Tu; - workKd = workKp * Tu / 8; + workKd = workKp * Tu * 0.125; SERIAL_PROTOCOLLNPGM(MSG_CLASSIC_PID); SERIAL_PROTOCOLPAIR(MSG_KP, workKp); SERIAL_PROTOCOLPAIR(MSG_KI, workKi); @@ -753,7 +753,7 @@ void Temperature::manage_heater() { // Get the delayed info and add 100 to reconstitute to a percent of // the nominal filament diameter then square it to get an area meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY); - float vm = pow((measurement_delay[meas_shift_index] + 100.0) / 100.0, 2); + float vm = pow((measurement_delay[meas_shift_index] + 100.0) * 0.01, 2); NOLESS(vm, 0.01); volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm; } diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 22a86a5da..742e253f2 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -385,7 +385,7 @@ static void lcd_implementation_status_screen() { // SD Card Progress bar and clock if (IS_SD_PRINTING) { // Progress bar solid part - u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - (TALL_FONT_CORRECTION)); + u8g.drawBox(55, 50, (unsigned int)(71 * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION)); } u8g.setPrintPos(80,48); From a5212bf277a4b880a3f90974ff79ff4351cc42c0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 13:36:00 -0700 Subject: [PATCH 487/580] Sanity check for too many temp sensors --- Marlin/SanityCheck.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 5eea066a6..299a7cc76 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -564,8 +564,20 @@ #elif !PIN_EXISTS(TEMP_3) #error "TEMP_3_PIN not defined for this board." #endif + #elif TEMP_SENSOR_3 != 0 + #error "TEMP_SENSOR_3 shouldn't be set with only 3 extruders." #endif - #endif + #elif TEMP_SENSOR_2 != 0 + #error "TEMP_SENSOR_2 shouldn't be set with only 2 extruders." + #elif TEMP_SENSOR_3 != 0 + #error "TEMP_SENSOR_3 shouldn't be set with only 2 extruders." + #endif +#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT) + #error "TEMP_SENSOR_1 shouldn't be set with only 1 extruder." +#elif TEMP_SENSOR_2 != 0 + #error "TEMP_SENSOR_2 shouldn't be set with only 1 extruder." +#elif TEMP_SENSOR_3 != 0 + #error "TEMP_SENSOR_3 shouldn't be set with only 1 extruder." #endif #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0 From bedda3be61c2033dab7a055c154ca281f0815120 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 15:24:40 -0700 Subject: [PATCH 488/580] Patch generic delta error caught by sanity check --- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index cb84cb96c..e25730952 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -239,7 +239,7 @@ //#define DUMMY_THERMISTOR_999_VALUE 100 // :{ '0': "Not used",'1':"100k / 4.7k - EPCOS",'2':"200k / 4.7k - ATC Semitec 204GT-2",'3':"Mendel-parts / 4.7k",'4':"10k !! do not use for a hotend. Bad resolution at high temp. !!",'5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'6':"100k / 4.7k EPCOS - Not as accurate as Table 1",'7':"100k / 4.7k Honeywell 135-104LAG-J01",'8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT",'9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1",'10':"100k / 4.7k RS 198-961",'11':"100k / 4.7k beta 3950 1%",'12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)",'13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'",'20':"PT100 (Ultimainboard V2.x)",'51':"100k / 1k - EPCOS",'52':"200k / 1k - ATC Semitec 204GT-2",'55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)",'60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950",'66':"Dyze Design 4.7M High Temperature thermistor",'70':"the 100K thermistor found in the bq Hephestos 2",'71':"100k / 4.7k Honeywell 135-104LAF-J01",'147':"Pt100 / 4.7k",'1047':"Pt1000 / 4.7k",'110':"Pt100 / 1k (non-standard)",'1010':"Pt1000 / 1k (non standard)",'-3':"Thermocouple + MAX31855 (only for sensor 0)",'-2':"Thermocouple + MAX6675 (only for sensor 0)",'-1':"Thermocouple + AD595",'998':"Dummy 1",'999':"Dummy 2" } #define TEMP_SENSOR_0 -1 -#define TEMP_SENSOR_1 -1 +#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 0 From 101b60ef42357fb846607fc5b1f514d8d5868383 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 16:34:31 -0700 Subject: [PATCH 489/580] Tweak Dual X Carriage data spacing --- Marlin/Marlin_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ef4bd32b6..f7f038561 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1424,11 +1424,11 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); } static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1 - static bool active_extruder_parked = false; // used in mode 1 & 2 - static float raised_parked_position[NUM_AXIS]; // used in mode 1 - static millis_t delayed_move_time = 0; // used in mode 1 + static bool active_extruder_parked = false; // used in mode 1 & 2 + static float raised_parked_position[NUM_AXIS]; // used in mode 1 + static millis_t delayed_move_time = 0; // used in mode 1 static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2 - static float duplicate_extruder_temp_offset = 0; // used in mode 2 + static float duplicate_extruder_temp_offset = 0; // used in mode 2 #endif //DUAL_X_CARRIAGE From f75b0c2ee1fe17fc431bc213d5029ce7d50aa3b9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 16:34:01 -0700 Subject: [PATCH 490/580] Make POSITION macros global --- Marlin/Marlin.h | 20 ++++++++++--- Marlin/Marlin_main.cpp | 66 ++++++++++++++++++++---------------------- 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 3d097235e..2a4c4fd94 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -292,14 +292,26 @@ extern bool volumetric_enabled; extern int extruder_multiplier[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner -extern float current_position[NUM_AXIS]; -extern float home_offset[3]; // axis[n].home_offset -extern float sw_endstop_min[3]; // axis[n].sw_endstop_min -extern float sw_endstop_max[3]; // axis[n].sw_endstop_max extern bool axis_known_position[3]; // axis[n].is_known extern bool axis_homed[3]; // axis[n].is_homed extern volatile bool wait_for_heatup; +extern float current_position[NUM_AXIS]; +extern float position_shift[3]; +extern float home_offset[3]; +extern float sw_endstop_min[3]; +extern float sw_endstop_max[3]; + +#define LOGICAL_POSITION(POS, AXIS) (POS + home_offset[AXIS] + position_shift[AXIS]) +#define RAW_POSITION(POS, AXIS) (POS - home_offset[AXIS] - position_shift[AXIS]) +#define LOGICAL_X_POSITION(POS) LOGICAL_POSITION(POS, X_AXIS) +#define LOGICAL_Y_POSITION(POS) LOGICAL_POSITION(POS, Y_AXIS) +#define LOGICAL_Z_POSITION(POS) LOGICAL_POSITION(POS, Z_AXIS) +#define RAW_X_POSITION(POS) RAW_POSITION(POS, X_AXIS) +#define RAW_Y_POSITION(POS) RAW_POSITION(POS, Y_AXIS) +#define RAW_Z_POSITION(POS) RAW_POSITION(POS, Z_AXIS) +#define RAW_CURRENT_POSITION(AXIS) RAW_POSITION(current_position[AXIS], AXIS) + // GCode support for external objects bool code_seen(char); int code_value_int(); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f7f038561..3d8b43254 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -331,10 +331,6 @@ float position_shift[3] = { 0 }; // Set by M206, M428, or menu item. Saved to EEPROM. float home_offset[3] = { 0 }; -#define LOGICAL_POSITION(POS, AXIS) (POS + home_offset[AXIS] + position_shift[AXIS]) -#define RAW_POSITION(POS, AXIS) (POS - home_offset[AXIS] - position_shift[AXIS]) -#define RAW_CURRENT_POSITION(AXIS) (RAW_POSITION(current_position[AXIS], AXIS)) - // Software Endstops. Default to configured limits. float sw_endstop_min[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; float sw_endstop_max[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; @@ -1408,7 +1404,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static float x_home_pos(int extruder) { if (extruder == 0) - return LOGICAL_POSITION(base_home_pos(X_AXIS), X_AXIS); + return LOGICAL_X_POSITION(base_home_pos(X_AXIS)); else /** * In dual carriage mode the extruder offset provides an override of the @@ -1513,7 +1509,7 @@ static void set_axis_is_at_home(AxisEnum axis) { if (active_extruder != 0) current_position[X_AXIS] = x_home_pos(active_extruder); else - current_position[X_AXIS] = LOGICAL_POSITION(base_home_pos(X_AXIS), X_AXIS); + current_position[X_AXIS] = LOGICAL_X_POSITION(base_home_pos(X_AXIS)); update_software_endstops(X_AXIS); return; } @@ -1803,7 +1799,7 @@ static void clean_up_after_endstop_or_probe_move() { SERIAL_ECHOLNPGM(")"); } #endif - float z_dest = LOGICAL_POSITION(z_raise, Z_AXIS); + float z_dest = LOGICAL_Z_POSITION(z_raise); if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; @@ -2964,7 +2960,7 @@ inline void gcode_G28() { if (home_all_axis || homeX || homeY) { // Raise Z before homing any other axes and z is not already high enough (never lower z) - destination[Z_AXIS] = LOGICAL_POSITION(MIN_Z_HEIGHT_FOR_HOMING, Z_AXIS); + destination[Z_AXIS] = LOGICAL_Z_POSITION(MIN_Z_HEIGHT_FOR_HOMING); if (destination[Z_AXIS] > current_position[Z_AXIS]) { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3218,12 +3214,12 @@ inline void gcode_G28() { ; line_to_current_position(); - current_position[X_AXIS] = LOGICAL_POSITION(x, X_AXIS); - current_position[Y_AXIS] = LOGICAL_POSITION(y, Y_AXIS); + current_position[X_AXIS] = LOGICAL_X_POSITION(x); + current_position[Y_AXIS] = LOGICAL_Y_POSITION(y); line_to_current_position(); #if Z_RAISE_BETWEEN_PROBINGS > 0 || MIN_Z_HEIGHT_FOR_HOMING > 0 - current_position[Z_AXIS] = LOGICAL_POSITION(MESH_HOME_SEARCH_Z, Z_AXIS); + current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z); line_to_current_position(); #endif @@ -3641,14 +3637,14 @@ inline void gcode_G28() { #endif // Probe at 3 arbitrary points - float z_at_pt_1 = probe_pt( LOGICAL_POSITION(ABL_PROBE_PT_1_X, X_AXIS), - LOGICAL_POSITION(ABL_PROBE_PT_1_Y, Y_AXIS), + float z_at_pt_1 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_1_X, X_AXIS), + LOGICAL_Y_POSITION(ABL_PROBE_PT_1_Y, Y_AXIS), stow_probe_after_each, verbose_level), - z_at_pt_2 = probe_pt( LOGICAL_POSITION(ABL_PROBE_PT_2_X, X_AXIS), - LOGICAL_POSITION(ABL_PROBE_PT_2_Y, Y_AXIS), + z_at_pt_2 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_2_X, X_AXIS), + LOGICAL_Y_POSITION(ABL_PROBE_PT_2_Y, Y_AXIS), stow_probe_after_each, verbose_level), - z_at_pt_3 = probe_pt( LOGICAL_POSITION(ABL_PROBE_PT_3_X, X_AXIS), - LOGICAL_POSITION(ABL_PROBE_PT_3_Y, Y_AXIS), + z_at_pt_3 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_3_X, X_AXIS), + LOGICAL_Y_POSITION(ABL_PROBE_PT_3_Y, Y_AXIS), stow_probe_after_each, verbose_level); if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); @@ -7748,9 +7744,9 @@ void clamp_to_software_endstops(float target[3]) { void inverse_kinematics(const float in_cartesian[3]) { const float cartesian[3] = { - RAW_POSITION(in_cartesian[X_AXIS], X_AXIS), - RAW_POSITION(in_cartesian[Y_AXIS], Y_AXIS), - RAW_POSITION(in_cartesian[Z_AXIS], Z_AXIS) + RAW_X_POSITION(in_cartesian[X_AXIS]), + RAW_Y_POSITION(in_cartesian[Y_AXIS]), + RAW_Z_POSITION(in_cartesian[Z_AXIS]) }; delta[TOWER_1] = sqrt(delta_diagonal_rod_2_tower_1 @@ -7778,13 +7774,13 @@ void clamp_to_software_endstops(float target[3]) { float delta_safe_distance_from_top() { float cartesian[3] = { - LOGICAL_POSITION(0, X_AXIS), - LOGICAL_POSITION(0, Y_AXIS), - LOGICAL_POSITION(0, Z_AXIS) + LOGICAL_X_POSITION(0), + LOGICAL_Y_POSITION(0), + LOGICAL_Z_POSITION(0) }; inverse_kinematics(cartesian); float distance = delta[TOWER_3]; - cartesian[Y_AXIS] = LOGICAL_POSITION(DELTA_PRINTABLE_RADIUS, Y_AXIS); + cartesian[Y_AXIS] = LOGICAL_Y_POSITION(DELTA_PRINTABLE_RADIUS); inverse_kinematics(cartesian); return abs(distance - delta[TOWER_3]); } @@ -7876,8 +7872,8 @@ void clamp_to_software_endstops(float target[3]) { int half = (AUTO_BED_LEVELING_GRID_POINTS - 1) / 2; float h1 = 0.001 - half, h2 = half - 0.001, - grid_x = max(h1, min(h2, RAW_POSITION(cartesian[X_AXIS], X_AXIS) / delta_grid_spacing[0])), - grid_y = max(h1, min(h2, RAW_POSITION(cartesian[Y_AXIS], Y_AXIS) / delta_grid_spacing[1])); + grid_x = max(h1, min(h2, RAW_X_POSITION(cartesian[X_AXIS]) / delta_grid_spacing[0])), + grid_y = max(h1, min(h2, RAW_Y_POSITION(cartesian[Y_AXIS]) / delta_grid_spacing[1])); int floor_x = floor(grid_x), floor_y = floor(grid_y); float ratio_x = grid_x - floor_x, ratio_y = grid_y - floor_y, z1 = bed_level[floor_x + half][floor_y + half], @@ -7918,9 +7914,9 @@ void set_current_from_steppers_for_axis(AxisEnum axis) { current_position[axis] = LOGICAL_POSITION(cartesian_position[axis], axis); #elif ENABLED(AUTO_BED_LEVELING_FEATURE) vector_3 pos = planner.adjusted_position(); - current_position[axis] = LOGICAL_POSITION(axis == X_AXIS ? pos.x : axis == Y_AXIS ? pos.y : pos.z, axis); + current_position[axis] = axis == X_AXIS ? pos.x : axis == Y_AXIS ? pos.y : pos.z; #else - current_position[axis] = LOGICAL_POSITION(stepper.get_axis_position_mm(axis), axis); // CORE handled transparently + current_position[axis] = stepper.get_axis_position_mm(axis); // CORE handled transparently #endif } @@ -7930,8 +7926,8 @@ void set_current_from_steppers_for_axis(AxisEnum axis) { void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { int cx1 = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)), cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), - cx2 = mbl.cell_index_x(RAW_POSITION(destination[X_AXIS], X_AXIS)), - cy2 = mbl.cell_index_y(RAW_POSITION(destination[Y_AXIS], Y_AXIS)); + cx2 = mbl.cell_index_x(RAW_X_POSITION(destination[X_AXIS])), + cy2 = mbl.cell_index_y(RAW_Y_POSITION(destination[Y_AXIS])); NOMORE(cx1, MESH_NUM_X_POINTS - 2); NOMORE(cy1, MESH_NUM_Y_POINTS - 2); NOMORE(cx2, MESH_NUM_X_POINTS - 2); @@ -7952,14 +7948,14 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); if (cx2 != cx1 && TEST(x_splits, gcx)) { memcpy(end, destination, sizeof(end)); - destination[X_AXIS] = LOGICAL_POSITION(mbl.get_probe_x(gcx), X_AXIS); + destination[X_AXIS] = LOGICAL_X_POSITION(mbl.get_probe_x(gcx)); normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); destination[Y_AXIS] = MBL_SEGMENT_END(Y); CBI(x_splits, gcx); } else if (cy2 != cy1 && TEST(y_splits, gcy)) { memcpy(end, destination, sizeof(end)); - destination[Y_AXIS] = LOGICAL_POSITION(mbl.get_probe_y(gcy), Y_AXIS); + destination[Y_AXIS] = LOGICAL_Y_POSITION(mbl.get_probe_y(gcy)); normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); destination[X_AXIS] = MBL_SEGMENT_END(X); CBI(y_splits, gcy); @@ -8374,8 +8370,8 @@ void prepare_move_to_destination() { float SCARA_pos[2]; static float SCARA_C2, SCARA_S2, SCARA_K1, SCARA_K2, SCARA_theta, SCARA_psi; - SCARA_pos[X_AXIS] = RAW_POSITION(cartesian[X_AXIS], X_AXIS) * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y - SCARA_pos[Y_AXIS] = RAW_POSITION(cartesian[Y_AXIS], Y_AXIS) * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor. + SCARA_pos[X_AXIS] = RAW_X_POSITION(cartesian[X_AXIS]) * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y + SCARA_pos[Y_AXIS] = RAW_Y_POSITION(cartesian[Y_AXIS]) * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor. #if (Linkage_1 == Linkage_2) SCARA_C2 = ((sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS])) / (2 * (float)L1_2)) - 1; @@ -8393,7 +8389,7 @@ void prepare_move_to_destination() { delta[X_AXIS] = SCARA_theta * SCARA_RAD2DEG; // Multiply by 180/Pi - theta is support arm angle delta[Y_AXIS] = (SCARA_theta + SCARA_psi) * SCARA_RAD2DEG; // - equal to sub arm angle (inverted motor) - delta[Z_AXIS] = RAW_POSITION(cartesian[Z_AXIS], Z_AXIS); + delta[Z_AXIS] = RAW_Z_POSITION(cartesian[Z_AXIS]); /** SERIAL_ECHOPGM("cartesian x="); SERIAL_ECHO(cartesian[X_AXIS]); From b183442c6179817cb3ed5bad741dc0da9cff7975 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 16:35:03 -0700 Subject: [PATCH 491/580] Fix inactive_extruder_x_pos for coordinate space --- Marlin/Marlin_main.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3d8b43254..2400acb94 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3000,7 +3000,7 @@ inline void gcode_G28() { int tmp_extruder = active_extruder; active_extruder = !active_extruder; HOMEAXIS(X); - inactive_extruder_x_pos = current_position[X_AXIS]; + inactive_extruder_x_pos = RAW_X_POSITION(current_position[X_AXIS]); active_extruder = tmp_extruder; HOMEAXIS(X); // reset state used by the different modes @@ -6746,16 +6746,16 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_m/*=0.0*/, bool n switch (dual_x_carriage_mode) { case DXC_FULL_CONTROL_MODE: - current_position[X_AXIS] = inactive_extruder_x_pos; - inactive_extruder_x_pos = destination[X_AXIS]; + current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos); + inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]); break; case DXC_DUPLICATION_MODE: active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position if (active_extruder_parked) - current_position[X_AXIS] = inactive_extruder_x_pos; + current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos); else current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset; - inactive_extruder_x_pos = destination[X_AXIS]; + inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]); extruder_duplication_enabled = false; break; default: @@ -8026,7 +8026,12 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_ if (active_extruder_parked) { if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) { // move duplicate extruder into correct duplication position. - planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + planner.set_position_mm( + LOGICAL_X_POSITION(inactive_extruder_x_pos), + current_position[Y_AXIS], + current_position[Z_AXIS], + current_position[E_AXIS] + ); planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1); SYNC_PLAN_POSITION_KINEMATIC(); From d8e5af68349a6d17c91c9ab64609d3de2b187583 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 16:48:13 -0700 Subject: [PATCH 492/580] Use RAW_POSITION for MBL in planner.set_position_mm --- Marlin/planner.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 35e5d3bd9..aa80eb082 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1142,10 +1142,14 @@ void Planner::check_axes_activity() { #endif // AUTO_BED_LEVELING_FEATURE || MESH_BED_LEVELING { #if ENABLED(MESH_BED_LEVELING) + if (mbl.active()) - z += mbl.get_z(x - home_offset[X_AXIS], y - home_offset[Y_AXIS]); + z += mbl.get_z(RAW_X_POSITION(x), RAW_Y_POSITION(y)); + #elif ENABLED(AUTO_BED_LEVELING_FEATURE) + apply_rotation_xyz(bed_level_matrix, x, y, z); + #endif long nx = position[X_AXIS] = lround(x * axis_steps_per_mm[X_AXIS]), From e4816293a8fbdb83fdfaff672851bbd3bf9f7980 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 17:46:19 -0700 Subject: [PATCH 493/580] serial_echopair_P for uint16_t --- Marlin/Marlin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 3d097235e..42269b75b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -114,6 +114,7 @@ void serial_echopair_P(const char* s_P, long v); void serial_echopair_P(const char* s_P, float v); void serial_echopair_P(const char* s_P, double v); void serial_echopair_P(const char* s_P, unsigned long v); +FORCE_INLINE void serial_echopair_P(const char* s_P, uint16_t v) { serial_echopair_P(s_P, (int)v); } FORCE_INLINE void serial_echopair_P(const char* s_P, bool v) { serial_echopair_P(s_P, (int)v); } FORCE_INLINE void serial_echopair_P(const char* s_P, void *v) { serial_echopair_P(s_P, (unsigned long)v); } From 060dc6d95ad983e164a9b969e837a8dc9355ba41 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 10:19:49 -0700 Subject: [PATCH 494/580] Neaten up EEPROM read/write functions --- Marlin/configuration_store.cpp | 300 +++++++++++++++++---------------- 1 file changed, 154 insertions(+), 146 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 6a581ee1f..3d61f7712 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -185,8 +185,10 @@ void Config_Postprocess() { #if ENABLED(EEPROM_SETTINGS) #define DUMMY_PID_VALUE 3000.0f - #define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value)) - #define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value)) + #define EEPROM_START() int eeprom_index = EEPROM_OFFSET + #define EEPROM_SKIP(VAR) eeprom_index += sizeof(VAR) + #define EEPROM_WRITE(VAR) _EEPROM_writeData(eeprom_index, (uint8_t*)&VAR, sizeof(VAR)) + #define EEPROM_READ(VAR) _EEPROM_readData(eeprom_index, (uint8_t*)&VAR, sizeof(VAR)) /** * M500 - Store Configuration @@ -194,26 +196,27 @@ void Config_Postprocess() { void Config_StoreSettings() { float dummy = 0.0f; char ver[4] = "000"; - int i = EEPROM_OFFSET; - EEPROM_WRITE_VAR(i, ver); // invalidate data first - i += sizeof(eeprom_checksum); // Skip the checksum slot + EEPROM_START(); + + EEPROM_WRITE(ver); // invalidate data first + EEPROM_SKIP(eeprom_checksum); // Skip the checksum slot eeprom_checksum = 0; // clear before first "real data" - EEPROM_WRITE_VAR(i, planner.axis_steps_per_mm); - EEPROM_WRITE_VAR(i, planner.max_feedrate_mm_s); - EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2); - EEPROM_WRITE_VAR(i, planner.acceleration); - EEPROM_WRITE_VAR(i, planner.retract_acceleration); - EEPROM_WRITE_VAR(i, planner.travel_acceleration); - EEPROM_WRITE_VAR(i, planner.min_feedrate_mm_s); - EEPROM_WRITE_VAR(i, planner.min_travel_feedrate_mm_s); - EEPROM_WRITE_VAR(i, planner.min_segment_time); - EEPROM_WRITE_VAR(i, planner.max_xy_jerk); - EEPROM_WRITE_VAR(i, planner.max_z_jerk); - EEPROM_WRITE_VAR(i, planner.max_e_jerk); - EEPROM_WRITE_VAR(i, home_offset); + EEPROM_WRITE(planner.axis_steps_per_mm); + EEPROM_WRITE(planner.max_feedrate_mm_s); + EEPROM_WRITE(planner.max_acceleration_mm_per_s2); + EEPROM_WRITE(planner.acceleration); + EEPROM_WRITE(planner.retract_acceleration); + EEPROM_WRITE(planner.travel_acceleration); + EEPROM_WRITE(planner.min_feedrate_mm_s); + EEPROM_WRITE(planner.min_travel_feedrate_mm_s); + EEPROM_WRITE(planner.min_segment_time); + EEPROM_WRITE(planner.max_xy_jerk); + EEPROM_WRITE(planner.max_z_jerk); + EEPROM_WRITE(planner.max_e_jerk); + EEPROM_WRITE(home_offset); #if ENABLED(MESH_BED_LEVELING) // Compile time test that sizeof(mbl.z_values) is as expected @@ -221,45 +224,45 @@ void Config_StoreSettings() { uint8_t mesh_num_x = MESH_NUM_X_POINTS, mesh_num_y = MESH_NUM_Y_POINTS, dummy_uint8 = mbl.status & _BV(MBL_STATUS_HAS_MESH_BIT); - EEPROM_WRITE_VAR(i, dummy_uint8); - EEPROM_WRITE_VAR(i, mbl.z_offset); - EEPROM_WRITE_VAR(i, mesh_num_x); - EEPROM_WRITE_VAR(i, mesh_num_y); - EEPROM_WRITE_VAR(i, mbl.z_values); + EEPROM_WRITE(dummy_uint8); + EEPROM_WRITE(mbl.z_offset); + EEPROM_WRITE(mesh_num_x); + EEPROM_WRITE(mesh_num_y); + EEPROM_WRITE(mbl.z_values); #else // For disabled MBL write a default mesh uint8_t mesh_num_x = 3, mesh_num_y = 3, dummy_uint8 = 0; dummy = 0.0f; - EEPROM_WRITE_VAR(i, dummy_uint8); - EEPROM_WRITE_VAR(i, dummy); - EEPROM_WRITE_VAR(i, mesh_num_x); - EEPROM_WRITE_VAR(i, mesh_num_y); - for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_WRITE_VAR(i, dummy); + EEPROM_WRITE(dummy_uint8); + EEPROM_WRITE(dummy); + EEPROM_WRITE(mesh_num_x); + EEPROM_WRITE(mesh_num_y); + for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_WRITE(dummy); #endif // MESH_BED_LEVELING #if !HAS_BED_PROBE float zprobe_zoffset = 0; #endif - EEPROM_WRITE_VAR(i, zprobe_zoffset); + EEPROM_WRITE(zprobe_zoffset); // 9 floats for DELTA / Z_DUAL_ENDSTOPS #if ENABLED(DELTA) - EEPROM_WRITE_VAR(i, endstop_adj); // 3 floats - EEPROM_WRITE_VAR(i, delta_radius); // 1 float - EEPROM_WRITE_VAR(i, delta_diagonal_rod); // 1 float - EEPROM_WRITE_VAR(i, delta_segments_per_second); // 1 float - EEPROM_WRITE_VAR(i, delta_diagonal_rod_trim_tower_1); // 1 float - EEPROM_WRITE_VAR(i, delta_diagonal_rod_trim_tower_2); // 1 float - EEPROM_WRITE_VAR(i, delta_diagonal_rod_trim_tower_3); // 1 float + EEPROM_WRITE(endstop_adj); // 3 floats + EEPROM_WRITE(delta_radius); // 1 float + EEPROM_WRITE(delta_diagonal_rod); // 1 float + EEPROM_WRITE(delta_segments_per_second); // 1 float + EEPROM_WRITE(delta_diagonal_rod_trim_tower_1); // 1 float + EEPROM_WRITE(delta_diagonal_rod_trim_tower_2); // 1 float + EEPROM_WRITE(delta_diagonal_rod_trim_tower_3); // 1 float #elif ENABLED(Z_DUAL_ENDSTOPS) - EEPROM_WRITE_VAR(i, z_endstop_adj); // 1 float + EEPROM_WRITE(z_endstop_adj); // 1 float dummy = 0.0f; - for (uint8_t q = 8; q--;) EEPROM_WRITE_VAR(i, dummy); + for (uint8_t q = 8; q--;) EEPROM_WRITE(dummy); #else dummy = 0.0f; - for (uint8_t q = 9; q--;) EEPROM_WRITE_VAR(i, dummy); + for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy); #endif #if DISABLED(ULTIPANEL) @@ -267,34 +270,34 @@ void Config_StoreSettings() { preheatHotendTemp2 = PREHEAT_2_TEMP_HOTEND, preheatBedTemp2 = PREHEAT_2_TEMP_BED, preheatFanSpeed2 = PREHEAT_2_FAN_SPEED; #endif // !ULTIPANEL - EEPROM_WRITE_VAR(i, preheatHotendTemp1); - EEPROM_WRITE_VAR(i, preheatBedTemp1); - EEPROM_WRITE_VAR(i, preheatFanSpeed1); - EEPROM_WRITE_VAR(i, preheatHotendTemp2); - EEPROM_WRITE_VAR(i, preheatBedTemp2); - EEPROM_WRITE_VAR(i, preheatFanSpeed2); + EEPROM_WRITE(preheatHotendTemp1); + EEPROM_WRITE(preheatBedTemp1); + EEPROM_WRITE(preheatFanSpeed1); + EEPROM_WRITE(preheatHotendTemp2); + EEPROM_WRITE(preheatBedTemp2); + EEPROM_WRITE(preheatFanSpeed2); for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { #if ENABLED(PIDTEMP) if (e < HOTENDS) { - EEPROM_WRITE_VAR(i, PID_PARAM(Kp, e)); - EEPROM_WRITE_VAR(i, PID_PARAM(Ki, e)); - EEPROM_WRITE_VAR(i, PID_PARAM(Kd, e)); + EEPROM_WRITE(PID_PARAM(Kp, e)); + EEPROM_WRITE(PID_PARAM(Ki, e)); + EEPROM_WRITE(PID_PARAM(Kd, e)); #if ENABLED(PID_ADD_EXTRUSION_RATE) - EEPROM_WRITE_VAR(i, PID_PARAM(Kc, e)); + EEPROM_WRITE(PID_PARAM(Kc, e)); #else dummy = 1.0f; // 1.0 = default kc - EEPROM_WRITE_VAR(i, dummy); + EEPROM_WRITE(dummy); #endif } else #endif // !PIDTEMP { dummy = DUMMY_PID_VALUE; // When read, will not change the existing value - EEPROM_WRITE_VAR(i, dummy); // Kp + EEPROM_WRITE(dummy); // Kp dummy = 0.0f; - for (uint8_t q = 3; q--;) EEPROM_WRITE_VAR(i, dummy); // Ki, Kd, Kc + for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); // Ki, Kd, Kc } } // Hotends Loop @@ -302,67 +305,68 @@ void Config_StoreSettings() { #if DISABLED(PID_ADD_EXTRUSION_RATE) int lpq_len = 20; #endif - EEPROM_WRITE_VAR(i, lpq_len); + EEPROM_WRITE(lpq_len); #if DISABLED(PIDTEMPBED) dummy = DUMMY_PID_VALUE; - for (uint8_t q = 3; q--;) EEPROM_WRITE_VAR(i, dummy); + for (uint8_t q = 3; q--;) EEPROM_WRITE(dummy); #else - EEPROM_WRITE_VAR(i, thermalManager.bedKp); - EEPROM_WRITE_VAR(i, thermalManager.bedKi); - EEPROM_WRITE_VAR(i, thermalManager.bedKd); + EEPROM_WRITE(thermalManager.bedKp); + EEPROM_WRITE(thermalManager.bedKi); + EEPROM_WRITE(thermalManager.bedKd); #endif #if !HAS_LCD_CONTRAST const int lcd_contrast = 32; #endif - EEPROM_WRITE_VAR(i, lcd_contrast); + EEPROM_WRITE(lcd_contrast); #if ENABLED(SCARA) - EEPROM_WRITE_VAR(i, axis_scaling); // 3 floats + EEPROM_WRITE(axis_scaling); // 3 floats #else dummy = 1.0f; - EEPROM_WRITE_VAR(i, dummy); + EEPROM_WRITE(dummy); #endif #if ENABLED(FWRETRACT) - EEPROM_WRITE_VAR(i, autoretract_enabled); - EEPROM_WRITE_VAR(i, retract_length); + EEPROM_WRITE(autoretract_enabled); + EEPROM_WRITE(retract_length); #if EXTRUDERS > 1 - EEPROM_WRITE_VAR(i, retract_length_swap); + EEPROM_WRITE(retract_length_swap); #else dummy = 0.0f; - EEPROM_WRITE_VAR(i, dummy); + EEPROM_WRITE(dummy); #endif - EEPROM_WRITE_VAR(i, retract_feedrate_mm_s); - EEPROM_WRITE_VAR(i, retract_zlift); - EEPROM_WRITE_VAR(i, retract_recover_length); + EEPROM_WRITE(retract_feedrate_mm_s); + EEPROM_WRITE(retract_zlift); + EEPROM_WRITE(retract_recover_length); #if EXTRUDERS > 1 - EEPROM_WRITE_VAR(i, retract_recover_length_swap); + EEPROM_WRITE(retract_recover_length_swap); #else dummy = 0.0f; - EEPROM_WRITE_VAR(i, dummy); + EEPROM_WRITE(dummy); #endif - EEPROM_WRITE_VAR(i, retract_recover_feedrate_mm_s); + EEPROM_WRITE(retract_recover_feedrate_mm_s); #endif // FWRETRACT - EEPROM_WRITE_VAR(i, volumetric_enabled); + EEPROM_WRITE(volumetric_enabled); // Save filament sizes for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { if (q < COUNT(filament_size)) dummy = filament_size[q]; - EEPROM_WRITE_VAR(i, dummy); + EEPROM_WRITE(dummy); } - uint16_t final_checksum = eeprom_checksum; + uint16_t final_checksum = eeprom_checksum, + eeprom_size = eeprom_index; - int j = EEPROM_OFFSET; - EEPROM_WRITE_VAR(j, version); - EEPROM_WRITE_VAR(j, final_checksum); + eeprom_index = EEPROM_OFFSET; + EEPROM_WRITE(version); + EEPROM_WRITE(final_checksum); // Report storage size SERIAL_ECHO_START; - SERIAL_ECHOPAIR("Settings Stored (", i); + SERIAL_ECHOPAIR("Settings Stored (", eeprom_size); SERIAL_ECHOLNPGM(" bytes)"); } @@ -370,11 +374,15 @@ void Config_StoreSettings() { * M501 - Retrieve Configuration */ void Config_RetrieveSettings() { - int i = EEPROM_OFFSET; + + EEPROM_START(); + char stored_ver[4]; + EEPROM_READ(stored_ver); + uint16_t stored_checksum; - EEPROM_READ_VAR(i, stored_ver); - EEPROM_READ_VAR(i, stored_checksum); + EEPROM_READ(stored_checksum); + // SERIAL_ECHOPAIR("Version: [", ver); // SERIAL_ECHOPAIR("] Stored version: [", stored_ver); // SERIAL_ECHOLNPGM("]"); @@ -388,63 +396,63 @@ void Config_RetrieveSettings() { eeprom_checksum = 0; // clear before reading first "real data" // version number match - EEPROM_READ_VAR(i, planner.axis_steps_per_mm); - EEPROM_READ_VAR(i, planner.max_feedrate_mm_s); - EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2); - - EEPROM_READ_VAR(i, planner.acceleration); - EEPROM_READ_VAR(i, planner.retract_acceleration); - EEPROM_READ_VAR(i, planner.travel_acceleration); - EEPROM_READ_VAR(i, planner.min_feedrate_mm_s); - EEPROM_READ_VAR(i, planner.min_travel_feedrate_mm_s); - EEPROM_READ_VAR(i, planner.min_segment_time); - EEPROM_READ_VAR(i, planner.max_xy_jerk); - EEPROM_READ_VAR(i, planner.max_z_jerk); - EEPROM_READ_VAR(i, planner.max_e_jerk); - EEPROM_READ_VAR(i, home_offset); + EEPROM_READ(planner.axis_steps_per_mm); + EEPROM_READ(planner.max_feedrate_mm_s); + EEPROM_READ(planner.max_acceleration_mm_per_s2); + + EEPROM_READ(planner.acceleration); + EEPROM_READ(planner.retract_acceleration); + EEPROM_READ(planner.travel_acceleration); + EEPROM_READ(planner.min_feedrate_mm_s); + EEPROM_READ(planner.min_travel_feedrate_mm_s); + EEPROM_READ(planner.min_segment_time); + EEPROM_READ(planner.max_xy_jerk); + EEPROM_READ(planner.max_z_jerk); + EEPROM_READ(planner.max_e_jerk); + EEPROM_READ(home_offset); uint8_t dummy_uint8 = 0, mesh_num_x = 0, mesh_num_y = 0; - EEPROM_READ_VAR(i, dummy_uint8); - EEPROM_READ_VAR(i, dummy); - EEPROM_READ_VAR(i, mesh_num_x); - EEPROM_READ_VAR(i, mesh_num_y); + EEPROM_READ(dummy_uint8); + EEPROM_READ(dummy); + EEPROM_READ(mesh_num_x); + EEPROM_READ(mesh_num_y); #if ENABLED(MESH_BED_LEVELING) mbl.status = dummy_uint8; mbl.z_offset = dummy; if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) { // EEPROM data fits the current mesh - EEPROM_READ_VAR(i, mbl.z_values); + EEPROM_READ(mbl.z_values); } else { // EEPROM data is stale mbl.reset(); - for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); + for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ(dummy); } #else // MBL is disabled - skip the stored data - for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy); + for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ(dummy); #endif // MESH_BED_LEVELING #if !HAS_BED_PROBE float zprobe_zoffset = 0; #endif - EEPROM_READ_VAR(i, zprobe_zoffset); + EEPROM_READ(zprobe_zoffset); #if ENABLED(DELTA) - EEPROM_READ_VAR(i, endstop_adj); // 3 floats - EEPROM_READ_VAR(i, delta_radius); // 1 float - EEPROM_READ_VAR(i, delta_diagonal_rod); // 1 float - EEPROM_READ_VAR(i, delta_segments_per_second); // 1 float - EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_1); // 1 float - EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_2); // 1 float - EEPROM_READ_VAR(i, delta_diagonal_rod_trim_tower_3); // 1 float + EEPROM_READ(endstop_adj); // 3 floats + EEPROM_READ(delta_radius); // 1 float + EEPROM_READ(delta_diagonal_rod); // 1 float + EEPROM_READ(delta_segments_per_second); // 1 float + EEPROM_READ(delta_diagonal_rod_trim_tower_1); // 1 float + EEPROM_READ(delta_diagonal_rod_trim_tower_2); // 1 float + EEPROM_READ(delta_diagonal_rod_trim_tower_3); // 1 float #elif ENABLED(Z_DUAL_ENDSTOPS) - EEPROM_READ_VAR(i, z_endstop_adj); + EEPROM_READ(z_endstop_adj); dummy = 0.0f; - for (uint8_t q=8; q--;) EEPROM_READ_VAR(i, dummy); + for (uint8_t q=8; q--;) EEPROM_READ(dummy); #else dummy = 0.0f; - for (uint8_t q=9; q--;) EEPROM_READ_VAR(i, dummy); + for (uint8_t q=9; q--;) EEPROM_READ(dummy); #endif #if DISABLED(ULTIPANEL) @@ -452,86 +460,86 @@ void Config_RetrieveSettings() { preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2; #endif - EEPROM_READ_VAR(i, preheatHotendTemp1); - EEPROM_READ_VAR(i, preheatBedTemp1); - EEPROM_READ_VAR(i, preheatFanSpeed1); - EEPROM_READ_VAR(i, preheatHotendTemp2); - EEPROM_READ_VAR(i, preheatBedTemp2); - EEPROM_READ_VAR(i, preheatFanSpeed2); + EEPROM_READ(preheatHotendTemp1); + EEPROM_READ(preheatBedTemp1); + EEPROM_READ(preheatFanSpeed1); + EEPROM_READ(preheatHotendTemp2); + EEPROM_READ(preheatBedTemp2); + EEPROM_READ(preheatFanSpeed2); #if ENABLED(PIDTEMP) for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) { - EEPROM_READ_VAR(i, dummy); // Kp + EEPROM_READ(dummy); // Kp if (e < HOTENDS && dummy != DUMMY_PID_VALUE) { // do not need to scale PID values as the values in EEPROM are already scaled PID_PARAM(Kp, e) = dummy; - EEPROM_READ_VAR(i, PID_PARAM(Ki, e)); - EEPROM_READ_VAR(i, PID_PARAM(Kd, e)); + EEPROM_READ(PID_PARAM(Ki, e)); + EEPROM_READ(PID_PARAM(Kd, e)); #if ENABLED(PID_ADD_EXTRUSION_RATE) - EEPROM_READ_VAR(i, PID_PARAM(Kc, e)); + EEPROM_READ(PID_PARAM(Kc, e)); #else - EEPROM_READ_VAR(i, dummy); + EEPROM_READ(dummy); #endif } else { - for (uint8_t q=3; q--;) EEPROM_READ_VAR(i, dummy); // Ki, Kd, Kc + for (uint8_t q=3; q--;) EEPROM_READ(dummy); // Ki, Kd, Kc } } #else // !PIDTEMP // 4 x 4 = 16 slots for PID parameters - for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ_VAR(i, dummy); // Kp, Ki, Kd, Kc + for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ(dummy); // Kp, Ki, Kd, Kc #endif // !PIDTEMP #if DISABLED(PID_ADD_EXTRUSION_RATE) int lpq_len; #endif - EEPROM_READ_VAR(i, lpq_len); + EEPROM_READ(lpq_len); #if ENABLED(PIDTEMPBED) - EEPROM_READ_VAR(i, dummy); // bedKp + EEPROM_READ(dummy); // bedKp if (dummy != DUMMY_PID_VALUE) { thermalManager.bedKp = dummy; - EEPROM_READ_VAR(i, thermalManager.bedKi); - EEPROM_READ_VAR(i, thermalManager.bedKd); + EEPROM_READ(thermalManager.bedKi); + EEPROM_READ(thermalManager.bedKd); } #else - for (uint8_t q=3; q--;) EEPROM_READ_VAR(i, dummy); // bedKp, bedKi, bedKd + for (uint8_t q=3; q--;) EEPROM_READ(dummy); // bedKp, bedKi, bedKd #endif #if !HAS_LCD_CONTRAST int lcd_contrast; #endif - EEPROM_READ_VAR(i, lcd_contrast); + EEPROM_READ(lcd_contrast); #if ENABLED(SCARA) - EEPROM_READ_VAR(i, axis_scaling); // 3 floats + EEPROM_READ(axis_scaling); // 3 floats #else - EEPROM_READ_VAR(i, dummy); + EEPROM_READ(dummy); #endif #if ENABLED(FWRETRACT) - EEPROM_READ_VAR(i, autoretract_enabled); - EEPROM_READ_VAR(i, retract_length); + EEPROM_READ(autoretract_enabled); + EEPROM_READ(retract_length); #if EXTRUDERS > 1 - EEPROM_READ_VAR(i, retract_length_swap); + EEPROM_READ(retract_length_swap); #else - EEPROM_READ_VAR(i, dummy); + EEPROM_READ(dummy); #endif - EEPROM_READ_VAR(i, retract_feedrate_mm_s); - EEPROM_READ_VAR(i, retract_zlift); - EEPROM_READ_VAR(i, retract_recover_length); + EEPROM_READ(retract_feedrate_mm_s); + EEPROM_READ(retract_zlift); + EEPROM_READ(retract_recover_length); #if EXTRUDERS > 1 - EEPROM_READ_VAR(i, retract_recover_length_swap); + EEPROM_READ(retract_recover_length_swap); #else - EEPROM_READ_VAR(i, dummy); + EEPROM_READ(dummy); #endif - EEPROM_READ_VAR(i, retract_recover_feedrate_mm_s); + EEPROM_READ(retract_recover_feedrate_mm_s); #endif // FWRETRACT - EEPROM_READ_VAR(i, volumetric_enabled); + EEPROM_READ(volumetric_enabled); for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) { - EEPROM_READ_VAR(i, dummy); + EEPROM_READ(dummy); if (q < COUNT(filament_size)) filament_size[q] = dummy; } @@ -539,7 +547,7 @@ void Config_RetrieveSettings() { Config_Postprocess(); SERIAL_ECHO_START; SERIAL_ECHO(version); - SERIAL_ECHOPAIR(" stored settings retrieved (", i); + SERIAL_ECHOPAIR(" stored settings retrieved (", eeprom_index); SERIAL_ECHOLNPGM(" bytes)"); } else { From 2595a40a61f706d7842e5686bea3e021f7f461b7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 18:33:31 -0700 Subject: [PATCH 495/580] Account for coordinate space more in G28 / G29 / M48 --- Marlin/Marlin_main.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2400acb94..47e834a74 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3075,7 +3075,7 @@ inline void gcode_G28() { * NOTE: This doesn't necessarily ensure the Z probe is also * within the bed! */ - float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS]; + float cpx = RAW_CURRENT_POSITION(X_AXIS), cpy = RAW_CURRENT_POSITION(Y_AXIS); if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) @@ -3472,36 +3472,36 @@ inline void gcode_G28() { xy_probe_feedrate_mm_m = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED; - int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LEFT_PROBE_BED_POSITION, - right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : RIGHT_PROBE_BED_POSITION, - front_probe_bed_position = code_seen('F') ? (int)code_value_axis_units(Y_AXIS) : FRONT_PROBE_BED_POSITION, - back_probe_bed_position = code_seen('B') ? (int)code_value_axis_units(Y_AXIS) : BACK_PROBE_BED_POSITION; + int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LOGICAL_X_POSITION(LEFT_PROBE_BED_POSITION), + right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : LOGICAL_X_POSITION(RIGHT_PROBE_BED_POSITION), + front_probe_bed_position = code_seen('F') ? (int)code_value_axis_units(Y_AXIS) : LOGICAL_Y_POSITION(FRONT_PROBE_BED_POSITION), + back_probe_bed_position = code_seen('B') ? (int)code_value_axis_units(Y_AXIS) : LOGICAL_Y_POSITION(BACK_PROBE_BED_POSITION); - bool left_out_l = left_probe_bed_position < MIN_PROBE_X, + bool left_out_l = left_probe_bed_position < LOGICAL_X_POSITION(MIN_PROBE_X), left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - (MIN_PROBE_EDGE), - right_out_r = right_probe_bed_position > MAX_PROBE_X, + right_out_r = right_probe_bed_position > LOGICAL_X_POSITION(MAX_PROBE_X), right_out = right_out_r || right_probe_bed_position < left_probe_bed_position + MIN_PROBE_EDGE, - front_out_f = front_probe_bed_position < MIN_PROBE_Y, + front_out_f = front_probe_bed_position < LOGICAL_Y_POSITION(MIN_PROBE_Y), front_out = front_out_f || front_probe_bed_position > back_probe_bed_position - (MIN_PROBE_EDGE), - back_out_b = back_probe_bed_position > MAX_PROBE_Y, + back_out_b = back_probe_bed_position > LOGICAL_Y_POSITION(MAX_PROBE_Y), back_out = back_out_b || back_probe_bed_position < front_probe_bed_position + MIN_PROBE_EDGE; if (left_out || right_out || front_out || back_out) { if (left_out) { out_of_range_error(PSTR("(L)eft")); - left_probe_bed_position = left_out_l ? MIN_PROBE_X : right_probe_bed_position - (MIN_PROBE_EDGE); + left_probe_bed_position = left_out_l ? LOGICAL_X_POSITION(MIN_PROBE_X) : right_probe_bed_position - (MIN_PROBE_EDGE); } if (right_out) { out_of_range_error(PSTR("(R)ight")); - right_probe_bed_position = right_out_r ? MAX_PROBE_X : left_probe_bed_position + MIN_PROBE_EDGE; + right_probe_bed_position = right_out_r ? LOGICAL_Y_POSITION(MAX_PROBE_X) : left_probe_bed_position + MIN_PROBE_EDGE; } if (front_out) { out_of_range_error(PSTR("(F)ront")); - front_probe_bed_position = front_out_f ? MIN_PROBE_Y : back_probe_bed_position - (MIN_PROBE_EDGE); + front_probe_bed_position = front_out_f ? LOGICAL_Y_POSITION(MIN_PROBE_Y) : back_probe_bed_position - (MIN_PROBE_EDGE); } if (back_out) { out_of_range_error(PSTR("(B)ack")); - back_probe_bed_position = back_out_b ? MAX_PROBE_Y : front_probe_bed_position + MIN_PROBE_EDGE; + back_probe_bed_position = back_out_b ? LOGICAL_Y_POSITION(MAX_PROBE_Y) : front_probe_bed_position + MIN_PROBE_EDGE; } return; } @@ -4208,7 +4208,7 @@ inline void gcode_M42() { float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER; #if DISABLED(DELTA) - if (X_probe_location < MIN_PROBE_X || X_probe_location > MAX_PROBE_X) { + if (X_probe_location < LOGICAL_X_POSITION(MIN_PROBE_X) || X_probe_location > LOGICAL_X_POSITION(MAX_PROBE_X)) { out_of_range_error(PSTR("X")); return; } @@ -4216,12 +4216,12 @@ inline void gcode_M42() { float Y_probe_location = code_seen('Y') ? code_value_axis_units(Y_AXIS) : Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER; #if DISABLED(DELTA) - if (Y_probe_location < MIN_PROBE_Y || Y_probe_location > MAX_PROBE_Y) { + if (Y_probe_location < LOGICAL_Y_POSITION(MIN_PROBE_Y) || Y_probe_location > LOGICAL_Y_POSITION(MAX_PROBE_Y)) { out_of_range_error(PSTR("Y")); return; } #else - if (HYPOT(X_probe_location, Y_probe_location) > DELTA_PROBEABLE_RADIUS) { + if (HYPOT(RAW_X_POSITION(X_probe_location), RAW_Y_POSITION(Y_probe_location)) > DELTA_PROBEABLE_RADIUS) { SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius."); return; } From 750a1e5116acf57a314eb01a6936dec0f6ad45f7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Jul 2016 18:54:24 -0700 Subject: [PATCH 496/580] Arrange stepper_indirection by axis --- Marlin/stepper_indirection.cpp | 1 + Marlin/stepper_indirection.h | 702 +++++++++++++-------------------- 2 files changed, 267 insertions(+), 436 deletions(-) diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp index 0ede05614..d7d627a02 100644 --- a/Marlin/stepper_indirection.cpp +++ b/Marlin/stepper_indirection.cpp @@ -42,6 +42,7 @@ */ #include "stepper_indirection.h" + #include "Configuration.h" #if ENABLED(HAVE_TMCDRIVER) diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 4052e395f..632666368 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -44,144 +44,311 @@ #ifndef STEPPER_INDIRECTION_H #define STEPPER_INDIRECTION_H -#include "macros.h" +#include "Configuration.h" -// X motor +// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI +#if ENABLED(HAVE_TMCDRIVER) + #include + #include + void tmc_init(); +#endif + +// L6470 has STEP on normal pins, but DIR/ENABLE via SPI +#if ENABLED(HAVE_L6470DRIVER) + #include + #include + void L6470_init(); +#endif + +// X Stepper +#if ENABLED(HAVE_L6470DRIVER) && ENABLED(X_IS_L6470) + extern L6470 stepperX; + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) do{if(STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree();}while(0) + #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ) + #define X_DIR_INIT NOOP + #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE) + #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) +#else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(X_IS_TMC) + extern TMC26XStepper stepperX; + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) + #define X_ENABLE_READ stepperX.isEnabled() + #else + #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN) + #define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE) + #define X_ENABLE_READ READ(X_ENABLE_PIN) + #endif + #define X_DIR_INIT SET_OUTPUT(X_DIR_PIN) + #define X_DIR_WRITE(STATE) WRITE(X_DIR_PIN,STATE) + #define X_DIR_READ READ(X_DIR_PIN) +#endif #define X_STEP_INIT SET_OUTPUT(X_STEP_PIN) #define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE) #define X_STEP_READ READ(X_STEP_PIN) -#define X_DIR_INIT SET_OUTPUT(X_DIR_PIN) -#define X_DIR_WRITE(STATE) WRITE(X_DIR_PIN,STATE) -#define X_DIR_READ READ(X_DIR_PIN) +// Y Stepper +#if ENABLED(HAVE_L6470DRIVER) && ENABLED(Y_IS_L6470) + extern L6470 stepperY; + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) do{if(STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree();}while(0) + #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ) + #define Y_DIR_INIT NOOP + #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE) + #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) +#else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Y_IS_TMC) + extern TMC26XStepper stepperY; + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) + #define Y_ENABLE_READ stepperY.isEnabled() + #else + #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN) + #define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE) + #define Y_ENABLE_READ READ(Y_ENABLE_PIN) + #endif + #define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN) + #define Y_DIR_WRITE(STATE) WRITE(Y_DIR_PIN,STATE) + #define Y_DIR_READ READ(Y_DIR_PIN) +#endif +#define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN) +#define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE) +#define Y_STEP_READ READ(Y_STEP_PIN) -#define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN) -#define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE) -#define X_ENABLE_READ READ(X_ENABLE_PIN) +// Z Stepper +#if ENABLED(HAVE_L6470DRIVER) && ENABLED(Z_IS_L6470) + extern L6470 stepperZ; + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) do{if(STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree();}while(0) + #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ) + #define Z_DIR_INIT NOOP + #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE) + #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR) +#else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Z_IS_TMC) + extern TMC26XStepper stepperZ; + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) + #define Z_ENABLE_READ stepperZ.isEnabled() + #else + #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN) + #define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE) + #define Z_ENABLE_READ READ(Z_ENABLE_PIN) + #endif + #define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN) + #define Z_DIR_WRITE(STATE) WRITE(Z_DIR_PIN,STATE) + #define Z_DIR_READ READ(Z_DIR_PIN) +#endif +#define Z_STEP_INIT SET_OUTPUT(Z_STEP_PIN) +#define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE) +#define Z_STEP_READ READ(Z_STEP_PIN) -// X2 motor +// X2 Stepper #if HAS_X2_ENABLE + #if ENABLED(HAVE_L6470DRIVER) && ENABLED(X2_IS_L6470) + extern L6470 stepperX2; + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) do{if(STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree();}while(0) + #define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ) + #define X2_DIR_INIT NOOP + #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE) + #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) + #else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(X2_IS_TMC) + extern TMC26XStepper stepperX2; + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) + #define X2_ENABLE_READ stepperX2.isEnabled() + #else + #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) + #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE) + #define X2_ENABLE_READ READ(X2_ENABLE_PIN) + #endif + #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN) + #define X2_DIR_WRITE(STATE) WRITE(X2_DIR_PIN,STATE) + #define X2_DIR_READ READ(X2_DIR_PIN) + #endif #define X2_STEP_INIT SET_OUTPUT(X2_STEP_PIN) #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE) #define X2_STEP_READ READ(X2_STEP_PIN) - - #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN) - #define X2_DIR_WRITE(STATE) WRITE(X2_DIR_PIN,STATE) - #define X2_DIR_READ READ(X_DIR_PIN) - - #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) - #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE) - #define X2_ENABLE_READ READ(X_ENABLE_PIN) #endif -// Y motor -#define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN) -#define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE) -#define Y_STEP_READ READ(Y_STEP_PIN) - -#define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN) -#define Y_DIR_WRITE(STATE) WRITE(Y_DIR_PIN,STATE) -#define Y_DIR_READ READ(Y_DIR_PIN) - -#define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN) -#define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE) -#define Y_ENABLE_READ READ(Y_ENABLE_PIN) - -// Y2 motor +// Y2 Stepper #if HAS_Y2_ENABLE + #if ENABLED(HAVE_L6470DRIVER) && ENABLED(Y2_IS_L6470) + extern L6470 stepperY2; + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) do{if(STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree();}while(0) + #define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ) + #define Y2_DIR_INIT NOOP + #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE) + #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) + #else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Y2_IS_TMC) + extern TMC26XStepper stepperY2; + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) + #define Y2_ENABLE_READ stepperY2.isEnabled() + #else + #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN) + #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE) + #define Y2_ENABLE_READ READ(Y2_ENABLE_PIN) + #endif + #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN) + #define Y2_DIR_WRITE(STATE) WRITE(Y2_DIR_PIN,STATE) + #define Y2_DIR_READ READ(Y2_DIR_PIN) + #endif #define Y2_STEP_INIT SET_OUTPUT(Y2_STEP_PIN) #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE) #define Y2_STEP_READ READ(Y2_STEP_PIN) +#endif - #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN) - #define Y2_DIR_WRITE(STATE) WRITE(Y2_DIR_PIN,STATE) - #define Y2_DIR_READ READ(Y2_DIR_PIN) - - #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN) - #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE) - #define Y2_ENABLE_READ READ(Y2_ENABLE_PIN) -#endif // Y_DUAL_STEPPER_DRIVERS - -// Z motor -#define Z_STEP_INIT SET_OUTPUT(Z_STEP_PIN) -#define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE) -#define Z_STEP_READ READ(Z_STEP_PIN) - -#define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN) -#define Z_DIR_WRITE(STATE) WRITE(Z_DIR_PIN,STATE) -#define Z_DIR_READ READ(Z_DIR_PIN) - -#define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN) -#define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE) -#define Z_ENABLE_READ READ(Z_ENABLE_PIN) - -// Z2 motor +// Z2 Stepper #if HAS_Z2_ENABLE + #if ENABLED(HAVE_L6470DRIVER) && ENABLED(Z2_IS_L6470) + extern L6470 stepperZ2; + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) do{if(STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree();}while(0) + #define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ) + #define Z2_DIR_INIT NOOP + #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE) + #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) + #else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(Z2_IS_TMC) + extern TMC26XStepper stepperZ2; + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) + #define Z2_ENABLE_READ stepperZ2.isEnabled() + #else + #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN) + #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE) + #define Z2_ENABLE_READ READ(Z2_ENABLE_PIN) + #endif + #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN) + #define Z2_DIR_WRITE(STATE) WRITE(Z2_DIR_PIN,STATE) + #define Z2_DIR_READ READ(Z2_DIR_PIN) + #endif #define Z2_STEP_INIT SET_OUTPUT(Z2_STEP_PIN) #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE) #define Z2_STEP_READ READ(Z2_STEP_PIN) +#endif - #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN) - #define Z2_DIR_WRITE(STATE) WRITE(Z2_DIR_PIN,STATE) - #define Z2_DIR_READ READ(Z2_DIR_PIN) - - #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN) - #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE) - #define Z2_ENABLE_READ READ(Z2_ENABLE_PIN) -#endif // Z_DUAL_STEPPER_DRIVERS - -// E0 motor +// E0 Stepper +#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E0_IS_L6470) + extern L6470 stepperE0; + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) do{if(STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree();}while(0) + #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) + #define E0_DIR_INIT NOOP + #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE) + #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) +#else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E0_IS_TMC) + extern TMC26XStepper stepperE0; + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) + #define E0_ENABLE_READ stepperE0.isEnabled() + #else + #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) + #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE) + #define E0_ENABLE_READ READ(E0_ENABLE_PIN) + #endif + #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) + #define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE) + #define E0_DIR_READ READ(E0_DIR_PIN) +#endif #define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN) #define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) #define E0_STEP_READ READ(E0_STEP_PIN) -#define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) -#define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE) -#define E0_DIR_READ READ(E0_DIR_PIN) - -#define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) -#define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE) -#define E0_ENABLE_READ READ(E0_ENABLE_PIN) - -// E1 motor +// E1 Stepper +#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E1_IS_L6470) + extern L6470 stepperE1; + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) do{if(STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree();}while(0) + #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) + #define E1_DIR_INIT NOOP + #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE) + #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) +#else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E1_IS_TMC) + extern TMC26XStepper stepperE1; + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) + #define E1_ENABLE_READ stepperE1.isEnabled() + #else + #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) + #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE) + #define E1_ENABLE_READ READ(E1_ENABLE_PIN) + #endif + #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) + #define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE) + #define E1_DIR_READ READ(E1_DIR_PIN) +#endif #define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN) #define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) #define E1_STEP_READ READ(E1_STEP_PIN) -#define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) -#define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE) -#define E1_DIR_READ READ(E1_DIR_PIN) - -#define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) -#define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE) -#define E1_ENABLE_READ READ(E1_ENABLE_PIN) - -// E2 motor +// E2 Stepper +#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E2_IS_L6470) + extern L6470 stepperE2; + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) do{if(STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree();}while(0) + #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) + #define E2_DIR_INIT NOOP + #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE) + #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) +#else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E2_IS_TMC) + extern TMC26XStepper stepperE2; + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) + #define E2_ENABLE_READ stepperE2.isEnabled() + #else + #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) + #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE) + #define E2_ENABLE_READ READ(E2_ENABLE_PIN) + #endif + #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) + #define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE) + #define E2_DIR_READ READ(E2_DIR_PIN) +#endif #define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN) #define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) #define E2_STEP_READ READ(E2_STEP_PIN) -#define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) -#define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE) -#define E2_DIR_READ READ(E2_DIR_PIN) - -#define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) -#define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE) -#define E2_ENABLE_READ READ(E2_ENABLE_PIN) - -// E3 motor +// E3 Stepper +#if ENABLED(HAVE_L6470DRIVER) && ENABLED(E3_IS_L6470) + extern L6470 stepperE3; + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) do{if(STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree();}while(0) + #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) + #define E3_DIR_INIT NOOP + #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE) + #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) +#else + #if ENABLED(HAVE_TMCDRIVER) && ENABLED(E3_IS_TMC) + extern TMC26XStepper stepperE3; + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) + #define E3_ENABLE_READ stepperE3.isEnabled() + #else + #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) + #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) + #define E3_ENABLE_READ READ(E3_ENABLE_PIN) + #endif + #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) + #define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE) + #define E3_DIR_READ READ(E3_DIR_PIN) +#endif #define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN) #define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) #define E3_STEP_READ READ(E3_STEP_PIN) -#define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) -#define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE) -#define E3_DIR_READ READ(E3_DIR_PIN) - -#define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) -#define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) -#define E3_ENABLE_READ READ(E3_ENABLE_PIN) - +/** + * Extruder indirection for the single E axis + */ #if ENABLED(SWITCHING_EXTRUDER) #define E_STEP_WRITE(v) E0_STEP_WRITE(v) #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? INVERT_E0_DIR : !INVERT_E0_DIR) @@ -225,341 +392,4 @@ #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR) #endif -////////////////////////////////// -// Pin redefines for TMC drivers. -// TMC26X drivers have step and dir on normal pins, but everything else via SPI -////////////////////////////////// -#if ENABLED(HAVE_TMCDRIVER) - #include - #include - - void tmc_init(); - #if ENABLED(X_IS_TMC) - extern TMC26XStepper stepperX; - #undef X_ENABLE_INIT - #define X_ENABLE_INIT ((void)0) - - #undef X_ENABLE_WRITE - #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) - - #undef X_ENABLE_READ - #define X_ENABLE_READ stepperX.isEnabled() - - #endif - #if ENABLED(X2_IS_TMC) - extern TMC26XStepper stepperX2; - #undef X2_ENABLE_INIT - #define X2_ENABLE_INIT ((void)0) - - #undef X2_ENABLE_WRITE - #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) - - #undef X2_ENABLE_READ - #define X2_ENABLE_READ stepperX2.isEnabled() - #endif - #if ENABLED(Y_IS_TMC) - extern TMC26XStepper stepperY; - #undef Y_ENABLE_INIT - #define Y_ENABLE_INIT ((void)0) - - #undef Y_ENABLE_WRITE - #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) - - #undef Y_ENABLE_READ - #define Y_ENABLE_READ stepperY.isEnabled() - #endif - #if ENABLED(Y2_IS_TMC) - extern TMC26XStepper stepperY2; - #undef Y2_ENABLE_INIT - #define Y2_ENABLE_INIT ((void)0) - - #undef Y2_ENABLE_WRITE - #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) - - #undef Y2_ENABLE_READ - #define Y2_ENABLE_READ stepperY2.isEnabled() - #endif - #if ENABLED(Z_IS_TMC) - extern TMC26XStepper stepperZ; - #undef Z_ENABLE_INIT - #define Z_ENABLE_INIT ((void)0) - - #undef Z_ENABLE_WRITE - #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) - - #undef Z_ENABLE_READ - #define Z_ENABLE_READ stepperZ.isEnabled() - #endif - #if ENABLED(Z2_IS_TMC) - extern TMC26XStepper stepperZ2; - #undef Z2_ENABLE_INIT - #define Z2_ENABLE_INIT ((void)0) - - #undef Z2_ENABLE_WRITE - #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) - - #undef Z2_ENABLE_READ - #define Z2_ENABLE_READ stepperZ2.isEnabled() - #endif - #if ENABLED(E0_IS_TMC) - extern TMC26XStepper stepperE0; - #undef E0_ENABLE_INIT - #define E0_ENABLE_INIT ((void)0) - - #undef E0_ENABLE_WRITE - #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) - - #undef E0_ENABLE_READ - #define E0_ENABLE_READ stepperE0.isEnabled() - #endif - #if ENABLED(E1_IS_TMC) - extern TMC26XStepper stepperE1; - #undef E1_ENABLE_INIT - #define E1_ENABLE_INIT ((void)0) - - #undef E1_ENABLE_WRITE - #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) - - #undef E1_ENABLE_READ - #define E1_ENABLE_READ stepperE1.isEnabled() - #endif - #if ENABLED(E2_IS_TMC) - extern TMC26XStepper stepperE2; - #undef E2_ENABLE_INIT - #define E2_ENABLE_INIT ((void)0) - - #undef E2_ENABLE_WRITE - #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) - - #undef E2_ENABLE_READ - #define E2_ENABLE_READ stepperE2.isEnabled() - #endif - #if ENABLED(E3_IS_TMC) - extern TMC26XStepper stepperE3; - #undef E3_ENABLE_INIT - #define E3_ENABLE_INIT ((void)0) - - #undef E3_ENABLE_WRITE - #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) - - #undef E3_ENABLE_READ - #define E3_ENABLE_READ stepperE3.isEnabled() - #endif - -#endif // HAVE_TMCDRIVER - -////////////////////////////////// -// Pin redefines for L6470 drivers. -// L640 drivers have step on normal pins, but dir and everything else via SPI -////////////////////////////////// -#if ENABLED(HAVE_L6470DRIVER) - - #include - #include - - void L6470_init(); - #if ENABLED(X_IS_L6470) - extern L6470 stepperX; - #undef X_ENABLE_INIT - #define X_ENABLE_INIT ((void)0) - - #undef X_ENABLE_WRITE - #define X_ENABLE_WRITE(STATE) {if(STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree();} - - #undef X_ENABLE_READ - #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ) - - #undef X_DIR_INIT - #define X_DIR_INIT ((void)0) - - #undef X_DIR_WRITE - #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE) - - #undef X_DIR_READ - #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) - - #endif - #if ENABLED(X2_IS_L6470) - extern L6470 stepperX2; - #undef X2_ENABLE_INIT - #define X2_ENABLE_INIT ((void)0) - - #undef X2_ENABLE_WRITE - #define X2_ENABLE_WRITE(STATE) (if(STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree();) - - #undef X2_ENABLE_READ - #define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ) - - #undef X2_DIR_INIT - #define X2_DIR_INIT ((void)0) - - #undef X2_DIR_WRITE - #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE) - - #undef X2_DIR_READ - #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) - #endif - #if ENABLED(Y_IS_L6470) - extern L6470 stepperY; - #undef Y_ENABLE_INIT - #define Y_ENABLE_INIT ((void)0) - - #undef Y_ENABLE_WRITE - #define Y_ENABLE_WRITE(STATE) (if(STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree();) - - #undef Y_ENABLE_READ - #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ) - - #undef Y_DIR_INIT - #define Y_DIR_INIT ((void)0) - - #undef Y_DIR_WRITE - #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE) - - #undef Y_DIR_READ - #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) - #endif - #if ENABLED(Y2_IS_L6470) - extern L6470 stepperY2; - #undef Y2_ENABLE_INIT - #define Y2_ENABLE_INIT ((void)0) - - #undef Y2_ENABLE_WRITE - #define Y2_ENABLE_WRITE(STATE) (if(STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree();) - - #undef Y2_ENABLE_READ - #define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ) - - #undef Y2_DIR_INIT - #define Y2_DIR_INIT ((void)0) - - #undef Y2_DIR_WRITE - #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE) - - #undef Y2_DIR_READ - #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) - #endif - #if ENABLED(Z_IS_L6470) - extern L6470 stepperZ; - #undef Z_ENABLE_INIT - #define Z_ENABLE_INIT ((void)0) - - #undef Z_ENABLE_WRITE - #define Z_ENABLE_WRITE(STATE) (if(STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree();) - - #undef Z_ENABLE_READ - #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ) - - #undef Z_DIR_INIT - #define Z_DIR_INIT ((void)0) - - #undef Z_DIR_WRITE - #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE) - - #undef Y_DIR_READ - #define Y_DIR_READ (stepperZ.getStatus() & STATUS_DIR) - #endif - #if ENABLED(Z2_IS_L6470) - extern L6470 stepperZ2; - #undef Z2_ENABLE_INIT - #define Z2_ENABLE_INIT ((void)0) - - #undef Z2_ENABLE_WRITE - #define Z2_ENABLE_WRITE(STATE) (if(STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree();) - - #undef Z2_ENABLE_READ - #define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ) - - #undef Z2_DIR_INIT - #define Z2_DIR_INIT ((void)0) - - #undef Z2_DIR_WRITE - #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE) - - #undef Y2_DIR_READ - #define Y2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) - #endif - #if ENABLED(E0_IS_L6470) - extern L6470 stepperE0; - #undef E0_ENABLE_INIT - #define E0_ENABLE_INIT ((void)0) - - #undef E0_ENABLE_WRITE - #define E0_ENABLE_WRITE(STATE) (if(STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree();) - - #undef E0_ENABLE_READ - #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) - - #undef E0_DIR_INIT - #define E0_DIR_INIT ((void)0) - - #undef E0_DIR_WRITE - #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE) - - #undef E0_DIR_READ - #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) - #endif - #if ENABLED(E1_IS_L6470) - extern L6470 stepperE1; - #undef E1_ENABLE_INIT - #define E1_ENABLE_INIT ((void)0) - - #undef E1_ENABLE_WRITE - #define E1_ENABLE_WRITE(STATE) (if(STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree();) - - #undef E1_ENABLE_READ - #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) - - #undef E1_DIR_INIT - #define E1_DIR_INIT ((void)0) - - #undef E1_DIR_WRITE - #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE) - - #undef E1_DIR_READ - #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) - #endif - #if ENABLED(E2_IS_L6470) - extern L6470 stepperE2; - #undef E2_ENABLE_INIT - #define E2_ENABLE_INIT ((void)0) - - #undef E2_ENABLE_WRITE - #define E2_ENABLE_WRITE(STATE) (if(STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree();) - - #undef E2_ENABLE_READ - #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) - - #undef E2_DIR_INIT - #define E2_DIR_INIT ((void)0) - - #undef E2_DIR_WRITE - #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE) - - #undef E2_DIR_READ - #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) - #endif - #if ENABLED(E3_IS_L6470) - extern L6470 stepperE3; - #undef E3_ENABLE_INIT - #define E3_ENABLE_INIT ((void)0) - - #undef E3_ENABLE_WRITE - #define E3_ENABLE_WRITE(STATE) (if(STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree();) - - #undef E3_ENABLE_READ - #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) - - #undef E3_DIR_INIT - #define E3_DIR_INIT ((void)0) - - #undef E3_DIR_WRITE - #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE) - - #undef E3_DIR_READ - #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) - #endif - -#endif //HAVE_L6470DRIVER - #endif // STEPPER_INDIRECTION_H From 4f2ff46ab91974b564dd74d7315bae6c75fa9d67 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 00:10:46 -0700 Subject: [PATCH 497/580] Move HAS_DIGIPOTSS to conditionals --- Marlin/Conditionals.h | 1 + Marlin/pins.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index e5e072a22..76c1fe353 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -735,6 +735,7 @@ #define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) #define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) #define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) + #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) diff --git a/Marlin/pins.h b/Marlin/pins.h index cc18289bd..141c8355f 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -432,6 +432,4 @@ X_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \ } -#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) - #endif //__PINS_H From a60a668f6bff4fbaba2eec75463050819df25bb0 Mon Sep 17 00:00:00 2001 From: brupje Date: Tue, 21 Jun 2016 14:39:10 +0200 Subject: [PATCH 498/580] Support for REPRAPWORLD_GRAPHICAL_LCD --- Marlin/Conditionals.h | 7 +++++ Marlin/Configuration.h | 7 +++++ Marlin/pins_MEGATRONICS_3.h | 54 +++++++++++++++++++++++++++++-------- Marlin/pins_MINITRONICS.h | 21 +++++++++++++++ Marlin/pins_RAMPS_14.h | 18 ++++++++++++- Marlin/ultralcd_impl_DOGM.h | 4 ++- 6 files changed, 98 insertions(+), 13 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index e5e072a22..2cc8eac31 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -130,6 +130,13 @@ #define NEWPANEL #endif + + #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + #define DOGLCD + #define U8GLIB_ST7920 + #define ULTIPANEL + #endif + /** * I2C PANELS */ diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f810fcd0c..999e043d9 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1118,6 +1118,13 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h index 47ec17649..a77232f21 100644 --- a/Marlin/pins_MEGATRONICS_3.h +++ b/Marlin/pins_MEGATRONICS_3.h @@ -106,17 +106,49 @@ #define BEEPER_PIN 61 -#define LCD_PINS_RS 32 -#define LCD_PINS_ENABLE 31 -#define LCD_PINS_D4 14 -#define LCD_PINS_D5 30 -#define LCD_PINS_D6 39 -#define LCD_PINS_D7 15 - -#define SHIFT_CLK 43 -#define SHIFT_LD 35 -#define SHIFT_OUT 34 -#define SHIFT_EN 44 + + + +#if ENABLED(DOGLCD) + + #if ENABLED(U8GLIB_ST7920) + + #define LCD_PINS_RS 56 //CS chip select /SS chip slave select + #define LCD_PINS_ENABLE 51 //SID (MOSI) + #define LCD_PINS_D4 52 //SCK (CLK) clock + + #define BTN_EN1 44 + #define BTN_EN2 45 + #define BTN_ENC 33 + + + #define SD_DETECT_PIN 35 + #endif + +#else + #define LCD_PINS_RS 32 + #define LCD_PINS_ENABLE 31 + #define LCD_PINS_D4 14 + #define LCD_PINS_D5 30 + #define LCD_PINS_D6 39 + #define LCD_PINS_D7 15 + + #define SHIFT_CLK 43 + #define SHIFT_LD 35 + #define SHIFT_OUT 34 + #define SHIFT_EN 44 + //buttons are directly attached using keypad + #define BTN_EN1 44 + #define BTN_EN2 45 + #define BTN_ENC 33 //the click + + #define BLEN_C 2 + #define BLEN_B 1 + #define BLEN_A 0 + + #define SD_DETECT_PIN 56 // Megatronics v3.1 only +#endif + // Buttons are directly attached using keypad #define BTN_EN1 44 diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h index 0c80ceda4..734b39de4 100644 --- a/Marlin/pins_MINITRONICS.h +++ b/Marlin/pins_MINITRONICS.h @@ -76,6 +76,25 @@ #define BEEPER_PIN -1 + + +#if ENABLED(DOGLCD) + + #if ENABLED(U8GLIB_ST7920) + + #define LCD_PINS_RS 15 //CS chip select /SS chip slave select + #define LCD_PINS_ENABLE 11 //SID (MOSI) + #define LCD_PINS_D4 10 //SCK (CLK) clock + + #define BTN_EN1 18 + #define BTN_EN2 17 + #define BTN_ENC 25 + + + #define SD_DETECT_PIN 30 + #endif + +#else #define LCD_PINS_RS -1 #define LCD_PINS_ENABLE -1 #define LCD_PINS_D4 -1 @@ -92,3 +111,5 @@ #define BLEN_B 1 #define BLEN_A 0 +#define SD_DETECT_PIN -1 // Minitronics doesn't use this +#endif diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index c51a8d02a..3434e8c90 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -139,7 +139,23 @@ #define SLED_PIN -1 #endif -#if ENABLED(ULTRA_LCD) + + +#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + + #define LCD_PINS_RS 49 //CS chip select /SS chip slave select + #define LCD_PINS_ENABLE 51 //SID (MOSI) + #define LCD_PINS_D4 52 //SCK (CLK) clock + + #define BTN_EN1 64 + #define BTN_EN2 59 + #define BTN_ENC 63 + + + #define SD_DETECT_PIN 42 + +#elif ENABLED(ULTRA_LCD) #if ENABLED(NEWPANEL) && ENABLED(PANEL_ONE) #define LCD_PINS_RS 40 diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index f53f9269c..218f3217b 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -141,7 +141,9 @@ #define START_COL 0 // LCD selection -#if ENABLED(U8GLIB_ST7920) +#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_RS); +#elif ENABLED(U8GLIB_ST7920) //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); U8GLIB_ST7920_128X64_RRD u8g(0); #elif defined(CARTESIO_UI) From 0c0a63322b86a871a825a56ffa9b88616fc97fef Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 12:09:24 -0700 Subject: [PATCH 499/580] Patches to prepare REPRAPWORLD_GRAPHICAL_LCD --- Marlin/Conditionals.h | 8 +++-- Marlin/Configuration.h | 1 - Marlin/pins_MEGATRONICS_3.h | 36 ++++++----------------- Marlin/pins_MINITRONICS.h | 58 ++++++++++++++++++------------------- Marlin/pins_RAMPS_14.h | 29 +++++++------------ 5 files changed, 54 insertions(+), 78 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 2cc8eac31..3a9ace919 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -118,7 +118,11 @@ #define REPRAP_DISCOUNT_SMART_CONTROLLER #endif - #if ENABLED(ULTIMAKERCONTROLLER) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL) || ENABLED(RIGIDBOT_PANEL) || ENABLED(REPRAPWORLD_KEYPAD) + #if ENABLED(ULTIMAKERCONTROLLER) \ + || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ + || ENABLED(G3D_PANEL) \ + || ENABLED(RIGIDBOT_PANEL) \ + || ENABLED(REPRAPWORLD_KEYPAD) #define ULTIPANEL #define NEWPANEL #endif @@ -130,11 +134,11 @@ #define NEWPANEL #endif - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define DOGLCD #define U8GLIB_ST7920 #define ULTIPANEL + #define NEWPANEL #endif /** diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 999e043d9..1ab5eddb1 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1124,7 +1124,6 @@ // //#define REPRAPWORLD_GRAPHICAL_LCD - // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h index a77232f21..93599781b 100644 --- a/Marlin/pins_MEGATRONICS_3.h +++ b/Marlin/pins_MEGATRONICS_3.h @@ -106,26 +106,17 @@ #define BEEPER_PIN 61 - - - #if ENABLED(DOGLCD) - #if ENABLED(U8GLIB_ST7920) - - #define LCD_PINS_RS 56 //CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 //SID (MOSI) - #define LCD_PINS_D4 52 //SCK (CLK) clock - - #define BTN_EN1 44 - #define BTN_EN2 45 - #define BTN_ENC 33 - - - #define SD_DETECT_PIN 35 - #endif + #if ENABLED(U8GLIB_ST7920) + #define LCD_PINS_RS 56 //CS chip select /SS chip slave select + #define LCD_PINS_ENABLE 51 //SID (MOSI) + #define LCD_PINS_D4 52 //SCK (CLK) clock + #define SD_DETECT_PIN 35 + #endif #else + #define LCD_PINS_RS 32 #define LCD_PINS_ENABLE 31 #define LCD_PINS_D4 14 @@ -137,25 +128,16 @@ #define SHIFT_LD 35 #define SHIFT_OUT 34 #define SHIFT_EN 44 - //buttons are directly attached using keypad - #define BTN_EN1 44 - #define BTN_EN2 45 - #define BTN_ENC 33 //the click - - #define BLEN_C 2 - #define BLEN_B 1 - #define BLEN_A 0 #define SD_DETECT_PIN 56 // Megatronics v3.1 only -#endif +#endif // Buttons are directly attached using keypad #define BTN_EN1 44 #define BTN_EN2 45 -#define BTN_ENC 33 // the click +#define BTN_ENC 33 #define BLEN_C 2 #define BLEN_B 1 #define BLEN_A 0 - diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h index 734b39de4..db68c97ae 100644 --- a/Marlin/pins_MINITRONICS.h +++ b/Marlin/pins_MINITRONICS.h @@ -76,40 +76,38 @@ #define BEEPER_PIN -1 - - #if ENABLED(DOGLCD) - #if ENABLED(U8GLIB_ST7920) - - #define LCD_PINS_RS 15 //CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 11 //SID (MOSI) - #define LCD_PINS_D4 10 //SCK (CLK) clock + #if ENABLED(U8GLIB_ST7920) + #define LCD_PINS_RS 15 //CS chip select /SS chip slave select + #define LCD_PINS_ENABLE 11 //SID (MOSI) + #define LCD_PINS_D4 10 //SCK (CLK) clock - #define BTN_EN1 18 - #define BTN_EN2 17 - #define BTN_ENC 25 + #define BTN_EN1 18 + #define BTN_EN2 17 + #define BTN_ENC 25 - - #define SD_DETECT_PIN 30 - #endif + #define SD_DETECT_PIN 30 + #endif #else -#define LCD_PINS_RS -1 -#define LCD_PINS_ENABLE -1 -#define LCD_PINS_D4 -1 -#define LCD_PINS_D5 -1 -#define LCD_PINS_D6 -1 -#define LCD_PINS_D7 -1 - -// Buttons are directly attached using keypad -#define BTN_EN1 -1 -#define BTN_EN2 -1 -#define BTN_ENC -1 // the click - -#define BLEN_C 2 -#define BLEN_B 1 -#define BLEN_A 0 - -#define SD_DETECT_PIN -1 // Minitronics doesn't use this + + #define LCD_PINS_RS -1 + #define LCD_PINS_ENABLE -1 + #define LCD_PINS_D4 -1 + #define LCD_PINS_D5 -1 + #define LCD_PINS_D6 -1 + #define LCD_PINS_D7 -1 + + // Buttons are directly attached using keypad + #define BTN_EN1 -1 + #define BTN_EN2 -1 + #define BTN_ENC -1 + + #define BLEN_C 2 + #define BLEN_B 1 + #define BLEN_A 0 + + #define SD_DETECT_PIN -1 // Minitronics doesn't use this + #endif diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 3434e8c90..ef96f59a6 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -139,25 +139,13 @@ #define SLED_PIN -1 #endif +#if ENABLED(ULTRA_LCD) - -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - - #define LCD_PINS_RS 49 //CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 //SID (MOSI) - #define LCD_PINS_D4 52 //SCK (CLK) clock - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - - - #define SD_DETECT_PIN 42 - -#elif ENABLED(ULTRA_LCD) - - #if ENABLED(NEWPANEL) && ENABLED(PANEL_ONE) + #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + #define LCD_PINS_RS 49 //CS chip select /SS chip slave select + #define LCD_PINS_ENABLE 51 //SID (MOSI) + #define LCD_PINS_D4 52 //SCK (CLK) clock + #elif ENABLED(NEWPANEL) && ENABLED(PANEL_ONE) #define LCD_PINS_RS 40 #define LCD_PINS_ENABLE 42 #define LCD_PINS_D4 65 @@ -198,6 +186,11 @@ #define LCD_PIN_BL 39 #endif + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + #define BTN_EN1 64 + #define BTN_EN2 59 + #define BTN_ENC 63 + #define SD_DETECT_PIN 42 #elif ENABLED(LCD_I2C_PANELOLU2) #define BTN_EN1 47 // reverse if the encoder turns the wrong way. #define BTN_EN2 43 From fcc39e2b5f92fd7a0e90d61dd0ac030d31927aae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 12:54:55 -0700 Subject: [PATCH 500/580] Clean up Transfer Buffer Size comment --- Marlin/Configuration_adv.h | 11 +++++++---- .../Cartesio/Configuration_adv.h | 11 +++++++---- .../example_configurations/Felix/Configuration_adv.h | 11 +++++++---- .../Hephestos/Configuration_adv.h | 11 +++++++---- .../Hephestos_2/Configuration_adv.h | 11 +++++++---- .../example_configurations/K8200/Configuration_adv.h | 11 +++++++---- .../example_configurations/K8400/Configuration_adv.h | 11 +++++++---- .../RigidBot/Configuration_adv.h | 11 +++++++---- .../example_configurations/SCARA/Configuration_adv.h | 11 +++++++---- .../example_configurations/TAZ4/Configuration_adv.h | 11 +++++++---- .../example_configurations/WITBOX/Configuration_adv.h | 11 +++++++---- .../delta/biv2.5/Configuration_adv.h | 11 +++++++---- .../delta/generic/Configuration_adv.h | 11 +++++++---- .../delta/kossel_mini/Configuration_adv.h | 11 +++++++---- .../delta/kossel_pro/Configuration_adv.h | 11 +++++++---- .../delta/kossel_xl/Configuration_adv.h | 11 +++++++---- .../makibox/Configuration_adv.h | 11 +++++++---- .../tvrrug/Round2/Configuration_adv.h | 11 +++++++---- 18 files changed, 126 insertions(+), 72 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index c8d657739..fde6524e8 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 86a14793c..4229d5487 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index d4eed80f3..bc9b589fe 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 6dc51d6b1..bd6f99e8b 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 501541bd9..6d017cde3 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index a822c9bf5..45c8cfb80 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -565,10 +565,13 @@ const unsigned int dropsegments = 2; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 8b0fd6d38..4cb356520 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 26 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index c2fcf9268..686a9d5f1 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 8 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 42045d7b8..e6f63af5f 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 9a7dcf602..93c041860 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -567,10 +567,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 6dc51d6b1..bd6f99e8b 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 9dc856be7..91b4ac3f2 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -561,10 +561,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 66877a67e..5995579ee 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -561,10 +561,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 24cf11fab..a29745937 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -560,10 +560,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 6ee22d84a..534779c18 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -565,10 +565,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index bd5577078..38a0542b6 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -561,10 +561,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 9413d9b0c..0c5b2da02 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 752c24f69..28269ec26 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -559,10 +559,13 @@ const unsigned int dropsegments = 5; //everything with less than this number of #define MAX_CMD_SIZE 96 #define BUFSIZE 4 -// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte. -// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0 -// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed. -// Any other output does not need to be that speedy. +// Transfer Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0,2,4,8,16,32,64,128,256] #define TX_BUFFER_SIZE 0 // Enable an emergency-command parser to intercept certain commands as they From 5272147f7c2b89033b861f947729ff7266377d78 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 15:56:34 -0700 Subject: [PATCH 501/580] Followup #4402 fixing 3-point leveling --- Marlin/Marlin_main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 42f67e866..0c7dddd6a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3637,14 +3637,14 @@ inline void gcode_G28() { #endif // Probe at 3 arbitrary points - float z_at_pt_1 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_1_X, X_AXIS), - LOGICAL_Y_POSITION(ABL_PROBE_PT_1_Y, Y_AXIS), + float z_at_pt_1 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_1_X), + LOGICAL_Y_POSITION(ABL_PROBE_PT_1_Y), stow_probe_after_each, verbose_level), - z_at_pt_2 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_2_X, X_AXIS), - LOGICAL_Y_POSITION(ABL_PROBE_PT_2_Y, Y_AXIS), + z_at_pt_2 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_2_X), + LOGICAL_Y_POSITION(ABL_PROBE_PT_2_Y), stow_probe_after_each, verbose_level), - z_at_pt_3 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_3_X, X_AXIS), - LOGICAL_Y_POSITION(ABL_PROBE_PT_3_Y, Y_AXIS), + z_at_pt_3 = probe_pt( LOGICAL_X_POSITION(ABL_PROBE_PT_3_X), + LOGICAL_Y_POSITION(ABL_PROBE_PT_3_Y), stow_probe_after_each, verbose_level); if (!dryrun) set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3); From 93ea281061590ca5b222a44dab25e903ddb94401 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 18:07:15 -0700 Subject: [PATCH 502/580] Split up Conditionals.h into two files Rather than include twice, which is tricky but may confuse --- Marlin/Conditionals.h | 281 +----------------- Marlin/Conditionals_LCD.h | 270 +++++++++++++++++ Marlin/Configuration_adv.h | 2 +- .../Cartesio/Configuration_adv.h | 2 +- .../Felix/Configuration_adv.h | 2 +- .../Hephestos/Configuration_adv.h | 2 +- .../Hephestos_2/Configuration_adv.h | 2 +- .../K8200/Configuration_adv.h | 2 +- .../K8400/Configuration_adv.h | 2 +- .../RigidBot/Configuration_adv.h | 2 +- .../SCARA/Configuration_adv.h | 2 +- .../TAZ4/Configuration_adv.h | 2 +- .../WITBOX/Configuration_adv.h | 2 +- .../delta/biv2.5/Configuration_adv.h | 2 +- .../delta/generic/Configuration_adv.h | 2 +- .../delta/kossel_mini/Configuration_adv.h | 2 +- .../delta/kossel_pro/Configuration_adv.h | 2 +- .../delta/kossel_xl/Configuration_adv.h | 2 +- .../makibox/Configuration_adv.h | 2 +- .../tvrrug/Round2/Configuration_adv.h | 2 +- Marlin/macros.h | 3 + 21 files changed, 307 insertions(+), 283 deletions(-) create mode 100644 Marlin/Conditionals_LCD.h diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 9ab609ad5..e593d79c9 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -26,273 +26,16 @@ */ #ifndef CONDITIONALS_H - -/** -* Miscellaneous -*/ -#ifndef M_PI - #define M_PI 3.1415926536 -#endif - -/** - * This value is used by M109 when tying to calculate a ballpark safe margin - * to prevent wait-forever situation. - */ -#ifndef EXTRUDE_MINTEMP - #define EXTRUDE_MINTEMP 170 -#endif - -#ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first -#define CONFIGURATION_LCD - - #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)) - - #if ENABLED(CARTESIO_UI) - #define DOGLCD - #define ULTIPANEL - #define NEWPANEL - #define DEFAULT_LCD_CONTRAST 90 - #define LCD_CONTRAST_MIN 60 - #define LCD_CONTRAST_MAX 140 - #endif - - #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL) - #define DOGLCD - #define ULTIPANEL - #define NEWPANEL - #define DEFAULT_LCD_CONTRAST 17 - #endif - - #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define ULTRA_LCD //general LCD support, also 16x2 - #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) - #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. - - #if ENABLED(miniVIKI) - #define LCD_CONTRAST_MIN 75 - #define LCD_CONTRAST_MAX 115 - #define DEFAULT_LCD_CONTRAST 95 - #elif ENABLED(VIKI2) - #define DEFAULT_LCD_CONTRAST 40 - #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define LCD_CONTRAST_MIN 90 - #define LCD_CONTRAST_MAX 130 - #define DEFAULT_LCD_CONTRAST 110 - #define U8GLIB_LM6059_AF - #define SD_DETECT_INVERTED - #endif - - #define ENCODER_PULSES_PER_STEP 4 - #define ENCODER_STEPS_PER_MENU_ITEM 1 - #endif - - // Generic support for SSD1306 / SH1106 OLED based LCDs. - #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106) - #define ULTRA_LCD //general LCD support, also 16x2 - #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family) - #endif - - #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106) - #define ULTIMAKERCONTROLLER - #endif - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - - #ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP 4 - #endif - - #ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM 1 - #endif - - #ifndef LONG_FILENAME_HOST_SUPPORT - #define LONG_FILENAME_HOST_SUPPORT - #endif - #endif - - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define DOGLCD - #define U8GLIB_ST7920 - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #endif - - #if ENABLED(ULTIMAKERCONTROLLER) \ - || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ - || ENABLED(G3D_PANEL) \ - || ENABLED(RIGIDBOT_PANEL) \ - || ENABLED(REPRAPWORLD_KEYPAD) - #define ULTIPANEL - #define NEWPANEL - #endif - - #if ENABLED(RA_CONTROL_PANEL) - #define LCD_I2C_TYPE_PCA8574 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTIPANEL - #define NEWPANEL - #endif - - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define DOGLCD - #define U8GLIB_ST7920 - #define ULTIPANEL - #define NEWPANEL - #endif - - /** - * I2C PANELS - */ - - #if ENABLED(LCD_I2C_SAINSMART_YWROBOT) - // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home ) - // Make sure it is placed in the Arduino libraries directory. - #define LCD_I2C_TYPE_PCF8575 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTIPANEL - #define NEWPANEL - #endif - - // PANELOLU2 LCD with status LEDs, separate encoder and click inputs - #if ENABLED(LCD_I2C_PANELOLU2) - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD - - #ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP 4 - #endif - - #ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM 1 - #endif - - #define ULTIPANEL - #define NEWPANEL - #endif - - // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs - #if ENABLED(LCD_I2C_VIKI) - // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) - // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory. - // Note: The pause/stop/resume LCD button pin should be connected to the Arduino - // BTN_ENC pin (or set BTN_ENC to -1 if not used) - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) - #define ULTIPANEL - #define NEWPANEL - #endif - - // Shift register panels - // --------------------- - // 2 wire Non-latching LCD SR from: - // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection - - #if ENABLED(SAV_3DLCD) - #define SR_LCD_2W_NL // Non latching 2 wire shift register - #define ULTIPANEL - #define NEWPANEL - #endif - - #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display - #ifndef LCD_WIDTH - #define LCD_WIDTH 22 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 5 - #endif - #endif - - #if ENABLED(ULTIPANEL) - #define NEWPANEL //enable this if you have a click-encoder panel - #define ULTRA_LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 20 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 4 - #endif - #else //no panel but just LCD - #if ENABLED(ULTRA_LCD) - #ifndef LCD_WIDTH - #define LCD_WIDTH 16 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 2 - #endif - #endif - #endif - - #if ENABLED(DOGLCD) - /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */ - // \x00 intentionally skipped to avoid problems in strings - #define LCD_STR_REFRESH "\x01" - #define LCD_STR_FOLDER "\x02" - #define LCD_STR_ARROW_RIGHT "\x03" - #define LCD_STR_UPLEVEL "\x04" - #define LCD_STR_CLOCK "\x05" - #define LCD_STR_FEEDRATE "\x06" - #define LCD_STR_BEDTEMP "\x07" - #define LCD_STR_THERMOMETER "\x08" - #define LCD_STR_DEGREE "\x09" - - #define LCD_STR_SPECIAL_MAX '\x09' - // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. - // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. - #else - /* Custom characters defined in the first 8 characters of the LCD */ - #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string! - #define LCD_STR_DEGREE "\x01" - #define LCD_STR_THERMOMETER "\x02" - #define LCD_STR_UPLEVEL "\x03" - #define LCD_STR_REFRESH "\x04" - #define LCD_STR_FOLDER "\x05" - #define LCD_STR_FEEDRATE "\x06" - #define LCD_STR_CLOCK "\x07" - #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ - #endif - - /** - * Default LCD contrast for dogm-like LCD displays - */ - #if ENABLED(DOGLCD) - - #define HAS_LCD_CONTRAST ( \ - ENABLED(MAKRPANEL) \ - || ENABLED(CARTESIO_UI) \ - || ENABLED(VIKI2) \ - || ENABLED(miniVIKI) \ - || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - ) - - #if HAS_LCD_CONTRAST - #ifndef LCD_CONTRAST_MIN - #define LCD_CONTRAST_MIN 0 - #endif - #ifndef LCD_CONTRAST_MAX - #define LCD_CONTRAST_MAX 63 - #endif - #ifndef DEFAULT_LCD_CONTRAST - #define DEFAULT_LCD_CONTRAST 32 - #endif - #endif - #endif - - #ifndef BOOTSCREEN_TIMEOUT - #define BOOTSCREEN_TIMEOUT 2500 - #endif - -#else // CONFIGURATION_LCD - - #define CONDITIONALS_H +#define CONDITIONALS_H #include "pins.h" #ifndef USBCON #define HardwareSerial_h // trick to disable the standard HWserial #endif + #include "Arduino.h" + + #include "macros.h" #if ENABLED(EMERGENCY_PARSER) #define EMERGENCY_PARSER_CAPABILITIES " EMERGENCY_CODES:M108,M112,M410" @@ -300,8 +43,6 @@ #define EMERGENCY_PARSER_CAPABILITIES "" #endif - #include "Arduino.h" - /** * Set ENDSTOPPULLUPS for unused endstop switches */ @@ -747,6 +488,7 @@ #define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) #define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) + #define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER)) #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) @@ -754,6 +496,14 @@ #define HAS_THERMALLY_PROTECTED_BED (HAS_TEMP_BED && HAS_HEATER_BED && ENABLED(THERMAL_PROTECTION_BED)) + /** + * This value is used by M109 when trying to calculate a ballpark safe margin + * to prevent wait-forever situation. + */ + #ifndef EXTRUDE_MINTEMP + #define EXTRUDE_MINTEMP 170 + #endif + /** * Helper Macros for heaters and extruder fan */ @@ -801,7 +551,9 @@ #endif #define WRITE_FAN_N(n, v) WRITE_FAN##n(v) - #define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER)) + /** + * Servos and probes + */ #if HAS_SERVOS #ifndef Z_ENDSTOP_SERVO_NR @@ -923,5 +675,4 @@ #define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING #endif -#endif //CONFIGURATION_LCD #endif //CONDITIONALS_H diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h new file mode 100644 index 000000000..60ed5ce6e --- /dev/null +++ b/Marlin/Conditionals_LCD.h @@ -0,0 +1,270 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Conditionals_LCD.h + * LCD Defines that depend on configuration but are not editable. + */ + +#ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first +#define CONDITIONALS_LCD_H + + #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)) + + #if ENABLED(CARTESIO_UI) + #define DOGLCD + #define ULTIPANEL + #define NEWPANEL + #define DEFAULT_LCD_CONTRAST 90 + #define LCD_CONTRAST_MIN 60 + #define LCD_CONTRAST_MAX 140 + #endif + + #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL) + #define DOGLCD + #define ULTIPANEL + #define NEWPANEL + #define DEFAULT_LCD_CONTRAST 17 + #endif + + #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) + #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + + #if ENABLED(miniVIKI) + #define LCD_CONTRAST_MIN 75 + #define LCD_CONTRAST_MAX 115 + #define DEFAULT_LCD_CONTRAST 95 + #elif ENABLED(VIKI2) + #define DEFAULT_LCD_CONTRAST 40 + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + #define LCD_CONTRAST_MIN 90 + #define LCD_CONTRAST_MAX 130 + #define DEFAULT_LCD_CONTRAST 110 + #define U8GLIB_LM6059_AF + #define SD_DETECT_INVERTED + #endif + + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 + #endif + + // Generic support for SSD1306 / SH1106 OLED based LCDs. + #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106) + #define ULTRA_LCD //general LCD support, also 16x2 + #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family) + #endif + + #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106) + #define ULTIMAKERCONTROLLER + #endif + + #if ENABLED(BQ_LCD_SMART_CONTROLLER) + #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + + #ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP 4 + #endif + + #ifndef ENCODER_STEPS_PER_MENU_ITEM + #define ENCODER_STEPS_PER_MENU_ITEM 1 + #endif + + #ifndef LONG_FILENAME_HOST_SUPPORT + #define LONG_FILENAME_HOST_SUPPORT + #endif + #endif + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define DOGLCD + #define U8GLIB_ST7920 + #define REPRAP_DISCOUNT_SMART_CONTROLLER + #endif + + #if ENABLED(ULTIMAKERCONTROLLER) \ + || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \ + || ENABLED(G3D_PANEL) \ + || ENABLED(RIGIDBOT_PANEL) \ + || ENABLED(REPRAPWORLD_KEYPAD) + #define ULTIPANEL + #define NEWPANEL + #endif + + #if ENABLED(RA_CONTROL_PANEL) + #define LCD_I2C_TYPE_PCA8574 + #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander + #define ULTIPANEL + #define NEWPANEL + #endif + + #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + #define DOGLCD + #define U8GLIB_ST7920 + #define ULTIPANEL + #define NEWPANEL + #endif + + /** + * I2C PANELS + */ + + #if ENABLED(LCD_I2C_SAINSMART_YWROBOT) + // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home ) + // Make sure it is placed in the Arduino libraries directory. + #define LCD_I2C_TYPE_PCF8575 + #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander + #define ULTIPANEL + #define NEWPANEL + #endif + + // PANELOLU2 LCD with status LEDs, separate encoder and click inputs + #if ENABLED(LCD_I2C_PANELOLU2) + #define LCD_I2C_TYPE_MCP23017 + #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander + #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD + + #ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP 4 + #endif + + #ifndef ENCODER_STEPS_PER_MENU_ITEM + #define ENCODER_STEPS_PER_MENU_ITEM 1 + #endif + + #define ULTIPANEL + #define NEWPANEL + #endif + + // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs + #if ENABLED(LCD_I2C_VIKI) + // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) + // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory. + // Note: The pause/stop/resume LCD button pin should be connected to the Arduino + // BTN_ENC pin (or set BTN_ENC to -1 if not used) + #define LCD_I2C_TYPE_MCP23017 + #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander + #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) + #define ULTIPANEL + #define NEWPANEL + #endif + + // Shift register panels + // --------------------- + // 2 wire Non-latching LCD SR from: + // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection + + #if ENABLED(SAV_3DLCD) + #define SR_LCD_2W_NL // Non latching 2 wire shift register + #define ULTIPANEL + #define NEWPANEL + #endif + + #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display + #ifndef LCD_WIDTH + #define LCD_WIDTH 22 + #endif + #ifndef LCD_HEIGHT + #define LCD_HEIGHT 5 + #endif + #endif + + #if ENABLED(ULTIPANEL) + #define NEWPANEL //enable this if you have a click-encoder panel + #define ULTRA_LCD + #ifndef LCD_WIDTH + #define LCD_WIDTH 20 + #endif + #ifndef LCD_HEIGHT + #define LCD_HEIGHT 4 + #endif + #else //no panel but just LCD + #if ENABLED(ULTRA_LCD) + #ifndef LCD_WIDTH + #define LCD_WIDTH 16 + #endif + #ifndef LCD_HEIGHT + #define LCD_HEIGHT 2 + #endif + #endif + #endif + + #if ENABLED(DOGLCD) + /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */ + // \x00 intentionally skipped to avoid problems in strings + #define LCD_STR_REFRESH "\x01" + #define LCD_STR_FOLDER "\x02" + #define LCD_STR_ARROW_RIGHT "\x03" + #define LCD_STR_UPLEVEL "\x04" + #define LCD_STR_CLOCK "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_BEDTEMP "\x07" + #define LCD_STR_THERMOMETER "\x08" + #define LCD_STR_DEGREE "\x09" + + #define LCD_STR_SPECIAL_MAX '\x09' + // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. + // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. + #else + /* Custom characters defined in the first 8 characters of the LCD */ + #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string! + #define LCD_STR_DEGREE "\x01" + #define LCD_STR_THERMOMETER "\x02" + #define LCD_STR_UPLEVEL "\x03" + #define LCD_STR_REFRESH "\x04" + #define LCD_STR_FOLDER "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_CLOCK "\x07" + #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ + #endif + + /** + * Default LCD contrast for dogm-like LCD displays + */ + #if ENABLED(DOGLCD) + + #define HAS_LCD_CONTRAST ( \ + ENABLED(MAKRPANEL) \ + || ENABLED(CARTESIO_UI) \ + || ENABLED(VIKI2) \ + || ENABLED(miniVIKI) \ + || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ + ) + + #if HAS_LCD_CONTRAST + #ifndef LCD_CONTRAST_MIN + #define LCD_CONTRAST_MIN 0 + #endif + #ifndef LCD_CONTRAST_MAX + #define LCD_CONTRAST_MAX 63 + #endif + #ifndef DEFAULT_LCD_CONTRAST + #define DEFAULT_LCD_CONTRAST 32 + #endif + #endif + #endif + + #ifndef BOOTSCREEN_TIMEOUT + #define BOOTSCREEN_TIMEOUT 2500 + #endif + +#endif //CONDITIONALS_LCD_H diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fde6524e8..3f8bddb6c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 4229d5487..8cf533f93 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index bc9b589fe..4089b4749 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index bd6f99e8b..067f7d5a3 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 6d017cde3..9f71aa3d0 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 45c8cfb80..bf8b220f8 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -52,7 +52,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 4cb356520..c3e10cd13 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 686a9d5f1..8b4a6efbe 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index e6f63af5f..d25cdbe5e 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 93c041860..33be9e9a4 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index bd6f99e8b..067f7d5a3 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 91b4ac3f2..b4277bff3 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 5995579ee..129a454ed 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index a29745937..06064bf99 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 534779c18..6ea5339ac 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -51,7 +51,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 38a0542b6..dff1353dd 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 0c5b2da02..de923d9a4 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 28269ec26..0fac6a839 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -46,7 +46,7 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals.h" +#include "Conditionals_LCD.h" // @section temperature diff --git a/Marlin/macros.h b/Marlin/macros.h index bf2d07180..f8c4735eb 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -34,6 +34,9 @@ #define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b)) // Macros for maths shortcuts +#ifndef M_PI + #define M_PI 3.14159265358979323846 +#endif #define RADIANS(d) ((d)*M_PI/180.0) #define DEGREES(r) ((r)*180.0/M_PI) #define HYPOT(x,y) sqrt(sq(x)+sq(y)) From df27d01cd9d0e33a7f0f94c1c6cee8db930c5fcf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 20:53:36 -0700 Subject: [PATCH 503/580] Arrange needed includes in Marlin.h --- Marlin/Marlin.h | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 53a66edfb..fec377644 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -41,26 +41,28 @@ #include "fastio.h" #include "Configuration.h" -#include "pins.h" - -#include "utility.h" #ifndef SANITYCHECK_H #error "Your Configuration.h and Configuration_adv.h files are outdated!" #endif -#include "Arduino.h" - #include "enum.h" +#include "utility.h" typedef unsigned long millis_t; #ifdef USBCON #include "HardwareSerial.h" + #if ENABLED(BLUETOOTH) + #define MYSERIAL bluetoothSerial + #else + #define MYSERIAL Serial + #endif // BLUETOOTH +#else + #include "MarlinSerial.h" + #define MYSERIAL customizedSerial #endif -#include "MarlinSerial.h" - #include "WString.h" #if ENABLED(PRINTCOUNTER) @@ -69,16 +71,6 @@ typedef unsigned long millis_t; #include "stopwatch.h" #endif -#ifdef USBCON - #if ENABLED(BLUETOOTH) - #define MYSERIAL bluetoothSerial - #else - #define MYSERIAL Serial - #endif // BLUETOOTH -#else - #define MYSERIAL customizedSerial -#endif - #define SERIAL_CHAR(x) MYSERIAL.write(x) #define SERIAL_EOL SERIAL_CHAR('\n') From 2d378fac1bfad5ad1915256df7e2dec112bba12f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 22:43:50 -0700 Subject: [PATCH 504/580] No need to include thermistortables.h in Configuration.h --- Marlin/Configuration.h | 1 - Marlin/example_configurations/Cartesio/Configuration.h | 1 - Marlin/example_configurations/Felix/Configuration.h | 1 - Marlin/example_configurations/Felix/DUAL/Configuration.h | 1 - Marlin/example_configurations/Hephestos/Configuration.h | 1 - Marlin/example_configurations/Hephestos_2/Configuration.h | 1 - Marlin/example_configurations/K8200/Configuration.h | 1 - Marlin/example_configurations/K8400/Configuration.h | 1 - Marlin/example_configurations/K8400/Dual-head/Configuration.h | 1 - .../RepRapWorld/Megatronics/Configuration.h | 1 - Marlin/example_configurations/RigidBot/Configuration.h | 1 - Marlin/example_configurations/SCARA/Configuration.h | 1 - Marlin/example_configurations/TAZ4/Configuration.h | 1 - Marlin/example_configurations/WITBOX/Configuration.h | 1 - Marlin/example_configurations/adafruit/ST7565/Configuration.h | 1 - Marlin/example_configurations/delta/biv2.5/Configuration.h | 1 - Marlin/example_configurations/delta/generic/Configuration.h | 1 - Marlin/example_configurations/delta/kossel_mini/Configuration.h | 1 - Marlin/example_configurations/delta/kossel_pro/Configuration.h | 1 - Marlin/example_configurations/delta/kossel_xl/Configuration.h | 1 - Marlin/example_configurations/makibox/Configuration.h | 1 - Marlin/example_configurations/tvrrug/Round2/Configuration.h | 1 - Marlin/temperature.cpp | 1 + Marlin/temperature.h | 1 + 24 files changed, 2 insertions(+), 22 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 1ab5eddb1..8c3677f7e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1344,6 +1344,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index feaaefa17..dc77b4074 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -1338,6 +1338,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 0fc856308..a870c5d5e 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1321,6 +1321,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 602a1b55e..1c057f46d 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -1319,6 +1319,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index f6a2f1def..542357bc3 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1330,6 +1330,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 73878728d..d15133b2b 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1332,6 +1332,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 61d704467..85e4833d5 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1355,6 +1355,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index b86d146f0..b6009f9d0 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -1338,6 +1338,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index a1d4d7d61..5f23ca5fe 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -1338,6 +1338,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index d09a46314..04ef83f2a 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -1338,6 +1338,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 57f0f455e..2854c7db6 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -1338,6 +1338,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 6c3e2de8f..6f67df532 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1346,6 +1346,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 6cac78e91..6e598b902 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -1359,6 +1359,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 8f15e51e6..3f41cdb48 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1330,6 +1330,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 0ec16f57b..bccd131e2 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -1338,6 +1338,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 67c55aaad..79176f729 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1430,6 +1430,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index e25730952..5a6811ff8 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1424,6 +1424,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index fa7aabddc..b99db5651 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1427,6 +1427,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 13898efc0..6de65a273 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1427,6 +1427,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index f7a5d8474..6edd5da92 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1430,6 +1430,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 6c91f2888..e68e10e71 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1341,6 +1341,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index a7e3f04f8..f77512a0f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1332,6 +1332,5 @@ #endif #include "Configuration_adv.h" -#include "thermistortables.h" #endif //CONFIGURATION_H diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 666edd90f..172014e7f 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -27,6 +27,7 @@ #include "Marlin.h" #include "ultralcd.h" #include "temperature.h" +#include "thermistortables.h" #include "language.h" #include "Sd2PinMap.h" diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 8fab0db3d..47d6af273 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -29,6 +29,7 @@ #include "Marlin.h" #include "planner.h" +#include "thermistortables.h" #if ENABLED(PID_ADD_EXTRUSION_RATE) #include "stepper.h" From c6226bb0aa578ead548863b3d0af75276a81efe6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 23:04:19 -0700 Subject: [PATCH 505/580] Unify config in a single include without nested includes --- Marlin/Configuration.h | 4 +-- Marlin/Configuration_adv.h | 7 +--- Marlin/Marlin.h | 3 +- Marlin/Marlin.ino | 3 +- Marlin/MarlinConfig.h | 32 +++++++++++++++++++ Marlin/configuration_store.h | 2 +- Marlin/dac_mcp4728.h | 3 +- Marlin/digipot_mcp4451.cpp | 2 +- .../Cartesio/Configuration.h | 4 +-- .../Cartesio/Configuration_adv.h | 7 +--- .../Felix/Configuration.h | 4 +-- .../Felix/Configuration_adv.h | 7 +--- .../Felix/DUAL/Configuration.h | 4 +-- .../Hephestos/Configuration.h | 4 +-- .../Hephestos/Configuration_adv.h | 7 +--- .../Hephestos_2/Configuration.h | 4 +-- .../Hephestos_2/Configuration_adv.h | 7 +--- .../K8200/Configuration.h | 4 +-- .../K8200/Configuration_adv.h | 7 +--- .../K8400/Configuration.h | 4 +-- .../K8400/Configuration_adv.h | 7 +--- .../K8400/Dual-head/Configuration.h | 4 +-- .../RepRapWorld/Megatronics/Configuration.h | 4 +-- .../RigidBot/Configuration.h | 4 +-- .../RigidBot/Configuration_adv.h | 7 +--- .../SCARA/Configuration.h | 4 +-- .../SCARA/Configuration_adv.h | 7 +--- .../TAZ4/Configuration.h | 4 +-- .../TAZ4/Configuration_adv.h | 7 +--- .../WITBOX/Configuration.h | 4 +-- .../WITBOX/Configuration_adv.h | 7 +--- .../adafruit/ST7565/Configuration.h | 4 +-- .../delta/biv2.5/Configuration.h | 4 +-- .../delta/biv2.5/Configuration_adv.h | 7 +--- .../delta/generic/Configuration.h | 4 +-- .../delta/generic/Configuration_adv.h | 7 +--- .../delta/kossel_mini/Configuration.h | 4 +-- .../delta/kossel_mini/Configuration_adv.h | 7 +--- .../delta/kossel_pro/Configuration.h | 4 +-- .../delta/kossel_pro/Configuration_adv.h | 7 +--- .../delta/kossel_xl/Configuration.h | 4 +-- .../delta/kossel_xl/Configuration_adv.h | 7 +--- .../makibox/Configuration.h | 4 +-- .../makibox/Configuration_adv.h | 7 +--- .../tvrrug/Round2/Configuration.h | 4 +-- .../tvrrug/Round2/Configuration_adv.h | 7 +--- Marlin/language.h | 2 +- Marlin/qr_solve.h | 2 +- Marlin/servo.cpp | 2 +- Marlin/stepper_indirection.cpp | 2 +- Marlin/stepper_indirection.h | 2 +- Marlin/ultralcd_impl_DOGM.h | 9 +++--- 52 files changed, 87 insertions(+), 191 deletions(-) create mode 100644 Marlin/MarlinConfig.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8c3677f7e..2f36343d3 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1343,6 +1343,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 3f8bddb6c..410ee36ec 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index fec377644..c780ff51b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -39,8 +39,9 @@ #include #include +#include "MarlinConfig.h" + #include "fastio.h" -#include "Configuration.h" #ifndef SANITYCHECK_H #error "Your Configuration.h and Configuration_adv.h files are outdated!" diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino index 1869d33b5..70fd8adfc 100644 --- a/Marlin/Marlin.ino +++ b/Marlin/Marlin.ino @@ -34,8 +34,7 @@ /* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */ /* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */ -#include "Configuration.h" -#include "pins.h" +#include "MarlinConfig.h" #if ENABLED(ULTRA_LCD) #if ENABLED(LCD_I2C_TYPE_PCF8575) diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h new file mode 100644 index 000000000..16099895a --- /dev/null +++ b/Marlin/MarlinConfig.h @@ -0,0 +1,32 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef MARLIN_CONFIG_H +#define MARLIN_CONFIG_H + +#include "Configuration.h" +#include "Conditionals_LCD.h" +#include "Configuration_adv.h" +#include "Conditionals.h" +#include "SanityCheck.h" + +#endif // MARLIN_CONFIG_H diff --git a/Marlin/configuration_store.h b/Marlin/configuration_store.h index 2b2680607..891f19fb9 100644 --- a/Marlin/configuration_store.h +++ b/Marlin/configuration_store.h @@ -23,7 +23,7 @@ #ifndef CONFIGURATION_STORE_H #define CONFIGURATION_STORE_H -#include "Configuration.h" +#include "MarlinConfig.h" void Config_ResetDefault(); diff --git a/Marlin/dac_mcp4728.h b/Marlin/dac_mcp4728.h index 26c54840f..c096c856a 100644 --- a/Marlin/dac_mcp4728.h +++ b/Marlin/dac_mcp4728.h @@ -27,8 +27,7 @@ #ifndef mcp4728_h #define mcp4728_h -#include "Configuration.h" -#include "Configuration_adv.h" +#include "MarlinConfig.h" #if ENABLED(DAC_STEPPER_CURRENT) #include "Wire.h" diff --git a/Marlin/digipot_mcp4451.cpp b/Marlin/digipot_mcp4451.cpp index 771581341..c6a01915f 100644 --- a/Marlin/digipot_mcp4451.cpp +++ b/Marlin/digipot_mcp4451.cpp @@ -20,7 +20,7 @@ * */ -#include "Configuration.h" +#include "MarlinConfig.h" #if ENABLED(DIGIPOT_I2C) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index dc77b4074..15642584c 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -1337,6 +1337,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 8cf533f93..1c75864f2 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index a870c5d5e..4d9cde622 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1320,6 +1320,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 4089b4749..84df93468 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 1c057f46d..fcfb763fa 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -1318,6 +1318,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 542357bc3..6eb81a80b 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1329,6 +1329,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 067f7d5a3..76fdb6b6f 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index d15133b2b..2ffefc758 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1331,6 +1331,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 9f71aa3d0..e5fbb0071 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 85e4833d5..585362360 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1354,6 +1354,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index bf8b220f8..8a30f6bfb 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -52,8 +52,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -804,7 +802,4 @@ const unsigned int dropsegments = 2; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index b6009f9d0..4907abb68 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -1337,6 +1337,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index c3e10cd13..f2b93daca 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 5f23ca5fe..083fa6214 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -1337,6 +1337,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 04ef83f2a..02153ad77 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -1337,6 +1337,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 2854c7db6..591b126fe 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -1337,6 +1337,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 8b4a6efbe..f8d8223a4 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 6f67df532..bfeb8653f 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1345,6 +1345,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index d25cdbe5e..a142085ee 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 6e598b902..ce7dc41be 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -1358,6 +1358,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 33be9e9a4..e3546f0fd 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -806,7 +804,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 3f41cdb48..368bcaaee 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1329,6 +1329,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 067f7d5a3..76fdb6b6f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index bccd131e2..7d52dd5a4 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -1337,6 +1337,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 79176f729..4b8821186 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1429,6 +1429,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index b4277bff3..d79183abf 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -800,7 +798,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 5a6811ff8..e562f29c1 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1423,6 +1423,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 129a454ed..bf4fe7126 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -800,7 +798,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index b99db5651..47875cb45 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1426,6 +1426,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 06064bf99..33f5d35ff 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -799,7 +797,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 6de65a273..484a64d5c 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1426,6 +1426,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 6ea5339ac..d54a8ac3b 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -51,8 +51,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -804,7 +802,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 6edd5da92..ba6dc6926 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1429,6 +1429,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index dff1353dd..0b1d20635 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -800,7 +798,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index e68e10e71..09d105bf4 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1340,6 +1340,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index de923d9a4..e21cbf3c5 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index f77512a0f..94781fedc 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1331,6 +1331,4 @@ //#define FILAMENT_LCD_DISPLAY #endif -#include "Configuration_adv.h" - -#endif //CONFIGURATION_H +#endif // CONFIGURATION_H diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 0fac6a839..83bc8899f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -46,8 +46,6 @@ */ #define CONFIGURATION_ADV_H_VERSION 010100 -#include "Conditionals_LCD.h" - // @section temperature //=========================================================================== @@ -798,7 +796,4 @@ const unsigned int dropsegments = 5; //everything with less than this number of //#define EXPERIMENTAL_I2CBUS -#include "Conditionals.h" -#include "SanityCheck.h" - -#endif //CONFIGURATION_ADV_H +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/language.h b/Marlin/language.h index 4e53c4890..82507d33b 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -23,7 +23,7 @@ #ifndef LANGUAGE_H #define LANGUAGE_H -#include "Configuration.h" +#include "MarlinConfig.h" // Fallback if no language is set. DON'T CHANGE #ifndef LCD_LANGUAGE diff --git a/Marlin/qr_solve.h b/Marlin/qr_solve.h index b985d622f..3ea30e9e7 100644 --- a/Marlin/qr_solve.h +++ b/Marlin/qr_solve.h @@ -20,7 +20,7 @@ * */ -#include "Configuration.h" +#include "MarlinConfig.h" #if ENABLED(AUTO_BED_LEVELING_GRID) diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp index c9708b8d8..b5f9ed86d 100644 --- a/Marlin/servo.cpp +++ b/Marlin/servo.cpp @@ -50,7 +50,7 @@ * detach() - Stop an attached servo from pulsing its i/o pin. * */ -#include "Configuration.h" +#include "MarlinConfig.h" #if HAS_SERVOS diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp index d7d627a02..101249e3c 100644 --- a/Marlin/stepper_indirection.cpp +++ b/Marlin/stepper_indirection.cpp @@ -43,7 +43,7 @@ #include "stepper_indirection.h" -#include "Configuration.h" +#include "MarlinConfig.h" #if ENABLED(HAVE_TMCDRIVER) #include diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 632666368..6fd19dd4d 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -44,7 +44,7 @@ #ifndef STEPPER_INDIRECTION_H #define STEPPER_INDIRECTION_H -#include "Configuration.h" +#include "MarlinConfig.h" // TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI #if ENABLED(HAVE_TMCDRIVER) diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 218f3217b..2d0faa0f5 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -36,6 +36,8 @@ #ifndef ULTRALCD_IMPL_DOGM_H #define ULTRALCD_IMPL_DOGM_H +#include "MarlinConfig.h" + /** * Implementation of the LCD display routines for a DOGM128 graphic display. * These are common LCD 128x64 pixel graphic displays. @@ -51,20 +53,17 @@ #define LCD_CLICKED (buttons&EN_C) #endif -#include #include "dogm_bitmaps.h" - #include "ultralcd.h" #include "ultralcd_st7920_u8glib_rrd.h" -#include "Configuration.h" - #include "duration_t.h" +#include + #if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT) #undef USE_BIG_EDIT_FONT #endif - #if ENABLED(USE_SMALL_INFOFONT) #include "dogm_font_data_6x9_marlin.h" #define FONT_STATUSMENU_NAME u8g_font_6x9 From 3d9b878cf0d94409965595ee8ce6040ff75fdc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Zahradn=C3=ADk=20junior?= Date: Tue, 26 Jul 2016 13:47:20 +0200 Subject: [PATCH 506/580] Czech update --- Marlin/language_cz.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index 3b53d90a2..742cd8c1b 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -110,6 +110,7 @@ #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" #define MSG_PID_C "PID-C" +#define MSG_SELECT "Vybrat" #define MSG_E1 " E1" #define MSG_E2 " E2" #define MSG_E3 " E3" @@ -211,12 +212,16 @@ #define MSG_INFO_PROTOCOL "Protokol" #if LCD_WIDTH > 19 #define MSG_INFO_PRINT_COUNT "Pocet tisku" - #define MSG_INFO_COMPLETED_PRINTS "Dokonceno " + #define MSG_INFO_COMPLETED_PRINTS "Dokonceno" #define MSG_INFO_PRINT_TIME "Celkovy cas" + #define MSG_INFO_PRINT_LONGEST "Nejdelsi tisk" + #define MSG_INFO_PRINT_FILAMENT "Celkem vytlaceno" #else - #define MSG_INFO_PRINT_COUNT "Tisky " + #define MSG_INFO_PRINT_COUNT "Tisky" #define MSG_INFO_COMPLETED_PRINTS "Hotovo" - #define MSG_INFO_PRINT_TIME "Cas " + #define MSG_INFO_PRINT_TIME "Cas" + #define MSG_INFO_PRINT_LONGEST "Nejdelsi" + #define MSG_INFO_PRINT_FILAMENT "Vytlaceno" #endif #define MSG_INFO_MIN_TEMP "Teplota min" #define MSG_INFO_MAX_TEMP "Teplota max" From 8a44928df3cff0a692713c39bef726c6ddbd0aac Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 23:12:03 -0700 Subject: [PATCH 507/580] Make Conditionals.h a catch-all for old configs --- Marlin/{Conditionals.h => Conditionals_post.h} | 8 ++++---- Marlin/MarlinConfig.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) rename Marlin/{Conditionals.h => Conditionals_post.h} (99%) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals_post.h similarity index 99% rename from Marlin/Conditionals.h rename to Marlin/Conditionals_post.h index e593d79c9..fc0c6d54a 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals_post.h @@ -21,12 +21,10 @@ */ /** - * Conditionals.h + * Conditionals_post.h * Defines that depend on configuration but are not editable. */ -#ifndef CONDITIONALS_H -#define CONDITIONALS_H #include "pins.h" @@ -36,6 +34,8 @@ #include "Arduino.h" #include "macros.h" +#ifndef CONDITIONALS_POST_H +#define CONDITIONALS_POST_H #if ENABLED(EMERGENCY_PARSER) #define EMERGENCY_PARSER_CAPABILITIES " EMERGENCY_CODES:M108,M112,M410" @@ -675,4 +675,4 @@ #define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING #endif -#endif //CONDITIONALS_H +#endif // CONDITIONALS_POST_H diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index 16099895a..c3d0c3f9e 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -26,7 +26,7 @@ #include "Configuration.h" #include "Conditionals_LCD.h" #include "Configuration_adv.h" -#include "Conditionals.h" +#include "Conditionals_post.h" #include "SanityCheck.h" #endif // MARLIN_CONFIG_H From 5f4702ecb27d8c8da9e8b14f9042c0f2caffc585 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 23:12:26 -0700 Subject: [PATCH 508/580] Make Conditionals.h a catch-all for old configs --- Marlin/Conditionals.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Marlin/Conditionals.h diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h new file mode 100644 index 000000000..381255662 --- /dev/null +++ b/Marlin/Conditionals.h @@ -0,0 +1,28 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Conditionals.h + * OBSOLETE: Replaced by Conditionals_LCD.h and Conditionals_post.h + */ + +#error "Please remove the following #include's from your Configuration.h and Configuration_adv.h: macros.h boards.h Conditionals.h Configuration_adv.h SanityCheck.h." From 83c4653c711f054640a6d522416ba886246cc6c6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 23:22:45 -0700 Subject: [PATCH 509/580] Include boards and macros ahead of configs --- Marlin/Configuration.h | 3 --- Marlin/MarlinConfig.h | 2 ++ Marlin/example_configurations/Cartesio/Configuration.h | 3 --- Marlin/example_configurations/Felix/Configuration.h | 3 --- Marlin/example_configurations/Felix/DUAL/Configuration.h | 3 --- Marlin/example_configurations/Hephestos/Configuration.h | 3 --- Marlin/example_configurations/Hephestos_2/Configuration.h | 3 --- Marlin/example_configurations/K8200/Configuration.h | 3 --- Marlin/example_configurations/K8400/Configuration.h | 3 --- Marlin/example_configurations/K8400/Dual-head/Configuration.h | 3 --- .../RepRapWorld/Megatronics/Configuration.h | 3 --- Marlin/example_configurations/RigidBot/Configuration.h | 3 --- Marlin/example_configurations/SCARA/Configuration.h | 3 --- Marlin/example_configurations/TAZ4/Configuration.h | 3 --- Marlin/example_configurations/WITBOX/Configuration.h | 3 --- Marlin/example_configurations/adafruit/ST7565/Configuration.h | 3 --- Marlin/example_configurations/delta/biv2.5/Configuration.h | 3 --- Marlin/example_configurations/delta/generic/Configuration.h | 3 --- .../example_configurations/delta/kossel_mini/Configuration.h | 3 --- Marlin/example_configurations/delta/kossel_pro/Configuration.h | 3 --- Marlin/example_configurations/delta/kossel_xl/Configuration.h | 3 --- Marlin/example_configurations/makibox/Configuration.h | 3 --- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 3 --- 23 files changed, 2 insertions(+), 66 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2f36343d3..57e86e0ff 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index c3d0c3f9e..07287bb55 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -23,6 +23,8 @@ #ifndef MARLIN_CONFIG_H #define MARLIN_CONFIG_H +#include "macros.h" +#include "boards.h" #include "Configuration.h" #include "Conditionals_LCD.h" #include "Configuration_adv.h" diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 15642584c..2dae67d8d 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 4d9cde622..d4d96a58f 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index fcfb763fa..01e4258b2 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 6eb81a80b..57a2caba4 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 2ffefc758..d0f8a0cef 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 585362360..8e7080c08 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -58,9 +58,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 4907abb68..6eefcaf01 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 083fa6214..cd5cb4e3f 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 02153ad77..f8cab6d37 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 591b126fe..e5b3bfcb7 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index bfeb8653f..2d6464ce8 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index ce7dc41be..4c1b2d880 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 368bcaaee..daa52e1bc 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 7d52dd5a4..a19e65a23 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 4b8821186..c371e257d 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index e562f29c1..a024a52e7 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 47875cb45..a3e0aa892 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 484a64d5c..b60419a31 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -57,9 +57,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index ba6dc6926..56d6eff5d 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 09d105bf4..e466bf5bf 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 94781fedc..afb20b0dd 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -51,9 +51,6 @@ */ #define CONFIGURATION_H_VERSION 010100 -#include "boards.h" -#include "macros.h" - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== From 277899c1755621bc0c5ecbec12744952fbb691d8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 23:23:55 -0700 Subject: [PATCH 510/580] Move include _Bootscreen.h where needed --- Marlin/Configuration.h | 4 ---- Marlin/example_configurations/Cartesio/Configuration.h | 3 --- Marlin/example_configurations/Cartesio/_Bootscreen.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 3 --- Marlin/example_configurations/Felix/DUAL/Configuration.h | 3 --- Marlin/example_configurations/Hephestos/Configuration.h | 3 --- Marlin/example_configurations/Hephestos_2/Configuration.h | 4 ---- Marlin/example_configurations/K8200/Configuration.h | 3 --- Marlin/example_configurations/K8400/Configuration.h | 3 --- .../example_configurations/K8400/Dual-head/Configuration.h | 3 --- .../RepRapWorld/Megatronics/Configuration.h | 3 --- Marlin/example_configurations/RigidBot/Configuration.h | 3 --- Marlin/example_configurations/SCARA/Configuration.h | 3 --- Marlin/example_configurations/TAZ4/Configuration.h | 3 --- Marlin/example_configurations/WITBOX/Configuration.h | 4 ---- .../example_configurations/adafruit/ST7565/Configuration.h | 3 --- Marlin/example_configurations/delta/biv2.5/Configuration.h | 3 --- Marlin/example_configurations/delta/generic/Configuration.h | 3 --- .../delta/kossel_mini/Configuration.h | 3 --- .../example_configurations/delta/kossel_pro/Configuration.h | 3 --- .../example_configurations/delta/kossel_xl/Configuration.h | 3 --- Marlin/example_configurations/makibox/Configuration.h | 3 --- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 4 ---- Marlin/ultralcd_impl_DOGM.h | 6 +++++- 24 files changed, 6 insertions(+), 72 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 57e86e0ff..d2c5d603c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -109,10 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_Bootscreen.h" -#endif - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 2dae67d8d..29c893aaf 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // #define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_Bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/Cartesio/_Bootscreen.h b/Marlin/example_configurations/Cartesio/_Bootscreen.h index 93de4f143..a365caee7 100644 --- a/Marlin/example_configurations/Cartesio/_Bootscreen.h +++ b/Marlin/example_configurations/Cartesio/_Bootscreen.h @@ -35,7 +35,7 @@ #define CUSTOM_BOOTSCREEN_BMPWIDTH 63 #define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 -const unsigned char 81x0i84fkcmoqbu7vte29[512] PROGMEM = { +const unsigned char custom_start_bmp[512] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index d4d96a58f..92eb2d3ae 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 01e4258b2..fc10dcfe6 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 57a2caba4..4701c06a0 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index d0f8a0cef..5874d1cf0 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -109,10 +109,6 @@ // example configuration folder. // #define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_Bootscreen.h" -#endif - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 8e7080c08..0bc4ee51d 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -116,9 +116,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 6eefcaf01..1dbc6a0c1 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index cd5cb4e3f..ff28de895 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index f8cab6d37..e4fd7fa74 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index e5b3bfcb7..ec9b14505 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 2d6464ce8..e06184e07 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -134,9 +134,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 4c1b2d880..10fd6a6b4 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index daa52e1bc..d63753905 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -109,10 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_Bootscreen.h" -#endif - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index a19e65a23..4c95f5295 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index c371e257d..2ecf23207 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index a024a52e7..5fbd6027b 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index a3e0aa892..41006fd8b 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index b60419a31..d9a628000 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -115,9 +115,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 56d6eff5d..afe02628e 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -102,9 +102,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index e466bf5bf..b4586b55a 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -109,9 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_bootscreen.h" -#endif // @section machine diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index afb20b0dd..f69b16d61 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -109,10 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN -#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) - #include "_Bootscreen.h" -#endif - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 2d0faa0f5..43b76a995 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -60,6 +60,10 @@ #include +#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN) + #include "_Bootscreen.h" +#endif + #if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT) #undef USE_BIG_EDIT_FONT #endif @@ -145,7 +149,7 @@ #elif ENABLED(U8GLIB_ST7920) //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); U8GLIB_ST7920_128X64_RRD u8g(0); -#elif defined(CARTESIO_UI) +#elif ENABLED(CARTESIO_UI) // The CartesioUI display #if DOGLCD_MOSI != -1 && DOGLCD_SCK != -1 // using SW-SPI From d9f7ed9a3c438ae686d4f177156471d6ecdd9538 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 23:24:11 -0700 Subject: [PATCH 511/580] Move some macros from Marlin.h to macros.h --- Marlin/Marlin.h | 11 ----------- Marlin/macros.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index c780ff51b..a32007e3b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -22,12 +22,6 @@ #ifndef MARLIN_H #define MARLIN_H -#define FORCE_INLINE __attribute__((always_inline)) inline -/** - * Compiler warning on unused variable. - */ -#define UNUSED(x) (void) (x) - #include #include #include @@ -265,11 +259,6 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); } void setPwmFrequency(uint8_t pin, int val); #endif -#ifndef CRITICAL_SECTION_START - #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli(); - #define CRITICAL_SECTION_END SREG = _sreg; -#endif - /** * Feedrate scaling and conversion */ diff --git a/Marlin/macros.h b/Marlin/macros.h index f8c4735eb..c228ac3ed 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -23,6 +23,17 @@ #ifndef MACROS_H #define MACROS_H +#define FORCE_INLINE __attribute__((always_inline)) inline + +// Bracket code that shouldn't be interrupted +#ifndef CRITICAL_SECTION_START + #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli(); + #define CRITICAL_SECTION_END SREG = _sreg; +#endif + +// Remove compiler warning on an unused variable +#define UNUSED(x) (void) (x) + // Macros to make a string from a macro #define STRINGIFY_(M) #M #define STRINGIFY(M) STRINGIFY_(M) From 7e70a0b05d18665ff775377ca0d8f7514d1e3a86 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Jul 2016 12:16:22 -0700 Subject: [PATCH 512/580] Move pins / Arduino includes to MarlinConfig.h --- Marlin/Conditionals_post.h | 9 --------- Marlin/MarlinConfig.h | 5 +++++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index fc0c6d54a..3ff131de2 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -25,15 +25,6 @@ * Defines that depend on configuration but are not editable. */ - - #include "pins.h" - - #ifndef USBCON - #define HardwareSerial_h // trick to disable the standard HWserial - #endif - #include "Arduino.h" - - #include "macros.h" #ifndef CONDITIONALS_POST_H #define CONDITIONALS_POST_H diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index 07287bb55..4277c6543 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -28,6 +28,11 @@ #include "Configuration.h" #include "Conditionals_LCD.h" #include "Configuration_adv.h" +#include "pins.h" +#ifndef USBCON + #define HardwareSerial_h // trick to disable the standard HWserial +#endif +#include "Arduino.h" #include "Conditionals_post.h" #include "SanityCheck.h" From 24a1a16e5d2fd2485f61456be22f5c795fe185f9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Jul 2016 12:16:59 -0700 Subject: [PATCH 513/580] Move versioning to MarlinConfig.h --- Marlin/Configuration.h | 6 - Marlin/MarlinConfig.h | 1 + Marlin/Version.h | 104 ++++++++++-------- .../Cartesio/Configuration.h | 6 - .../Felix/Configuration.h | 6 - .../Felix/DUAL/Configuration.h | 6 - .../Hephestos/Configuration.h | 6 - .../Hephestos_2/Configuration.h | 6 - .../K8200/Configuration.h | 6 - .../K8400/Configuration.h | 6 - .../K8400/Dual-head/Configuration.h | 6 - .../RepRapWorld/Megatronics/Configuration.h | 6 - .../RigidBot/Configuration.h | 6 - .../SCARA/Configuration.h | 6 - .../TAZ4/Configuration.h | 6 - .../WITBOX/Configuration.h | 6 - .../adafruit/ST7565/Configuration.h | 6 - .../delta/biv2.5/Configuration.h | 6 - .../delta/generic/Configuration.h | 6 - .../delta/kossel_mini/Configuration.h | 6 - .../delta/kossel_pro/Configuration.h | 6 - .../delta/kossel_xl/Configuration.h | 6 - .../makibox/Configuration.h | 6 - .../tvrrug/Round2/Configuration.h | 6 - Marlin/language.h | 6 - 25 files changed, 57 insertions(+), 186 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d2c5d603c..8b5e3394c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index 4277c6543..b0d10a301 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -25,6 +25,7 @@ #include "macros.h" #include "boards.h" +#include "Version.h" #include "Configuration.h" #include "Conditionals_LCD.h" #include "Configuration_adv.h" diff --git a/Marlin/Version.h b/Marlin/Version.h index d17564b42..6a34f6fd8 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -26,59 +26,67 @@ * directive USE_AUTOMATIC_VERSIONING. */ -/** - * Marlin release version identifier - */ -#define SHORT_BUILD_VERSION "1.1.0-RCBugFix" +#if ENABLED(USE_AUTOMATIC_VERSIONING) -/** - * Verbose version identifier which should contain a reference to the location - * from where the binary was downloaded or the source code was compiled. - */ -#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" + #include "_Version.h" -/** - * The STRING_DISTRIBUTION_DATE represents when the binary file was built, - * here we define this default string as the date where the latest release - * version was tagged. - */ -#define STRING_DISTRIBUTION_DATE "2016-04-27 12:00" +#else -/** - * Required minimum Configuration.h and Configuration_adv.h file versions. - * - * You must increment this version number for every significant change such as, - * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on - * the configuration files. - */ -#define REQUIRED_CONFIGURATION_H_VERSION 010100 -#define REQUIRED_CONFIGURATION_ADV_H_VERSION 010100 + /** + * Marlin release version identifier + */ + #define SHORT_BUILD_VERSION "1.1.0-RCBugFix" -/** - * @todo: Missing documentation block - */ -#define PROTOCOL_VERSION "1.0" + /** + * Verbose version identifier which should contain a reference to the location + * from where the binary was downloaded or the source code was compiled. + */ + #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" -/** - * Defines a generic printer name to be output to the LCD after booting Marlin. - */ -#define MACHINE_NAME "3D Printer" + /** + * The STRING_DISTRIBUTION_DATE represents when the binary file was built, + * here we define this default string as the date where the latest release + * version was tagged. + */ + #define STRING_DISTRIBUTION_DATE "2016-04-27 12:00" -/** - * The SOURCE_CODE_URL is the location where users will find the Marlin Source - * Code which is installed on the device. In most cases —unless the manufacturer - * has a distinct Github fork— the Source Code URL should just be the main - * Marlin repository. - */ -#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" + /** + * Required minimum Configuration.h and Configuration_adv.h file versions. + * + * You must increment this version number for every significant change such as, + * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on + * the configuration files. + */ + #define REQUIRED_CONFIGURATION_H_VERSION 010100 + #define REQUIRED_CONFIGURATION_ADV_H_VERSION 010100 -/** - * Default generic printer UUID. - */ -#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" + /** + * @todo: Missing documentation block + */ + #define PROTOCOL_VERSION "1.0" -/** - * The WEBSITE_URL is the location where users can get more information such as - * documentation about a specific Marlin release. - */ -#define WEBSITE_URL "http://marlinfw.org" + /** + * Defines a generic printer name to be output to the LCD after booting Marlin. + */ + #define MACHINE_NAME "3D Printer" + + /** + * The SOURCE_CODE_URL is the location where users will find the Marlin Source + * Code which is installed on the device. In most cases —unless the manufacturer + * has a distinct Github fork— the Source Code URL should just be the main + * Marlin repository. + */ + #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" + + /** + * Default generic printer UUID. + */ + #define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" + + /** + * The WEBSITE_URL is the location where users can get more information such as + * documentation about a specific Marlin release. + */ + #define WEBSITE_URL "http://marlinfw.org" + +#endif // USE_AUTOMATIC_VERSIONING diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 29c893aaf..2ac06d1e8 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 92eb2d3ae..7bd240eda 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index fc10dcfe6..09a97f1e1 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 4701c06a0..47b72e461 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 5874d1cf0..a4eb3a30d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 0bc4ee51d..933b229d4 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -90,12 +90,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 1dbc6a0c1..4cbf03c11 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index ff28de895..390b07e2d 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index e4fd7fa74..7fe8a6a5f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index ec9b14505..ac2411b67 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index e06184e07..52a56937c 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -108,12 +108,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 10fd6a6b4..b3ac58545 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index d63753905..ad08e0e02 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 4c95f5295..b733bd6af 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 2ecf23207..673e167ff 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 5fbd6027b..f321eafeb 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 41006fd8b..50e42936d 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index d9a628000..2726e9a2c 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -89,12 +89,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index afe02628e..7a0ff37ba 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -76,12 +76,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index b4586b55a..79907874f 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index f69b16d61..36f6d3c5f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -83,12 +83,6 @@ // @section info -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - // User-specified version info of this build to display in [Pronterface, etc] terminal window during // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // build by the user have been successfully uploaded into firmware. diff --git a/Marlin/language.h b/Marlin/language.h index 82507d33b..496fed5c9 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -68,12 +68,6 @@ // pt_utf8 Portuguese (UTF8) // ru Russian -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Version.h" -#endif - #ifdef DEFAULT_SOURCE_CODE_URL #undef SOURCE_CODE_URL #define SOURCE_CODE_URL DEFAULT_SOURCE_CODE_URL From fa647cca23a1901afb0797090275dfc4e7f40843 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Jul 2016 12:28:49 -0700 Subject: [PATCH 514/580] Do the sanity check just once per build --- Marlin/MarlinConfig.h | 1 - Marlin/{SanityCheck.h => SanityCheck.cpp} | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) rename Marlin/{SanityCheck.h => SanityCheck.cpp} (99%) diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index b0d10a301..5ead4a11b 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -35,6 +35,5 @@ #endif #include "Arduino.h" #include "Conditionals_post.h" -#include "SanityCheck.h" #endif // MARLIN_CONFIG_H diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.cpp similarity index 99% rename from Marlin/SanityCheck.h rename to Marlin/SanityCheck.cpp index 129a43561..366090722 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.cpp @@ -21,12 +21,12 @@ */ /** - * SanityCheck.h + * SanityCheck.cpp * * Test configuration values for errors at compile-time. + * This is done only once, here, to speed up compilation time. */ -#ifndef SANITYCHECK_H -#define SANITYCHECK_H +#include "MarlinConfig.h" /** * Due to the high number of issues related with old versions of Arduino IDE @@ -727,5 +727,3 @@ #elif defined(HOMING_FEEDRATE) #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." #endif - -#endif //SANITYCHECK_H From 3be49881c0bf7c976e0b1fcecce011f087b2574e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Jul 2016 12:32:16 -0700 Subject: [PATCH 515/580] Make SanityCheck.h a catch-all for obsolete configs --- Marlin/Conditionals.h | 3 +-- Marlin/Marlin.h | 4 ---- Marlin/SanityCheck.h | 27 +++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 Marlin/SanityCheck.h diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 381255662..baa822d7f 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -24,5 +24,4 @@ * Conditionals.h * OBSOLETE: Replaced by Conditionals_LCD.h and Conditionals_post.h */ - -#error "Please remove the following #include's from your Configuration.h and Configuration_adv.h: macros.h boards.h Conditionals.h Configuration_adv.h SanityCheck.h." +#include "SanityCheck.h" diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index a32007e3b..1b1bffaec 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -37,10 +37,6 @@ #include "fastio.h" -#ifndef SANITYCHECK_H - #error "Your Configuration.h and Configuration_adv.h files are outdated!" -#endif - #include "enum.h" #include "utility.h" diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h new file mode 100644 index 000000000..fcf258475 --- /dev/null +++ b/Marlin/SanityCheck.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * SanityCheck.h + * OBSOLETE: Moved to SanityCheck.cpp + */ +#error "Please remove all #include lines from your Configuration.h and Configuration_adv.h files!" From 4be635ec6e7499c89db5d36b7f2421421fef3792 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Jul 2016 12:47:45 -0700 Subject: [PATCH 516/580] Remove MSG_PRINT_TIME from languages --- Marlin/language_en.h | 3 --- Marlin/language_it.h | 1 - Marlin/language_kana.h | 1 - Marlin/language_kana_utf8.h | 1 - 4 files changed, 6 deletions(-) diff --git a/Marlin/language_en.h b/Marlin/language_en.h index f59981082..6cf7d52c5 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -500,9 +500,6 @@ #ifndef MSG_SHORT_MINUTE #define MSG_SHORT_MINUTE "m" // One character only #endif -#ifndef MSG_PRINT_TIME - #define MSG_PRINT_TIME "Print time" -#endif #ifndef MSG_HEATING #define MSG_HEATING "Heating..." #endif diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 82bece181..047272bc6 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -169,7 +169,6 @@ #define MSG_SHORT_DAY "g" // One character only #define MSG_SHORT_HOUR "h" // One character only #define MSG_SHORT_MINUTE "m" // One character only -#define MSG_PRINT_TIME "Durata stampa" #define MSG_HEATING "Riscaldamento.." #define MSG_HEATING_COMPLETE "Risc. completato" #define MSG_BED_HEATING "Risc. Piatto.." diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 9b406e5fc..67136e298 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -220,7 +220,6 @@ #define MSG_SHORT_DAY "d" // One character only #define MSG_SHORT_HOUR "h" // One character only #define MSG_SHORT_MINUTE "m" // One character only -#define MSG_PRINT_TIME "\xcc\xdf\xd8\xdd\xc4\xbc\xde\xb6\xdd" // "プリントジカン" ("Print time") #define MSG_HEATING "\xb6\xc8\xc2\xc1\xad\xb3" // "カネツチュウ" ("Heating...") #define MSG_HEATING_COMPLETE "\xb6\xc8\xc2\xb6\xdd\xd8\xae\xb3" // "カネツカンリョウ" ("Heating done.") #define MSG_BED_HEATING "\xcd\xde\xaf\xc4\xde\x20\xb6\xc8\xc2\xc1\xad\xb3" // "ベッド カネツチュウ" ("Bed Heating.") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index ed521aaea..3e46f57d8 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -175,7 +175,6 @@ #define MSG_SHORT_DAY "d" // One character only #define MSG_SHORT_HOUR "h" // One character only #define MSG_SHORT_MINUTE "m" // One character only -#define MSG_PRINT_TIME "プリントジカン" // "Print time" #define MSG_HEATING "カネツチュウ" // "Heating..." #define MSG_HEATING_COMPLETE "カネツカンリョウ" // "Heating done." #define MSG_BED_HEATING "ベッド カネツチュウ" // "Bed Heating." From 21e744c454213c32a5ae7685b17af8433b25105c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Jul 2016 17:19:25 -0700 Subject: [PATCH 517/580] Allow zero raise for deploy/stow --- Marlin/SanityCheck.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/SanityCheck.cpp b/Marlin/SanityCheck.cpp index 366090722..269c59ea8 100644 --- a/Marlin/SanityCheck.cpp +++ b/Marlin/SanityCheck.cpp @@ -338,8 +338,8 @@ #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration." #elif !defined(Z_RAISE_BETWEEN_PROBINGS) #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration." - #elif Z_RAISE_PROBE_DEPLOY_STOW < 1 - #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 1." + #elif Z_RAISE_PROBE_DEPLOY_STOW < 0 + #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0." #elif Z_RAISE_BETWEEN_PROBINGS < 1 #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 1." #endif From e4942d2163cdc4faffa985a12cdcac7e5c35da60 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 27 Jul 2016 12:40:44 +0200 Subject: [PATCH 518/580] Switch SD2cadrLib to fastio Replace all fastDigitalRead/Write() with READ/WRITE() Define SCK_PIN, MISO_PIN, MOSI_PIN in pins.h if not already defined in the pins_*.h files. Remove these conditional pin definitions from the pin-files. They are now always defined. Define separate sets of SPI-pins for AT90USB with and without Teensy support in fastio.h. Likely this was the main reason for all that confusion about the AT90USB-SPI pins. --- Marlin/MarlinConfig.h | 1 + Marlin/Sd2Card.cpp | 17 +- Marlin/Sd2Card.h | 1 - Marlin/Sd2PinMap.h | 453 --------------------------------- Marlin/buzzer.h | 4 +- Marlin/fastio.h | 17 +- Marlin/pins.h | 15 ++ Marlin/pins_5DPRINT.h | 11 +- Marlin/pins_BRAINWAVE.h | 8 - Marlin/pins_BRAINWAVE_PRO.h | 8 - Marlin/pins_PRINTRBOARD.h | 7 - Marlin/pins_PRINTRBOARD_REVF.h | 7 - Marlin/pins_RAMPS_14.h | 6 - Marlin/pins_RAMPS_OLD.h | 7 - Marlin/pins_SAV_MKI.h | 6 - Marlin/pins_TEENSY2.h | 7 - Marlin/pins_TEENSYLU.h | 7 - Marlin/temperature.cpp | 4 +- 18 files changed, 42 insertions(+), 544 deletions(-) delete mode 100644 Marlin/Sd2PinMap.h diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index 5ead4a11b..7ed8aea05 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -23,6 +23,7 @@ #ifndef MARLIN_CONFIG_H #define MARLIN_CONFIG_H +#include "fastio.h" #include "macros.h" #include "boards.h" #include "Version.h" diff --git a/Marlin/Sd2Card.cpp b/Marlin/Sd2Card.cpp index f077e9e77..190e4ad1f 100644 --- a/Marlin/Sd2Card.cpp +++ b/Marlin/Sd2Card.cpp @@ -30,6 +30,7 @@ #if ENABLED(SDSUPPORT) #include "Sd2Card.h" + //------------------------------------------------------------------------------ #if DISABLED(SOFTWARE_SPI) // functions for hardware SPI @@ -99,10 +100,10 @@ // no interrupts during byte receive - about 8 us cli(); // output pin high - like sending 0XFF - fastDigitalWrite(SPI_MOSI_PIN, HIGH); + WRITE(SPI_MOSI_PIN, HIGH); for (uint8_t i = 0; i < 8; i++) { - fastDigitalWrite(SPI_SCK_PIN, HIGH); + WRITE(SPI_SCK_PIN, HIGH); // adjust so SCK is nice nop; @@ -110,9 +111,9 @@ data <<= 1; - if (fastDigitalRead(SPI_MISO_PIN)) data |= 1; + if (READ(SPI_MISO_PIN)) data |= 1; - fastDigitalWrite(SPI_SCK_PIN, LOW); + WRITE(SPI_SCK_PIN, LOW); } // enable interrupts sei(); @@ -130,13 +131,13 @@ // no interrupts during byte send - about 8 us cli(); for (uint8_t i = 0; i < 8; i++) { - fastDigitalWrite(SPI_SCK_PIN, LOW); + WRITE(SPI_SCK_PIN, LOW); - fastDigitalWrite(SPI_MOSI_PIN, data & 0X80); + WRITE(SPI_MOSI_PIN, data & 0X80); data <<= 1; - fastDigitalWrite(SPI_SCK_PIN, HIGH); + WRITE(SPI_SCK_PIN, HIGH); } // hold SCK high for a few ns nop; @@ -144,7 +145,7 @@ nop; nop; - fastDigitalWrite(SPI_SCK_PIN, LOW); + WRITE(SPI_SCK_PIN, LOW); // enable interrupts sei(); } diff --git a/Marlin/Sd2Card.h b/Marlin/Sd2Card.h index 45d8f22ea..8c19a5629 100644 --- a/Marlin/Sd2Card.h +++ b/Marlin/Sd2Card.h @@ -37,7 +37,6 @@ * \brief Sd2Card class for V2 SD/SDHC cards */ #include "SdFatConfig.h" -#include "Sd2PinMap.h" #include "SdInfo.h" //------------------------------------------------------------------------------ // SPI speed is F_CPU/2^(1 + index), 0 <= index <= 6 diff --git a/Marlin/Sd2PinMap.h b/Marlin/Sd2PinMap.h deleted file mode 100644 index 3ad6b795a..000000000 --- a/Marlin/Sd2PinMap.h +++ /dev/null @@ -1,453 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino SdFat Library - * Copyright (C) 2010 by William Greiman - * - * This file is part of the Arduino Sd2Card Library - */ -// Warning this file was generated by a program. -#include "Marlin.h" -#include "macros.h" - -#if ENABLED(SDSUPPORT) - -#ifndef Sd2PinMap_h -#define Sd2PinMap_h -#include -//------------------------------------------------------------------------------ -/** struct for mapping digital pins */ -struct pin_map_t { - volatile uint8_t* ddr; - volatile uint8_t* pin; - volatile uint8_t* port; - uint8_t bit; -}; -//------------------------------------------------------------------------------ -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // Mega - -// Two Wire (aka I2C) ports -uint8_t const SDA_PIN = 20; // D1 -uint8_t const SCL_PIN = 21; // D0 - -#undef MOSI_PIN -#undef MISO_PIN -#undef SCK_PIN -// SPI port -uint8_t const SS_PIN = 53; // B0 -uint8_t const MOSI_PIN = 51; // B2 -uint8_t const MISO_PIN = 50; // B3 -uint8_t const SCK_PIN = 52; // B1 - -static const pin_map_t digitalPinMap[] = { - {&DDRE, &PINE, &PORTE, 0}, // E0 0 - {&DDRE, &PINE, &PORTE, 1}, // E1 1 - {&DDRE, &PINE, &PORTE, 4}, // E4 2 - {&DDRE, &PINE, &PORTE, 5}, // E5 3 - {&DDRG, &PING, &PORTG, 5}, // G5 4 - {&DDRE, &PINE, &PORTE, 3}, // E3 5 - {&DDRH, &PINH, &PORTH, 3}, // H3 6 - {&DDRH, &PINH, &PORTH, 4}, // H4 7 - {&DDRH, &PINH, &PORTH, 5}, // H5 8 - {&DDRH, &PINH, &PORTH, 6}, // H6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRJ, &PINJ, &PORTJ, 1}, // J1 14 - {&DDRJ, &PINJ, &PORTJ, 0}, // J0 15 - {&DDRH, &PINH, &PORTH, 1}, // H1 16 - {&DDRH, &PINH, &PORTH, 0}, // H0 17 - {&DDRD, &PIND, &PORTD, 3}, // D3 18 - {&DDRD, &PIND, &PORTD, 2}, // D2 19 - {&DDRD, &PIND, &PORTD, 1}, // D1 20 - {&DDRD, &PIND, &PORTD, 0}, // D0 21 - {&DDRA, &PINA, &PORTA, 0}, // A0 22 - {&DDRA, &PINA, &PORTA, 1}, // A1 23 - {&DDRA, &PINA, &PORTA, 2}, // A2 24 - {&DDRA, &PINA, &PORTA, 3}, // A3 25 - {&DDRA, &PINA, &PORTA, 4}, // A4 26 - {&DDRA, &PINA, &PORTA, 5}, // A5 27 - {&DDRA, &PINA, &PORTA, 6}, // A6 28 - {&DDRA, &PINA, &PORTA, 7}, // A7 29 - {&DDRC, &PINC, &PORTC, 7}, // C7 30 - {&DDRC, &PINC, &PORTC, 6}, // C6 31 - {&DDRC, &PINC, &PORTC, 5}, // C5 32 - {&DDRC, &PINC, &PORTC, 4}, // C4 33 - {&DDRC, &PINC, &PORTC, 3}, // C3 34 - {&DDRC, &PINC, &PORTC, 2}, // C2 35 - {&DDRC, &PINC, &PORTC, 1}, // C1 36 - {&DDRC, &PINC, &PORTC, 0}, // C0 37 - {&DDRD, &PIND, &PORTD, 7}, // D7 38 - {&DDRG, &PING, &PORTG, 2}, // G2 39 - {&DDRG, &PING, &PORTG, 1}, // G1 40 - {&DDRG, &PING, &PORTG, 0}, // G0 41 - {&DDRL, &PINL, &PORTL, 7}, // L7 42 - {&DDRL, &PINL, &PORTL, 6}, // L6 43 - {&DDRL, &PINL, &PORTL, 5}, // L5 44 - {&DDRL, &PINL, &PORTL, 4}, // L4 45 - {&DDRL, &PINL, &PORTL, 3}, // L3 46 - {&DDRL, &PINL, &PORTL, 2}, // L2 47 - {&DDRL, &PINL, &PORTL, 1}, // L1 48 - {&DDRL, &PINL, &PORTL, 0}, // L0 49 - {&DDRB, &PINB, &PORTB, 3}, // B3 50 - {&DDRB, &PINB, &PORTB, 2}, // B2 51 - {&DDRB, &PINB, &PORTB, 1}, // B1 52 - {&DDRB, &PINB, &PORTB, 0}, // B0 53 - {&DDRF, &PINF, &PORTF, 0}, // F0 54 - {&DDRF, &PINF, &PORTF, 1}, // F1 55 - {&DDRF, &PINF, &PORTF, 2}, // F2 56 - {&DDRF, &PINF, &PORTF, 3}, // F3 57 - {&DDRF, &PINF, &PORTF, 4}, // F4 58 - {&DDRF, &PINF, &PORTF, 5}, // F5 59 - {&DDRF, &PINF, &PORTF, 6}, // F6 60 - {&DDRF, &PINF, &PORTF, 7}, // F7 61 - {&DDRK, &PINK, &PORTK, 0}, // K0 62 - {&DDRK, &PINK, &PORTK, 1}, // K1 63 - {&DDRK, &PINK, &PORTK, 2}, // K2 64 - {&DDRK, &PINK, &PORTK, 3}, // K3 65 - {&DDRK, &PINK, &PORTK, 4}, // K4 66 - {&DDRK, &PINK, &PORTK, 5}, // K5 67 - {&DDRK, &PINK, &PORTK, 6}, // K6 68 - {&DDRK, &PINK, &PORTK, 7} // K7 69 -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega644P__)\ -|| defined(__AVR_ATmega644__)\ -|| defined(__AVR_ATmega1284P__) -// Sanguino - -// Two Wire (aka I2C) ports -uint8_t const SDA_PIN = 17; // C1 -uint8_t const SCL_PIN = 18; // C2 - -// SPI port -uint8_t const SS_PIN = 4; // B4 -uint8_t const MOSI_PIN = 5; // B5 -uint8_t const MISO_PIN = 6; // B6 -uint8_t const SCK_PIN = 7; // B7 - -static const pin_map_t digitalPinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 7}, // A7 24 - {&DDRA, &PINA, &PORTA, 6}, // A6 25 - {&DDRA, &PINA, &PORTA, 5}, // A5 26 - {&DDRA, &PINA, &PORTA, 4}, // A4 27 - {&DDRA, &PINA, &PORTA, 3}, // A3 28 - {&DDRA, &PINA, &PORTA, 2}, // A2 29 - {&DDRA, &PINA, &PORTA, 1}, // A1 30 - {&DDRA, &PINA, &PORTA, 0} // A0 31 -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega32U4__) -// Teensy 2.0 - -// Two Wire (aka I2C) ports -uint8_t const SDA_PIN = 6; // D1 -uint8_t const SCL_PIN = 5; // D0 - -// SPI port -uint8_t const SS_PIN = 0; // B0 -uint8_t const MOSI_PIN = 2; // B2 -uint8_t const MISO_PIN = 3; // B3 -uint8_t const SCK_PIN = 1; // B1 - -static const pin_map_t digitalPinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 7}, // B7 4 - {&DDRD, &PIND, &PORTD, 0}, // D0 5 - {&DDRD, &PIND, &PORTD, 1}, // D1 6 - {&DDRD, &PIND, &PORTD, 2}, // D2 7 - {&DDRD, &PIND, &PORTD, 3}, // D3 8 - {&DDRC, &PINC, &PORTC, 6}, // C6 9 - {&DDRC, &PINC, &PORTC, 7}, // C7 10 - {&DDRD, &PIND, &PORTD, 6}, // D6 11 - {&DDRD, &PIND, &PORTD, 7}, // D7 12 - {&DDRB, &PINB, &PORTB, 4}, // B4 13 - {&DDRB, &PINB, &PORTB, 5}, // B5 14 - {&DDRB, &PINB, &PORTB, 6}, // B6 15 - {&DDRF, &PINF, &PORTF, 7}, // F7 16 - {&DDRF, &PINF, &PORTF, 6}, // F6 17 - {&DDRF, &PINF, &PORTF, 5}, // F5 18 - {&DDRF, &PINF, &PORTF, 4}, // F4 19 - {&DDRF, &PINF, &PORTF, 1}, // F1 20 - {&DDRF, &PINF, &PORTF, 0}, // F0 21 - {&DDRD, &PIND, &PORTD, 4}, // D4 22 - {&DDRD, &PIND, &PORTD, 5}, // D5 23 - {&DDRE, &PINE, &PORTE, 6} // E6 24 -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_AT90USB646__)\ -|| defined(__AVR_AT90USB1286__) -// Teensy++ 1.0 & 2.0 - -// Two Wire (aka I2C) ports -uint8_t const SDA_PIN = 1; // D1 -uint8_t const SCL_PIN = 0; // D0 - -// SPI port -uint8_t const SS_PIN = 20; // B0 -uint8_t const MOSI_PIN = 22; // B2 -uint8_t const MISO_PIN = 23; // B3 -uint8_t const SCK_PIN = 21; // B1 - -static const pin_map_t digitalPinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRE, &PINE, &PORTE, 0}, // E0 8 - {&DDRE, &PINE, &PORTE, 1}, // E1 9 - {&DDRC, &PINC, &PORTC, 0}, // C0 10 - {&DDRC, &PINC, &PORTC, 1}, // C1 11 - {&DDRC, &PINC, &PORTC, 2}, // C2 12 - {&DDRC, &PINC, &PORTC, 3}, // C3 13 - {&DDRC, &PINC, &PORTC, 4}, // C4 14 - {&DDRC, &PINC, &PORTC, 5}, // C5 15 - {&DDRC, &PINC, &PORTC, 6}, // C6 16 - {&DDRC, &PINC, &PORTC, 7}, // C7 17 - {&DDRE, &PINE, &PORTE, 6}, // E6 18 - {&DDRE, &PINE, &PORTE, 7}, // E7 19 - {&DDRB, &PINB, &PORTB, 0}, // B0 20 - {&DDRB, &PINB, &PORTB, 1}, // B1 21 - {&DDRB, &PINB, &PORTB, 2}, // B2 22 - {&DDRB, &PINB, &PORTB, 3}, // B3 23 - {&DDRB, &PINB, &PORTB, 4}, // B4 24 - {&DDRB, &PINB, &PORTB, 5}, // B5 25 - {&DDRB, &PINB, &PORTB, 6}, // B6 26 - {&DDRB, &PINB, &PORTB, 7}, // B7 27 - {&DDRA, &PINA, &PORTA, 0}, // A0 28 - {&DDRA, &PINA, &PORTA, 1}, // A1 29 - {&DDRA, &PINA, &PORTA, 2}, // A2 30 - {&DDRA, &PINA, &PORTA, 3}, // A3 31 - {&DDRA, &PINA, &PORTA, 4}, // A4 32 - {&DDRA, &PINA, &PORTA, 5}, // A5 33 - {&DDRA, &PINA, &PORTA, 6}, // A6 34 - {&DDRA, &PINA, &PORTA, 7}, // A7 35 - {&DDRE, &PINE, &PORTE, 4}, // E4 36 - {&DDRE, &PINE, &PORTE, 5}, // E5 37 - {&DDRF, &PINF, &PORTF, 0}, // F0 38 - {&DDRF, &PINF, &PORTF, 1}, // F1 39 - {&DDRF, &PINF, &PORTF, 2}, // F2 40 - {&DDRF, &PINF, &PORTF, 3}, // F3 41 - {&DDRF, &PINF, &PORTF, 4}, // F4 42 - {&DDRF, &PINF, &PORTF, 5}, // F5 43 - {&DDRF, &PINF, &PORTF, 6}, // F6 44 - {&DDRF, &PINF, &PORTF, 7} // F7 45 -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega168__)\ -||defined(__AVR_ATmega168P__)\ -||defined(__AVR_ATmega328P__) -// 168 and 328 Arduinos - -// Two Wire (aka I2C) ports -uint8_t const SDA_PIN = 18; // C4 -uint8_t const SCL_PIN = 19; // C5 - -// SPI port -uint8_t const SS_PIN = 10; // B2 -uint8_t const MOSI_PIN = 11; // B3 -uint8_t const MISO_PIN = 12; // B4 -uint8_t const SCK_PIN = 13; // B5 - -static const pin_map_t digitalPinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRB, &PINB, &PORTB, 0}, // B0 8 - {&DDRB, &PINB, &PORTB, 1}, // B1 9 - {&DDRB, &PINB, &PORTB, 2}, // B2 10 - {&DDRB, &PINB, &PORTB, 3}, // B3 11 - {&DDRB, &PINB, &PORTB, 4}, // B4 12 - {&DDRB, &PINB, &PORTB, 5}, // B5 13 - {&DDRC, &PINC, &PORTC, 0}, // C0 14 - {&DDRC, &PINC, &PORTC, 1}, // C1 15 - {&DDRC, &PINC, &PORTC, 2}, // C2 16 - {&DDRC, &PINC, &PORTC, 3}, // C3 17 - {&DDRC, &PINC, &PORTC, 4}, // C4 18 - {&DDRC, &PINC, &PORTC, 5} // C5 19 -}; -#elif defined(__AVR_ATmega1281__) -// Waspmote - -// Two Wire (aka I2C) ports -uint8_t const SDA_PIN = 41; -uint8_t const SCL_PIN = 40; - - -#undef MOSI_PIN -#undef MISO_PIN -// SPI port -uint8_t const SS_PIN = 16; // B0 -uint8_t const MOSI_PIN = 11; // B2 -uint8_t const MISO_PIN = 12; // B3 -uint8_t const SCK_PIN = 10; // B1 - -static const pin_map_t digitalPinMap[] = { - {&DDRE, &PINE, &PORTE, 0}, // E0 0 - {&DDRE, &PINE, &PORTE, 1}, // E1 1 - {&DDRE, &PINE, &PORTE, 3}, // E3 2 - {&DDRE, &PINE, &PORTE, 4}, // E4 3 - {&DDRC, &PINC, &PORTC, 4}, // C4 4 - {&DDRC, &PINC, &PORTC, 5}, // C5 5 - {&DDRC, &PINC, &PORTC, 6}, // C6 6 - {&DDRC, &PINC, &PORTC, 7}, // C7 7 - {&DDRA, &PINA, &PORTA, 2}, // A2 8 - {&DDRA, &PINA, &PORTA, 3}, // A3 9 - {&DDRA, &PINA, &PORTA, 4}, // A4 10 - {&DDRD, &PIND, &PORTD, 5}, // D5 11 - {&DDRD, &PIND, &PORTD, 6}, // D6 12 - {&DDRC, &PINC, &PORTC, 1}, // C1 13 - {&DDRF, &PINF, &PORTF, 1}, // F1 14 - {&DDRF, &PINF, &PORTF, 2}, // F2 15 - {&DDRF, &PINF, &PORTF, 3}, // F3 16 - {&DDRF, &PINF, &PORTF, 4}, // F4 17 - {&DDRF, &PINF, &PORTF, 5}, // F5 18 - {&DDRF, &PINF, &PORTF, 6}, // F6 19 - {&DDRF, &PINF, &PORTF, 7}, // F7 20 - {&DDRF, &PINF, &PORTF, 0}, // F0 21 - {&DDRA, &PINA, &PORTA, 1}, // A1 22 - {&DDRD, &PIND, &PORTD, 7}, // D7 23 - {&DDRE, &PINE, &PORTE, 5}, // E5 24 - {&DDRA, &PINA, &PORTA, 6}, // A6 25 - {&DDRE, &PINE, &PORTE, 2}, // E2 26 - {&DDRA, &PINA, &PORTA, 5}, // A5 27 - {&DDRC, &PINC, &PORTC, 0}, // C0 28 - {&DDRB, &PINB, &PORTB, 0}, // B0 29 - {&DDRB, &PINB, &PORTB, 1}, // B1 30 - {&DDRB, &PINB, &PORTB, 2}, // B2 31 - {&DDRB, &PINB, &PORTB, 3}, // B3 32 - {&DDRB, &PINB, &PORTB, 4}, // B4 33 - {&DDRB, &PINB, &PORTB, 5}, // B5 34 - {&DDRA, &PINA, &PORTA, 0}, // A0 35 - {&DDRB, &PINB, &PORTB, 6}, // B6 36 - {&DDRB, &PINB, &PORTB, 7}, // B7 37 - {&DDRE, &PINE, &PORTE, 6}, // E6 38 - {&DDRE, &PINE, &PORTE, 7}, // E7 39 - {&DDRD, &PIND, &PORTD, 0}, // D0 40 - {&DDRD, &PIND, &PORTD, 1}, // D1 41 - {&DDRC, &PINC, &PORTC, 3}, // C3 42 - {&DDRD, &PIND, &PORTD, 2}, // D2 43 - {&DDRD, &PIND, &PORTD, 3}, // D3 44 - {&DDRA, &PINA, &PORTA, 7}, // A7 45 - {&DDRC, &PINC, &PORTC, 2}, // C2 46 - {&DDRD, &PIND, &PORTD, 4}, // D4 47 - {&DDRG, &PING, &PORTG, 2}, // G2 48 - {&DDRG, &PING, &PORTG, 1}, // G1 49 - {&DDRG, &PING, &PORTG, 0}, // G0 50 -}; -#else // defined(__AVR_ATmega1280__) -#error "unknown chip" -#endif // defined(__AVR_ATmega1280__) -//------------------------------------------------------------------------------ -static const uint8_t digitalPinCount = COUNT(digitalPinMap); - -uint8_t badPinNumber(void) - __attribute__((error("Pin number is too large or not a constant"))); - -static inline __attribute__((always_inline)) - bool getPinMode(uint8_t pin) { - if (__builtin_constant_p(pin) && pin < digitalPinCount) { - return (*digitalPinMap[pin].ddr >> digitalPinMap[pin].bit) & 1; - } - else { - return badPinNumber(); - } -} -static inline __attribute__((always_inline)) - void setPinMode(uint8_t pin, uint8_t mode) { - if (__builtin_constant_p(pin) && pin < digitalPinCount) { - if (mode) { - SBI(*digitalPinMap[pin].ddr, digitalPinMap[pin].bit); - } - else { - CBI(*digitalPinMap[pin].ddr, digitalPinMap[pin].bit); - } - } - else { - badPinNumber(); - } -} -static inline __attribute__((always_inline)) - bool fastDigitalRead(uint8_t pin) { - if (__builtin_constant_p(pin) && pin < digitalPinCount) { - return (*digitalPinMap[pin].pin >> digitalPinMap[pin].bit) & 1; - } - else { - return badPinNumber(); - } -} -static inline __attribute__((always_inline)) - void fastDigitalWrite(uint8_t pin, uint8_t value) { - if (__builtin_constant_p(pin) && pin < digitalPinCount) { - if (value) { - SBI(*digitalPinMap[pin].port, digitalPinMap[pin].bit); - } - else { - CBI(*digitalPinMap[pin].port, digitalPinMap[pin].bit); - } - } - else { - badPinNumber(); - } -} -#endif // Sd2PinMap_h - - -#endif diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index e967284ea..0ad870a30 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -31,7 +31,7 @@ /** * @brief Tone structure - * @details Simple abstration of a tone based on a duration and a frequency. + * @details Simple abstraction of a tone based on a duration and a frequency. * */ struct tone_t { @@ -57,7 +57,7 @@ class Buzzer { * @details This will invert the current state of an digital IO pin. */ void invert() { - WRITE(BEEPER_PIN, !READ(BEEPER_PIN)); + TOGGLE(BEEPER_PIN); } /** diff --git a/Marlin/fastio.h b/Marlin/fastio.h index 10464bf50..3a608e005 100644 --- a/Marlin/fastio.h +++ b/Marlin/fastio.h @@ -2047,11 +2047,6 @@ #endif #if defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) - // SPI - #define SCK DIO9 - #define MISO DIO11 - #define MOSI DIO10 - #define SS DIO8 // change for your board #define DEBUG_LED DIO31 /* led D5 red */ @@ -2063,6 +2058,12 @@ //#define AT90USBxx_TEENSYPP_ASSIGNMENTS // Use Teensy++ 2.0 assignments #ifndef AT90USBxx_TEENSYPP_ASSIGNMENTS // Use traditional Marlin pin assignments + // SPI + #define SCK DIO9 // 21 + #define MISO DIO11 // 23 + #define MOSI DIO10 // 22 + #define SS DIO8 // 20 + #define DIO0_PIN PINA0 #define DIO0_RPORT PINA #define DIO0_WPORT PORTA @@ -2707,6 +2708,12 @@ The pins 46 and 47 are not supported by Teensyduino, but are supported below. */ + // SPI + #define SCK DIO21 // 9 + #define MISO DIO23 // 11 + #define MOSI DIO22 // 10 + #define SS DIO20 // 8 + #define DIO0_PIN PIND0 #define DIO0_RPORT PIND #define DIO0_WPORT PORTD diff --git a/Marlin/pins.h b/Marlin/pins.h index 141c8355f..8133f4db5 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -432,4 +432,19 @@ X_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \ } +#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) + +#ifndef SCK_PIN + #define SCK_PIN SCK +#endif +#ifndef MISO_PIN + #define MISO_PIN MISO +#endif +#ifndef MOSI_PIN + #define MOSI_PIN MOSI +#endif +#ifndef SS_PIN + #define SS_PIN SS +#endif + #endif //__PINS_H diff --git a/Marlin/pins_5DPRINT.h b/Marlin/pins_5DPRINT.h index 0674a98d1..dae7e2034 100644 --- a/Marlin/pins_5DPRINT.h +++ b/Marlin/pins_5DPRINT.h @@ -63,19 +63,12 @@ #define TEMP_0_PIN 1 // Extruder / Analog pin numbering #define TEMP_BED_PIN 0 // Bed / Analog pin numbering -// The SDSS pin uses a different pin mapping from file Sd2PinMap.h +// The SDSS pin uses a different pin mapping from file fastio.h #define SDSS 20 -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 9 - #define MISO_PIN 11 - #define MOSI_PIN 10 -#endif - // Microstepping pins // Note that the pin mapping is not from fastio.h -// See Sd2PinMap.h for the pin configurations +// See Sd2PinMap.h for the pin configurations ??? #define X_MS1_PIN 25 #define X_MS2_PIN 26 #define Y_MS1_PIN 9 diff --git a/Marlin/pins_BRAINWAVE.h b/Marlin/pins_BRAINWAVE.h index 63e2d0bbc..9dfeb3ab1 100644 --- a/Marlin/pins_BRAINWAVE.h +++ b/Marlin/pins_BRAINWAVE.h @@ -64,11 +64,3 @@ #define TEMP_BED_PIN 6 // Bed / Analog pin numbering #define LED_PIN 39 - -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 9 - #define MISO_PIN 11 - #define MOSI_PIN 10 -#endif - diff --git a/Marlin/pins_BRAINWAVE_PRO.h b/Marlin/pins_BRAINWAVE_PRO.h index fc10c2977..3b33eeb28 100644 --- a/Marlin/pins_BRAINWAVE_PRO.h +++ b/Marlin/pins_BRAINWAVE_PRO.h @@ -72,11 +72,3 @@ #define SDSS 20 #define LED_PIN 19 #define SD_DETECT_PIN 12 - -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 21 - #define MISO_PIN 23 - #define MOSI_PIN 22 -#endif - diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h index eaccabe9d..f8e9e10c4 100644 --- a/Marlin/pins_PRINTRBOARD.h +++ b/Marlin/pins_PRINTRBOARD.h @@ -86,13 +86,6 @@ #define SDSS 26 -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 9 - #define MISO_PIN 11 - #define MOSI_PIN 10 -#endif - #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) //we have no buzzer installed #define BEEPER_PIN -1 diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h index d2a45623a..a826eee68 100644 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ b/Marlin/pins_PRINTRBOARD_REVF.h @@ -92,13 +92,6 @@ #define DAC_STEPPER_GAIN 0 #define DAC_OR_ADDRESS 0x00 -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 9 - #define MISO_PIN 11 - #define MOSI_PIN 10 -#endif - #if ENABLED(ULTRA_LCD) #define BEEPER_PIN -1 diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index ef96f59a6..9f99ba5b0 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -302,9 +302,3 @@ #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 52 - #define MISO_PIN 50 - #define MOSI_PIN 51 -#endif diff --git a/Marlin/pins_RAMPS_OLD.h b/Marlin/pins_RAMPS_OLD.h index 470071a2f..213bd3f1e 100644 --- a/Marlin/pins_RAMPS_OLD.h +++ b/Marlin/pins_RAMPS_OLD.h @@ -78,10 +78,3 @@ #else #define MAX6675_SS 66// Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif - -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 52 - #define MISO_PIN 50 - #define MOSI_PIN 51 -#endif diff --git a/Marlin/pins_SAV_MKI.h b/Marlin/pins_SAV_MKI.h index 97189bf77..530f63ada 100644 --- a/Marlin/pins_SAV_MKI.h +++ b/Marlin/pins_SAV_MKI.h @@ -65,12 +65,6 @@ #define TEMP_0_PIN 7 // Extruder / Analog pin numbering #define TEMP_BED_PIN 6 // Bed / Analog pin numbering -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 9 - #define MISO_PIN 11 - #define MOSI_PIN 10 -#endif #define SDSS 20 // PB0 - 8 in marlin env. // Extension header pin mapping diff --git a/Marlin/pins_TEENSY2.h b/Marlin/pins_TEENSY2.h index 0f83117f2..f4f7d4c01 100644 --- a/Marlin/pins_TEENSY2.h +++ b/Marlin/pins_TEENSY2.h @@ -109,13 +109,6 @@ #define LED_PIN 6 #define PS_ON_PIN 27 -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 21 // 9 - #define MISO_PIN 23 // 11 - #define MOSI_PIN 22 // 10 -#endif - #if ENABLED(ULTIPANEL) #define LCD_PINS_RS 8 #define LCD_PINS_ENABLE 9 diff --git a/Marlin/pins_TEENSYLU.h b/Marlin/pins_TEENSYLU.h index a19ef038b..775837767 100644 --- a/Marlin/pins_TEENSYLU.h +++ b/Marlin/pins_TEENSYLU.h @@ -76,13 +76,6 @@ #define SDSS 8 -#if DISABLED(SDSUPPORT) - // these pins are defined in the SD library if building with SD support - #define SCK_PIN 9 - #define MISO_PIN 11 - #define MOSI_PIN 10 -#endif - #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) #define BEEPER_PIN -1 diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 172014e7f..4d342e8a1 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -29,7 +29,6 @@ #include "temperature.h" #include "thermistortables.h" #include "language.h" -#include "Sd2PinMap.h" #if ENABLED(USE_WATCHDOG) #include "watchdog.h" @@ -1021,8 +1020,7 @@ void Temperature::init() { OUT_WRITE(MOSI_PIN, HIGH); OUT_WRITE(MISO_PIN, HIGH); #else - pinMode(SS_PIN, OUTPUT); - digitalWrite(SS_PIN, HIGH); + OUT_WRITE(SS_PIN, HIGH); #endif OUT_WRITE(MAX6675_SS, HIGH); From 8953e3e9840a852b29e2ef5010b59093c627938c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 27 Jul 2016 04:30:39 -0700 Subject: [PATCH 519/580] Allow Z_SAFE_HOMING without a probe --- Marlin/Conditionals_post.h | 16 +++++++--------- Marlin/Configuration.h | 2 +- Marlin/Marlin_main.cpp | 5 ++--- Marlin/SanityCheck.cpp | 14 ++++++++++---- .../Cartesio/Configuration.h | 2 +- .../example_configurations/Felix/Configuration.h | 2 +- .../Felix/DUAL/Configuration.h | 2 +- .../Hephestos/Configuration.h | 2 +- .../Hephestos_2/Configuration.h | 2 +- .../example_configurations/K8200/Configuration.h | 2 +- .../example_configurations/K8400/Configuration.h | 2 +- .../K8400/Dual-head/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- .../RigidBot/Configuration.h | 2 +- .../example_configurations/SCARA/Configuration.h | 2 +- .../example_configurations/TAZ4/Configuration.h | 2 +- .../WITBOX/Configuration.h | 2 +- .../adafruit/ST7565/Configuration.h | 2 +- .../delta/biv2.5/Configuration.h | 2 +- .../delta/generic/Configuration.h | 2 +- .../delta/kossel_mini/Configuration.h | 2 +- .../delta/kossel_pro/Configuration.h | 2 +- .../delta/kossel_xl/Configuration.h | 2 +- .../makibox/Configuration.h | 2 +- .../tvrrug/Round2/Configuration.h | 2 +- 25 files changed, 41 insertions(+), 38 deletions(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 3ff131de2..f610e0df8 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -566,15 +566,6 @@ * Bed Probe dependencies */ #if HAS_BED_PROBE - #ifndef X_PROBE_OFFSET_FROM_EXTRUDER - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif - #ifndef Y_PROBE_OFFSET_FROM_EXTRUDER - #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif - #ifndef Z_PROBE_OFFSET_FROM_EXTRUDER - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif #ifndef Z_PROBE_OFFSET_RANGE_MIN #define Z_PROBE_OFFSET_RANGE_MIN -20 #endif @@ -593,6 +584,13 @@ #else #define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_PROBE_DEPLOY_STOW #endif + #else + #undef X_PROBE_OFFSET_FROM_EXTRUDER + #undef Y_PROBE_OFFSET_FROM_EXTRUDER + #undef Z_PROBE_OFFSET_FROM_EXTRUDER + #define X_PROBE_OFFSET_FROM_EXTRUDER 0 + #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 #endif /** diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8b5e3394c..53ff21143 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -735,7 +735,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0c7dddd6a..1a3830ac8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3049,12 +3049,11 @@ inline void gcode_G28() { SYNC_PLAN_POSITION_KINEMATIC(); /** - * Set the Z probe (or just the nozzle) destination to the safe - * homing point + * Move the Z probe (or just the nozzle) to the safe homing point */ destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - (X_PROBE_OFFSET_FROM_EXTRUDER)); destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER)); - destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height + destination[Z_AXIS] = current_position[Z_AXIS]; // Z is already at the right height #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { diff --git a/Marlin/SanityCheck.cpp b/Marlin/SanityCheck.cpp index 269c59ea8..6bacb29d4 100644 --- a/Marlin/SanityCheck.cpp +++ b/Marlin/SanityCheck.cpp @@ -353,8 +353,6 @@ #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." - #elif ENABLED(Z_SAFE_HOMING) - #error "Z_SAFE_HOMING currently requires a probe." #endif #endif @@ -364,9 +362,17 @@ */ #if ENABLED(Z_SAFE_HOMING) #if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X - #error "The given Z_SAFE_HOMING_X_POINT can't be reached by the Z probe." + #if HAS_BED_PROBE + #error "Z_SAFE_HOMING_X_POINT can't be reached by the Z probe." + #else + #error "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle." + #endif #elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y - #error "The given Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe." + #if HAS_BED_PROBE + #error "Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe." + #else + #error "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle." + #endif #endif #endif // Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 2ac06d1e8..751417eda 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 7bd240eda..ac526d97e 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -718,7 +718,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 09a97f1e1..9729be616 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -716,7 +716,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 47b72e461..6883b4f7d 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -728,7 +728,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index a4eb3a30d..23d71364d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -729,7 +729,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. #define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 933b229d4..a9d9a1e02 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -753,7 +753,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 4cbf03c11..a51cf5e03 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 390b07e2d..51d932c8a 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 7fe8a6a5f..c4b535051 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index ac2411b67..b3465378c 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -733,7 +733,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 52a56937c..5fe162019 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -744,7 +744,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index b3ac58545..bf990ac1b 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -757,7 +757,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index ad08e0e02..9a90ad9e5 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -727,7 +727,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index b733bd6af..a1fd9aac0 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 673e167ff..6db0f4057 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -828,7 +828,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index f321eafeb..fabcba89c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -822,7 +822,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 50e42936d..c5fda7d47 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -825,7 +825,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 2726e9a2c..7509fd634 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -819,7 +819,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. #define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 7a0ff37ba..9e25b029a 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -820,7 +820,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 79907874f..d77fe645e 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -739,7 +739,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 36f6d3c5f..3c1f39937 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -725,7 +725,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING From ab4b2a66ffaa08ebf29192364021aef9f726c940 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 27 Jul 2016 05:00:58 -0700 Subject: [PATCH 520/580] Allow zero Z_RAISE_BETWEEN_PROBINGS --- Marlin/SanityCheck.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/SanityCheck.cpp b/Marlin/SanityCheck.cpp index 6bacb29d4..f3ef238b7 100644 --- a/Marlin/SanityCheck.cpp +++ b/Marlin/SanityCheck.cpp @@ -340,8 +340,8 @@ #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration." #elif Z_RAISE_PROBE_DEPLOY_STOW < 0 #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0." - #elif Z_RAISE_BETWEEN_PROBINGS < 1 - #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 1." + #elif Z_RAISE_BETWEEN_PROBINGS < 0 + #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 0." #endif #else From 2525528fb2ec3961d8c10cd9146b2e7ec02a1000 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 27 Jul 2016 23:25:56 -0700 Subject: [PATCH 521/580] DELTA should ignore Z_SAFE_HOMING --- Marlin/Conditionals_post.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 3ff131de2..76ee98457 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -146,6 +146,13 @@ #define Z_SAFE_HOMING #endif + /** + * DELTA should ignore Z_SAFE_HOMING + */ + #if ENABLED(DELTA) + #undef Z_SAFE_HOMING + #endif + /** * Safe Homing Options */ From 4f191a384b875cea3e6dfe91df1ea0aa88a5217f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 28 Jul 2016 16:53:13 +0100 Subject: [PATCH 522/580] Moves the font folder into the buildroot --- Marlin/fonts/README.md | 30 ------------------ Marlin/fonts/bdf2u8g.exe | Bin 56515 -> 0 bytes .../share}/fonts/HD44780_C.fon | Bin .../share}/fonts/HD44780_J.fon | Bin .../share}/fonts/HD44780_W.fon | Bin .../share}/fonts/ISO10646-1.fon | Bin .../share}/fonts/ISO10646-4_Greek.fon | Bin .../share}/fonts/ISO10646-5_Cyrillic.fon | Bin .../share}/fonts/ISO10646_CN.fon | Bin .../share}/fonts/ISO10646_Kana.fon | Bin .../share}/fonts/Marlin_symbols.fon | Bin buildroot/share/fonts/README.md | 20 ++++++++++++ .../share}/fonts/make_fonts.bat | 0 13 files changed, 20 insertions(+), 30 deletions(-) delete mode 100644 Marlin/fonts/README.md delete mode 100644 Marlin/fonts/bdf2u8g.exe rename {Marlin => buildroot/share}/fonts/HD44780_C.fon (100%) rename {Marlin => buildroot/share}/fonts/HD44780_J.fon (100%) rename {Marlin => buildroot/share}/fonts/HD44780_W.fon (100%) rename {Marlin => buildroot/share}/fonts/ISO10646-1.fon (100%) rename {Marlin => buildroot/share}/fonts/ISO10646-4_Greek.fon (100%) rename {Marlin => buildroot/share}/fonts/ISO10646-5_Cyrillic.fon (100%) rename {Marlin => buildroot/share}/fonts/ISO10646_CN.fon (100%) rename {Marlin => buildroot/share}/fonts/ISO10646_Kana.fon (100%) rename {Marlin => buildroot/share}/fonts/Marlin_symbols.fon (100%) create mode 100644 buildroot/share/fonts/README.md rename {Marlin => buildroot/share}/fonts/make_fonts.bat (100%) diff --git a/Marlin/fonts/README.md b/Marlin/fonts/README.md deleted file mode 100644 index d41899391..000000000 --- a/Marlin/fonts/README.md +++ /dev/null @@ -1,30 +0,0 @@ -The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience). - -In Fony export the fonts to bdf-format. (Maybe another one can edit them with Fontforge.) Then run `make_fonts.bat` which calls `bdf2u8g.exe` with the parameters needed to produce the `.h` files. The `.h` files must be edited and moved: -- Replace `#include "u8g.h"` with `#include `, -- Replace `U8G_FONT_SECTION` with `U8G_SECTION`, -- Insert `.progmem.` right after the first quote `"`, -- Move the file to the main directory. - -How to integrate a new font: -Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixels per line. So to have any space between the lines we can use no more than 10 pixel height for the symbols. For up to 11 pixels set TALL_FONT_CORRECTION 1 when loading the font. -To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols. -For the second half of the font we now support up to 11x11 pixel. - -- Get `Fony.exe` from [hukka.ncn.fi](http://hukka.ncn.fi/?fony) -- Copy one of the existing `*.fon` files and use the copy for your work. -- Only change the pixels. Don't change width or height. -- Export as a `*.bdf` file -- Use `bdf2u8g.exe` to produce the `.h` file. Examples for the existing fonts are in `make_fonts.bat`. -- Edit the produced `.h` file to match our needs. Find hints in the `dogm_font_data_.h` files. -- Make a new entry in the font list in `ultralcd_impl_DOGM.h` before the `#else // fall-back` line: -```cpp - #elif ENABLED(DISPLAY_CHARSET_NEWNAME) - #include "dogm_font_data_yourfont.h" - #define FONT_MENU_NAME YOURFONTNAME - #else // fall-back -``` -- Add your font to the list of permitted fonts in 'language_en.h' -```cpp - ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... ) -``` \ No newline at end of file diff --git a/Marlin/fonts/bdf2u8g.exe b/Marlin/fonts/bdf2u8g.exe deleted file mode 100644 index 1e51b26567d78d2ba1b5eda6942a18561846dee2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56515 zcmeHw3w%_?z5hA88#q8nf&`5gbcLW%AtV}J3Uwh_gc>9Qv7p!`B%6mWNt*2Puz+Yl zi7Oh^R`0#G5V5_qS6bV8TPm~-j|y6AsntrAwrNGXH2hmyQ=3+9^Z$Nl=Dc!(t@-zJ z|M%g6lbQLw=Qr;;XV1*PxlQwHnijy_+pB4N5b_F%zwiHNBhVQaJ)5CDGvo&s@6k(t zaPi{Wy5?YGQ$tNt#mZo1MSXokJh&nnY)aGz>*|9g3l;@eHdICPhYuf`t3;QDHLX<7 z&>lbV+Kt+MnzjkXbZUe3VY=^J?Me_W#NFxBHlBkp3wIfATF1Cg+N~o>`{jig{;zvL z7x~h(prj=Od2p#fCYJlP9-CRhKFHsVel4dz`U<~xs6V)Z<;SCI;)v%J;13OAUi;Xw zTq|3iUsVyW0ICeP_=7xaQ<$)?khZ)dzey4<9t`+$+y?GxxE)tWD+o<0l7RS7gpIh< zaffg_F4E<%Xl^EG@z0@fqXX%PZlvBisaN=LISOwO2udA9h(caRe(}P^gbH6Zf{yuM z**Y#k7mo?OLBcmGI>BiZl5SF=%!r_CQ*<}kG>nC`tl5*UoGyS{&PA{TbTnXz09k(o zT~VP(ucTcapkrCkKaNY#O`a?uLFV%)=;-ITg9uSUH)W~-=J9W*vTvOLS$_oGR9Q%K zSstfB$MV=n1au)I zYcFdPDrYChlvWgLJ4?U|WFT3b)f&i6Wtb!qRzTQaCMq@wD zkg9t}g-{bxxBmwyP!KM>&&FTx#Y(=W{(7fHQ|fQ&nW}o5d<5kAfVsV7=nkA!%I;!H$NXQ1n4q~XjURFC+$=vqS_KM z1axHSJ^K8?Jld$I{S>ECBX^u39!>p`Y*C&(V?lh9#r)7Sl zgRO*?RKXI+qht15j#3MEZ!Ob>u;~ZlBZ&bKG6_Sq)B}XeWvGu!4x(!Tu=Z&U2?3q+))CwOO8>QN9u;+s-pnk}Z~RQBQU8M?vLnvFcgU~%e;;F0vR zrA&z0aG@YemY=!nK=A9cwJpBh@R`(fDgCEVo(!K!BjP#c^GxbC%An24^;t@pX=Y2$ zMg5C>8|?!I_al<6%_*|4{X>P#C%2uVA}4hfpw9dYBfBQ{=P*MG{1;R2M@@mUIf{PSEXu~KKn{($dC1ENEQXfOlgK{?Yrq;tC!1qVb1X7CxltaZOm zhO<}(laNl+&~UB@XN`vm8#i~X9Xxk9Rwlinq?Ahy9$y@>{3jcAm(tYH7D7Hmn>79X zwj#}GS)Z=0DMa2;I;2Bae2JYxSIF^9PD*5V_^t79S)dJVScrhDEl#t~a`Z4RbS6{f z=`fs{AVJjX!)fUcs=`h?jb4t|;k0RJ1u~YhU_lF3u-&A~vtXSTT>yQ{mf|8?{nfBa+3c<)uf|8?{xAsFYNN_N+lc3}%W>x9fFjPc#5|kXp zoGTqb2pt3^N6`^V2M|IBK~Qe%07B>>C^?F5YB$V$FtU@Ngj;9Bfqlf(j zCZ+A15Vv#$IRf8=bjzWFTRx$BL5w3kEUm6dW|JC|EbnPOy1&z>^N(n|X(1?=0}-10 z$PGX14fou&zUMIbHpqtZaoWAEJ#S-3OkOwd#-dSKNR#!WJDJUPW}>BMR${2g;m%wn z6|B&N9YG-}SPfvJ1cE40lo_eXA_|j{odhWa`2>OyflyNN66Y%tx66e%Y0xe2Ly{cD z3f)craS*q)3>REI)xtWzE5|DqyaxP$5>Rw}LQD z&bL!TU{W%CVkhgmFbETm24N4UgCO4iM_9^wtI`iLO=^|ClWDdsm2O~~wOyqnf*yWW z=>LY28L(=7x#N4;^{B@mdnk_xUH(Z|_Bf8M^vmkEB~2lJ24;7PXKh%3Kx$ zqaI23_mMQxA!#Zl(NUZO1!U$sd_&}HCNWXUDv|4)7yHQhK9=HU%lIAQLeBoqz?K8H z996IG{R8S1vnkOubI4JJyPY_ex?+Vf7H$D>cJ)in6qSSBTx<9cDjg%`9df*Aoxe}G zq&2)JIf|-U%byYEb1`y`irsOiksQNn+Lg99sG%{7VF#JeK0QlIU5QMjG1j^+H#a%| z5DGV#Ebl=1j!w?shg43od=FCD$@$NSf?tMiBQBkjT`8Bw?~aBeR9}_(Ahts=)9l1w zt!w__@Np5jJXzl99Dt7NN5udn7nSHmmi`{IxA`Y}!^c$t6{ZE=q=vsZ#y)X_TBxt}91A z=Hqi<(&G7hxLI>W_>~`ZZrT6i=rLQyjs44zc}FjIO}I1j!E50w;es)ofQI^U!Sx@} zw6>N*>u&i(L`(`Wl3TNaQcN>Bf?x&`HvV+9rE_p=_;jBMLbs!QjwZvWTYn5Y-)lYA z(y3zxtk&M=V9KD%q-Wii#EP!vP}VK|DeN&7_SgyyXNCCt6|$aB5BICkTXm2#wUKdh zmnd#AF*=F8IxSh=?KGgr%JJ6pv*EU2dfq>ifwj-pCAtf(A5&GlBQjS{HRpTN zXik~#%paC((wr=)cG_{qVTW94b+7A?CUH+kSaM+9=hcEJ&^1PwFqcFBPRvwL9nO`I zouW_YpUoY2zTP#Zt?MemEl5vF(h2RH2hH7S&4%Xg6#X~5wa`vE%!oez&O==nwsn0Z zH5Q9|(aDB(im{F2=L${i!EmK6l#-_jBcS=ku8AfpE>V}IIw+-I&D?9D1z>#MT(hyU zw5&I@wW^-4=OWNdGzvY_!^S#=ji|y(Hvu=8?F*%9wy$ok>l_nsyS8P11MRE3Z~J1$ z)s?n~8FZGuSpw^nB*N*bM&oZMqY`xQvp@Dn+|f1dIEYH6CaWxs8g#c!~t zfPagj))NJ(4XA}m_sPp(n^J#r2;!ouam!;ahKT^H#kb&X?sCHbP@ckH1nAeWTeBRk zQAFS*_Br}dEQyf+@A>&2yu&~EQIEHLe6S2G1bGT&|q5D zck3IT>J6W6S$|sJ@XsylPo>>C^+4uV%1^cDBHp@x|H+H=BR_)v zGyNJt;*Hy`K?3Ri(n^iQTm$b$qY~YXQ z@?a3!U`AJQOOG!;uBFExpU^cGEdY-y@Em3o@_!jpcvhgL%9;8IQdcl_9aF=R8pqUh zq}tf^u!RYWyE7kLi%fukPn}XZAb^8KZ5Q~{nGco$uX1Fhj-s`tE;J!%M7gN{^v~_T z5%poybC^k|5-PC|iS`0?2CONas7I+JFdWKntPF9E6-1Yi`nPNi1c?h%zEcuOD3O>k zr9K1X$pqw(>lO!B!sPnA5~;XCXy~csLAOJ zWcjK4K*sD{3Db6Rf|VTgBz$MiMMYCM|F^xpCtud3iS-UCFOL)%J3m!IWt`)su4asT z4JX?bL&Cw(E*U1KMv|f4qBt;g7q_y?n~W5Da~dZ|qe3?Vrrk!7aX0}0Z?8t$6fv&+X|XzKI`G!zUK zEr)XDREJNF#B7sB0->^EAS*jrA()0N%IVF7yg+V*~;s1z!?9Bq+PJBerm4|-HJs;E{A%elY9OV|ev zW&S2a+u2E}$?cxEIE12}sPrzTS@~4@F{W7sReB54tcWVTM&Qv(Hg{lY!kr$4hyc-* z)y^#*1(^>Byh5W=vmEisj`(Gc_!z|D1jU^xQdugcJLvv+!j^l|5&xMZ{v${Hdx)EU zNA8cI-_H7#~D>jM!WubYtgz!#$$FP;%)a^2A#xtgfM=%tXAM*6i;w zo_HGwk$B?QjL|59Q)c3clZ_;wRHT|~T626wfmeAR`V}uIlw+I6v1dL-*a4h#;V5| zT@^xQ5XNRw*BCa* zZW45g&H|5+q#h)qk#Tao7@J+fcFU@`t#2P*b#UnOxrIGVVHZOfs|FLQARg&tlRlf3 zUnf_W5{x=_4AGWD%gmL0dl8(3HhqDJU?qiQd*>swFlP(wWQd_d&D+_9@QJ_VFrPln z5!6XGezk%rQjq(!857O5eNe$d_i0y$&zR7msXNejI7X%ur}1bbH4_iPkjDwgKEpg+ zhN1^YI;h~I89_RS9S#;){yVQg8{5PD`bB=z#cMcxZ{P%ht1#~rx=xOTXOS6^S$4wA zXX6ooQsB2daHHfVqz;3w>nEU0kn&eZ^`ZRh5J8!j`Yb7*0%bEP z_joB^k(9ZqW>Ve_%0;AnKvIrTKBM+8Ny=bq9&jhiVIGKAkhsE2yj~KIPK_pUo+OTv zxX4RfCW&)Wzr%d{SW0EY|M&E&uNSt8eqW8-7{%Ml$eOreT&3Z_6Fj zr@xapCP{T1M_=6vBLX;Md(tD^T3Euyq?x_Foa==Gn-wg zAMoSo)W5)iaPDZl#HajPz$%n_81U3*@JGEUXT49h3=&FP4?=t{#bZZV)H(9UbIV$P zg7J27>knIFxl2-yf*r3u(#6k$3~Hve^aK)DfW!cCfG-YSL;aAL1alIsNid>QKd98U z^n~I^!C0_0hE^AobCHnJ33zTRD#28tCyVkOqQRQ^>5|+Fp_1W6siSFd^t#-OwDtqC-4zer;XJ!`8>tN%02t7u1Tl*5!6ja;62W7L^v$!Ut zP2``Jp23IHh(%f9HITEMe-6#HW(O zmm#)yIg`(4Zu%CGdr6rrHpEi#I*4sKn10uL1ZK9h0H67dMMknYkQ~fNl9pFmuys5iv41J%b2)9ONbs0#K4UfM}_G=nRD(DY!X5xhU|h05Dtc76KpQ zU;oIKg9f-qZ^fPB2BxHLdKo1dL`mkNB=cGhO*q&lZ63M#<;0hh#duL9bJI2OXIFdX zH_?lPv}$Dhn?G4Q=&l#Ah0=T33*YiV)m^_KO8*NqR$HHnc%B#%lt;xrk69n z@dvQH#MfF{{~)QsN#;fHRP>OQPB zogGN~+%mY4C43QTa&=qpQ32Un7D$Eyt)qy=bm3&nq4akSs`p=Wl4G(%DF63*yvT#3;t(ZCm zoC>~!g6{3Q&-AY_h&7E9HMp>_n|>@YqU(CopT_i`#xH6; zkeqFRn}s3NjshE$Dq+dFM(fAK(6<{IGHHH~IB2?F2k%Z{|Iw~D)OgBKuA~Wroj-o7 zIi!mEAZ&%ES`h(RqEpE`oJPO$N^Mt?zlZ*WK-9KNC7S;1PhR|=Q$Ez(u7^$Is+5Q$ zso$VlcWpE4aPRmcj0J6Nz2g_FaE1z}sc^0epH$&S6|Pg^ause-;bSUnRAGqD$G)0whAYx zFi(X673QiiU4^4nsHreVgz{bF)X!d)GwqRReP2cVd5*@ctv%OTBYK&);>O=V@IIa0Oy%87;fRk4^B zi8MuP>YC%xrbsn@#}|#%)mJxYg7CJ9g;z#FObO_yn7gC^KRKlU;YXxU}jiWO^uG*`09Rk7|}K53{X3Up?$Kr3EQwshgV>*g-j<}A2jv9@U5&0#HkL-B%=c{g0A z$#N5z*$c{VAZ+%6CED!SxaTdNKdTI+CB<`RE%esa8Nt~lb0YI+Es4wx3-L`WwACxL zhD1D4-59(Wd&=ddr7(S{77Wg5sE^m9eR&NVX(O4I+hy`Z_=Zb0% zc-4g9rG=L|(t@!fR+)&=Ey4K}Yl1gb#1g32t7neCvMN|B{;m;!*NVSYGEpT{@DN(H zK)^W+S=Xg;!PyOodeKN%G^`2oI*UxQfT!4D2YyJb>=2CN&snWd{AG!zsPGD?rCmX3 zanv#rl)>N(7v zNz~QHr$yo@EwrXvgXPn%i?H%U7KMu!&s%Uq-q`WYV=qH3{}jtaTYn9tpx;7|L?P&y z(YwGF)x|*is%R5>@8GJ!{DMOGZ+vs`mWi=oV?|B$R>TrktU1_RTUQ+?a8WSP*cfe^ zXaQE>hubxE^~6Qd9AMTh6RVYuTZO{vx>!_1Sk;24h>eLjVM8^m=WME|M}H}Mh@o0t zJt)v4g6-1r&6f_ZMeAI#Hje6wZnvVUswvvs930;$>r;9C?ez_->w}HW(L_~4uqhgA zsH}+BH2~7o5O1h#hy~%pW&&V53oRHtJI@OA@y&I2h>VH?rjq|A7w2}o^g9-6`Z`1Z zNO~Z!1(Uu!z_?q~xxKeHos+;>8Agk*I3u(oqX>UXGiKng@0E-hKm~En#eHZ;Z*Qf8 zw!jx2nqka3m=TyWEDLz<=Vv|9+l$vtG_5!zNZ3Z)qx--f0W1$NY}<;9bh~ipI$&qB zI|w@3ZGbk3kalnO%^sfSTQl@~$lEMDjtBxA!rcg(VuTh=LXebzM9g`K>gyNE=Dh~I zc;s*MUQg)~N1xOHf2k8+Y2%jxUJv}kPQ33yK|tB-aQ_ncA}7Al=6@XUKLUS_6Mut^ z-v{`wflqVdXW97UfWHWQffFCI@n--(4*W_d-d86GMguk)WqjGr-d;W-v3%!SVBu!~ zzYO?ST==6Fp6{<@J=xofH(71|kK6j!0Y41*^PTu|8~-@)0pQm-@xHhve;@S&e~}Y^ zi_L!=_*;OV;>0)E_%pzN68N+Ee>65*HUn?A3sJxPhE56e&kW!{`T5@7E1dFcZ28N8 zUkALa?%iqQ*8#sB__NvnIPjkXewK|uSC1AopJdV33zPpka= z6NUY`0G$DT+`snr);syb_xM`^zRH8Mo)a~Ra&rBeRtLIyPC8#$=;0H?65t;K{zW!q zvmMU4*MCo-CC&fc!4!2^RZA@hk~rw|ztY?LNyIJsk`}+O_Mjjm&10bX)Zd`l2bv?G zInh_n8&VE!?*z@3r?I)}r17n{e8dIsN#Ngh;eRFYLBN8*f90#ay?pfIvh@L5M+s=g zeyz8+%t_-bwRBVgzYzGd^%I+bUkdypS2-;Z<-|NZ3H<$E@9llrCI2N${vqH$`b_`* zL@szv0AB$7Z&2ROJotaYKg2OI>)`V98$! zd<=N;^w_Ki{#+{`G2r9)WB}(Xmi(1MywHC?@SA}zclqH)!Owd36!6b}tG9O$%GBaF z>)D@?7e_s#J;y=chTo50hPXu^we{gAsMe8g zq3QQv8S+pp7^UKRsnUYpEYf1mcNA==!2cNep?3-DXc(nHOCut_OcDcqw!AanydVEw z|6@2%A71}OJTPOq*<+w>S0Rq?Ry8_crvNJgtiS6J;Ky-ysf>^;C>x<3in@d2P*wq2JUll2XRlpU4;9ixaZ(5!@UIe3fwW=aop>0 z--G)B+@HbyIow~s{WR`paUa6{67HYi?!^5Y+}*hUirYY*&S740{ZGil54DnLEEM z59#?0Rf$-1Zbf}nEIJDv31MWIB^T0~_H*C7dT6VNVcpwTLB78Vz5&CbYO9;8EVAlj`r<PvdSJgEk^V$NLuI3l#G_4Y;=4d=p(byP?uWbaRRf}-nx+$(btVJrL z@Q9`j)gyHcEAZtDJ<@>9YJk3^lTFIF&R4Ob0rWTcup=hu%Mfd*!<#rhxE*^4Sa{g|7tP0DCrg|Et_9n^#pf#ZAkYxeqVl0qn0mJtg#^GyWHP;QWon+GyORZ6Pgy zHyA&>{&#tR^K>p_%_sa%j|^!&V+G*DKmQ9nu<2Z@{PpW@C=V6~i}I)D7ic;jFsUc! z#aA!G)0gW$zHDXl+U8|=rnIcKVP$mL?M)Sl=4H)ImCNuLXBnQ3$C{V%In*-6sj({U zQp1WbFgQ`qISC%lV8)~Qe1n^7F_#Luq52>(jq!69mZ;W(zPl!1jUR|K#+x)>3*)|V zNLEt9rYl7<5Qwa(z&y*hS)z?Vq&iknqxtTU_;jT4#7XnrE7MtE$5e^peOn|b8zK_b zc!Hz(S|ubW5Q(pBtmb1W&3B&^JX%W&Y(QKe z3rK*>YMRU{6N7a={*Q3(tm!*+y6C&OdFh74l_h}syiV}jxVe#_e-l|9QVB34zHP|8 zZdjfZE*mPDKQ3m8`oHO9U7H;epRm;n(ZYwwC&ilnZ%p~NX+!Gj`Pu~lQw1O}tWMK+ zi~Mhk4HJ*fB6uPw-jvYvFH1x%oG=|Wqy=VzDV_cp-Wb7DIWD}a>CfpTq~_hY`P4?w z&>K+%P0c3B4+RO)-^JZYl7FUwd^JPUe<-cN6CAKbo0>HJRh@K)aOXg@{yoyJY_0*q zB+UdVALU1y8!IXyyMujv!_0ofw?a~h^nccYN z<%{s;kjRQyMg8rX{%0YA?9brtpa?85g^2e|5m`z#CfIn0sp&&>!9<2F=c2bI(?5Y} z1oRFQD3G*))31^QL>8SF z(sl?5*mxWP_5@ru*;4Fai?9}GdPwq;ZxQZeD*U zA-1M3keuXd#hry*>W_jmJ0ZzPA>AZ$f1@RAln^GH$r4>B^S5!&rGW2IHGFk*AL?>G zz%FfA9c?PZlWt94uIuD^J|`qTB(1MV)3kGku(~Zbm7a@l}Ex8fJJb$ ztf5)c@7Hx&+>Lt=bNh8LQQrfmKJ5a*gr&5_^RTXye(L!l@d;`DPvFU}h8YiwrjN#c zt}yapB_p7Xl!}|f>Sd`}tMEjq1{j;*nDC{QOdGNM=HFmtEh|ek!nkH>u6mMvX zT88Y>b@Hsmy_|e^S$w-pzU)Tka+iJ+yyDvy&^{t8Ss2AC8*f!;`g^)g_MsPqw8tny z;>#P+Z$<^daGy@(H6ICSM@gXEQQNRuy#J%=SNe1!zlhs_BlKx_{4^Spi+n7J(P&O8 zCTq8uV2`ZgHK3j>s7KU*Tt)(*7N+BUWhoIKOOIWg|FRTFFw)D*NJw*v-+V22G#q7llKmlX9^Xq~eAUhmf_ zE$xz!wuBOIRT3MOkQgO?QYA#`nu$j3LRGh`5|vR^z-#?FMRnnBqd3_RvF){FDK@?| zeYY*qP1m%G#Bh}96wZ0FzCnto z=vQ!Wq4+A$pPQ{Aw!ySj4hI{Qk%1BD`!=dX?Fd?Om$D?Le0`mI!;qg8Exmg)M6N zhO(xAN1otn2?g{d61{}tM^F@YBg5@1z*$>w^?4GWB@l<#(8bDQs9 zYWg3Pj%6dv6~H^HWR_s?t*OA<-YXkcMI+cm*YseTPNiSPy@QIgNKn@-k$GvN;t@Hj z2=hP^EY6^1jnI>qwiOkGQ`am^-s&)9O_lVdD9)Hr5qQM`e!dENt(a&k&pt5 zS$A0SoMZFN z(Rf3|nnTYQlTA?Y1Ks09yJuyi#7J|zqA4B`*0hQ_7s&YOnjFr*j4W$bD%i}5De3Ri zdt|OUKrisDZV~yKsir?8Dg(sjB6k7}U0g0aYa;SYL{s#WcyAbQ5j(2>UXzNST@mb+ z=3B~|en@m^%ricTVX4N{--Ppv9il*fWM<*8m|l;R)EENkDCyJZ^t~X0Fn$+VFbx`^ z^8LJE`if*ickbdltn;`8^5LT@bypdU5S9jI+K8l%;ZObkB)Vq-9Ly=-Fmkr06~yNOxm zFCX+*Od5Vh#YIzS(Y$KX@bf2vCdLI-Wup1X94A^@e9A=g!!-h3!=LR$M29R^OTRTK z_$lYU6jUOperHncFe{_k17b#H;`seHA;H8&rc9O{6957^yqBN?2UZAA2`JhNwe5}5IfXM_?g-1Bpg=c zB22$TqxRwX3VLb!ypaxt8BRGSMoG$a8tK4ctz~hg+42cTmg6<+A2h8%Q4LQxuK#uuZqUTl}ewdpf}9_s|qJ>zWY*QOKj;q_n7 z1ALd+r$u3yuD_Qt9Dj9G0S&iadG(}~{MFT@6?OHK^7AL*hh~%TTVV;j>dHytK_L;= zfAwQG@#{4EXSdDqs=9`J%xjtZG#{UN`FH60%w{(t@~3~!pPoPSt!;_jOABYV;4X}e7Pz)SJGQM_dSy*wn=$1hJB&%&t{DH?QluZV z6NNx--)=13=Fc+n{msE0+l+!8OE1~o0BYmh!kOC>OABk3?gg2U__;ybpZ7#|FP&Lf z+j4!&O#hJl+HG&$r0jZlX<_Yl#Id7}KZh0cp~6oy`4IoS!$03sh}c8M$hYu?A(^R1 zi4sJ{)e2rGKgi`G35@c*_5@9^A6(p>4Z;`6C+?*XNhkc_9g-bT9BeX5QzUEKKs1XDXI& zsqlDRjZrF!Lz+I>tO$20f|G?c1;$t=c0GD|E~2}4GvUAEDgTf*{~h_46f6~hU4Z%q z{bA6f1>H+``|mg+*n@+!r|3%G7DoxutLb6G060-e@J!hBfbgQJHGmmzrtYQux;}Rm}ui;jdKcXkL`QN zHzWJC*Ix6lmFA)G4>iv5$DcLHGC@|ebm`8>@_qjV~Lk zwj+irD*tXb>WnXM|MfBB*wUrjQ@>ul!#8f^%qwz*Lk2xN$p5uFji;{l|4<9wR_h<~ ztpASSJI1lS=thP#>LzAZu2+cwE~&FbMD@@Z^!f7pWnd-`9$Hv#!`VnRr~U` z9h+d3vEA5?+UARm@?D+nyLuErOkR@B2>xHrzs4lrxSZYoA$QMwX!ozi74Aikn0P+% zRswxq+tLh{{;vkBi8V zCH}RD%v|>IamJUIF7>DTa&lau&+`G34*hME($FO1QU;nu0NWM#c?>exJ-A!+?m#Ek35x6pZ0u z88;ZdCgKT$Az$`kSVD4TgUZ@r1$f9SOJinC@0EhVRO_!EhKV9m|1X zx`^BQm>#ZR3^QfiVAvw!34`G#3Agkyy;;E+-Yeqn#I?ffy#AAr)w40)O>%bj5k*4pG_c)p0+ zd`w@UU<^mgxWTYk#8J->mPk0H$&2Z*f-$^K#tnw|h%oM;qwx1@iF~^f-!ti#tnu`#hNu?FuYmBZND&m zi-Iw{RmKg5_u-*D{mC#X;x-@C_bV8~2V~q}*dyWzgW;bg+_IDDzbF{PGcs;4oP`}U z>SH)t#BF^{7b_UUu#6iFhoeI!AHxh0xA~aPR4|4kWZYo5LBtaV!#gG1vXkkJ3dZnm z88;aIPQ()iLq76yws)p~uV4({k#U3JkMS6db~1cL#BDp7epSI3z9!=a!^IdR$j7i; z#BDyNZ&EOZOJv+&cr|vr$j9&+5x4o6o}pk2KPuw}!yk!w!eGeLS)BP}`o{{!@KqT% z7+#Dw9;lDuSP{4NF+EPf7><{5gW+5ePZ$j6Nw`%GOn*$l7?#So!SG+O^G#cS z3@?>&gCUQ~qhA=7inz_k^n3+lxIo4YhU-K;VK7`T;g+3DZ%{CX8)e*J_#^z7g8CS~ zEaJ94rhlwp3}2OTgW+rV&&BVkXaja0Gx z+bWwFwexOzm32sZ74L4?&kz(Jya}H?ZRY(f{^8o~yC#j`JRgv^U6ApBtVPk-b@fU> zb}NWa!%xZi;}iVq-1IXAg+Rlv>e%)920*%9kmZ0>pondn^?*F%f+PXif@)>cdIY`*fczt{ACw}tI$8YAm;&6in)o+ zl?%v)n045YX@C^CAaek@0IxIJGz$RA>Divr}y6hDQ z{9%8af3#*SOIYS;mV&EUgHH#o{0DT!+w=N za3iT-p9VRTTqI@>xeZX+L&jsx&56doWA%9u@bo3J1kW~7Urr^Lnx!0xMAlSA?hs=J zItqASLMp@#pM=nqnc!-(xU9M%bkXKFK|^Z$GV4YNAbPGpd(65KLXD7h!&5c1{Nja+ zbC;BsaBLFx=*$3|<+v10F)?SQQDf7S@Ggti-=7?~)f7v8elZSGs(mS4H?z!bT{fOE zMKg=>v(i9U?#(yfj75N$8TfT~p2(X|npv}EaWt0p^g|>3Q*tv${j=(lG_&a4v(W&h zu^yIzfH_9{;$PhMW!A%g0!Y?F2(F1WtZ-CBvu^CTRF+b|<*ud)A;^(+!|h{gH0ws0 zRW}HAU#30n09*EmufEs@eGq#}Am?w@Rok9^Y*sVsFIx7**N6|u*yf;2<(&5K@sDj! zKf2VMcJbfgpMSUPsccL{s-qQgd_lL_Hj2OKl=cMi^I{P9xx6+X2Zg)aG~4@JVE&d5 zZJWLMqH5N|V^%$!hLqbVv)m5=W0gC;gp{tXbzX3HB=GA%5DJH`o0^UuJ%LB;ONoCEB#`e*vadl5Rr z^4Q}@xl73O*qgvekKx57&TedH388yoLgy9lQ#Ts(3#U#g6kj(M^;vMe1g4|?Fsg45ADjtB%;>TB@Dd~kc}?LL_j)S<#jzERW6zcAdM5vQl_AdfN1$9#Ot3N zxS;=b@%Q-0(yj-g#(S|$LzsxNR$v~Ezl_BB#xoMf32_i5T}U8c=DL@xf{%XE|J zF`cFFzW&j=wphB{dYJO)vifJs^VVF#lB4Cu&mS3(c78U(t^G-l_D+xXpLnz%9gy~?JlZ#UwD0q1zsIBf z*nqU}@@QY@(Z0u{eVs>p=YX`|@6o>8qn$G&SLsaos7HHhK-!=2Xy-S7T)K)5d9;7V zqy6-Nv~%CsrEBtI9__Dqv_I?7-ZLQWk9)K?dbB^~(Z0f?otsi%$hw3m7Eo;4utogVFcH_M&((;n@A^=Qu-koH$R z+IM-hpYUk!^k@$bNc$0w_QyTik9o8o@@UT+koIF9?R>!4fV4m9(Z0r`{TYvTo_*rhzGOh!`OPd>9h)5UXy4`0zQm(_ z`GBlR2%9*Cy}*O0CG& zrRvXPW-fr~dwJ$;{n4mBMr)s>KN?xbuFN*=(HTRQ9GBWlDY9)gcUK%XtGw5}Pu|VF zo&Usq6`esogrED{t5of)!}R>wX{Mes>xRxJ(eBHWuMae%4w;gzJ*%K;j|nMS28FJ6 zF(u}iQSUHo%Lme)=h1F>w3m3aciS|ouI?I;_5zRgEL*ZHog%JE+<8C8llP|wq`k$b%%h!e&nSCT-uDbhd#OkJ1dsMwkM=Klw08_h`&^IqJdgG&kM_qr+K&uKd#*=& zz@t6n(SF>fQJz0KAnhd{?YXvORqK{}wBP5+`>_FOpWxA+?$JKiqa8ot>{IJH2c&(5 zNBd}x_9Y(ei#^&?1JWM!Xy+D$t92L6@Mu3|)2MPkJs|DVJlbMzB_DIdEfj#c{j(w|HOP1 z#jJdxaQj?lE(*+2exLEZ%&Z$a-|TW<=JU86R^BV^_k{83LG#fje+k8}>Ch56gW3ZK z$1gA{$oBw|{t5Q`-19%vhs-6PMOrrNtO4%I=y|`lA0JZA>sG#yQys5U_L)PHCIygXu>90YI92pj$g zo8<^gNCcnd;#cT`qUD-21_Ugw32D7}-YvN<1!PB-dfojv7Z=}&T&ygVTnlIj zE~X^p6M*0(dQm2jBaf8QJswrfSCQfgz#M?IewWr{XHOyakJG*nlu`M%l6nbK+Kgm z{ERm(W06YH*1@Q__?y2DETC))`SopHww!uGkS`l@FCYZ~+FXwcuAqbFtAMayvAKRA zXyhA!(&k@yAisA(q|JAT_gih7b-ami%ql_FaK1EIYeA6EMu29TtG0{>WRHtx3LtY` z<+T8iLoRPD1Eka?habh=<&v`wkUcJ%Bp~uadFgm9yiXrR+!LTV;?lJTkQZH$?*r0l zLGZR14{Foovp?2^i2Tsqs!l8e?6P=OX}2M70 zO9*~iZcCm=NT$yL`2-;HxiBr{6$2#TqWKgc=E_CVJPe3j6Pa9}2Ly$q+2#ICKn$0h z?*n4)>PtDV0}=$6ZQ%(((p_Bq(6?K%fhF>jmVY9Vs#q)%ffQ%$Jr^`PEE?j*s)ejC{odfOPiMf!m_Y!t^_2@Wpe`{nig`jrVW79x+LF68e~k_ zBaa8vdSAX_Xs5p~4hMprKOfySKEN}G=W;;t=kQ}RX5n(!w;X4sPD zCmBVbVCQs5I{G@8&1Nqpj{+puCFcr2cDU@h8jv!@A-S$2jd(iAoXUQq0u*Nbk&r5( z$F5N~fh)Vf9IZ&ruZ{CkK8)b~;>i5P%i&eq<~V5bTo&E~$Syml>d-~`wAA$cr$Mv$ z=T85$17g0-D|4|MkO?lydja7kZRY!;ILfD5K7ThQe;+gj7MJQ1DvK-#`HzF9)Rl{r zOEPKx0!ZA>17(U3%!z8sbSLvJ!8jhaQW06XEJmnUPCK8bcW0ru1 z`IdRVR83>;@#1Pgrnz!)tD>>FVt_ni*$iRY9e_OLg7Ew4RANj17eLHaq}2W`Kte8E zF95RKCFduAbmlut@NGccW88ayXfCcH8PElwtl{`=m-sUD2}=%-4Xt8tgVM2E!ANkG zxa5ol#N2C=HqQVgWyygGtrU<`79^q$;*@Wyn6;$>G|m~CJSudFRXUW@0Gf4{b}>W4 zk(~uDnhl^iZRsM{!+;!d(fk`Ayll^R0ur+%6Zcy{x-B^odH5*uMK_u@`!hi}$?5s? z2)W7$$s+_#v~|q_1Wt8~Ad3V|$U(Cl5YC}&u6jV8aap(ykVY5eK0uy!K^_C7%7R4X zVXfMlNzPn+0W?L>W%nd|0Ff7RD%QCW(dYUBXacUB{v41smM)TaQL+mnYLkmA9j*w1 z)~bj6z`GW7(VWjZ=#rBUNC>xT%j%%kX_L%+MdTr|TF8RXo;lz+?SfPSV!m}RYi~0k zn_Rm1ors_d!nwS>=pXzjPXoHo^=;4)YM0=vlvC`i8^2L8_(RzMxX@ZO9d_YRz zSyfx)am1S8l3WOyqb^7Y5Eh~BjR+tGF3Amm6uBUG0@7*8iKvr?<@-^nEtmtSBbF^1 z+WaWErn%(&D$M&OohFp?|1Hy`D&o{;Z(&)11 zQgXRw1y=zQaCzfKK-yf82q4oSS^D`?NaaUsvDoIBf%#R@6^R-Q-WByV(PlGQ#}9X# zs1+-kqN~i57>*PMRlx!`@Yw2z_zEj$L5p~pL!uF|n)*Z}Y962+ktb?5g^D!sQv@gF z$Ls3n<981ZkZmPIhv!D-ESxnz9GM-yZr%+T0Rj71@xn;yyhV#;3O}5{2_ZFgIKH7t z^5`9_#L+faUry$nYg%9uQt5CgA$R3H+LQvs23oZyF4pTqh*5a%&`3JK5g zfIXGs!FejmV}n$bhvC^#dB7c<*5}|l0THLqNu2v+xd@LHAa;&Av`qjU2eL_mehycY zgw7+=1jIW1Or-3y&Lp{YvYAMFjvNzEcv_x)BU1C4&9l8!(maPtB>SA1)fdK7uLNvi z)IPUL0IXB0M9Mt&+M5$e%KK@>P?y$W3+Vk1JwjO%3sAC5mzi#V;(sVeve4sb!18 zv;z}H!2{EECm8bWJUb$rP0!OzjsJ+_r zS4S&u&qo)&3Qa}!*~K_`su{oYgz$d5a;X<*PplEu41J?o8H&avPOW04b{r(6Y(;NS zierYttc4*|I5hwAdN~qRh0UP}jTPet2PT<8W%7-QXwzCz^XU(D!h}#LPHT~8#lT{= z8_NeIH9uD>PS+3&{hTeNbS;iG!^WFbi=d^87ittCyK-5xi_wzm zP<K@-QQ=xgtqF2_b&jsRuLHz#{{W!WKa#T3r3$* zRKky_!F6a6tPea#DAG_(?^NC%!D$~W>*7SvNoIM)S&!U={H1FX4*Q~rl@+%&G~sNI z6*$&89$gt(6>Vxpre&j`o3K@FIUk)8A$9#g$gXs2%p-tg)8oo462ZGrjvR}&A~%2qA1bc%02C-bd)qg=8?!uWqnLEK%S{Y8 zLa~tdw**;B5xd)CxKU6uZstSeN974bDg{V@*TuU4ars|8MKjI=p$>TmZ zDxR9a@dPp3SM0W|Mk*=>K9?hQP!zM;^{_>8OhI9z!ZkFzYMSt=`V3SA=S)>pq5fJ8 zRqBMbtjo-{=pQhJLzTd%ipA02qQVL>st;?Htv7zWe-{y_2Rj_1j;2!Ps3(VDXZX%(HxgiO~!5 zLwC_j152Y7tD^n%<22EE?wgV)cJ6Hto5d|V%|3OQ)yH-R2QByT@=sofRt^t`5*S9?6OocX%=~kBxkGMY9;ltbvMymvF7xHBl+G<8R|Cv0tiEYX4i9 zBZf!woWB0%O46NnGnd^BCq`nYU5Uhe%Gpw_GNev1aWUJSFttycca3|^i3W4nd*7)D znx5m!9cI?V<9%h*-5j8p*V>`I&su2PKy za=ht(f+KPLW>}1@R++Err;Ul@?W}5WmOj~Rg|4FJ%1_O3`c6-Uze=J!w9VUQG5otu z4;5|`hN@xs{dza6Yhk9&KD?PT6b!$%o2{9$Ytbs6Cy6DNtm=toE(%#}vjXe*r=nM#caD diff --git a/Marlin/fonts/HD44780_C.fon b/buildroot/share/fonts/HD44780_C.fon similarity index 100% rename from Marlin/fonts/HD44780_C.fon rename to buildroot/share/fonts/HD44780_C.fon diff --git a/Marlin/fonts/HD44780_J.fon b/buildroot/share/fonts/HD44780_J.fon similarity index 100% rename from Marlin/fonts/HD44780_J.fon rename to buildroot/share/fonts/HD44780_J.fon diff --git a/Marlin/fonts/HD44780_W.fon b/buildroot/share/fonts/HD44780_W.fon similarity index 100% rename from Marlin/fonts/HD44780_W.fon rename to buildroot/share/fonts/HD44780_W.fon diff --git a/Marlin/fonts/ISO10646-1.fon b/buildroot/share/fonts/ISO10646-1.fon similarity index 100% rename from Marlin/fonts/ISO10646-1.fon rename to buildroot/share/fonts/ISO10646-1.fon diff --git a/Marlin/fonts/ISO10646-4_Greek.fon b/buildroot/share/fonts/ISO10646-4_Greek.fon similarity index 100% rename from Marlin/fonts/ISO10646-4_Greek.fon rename to buildroot/share/fonts/ISO10646-4_Greek.fon diff --git a/Marlin/fonts/ISO10646-5_Cyrillic.fon b/buildroot/share/fonts/ISO10646-5_Cyrillic.fon similarity index 100% rename from Marlin/fonts/ISO10646-5_Cyrillic.fon rename to buildroot/share/fonts/ISO10646-5_Cyrillic.fon diff --git a/Marlin/fonts/ISO10646_CN.fon b/buildroot/share/fonts/ISO10646_CN.fon similarity index 100% rename from Marlin/fonts/ISO10646_CN.fon rename to buildroot/share/fonts/ISO10646_CN.fon diff --git a/Marlin/fonts/ISO10646_Kana.fon b/buildroot/share/fonts/ISO10646_Kana.fon similarity index 100% rename from Marlin/fonts/ISO10646_Kana.fon rename to buildroot/share/fonts/ISO10646_Kana.fon diff --git a/Marlin/fonts/Marlin_symbols.fon b/buildroot/share/fonts/Marlin_symbols.fon similarity index 100% rename from Marlin/fonts/Marlin_symbols.fon rename to buildroot/share/fonts/Marlin_symbols.fon diff --git a/buildroot/share/fonts/README.md b/buildroot/share/fonts/README.md new file mode 100644 index 000000000..ccafbd777 --- /dev/null +++ b/buildroot/share/fonts/README.md @@ -0,0 +1,20 @@ +# Marlin fonts + +## Author and license +The original author of the following font files is [A. Hardtung](https://github.com/AnHardt). + +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/publicdomain/zero/1.0/ + + - HD44780_C.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) + - HD44780_J.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) + - HD44780_W.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) + - ISO10646-1.fon ([be79235](https://github.com/MarlinFirmware/Marlin/commit/be79235ef255a5c42fd385820447ec351f23b9b1)) + - ISO10646_5_Cyrillic.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) + - ISO10646_CN.fon ([6b1b718](https://github.com/MarlinFirmware/Marlin/commit/6b1b71837c98ceab55db7433357a13cd829d1ede)) + - ISO10646_Kana.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) + - Marlin_symbols.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) + +Any additional changes to these font files being distributed with Marlin are copyrighted under the terms of the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt) license. + +## Documentation diff --git a/Marlin/fonts/make_fonts.bat b/buildroot/share/fonts/make_fonts.bat similarity index 100% rename from Marlin/fonts/make_fonts.bat rename to buildroot/share/fonts/make_fonts.bat From 83d0d59303966223ced66f81beba29f29cacde93 Mon Sep 17 00:00:00 2001 From: fabtopia Date: Thu, 28 Jul 2016 19:29:07 +0200 Subject: [PATCH 523/580] Fix for R.D.F.G.S.C. with MEGATRONICS 3 board The support for reprapworld LCD boke the code for the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER. See Full Grapics Display does not work any more after #4408 #4439 --- Marlin/pins_MEGATRONICS_3.h | 80 ++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h index 93599781b..a671e9a18 100644 --- a/Marlin/pins_MEGATRONICS_3.h +++ b/Marlin/pins_MEGATRONICS_3.h @@ -28,7 +28,14 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#define BOARD_NAME "Megatronics v3.0" +#define MEGATRONICS_31 + +#if ENABLED(MEGATRONICS_31) + #define BOARD_NAME "Megatronics v3.1" +#else + #define BOARD_NAME "Megatronics v3.0" +#endif + #define LARGE_FLASH true #if ENABLED(Z_PROBE_SLED) @@ -36,28 +43,28 @@ #endif // Servo support -#define SERVO0_PIN 46 //AUX3-6 -#define SERVO1_PIN 47 //AUX3-5 -#define SERVO2_PIN 48 //AUX3-4 -#define SERVO3_PIN 49 //AUX3-3 +#define SERVO0_PIN 46 // AUX3-6 +#define SERVO1_PIN 47 // AUX3-5 +#define SERVO2_PIN 48 // AUX3-4 +#define SERVO3_PIN 49 // AUX3-3 #define X_STEP_PIN 58 #define X_DIR_PIN 57 #define X_ENABLE_PIN 59 #define X_MIN_PIN 37 -#define X_MAX_PIN 40 // put to -1 to disable +#define X_MAX_PIN 40 #define Y_STEP_PIN 5 #define Y_DIR_PIN 17 #define Y_ENABLE_PIN 4 #define Y_MIN_PIN 41 -#define Y_MAX_PIN 38 // put to -1 to disable +#define Y_MAX_PIN 38 #define Z_STEP_PIN 16 #define Z_DIR_PIN 11 #define Z_ENABLE_PIN 3 #define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 // put to -1 to disable +#define Z_MAX_PIN 19 #define E0_STEP_PIN 28 #define E0_DIR_PIN 27 @@ -104,36 +111,11 @@ #define TEMP_BED_PIN 14 // ANALOG NUMBERING #endif +/** + * Controllers and LCDs + */ #define BEEPER_PIN 61 -#if ENABLED(DOGLCD) - - #if ENABLED(U8GLIB_ST7920) - #define LCD_PINS_RS 56 //CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 //SID (MOSI) - #define LCD_PINS_D4 52 //SCK (CLK) clock - #define SD_DETECT_PIN 35 - #endif - -#else - - #define LCD_PINS_RS 32 - #define LCD_PINS_ENABLE 31 - #define LCD_PINS_D4 14 - #define LCD_PINS_D5 30 - #define LCD_PINS_D6 39 - #define LCD_PINS_D7 15 - - #define SHIFT_CLK 43 - #define SHIFT_LD 35 - #define SHIFT_OUT 34 - #define SHIFT_EN 44 - - #define SD_DETECT_PIN 56 // Megatronics v3.1 only - -#endif - -// Buttons are directly attached using keypad #define BTN_EN1 44 #define BTN_EN2 45 #define BTN_ENC 33 @@ -141,3 +123,29 @@ #define BLEN_C 2 #define BLEN_B 1 #define BLEN_A 0 + +#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + #define LCD_PINS_RS 56 // CS chip select / SS chip slave select + #define LCD_PINS_ENABLE 51 // SID (MOSI) + #define LCD_PINS_D4 52 // SCK (CLK) clock + #define SD_DETECT_PIN 35 +#else + #define LCD_PINS_RS 32 + #define LCD_PINS_ENABLE 31 + #define LCD_PINS_D4 14 + #define LCD_PINS_D5 30 + #define LCD_PINS_D6 39 + #define LCD_PINS_D7 15 + + #define SHIFT_CLK 43 + #define SHIFT_LD 35 + #define SHIFT_OUT 34 + #define SHIFT_EN 44 + + #if ENABLED(MEGATRONICS_31) + #define SD_DETECT_PIN 56 + #else + #define SD_DETECT_PIN -1 + #endif + +#endif From 0eba65f96b2ac3ec9271e560f1531d1f46d6553d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 14:36:40 -0700 Subject: [PATCH 524/580] Fix for R.D.F.G.S.C. with MINITRONICS board --- Marlin/pins_MINITRONICS.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h index db68c97ae..e3582aaa5 100644 --- a/Marlin/pins_MINITRONICS.h +++ b/Marlin/pins_MINITRONICS.h @@ -74,40 +74,40 @@ #define HEATER_1_PIN 8 // EXTRUDER 2 #define HEATER_BED_PIN 3 // BED +/** + * Controllers and LCDs + */ #define BEEPER_PIN -1 -#if ENABLED(DOGLCD) +#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #if ENABLED(U8GLIB_ST7920) - #define LCD_PINS_RS 15 //CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 11 //SID (MOSI) - #define LCD_PINS_D4 10 //SCK (CLK) clock + #define LCD_PINS_RS 15 // CS chip select /SS chip slave select + #define LCD_PINS_ENABLE 11 // SID (MOSI) + #define LCD_PINS_D4 10 // SCK (CLK) clock - #define BTN_EN1 18 - #define BTN_EN2 17 - #define BTN_ENC 25 + #define BTN_EN1 18 + #define BTN_EN2 17 + #define BTN_ENC 25 - #define SD_DETECT_PIN 30 - #endif + #define SD_DETECT_PIN 30 #else - #define LCD_PINS_RS -1 + #define LCD_PINS_RS -1 #define LCD_PINS_ENABLE -1 - #define LCD_PINS_D4 -1 - #define LCD_PINS_D5 -1 - #define LCD_PINS_D6 -1 - #define LCD_PINS_D7 -1 + #define LCD_PINS_D4 -1 + #define LCD_PINS_D5 -1 + #define LCD_PINS_D6 -1 + #define LCD_PINS_D7 -1 // Buttons are directly attached using keypad - #define BTN_EN1 -1 - #define BTN_EN2 -1 - #define BTN_ENC -1 + #define BTN_EN1 -1 + #define BTN_EN2 -1 + #define BTN_ENC -1 #define BLEN_C 2 #define BLEN_B 1 #define BLEN_A 0 #define SD_DETECT_PIN -1 // Minitronics doesn't use this - #endif From 42dcc3bf504f7da02c2da40b389f39869ecc564b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 13:58:37 -0700 Subject: [PATCH 525/580] Remove "the click" comments --- Marlin/pins_3DRAG.h | 2 +- Marlin/pins_ELEFU_3.h | 2 +- Marlin/pins_GEN7_CUSTOM.h | 2 +- Marlin/pins_MEGACONTROLLER.h | 8 ++++---- Marlin/pins_MEGATRONICS_2.h | 2 +- Marlin/pins_PRINTRBOARD.h | 2 +- Marlin/pins_PRINTRBOARD_REVF.h | 2 +- Marlin/pins_RAMBO.h | 4 ++-- Marlin/pins_RAMPS_14.h | 2 +- Marlin/pins_ULTIMAIN_2.h | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Marlin/pins_3DRAG.h b/Marlin/pins_3DRAG.h index 6f253ac8a..db19e5df2 100644 --- a/Marlin/pins_3DRAG.h +++ b/Marlin/pins_3DRAG.h @@ -86,7 +86,7 @@ #undef BTN_ENC #define BTN_EN1 16 #define BTN_EN2 17 - #define BTN_ENC 23 //the click + #define BTN_ENC 23 #else diff --git a/Marlin/pins_ELEFU_3.h b/Marlin/pins_ELEFU_3.h index 546b5a84e..bb98f2b02 100644 --- a/Marlin/pins_ELEFU_3.h +++ b/Marlin/pins_ELEFU_3.h @@ -87,11 +87,11 @@ #define BTN_EN1 14 #define BTN_EN2 39 - #define BTN_ENC 15 //the click #define BLEN_C 2 #define BLEN_B 1 #define BLEN_A 0 + #define BTN_ENC 15 #endif // RA_CONTROL_PANEL diff --git a/Marlin/pins_GEN7_CUSTOM.h b/Marlin/pins_GEN7_CUSTOM.h index f740e4a01..06aaebd65 100644 --- a/Marlin/pins_GEN7_CUSTOM.h +++ b/Marlin/pins_GEN7_CUSTOM.h @@ -86,5 +86,5 @@ //buttons are directly attached #define BTN_EN1 11 #define BTN_EN2 10 -#define BTN_ENC 12 //the click +#define BTN_ENC 12 diff --git a/Marlin/pins_MEGACONTROLLER.h b/Marlin/pins_MEGACONTROLLER.h index f21a80518..7ea4ee34b 100644 --- a/Marlin/pins_MEGACONTROLLER.h +++ b/Marlin/pins_MEGACONTROLLER.h @@ -113,11 +113,11 @@ //#define LCD_SCREEN_ROT_90 //#define LCD_SCREEN_ROT_180 //#define LCD_SCREEN_ROT_270 - //The encoder and click button + #define BTN_EN1 48 #define BTN_EN2 11 - #define BTN_ENC 10 //the click switch - //not connected to a pin + #define BTN_ENC 10 + #define SD_DETECT_PIN 49 -#endif //Minipanel +#endif // MINIPANEL diff --git a/Marlin/pins_MEGATRONICS_2.h b/Marlin/pins_MEGATRONICS_2.h index 90e9b1fee..cb4bcb80a 100644 --- a/Marlin/pins_MEGATRONICS_2.h +++ b/Marlin/pins_MEGATRONICS_2.h @@ -101,9 +101,9 @@ // Buttons are directly attached using keypad #define BTN_EN1 61 #define BTN_EN2 59 -#define BTN_ENC 43 //the click #define BLEN_C 2 #define BLEN_B 1 #define BLEN_A 0 +#define BTN_ENC 43 diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h index eaccabe9d..301548c44 100644 --- a/Marlin/pins_PRINTRBOARD.h +++ b/Marlin/pins_PRINTRBOARD.h @@ -132,7 +132,7 @@ //The encoder and click button (FastIO Pins) #define BTN_EN1 26 #define BTN_EN2 27 - #define BTN_ENC 47 //the click switch + #define BTN_ENC 47 #define SDSS 45 #define SD_DETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test) diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h index d2a45623a..751104b6c 100644 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ b/Marlin/pins_PRINTRBOARD_REVF.h @@ -136,7 +136,7 @@ //The encoder and click button (FastIO Pins) #define BTN_EN1 26 #define BTN_EN2 27 - #define BTN_ENC 47 //the click switch + #define BTN_ENC 47 #define SDSS 45 #define SD_DETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test) diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index 68c627b90..450a5fe0b 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -127,11 +127,11 @@ //buttons are directly attached using AUX-2 #define BTN_EN1 76 #define BTN_EN2 77 - #define BTN_ENC 78 //the click #define BLEN_C 2 #define BLEN_B 1 #define BLEN_A 0 + #define BTN_ENC 78 #define SD_DETECT_PIN 81 // Ramps doesn't use this @@ -179,7 +179,7 @@ //The encoder and click button #define BTN_EN1 85 #define BTN_EN2 84 - #define BTN_ENC 83 //the click switch + #define BTN_ENC 83 #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index ef96f59a6..b1c5b1953 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -256,7 +256,7 @@ //The encoder and click button #define BTN_EN1 40 #define BTN_EN2 63 - #define BTN_ENC 59 //the click switch + #define BTN_ENC 59 //not connected to a pin #define SD_DETECT_PIN 49 diff --git a/Marlin/pins_ULTIMAIN_2.h b/Marlin/pins_ULTIMAIN_2.h index c348ebb49..3f61c16aa 100644 --- a/Marlin/pins_ULTIMAIN_2.h +++ b/Marlin/pins_ULTIMAIN_2.h @@ -89,10 +89,10 @@ //buttons are directly attached #define BTN_EN1 40 #define BTN_EN2 41 -#define BTN_ENC 19 //the click #define BLEN_C 2 #define BLEN_B 1 #define BLEN_A 0 +#define BTN_ENC 19 #define SD_DETECT_PIN 39 From 155def24c6c63657e3d61eee684de3737ec42ccd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 14:00:31 -0700 Subject: [PATCH 526/580] BLEN_A, B, C are defined in ultralcd headers --- Marlin/pins_CHEAPTRONIC.h | 4 ---- Marlin/pins_ELEFU_3.h | 4 ---- Marlin/pins_FELIX2.h | 3 --- Marlin/pins_MEGATRONICS.h | 4 ---- Marlin/pins_MEGATRONICS_2.h | 5 ----- Marlin/pins_MEGATRONICS_3.h | 4 ---- Marlin/pins_MINITRONICS.h | 4 ---- Marlin/pins_PRINTRBOARD_REVF.h | 4 ---- Marlin/pins_RAMBO.h | 6 ------ Marlin/pins_ULTIMAIN_2.h | 4 ---- 10 files changed, 42 deletions(-) diff --git a/Marlin/pins_CHEAPTRONIC.h b/Marlin/pins_CHEAPTRONIC.h index 41e3dacb0..2fbb4e835 100644 --- a/Marlin/pins_CHEAPTRONIC.h +++ b/Marlin/pins_CHEAPTRONIC.h @@ -84,8 +84,4 @@ #define BTN_EN2 -1 #define BTN_ENC -1 -#define BLEN_C 2 -#define BLEN_B 1 -#define BLEN_A 0 - // Cheaptronic v1.0 doesn't use this diff --git a/Marlin/pins_ELEFU_3.h b/Marlin/pins_ELEFU_3.h index bb98f2b02..2b8e64d8e 100644 --- a/Marlin/pins_ELEFU_3.h +++ b/Marlin/pins_ELEFU_3.h @@ -87,10 +87,6 @@ #define BTN_EN1 14 #define BTN_EN2 39 - - #define BLEN_C 2 - #define BLEN_B 1 - #define BLEN_A 0 #define BTN_ENC 15 #endif // RA_CONTROL_PANEL diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index dfea48358..7bb724bf5 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -38,9 +38,6 @@ #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) - #define BLEN_C 2 - #define BLEN_B 1 - #define BLEN_A 0 #define SD_DETECT_PIN 6 #endif // NEWPANEL && ULTRA_LCD diff --git a/Marlin/pins_MEGATRONICS.h b/Marlin/pins_MEGATRONICS.h index 4e766d8b9..1b95f525f 100644 --- a/Marlin/pins_MEGATRONICS.h +++ b/Marlin/pins_MEGATRONICS.h @@ -92,10 +92,6 @@ #define BTN_EN2 64 #define BTN_ENC 43 - #define BLEN_C 2 - #define BLEN_B 1 - #define BLEN_A 0 - #define SD_DETECT_PIN -1 // RAMPS doesn't use this #endif // ULTRA_LCD && NEWPANEL diff --git a/Marlin/pins_MEGATRONICS_2.h b/Marlin/pins_MEGATRONICS_2.h index cb4bcb80a..991ab4a9c 100644 --- a/Marlin/pins_MEGATRONICS_2.h +++ b/Marlin/pins_MEGATRONICS_2.h @@ -101,9 +101,4 @@ // Buttons are directly attached using keypad #define BTN_EN1 61 #define BTN_EN2 59 - -#define BLEN_C 2 -#define BLEN_B 1 -#define BLEN_A 0 - #define BTN_ENC 43 diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h index a671e9a18..a983ee2a7 100644 --- a/Marlin/pins_MEGATRONICS_3.h +++ b/Marlin/pins_MEGATRONICS_3.h @@ -120,10 +120,6 @@ #define BTN_EN2 45 #define BTN_ENC 33 -#define BLEN_C 2 -#define BLEN_B 1 -#define BLEN_A 0 - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define LCD_PINS_RS 56 // CS chip select / SS chip slave select #define LCD_PINS_ENABLE 51 // SID (MOSI) diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h index e3582aaa5..34faa9ad3 100644 --- a/Marlin/pins_MINITRONICS.h +++ b/Marlin/pins_MINITRONICS.h @@ -105,9 +105,5 @@ #define BTN_EN2 -1 #define BTN_ENC -1 - #define BLEN_C 2 - #define BLEN_B 1 - #define BLEN_A 0 - #define SD_DETECT_PIN -1 // Minitronics doesn't use this #endif diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h index 751104b6c..a289a5c4a 100644 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ b/Marlin/pins_PRINTRBOARD_REVF.h @@ -113,10 +113,6 @@ #define BTN_EN2 17 #define BTN_ENC 18//the click - #define BLEN_C 2 - #define BLEN_B 1 - #define BLEN_A 0 - #define SD_DETECT_PIN -1 //encoder rotation values diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index 450a5fe0b..386d63b36 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -127,10 +127,6 @@ //buttons are directly attached using AUX-2 #define BTN_EN1 76 #define BTN_EN2 77 - - #define BLEN_C 2 - #define BLEN_B 1 - #define BLEN_A 0 #define BTN_ENC 78 #define SD_DETECT_PIN 81 // Ramps doesn't use this @@ -162,8 +158,6 @@ #define BL_DW 4 #define BL_RI 3 #define BL_ST 2 - #define BLEN_B 1 - #define BLEN_A 0 #endif // !NEWPANEL diff --git a/Marlin/pins_ULTIMAIN_2.h b/Marlin/pins_ULTIMAIN_2.h index 3f61c16aa..c2de0a426 100644 --- a/Marlin/pins_ULTIMAIN_2.h +++ b/Marlin/pins_ULTIMAIN_2.h @@ -89,10 +89,6 @@ //buttons are directly attached #define BTN_EN1 40 #define BTN_EN2 41 - -#define BLEN_C 2 -#define BLEN_B 1 -#define BLEN_A 0 #define BTN_ENC 19 #define SD_DETECT_PIN 39 From 03fdb26cd2f66d55f7afab4b8592aa16ec43afae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 14:23:21 -0700 Subject: [PATCH 527/580] Wrangle encoder bits, LCD_CLICKED --- Marlin/pins_RAMBO.h | 9 ------ Marlin/ultralcd.h | 49 ++++++++++++--------------------- Marlin/ultralcd_impl_DOGM.h | 13 +-------- Marlin/ultralcd_impl_HD44780.h | 50 ++++++++-------------------------- 4 files changed, 30 insertions(+), 91 deletions(-) diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index 386d63b36..e04fbc529 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -150,15 +150,6 @@ #define LCD_PINS_D6 27 #define LCD_PINS_D7 29 - //bits in the shift register that carry the buttons for: - // left up center down right red - #define BL_LE 7 - #define BL_UP 6 - #define BL_MI 5 - #define BL_DW 4 - #define BL_RI 3 - #define BL_ST 2 - #endif // !NEWPANEL #endif // ULTRA_LCD diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 457a70f51..b1d4300c0 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -58,7 +58,6 @@ void bootscreen(); #endif - #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x)) #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x)) @@ -93,7 +92,20 @@ bool lcd_blink(); - #if ENABLED(REPRAPWORLD_KEYPAD) + #if ENABLED(ULTIPANEL) + #define BLEN_A 0 + #define BLEN_B 1 + // Encoder click is directly connected + #if BUTTON_EXISTS(ENC) + #define BLEN_C 2 + #define EN_C (_BV(BLEN_C)) + #endif + #define EN_A (_BV(BLEN_A)) + #define EN_B (_BV(BLEN_B)) + #define EN_C (_BV(BLEN_C)) + #endif + + #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values @@ -135,35 +147,10 @@ EN_REPRAPWORLD_KEYPAD_LEFT) \ ) - #endif // REPRAPWORLD_KEYPAD - - #if ENABLED(NEWPANEL) - - #define EN_C (_BV(BLEN_C)) - #define EN_B (_BV(BLEN_B)) - #define EN_A (_BV(BLEN_A)) - - #if ENABLED(REPRAPWORLD_KEYPAD) - #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1)) - #else - #define LCD_CLICKED (buttons&EN_C) - #endif - - #else //!NEWPANEL - - //atomic, do not change - #define B_LE (_BV(BL_LE)) - #define B_UP (_BV(BL_UP)) - #define B_MI (_BV(BL_MI)) - #define B_DW (_BV(BL_DW)) - #define B_RI (_BV(BL_RI)) - #define B_ST (_BV(BL_ST)) - #define EN_B (_BV(BLEN_B)) - #define EN_A (_BV(BLEN_A)) - - #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST)) - - #endif //!NEWPANEL + #define LCD_CLICKED ((buttons & EN_C) || (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1)) + #elif ENABLED(NEWPANEL) + #define LCD_CLICKED (buttons & EN_C) + #endif #else //no LCD FORCE_INLINE void lcd_update() {} diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 43b76a995..f8ffd4db0 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -42,20 +42,9 @@ * Implementation of the LCD display routines for a DOGM128 graphic display. * These are common LCD 128x64 pixel graphic displays. */ - -#if ENABLED(ULTIPANEL) - #define BLEN_A 0 - #define BLEN_B 1 - #define BLEN_C 2 - #define EN_A (_BV(BLEN_A)) - #define EN_B (_BV(BLEN_B)) - #define EN_C (_BV(BLEN_C)) - #define LCD_CLICKED (buttons&EN_C) -#endif - -#include "dogm_bitmaps.h" #include "ultralcd.h" #include "ultralcd_st7920_u8glib_rrd.h" +#include "dogm_bitmaps.h" #include "duration_t.h" #include diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h index fa942d8a1..ab120c2ca 100644 --- a/Marlin/ultralcd_impl_HD44780.h +++ b/Marlin/ultralcd_impl_HD44780.h @@ -39,18 +39,6 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt // via a shift/i2c register. #if ENABLED(ULTIPANEL) - // All UltiPanels might have an encoder - so this is always be mapped onto first two bits - #define BLEN_B 1 - #define BLEN_A 0 - - #define EN_B (_BV(BLEN_B)) // The two encoder pins are connected through BTN_EN1 and BTN_EN2 - #define EN_A (_BV(BLEN_A)) - - #if BUTTON_EXISTS(ENC) - // encoder click is directly connected - #define BLEN_C 2 - #define EN_C (_BV(BLEN_C)) - #endif // // Setup other button mappings of each panel @@ -80,51 +68,35 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt #elif ENABLED(LCD_I2C_PANELOLU2) - #if BUTTON_EXISTS(ENC) - - #undef LCD_CLICKED - #define LCD_CLICKED (buttons&EN_C) - - #else // Read through I2C if not directly connected to a pin + #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) #define B_MI (PANELOLU2_ENCODER_C< Date: Fri, 29 Jul 2016 00:03:25 +0100 Subject: [PATCH 528/580] A little cleanup at speaker.h --- Marlin/buzzer.h | 1 - Marlin/speaker.h | 28 +++++++++++++--------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index e967284ea..766b7aa7c 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -104,7 +104,6 @@ class Buzzer { */ void tone(uint16_t const &duration, uint16_t const &frequency = 0) { while (buffer.isFull()) { - delay(5); this->tick(); thermalManager.manage_heater(); } diff --git a/Marlin/speaker.h b/Marlin/speaker.h index 93aa6f736..0bc2a9a9f 100644 --- a/Marlin/speaker.h +++ b/Marlin/speaker.h @@ -32,7 +32,7 @@ class Speaker: public Buzzer { struct state_t { tone_t tone; uint16_t period; - uint16_t cycles; + uint16_t counter; } state; protected: @@ -43,7 +43,7 @@ class Speaker: public Buzzer { void reset() { super::reset(); this->state.period = 0; - this->state.cycles = 0; + this->state.counter = 0; } public: @@ -60,7 +60,7 @@ class Speaker: public Buzzer { * playing the tones in the queue. */ virtual void tick() { - if (!this->state.cycles) { + if (!this->state.counter) { if (this->buffer.isEmpty()) return; this->reset(); @@ -69,20 +69,18 @@ class Speaker: public Buzzer { // Period is uint16, min frequency will be ~16Hz this->state.period = 1000000UL / this->state.tone.frequency; - this->state.cycles = - (this->state.tone.duration * 1000L) / this->state.period; + this->state.counter = + (this->state.tone.counter * 1000L) / this->state.period; - this->state.period >>= 1; - this->state.cycles <<= 1; + this->state.period >>= 1; + this->state.counter <<= 1; + } else { + const uint32_t now = micros(); + static uint32_t next = now + this->state.period; - } - else { - uint32_t const us = micros(); - static uint32_t next = us + this->state.period; - - if (us >= next) { - --this->state.cycles; - next = us + this->state.period; + if (now >= next) { + --this->state.counter; + next = now + this->state.period; if (this->state.tone.frequency > 0) this->invert(); } } From 83e1d90ca387e0f56e2a23eaf00867753d49e22b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 16:26:52 -0700 Subject: [PATCH 529/580] Undo errant optimization of block->millimeters --- Marlin/planner.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 3ffa00f3f..1b49897db 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -804,15 +804,9 @@ void Planner::check_axes_activity() { #endif #else float delta_mm[4]; - #if ENABLED(DELTA) - // On delta all axes (should!) have the same steps-per-mm - // so calculate distance in steps first, then do one division - // at the end to get millimeters - #else - delta_mm[X_AXIS] = dx * steps_to_mm[X_AXIS]; - delta_mm[Y_AXIS] = dy * steps_to_mm[Y_AXIS]; - delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS]; - #endif + delta_mm[X_AXIS] = dx * steps_to_mm[X_AXIS]; + delta_mm[Y_AXIS] = dy * steps_to_mm[Y_AXIS]; + delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS]; #endif delta_mm[E_AXIS] = 0.01 * (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder]; @@ -827,16 +821,10 @@ void Planner::check_axes_activity() { sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD]) #elif ENABLED(COREYZ) sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD]) - #elif ENABLED(DELTA) - sq(dx) + sq(dy) + sq(dz) #else sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS]) #endif - ) - #if ENABLED(DELTA) - * steps_to_mm[X_AXIS] - #endif - ; + ); } float inverse_millimeters = 1.0 / block->millimeters; // Inverse millimeters to remove multiple divides From 753283e02091ba0391e674dc01471d31a5dfe247 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 16:35:18 -0700 Subject: [PATCH 530/580] inverse_second => inverse_mm_s --- Marlin/planner.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 1b49897db..7ced932c9 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -829,7 +829,7 @@ void Planner::check_axes_activity() { float inverse_millimeters = 1.0 / block->millimeters; // Inverse millimeters to remove multiple divides // Calculate moves/second for this move. No divide by zero due to previous checks. - float inverse_second = fr_mm_s * inverse_millimeters; + float inverse_mm_s = fr_mm_s * inverse_millimeters; int moves_queued = movesplanned(); @@ -841,21 +841,21 @@ void Planner::check_axes_activity() { #endif #if ENABLED(SLOWDOWN) // segment time im micro seconds - unsigned long segment_time = lround(1000000.0/inverse_second); + unsigned long segment_time = lround(1000000.0/inverse_mm_s); if (mq) { if (segment_time < min_segment_time) { // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. - inverse_second = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued)); + inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued)); #ifdef XY_FREQUENCY_LIMIT - segment_time = lround(1000000.0 / inverse_second); + segment_time = lround(1000000.0 / inverse_mm_s); #endif } } #endif #endif - block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 - block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0 + block->nominal_speed = block->millimeters * inverse_mm_s; // (mm/sec) Always > 0 + block->nominal_rate = ceil(block->step_event_count * inverse_mm_s); // (step/sec) Always > 0 #if ENABLED(FILAMENT_WIDTH_SENSOR) static float filwidth_e_count = 0, filwidth_delay_dist = 0; @@ -895,7 +895,7 @@ void Planner::check_axes_activity() { float current_speed[NUM_AXIS]; float speed_factor = 1.0; //factor <=1 do decrease speed LOOP_XYZE(i) { - current_speed[i] = delta_mm[i] * inverse_second; + current_speed[i] = delta_mm[i] * inverse_mm_s; float cs = fabs(current_speed[i]), mf = max_feedrate_mm_s[i]; if (cs > mf) speed_factor = min(speed_factor, mf / cs); } From c94b6dd3e7d9c0624ea3243a42eabd0b3f29c331 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 17:08:28 -0700 Subject: [PATCH 531/580] Revert to SanityCheck on every .cpp file --- Marlin/MarlinConfig.h | 1 + Marlin/SanityCheck.cpp | 735 ----------------------------------------- Marlin/SanityCheck.h | 708 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 707 insertions(+), 737 deletions(-) delete mode 100644 Marlin/SanityCheck.cpp diff --git a/Marlin/MarlinConfig.h b/Marlin/MarlinConfig.h index 5ead4a11b..b0d10a301 100644 --- a/Marlin/MarlinConfig.h +++ b/Marlin/MarlinConfig.h @@ -35,5 +35,6 @@ #endif #include "Arduino.h" #include "Conditionals_post.h" +#include "SanityCheck.h" #endif // MARLIN_CONFIG_H diff --git a/Marlin/SanityCheck.cpp b/Marlin/SanityCheck.cpp deleted file mode 100644 index f3ef238b7..000000000 --- a/Marlin/SanityCheck.cpp +++ /dev/null @@ -1,735 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * SanityCheck.cpp - * - * Test configuration values for errors at compile-time. - * This is done only once, here, to speed up compilation time. - */ -#include "MarlinConfig.h" - -/** - * Due to the high number of issues related with old versions of Arduino IDE - * we are now warning our users to update their toolkits. In a future Marlin - * release we will stop supporting old IDE versions and will require user - * action to proceed with compilation in such environments. - */ -#if !defined(ARDUINO) || ARDUINO < 10600 - #error "Versions of Arduino IDE prior to 1.6.0 are no longer supported, please update your toolkit." -#endif - -/** - * We try our best to include sanity checks for all the changes configuration - * directives because people have a tendency to use outdated config files with - * the bleding edge source code, but sometimes this is not enough. This check - * will force a minimum config file revision, otherwise Marlin will not build. - */ -#if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION - #error "You are using an old Configuration.h file, update it before building Marlin." -#endif - -#if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION - #error "You are using an old Configuration_adv.h file, update it before building Marlin." -#endif - -/** - * Marlin release, version and default string - */ -#ifndef SHORT_BUILD_VERSION - #error "SHORT_BUILD_VERSION must be specified." -#elif !defined(DETAILED_BUILD_VERSION) - #error "BUILD_VERSION must be specified." -#elif !defined(STRING_DISTRIBUTION_DATE) - #error "STRING_DISTRIBUTION_DATE must be specified." -#elif !defined(PROTOCOL_VERSION) - #error "PROTOCOL_VERSION must be specified." -#elif !defined(MACHINE_NAME) - #error "MACHINE_NAME must be specified." -#elif !defined(SOURCE_CODE_URL) - #error "SOURCE_CODE_URL must be specified." -#elif !defined(DEFAULT_MACHINE_UUID) - #error "DEFAULT_MACHINE_UUID must be specified." -#elif !defined(WEBSITE_URL) - #error "WEBSITE_URL must be specified." -#endif - -/** - * Dual Stepper Drivers - */ -#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE) - #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS." -#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR) - #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)." -#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR) - #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)." -#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR) - #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)." -#endif - -/** - * Progress Bar - */ -#if ENABLED(LCD_PROGRESS_BAR) - #if DISABLED(SDSUPPORT) - #error "LCD_PROGRESS_BAR requires SDSUPPORT." - #endif - #if ENABLED(DOGLCD) - #error "LCD_PROGRESS_BAR does not apply to graphical displays." - #endif - #if ENABLED(FILAMENT_LCD_DISPLAY) - #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." - #endif -#endif - -/** - * Babystepping - */ -#if ENABLED(BABYSTEPPING) - #if DISABLED(ULTRA_LCD) - #error "BABYSTEPPING requires an LCD controller." - #endif - #if ENABLED(SCARA) - #error "BABYSTEPPING is not implemented for SCARA yet." - #endif - #if ENABLED(DELTA) && ENABLED(BABYSTEP_XY) - #error "BABYSTEPPING only implemented for Z axis on deltabots." - #endif -#endif - -/** - * Filament Runout needs a pin and either SD Support or Auto print start detection - */ -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #if !HAS_FIL_RUNOUT - #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." - #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART) - #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." - #endif -#endif - -/** - * Filament Change with Extruder Runout Prevention - */ -#if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(EXTRUDER_RUNOUT_PREVENT) - #error "EXTRUDER_RUNOUT_PREVENT is incompatible with FILAMENT_CHANGE_FEATURE." -#endif - -/** - * Individual axis homing is useless for DELTAS - */ -#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA) - #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." -#endif - -/** - * Options only for EXTRUDERS > 1 - */ -#if EXTRUDERS > 1 - - #if EXTRUDERS > 4 - #error "The maximum number of EXTRUDERS in Marlin is 4." - #endif - - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." - #endif - - #if ENABLED(HEATERS_PARALLEL) - #error "EXTRUDERS must be 1 with HEATERS_PARALLEL." - #endif - -#elif ENABLED(SINGLENOZZLE) - #error "SINGLENOZZLE requires 2 or more EXTRUDERS." -#endif - -/** - * Only one type of extruder allowed - */ -#if (ENABLED(SWITCHING_EXTRUDER) && (ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER))) \ - || (ENABLED(SINGLENOZZLE) && ENABLED(MIXING_EXTRUDER)) - #error "Please define only one type of extruder: SINGLENOZZLE, SWITCHING_EXTRUDER, or MIXING_EXTRUDER." -#endif - -/** - * Single Stepper Dual Extruder with switching servo - */ -#if ENABLED(SWITCHING_EXTRUDER) - #if ENABLED(DUAL_X_CARRIAGE) - #error "SWITCHING_EXTRUDER and DUAL_X_CARRIAGE are incompatible." - #elif EXTRUDERS != 2 - #error "SWITCHING_EXTRUDER requires exactly 2 EXTRUDERS." - #elif NUM_SERVOS < 1 - #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1." - #endif -#endif - -/** - * Mixing Extruder requirements - */ -#if ENABLED(MIXING_EXTRUDER) - #if EXTRUDERS > 1 - #error "MIXING_EXTRUDER currently only supports one extruder." - #endif - #if MIXING_STEPPERS < 2 - #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." - #endif - #if ENABLED(FILAMENT_SENSOR) - #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway." - #endif -#endif - -/** - * Limited number of servos - */ -#if defined(NUM_SERVOS) && NUM_SERVOS > 0 - #if NUM_SERVOS > 4 - #error "The maximum number of SERVOS in Marlin is 4." - #elif HAS_Z_SERVO_ENDSTOP && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS - #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." - #endif -#endif - -/** - * Servo deactivation depends on servo endstops - */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_ENDSTOP - #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." -#endif - -/** - * Required LCD language - */ -#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780) - #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller." -#endif - -/** - * Bed Heating Options - PID vs Limit Switching - */ -#if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING) - #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED." -#endif - -/** - * Mesh Bed Leveling - */ -#if ENABLED(MESH_BED_LEVELING) - #if ENABLED(DELTA) - #error "MESH_BED_LEVELING does not yet support DELTA printers." - #elif ENABLED(AUTO_BED_LEVELING_FEATURE) - #error "Select AUTO_BED_LEVELING_FEATURE or MESH_BED_LEVELING, not both." - #elif MESH_NUM_X_POINTS > 9 || MESH_NUM_Y_POINTS > 9 - #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS must be less than 10." - #endif -#elif ENABLED(MANUAL_BED_LEVELING) - #error "MESH_BED_LEVELING is required for MANUAL_BED_LEVELING." -#endif - -/** - * Probes - */ - -#if PROBE_SELECTED - - #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA) - #error "You cannot use Z_PROBE_SLED with DELTA." - #endif - - /** - * NUM_SERVOS is required for a Z servo probe - */ - #if HAS_Z_SERVO_ENDSTOP - #ifndef NUM_SERVOS - #error "You must set NUM_SERVOS for a Z servo probe (Z_ENDSTOP_SERVO_NR)." - #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS - #error "Z_ENDSTOP_SERVO_NR must be less than NUM_SERVOS." - #endif - #endif - - /** - * A probe needs a pin - */ - #if !PROBE_PIN_CONFIGURED - #error "A probe needs a pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN." - #endif - - /** - * Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - */ - #if HAS_Z_MIN && HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #error "A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN." - #endif - - /** - * Make sure the plug is enabled if it's used - */ - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && DISABLED(USE_ZMIN_PLUG) - #error "You must enable USE_ZMIN_PLUG if any probe or endstop is connected to the ZMIN plug." - #endif - - /** - * Only allow one probe option to be defined - */ - #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ - || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ - || (HAS_Z_SERVO_ENDSTOP && ENABLED(Z_PROBE_SLED)) - #error "Please define only one type of probe: Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." - #endif - - /** - * Don't allow nonsense probe-pin settings - */ - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(Z_MIN_PROBE_ENDSTOP) - #error "You can't enable both Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN and Z_MIN_PROBE_ENDSTOP." - #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) - #error "Don't enable DISABLE_Z_MIN_PROBE_ENDSTOP with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN." - #elif ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) && DISABLED(Z_MIN_PROBE_ENDSTOP) - #error "DISABLE_Z_MIN_PROBE_ENDSTOP requires Z_MIN_PROBE_ENDSTOP to be set." - #endif - - /** - * Require a Z probe pin if Z_MIN_PROBE_ENDSTOP is enabled. - */ - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #if !HAS_Z_MIN_PROBE_PIN - #error "Z_MIN_PROBE_ENDSTOP requires a Z_MIN_PROBE_PIN in your board's pins_XXXX.h file." - #endif - // Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment. - //#ifndef NUM_SERVOS - // #error "You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_MIN_PROBE_ENDSTOP." - //#endif - //#if defined(NUM_SERVOS) && NUM_SERVOS < 1 - // #error "You must have at least 1 servo defined for NUM_SERVOS to use Z_MIN_PROBE_ENDSTOP." - //#endif - //#if Z_ENDSTOP_SERVO_NR < 0 - // #error "You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_MIN_PROBE_ENDSTOP." - //#endif - //#ifndef Z_SERVO_ANGLES - // #error "You must have Z_SERVO_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP." - //#endif - #endif - - /** - * Make sure Z raise values are set - */ - #if defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) - #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_RAISE_PROBE_DEPLOY_STOW instead." - #elif !defined(Z_RAISE_PROBE_DEPLOY_STOW) - #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration." - #elif !defined(Z_RAISE_BETWEEN_PROBINGS) - #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration." - #elif Z_RAISE_PROBE_DEPLOY_STOW < 0 - #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0." - #elif Z_RAISE_BETWEEN_PROBINGS < 0 - #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 0." - #endif - -#else - - /** - * Require some kind of probe for bed leveling and probe testing - */ - #if ENABLED(AUTO_BED_LEVELING_FEATURE) - #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." - #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." - #endif - -#endif - -/** - * Make sure Z_SAFE_HOMING point is reachable - */ -#if ENABLED(Z_SAFE_HOMING) - #if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X - #if HAS_BED_PROBE - #error "Z_SAFE_HOMING_X_POINT can't be reached by the Z probe." - #else - #error "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle." - #endif - #elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y - #if HAS_BED_PROBE - #error "Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe." - #else - #error "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle." - #endif - #endif -#endif // Z_SAFE_HOMING - -/** - * Auto Bed Leveling - */ -#if ENABLED(AUTO_BED_LEVELING_FEATURE) - - /** - * Delta has limited bed leveling options - */ - #if ENABLED(DELTA) && DISABLED(AUTO_BED_LEVELING_GRID) - #error "You must use AUTO_BED_LEVELING_GRID for DELTA bed leveling." - #endif - - /** - * Require a Z min pin - */ - #if !PIN_EXISTS(Z_MIN) - #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z probe, but not enable it. - #error "AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin." - #endif - #endif - - /** - * Check if Probe_Offset * Grid Points is greater than Probing Range - */ - #if ENABLED(AUTO_BED_LEVELING_GRID) - #ifndef DELTA_PROBEABLE_RADIUS - // Be sure points are in the right order - #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION - #error "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION." - #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION - #error "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION." - #endif - // Make sure probing points are reachable - #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X - #error "The given LEFT_PROBE_BED_POSITION can't be reached by the Z probe." - #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X - #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the Z probe." - #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y - #error "The given FRONT_PROBE_BED_POSITION can't be reached by the Z probe." - #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y - #error "The given BACK_PROBE_BED_POSITION can't be reached by the Z probe." - #endif - #endif - #else // !AUTO_BED_LEVELING_GRID - - // Check the triangulation points - #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X - #error "The given ABL_PROBE_PT_1_X can't be reached by the Z probe." - #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X - #error "The given ABL_PROBE_PT_2_X can't be reached by the Z probe." - #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X - #error "The given ABL_PROBE_PT_3_X can't be reached by the Z probe." - #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y - #error "The given ABL_PROBE_PT_1_Y can't be reached by the Z probe." - #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y - #error "The given ABL_PROBE_PT_2_Y can't be reached by the Z probe." - #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y - #error "The given ABL_PROBE_PT_3_Y can't be reached by the Z probe." - #endif - - #endif // !AUTO_BED_LEVELING_GRID - -#endif // AUTO_BED_LEVELING_FEATURE - -/** - * Advance Extrusion - */ -#if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE) - #error "You can enable ADVANCE or LIN_ADVANCE, but not both." -#endif - -/** - * Filament Width Sensor - */ -#if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR - #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined." -#endif - -/** - * ULTIPANEL encoder - */ -#if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK) - #error "ULTIPANEL requires some kind of encoder." -#endif - -#if ENCODER_PULSES_PER_STEP < 0 - #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead." -#endif - -/** - * SAV_3DGLCD display options - */ -#if ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106) - #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." -#endif - -/** - * Don't set more than one kinematic type - */ -#if (ENABLED(DELTA) && (ENABLED(SCARA) || ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \ - || (ENABLED(SCARA) && (ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \ - || (ENABLED(COREXY) && (ENABLED(COREXZ) || ENABLED(COREYZ))) \ - || (ENABLED(COREXZ) && ENABLED(COREYZ)) - #error "Please enable only one of DELTA, SCARA, COREXY, COREXZ, or COREYZ." -#endif - -/** - * Allen Key - * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. - */ -#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY" -#endif - -/** - * Dual X Carriage requirements - */ -#if ENABLED(DUAL_X_CARRIAGE) - #if EXTRUDERS == 1 - #error "DUAL_X_CARRIAGE requires 2 (or more) extruders." - #elif ENABLED(COREXY) || ENABLED(COREXZ) - #error "DUAL_X_CARRIAGE cannot be used with COREXY or COREXZ." - #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR - #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined." - #elif !HAS_X_MAX - #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop." - #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) - #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS." - #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1 - #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1." - #endif -#endif // DUAL_X_CARRIAGE - -/** - * Make sure auto fan pins don't conflict with the fan pin - */ -#if HAS_AUTO_FAN - #if HAS_FAN0 - #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN." - #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN." - #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN." - #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN - #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN." - #endif - #endif -#endif - -#if HAS_FAN0 && CONTROLLERFAN_PIN == FAN_PIN - #error "You cannot set CONTROLLERFAN_PIN equal to FAN_PIN." -#endif - -#if HAS_CONTROLLERFAN - #if EXTRUDER_0_AUTO_FAN_PIN == CONTROLLERFAN_PIN - #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN." - #elif EXTRUDER_1_AUTO_FAN_PIN == CONTROLLERFAN_PIN - #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN." - #elif EXTRUDER_2_AUTO_FAN_PIN == CONTROLLERFAN_PIN - #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN." - #elif EXTRUDER_3_AUTO_FAN_PIN == CONTROLLERFAN_PIN - #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN." - #endif -#endif - -/** - * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. - */ -#if !HAS_HEATER_0 - #error "HEATER_0_PIN not defined for this board." -#elif !PIN_EXISTS(TEMP_0) - #error "TEMP_0_PIN not defined for this board." -#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE) - #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." -#elif TEMP_SENSOR_0 == 0 - #error "TEMP_SENSOR_0 is required." -#endif - -#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL) - #if !HAS_HEATER_1 - #error "HEATER_1_PIN not defined for this board." - #endif -#endif - -#if HOTENDS > 1 - #if TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." - #elif !PIN_EXISTS(TEMP_1) - #error "TEMP_1_PIN not defined for this board." - #endif - #if HOTENDS > 2 - #if TEMP_SENSOR_2 == 0 - #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." - #elif !HAS_HEATER_2 - #error "HEATER_2_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_2) - #error "TEMP_2_PIN not defined for this board." - #endif - #if HOTENDS > 3 - #if TEMP_SENSOR_3 == 0 - #error "TEMP_SENSOR_3 is required with 4 HOTENDS." - #elif !HAS_HEATER_3 - #error "HEATER_3_PIN not defined for this board." - #elif !PIN_EXISTS(TEMP_3) - #error "TEMP_3_PIN not defined for this board." - #endif - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 3 extruders." - #endif - #elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 2 extruders." - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 2 extruders." - #endif -#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "TEMP_SENSOR_1 shouldn't be set with only 1 extruder." -#elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 1 extruder." -#elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 1 extruder." -#endif - -#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0 - #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." -#endif - -/** - * Basic 2-nozzle duplication mode - */ -#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - #if HOTENDS != 2 - #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends." - #elif ENABLED(DUAL_X_CARRIAGE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE." - #elif ENABLED(SINGLENOZZLE) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE." - #elif ENABLED(MIXING_EXTRUDER) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER." - #elif ENABLED(SWITCHING_EXTRUDER) - #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER." - #endif -#endif - -/** - * Test Extruder Pins - */ -#if EXTRUDERS > 3 - #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE) - #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." - #endif -#elif EXTRUDERS > 2 - #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE) - #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." - #endif -#elif EXTRUDERS > 1 - #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE) - #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." - #endif -#endif - -/** - * Endstops - */ -#if DISABLED(USE_XMIN_PLUG) && DISABLED(USE_XMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _XMAX_ && Z2_USE_ENDSTOP <= _XMIN_) - #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG" -#elif DISABLED(USE_YMIN_PLUG) && DISABLED(USE_YMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _YMAX_ && Z2_USE_ENDSTOP <= _YMIN_) - #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG" -#elif DISABLED(USE_ZMIN_PLUG) && DISABLED(USE_ZMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _ZMAX_ && Z2_USE_ENDSTOP <= _ZMIN_) - #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG" -#elif ENABLED(Z_DUAL_ENDSTOPS) && !Z2_USE_ENDSTOP - #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS" -#endif - -/** - * emergency-command parser - */ -#if ENABLED(EMERGENCY_PARSER) && ENABLED(USBCON) - #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." -#endif - - /** - * Warnings for old configurations - */ -#if WATCH_TEMP_PERIOD > 500 - #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." -#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) - #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS." -#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) - #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED." -#elif ENABLED(COREXZ) && ENABLED(Z_LATE_ENABLE) - #error "Z_LATE_ENABLE can't be used with COREXZ." -#elif defined(X_HOME_RETRACT_MM) - #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." -#elif defined(BEEPER) - #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." -#elif defined(SDCARDDETECT) - #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions." -#elif defined(SDCARDDETECTINVERTED) - #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration." -#elif defined(BTENABLED) - #error "BTENABLED is now BLUETOOTH. Please update your configuration." -#elif defined(CUSTOM_MENDEL_NAME) - #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." -#elif defined(HAS_AUTOMATIC_VERSIONING) - #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration." -#elif defined(ENABLE_AUTO_BED_LEVELING) - #error "ENABLE_AUTO_BED_LEVELING is now AUTO_BED_LEVELING_FEATURE. Please update your configuration." -#elif defined(SDSLOW) - #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." -#elif defined(SDEXTRASLOW) - #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." -#elif defined(Z_RAISE_BEFORE_HOMING) - #error "Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead." -#elif defined(FILAMENT_SENSOR) - #error "FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead." -#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) - #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." -#elif ENABLED(Z_DUAL_ENDSTOPS) && !defined(Z2_USE_ENDSTOP) - #error "Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2" -#elif defined(LANGUAGE_INCLUDE) - #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration." -#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y) - #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." -#elif defined(PID_PARAMS_PER_EXTRUDER) - #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." -#elif defined(EXTRUDER_WATTS) - #error "EXTRUDER_WATTS is deprecated. Use HOTEND_WATTS instead." -#elif defined(SERVO_ENDSTOP_ANGLES) - #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." -#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) - #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." -#elif defined(XY_TRAVEL_SPEED) - #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." -#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) - #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." -#elif defined(SERVO_DEACTIVATION_DELAY) - #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." -#elif ENABLED(FILAMENTCHANGEENABLE) - #error "FILAMENTCHANGEENABLE is now FILAMENT_CHANGE_FEATURE. Please update your configuration." -#elif defined(PLA_PREHEAT_HOTEND_TEMP) - #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." -#elif defined(PLA_PREHEAT_HPB_TEMP) - #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration." -#elif defined(PLA_PREHEAT_FAN_SPEED) - #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration." -#elif defined(ABS_PREHEAT_HOTEND_TEMP) - #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration." -#elif defined(ABS_PREHEAT_HPB_TEMP) - #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." -#elif defined(ABS_PREHEAT_FAN_SPEED) - #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." -#elif defined(ENDSTOPS_ONLY_FOR_HOMING) - #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." -#elif defined(HOMING_FEEDRATE) - #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." -#endif diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index fcf258475..c6602ea04 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -22,6 +22,710 @@ /** * SanityCheck.h - * OBSOLETE: Moved to SanityCheck.cpp + * + * Test configuration values for errors at compile-time. + */ + +/** + * Due to the high number of issues related with old versions of Arduino IDE + * we now prevent Marlin from compiling with older toolkits. + */ +#if !defined(ARDUINO) || ARDUINO < 10600 + #error "Versions of Arduino IDE prior to 1.6.0 are no longer supported, please update your toolkit." +#endif + +/** + * We try our best to include sanity checks for all the changes configuration + * directives because people have a tendency to use outdated config files with + * the bleding edge source code, but sometimes this is not enough. This check + * will force a minimum config file revision, otherwise Marlin will not build. + */ +#if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION + #error "You are using an old Configuration.h file, update it before building Marlin." +#endif + +#if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION + #error "You are using an old Configuration_adv.h file, update it before building Marlin." +#endif + +/** + * Marlin release, version and default string + */ +#ifndef SHORT_BUILD_VERSION + #error "SHORT_BUILD_VERSION must be specified." +#elif !defined(DETAILED_BUILD_VERSION) + #error "BUILD_VERSION must be specified." +#elif !defined(STRING_DISTRIBUTION_DATE) + #error "STRING_DISTRIBUTION_DATE must be specified." +#elif !defined(PROTOCOL_VERSION) + #error "PROTOCOL_VERSION must be specified." +#elif !defined(MACHINE_NAME) + #error "MACHINE_NAME must be specified." +#elif !defined(SOURCE_CODE_URL) + #error "SOURCE_CODE_URL must be specified." +#elif !defined(DEFAULT_MACHINE_UUID) + #error "DEFAULT_MACHINE_UUID must be specified." +#elif !defined(WEBSITE_URL) + #error "WEBSITE_URL must be specified." +#endif + +/** + * Dual Stepper Drivers + */ +#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE) + #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS." +#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR) + #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)." +#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR) + #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)." +#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR) + #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)." +#endif + +/** + * Progress Bar + */ +#if ENABLED(LCD_PROGRESS_BAR) + #if DISABLED(SDSUPPORT) + #error "LCD_PROGRESS_BAR requires SDSUPPORT." + #endif + #if ENABLED(DOGLCD) + #error "LCD_PROGRESS_BAR does not apply to graphical displays." + #endif + #if ENABLED(FILAMENT_LCD_DISPLAY) + #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." + #endif +#endif + +/** + * Babystepping + */ +#if ENABLED(BABYSTEPPING) + #if DISABLED(ULTRA_LCD) + #error "BABYSTEPPING requires an LCD controller." + #endif + #if ENABLED(SCARA) + #error "BABYSTEPPING is not implemented for SCARA yet." + #endif + #if ENABLED(DELTA) && ENABLED(BABYSTEP_XY) + #error "BABYSTEPPING only implemented for Z axis on deltabots." + #endif +#endif + +/** + * Filament Runout needs a pin and either SD Support or Auto print start detection + */ +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if !HAS_FIL_RUNOUT + #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." + #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART) + #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART." + #endif +#endif + +/** + * Filament Change with Extruder Runout Prevention + */ +#if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(EXTRUDER_RUNOUT_PREVENT) + #error "EXTRUDER_RUNOUT_PREVENT is incompatible with FILAMENT_CHANGE_FEATURE." +#endif + +/** + * Individual axis homing is useless for DELTAS + */ +#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA) + #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." +#endif + +/** + * Options only for EXTRUDERS > 1 + */ +#if EXTRUDERS > 1 + + #if EXTRUDERS > 4 + #error "The maximum number of EXTRUDERS in Marlin is 4." + #endif + + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." + #endif + + #if ENABLED(HEATERS_PARALLEL) + #error "EXTRUDERS must be 1 with HEATERS_PARALLEL." + #endif + +#elif ENABLED(SINGLENOZZLE) + #error "SINGLENOZZLE requires 2 or more EXTRUDERS." +#endif + +/** + * Only one type of extruder allowed + */ +#if (ENABLED(SWITCHING_EXTRUDER) && (ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER))) \ + || (ENABLED(SINGLENOZZLE) && ENABLED(MIXING_EXTRUDER)) + #error "Please define only one type of extruder: SINGLENOZZLE, SWITCHING_EXTRUDER, or MIXING_EXTRUDER." +#endif + +/** + * Single Stepper Dual Extruder with switching servo + */ +#if ENABLED(SWITCHING_EXTRUDER) + #if ENABLED(DUAL_X_CARRIAGE) + #error "SWITCHING_EXTRUDER and DUAL_X_CARRIAGE are incompatible." + #elif EXTRUDERS != 2 + #error "SWITCHING_EXTRUDER requires exactly 2 EXTRUDERS." + #elif NUM_SERVOS < 1 + #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1." + #endif +#endif + +/** + * Mixing Extruder requirements + */ +#if ENABLED(MIXING_EXTRUDER) + #if EXTRUDERS > 1 + #error "MIXING_EXTRUDER currently only supports one extruder." + #endif + #if MIXING_STEPPERS < 2 + #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." + #endif + #if ENABLED(FILAMENT_SENSOR) + #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway." + #endif +#endif + +/** + * Limited number of servos + */ +#if defined(NUM_SERVOS) && NUM_SERVOS > 0 + #if NUM_SERVOS > 4 + #error "The maximum number of SERVOS in Marlin is 4." + #elif HAS_Z_SERVO_ENDSTOP && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS + #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." + #endif +#endif + +/** + * Servo deactivation depends on servo endstops + */ +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_ENDSTOP + #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." +#endif + +/** + * Required LCD language + */ +#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780) + #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller." +#endif + +/** + * Bed Heating Options - PID vs Limit Switching + */ +#if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING) + #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED." +#endif + +/** + * Mesh Bed Leveling + */ +#if ENABLED(MESH_BED_LEVELING) + #if ENABLED(DELTA) + #error "MESH_BED_LEVELING does not yet support DELTA printers." + #elif ENABLED(AUTO_BED_LEVELING_FEATURE) + #error "Select AUTO_BED_LEVELING_FEATURE or MESH_BED_LEVELING, not both." + #elif MESH_NUM_X_POINTS > 9 || MESH_NUM_Y_POINTS > 9 + #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS must be less than 10." + #endif +#elif ENABLED(MANUAL_BED_LEVELING) + #error "MESH_BED_LEVELING is required for MANUAL_BED_LEVELING." +#endif + +/** + * Probes + */ + +#if PROBE_SELECTED + + #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA) + #error "You cannot use Z_PROBE_SLED with DELTA." + #endif + + /** + * NUM_SERVOS is required for a Z servo probe + */ + #if HAS_Z_SERVO_ENDSTOP + #ifndef NUM_SERVOS + #error "You must set NUM_SERVOS for a Z servo probe (Z_ENDSTOP_SERVO_NR)." + #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS + #error "Z_ENDSTOP_SERVO_NR must be less than NUM_SERVOS." + #endif + #endif + + /** + * A probe needs a pin + */ + #if !PROBE_PIN_CONFIGURED + #error "A probe needs a pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN." + #endif + + /** + * Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + */ + #if HAS_Z_MIN && HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #error "A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN." + #endif + + /** + * Make sure the plug is enabled if it's used + */ + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && DISABLED(USE_ZMIN_PLUG) + #error "You must enable USE_ZMIN_PLUG if any probe or endstop is connected to the ZMIN plug." + #endif + + /** + * Only allow one probe option to be defined + */ + #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + || (HAS_Z_SERVO_ENDSTOP && ENABLED(Z_PROBE_SLED)) + #error "Please define only one type of probe: Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #endif + + /** + * Don't allow nonsense probe-pin settings + */ + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(Z_MIN_PROBE_ENDSTOP) + #error "You can't enable both Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN and Z_MIN_PROBE_ENDSTOP." + #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) + #error "Don't enable DISABLE_Z_MIN_PROBE_ENDSTOP with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN." + #elif ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) && DISABLED(Z_MIN_PROBE_ENDSTOP) + #error "DISABLE_Z_MIN_PROBE_ENDSTOP requires Z_MIN_PROBE_ENDSTOP to be set." + #endif + + /** + * Require a Z probe pin if Z_MIN_PROBE_ENDSTOP is enabled. + */ + #if ENABLED(Z_MIN_PROBE_ENDSTOP) + #if !HAS_Z_MIN_PROBE_PIN + #error "Z_MIN_PROBE_ENDSTOP requires a Z_MIN_PROBE_PIN in your board's pins_XXXX.h file." + #endif + // Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment. + //#ifndef NUM_SERVOS + // #error "You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_MIN_PROBE_ENDSTOP." + //#endif + //#if defined(NUM_SERVOS) && NUM_SERVOS < 1 + // #error "You must have at least 1 servo defined for NUM_SERVOS to use Z_MIN_PROBE_ENDSTOP." + //#endif + //#if Z_ENDSTOP_SERVO_NR < 0 + // #error "You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_MIN_PROBE_ENDSTOP." + //#endif + //#ifndef Z_SERVO_ANGLES + // #error "You must have Z_SERVO_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP." + //#endif + #endif + + /** + * Make sure Z raise values are set + */ + #if defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) + #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_RAISE_PROBE_DEPLOY_STOW instead." + #elif !defined(Z_RAISE_PROBE_DEPLOY_STOW) + #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration." + #elif !defined(Z_RAISE_BETWEEN_PROBINGS) + #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration." + #elif Z_RAISE_PROBE_DEPLOY_STOW < 0 + #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0." + #elif Z_RAISE_BETWEEN_PROBINGS < 0 + #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 0." + #endif + +#else + + /** + * Require some kind of probe for bed leveling and probe testing + */ + #if ENABLED(AUTO_BED_LEVELING_FEATURE) + #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) + #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #endif + +#endif + +/** + * Make sure Z_SAFE_HOMING point is reachable + */ +#if ENABLED(Z_SAFE_HOMING) + #if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X + #if HAS_BED_PROBE + #error "Z_SAFE_HOMING_X_POINT can't be reached by the Z probe." + #else + #error "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle." + #endif + #elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y + #if HAS_BED_PROBE + #error "Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe." + #else + #error "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle." + #endif + #endif +#endif // Z_SAFE_HOMING + +/** + * Auto Bed Leveling + */ +#if ENABLED(AUTO_BED_LEVELING_FEATURE) + + /** + * Delta has limited bed leveling options + */ + #if ENABLED(DELTA) && DISABLED(AUTO_BED_LEVELING_GRID) + #error "You must use AUTO_BED_LEVELING_GRID for DELTA bed leveling." + #endif + + /** + * Require a Z min pin + */ + #if !PIN_EXISTS(Z_MIN) + #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z probe, but not enable it. + #error "AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin." + #endif + #endif + + /** + * Check if Probe_Offset * Grid Points is greater than Probing Range + */ + #if ENABLED(AUTO_BED_LEVELING_GRID) + #ifndef DELTA_PROBEABLE_RADIUS + // Be sure points are in the right order + #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION + #error "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION." + #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION + #error "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION." + #endif + // Make sure probing points are reachable + #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X + #error "The given LEFT_PROBE_BED_POSITION can't be reached by the Z probe." + #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X + #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the Z probe." + #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y + #error "The given FRONT_PROBE_BED_POSITION can't be reached by the Z probe." + #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y + #error "The given BACK_PROBE_BED_POSITION can't be reached by the Z probe." + #endif + #endif + #else // !AUTO_BED_LEVELING_GRID + + // Check the triangulation points + #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X + #error "The given ABL_PROBE_PT_1_X can't be reached by the Z probe." + #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X + #error "The given ABL_PROBE_PT_2_X can't be reached by the Z probe." + #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X + #error "The given ABL_PROBE_PT_3_X can't be reached by the Z probe." + #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y + #error "The given ABL_PROBE_PT_1_Y can't be reached by the Z probe." + #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y + #error "The given ABL_PROBE_PT_2_Y can't be reached by the Z probe." + #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y + #error "The given ABL_PROBE_PT_3_Y can't be reached by the Z probe." + #endif + + #endif // !AUTO_BED_LEVELING_GRID + +#endif // AUTO_BED_LEVELING_FEATURE + +/** + * Advance Extrusion + */ +#if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE) + #error "You can enable ADVANCE or LIN_ADVANCE, but not both." +#endif + +/** + * Filament Width Sensor + */ +#if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR + #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined." +#endif + +/** + * ULTIPANEL encoder + */ +#if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK) + #error "ULTIPANEL requires some kind of encoder." +#endif + +#if ENCODER_PULSES_PER_STEP < 0 + #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead." +#endif + +/** + * SAV_3DGLCD display options + */ +#if ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106) + #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106." +#endif + +/** + * Don't set more than one kinematic type + */ +#if (ENABLED(DELTA) && (ENABLED(SCARA) || ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \ + || (ENABLED(SCARA) && (ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \ + || (ENABLED(COREXY) && (ENABLED(COREXZ) || ENABLED(COREYZ))) \ + || (ENABLED(COREXZ) && ENABLED(COREYZ)) + #error "Please enable only one of DELTA, SCARA, COREXY, COREXZ, or COREYZ." +#endif + +/** + * Allen Key + * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. + */ +#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY" +#endif + +/** + * Dual X Carriage requirements + */ +#if ENABLED(DUAL_X_CARRIAGE) + #if EXTRUDERS == 1 + #error "DUAL_X_CARRIAGE requires 2 (or more) extruders." + #elif ENABLED(COREXY) || ENABLED(COREXZ) + #error "DUAL_X_CARRIAGE cannot be used with COREXY or COREXZ." + #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR + #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined." + #elif !HAS_X_MAX + #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop." + #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) + #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS." + #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1 + #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1." + #endif +#endif // DUAL_X_CARRIAGE + +/** + * Make sure auto fan pins don't conflict with the fan pin + */ +#if HAS_AUTO_FAN + #if HAS_FAN0 + #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN + #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN." + #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN + #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN." + #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN + #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN." + #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN + #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN." + #endif + #endif +#endif + +#if HAS_FAN0 && CONTROLLERFAN_PIN == FAN_PIN + #error "You cannot set CONTROLLERFAN_PIN equal to FAN_PIN." +#endif + +#if HAS_CONTROLLERFAN + #if EXTRUDER_0_AUTO_FAN_PIN == CONTROLLERFAN_PIN + #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN." + #elif EXTRUDER_1_AUTO_FAN_PIN == CONTROLLERFAN_PIN + #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN." + #elif EXTRUDER_2_AUTO_FAN_PIN == CONTROLLERFAN_PIN + #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN." + #elif EXTRUDER_3_AUTO_FAN_PIN == CONTROLLERFAN_PIN + #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN." + #endif +#endif + +/** + * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. + */ +#if !HAS_HEATER_0 + #error "HEATER_0_PIN not defined for this board." +#elif !PIN_EXISTS(TEMP_0) + #error "TEMP_0_PIN not defined for this board." +#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE) + #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." +#elif TEMP_SENSOR_0 == 0 + #error "TEMP_SENSOR_0 is required." +#endif + +#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL) + #if !HAS_HEATER_1 + #error "HEATER_1_PIN not defined for this board." + #endif +#endif + +#if HOTENDS > 1 + #if TEMP_SENSOR_1 == 0 + #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." + #elif !PIN_EXISTS(TEMP_1) + #error "TEMP_1_PIN not defined for this board." + #endif + #if HOTENDS > 2 + #if TEMP_SENSOR_2 == 0 + #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." + #elif !HAS_HEATER_2 + #error "HEATER_2_PIN not defined for this board." + #elif !PIN_EXISTS(TEMP_2) + #error "TEMP_2_PIN not defined for this board." + #endif + #if HOTENDS > 3 + #if TEMP_SENSOR_3 == 0 + #error "TEMP_SENSOR_3 is required with 4 HOTENDS." + #elif !HAS_HEATER_3 + #error "HEATER_3_PIN not defined for this board." + #elif !PIN_EXISTS(TEMP_3) + #error "TEMP_3_PIN not defined for this board." + #endif + #elif TEMP_SENSOR_3 != 0 + #error "TEMP_SENSOR_3 shouldn't be set with only 3 extruders." + #endif + #elif TEMP_SENSOR_2 != 0 + #error "TEMP_SENSOR_2 shouldn't be set with only 2 extruders." + #elif TEMP_SENSOR_3 != 0 + #error "TEMP_SENSOR_3 shouldn't be set with only 2 extruders." + #endif +#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT) + #error "TEMP_SENSOR_1 shouldn't be set with only 1 extruder." +#elif TEMP_SENSOR_2 != 0 + #error "TEMP_SENSOR_2 shouldn't be set with only 1 extruder." +#elif TEMP_SENSOR_3 != 0 + #error "TEMP_SENSOR_3 shouldn't be set with only 1 extruder." +#endif + +#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0 + #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT." +#endif + +/** + * Basic 2-nozzle duplication mode + */ +#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + #if HOTENDS != 2 + #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends." + #elif ENABLED(DUAL_X_CARRIAGE) + #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE." + #elif ENABLED(SINGLENOZZLE) + #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE." + #elif ENABLED(MIXING_EXTRUDER) + #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER." + #elif ENABLED(SWITCHING_EXTRUDER) + #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER." + #endif +#endif + +/** + * Test Extruder Pins + */ +#if EXTRUDERS > 3 + #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE) + #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." + #endif +#elif EXTRUDERS > 2 + #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE) + #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board." + #endif +#elif EXTRUDERS > 1 + #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE) + #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board." + #endif +#endif + +/** + * Endstops + */ +#if DISABLED(USE_XMIN_PLUG) && DISABLED(USE_XMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _XMAX_ && Z2_USE_ENDSTOP <= _XMIN_) + #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG" +#elif DISABLED(USE_YMIN_PLUG) && DISABLED(USE_YMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _YMAX_ && Z2_USE_ENDSTOP <= _YMIN_) + #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG" +#elif DISABLED(USE_ZMIN_PLUG) && DISABLED(USE_ZMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _ZMAX_ && Z2_USE_ENDSTOP <= _ZMIN_) + #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG" +#elif ENABLED(Z_DUAL_ENDSTOPS) && !Z2_USE_ENDSTOP + #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS" +#endif + +/** + * emergency-command parser + */ +#if ENABLED(EMERGENCY_PARSER) && ENABLED(USBCON) + #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)." +#endif + + /** + * Warnings for old configurations */ -#error "Please remove all #include lines from your Configuration.h and Configuration_adv.h files!" +#if WATCH_TEMP_PERIOD > 500 + #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds." +#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) + #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS." +#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) + #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED." +#elif ENABLED(COREXZ) && ENABLED(Z_LATE_ENABLE) + #error "Z_LATE_ENABLE can't be used with COREXZ." +#elif defined(X_HOME_RETRACT_MM) + #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." +#elif defined(BEEPER) + #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." +#elif defined(SDCARDDETECT) + #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions." +#elif defined(SDCARDDETECTINVERTED) + #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration." +#elif defined(BTENABLED) + #error "BTENABLED is now BLUETOOTH. Please update your configuration." +#elif defined(CUSTOM_MENDEL_NAME) + #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." +#elif defined(HAS_AUTOMATIC_VERSIONING) + #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration." +#elif defined(ENABLE_AUTO_BED_LEVELING) + #error "ENABLE_AUTO_BED_LEVELING is now AUTO_BED_LEVELING_FEATURE. Please update your configuration." +#elif defined(SDSLOW) + #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." +#elif defined(SDEXTRASLOW) + #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead." +#elif defined(Z_RAISE_BEFORE_HOMING) + #error "Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead." +#elif defined(FILAMENT_SENSOR) + #error "FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead." +#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) + #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead." +#elif ENABLED(Z_DUAL_ENDSTOPS) && !defined(Z2_USE_ENDSTOP) + #error "Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2" +#elif defined(LANGUAGE_INCLUDE) + #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration." +#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y) + #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." +#elif defined(PID_PARAMS_PER_EXTRUDER) + #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." +#elif defined(EXTRUDER_WATTS) + #error "EXTRUDER_WATTS is deprecated. Use HOTEND_WATTS instead." +#elif defined(SERVO_ENDSTOP_ANGLES) + #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." +#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) + #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." +#elif defined(XY_TRAVEL_SPEED) + #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." +#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) + #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." +#elif defined(SERVO_DEACTIVATION_DELAY) + #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." +#elif ENABLED(FILAMENTCHANGEENABLE) + #error "FILAMENTCHANGEENABLE is now FILAMENT_CHANGE_FEATURE. Please update your configuration." +#elif defined(PLA_PREHEAT_HOTEND_TEMP) + #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." +#elif defined(PLA_PREHEAT_HPB_TEMP) + #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration." +#elif defined(PLA_PREHEAT_FAN_SPEED) + #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration." +#elif defined(ABS_PREHEAT_HOTEND_TEMP) + #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration." +#elif defined(ABS_PREHEAT_HPB_TEMP) + #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." +#elif defined(ABS_PREHEAT_FAN_SPEED) + #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." +#elif defined(ENDSTOPS_ONLY_FOR_HOMING) + #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." +#elif defined(HOMING_FEEDRATE) + #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." +#endif From b40661cb189067dbfc6c8878421c5db2e192f88a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 14:51:18 -0700 Subject: [PATCH 532/580] Fix output of heater states --- Marlin/Marlin.h | 1 + Marlin/Marlin_main.cpp | 19 ++++++------------- Marlin/temperature.h | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 1b1bffaec..ded8b1f50 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -97,6 +97,7 @@ void serial_echopair_P(const char* s_P, long v); void serial_echopair_P(const char* s_P, float v); void serial_echopair_P(const char* s_P, double v); void serial_echopair_P(const char* s_P, unsigned long v); +FORCE_INLINE void serial_echopair_P(const char* s_P, uint8_t v) { serial_echopair_P(s_P, (int)v); } FORCE_INLINE void serial_echopair_P(const char* s_P, uint16_t v) { serial_echopair_P(s_P, (int)v); } FORCE_INLINE void serial_echopair_P(const char* s_P, bool v) { serial_echopair_P(s_P, (int)v); } FORCE_INLINE void serial_echopair_P(const char* s_P, void *v) { serial_echopair_P(s_P, (unsigned long)v); } diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1a3830ac8..777d91016 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4468,8 +4468,7 @@ inline void gcode_M104() { #endif #if HOTENDS > 1 HOTEND_LOOP() { - SERIAL_PROTOCOLPGM(" T"); - SERIAL_PROTOCOL(e); + SERIAL_PROTOCOLPAIR(" T", e); SERIAL_PROTOCOLCHAR(':'); SERIAL_PROTOCOL_F(thermalManager.degHotend(e), 1); SERIAL_PROTOCOLPGM(" /"); @@ -4494,8 +4493,7 @@ inline void gcode_M104() { #endif #if HOTENDS > 1 HOTEND_LOOP() { - SERIAL_PROTOCOLPGM(" @"); - SERIAL_PROTOCOL(e); + SERIAL_PROTOCOLPAIR(" @", e); SERIAL_PROTOCOLCHAR(':'); #ifdef EXTRUDER_WATTS SERIAL_PROTOCOL(((EXTRUDER_WATTS) * thermalManager.getHeaterPower(e)) / 127); @@ -4507,20 +4505,15 @@ inline void gcode_M104() { #endif #if ENABLED(SHOW_TEMP_ADC_VALUES) #if HAS_TEMP_BED - SERIAL_PROTOCOLPGM(" ADC B:"); - SERIAL_PROTOCOL_F(thermalManager.degBed(), 1); - SERIAL_PROTOCOLPGM("C->"); - SERIAL_PROTOCOL_F(thermalManager.rawBedTemp() / OVERSAMPLENR, 0); + SERIAL_PROTOCOLPAIR(" ADC B:", thermalManager.current_temperature_bed_raw / OVERSAMPLENR); #endif HOTEND_LOOP() { - SERIAL_PROTOCOLPGM(" T"); - SERIAL_PROTOCOL(e); + SERIAL_PROTOCOLPAIR(" T", e); SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL_F(thermalManager.degHotend(e), 1); - SERIAL_PROTOCOLPGM("C->"); - SERIAL_PROTOCOL_F(thermalManager.rawHotendTemp(e) / OVERSAMPLENR, 0); + SERIAL_PROTOCOL(thermalManager.current_temperature_raw[e] / OVERSAMPLENR); } #endif + SERIAL_EOL; } #endif diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 47d6af273..639eaad59 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -40,7 +40,7 @@ #endif #if HOTENDS == 1 - #define HOTEND_LOOP() const uint8_t e = 0; + #define HOTEND_LOOP() const int8_t e = 0; #define HOTEND_INDEX 0 #define EXTRUDER_IDX 0 #else From ea5ac94804bc7371d193ed1f4c68a18f1c699176 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 19:51:48 -0700 Subject: [PATCH 533/580] Improved MANUAL_[XYZ]_HOME_POS No need for `MANUAL_HOME_POSITIONS`. Just set each one as-needed to override the automatic behavior. --- Marlin/Conditionals_post.h | 29 ++++++++++++------- Marlin/Configuration.h | 20 +++++-------- Marlin/SanityCheck.h | 2 ++ .../Cartesio/Configuration.h | 20 +++++-------- .../Felix/Configuration.h | 20 +++++-------- .../Felix/DUAL/Configuration.h | 20 +++++-------- .../Hephestos/Configuration.h | 20 +++++-------- .../Hephestos_2/Configuration.h | 20 +++++-------- .../K8200/Configuration.h | 20 +++++-------- .../K8400/Configuration.h | 20 +++++-------- .../K8400/Dual-head/Configuration.h | 20 +++++-------- .../RepRapWorld/Megatronics/Configuration.h | 20 +++++-------- .../RigidBot/Configuration.h | 20 +++++-------- .../SCARA/Configuration.h | 20 +++++-------- .../TAZ4/Configuration.h | 20 +++++-------- .../WITBOX/Configuration.h | 20 +++++-------- .../adafruit/ST7565/Configuration.h | 20 +++++-------- .../delta/biv2.5/Configuration.h | 19 +++++------- .../delta/generic/Configuration.h | 19 +++++------- .../delta/kossel_mini/Configuration.h | 19 +++++------- .../delta/kossel_pro/Configuration.h | 19 +++++------- .../delta/kossel_xl/Configuration.h | 19 +++++------- .../makibox/Configuration.h | 20 +++++-------- .../tvrrug/Round2/Configuration.h | 20 +++++-------- 24 files changed, 196 insertions(+), 270 deletions(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 46d986c36..55ee277da 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -94,22 +94,29 @@ #endif /** - * AUTOSET LOCATIONS OF LIMIT SWITCHES + * Set the home position based on settings or manual overrides */ - #if ENABLED(MANUAL_HOME_POSITIONS) // Use manual limit switch locations + #ifdef MANUAL_X_HOME_POS #define X_HOME_POS MANUAL_X_HOME_POS + #elif ENABLED(BED_CENTER_AT_0_0) + #define X_HOME_POS ((X_MAX_LENGTH) * (X_HOME_DIR) * 0.5) + #else + #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) + #endif + + #ifdef MANUAL_Y_HOME_POS #define Y_HOME_POS MANUAL_Y_HOME_POS + #elif ENABLED(BED_CENTER_AT_0_0) + #define Y_HOME_POS ((Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5) + #else + #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) + #endif + + #ifdef MANUAL_Z_HOME_POS #define Z_HOME_POS MANUAL_Z_HOME_POS - #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits - #if ENABLED(BED_CENTER_AT_0_0) - #define X_HOME_POS (X_MAX_LENGTH) * (X_HOME_DIR) * 0.5 - #define Y_HOME_POS (Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5 - #else - #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) - #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) - #endif + #else #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS) - #endif //!MANUAL_HOME_POSITIONS + #endif /** * The BLTouch Probe emulates a servo probe diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 53ff21143..b8ebd2083 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -716,18 +716,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index c6602ea04..12e5e9b34 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -728,4 +728,6 @@ #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." #elif defined(HOMING_FEEDRATE) #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." +#elif defined(MANUAL_HOME_POSITIONS) + #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 751417eda..7892e4e43 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -717,18 +717,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index ac526d97e..b0e218b5d 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -699,18 +699,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 9729be616..30ea847f4 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -697,18 +697,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 6883b4f7d..a578621c8 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -709,18 +709,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 23d71364d..6586758ca 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -710,18 +710,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index a9d9a1e02..9608baed4 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -734,18 +734,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index a51cf5e03..5a431599c 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -717,18 +717,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 51d932c8a..cf3cb68d7 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -717,18 +717,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index c4b535051..5f7ce95ee 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -717,18 +717,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index b3465378c..ed919e87f 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -714,18 +714,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 5fe162019..3ee07c3a9 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -725,18 +725,14 @@ // @section homing -// The position of the homing switches -#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - // For SCARA: Offset between HomingPosition and Bed X=0 / Y=0 - #define MANUAL_X_HOME_POS -22. - #define MANUAL_Y_HOME_POS -52. - #define MANUAL_Z_HOME_POS 0.1 // Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +#define MANUAL_X_HOME_POS -22 +#define MANUAL_Y_HOME_POS -52 +#define MANUAL_Z_HOME_POS 0.1 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index bf990ac1b..bf7c10f3b 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -738,18 +738,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 9a90ad9e5..0f81183e3 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -708,18 +708,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index a1fd9aac0..fd4441f84 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -717,18 +717,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 6db0f4057..35ec25acb 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -810,17 +810,14 @@ // @section homing -// The position of the homing switches -#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 405 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS 405 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index fabcba89c..163251168 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -804,17 +804,14 @@ // @section homing -// The position of the homing switches -#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS 250 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index c5fda7d47..f5283d99a 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -807,17 +807,14 @@ // @section homing -// The position of the homing switches -#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS 250 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 7509fd634..65e68a4b5 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -801,17 +801,14 @@ // @section homing -// The position of the homing switches -#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 277 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS 277 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 9e25b029a..9aac30d6b 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -802,17 +802,14 @@ // @section homing -// The position of the homing switches -#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 381.4 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS 381.4 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index d77fe645e..ad2997dda 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -720,18 +720,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 3c1f39937..dbe5b9cd2 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -706,18 +706,14 @@ // @section homing -// The position of the homing switches -//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used -//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) - -// Manual homing switch locations: -// For deltabots this means top and center of the Cartesian print volume. -#if ENABLED(MANUAL_HOME_POSITIONS) - #define MANUAL_X_HOME_POS 0 - #define MANUAL_Y_HOME_POS 0 - #define MANUAL_Z_HOME_POS 0 - //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. -#endif +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 // Distance between the nozzle to printbed after homing // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // From 8896f08074ed4be09b3f6f30603df79ce7e21534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 29 Jul 2016 18:33:42 +0100 Subject: [PATCH 534/580] Fixes a compilation error introduced by #4448 --- Marlin/speaker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/speaker.h b/Marlin/speaker.h index 0bc2a9a9f..e3a0f9670 100644 --- a/Marlin/speaker.h +++ b/Marlin/speaker.h @@ -70,7 +70,7 @@ class Speaker: public Buzzer { this->state.period = 1000000UL / this->state.tone.frequency; this->state.counter = - (this->state.tone.counter * 1000L) / this->state.period; + (this->state.tone.duration * 1000L) / this->state.period; this->state.period >>= 1; this->state.counter <<= 1; From 8093c5f5343c2973f827c59c1078cf4ff8d09e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 28 Jul 2016 23:54:46 +0100 Subject: [PATCH 535/580] Non-blocking speaker now uses arduino's tone() --- Marlin/speaker.h | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/Marlin/speaker.h b/Marlin/speaker.h index e3a0f9670..5f3b6362f 100644 --- a/Marlin/speaker.h +++ b/Marlin/speaker.h @@ -31,8 +31,7 @@ class Speaker: public Buzzer { struct state_t { tone_t tone; - uint16_t period; - uint16_t counter; + millis_t next; } state; protected: @@ -42,8 +41,7 @@ class Speaker: public Buzzer { */ void reset() { super::reset(); - this->state.period = 0; - this->state.counter = 0; + this->state.next = 0; } public: @@ -60,29 +58,15 @@ class Speaker: public Buzzer { * playing the tones in the queue. */ virtual void tick() { - if (!this->state.counter) { + const uint32_t now = millis(); + + if (now >= this->state.next) { if (this->buffer.isEmpty()) return; this->reset(); this->state.tone = this->buffer.dequeue(); - - // Period is uint16, min frequency will be ~16Hz - this->state.period = 1000000UL / this->state.tone.frequency; - - this->state.counter = - (this->state.tone.duration * 1000L) / this->state.period; - - this->state.period >>= 1; - this->state.counter <<= 1; - } else { - const uint32_t now = micros(); - static uint32_t next = now + this->state.period; - - if (now >= next) { - --this->state.counter; - next = now + this->state.period; - if (this->state.tone.frequency > 0) this->invert(); - } + this->state.next = now + this->state.tone.duration; + ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration); } } }; From 2b5faa61e2fcd345eb1b86136e40b465b9d208f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Fri, 29 Jul 2016 17:39:07 +0100 Subject: [PATCH 536/580] Consolidates Buzzer and Speaker into a single object --- Marlin/Marlin.h | 9 ++--- Marlin/Marlin_main.cpp | 4 --- Marlin/buzzer.h | 16 ++++++--- Marlin/speaker.h | 74 ------------------------------------------ 4 files changed, 14 insertions(+), 89 deletions(-) delete mode 100644 Marlin/speaker.h diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index ded8b1f50..b0fcbb78f 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -386,13 +386,8 @@ void calculate_volumetric_multipliers(); // Buzzer #if HAS_BUZZER - #if ENABLED(SPEAKER) - #include "speaker.h" - extern Speaker buzzer; - #else - #include "buzzer.h" - extern Buzzer buzzer; - #endif + #include "buzzer.h" + extern Buzzer buzzer; #endif /** diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 777d91016..dc5f407aa 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -375,11 +375,7 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL // Buzzer #if HAS_BUZZER - #if ENABLED(SPEAKER) - Speaker buzzer; - #else Buzzer buzzer; - #endif #endif static uint8_t target_extruder; diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index e69116068..a398269d7 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -32,7 +32,6 @@ /** * @brief Tone structure * @details Simple abstraction of a tone based on a duration and a frequency. - * */ struct tone_t { uint16_t duration; @@ -116,14 +115,23 @@ class Buzzer { * playing the tones in the queue. */ virtual void tick() { + const millis_t now = millis(); + if (!this->state.endtime) { if (this->buffer.isEmpty()) return; this->state.tone = this->buffer.dequeue(); - this->state.endtime = millis() + this->state.tone.duration; - if (this->state.tone.frequency > 0) this->on(); + this->state.endtime = now + this->state.tone.duration; + + if (this->state.tone.frequency > 0) { + #if ENABLED(SPEAKER) + ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration); + #else + this->on(); + #endif + } } - else if (ELAPSED(millis(), this->state.endtime)) this->reset(); + else if (ELAPSED(now, this->state.endtime)) this->reset(); } }; diff --git a/Marlin/speaker.h b/Marlin/speaker.h deleted file mode 100644 index 5f3b6362f..000000000 --- a/Marlin/speaker.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef __SPEAKER_H__ -#define __SPEAKER_H__ - -#include "buzzer.h" - -class Speaker: public Buzzer { - private: - typedef Buzzer super; - - struct state_t { - tone_t tone; - millis_t next; - } state; - - protected: - /** - * @brief Resets the state of the class - * @details Brings the class state to a known one. - */ - void reset() { - super::reset(); - this->state.next = 0; - } - - public: - /** - * @brief Class constructor - */ - Speaker() { - this->reset(); - } - - /** - * @brief Loop function - * @details This function should be called at loop, it will take care of - * playing the tones in the queue. - */ - virtual void tick() { - const uint32_t now = millis(); - - if (now >= this->state.next) { - if (this->buffer.isEmpty()) return; - - this->reset(); - this->state.tone = this->buffer.dequeue(); - this->state.next = now + this->state.tone.duration; - ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration); - } - } -}; - -#endif From 74df828acc98dc2c637d30dcd21557f0026d5b25 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 16:02:54 -0700 Subject: [PATCH 537/580] Show ADC values inline rather than after --- Marlin/Marlin_main.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 777d91016..63b69b55e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4459,12 +4459,20 @@ inline void gcode_M104() { SERIAL_PROTOCOL_F(thermalManager.degHotend(target_extruder), 1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(target_extruder), 1); + #if ENABLED(SHOW_TEMP_ADC_VALUES) + SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[target_extruder] / OVERSAMPLENR); + SERIAL_CHAR(')') + #endif #endif #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B:"); SERIAL_PROTOCOL_F(thermalManager.degBed(), 1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(thermalManager.degTargetBed(), 1); + #if ENABLED(SHOW_TEMP_ADC_VALUES) + SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_bed_raw / OVERSAMPLENR); + SERIAL_CHAR(')') + #endif #endif #if HOTENDS > 1 HOTEND_LOOP() { @@ -4473,6 +4481,10 @@ inline void gcode_M104() { SERIAL_PROTOCOL_F(thermalManager.degHotend(e), 1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(e), 1); + #if ENABLED(SHOW_TEMP_ADC_VALUES) + SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[e] / OVERSAMPLENR); + SERIAL_CHAR(')') + #endif } #endif #if HAS_TEMP_BED @@ -4503,17 +4515,6 @@ inline void gcode_M104() { #endif } #endif - #if ENABLED(SHOW_TEMP_ADC_VALUES) - #if HAS_TEMP_BED - SERIAL_PROTOCOLPAIR(" ADC B:", thermalManager.current_temperature_bed_raw / OVERSAMPLENR); - #endif - HOTEND_LOOP() { - SERIAL_PROTOCOLPAIR(" T", e); - SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL(thermalManager.current_temperature_raw[e] / OVERSAMPLENR); - } - #endif - SERIAL_EOL; } #endif From e1970b4b287b9e69d6a90b9ab1f8784438e0ca0a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 28 Jul 2016 16:03:16 -0700 Subject: [PATCH 538/580] Show power output in same order as temp output --- Marlin/Marlin_main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 63b69b55e..9f7e78b1e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4487,6 +4487,13 @@ inline void gcode_M104() { #endif } #endif + SERIAL_PROTOCOLPGM(" @:"); + #ifdef EXTRUDER_WATTS + SERIAL_PROTOCOL(((EXTRUDER_WATTS) * thermalManager.getHeaterPower(target_extruder)) / 127); + SERIAL_PROTOCOLCHAR('W'); + #else + SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder)); + #endif #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B@:"); #ifdef BED_WATTS @@ -4496,13 +4503,6 @@ inline void gcode_M104() { SERIAL_PROTOCOL(thermalManager.getHeaterPower(-1)); #endif #endif - SERIAL_PROTOCOLPGM(" @:"); - #ifdef EXTRUDER_WATTS - SERIAL_PROTOCOL(((EXTRUDER_WATTS) * thermalManager.getHeaterPower(target_extruder)) / 127); - SERIAL_PROTOCOLCHAR('W'); - #else - SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder)); - #endif #if HOTENDS > 1 HOTEND_LOOP() { SERIAL_PROTOCOLPAIR(" @", e); From c31f56a38c0091873eb13cf8c6e1d6e4a4b84fa7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 29 Jul 2016 15:14:13 -0700 Subject: [PATCH 539/580] Deprecate EXTRUDER_WATTS and BED_WATTS --- Marlin/Configuration.h | 4 ---- Marlin/Marlin_main.cpp | 21 +++---------------- Marlin/SanityCheck.h | 4 ++-- .../Cartesio/Configuration.h | 4 ---- .../Felix/Configuration.h | 4 ---- .../Felix/DUAL/Configuration.h | 4 ---- .../Hephestos/Configuration.h | 4 ---- .../Hephestos_2/Configuration.h | 4 ---- .../K8200/Configuration.h | 4 ---- .../K8400/Configuration.h | 4 ---- .../K8400/Dual-head/Configuration.h | 4 ---- .../RepRapWorld/Megatronics/Configuration.h | 4 ---- .../RigidBot/Configuration.h | 4 ---- .../SCARA/Configuration.h | 4 ---- .../TAZ4/Configuration.h | 4 ---- .../WITBOX/Configuration.h | 4 ---- .../adafruit/ST7565/Configuration.h | 4 ---- .../delta/biv2.5/Configuration.h | 4 ---- .../delta/generic/Configuration.h | 4 ---- .../delta/kossel_mini/Configuration.h | 4 ---- .../delta/kossel_pro/Configuration.h | 4 ---- .../delta/kossel_xl/Configuration.h | 4 ---- .../makibox/Configuration.h | 4 ---- .../tvrrug/Round2/Configuration.h | 4 ---- 24 files changed, 5 insertions(+), 108 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b8ebd2083..7f0904d2e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -263,10 +263,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9f7e78b1e..a47b446c3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4488,31 +4488,16 @@ inline void gcode_M104() { } #endif SERIAL_PROTOCOLPGM(" @:"); - #ifdef EXTRUDER_WATTS - SERIAL_PROTOCOL(((EXTRUDER_WATTS) * thermalManager.getHeaterPower(target_extruder)) / 127); - SERIAL_PROTOCOLCHAR('W'); - #else - SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder)); - #endif + SERIAL_PROTOCOL(thermalManager.getHeaterPower(target_extruder)); #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B@:"); - #ifdef BED_WATTS - SERIAL_PROTOCOL(((BED_WATTS) * thermalManager.getHeaterPower(-1)) / 127); - SERIAL_PROTOCOLCHAR('W'); - #else - SERIAL_PROTOCOL(thermalManager.getHeaterPower(-1)); - #endif + SERIAL_PROTOCOL(thermalManager.getHeaterPower(-1)); #endif #if HOTENDS > 1 HOTEND_LOOP() { SERIAL_PROTOCOLPAIR(" @", e); SERIAL_PROTOCOLCHAR(':'); - #ifdef EXTRUDER_WATTS - SERIAL_PROTOCOL(((EXTRUDER_WATTS) * thermalManager.getHeaterPower(e)) / 127); - SERIAL_PROTOCOLCHAR('W'); - #else - SERIAL_PROTOCOL(thermalManager.getHeaterPower(e)); - #endif + SERIAL_PROTOCOL(thermalManager.getHeaterPower(e)); } #endif } diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 12e5e9b34..2cbdcc549 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -698,8 +698,8 @@ #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead." #elif defined(PID_PARAMS_PER_EXTRUDER) #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." -#elif defined(EXTRUDER_WATTS) - #error "EXTRUDER_WATTS is deprecated. Use HOTEND_WATTS instead." +#elif defined(EXTRUDER_WATTS) || defined(BED_WATTS) + #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration." #elif defined(SERVO_ENDSTOP_ANGLES) #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 7892e4e43..4f77d4bb2 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -265,10 +265,6 @@ #define HEATER_3_MAXTEMP 415 #define BED_MAXTEMP 165 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index b0e218b5d..4be4e7950 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 30ea847f4..7399f98fd 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index a578621c8..8dc9522fd 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -267,10 +267,6 @@ #define HEATER_3_MAXTEMP 260 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 6586758ca..bed48247b 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -263,10 +263,6 @@ //#define HEATER_3_MAXTEMP 275 //#define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 9608baed4..49057aea0 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -271,10 +271,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 5a431599c..f53441c74 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index cf3cb68d7..3b76fbda1 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 5f7ce95ee..2dc3555c6 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index ed919e87f..571e3aa16 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -267,10 +267,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 3ee07c3a9..b6c70ee74 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -289,10 +289,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -#define HOTEND_WATTS (2*2/5.9) // P=U^2/R -#define BED_WATTS (5.45*5.45/2.2) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index bf7c10f3b..54f69f546 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 250 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 0f81183e3..67fc743a9 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -266,10 +266,6 @@ #define HEATER_3_MAXTEMP 260 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index fd4441f84..80b0715a7 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 35ec25acb..79079193f 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 163251168..e3232022e 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index f5283d99a..873f3c6aa 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 65e68a4b5..f6a09cac2 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -270,10 +270,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 9aac30d6b..d3b4bb0d1 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -257,10 +257,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index ad2997dda..9f9d94065 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -264,10 +264,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index dbe5b9cd2..a36fb37f0 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -263,10 +263,6 @@ #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS -//#define HOTEND_WATTS (12.0*12.0/6.7) // P=U^2/R -//#define BED_WATTS (12.0*12.0/1.1) // P=U^2/R - //=========================================================================== //============================= PID Settings ================================ //=========================================================================== From 7188ce0ad6794748bb600f49e831adcdf4295fe1 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 30 Jul 2016 03:00:49 +0200 Subject: [PATCH 540/580] double bump probing as a feature Why double touch probing is not a good thing. It's widely believed we can get better __probing__ results when using a double touch when probing. Let's compare to double touch __homing__. Or better let's begin with single touch __homing__. We home to find out out position, so our position is unknown. To find the endstop we have to move into the direction of the endstop. The maximum way we have to move is a bit longer than the axis length. When we arrive at the endstop - when it triggers, the stepper pulses are stopped immediately. It's a sudden stop. No smooth deacceleration is possible. Depending on the speed and the moving mass we lose steps here. Only if we approached slow enough (below jerk speed?) we will not lose steps. Moving a complete axis length, that slow, takes for ever. To speed up homing, we now make the first approach faster, get a guess about our position, back up a bit and make a second slower approach to get a exact result without losing steps. What we do in double touch probing is the same. But the difference here is: a. we already know where we are b. if the first approach is to fast we will lose steps here to. But this time there is no second approach to set the position to 0. We are measuring only. The lost steps are permanent until we home the next time. So if you experienced permanently rising values in M48 you now know why. (Too fast, suddenly stopped, first approach) What can we do to improve probing? We can use the information about our current position. We can make a really fast, but deaccelerated, move to a place we know it is a bit before the trigger point. And then move the rest of the way really slow. --- Marlin/Configuration.h | 6 ++++-- Marlin/Marlin_main.cpp | 21 ++++++++++++------- .../Cartesio/Configuration.h | 6 ++++-- .../Felix/Configuration.h | 6 ++++-- .../Felix/DUAL/Configuration.h | 6 ++++-- .../Hephestos/Configuration.h | 6 ++++-- .../Hephestos_2/Configuration.h | 6 ++++-- .../K8200/Configuration.h | 6 ++++-- .../K8400/Configuration.h | 6 ++++-- .../K8400/Dual-head/Configuration.h | 6 ++++-- .../RepRapWorld/Megatronics/Configuration.h | 6 ++++-- .../RigidBot/Configuration.h | 6 ++++-- .../SCARA/Configuration.h | 6 ++++-- .../TAZ4/Configuration.h | 6 ++++-- .../WITBOX/Configuration.h | 6 ++++-- .../adafruit/ST7565/Configuration.h | 6 ++++-- .../delta/biv2.5/Configuration.h | 6 ++++-- .../delta/generic/Configuration.h | 6 ++++-- .../delta/kossel_mini/Configuration.h | 6 ++++-- .../delta/kossel_pro/Configuration.h | 6 ++++-- .../delta/kossel_xl/Configuration.h | 6 ++++-- .../makibox/Configuration.h | 6 ++++-- .../tvrrug/Round2/Configuration.h | 6 ++++-- 23 files changed, 101 insertions(+), 52 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b8ebd2083..28fc49f01 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -486,10 +486,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 777d91016..85150b4e9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2110,16 +2110,21 @@ static void clean_up_after_endstop_or_probe_move() { planner.bed_level_matrix.set_to_identity(); #endif - do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST); - endstops.hit_on_purpose(); - set_current_from_steppers_for_axis(Z_AXIS); - SYNC_PLAN_POSITION_KINEMATIC(); + #if ENABLED(PROBE_DOUBLE_TOUCH) + do_blocking_move_to_z(-(Z_MAX_LENGTH + 10), Z_PROBE_SPEED_FAST); + endstops.hit_on_purpose(); + set_current_from_steppers_for_axis(Z_AXIS); + SYNC_PLAN_POSITION_KINEMATIC(); - // move up the retract distance - do_blocking_move_to_z(current_position[Z_AXIS] + home_bump_mm(Z_AXIS), Z_PROBE_SPEED_FAST); + // move up the retract distance + do_blocking_move_to_z(current_position[Z_AXIS] + home_bump_mm(Z_AXIS), Z_PROBE_SPEED_FAST); + #else + // move fast, close to the bed + do_blocking_move_to_z(home_bump_mm(Z_AXIS), Z_PROBE_SPEED_FAST); + #endif - // move back down slowly to find bed - do_blocking_move_to_z(current_position[Z_AXIS] - home_bump_mm(Z_AXIS) * 2, Z_PROBE_SPEED_SLOW); + // move down slowly to find bed + do_blocking_move_to_z(current_position[Z_AXIS] -2.0*home_bump_mm(Z_AXIS), Z_PROBE_SPEED_SLOW); endstops.hit_on_purpose(); set_current_from_steppers_for_axis(Z_AXIS); SYNC_PLAN_POSITION_KINEMATIC(); diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 7892e4e43..269c72da0 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -487,10 +487,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index b0e218b5d..731c485bc 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -469,10 +469,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 30ea847f4..d9f75805c 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -467,10 +467,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index a578621c8..52be6241a 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -479,10 +479,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 6586758ca..b78a37662 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -480,10 +480,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 9608baed4..ead5dd689 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -504,10 +504,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 5a431599c..6867c25df 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -487,10 +487,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index cf3cb68d7..88be1271a 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -487,10 +487,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 5f7ce95ee..5007904d1 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -487,10 +487,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index ed919e87f..bd198548b 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -484,10 +484,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 3ee07c3a9..e7ccd29f1 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -495,10 +495,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index bf7c10f3b..5739ddbb5 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -508,10 +508,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 0f81183e3..c5b9293d8 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -478,10 +478,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index fd4441f84..27847bc33 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -487,10 +487,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 35ec25acb..db2d1b6f2 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -529,10 +529,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 163251168..6f0d2c3dc 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -529,10 +529,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index f5283d99a..80b1b234c 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -529,10 +529,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 4000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 65e68a4b5..cc700de4a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -520,10 +520,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 9aac30d6b..49d4dd18c 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -527,10 +527,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index ad2997dda..fd2e78919 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -490,10 +490,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index dbe5b9cd2..67da68f79 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -476,10 +476,12 @@ // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 -// Speed for the first approach when probing +// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the second approach when probing +// Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +// Use double touch for probing +//#define PROBE_DOUBLE_TOUCH // // Allen Key Probe is defined in the Delta example configurations. From 844a4e799e9b27c67d13febed1deb79e2bc1cc7a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 29 Jul 2016 17:15:54 -0700 Subject: [PATCH 541/580] Account for DELTA in Planner::refresh_positioning --- Marlin/Marlin.h | 1 + Marlin/Marlin_main.cpp | 4 ++-- Marlin/planner.cpp | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index ded8b1f50..c0b773430 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -314,6 +314,7 @@ float code_value_temp_diff(); void adjust_delta(float cartesian[3]); #endif #elif ENABLED(SCARA) + extern float delta[3]; extern float axis_scaling[3]; // Build size scaling void inverse_kinematics(const float cartesian[3]); void forward_kinematics_SCARA(float f_scara[3]); diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 777d91016..68bffded0 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -456,7 +456,7 @@ static uint8_t target_extruder; #define TOWER_2 Y_AXIS #define TOWER_3 Z_AXIS - float delta[3] = { 0 }; + float delta[3]; float cartesian_position[3] = { 0 }; #define SIN_60 0.8660254037844386 #define COS_60 0.5 @@ -489,7 +489,7 @@ static uint8_t target_extruder; #if ENABLED(SCARA) float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND; - static float delta[3] = { 0 }; + float delta[3]; float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1 #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 7ced932c9..ac41165d5 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1183,7 +1183,12 @@ void Planner::reset_acceleration_rates() { // Recalculate position, steps_to_mm if axis_steps_per_mm changes! void Planner::refresh_positioning() { LOOP_XYZE(i) planner.steps_to_mm[i] = 1.0 / planner.axis_steps_per_mm[i]; - set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + #if ENABLED(DELTA) || ENABLED(SCARA) + inverse_kinematics(current_position); + set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); + #else + set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + #endif reset_acceleration_rates(); } From 8e79e8cdb375da86064d7bb5752d3e38135bdff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 30 Jul 2016 02:55:52 +0100 Subject: [PATCH 542/580] Adds types.h --- Marlin/types.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Marlin/types.h diff --git a/Marlin/types.h b/Marlin/types.h new file mode 100644 index 000000000..8ab7beebe --- /dev/null +++ b/Marlin/types.h @@ -0,0 +1,28 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef __TYPES_H__ +#define __TYPES_H__ + +typedef unsigned long millis_t; + +#endif From 226e74a438c1dac72e575dbf39371e0f50335118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 30 Jul 2016 02:56:26 +0100 Subject: [PATCH 543/580] Fixes safe_delay() to be fully compatible with delay() --- Marlin/Marlin.h | 6 ++---- Marlin/utility.cpp | 3 ++- Marlin/utility.h | 7 ++++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index ded8b1f50..1e14fbf1c 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -35,13 +35,11 @@ #include "MarlinConfig.h" -#include "fastio.h" - #include "enum.h" +#include "types.h" +#include "fastio.h" #include "utility.h" -typedef unsigned long millis_t; - #ifdef USBCON #include "HardwareSerial.h" #if ENABLED(BLUETOOTH) diff --git a/Marlin/utility.cpp b/Marlin/utility.cpp index 385fe3d39..0285219c4 100644 --- a/Marlin/utility.cpp +++ b/Marlin/utility.cpp @@ -21,9 +21,10 @@ */ #include "Marlin.h" +#include "utility.h" #include "temperature.h" -void safe_delay(uint16_t ms) { +void safe_delay(millis_t ms) { while (ms > 50) { ms -= 50; delay(50); diff --git a/Marlin/utility.h b/Marlin/utility.h index 8bb3a9b8b..8ca70dbf8 100644 --- a/Marlin/utility.h +++ b/Marlin/utility.h @@ -20,4 +20,9 @@ * */ -void safe_delay(uint16_t ms); +#ifndef __UTILITY_H__ +#define __UTILITY_H__ + +void safe_delay(millis_t ms); + +#endif From 696b63e300bf0cda5b356a5e6d7e9f73c545c0d8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 29 Jul 2016 20:08:05 -0700 Subject: [PATCH 544/580] Specify manual-movable E axes by extruder type --- Marlin/Conditionals_post.h | 4 ++++ Marlin/ultralcd.cpp | 33 +++++++++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 55ee277da..68efd43f4 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -322,6 +322,7 @@ #if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder #define HOTENDS 1 #define E_STEPPERS EXTRUDERS + #define E_MANUAL EXTRUDERS #define TOOL_E_INDEX current_block->active_extruder #undef TEMP_SENSOR_1_AS_REDUNDANT #undef HOTEND_OFFSET_X @@ -329,6 +330,7 @@ #elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends #define HOTENDS EXTRUDERS #define E_STEPPERS 1 + #define E_MANUAL 1 #define TOOL_E_INDEX 0 #ifndef HOTEND_OFFSET_Z #define HOTEND_OFFSET_Z { 0 } @@ -336,10 +338,12 @@ #elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend #define HOTENDS 1 #define E_STEPPERS MIXING_STEPPERS + #define E_MANUAL 1 #define TOOL_E_INDEX 0 #else // One stepper, E axis, and hotend per tool #define HOTENDS EXTRUDERS #define E_STEPPERS EXTRUDERS + #define E_MANUAL EXTRUDERS #define TOOL_E_INDEX current_block->active_extruder #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index e3729898f..1d14e9eb6 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1316,11 +1316,11 @@ void kill_screen(const char* lcd_msg) { * to "current_position" after a short delay. */ inline void manual_move_to_current(AxisEnum axis - #if EXTRUDERS > 1 + #if E_MANUAL > 1 , int8_t eindex=-1 #endif ) { - #if EXTRUDERS > 1 + #if E_MANUAL > 1 if (axis == E_AXIS) manual_move_e_index = eindex >= 0 ? eindex : active_extruder; #endif manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves @@ -1357,9 +1357,9 @@ void kill_screen(const char* lcd_msg) { static void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS, sw_endstop_min[Y_AXIS], sw_endstop_max[Y_AXIS]); } #endif static void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); } - static void lcd_move_e( - #if E_STEPPERS > 1 - int8_t eindex = -1 + static void _lcd_move_e( + #if E_MANUAL > 1 + int8_t eindex #endif ) { if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } @@ -1368,7 +1368,7 @@ void kill_screen(const char* lcd_msg) { current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale; encoderPosition = 0; manual_move_to_current(E_AXIS - #if E_STEPPERS > 1 + #if E_MANUAL > 1 , eindex #endif ); @@ -1376,15 +1376,15 @@ void kill_screen(const char* lcd_msg) { } if (lcdDrawUpdate) { PGM_P pos_label; - #if E_STEPPERS == 1 + #if E_MANUAL == 1 pos_label = PSTR(MSG_MOVE_E); #else switch (eindex) { default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; - #if E_STEPPERS > 2 + #if E_MANUAL > 2 case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; - #if E_STEPPERS > 3 + #if E_MANUAL > 3 case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; #endif #endif @@ -1394,13 +1394,14 @@ void kill_screen(const char* lcd_msg) { } } - #if E_STEPPERS > 1 - static void lcd_move_e0() { lcd_move_e(0); } - static void lcd_move_e1() { lcd_move_e(1); } - #if E_STEPPERS > 2 - static void lcd_move_e2() { lcd_move_e(2); } - #if E_STEPPERS > 3 - static void lcd_move_e3() { lcd_move_e(3); } + static void lcd_move_e() { _lcd_move_e(); } + #if E_MANUAL > 1 + static void lcd_move_e0() { _lcd_move_e(0); } + static void lcd_move_e1() { _lcd_move_e(1); } + #if E_MANUAL > 2 + static void lcd_move_e2() { _lcd_move_e(2); } + #if E_MANUAL > 3 + static void lcd_move_e3() { _lcd_move_e(3); } #endif #endif #endif From b8c112c490c5fd250cf83c3a8fb0b828a90965f9 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 30 Jul 2016 19:34:46 +0900 Subject: [PATCH 545/580] Fix for PR #4453 (Improved MANUAL_[XYZ]_HOME_POS) --- Marlin/Conditionals_post.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 68efd43f4..8a51187e6 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -99,17 +99,33 @@ #ifdef MANUAL_X_HOME_POS #define X_HOME_POS MANUAL_X_HOME_POS #elif ENABLED(BED_CENTER_AT_0_0) - #define X_HOME_POS ((X_MAX_LENGTH) * (X_HOME_DIR) * 0.5) + #if ENABLED(DELTA) + #define X_HOME_POS 0 + #else + #define X_HOME_POS ((X_MAX_LENGTH) * (X_HOME_DIR) * 0.5) + #endif #else - #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) + #if ENABLED(DELTA) + #define X_HOME_POS ((X_MAX_LENGTH) * 0.5) + #else + #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) + #endif #endif #ifdef MANUAL_Y_HOME_POS #define Y_HOME_POS MANUAL_Y_HOME_POS #elif ENABLED(BED_CENTER_AT_0_0) - #define Y_HOME_POS ((Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5) + #if ENABLED(DELTA) + #define Y_HOME_POS 0 + #else + #define Y_HOME_POS ((Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5) + #endif #else - #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) + #if ENABLED(DELTA) + #define Y_HOME_POS ((Y_MAX_LENGTH) * 0.5) + #else + #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) + #endif #endif #ifdef MANUAL_Z_HOME_POS From ad68b4cb8bf42e5e36cba1b2d9722f98e3a64788 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Jul 2016 03:49:23 -0700 Subject: [PATCH 546/580] Followup to #4468 --- Marlin/ultralcd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 1d14e9eb6..5f0314903 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1437,14 +1437,14 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM(gcode, MSG_SELECT MSG_E2, PSTR("T1")); #endif - #if E_STEPPERS == 1 + #if E_MANUAL == 1 MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); #else MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0); MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1); - #if E_STEPPERS > 2 + #if E_MANUAL > 2 MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_e2); - #if E_STEPPERS > 3 + #if E_MANUAL > 3 MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_e3); #endif #endif From bdac2eb13aea7a96c535010dfb0d88a845d33f29 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Jul 2016 02:01:46 -0700 Subject: [PATCH 547/580] Don't set non-existent SLED_PIN --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c77a83096..47cf0ac6e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -939,7 +939,7 @@ void setup() { dac_init(); #endif - #if ENABLED(Z_PROBE_SLED) + #if ENABLED(Z_PROBE_SLED) && PIN_EXISTS(SLED) pinMode(SLED_PIN, OUTPUT); digitalWrite(SLED_PIN, LOW); // turn it off #endif // Z_PROBE_SLED @@ -1856,8 +1856,10 @@ static void clean_up_after_endstop_or_probe_move() { // Dock sled a bit closer to ensure proper capturing do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0)); - digitalWrite(SLED_PIN, !stow); // switch solenoid + #if PIN_EXISTS(SLED) + digitalWrite(SLED_PIN, !stow); // switch solenoid + #endif } #endif // Z_PROBE_SLED From 38658432835948b11ffeaf45187f505e82775590 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 29 Jul 2016 16:13:19 -0700 Subject: [PATCH 548/580] Consolidate setting of RAMPS High Voltage PWM outputs --- Marlin/pins_AZTEEG_X3.h | 6 ++- Marlin/pins_BAM_DICE_DUE.h | 6 ++- Marlin/pins_FELIX2.h | 9 +++-- Marlin/pins_MKS_13.h | 9 +++-- Marlin/pins_MKS_BASE.h | 9 +++-- Marlin/pins_RAMPS_14.h | 76 ++++++++++++++++++++++++------------ Marlin/pins_SAINSMART_2IN1.h | 18 ++++----- 7 files changed, 86 insertions(+), 47 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index f16eee310..ed8f4a5eb 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -24,9 +24,13 @@ * AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments */ +#if HOTENDS > 2 + #error "Azteeg X3 supports up to 2 hotends. Comment this line to keep going." +#endif + #define BOARD_NAME "Azteeg X3" -#include "pins_RAMPS_14_EFB.h" +#include "pins_RAMPS_14.h" #if ENABLED(VIKI2) || ENABLED(miniVIKI) diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h index a8e76a7ef..f75a6c442 100644 --- a/Marlin/pins_BAM_DICE_DUE.h +++ b/Marlin/pins_BAM_DICE_DUE.h @@ -24,9 +24,13 @@ * BAM&DICE Due (Arduino Mega) pin assignments */ +#if HOTENDS > 2 + #error "2PrintBeta Due supports up to 2 hotends. Comment this line to keep going." +#endif + #define BOARD_NAME "2PrintBeta Due" -#include "pins_RAMPS_14_EFB.h" +#include "pins_RAMPS_14.h" #undef TEMP_0_PIN #undef TEMP_1_PIN diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index 7bb724bf5..16ad9f4f7 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -24,12 +24,15 @@ * FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments */ +#if HOTENDS > 2 + #error "Felix 2.0+ supports up to 2 hotends. Comment this line to keep going." +#endif + #define BOARD_NAME "Felix 2.0+" -#include "pins_RAMPS_14_EFB.h" +#define HI_VOLT_PIN_D 7 -#undef HEATER_1_PIN -#define HEATER_1_PIN 7 // EXTRUDER 2 +#include "pins_RAMPS_14_EFB.h" #undef SDPOWER #define SDPOWER 1 diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index 00da20644..e536d870b 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -29,12 +29,15 @@ * MKS v1.4 (Extruder, Extruder, Fan, Bed) */ +#if HOTENDS > 2 + #error "MKS 1.3/1.4 supports up to 2 hotends. Comment this line to keep going." +#endif + #define BOARD_NAME "MKS > v1.3" -#include "pins_RAMPS_14_EFB.h" +#define HI_VOLT_PIN_D 7 -#undef HEATER_1_PIN -#define HEATER_1_PIN 7 // EXTRUDER 2 (-1 on RAMPS 1.4) +#include "pins_RAMPS_14_EFB.h" #if ENABLED(VIKI2) || ENABLED(miniVIKI) /** diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h index 3c721f5ff..583f82b1d 100644 --- a/Marlin/pins_MKS_BASE.h +++ b/Marlin/pins_MKS_BASE.h @@ -24,9 +24,12 @@ * MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments */ +#if HOTENDS > 2 + #error "MKS BASE 1.0 supports up to 2 hotends. Comment this line to keep going." +#endif + #define BOARD_NAME "MKS BASE 1.0" -#include "pins_RAMPS_14_EFB.h" +#define HI_VOLT_PIN_D 7 -#undef HEATER_1_PIN -#define HEATER_1_PIN 7 +#include "pins_RAMPS_14_EFB.h" \ No newline at end of file diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 9f10dd65c..a8c9d3eb7 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -105,32 +105,7 @@ // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector #define FIL_RUNOUT_PIN 4 -#if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB) - #define FAN_PIN 9 // (Sprinter config) - #if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) - #define CONTROLLERFAN_PIN -1 // Pin used for the fan to cool controller - #endif -#elif MB(RAMPS_14_EEF) || MB(RAMPS_14_SF) || MB(RAMPS_13_EEF) || MB(RAMPS_13_SF) - #define FAN_PIN 8 -#else - #define FAN_PIN 4 // IO pin. Buffer needed -#endif - #define PS_ON_PIN 12 - -#if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) - #define HEATER_0_PIN 8 -#else - #define HEATER_0_PIN 10 // EXTRUDER 1 - #if !MB(RAMPS_14_EEF) && !MB(RAMPS_13_EEF) && !MB(RAMPS_14_SF) && !MB(RAMPS_13_SF) - #define HEATER_BED_PIN 8 // BED - #endif -#endif - -#if !MB(RAMPS_14_SF) && !MB(RAMPS_13_SF) && !ENABLED(IS_RAMPS_EFB) - #define HEATER_1_PIN 9 // EXTRUDER 2 (FAN On Sprinter) -#endif - #define TEMP_0_PIN 13 // ANALOG NUMBERING #define TEMP_1_PIN 15 // ANALOG NUMBERING #define TEMP_BED_PIN 14 // ANALOG NUMBERING @@ -139,6 +114,56 @@ #define SLED_PIN -1 #endif + +/** + * Hi Voltage PWM Pin Assignments + */ + +#ifndef HI_VOLT_PIN_D + #define HI_VOLT_PIN_D -1 +#endif +#ifndef HI_VOLT_PIN_C + #define HI_VOLT_PIN_C 8 +#endif +#ifndef HI_VOLT_PIN_B + #define HI_VOLT_PIN_B 9 +#endif +#ifndef HI_VOLT_PIN_A + #define HI_VOLT_PIN_A 10 +#endif + +#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed + #define HEATER_0_PIN HI_VOLT_PIN_A + #define FAN_PIN HI_VOLT_PIN_B + #define HEATER_BED_PIN HI_VOLT_PIN_C + #if EXTRUDERS == 1 + #define FAN1_PIN HI_VOLT_PIN_D + #else + #define HEATER_1_PIN HI_VOLT_PIN_D + #endif +#elif MB(RAMPS_13_EEF) || MB(RAMPS_14_EEF) // Hotend, Hotend, Fan + #define HEATER_0_PIN HI_VOLT_PIN_A + #define HEATER_1_PIN HI_VOLT_PIN_B + #define FAN_PIN HI_VOLT_PIN_C +#elif MB(RAMPS_13_EEB) || MB(RAMPS_14_EEB) // Hotend, Hotend, Bed + #define HEATER_0_PIN HI_VOLT_PIN_A + #define HEATER_1_PIN HI_VOLT_PIN_B + #define HEATER_BED_PIN HI_VOLT_PIN_C + #define FAN_PIN 4 // IO pin. Buffer needed +#elif MB(RAMPS_13_EFF) || MB(RAMPS_14_EFF) // Hotend, Fan, Fan (EFF is reversed?) + #define HEATER_0_PIN HI_VOLT_PIN_C + #define FAN_PIN HI_VOLT_PIN_B + #define FAN1_PIN HI_VOLT_PIN_A + #define CONTROLLERFAN_PIN -1 +#elif MB(RAMPS_13_SF) || MB(RAMPS_14_SF) // Spindle, Fan + #define FAN_PIN HI_VOLT_PIN_C +#endif + + +/** + * LCD Controller Pin Assignments + */ + #if ENABLED(ULTRA_LCD) #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) @@ -301,4 +326,3 @@ #else #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif - diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h index 3664fbd3a..cc74c910a 100644 --- a/Marlin/pins_SAINSMART_2IN1.h +++ b/Marlin/pins_SAINSMART_2IN1.h @@ -24,16 +24,14 @@ * Sainsmart 2-in-1 pin assignments */ -#include "pins_RAMPS_14_EFB.h" - -#undef BOARD_NAME -#define BOARD_NAME "Sainsmart" +#if HOTENDS > 2 + #error "Sainsmart 2-in-1 supports up to 2 hotends. Comment this line to keep going." +#endif -#undef FAN_PIN -#define FAN_PIN 7 // PART FAN in front of board next to Extruder heat +#define BOARD_NAME "Sainsmart" -#undef HEATER_0_PIN -#define HEATER_0_PIN 9 // EXTRUDER 1 +#define HI_VOLT_PIN_A 9 +#define HI_VOLT_PIN_B 7 // PART FAN in front of board next to Extruder heat +#define HI_VOLT_PIN_D 10 -#undef HEATER_1_PIN -#define HEATER_1_PIN 10 // EXTRUDER 2 +#include "pins_RAMPS_14_EFB.h" From 223b7e473ffa554eb52e4d52ec537bd8a4b470f9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Jul 2016 03:02:03 -0700 Subject: [PATCH 549/580] RAMPS assignment for derivatives --- Marlin/pins_RAMPS_14.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index a8c9d3eb7..207743822 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -114,6 +114,25 @@ #define SLED_PIN -1 #endif +/* + +// Augmentation for auto-assigning RAMPS plugs + +#if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) + #if HOTENDS > 1 + #if TEMP_SENSOR_BED + #define IS_RAMPS_EEB + #else + #define IS_RAMPS_EEF + #endif + #elif TEMP_SENSOR_BED + #define IS_RAMPS_EFB + #else + #define IS_RAMPS_EFF + #endif +#endif + +*/ /** * Hi Voltage PWM Pin Assignments @@ -157,6 +176,15 @@ #define CONTROLLERFAN_PIN -1 #elif MB(RAMPS_13_SF) || MB(RAMPS_14_SF) // Spindle, Fan #define FAN_PIN HI_VOLT_PIN_C +#else // Non-specific are "EFB" by legacy + #define HEATER_0_PIN HI_VOLT_PIN_A + #define FAN_PIN HI_VOLT_PIN_B + #define HEATER_BED_PIN HI_VOLT_PIN_C + #if HOTENDS == 1 + #define FAN1_PIN HI_VOLT_PIN_D + #else + #define HEATER_1_PIN HI_VOLT_PIN_D + #endif #endif From d3b713cebcf302896ca388470a76463450d7297d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Jul 2016 03:07:20 -0700 Subject: [PATCH 550/580] Set flags for RAMPS "type" in pins.h --- Marlin/pins.h | 30 ++++++++++++++++++++++++++---- Marlin/pins_FELIX2.h | 2 +- Marlin/pins_MKS_13.h | 2 +- Marlin/pins_MKS_BASE.h | 2 +- Marlin/pins_RAMPS_13_EFB.h | 32 -------------------------------- Marlin/pins_RAMPS_14.h | 15 +++++---------- Marlin/pins_RAMPS_14_EFB.h | 34 ---------------------------------- Marlin/pins_SAINSMART_2IN1.h | 9 +++++---- 8 files changed, 39 insertions(+), 87 deletions(-) delete mode 100644 Marlin/pins_RAMPS_13_EFB.h delete mode 100644 Marlin/pins_RAMPS_14_EFB.h diff --git a/Marlin/pins.h b/Marlin/pins.h index 8133f4db5..548d44fdf 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -42,12 +42,34 @@ #elif MB(RAMPS_OLD) #include "pins_RAMPS_OLD.h" #elif MB(RAMPS_13_EFB) - #include "pins_RAMPS_13_EFB.h" -#elif MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF) || MB(RAMPS_13_SF) + #define IS_RAMPS_EFB + #include "pins_RAMPS_13.h" +#elif MB(RAMPS_13_EEB) + #define IS_RAMPS_EEB + #include "pins_RAMPS_13.h" +#elif MB(RAMPS_13_EFF) + #define IS_RAMPS_EFF + #include "pins_RAMPS_13.h" +#elif MB(RAMPS_13_EEF) + #define IS_RAMPS_EEF + #include "pins_RAMPS_13.h" +#elif MB(RAMPS_13_SF) + #define IS_RAMPS_SF #include "pins_RAMPS_13.h" #elif MB(RAMPS_14_EFB) - #include "pins_RAMPS_14_EFB.h" -#elif MB(RAMPS_14_EEB) || MB(RAMPS_14_EFF) || MB(RAMPS_14_EEF) || MB(RAMPS_14_SF) + #define IS_RAMPS_EFB + #include "pins_RAMPS_14.h" +#elif MB(RAMPS_14_EEB) + #define IS_RAMPS_EEB + #include "pins_RAMPS_14.h" +#elif MB(RAMPS_14_EFF) + #define IS_RAMPS_EFF + #include "pins_RAMPS_14.h" +#elif MB(RAMPS_14_EEF) + #define IS_RAMPS_EEF + #include "pins_RAMPS_14.h" +#elif MB(RAMPS_14_SF) + #define IS_RAMPS_SF #include "pins_RAMPS_14.h" #elif MB(GEN6) #include "pins_GEN6.h" diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index 16ad9f4f7..d164f99c7 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -32,7 +32,7 @@ #define HI_VOLT_PIN_D 7 -#include "pins_RAMPS_14_EFB.h" +#include "pins_RAMPS_14.h" #undef SDPOWER #define SDPOWER 1 diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index e536d870b..eee34dd6f 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -37,7 +37,7 @@ #define HI_VOLT_PIN_D 7 -#include "pins_RAMPS_14_EFB.h" +#include "pins_RAMPS_14.h" #if ENABLED(VIKI2) || ENABLED(miniVIKI) /** diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h index 583f82b1d..92895b1d7 100644 --- a/Marlin/pins_MKS_BASE.h +++ b/Marlin/pins_MKS_BASE.h @@ -32,4 +32,4 @@ #define HI_VOLT_PIN_D 7 -#include "pins_RAMPS_14_EFB.h" \ No newline at end of file +#include "pins_RAMPS_14.h" \ No newline at end of file diff --git a/Marlin/pins_RAMPS_13_EFB.h b/Marlin/pins_RAMPS_13_EFB.h deleted file mode 100644 index 80e292729..000000000 --- a/Marlin/pins_RAMPS_13_EFB.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.3 pin assignments - * - * RAMPS_13_EFB (Extruder, Fan, Bed) - */ - -#define BOARD_NAME "RAMPS 1.3 EFB" - -#define IS_RAMPS_13 -#include "pins_RAMPS_14_EFB.h" diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS_14.h index 207743822..7cb89e996 100644 --- a/Marlin/pins_RAMPS_14.h +++ b/Marlin/pins_RAMPS_14.h @@ -151,30 +151,25 @@ #define HI_VOLT_PIN_A 10 #endif -#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed +#if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed #define HEATER_0_PIN HI_VOLT_PIN_A #define FAN_PIN HI_VOLT_PIN_B #define HEATER_BED_PIN HI_VOLT_PIN_C - #if EXTRUDERS == 1 - #define FAN1_PIN HI_VOLT_PIN_D - #else - #define HEATER_1_PIN HI_VOLT_PIN_D - #endif -#elif MB(RAMPS_13_EEF) || MB(RAMPS_14_EEF) // Hotend, Hotend, Fan +#elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan #define HEATER_0_PIN HI_VOLT_PIN_A #define HEATER_1_PIN HI_VOLT_PIN_B #define FAN_PIN HI_VOLT_PIN_C -#elif MB(RAMPS_13_EEB) || MB(RAMPS_14_EEB) // Hotend, Hotend, Bed +#elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed #define HEATER_0_PIN HI_VOLT_PIN_A #define HEATER_1_PIN HI_VOLT_PIN_B #define HEATER_BED_PIN HI_VOLT_PIN_C #define FAN_PIN 4 // IO pin. Buffer needed -#elif MB(RAMPS_13_EFF) || MB(RAMPS_14_EFF) // Hotend, Fan, Fan (EFF is reversed?) +#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan (EFF is reversed?) #define HEATER_0_PIN HI_VOLT_PIN_C #define FAN_PIN HI_VOLT_PIN_B #define FAN1_PIN HI_VOLT_PIN_A #define CONTROLLERFAN_PIN -1 -#elif MB(RAMPS_13_SF) || MB(RAMPS_14_SF) // Spindle, Fan +#elif ENABLED(IS_RAMPS_SF) // Spindle, Fan #define FAN_PIN HI_VOLT_PIN_C #else // Non-specific are "EFB" by legacy #define HEATER_0_PIN HI_VOLT_PIN_A diff --git a/Marlin/pins_RAMPS_14_EFB.h b/Marlin/pins_RAMPS_14_EFB.h deleted file mode 100644 index b7282ea56..000000000 --- a/Marlin/pins_RAMPS_14_EFB.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * Arduino Mega with RAMPS v1.4 pin assignments - * - * RAMPS_14_EFB (Extruder, Fan, Bed) - */ - -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.4 EFB" -#endif - -#define IS_RAMPS_EFB -#include "pins_RAMPS_14.h" diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h index cc74c910a..c032d4d6f 100644 --- a/Marlin/pins_SAINSMART_2IN1.h +++ b/Marlin/pins_SAINSMART_2IN1.h @@ -30,8 +30,9 @@ #define BOARD_NAME "Sainsmart" -#define HI_VOLT_PIN_A 9 -#define HI_VOLT_PIN_B 7 // PART FAN in front of board next to Extruder heat -#define HI_VOLT_PIN_D 10 +#define HI_VOLT_PIN_A 9 // E +#define HI_VOLT_PIN_B 7 // F PART FAN in front of board next to Extruder heat + // HI_VOLT_PIN_C 8 // B +#define HI_VOLT_PIN_D 10 // F / E -#include "pins_RAMPS_14_EFB.h" +#include "pins_RAMPS_14.h" From 49f75b7891423728c27c7bc0871defdaa0b3b64d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Jul 2016 03:10:30 -0700 Subject: [PATCH 551/580] pins_RAMPS_14.h => pins_RAMPS.h --- .travis.yml | 6 +++--- Marlin/pins.h | 12 ++++++------ Marlin/pins_3DRAG.h | 2 +- Marlin/pins_AZTEEG_X3.h | 2 +- Marlin/pins_AZTEEG_X3_PRO.h | 2 +- Marlin/pins_BAM_DICE_DUE.h | 2 +- Marlin/pins_FELIX2.h | 2 +- Marlin/pins_MKS_13.h | 2 +- Marlin/pins_MKS_BASE.h | 2 +- Marlin/{pins_RAMPS_14.h => pins_RAMPS.h} | 0 Marlin/pins_RAMPS_13.h | 2 +- Marlin/pins_RIGIDBOARD.h | 2 +- Marlin/pins_SAINSMART_2IN1.h | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) rename Marlin/{pins_RAMPS_14.h => pins_RAMPS.h} (100%) diff --git a/.travis.yml b/.travis.yml index 75dc16926..23d673f4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,11 +56,11 @@ before_script: # script: # - # Backup Configuration.h, Configuration_adv.h, and pins_RAMPS_14.h + # Backup Configuration.h, Configuration_adv.h, and pins_RAMPS.h # - cp Marlin/Configuration.h Marlin/Configuration.h.backup - cp Marlin/Configuration_adv.h Marlin/Configuration_adv.h.backup - - cp Marlin/pins_RAMPS_14.h Marlin/pins_RAMPS_14.h.backup + - cp Marlin/pins_RAMPS.h Marlin/pins_RAMPS.h.backup # # Build with the default configurations # @@ -221,7 +221,7 @@ script: # - restore_configs - opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS - - pins_set RAMPS_14 X_MAX_PIN -1 + - pins_set RAMPS X_MAX_PIN -1 - opt_set_adv Z2_MAX_PIN 2 - build_marlin # diff --git a/Marlin/pins.h b/Marlin/pins.h index 548d44fdf..3657675db 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -58,19 +58,19 @@ #include "pins_RAMPS_13.h" #elif MB(RAMPS_14_EFB) #define IS_RAMPS_EFB - #include "pins_RAMPS_14.h" + #include "pins_RAMPS.h" #elif MB(RAMPS_14_EEB) #define IS_RAMPS_EEB - #include "pins_RAMPS_14.h" + #include "pins_RAMPS.h" #elif MB(RAMPS_14_EFF) #define IS_RAMPS_EFF - #include "pins_RAMPS_14.h" + #include "pins_RAMPS.h" #elif MB(RAMPS_14_EEF) #define IS_RAMPS_EEF - #include "pins_RAMPS_14.h" + #include "pins_RAMPS.h" #elif MB(RAMPS_14_SF) #define IS_RAMPS_SF - #include "pins_RAMPS_14.h" + #include "pins_RAMPS.h" #elif MB(GEN6) #include "pins_GEN6.h" #elif MB(GEN6_DELUXE) @@ -146,7 +146,7 @@ #elif MB(LEAPFROG) #include "pins_LEAPFROG.h" #elif MB(BAM_DICE) - #include "pins_RAMPS_14.h" + #include "pins_RAMPS.h" #elif MB(BAM_DICE_DUE) #include "pins_BAM_DICE_DUE.h" #elif MB(FELIX2) diff --git a/Marlin/pins_3DRAG.h b/Marlin/pins_3DRAG.h index db19e5df2..a3a616902 100644 --- a/Marlin/pins_3DRAG.h +++ b/Marlin/pins_3DRAG.h @@ -36,7 +36,7 @@ #define DEFAULT_SOURCE_CODE_URL "http://3dprint.elettronicain.it/" #endif -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" #undef Z_ENABLE_PIN #define Z_ENABLE_PIN 63 diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index ed8f4a5eb..05a5a269f 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -30,7 +30,7 @@ #define BOARD_NAME "Azteeg X3" -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" #if ENABLED(VIKI2) || ENABLED(miniVIKI) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 3331a299a..b531ec30d 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -26,7 +26,7 @@ #define BOARD_NAME "Azteeg X3 Pro" -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" #undef FAN_PIN #define FAN_PIN 6 //Part Cooling System diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h index f75a6c442..0c5914f2b 100644 --- a/Marlin/pins_BAM_DICE_DUE.h +++ b/Marlin/pins_BAM_DICE_DUE.h @@ -30,7 +30,7 @@ #define BOARD_NAME "2PrintBeta Due" -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" #undef TEMP_0_PIN #undef TEMP_1_PIN diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index d164f99c7..31c67ad19 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -32,7 +32,7 @@ #define HI_VOLT_PIN_D 7 -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" #undef SDPOWER #define SDPOWER 1 diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index eee34dd6f..065a0f2aa 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -37,7 +37,7 @@ #define HI_VOLT_PIN_D 7 -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" #if ENABLED(VIKI2) || ENABLED(miniVIKI) /** diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h index 92895b1d7..fc7a7f1fe 100644 --- a/Marlin/pins_MKS_BASE.h +++ b/Marlin/pins_MKS_BASE.h @@ -32,4 +32,4 @@ #define HI_VOLT_PIN_D 7 -#include "pins_RAMPS_14.h" \ No newline at end of file +#include "pins_RAMPS.h" \ No newline at end of file diff --git a/Marlin/pins_RAMPS_14.h b/Marlin/pins_RAMPS.h similarity index 100% rename from Marlin/pins_RAMPS_14.h rename to Marlin/pins_RAMPS.h diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index e3a854b11..effce9070 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -38,4 +38,4 @@ #endif #define IS_RAMPS_13 -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" diff --git a/Marlin/pins_RIGIDBOARD.h b/Marlin/pins_RIGIDBOARD.h index 7fdc1ae30..6b7645205 100644 --- a/Marlin/pins_RIGIDBOARD.h +++ b/Marlin/pins_RIGIDBOARD.h @@ -24,7 +24,7 @@ * RIGIDBOARD Arduino Mega with RAMPS v1.4 pin assignments */ -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" #undef BOARD_NAME #define BOARD_NAME "RigidBoard" diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h index c032d4d6f..848b10d44 100644 --- a/Marlin/pins_SAINSMART_2IN1.h +++ b/Marlin/pins_SAINSMART_2IN1.h @@ -35,4 +35,4 @@ // HI_VOLT_PIN_C 8 // B #define HI_VOLT_PIN_D 10 // F / E -#include "pins_RAMPS_14.h" +#include "pins_RAMPS.h" From de951c64f1fbb9e0aa275b98d1a881c563825307 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Jul 2016 04:03:45 -0700 Subject: [PATCH 552/580] Make pins for EFF a consistent order --- Marlin/pins_RAMPS.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Marlin/pins_RAMPS.h b/Marlin/pins_RAMPS.h index 7cb89e996..9aa45e5f6 100644 --- a/Marlin/pins_RAMPS.h +++ b/Marlin/pins_RAMPS.h @@ -151,28 +151,27 @@ #define HI_VOLT_PIN_A 10 #endif +#define HEATER_0_PIN HI_VOLT_PIN_A + #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed - #define HEATER_0_PIN HI_VOLT_PIN_A #define FAN_PIN HI_VOLT_PIN_B #define HEATER_BED_PIN HI_VOLT_PIN_C + #define FAN1_PIN 4 // IO pin. Buffer needed #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan - #define HEATER_0_PIN HI_VOLT_PIN_A #define HEATER_1_PIN HI_VOLT_PIN_B #define FAN_PIN HI_VOLT_PIN_C + #define FAN1_PIN 4 // IO pin. Buffer needed #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define HEATER_0_PIN HI_VOLT_PIN_A #define HEATER_1_PIN HI_VOLT_PIN_B #define HEATER_BED_PIN HI_VOLT_PIN_C - #define FAN_PIN 4 // IO pin. Buffer needed -#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan (EFF is reversed?) - #define HEATER_0_PIN HI_VOLT_PIN_C + #define FAN_PIN 4 // IO pin. Buffer needed +#elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan #define FAN_PIN HI_VOLT_PIN_B - #define FAN1_PIN HI_VOLT_PIN_A + #define FAN1_PIN HI_VOLT_PIN_C #define CONTROLLERFAN_PIN -1 #elif ENABLED(IS_RAMPS_SF) // Spindle, Fan #define FAN_PIN HI_VOLT_PIN_C #else // Non-specific are "EFB" by legacy - #define HEATER_0_PIN HI_VOLT_PIN_A #define FAN_PIN HI_VOLT_PIN_B #define HEATER_BED_PIN HI_VOLT_PIN_C #if HOTENDS == 1 From 83d341c39408b0ec2bedabdb9fd7545049f4cba6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Jul 2016 04:25:30 -0700 Subject: [PATCH 553/580] Make Conditionals.h a catch-all for old configs --- Marlin/Conditionals.h | 2 +- Marlin/MarlinSerial.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index baa822d7f..ff6c6b187 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -24,4 +24,4 @@ * Conditionals.h * OBSOLETE: Replaced by Conditionals_LCD.h and Conditionals_post.h */ -#include "SanityCheck.h" +#error "Old configurations? Please delete all #include lines from Configuration.h and Configuration_adv.h." diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index d2f5623cb..304b3be07 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -451,7 +451,7 @@ MarlinSerial customizedSerial; #if ENABLED(EMERGENCY_PARSER) // Currently looking for: M108, M112, M410 - // If you alter the parser please don't forget to update the capabilities in Conditionals.h + // If you alter the parser please don't forget to update the capabilities in Conditionals_post.h FORCE_INLINE void emergency_parser(unsigned char c) { From 657ef8aded24dee3a8b300245732d17fbf14cd99 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 30 Jul 2016 20:31:13 +0900 Subject: [PATCH 554/580] Follow-up the PR #4408 (Add support for reprapworld LCD), etc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Put #define REPRAPWORLD_GRAPHICAL_LCD into all the example configuration files ・Adjust spacing --- Marlin/example_configurations/Cartesio/Configuration.h | 7 ++++++- Marlin/example_configurations/Felix/Configuration.h | 7 ++++++- Marlin/example_configurations/Felix/DUAL/Configuration.h | 7 ++++++- Marlin/example_configurations/Hephestos/Configuration.h | 7 ++++++- Marlin/example_configurations/Hephestos_2/Configuration.h | 6 ++++++ Marlin/example_configurations/K8200/Configuration.h | 7 ++++++- Marlin/example_configurations/K8400/Configuration.h | 7 ++++++- .../example_configurations/K8400/Dual-head/Configuration.h | 7 ++++++- .../RepRapWorld/Megatronics/Configuration.h | 7 ++++++- Marlin/example_configurations/RigidBot/Configuration.h | 7 ++++++- Marlin/example_configurations/SCARA/Configuration.h | 7 ++++++- Marlin/example_configurations/TAZ4/Configuration.h | 7 ++++++- Marlin/example_configurations/WITBOX/Configuration.h | 6 ++++++ .../example_configurations/adafruit/ST7565/Configuration.h | 7 ++++++- Marlin/example_configurations/delta/biv2.5/Configuration.h | 7 ++++++- .../example_configurations/delta/generic/Configuration.h | 7 ++++++- .../delta/kossel_mini/Configuration.h | 7 ++++++- .../delta/kossel_pro/Configuration.h | 7 ++++++- .../example_configurations/delta/kossel_xl/Configuration.h | 7 ++++++- Marlin/example_configurations/makibox/Configuration.h | 7 ++++++- .../example_configurations/tvrrug/Round2/Configuration.h | 6 ++++++ 21 files changed, 126 insertions(+), 18 deletions(-) diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index baaa50efe..54505b66b 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // #define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1100,6 +1099,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 37e7a8bd0..95a414580 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1083,6 +1082,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 79139204c..49ce86a76 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1081,6 +1080,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index e05f316d8..478d5c755 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1092,6 +1091,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 6dab03178..bb4b483be 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1093,6 +1093,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 7f2906e8f..1a740067c 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -110,7 +110,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1117,6 +1116,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index a078cfab7..c525b2203 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1100,6 +1099,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 6f09a5ed9..7713ed90b 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1100,6 +1099,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 6a39704c5..67d6ddeb6 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1100,6 +1099,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index b2c044321..1ea13b9a4 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1098,6 +1097,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index a83d52a8c..389c6de23 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -128,7 +128,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1108,6 +1107,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 14bb485d9..113a4f922 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1121,6 +1120,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 35b4695a6..e422e7c4f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1091,6 +1091,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 05dcf15c1..633d13090 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1100,6 +1099,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 39b984021..0f1ef7e44 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1193,6 +1192,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 8b17b1ece..d6cb1a1d0 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1187,6 +1186,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 825333b71..bdd3afc44 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1190,6 +1189,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index d46d9b9ed..3764b52d9 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -109,7 +109,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1190,6 +1189,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index f4c0fc5cd..8c6195bb3 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -96,7 +96,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1193,6 +1192,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 79f427cfa..49196a128 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -103,7 +103,6 @@ // example configuration folder. // //#define SHOW_CUSTOM_BOOTSCREEN - // @section machine // SERIAL_PORT selects which serial port should be used for communication with the host. @@ -1103,6 +1102,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 53739f34a..60ba4d6ca 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1093,6 +1093,12 @@ // //#define MAKRPANEL +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + // // Activate one of these if you have a Panucatt Devices // Viki 2.0 or mini Viki with Graphic LCD From cd5b03d88fb39d982dae2cd58ea96685c129a713 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 30 Jul 2016 21:21:21 +0900 Subject: [PATCH 555/580] Update distribution date and readme --- Marlin/Version.h | 2 +- README.md | 43 ++++++++++++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 6a34f6fd8..5aa79221a 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -48,7 +48,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ - #define STRING_DISTRIBUTION_DATE "2016-04-27 12:00" + #define STRING_DISTRIBUTION_DATE "2016-07-26 12:00" /** * Required minimum Configuration.h and Configuration_adv.h file versions. diff --git a/README.md b/README.md index 58597efee..112b0eadc 100644 --- a/README.md +++ b/README.md @@ -5,28 +5,49 @@ -Additional documentation can be found in [The Marlin Wiki](https://github.com/MarlinFirmware/Marlin/wiki). +Additional documentation can be found at [The Marlin Documentation Project](https://www.marlinfw.org/). Please test this firmware and inform us if it misbehaves in any way, volunteers are standing by! -## Release Candidate -- Marlin 1.1.0-RCBugFix - 27 April 2016 +## Release Candidate -- Marlin 1.1.0-RCBugFix - 26 July 2016 __Not for production use – use with caution!__ You can download earlier versions of Marlin on the [Releases page](https://github.com/MarlinFirmware/Marlin/releases). (The latest "stable" release of Marlin is 1.0.2-1.) -You'll always find the latest Release Candidate in the ["RC" branch](https://github.com/MarlinFirmware/Marlin/tree/RC). Bugs that we find in the current Release Candidate are patched in the ["RCBugFix" branch](https://github.com/MarlinFirmware/Marlin/tree/RCBugFix), so during beta testing this is where you can always find the latest code on its way towards release. - -Future development (Marlin 1.2 and beyond) takes place in the [MarlinDev repository](https://github.com/MarlinFirmware/MarlinDev/). +The latest Release Candidate lives in the ["RC" branch](https://github.com/MarlinFirmware/Marlin/tree/RC). Bugs that we find in the current Release Candidate are patched in the ["RCBugFix" branch](https://github.com/MarlinFirmware/Marlin/tree/RCBugFix), so during beta testing this is where you can always find the latest code on its way towards release. ## Recent Changes - RCBugFix +- RC7 - 26 Jul 2016 + - Add Print Job Timer and Print Counter (`PRINTCOUNTER`) + - New `M600` Filament Change (`FILAMENT_CHANGE_FEATURE`) + - New `G12` Nozzle Clean (`NOZZLE_CLEAN_FEATURE`) + - New `G27` Nozzle Park (`NOZZLE_PARK_FEATURE`) + - Add support for `COREYZ` + - Add a new Advance Extrusion algorithm (`LIN_ADVANCE`) + - Add support for inches, Fahrenheit, Kelvin units (`INCH_MODE_SUPPORT`, `TEMPERATURE_UNITS_SUPPORT`) + - Better handling of `G92` shifting of the coordinate space + - Add Greek and Croatian languages + - Improve the Manual (Mesh) Bed Leveling user interface + - Add support for more boards, controllers, and probes: + - Vellemann K8400 (`BOARD_K8400`) + - RigidBot V2 (`BOARD_RIGIDBOARD_V2`) + - Cartesio UI (`BOARD_CNCONTROLS_12`) + - BLTouch probe sensor (`BLTOUCH`) + - Viki 2 with RAMPS and MKS boards + - Improve support for `DELTA` and other kinematics + - Improve thermal management, add `WATCH_BED_TEMP_PERIOD` + - Better handling of toolchange, multiple tools + - Add support for two X steppers `X_DUAL_STEPPER_DRIVERS` + - Add support for `SINGLENOZZLE`, `MIXING_EXTRUDER`, and `SWITCHING_EXTRUDER` + - Simplified probe configuration, allow usage without bed leveling + - And much more… See the [1.1.0-RC7 Change Log](https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC7) for the complete list of changes. + - RC6 - 24 Apr 2016 - - Completed support for CoreXY / CoreXZ in planner - - Changes to positioning behavior - - Various issues fixed. More details pending. - - Throw error if compiling with older versions (<1.60) of Arduino due to serious problems with outdated Arduino versions - - Please upgrade your IDE at least to Arduino 1.6.0. Thanks. + - Marlin now requires Arduino version 1.6.0 or later + - Completed support for CoreXY / CoreXZ + - See the [1.1.0-RC6 Change Log](https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC6) for all the changes. - RC5 - 01 Apr 2016 - Warn if compiling with older versions (<1.50) of Arduino @@ -39,7 +60,7 @@ Future development (Marlin 1.2 and beyond) takes place in the [MarlinDev reposit - Rename FILAMENT_SENSOR to FILAMENT_WIDTH_SENSOR - Fix SD card bugs - and a lot more - - see https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC5 for details + - See the [1.1.0-RC5 Change Log](https://github.com/MarlinFirmware/Marlin/releases/tag/1.1.0-RC5) for more! - RC4 - 24 Mar 2016 - Many lingering bugs and nagging issues addressed From bd73e6d3c80458e6de54255b0a09a5f858834c65 Mon Sep 17 00:00:00 2001 From: esenapaj Date: Sat, 30 Jul 2016 22:43:33 +0900 Subject: [PATCH 556/580] Fix for PR #4452 (Additional heater-state output changes) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Add missing ';' --- Marlin/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c77a83096..88c92d605 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4462,7 +4462,7 @@ inline void gcode_M104() { SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(target_extruder), 1); #if ENABLED(SHOW_TEMP_ADC_VALUES) SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[target_extruder] / OVERSAMPLENR); - SERIAL_CHAR(')') + SERIAL_CHAR(')'); #endif #endif #if HAS_TEMP_BED @@ -4472,7 +4472,7 @@ inline void gcode_M104() { SERIAL_PROTOCOL_F(thermalManager.degTargetBed(), 1); #if ENABLED(SHOW_TEMP_ADC_VALUES) SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_bed_raw / OVERSAMPLENR); - SERIAL_CHAR(')') + SERIAL_CHAR(')'); #endif #endif #if HOTENDS > 1 @@ -4484,7 +4484,7 @@ inline void gcode_M104() { SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(e), 1); #if ENABLED(SHOW_TEMP_ADC_VALUES) SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[e] / OVERSAMPLENR); - SERIAL_CHAR(')') + SERIAL_CHAR(')'); #endif } #endif From fe059f122162d24bfb9427173656dc9606a2c06f Mon Sep 17 00:00:00 2001 From: Thomas Otvald Jensen Date: Sat, 30 Jul 2016 16:50:31 +0200 Subject: [PATCH 557/580] During homing, line_to_axis_pos will make a path which moves across the endstop trigger point. The move is stopped at endstop, so current_position should also be adjusted to reflect this! Caused error in subsequent call in endstop adjustment, since the movement would assume a wrong starting position. --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c77a83096..4982e389e 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2414,6 +2414,10 @@ static void homeaxis(AxisEnum axis) { // Move slowly towards the endstop until triggered line_to_axis_pos(axis, 2 * home_bump_mm(axis) * axis_home_dir, get_homing_bump_feedrate(axis)); + // reset current_position to 0 to reflect hitting endpoint + current_position[axis] = 0; + sync_plan_position(); + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position); #endif @@ -2430,7 +2434,6 @@ static void homeaxis(AxisEnum axis) { lockZ1 = (z_endstop_adj < 0); if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true); - sync_plan_position(); // Move to the adjusted endstop height line_to_axis_pos(axis, adj); @@ -2443,7 +2446,6 @@ static void homeaxis(AxisEnum axis) { #if ENABLED(DELTA) // retrace by the amount specified in endstop_adj if (endstop_adj[axis] * axis_home_dir < 0) { - sync_plan_position(); #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]); From 60ad365e218db1c74d0709ea4490945316cc4d4e Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 31 Jul 2016 15:48:36 +0200 Subject: [PATCH 558/580] repair-software-spi --- Marlin/Sd2Card.h | 16 ++++++++-------- Marlin/SdFatConfig.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/Sd2Card.h b/Marlin/Sd2Card.h index 8c19a5629..b1f442c4e 100644 --- a/Marlin/Sd2Card.h +++ b/Marlin/Sd2Card.h @@ -136,25 +136,25 @@ uint8_t const SD_CARD_TYPE_SDHC = 3; #if DISABLED(SOFTWARE_SPI) // hardware pin defs /** The default chip select pin for the SD card is SS. */ - uint8_t const SD_CHIP_SELECT_PIN = SS_PIN; + #define SD_CHIP_SELECT_PIN SS_PIN // The following three pins must not be redefined for hardware SPI. /** SPI Master Out Slave In pin */ - uint8_t const SPI_MOSI_PIN = MOSI_PIN; + #define SPI_MOSI_PIN MOSI_PIN /** SPI Master In Slave Out pin */ - uint8_t const SPI_MISO_PIN = MISO_PIN; + #define SPI_MISO_PIN MISO_PIN /** SPI Clock pin */ - uint8_t const SPI_SCK_PIN = SCK_PIN; + #define SPI_SCK_PIN SCK_PIN #else // SOFTWARE_SPI /** SPI chip select pin */ - uint8_t const SD_CHIP_SELECT_PIN = SOFT_SPI_CS_PIN; + #define SD_CHIP_SELECT_PIN SOFT_SPI_CS_PIN /** SPI Master Out Slave In pin */ - uint8_t const SPI_MOSI_PIN = SOFT_SPI_MOSI_PIN; + #define SPI_MOSI_PIN SOFT_SPI_MOSI_PIN /** SPI Master In Slave Out pin */ - uint8_t const SPI_MISO_PIN = SOFT_SPI_MISO_PIN; + #define SPI_MISO_PIN SOFT_SPI_MISO_PIN /** SPI Clock pin */ - uint8_t const SPI_SCK_PIN = SOFT_SPI_SCK_PIN; + #define SPI_SCK_PIN SOFT_SPI_SCK_PIN #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ /** diff --git a/Marlin/SdFatConfig.h b/Marlin/SdFatConfig.h index f9cb9fe14..d3406a028 100644 --- a/Marlin/SdFatConfig.h +++ b/Marlin/SdFatConfig.h @@ -104,13 +104,13 @@ #define USE_SOFTWARE_SPI 0 // define software SPI pins so Mega can use unmodified 168/328 shields /** Software SPI chip select pin for the SD */ - uint8_t const SOFT_SPI_CS_PIN = 10; + #define SOFT_SPI_CS_PIN 10 /** Software SPI Master Out Slave In pin */ - uint8_t const SOFT_SPI_MOSI_PIN = 11; + #define SOFT_SPI_MOSI_PIN 11 /** Software SPI Master In Slave Out pin */ - uint8_t const SOFT_SPI_MISO_PIN = 12; + #define SOFT_SPI_MISO_PIN 12 /** Software SPI Clock pin */ - uint8_t const SOFT_SPI_SCK_PIN = 13; + #define SOFT_SPI_SCK_PIN 13 //------------------------------------------------------------------------------ /** * The __cxa_pure_virtual function is an error handler that is invoked when From 49997e2e223df53d1b991e46e39b2bc6fdb8a9f8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Jul 2016 05:32:00 -0700 Subject: [PATCH 559/580] HI_VOLT_PIN => "RAMPS_Dn_PIN" --- Marlin/pins_FELIX2.h | 2 +- Marlin/pins_MKS_13.h | 2 +- Marlin/pins_MKS_BASE.h | 2 +- Marlin/pins_RAMPS.h | 50 ++++++++++++++++++------------------ Marlin/pins_SAINSMART_2IN1.h | 8 +++--- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index 31c67ad19..83ce47bf5 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -30,7 +30,7 @@ #define BOARD_NAME "Felix 2.0+" -#define HI_VOLT_PIN_D 7 +#define MOSFET_D_PIN 7 #include "pins_RAMPS.h" diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index 065a0f2aa..36fc0f7b8 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -35,7 +35,7 @@ #define BOARD_NAME "MKS > v1.3" -#define HI_VOLT_PIN_D 7 +#define MOSFET_D_PIN 7 #include "pins_RAMPS.h" diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h index fc7a7f1fe..fdaff0689 100644 --- a/Marlin/pins_MKS_BASE.h +++ b/Marlin/pins_MKS_BASE.h @@ -30,6 +30,6 @@ #define BOARD_NAME "MKS BASE 1.0" -#define HI_VOLT_PIN_D 7 +#define MOSFET_D_PIN 7 #include "pins_RAMPS.h" \ No newline at end of file diff --git a/Marlin/pins_RAMPS.h b/Marlin/pins_RAMPS.h index 9aa45e5f6..fb378e07f 100644 --- a/Marlin/pins_RAMPS.h +++ b/Marlin/pins_RAMPS.h @@ -138,49 +138,49 @@ * Hi Voltage PWM Pin Assignments */ -#ifndef HI_VOLT_PIN_D - #define HI_VOLT_PIN_D -1 +#ifndef MOSFET_D_PIN + #define MOSFET_D_PIN -1 #endif -#ifndef HI_VOLT_PIN_C - #define HI_VOLT_PIN_C 8 +#ifndef RAMPS_D8_PIN + #define RAMPS_D8_PIN 8 #endif -#ifndef HI_VOLT_PIN_B - #define HI_VOLT_PIN_B 9 +#ifndef RAMPS_D9_PIN + #define RAMPS_D9_PIN 9 #endif -#ifndef HI_VOLT_PIN_A - #define HI_VOLT_PIN_A 10 +#ifndef RAMPS_D10_PIN + #define RAMPS_D10_PIN 10 #endif -#define HEATER_0_PIN HI_VOLT_PIN_A +#define HEATER_0_PIN RAMPS_D10_PIN #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed - #define FAN_PIN HI_VOLT_PIN_B - #define HEATER_BED_PIN HI_VOLT_PIN_C - #define FAN1_PIN 4 // IO pin. Buffer needed + #define FAN_PIN RAMPS_D9_PIN + #define HEATER_BED_PIN RAMPS_D8_PIN #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan - #define HEATER_1_PIN HI_VOLT_PIN_B - #define FAN_PIN HI_VOLT_PIN_C - #define FAN1_PIN 4 // IO pin. Buffer needed + #define HEATER_1_PIN RAMPS_D9_PIN + #define FAN_PIN RAMPS_D8_PIN #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed - #define HEATER_1_PIN HI_VOLT_PIN_B - #define HEATER_BED_PIN HI_VOLT_PIN_C - #define FAN_PIN 4 // IO pin. Buffer needed + #define HEATER_1_PIN RAMPS_D9_PIN + #define HEATER_BED_PIN RAMPS_D8_PIN #elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan - #define FAN_PIN HI_VOLT_PIN_B - #define FAN1_PIN HI_VOLT_PIN_C + #define FAN_PIN RAMPS_D9_PIN + #define FAN1_PIN RAMPS_D8_PIN #define CONTROLLERFAN_PIN -1 #elif ENABLED(IS_RAMPS_SF) // Spindle, Fan - #define FAN_PIN HI_VOLT_PIN_C + #define FAN_PIN RAMPS_D8_PIN #else // Non-specific are "EFB" by legacy - #define FAN_PIN HI_VOLT_PIN_B - #define HEATER_BED_PIN HI_VOLT_PIN_C + #define FAN_PIN RAMPS_D9_PIN + #define HEATER_BED_PIN RAMPS_D8_PIN #if HOTENDS == 1 - #define FAN1_PIN HI_VOLT_PIN_D + #define FAN1_PIN MOSFET_D_PIN #else - #define HEATER_1_PIN HI_VOLT_PIN_D + #define HEATER_1_PIN MOSFET_D_PIN #endif #endif +#ifndef FAN_PIN + #define FAN_PIN 4 // IO pin. Buffer needed +#endif /** * LCD Controller Pin Assignments diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h index 848b10d44..8d272ada4 100644 --- a/Marlin/pins_SAINSMART_2IN1.h +++ b/Marlin/pins_SAINSMART_2IN1.h @@ -30,9 +30,9 @@ #define BOARD_NAME "Sainsmart" -#define HI_VOLT_PIN_A 9 // E -#define HI_VOLT_PIN_B 7 // F PART FAN in front of board next to Extruder heat - // HI_VOLT_PIN_C 8 // B -#define HI_VOLT_PIN_D 10 // F / E +#define RAMPS_D10_PIN 9 // E +#define RAMPS_D9_PIN 7 // F PART FAN in front of board next to Extruder heat + // RAMPS_D8_PIN 8 // B +#define MOSFET_D_PIN 10 // F / E #include "pins_RAMPS.h" From 63fd1f49a6ec8aedfa05ba0997ee32a4f6456085 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 31 Jul 2016 17:49:34 -0700 Subject: [PATCH 560/580] PID_EXTRUSION_SCALING, disabled by default --- Marlin/Configuration_adv.h | 4 ++-- Marlin/Marlin.h | 2 +- Marlin/Marlin_main.cpp | 8 ++++---- Marlin/SanityCheck.h | 2 ++ Marlin/configuration_store.cpp | 16 ++++++++-------- .../Cartesio/Configuration_adv.h | 4 ++-- .../Felix/Configuration_adv.h | 4 ++-- .../Hephestos/Configuration_adv.h | 4 ++-- .../Hephestos_2/Configuration_adv.h | 4 ++-- .../K8200/Configuration_adv.h | 4 ++-- .../K8400/Configuration_adv.h | 4 ++-- .../RigidBot/Configuration_adv.h | 4 ++-- .../SCARA/Configuration_adv.h | 4 ++-- .../TAZ4/Configuration_adv.h | 4 ++-- .../WITBOX/Configuration_adv.h | 4 ++-- .../delta/biv2.5/Configuration_adv.h | 4 ++-- .../delta/generic/Configuration_adv.h | 4 ++-- .../delta/kossel_mini/Configuration_adv.h | 4 ++-- .../delta/kossel_pro/Configuration_adv.h | 4 ++-- .../delta/kossel_xl/Configuration_adv.h | 4 ++-- .../makibox/Configuration_adv.h | 4 ++-- .../tvrrug/Round2/Configuration_adv.h | 4 ++-- Marlin/temperature.cpp | 18 +++++++++--------- Marlin/temperature.h | 8 ++++---- Marlin/ultralcd.cpp | 2 +- 25 files changed, 65 insertions(+), 63 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 410ee36ec..a822c83b1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 7f9275b68..cfa57eb0f 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -352,7 +352,7 @@ float code_value_temp_diff(); extern FilamentChangeMenuResponse filament_change_menu_response; #endif -#if ENABLED(PID_ADD_EXTRUSION_RATE) +#if ENABLED(PID_EXTRUSION_SCALING) extern int lpq_len; #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c77a83096..0e0f570b6 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -531,7 +531,7 @@ static bool send_ok[BUFSIZE]; boolean chdkActive = false; #endif -#if ENABLED(PID_ADD_EXTRUSION_RATE) +#if ENABLED(PID_EXTRUSION_SCALING) int lpq_len = 20; #endif @@ -5667,7 +5667,7 @@ inline void gcode_M226() { * I[float] Ki term (unscaled) * D[float] Kd term (unscaled) * - * With PID_ADD_EXTRUSION_RATE: + * With PID_EXTRUSION_SCALING: * * C[float] Kc term * L[float] LPQ length @@ -5682,7 +5682,7 @@ inline void gcode_M226() { if (code_seen('P')) PID_PARAM(Kp, e) = code_value_float(); if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value_float()); if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value_float()); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) if (code_seen('C')) PID_PARAM(Kc, e) = code_value_float(); if (code_seen('L')) lpq_len = code_value_float(); NOMORE(lpq_len, LPQ_MAX_LEN); @@ -5700,7 +5700,7 @@ inline void gcode_M226() { SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e))); SERIAL_ECHOPGM(" d:"); SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e))); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) SERIAL_ECHOPGM(" c:"); //Kc does not have scaling applied above, or in resetting defaults SERIAL_ECHO(PID_PARAM(Kc, e)); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 2cbdcc549..92e21f0d3 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -730,4 +730,6 @@ #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead." #elif defined(MANUAL_HOME_POSITIONS) #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead." +#elif defined(PID_ADD_EXTRUSION_RATE) + #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration." #endif diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index a8bc7b8e6..db10bba15 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -290,7 +290,7 @@ void Config_StoreSettings() { EEPROM_WRITE(PID_PARAM(Kp, e)); EEPROM_WRITE(PID_PARAM(Ki, e)); EEPROM_WRITE(PID_PARAM(Kd, e)); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) EEPROM_WRITE(PID_PARAM(Kc, e)); #else dummy = 1.0f; // 1.0 = default kc @@ -308,7 +308,7 @@ void Config_StoreSettings() { } // Hotends Loop - #if DISABLED(PID_ADD_EXTRUSION_RATE) + #if DISABLED(PID_EXTRUSION_SCALING) int lpq_len = 20; #endif EEPROM_WRITE(lpq_len); @@ -481,7 +481,7 @@ void Config_RetrieveSettings() { PID_PARAM(Kp, e) = dummy; EEPROM_READ(PID_PARAM(Ki, e)); EEPROM_READ(PID_PARAM(Kd, e)); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) EEPROM_READ(PID_PARAM(Kc, e)); #else EEPROM_READ(dummy); @@ -496,7 +496,7 @@ void Config_RetrieveSettings() { for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ(dummy); // Kp, Ki, Kd, Kc #endif // !PIDTEMP - #if DISABLED(PID_ADD_EXTRUSION_RATE) + #if DISABLED(PID_EXTRUSION_SCALING) int lpq_len; #endif EEPROM_READ(lpq_len); @@ -641,11 +641,11 @@ void Config_ResetDefault() { PID_PARAM(Kp, e) = DEFAULT_Kp; PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki); PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) PID_PARAM(Kc, e) = DEFAULT_Kc; #endif } - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) lpq_len = 20; // default last-position-queue size #endif #endif // PIDTEMP @@ -863,7 +863,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, e)); SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, e))); SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, e))); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e)); if (e == 0) SERIAL_ECHOPAIR(" L", lpq_len); #endif @@ -878,7 +878,7 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOPAIR(" M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0 SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0))); SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0))); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0)); SERIAL_ECHOPAIR(" L", lpq_len); #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 1c75864f2..3e10c3f85 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 84df93468..570073579 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 76fdb6b6f..b719e6072 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index e5fbb0071..eeb11da2d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 8a30f6bfb..dc26fd603 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -119,8 +119,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index f2b93daca..64efac984 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index f8d8223a4..2118f83d5 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index a142085ee..07f1e5654 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index e3546f0fd..d0d98fb9f 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 76fdb6b6f..b719e6072 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index d79183abf..9183be44b 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index bf4fe7126..eb79a3041 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 33f5d35ff..7ec5948d0 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index d54a8ac3b..811477921 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -118,8 +118,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 0b1d20635..2a7399bb0 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index e21cbf3c5..22cefd538 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 83bc8899f..2ececd4c3 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -113,8 +113,8 @@ #if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. - #define PID_ADD_EXTRUSION_RATE - #if ENABLED(PID_ADD_EXTRUSION_RATE) + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 4d342e8a1..35a2a3e9b 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -72,14 +72,14 @@ unsigned char Temperature::soft_pwm_bed; float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp), Temperature::Ki[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Ki) * (PID_dT)), Temperature::Kd[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Kd) / (PID_dT)); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) float Temperature::Kc[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kc); #endif #else float Temperature::Kp = DEFAULT_Kp, Temperature::Ki = (DEFAULT_Ki) * (PID_dT), Temperature::Kd = (DEFAULT_Kd) / (PID_dT); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) float Temperature::Kc = DEFAULT_Kc; #endif #endif @@ -126,7 +126,7 @@ volatile bool Temperature::temp_meas_ready = false; Temperature::iTerm[HOTENDS], Temperature::dTerm[HOTENDS]; - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) float Temperature::cTerm[HOTENDS]; long Temperature::last_e_position; long Temperature::lpq[LPQ_MAX_LEN]; @@ -444,7 +444,7 @@ Temperature::Temperature() { } void Temperature::updatePID() { #if ENABLED(PIDTEMP) - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) last_e_position = 0; #endif HOTEND_LOOP() { @@ -560,7 +560,7 @@ float Temperature::get_pid_output(int e) { pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX]; - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) cTerm[HOTEND_INDEX] = 0; if (_HOTEND_TEST) { long e_position = stepper.position(E_AXIS); @@ -575,7 +575,7 @@ float Temperature::get_pid_output(int e) { cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX); pid_output += cTerm[HOTEND_INDEX]; } - #endif //PID_ADD_EXTRUSION_RATE + #endif // PID_EXTRUSION_SCALING if (pid_output > PID_MAX) { if (pid_error[HOTEND_INDEX] > 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration @@ -598,7 +598,7 @@ float Temperature::get_pid_output(int e) { SERIAL_ECHOPAIR(MSG_PID_DEBUG_PTERM, pTerm[HOTEND_INDEX]); SERIAL_ECHOPAIR(MSG_PID_DEBUG_ITERM, iTerm[HOTEND_INDEX]); SERIAL_ECHOPAIR(MSG_PID_DEBUG_DTERM, dTerm[HOTEND_INDEX]); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) SERIAL_ECHOPAIR(MSG_PID_DEBUG_CTERM, cTerm[HOTEND_INDEX]); #endif SERIAL_EOL; @@ -949,7 +949,7 @@ void Temperature::init() { #if ENABLED(PIDTEMP) temp_iState_min[e] = 0.0; temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e); - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) last_e_position = 0; #endif #endif //PIDTEMP @@ -959,7 +959,7 @@ void Temperature::init() { #endif //PIDTEMPBED } - #if ENABLED(PIDTEMP) && ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING) last_e_position = 0; #endif diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 639eaad59..9a1de04ca 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -31,7 +31,7 @@ #include "planner.h" #include "thermistortables.h" -#if ENABLED(PID_ADD_EXTRUSION_RATE) +#if ENABLED(PID_EXTRUSION_SCALING) #include "stepper.h" #endif @@ -79,7 +79,7 @@ class Temperature { #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 static float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS]; - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) static float Kc[HOTENDS]; #endif #define PID_PARAM(param, h) Temperature::param[h] @@ -87,7 +87,7 @@ class Temperature { #else static float Kp, Ki, Kd; - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) static float Kc; #endif #define PID_PARAM(param, h) Temperature::param @@ -149,7 +149,7 @@ class Temperature { iTerm[HOTENDS], dTerm[HOTENDS]; - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) static float cTerm[HOTENDS]; static long last_e_position; static long lpq[LPQ_MAX_LEN]; diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 5f0314903..4e23e4ea3 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1684,7 +1684,7 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \ MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex) - #if ENABLED(PID_ADD_EXTRUSION_RATE) + #if ENABLED(PID_EXTRUSION_SCALING) #define _PID_MENU_ITEMS(ELABEL, eindex) \ _PID_BASE_MENU_ITEMS(ELABEL, eindex); \ MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990) From f83369b79c9e419de924544cda8be08882f13075 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 31 Jul 2016 18:00:54 -0700 Subject: [PATCH 561/580] Update refresh_positioning - no need for obj ref --- Marlin/planner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index ac41165d5..d786824e1 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1182,7 +1182,7 @@ void Planner::reset_acceleration_rates() { // Recalculate position, steps_to_mm if axis_steps_per_mm changes! void Planner::refresh_positioning() { - LOOP_XYZE(i) planner.steps_to_mm[i] = 1.0 / planner.axis_steps_per_mm[i]; + LOOP_XYZE(i) steps_to_mm[i] = 1.0 / axis_steps_per_mm[i]; #if ENABLED(DELTA) || ENABLED(SCARA) inverse_kinematics(current_position); set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]); From b15ef35568d3e265803efa16fc329f6366294cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Mon, 1 Aug 2016 13:53:51 +0100 Subject: [PATCH 562/580] Update the font README to link to marlinfw.org --- buildroot/share/fonts/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/buildroot/share/fonts/README.md b/buildroot/share/fonts/README.md index ccafbd777..ee9d8e00b 100644 --- a/buildroot/share/fonts/README.md +++ b/buildroot/share/fonts/README.md @@ -1,5 +1,6 @@ # Marlin fonts + ## Author and license The original author of the following font files is [A. Hardtung](https://github.com/AnHardt). @@ -15,6 +16,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ - ISO10646_Kana.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) - Marlin_symbols.fon ([fe2bd23](https://github.com/MarlinFirmware/Marlin/commit/fe2bd237d556439499dfdee852c1550c7a16430a)) -Any additional changes to these font files being distributed with Marlin are copyrighted under the terms of the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt) license. +Additional changes to the original font files being distritubted with Marlin are copyrighted under the terms of the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt) license. + ## Documentation +For detailed information about [adding new fonts](http://www.marlinfw.org/docs/development/fonts.html) to Marlin visit our documentation website. From 374ae6c0994f5222022f9373c5a359f84eba7bae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Aug 2016 16:07:31 -0700 Subject: [PATCH 563/580] Fix pins for RAMBO plus VIKI --- Marlin/pins_RAMBO.h | 57 +++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index e04fbc529..d1bd48bdd 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -114,9 +114,6 @@ #if ENABLED(NEWPANEL) - // Beeper on AUX-4 - #define BEEPER_PIN 79 - #define LCD_PINS_RS 70 #define LCD_PINS_ENABLE 71 #define LCD_PINS_D4 72 @@ -124,12 +121,36 @@ #define LCD_PINS_D6 74 #define LCD_PINS_D7 75 - //buttons are directly attached using AUX-2 - #define BTN_EN1 76 - #define BTN_EN2 77 - #define BTN_ENC 78 + #if ENABLED(VIKI2) || ENABLED(miniVIKI) + #define BEEPER_PIN 44 + + #define DOGLCD_A0 70 + #define DOGLCD_CS 71 + #define LCD_SCREEN_ROT_180 + + #define BTN_EN1 85 + #define BTN_EN2 84 + #define BTN_ENC 83 + + #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board + + #if ENABLED(TEMP_STAT_LEDS) + #define STAT_LED_RED 22 + #define STAT_LED_BLUE 32 + #endif - #define SD_DETECT_PIN 81 // Ramps doesn't use this + #else + + #define BEEPER_PIN 79 // AUX-4 + + // AUX-2 + #define BTN_EN1 76 + #define BTN_EN2 77 + #define BTN_ENC 78 + + #define SD_DETECT_PIN 81 + + #endif // VIKI2/miniVIKI #else //!NEWPANEL - old style panel with shift register @@ -154,23 +175,3 @@ #endif // ULTRA_LCD -#if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define BEEPER_PIN 44 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 70 - #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 - - //The encoder and click button - #define BTN_EN1 85 - #define BTN_EN2 84 - #define BTN_ENC 83 - - #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board - - #if ENABLED(TEMP_STAT_LEDS) - #define STAT_LED_RED 22 - #define STAT_LED_BLUE 32 - #endif -#endif // VIKI2/miniVIKI - From 38af251b9174cad0bff35c3aa1815a3cd1e688af Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Aug 2016 00:12:20 -0700 Subject: [PATCH 564/580] Use a default argument in _lcd_move_e --- Marlin/ultralcd.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 4e23e4ea3..b08eaccd2 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1359,7 +1359,7 @@ void kill_screen(const char* lcd_msg) { static void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS, sw_endstop_min[Z_AXIS], sw_endstop_max[Z_AXIS]); } static void _lcd_move_e( #if E_MANUAL > 1 - int8_t eindex + int8_t eindex=-1 #endif ) { if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; } @@ -1437,9 +1437,8 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM(gcode, MSG_SELECT MSG_E2, PSTR("T1")); #endif - #if E_MANUAL == 1 - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); - #else + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); + #if E_MANUAL > 1 MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0); MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1); #if E_MANUAL > 2 From cebd2bfff0b94ab75ac24d2410e933dc533161dd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Aug 2016 21:13:13 -0700 Subject: [PATCH 565/580] Auto-select power plugs for RAMPS derivatives --- Marlin/Conditionals_LCD.h | 38 ++++++++++++++++++++++++++++++++++++++ Marlin/Conditionals_post.h | 38 -------------------------------------- Marlin/pins_RAMPS.h | 5 ----- 3 files changed, 38 insertions(+), 43 deletions(-) diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 60ed5ce6e..1cad0a0e3 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -267,4 +267,42 @@ #define BOOTSCREEN_TIMEOUT 2500 #endif + /** + * Extruders have some combination of stepper motors and hotends + * so we separate these concepts into the defines: + * + * EXTRUDERS - Number of Selectable Tools + * HOTENDS - Number of hotends, whether connected or separate + * E_STEPPERS - Number of actual E stepper motors + * TOOL_E_INDEX - Index to use when getting/setting the tool state + * + */ + #if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder + #define HOTENDS 1 + #define E_STEPPERS EXTRUDERS + #define E_MANUAL EXTRUDERS + #define TOOL_E_INDEX current_block->active_extruder + #undef TEMP_SENSOR_1_AS_REDUNDANT + #undef HOTEND_OFFSET_X + #undef HOTEND_OFFSET_Y + #elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends + #define HOTENDS EXTRUDERS + #define E_STEPPERS 1 + #define E_MANUAL 1 + #define TOOL_E_INDEX 0 + #ifndef HOTEND_OFFSET_Z + #define HOTEND_OFFSET_Z { 0 } + #endif + #elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend + #define HOTENDS 1 + #define E_STEPPERS MIXING_STEPPERS + #define E_MANUAL 1 + #define TOOL_E_INDEX 0 + #else // One stepper, E axis, and hotend per tool + #define HOTENDS EXTRUDERS + #define E_STEPPERS EXTRUDERS + #define E_MANUAL EXTRUDERS + #define TOOL_E_INDEX current_block->active_extruder + #endif + #endif //CONDITIONALS_LCD_H diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 8a51187e6..59750fc28 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -325,44 +325,6 @@ #define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)) #define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED)) - /** - * Extruders have some combination of stepper motors and hotends - * so we separate these concepts into the defines: - * - * EXTRUDERS - Number of Selectable Tools - * HOTENDS - Number of hotends, whether connected or separate - * E_STEPPERS - Number of actual E stepper motors - * TOOL_E_INDEX - Index to use when getting/setting the tool state - * - */ - #if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder - #define HOTENDS 1 - #define E_STEPPERS EXTRUDERS - #define E_MANUAL EXTRUDERS - #define TOOL_E_INDEX current_block->active_extruder - #undef TEMP_SENSOR_1_AS_REDUNDANT - #undef HOTEND_OFFSET_X - #undef HOTEND_OFFSET_Y - #elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends - #define HOTENDS EXTRUDERS - #define E_STEPPERS 1 - #define E_MANUAL 1 - #define TOOL_E_INDEX 0 - #ifndef HOTEND_OFFSET_Z - #define HOTEND_OFFSET_Z { 0 } - #endif - #elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend - #define HOTENDS 1 - #define E_STEPPERS MIXING_STEPPERS - #define E_MANUAL 1 - #define TOOL_E_INDEX 0 - #else // One stepper, E axis, and hotend per tool - #define HOTENDS EXTRUDERS - #define E_STEPPERS EXTRUDERS - #define E_MANUAL EXTRUDERS - #define TOOL_E_INDEX current_block->active_extruder - #endif - /** * Default hotend offsets, if not defined */ diff --git a/Marlin/pins_RAMPS.h b/Marlin/pins_RAMPS.h index fb378e07f..88a457b2a 100644 --- a/Marlin/pins_RAMPS.h +++ b/Marlin/pins_RAMPS.h @@ -114,10 +114,7 @@ #define SLED_PIN -1 #endif -/* - // Augmentation for auto-assigning RAMPS plugs - #if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) #if HOTENDS > 1 #if TEMP_SENSOR_BED @@ -132,8 +129,6 @@ #endif #endif -*/ - /** * Hi Voltage PWM Pin Assignments */ From 39c46035986f64c9fee6cf6308fd0eca2cc13e0d Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 2 Aug 2016 21:03:05 +0200 Subject: [PATCH 566/580] Correct typo in retract. --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 699386257..d2b7b526a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2520,7 +2520,7 @@ static void homeaxis(AxisEnum axis) { SYNC_PLAN_POSITION_KINEMATIC(); } - feedrate_mm_m = MMM_TO_MMS(retract_recover_feedrate_mm_s); + feedrate_mm_m = MMS_TO_MMM(retract_recover_feedrate_mm_s); float move_e = swapping ? retract_length_swap + retract_recover_length_swap : retract_length + retract_recover_length; current_position[E_AXIS] -= move_e / volumetric_multiplier[active_extruder]; sync_plan_position_e(); From 9ab94bd2c1577a79b8c8758b50f0aeb553ba4a20 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 2 Aug 2016 21:05:31 +0200 Subject: [PATCH 567/580] fix-babysrepping --- Marlin/temperature.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 35a2a3e9b..552ef8b2d 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -29,6 +29,9 @@ #include "temperature.h" #include "thermistortables.h" #include "language.h" +#if ENABLED(BABYSTEPPING) + #include "stepper.h" +#endif #if ENABLED(USE_WATCHDOG) #include "watchdog.h" From 593b37519ad3c4a1b81e8475bc089d26042d5b46 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 12:32:36 -0700 Subject: [PATCH 568/580] Boards with 4 power outputs are EFBF or EFBE --- Marlin/pins_FELIX2.h | 1 + Marlin/pins_MKS_13.h | 1 + Marlin/pins_MKS_BASE.h | 1 + Marlin/pins_RAMPS.h | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index 83ce47bf5..31906b515 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -30,6 +30,7 @@ #define BOARD_NAME "Felix 2.0+" +// Power outputs EFBF or EFBE #define MOSFET_D_PIN 7 #include "pins_RAMPS.h" diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index 36fc0f7b8..3b5b242ab 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -35,6 +35,7 @@ #define BOARD_NAME "MKS > v1.3" +// Power outputs EFBF or EFBE #define MOSFET_D_PIN 7 #include "pins_RAMPS.h" diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h index fdaff0689..8c7222017 100644 --- a/Marlin/pins_MKS_BASE.h +++ b/Marlin/pins_MKS_BASE.h @@ -30,6 +30,7 @@ #define BOARD_NAME "MKS BASE 1.0" +// Power outputs EFBF or EFBE #define MOSFET_D_PIN 7 #include "pins_RAMPS.h" \ No newline at end of file diff --git a/Marlin/pins_RAMPS.h b/Marlin/pins_RAMPS.h index 88a457b2a..3280dd3e0 100644 --- a/Marlin/pins_RAMPS.h +++ b/Marlin/pins_RAMPS.h @@ -115,7 +115,7 @@ #endif // Augmentation for auto-assigning RAMPS plugs -#if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) +#if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) #if HOTENDS > 1 #if TEMP_SENSOR_BED #define IS_RAMPS_EEB @@ -163,7 +163,7 @@ #define CONTROLLERFAN_PIN -1 #elif ENABLED(IS_RAMPS_SF) // Spindle, Fan #define FAN_PIN RAMPS_D8_PIN -#else // Non-specific are "EFB" by legacy +#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") #define FAN_PIN RAMPS_D9_PIN #define HEATER_BED_PIN RAMPS_D8_PIN #if HOTENDS == 1 From e0d7b8bf27f8dd86c7c84e02d49a0112025763db Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 13:59:43 -0700 Subject: [PATCH 569/580] Fix Azteeg X3 servo pin / Viki i2c --- Marlin/pins_AZTEEG_X3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index 05a5a269f..b33818ee7 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -30,7 +30,7 @@ #define BOARD_NAME "Azteeg X3" -#include "pins_RAMPS.h" +#include "pins_RAMPS_13.h" #if ENABLED(VIKI2) || ENABLED(miniVIKI) From 330f82971b8b1c6a8f44bcb917ff788db49a44ce Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 1 Aug 2016 21:10:53 -0700 Subject: [PATCH 570/580] Buzzer requires BEEPER_PIN --- Marlin/Marlin.h | 3 +-- Marlin/Marlin_main.cpp | 27 ++++++++++++++------------- Marlin/buzzer.h | 4 ++++ Marlin/ultralcd.cpp | 18 +++++++++--------- Marlin/ultralcd.h | 2 +- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index cfa57eb0f..a0f996887 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -384,9 +384,8 @@ extern uint8_t active_extruder; void calculate_volumetric_multipliers(); // Buzzer -#if HAS_BUZZER +#if HAS_BUZZER && PIN_EXISTS(BEEPER) #include "buzzer.h" - extern Buzzer buzzer; #endif /** diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 699386257..201f67428 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -373,9 +373,14 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL Stopwatch print_job_timer = Stopwatch(); #endif -// Buzzer -#if HAS_BUZZER - Buzzer buzzer; +// Buzzer - I2C on the LCD or a BEEPER_PIN +#if ENABLED(LCD_USE_I2C_BUZZER) + #define BUZZ(d,f) lcd_buzz(d, f) +#elif HAS_BUZZER + Buzzer buzzer; + #define BUZZ(d,f) buzzer.tone(d, f) +#else + #define BUZZ(d,f) NOOP #endif static uint8_t target_extruder; @@ -5657,7 +5662,7 @@ inline void gcode_M226() { // Limits the tone duration to 0-5 seconds. NOMORE(duration, 5000); - buzzer.tone(duration, frequency); + BUZZ(duration, frequency); } #endif // HAS_BUZZER @@ -6129,9 +6134,7 @@ inline void gcode_M428() { SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_M428_TOO_FAR); LCD_ALERTMESSAGEPGM("Err: Too far!"); - #if HAS_BUZZER - buzzer.tone(200, 40); - #endif + BUZZ(200, 40); err = true; break; } @@ -6142,10 +6145,8 @@ inline void gcode_M428() { SYNC_PLAN_POSITION_KINEMATIC(); report_current_position(); LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); - #if HAS_BUZZER - buzzer.tone(200, 659); - buzzer.tone(200, 698); - #endif + BUZZ(200, 659); + BUZZ(200, 698); } } @@ -6327,7 +6328,7 @@ inline void gcode_M503() { #if HAS_BUZZER millis_t ms = millis(); if (ms >= next_tick) { - buzzer.tone(300, 2000); + BUZZ(300, 2000); next_tick = ms + 2500; // Beep every 2.5s while waiting } #endif @@ -8470,7 +8471,7 @@ void idle( print_job_timer.tick(); #endif - #if HAS_BUZZER + #if HAS_BUZZER && PIN_EXISTS(BEEPER) buzzer.tick(); #endif } diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index a398269d7..4548acfaa 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -27,6 +27,8 @@ #include "circularqueue.h" #include "temperature.h" +#include "MarlinConfig.h" + #define TONE_QUEUE_LENGTH 4 /** @@ -135,4 +137,6 @@ class Buzzer { } }; +extern Buzzer buzzer; + #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index b08eaccd2..d00937402 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1074,8 +1074,8 @@ void kill_screen(const char* lcd_msg) { lcd_return_to_status(); //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE); #if HAS_BUZZER - buzzer.tone(200, 659); - buzzer.tone(200, 698); + lcd_buzz(200, 659); + lcd_buzz(200, 698); #endif } else { @@ -2342,23 +2342,23 @@ void kill_screen(const char* lcd_msg) { * Audio feedback for controller clicks * */ - - #if ENABLED(LCD_USE_I2C_BUZZER) - void lcd_buzz(long duration, uint16_t freq) { // called from buzz() in Marlin_main.cpp where lcd is unknown + void lcd_buzz(long duration, uint16_t freq) { + #if ENABLED(LCD_USE_I2C_BUZZER) lcd.buzz(duration, freq); - } - #endif + #elif PIN_EXISTS(BEEPER) + buzzer.tone(duration, freq); + #endif + } void lcd_quick_feedback() { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; next_button_update_ms = millis() + 500; // Buzz and wait. The delay is needed for buttons to settle! + lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); delay(10); #elif PIN_EXISTS(BEEPER) - buzzer.tone(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } #endif } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index b1d4300c0..4cc8334ec 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -43,7 +43,7 @@ void lcd_kill_screen(); void kill_screen(const char* lcd_msg); - #if ENABLED(LCD_USE_I2C_BUZZER) + #if HAS_BUZZER void lcd_buzz(long duration, uint16_t freq); #endif From d8945e84644405e247ad99e63d257356bce26383 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 15:03:35 -0700 Subject: [PATCH 571/580] Fix Z_HEAD index for COREYZ --- Marlin/enum.h | 2 +- Marlin/planner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/enum.h b/Marlin/enum.h index cbdfd4a41..a51d208ae 100644 --- a/Marlin/enum.h +++ b/Marlin/enum.h @@ -42,7 +42,7 @@ enum AxisEnum { E_AXIS = 3, X_HEAD = 4, Y_HEAD = 5, - Z_HEAD = 5 + Z_HEAD = 6 }; #define LOOP_XYZ(VAR) for (uint8_t VAR=X_AXIS; VAR<=Z_AXIS; VAR++) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d786824e1..f738d56c4 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -782,7 +782,7 @@ void Planner::check_axes_activity() { * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. */ #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ) - float delta_mm[6]; + float delta_mm[7]; #if ENABLED(COREXY) delta_mm[X_HEAD] = dx * steps_to_mm[A_AXIS]; delta_mm[Y_HEAD] = dy * steps_to_mm[B_AXIS]; From 14c5a46ee9863de6a9d303405291789a953a64b1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 15:03:55 -0700 Subject: [PATCH 572/580] Use multiplication for MMM_SCALED --- Marlin/Marlin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index a0f996887..3aa0aff67 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -261,7 +261,7 @@ extern int feedrate_percentage; #define MMM_TO_MMS(MM_M) ((MM_M)/60.0) #define MMS_TO_MMM(MM_S) ((MM_S)*60.0) -#define MMM_SCALED(MM_M) ((MM_M)*feedrate_percentage/100.0) +#define MMM_SCALED(MM_M) ((MM_M)*feedrate_percentage*0.01) #define MMS_SCALED(MM_S) MMM_SCALED(MM_S) #define MMM_TO_MMS_SCALED(MM_M) (MMS_SCALED(MMM_TO_MMS(MM_M))) From 3cccaa988560a3241e75ad30e58cf623006c8814 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 15:54:33 -0700 Subject: [PATCH 573/580] Allow encoder pulse/step override for more LCDs --- Marlin/Conditionals_LCD.h | 19 +++++++++++++++---- Marlin/ultralcd.cpp | 33 ++++++++++----------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 1cad0a0e3..29c67bf75 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -65,8 +65,12 @@ #define SD_DETECT_INVERTED #endif - #define ENCODER_PULSES_PER_STEP 4 - #define ENCODER_STEPS_PER_MENU_ITEM 1 + #ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP 4 + #endif + #ifndef ENCODER_STEPS_PER_MENU_ITEM + #define ENCODER_STEPS_PER_MENU_ITEM 1 + #endif #endif // Generic support for SSD1306 / SH1106 OLED based LCDs. @@ -85,7 +89,6 @@ #ifndef ENCODER_PULSES_PER_STEP #define ENCODER_PULSES_PER_STEP 4 #endif - #ifndef ENCODER_STEPS_PER_MENU_ITEM #define ENCODER_STEPS_PER_MENU_ITEM 1 #endif @@ -146,7 +149,6 @@ #ifndef ENCODER_PULSES_PER_STEP #define ENCODER_PULSES_PER_STEP 4 #endif - #ifndef ENCODER_STEPS_PER_MENU_ITEM #define ENCODER_STEPS_PER_MENU_ITEM 1 #endif @@ -166,6 +168,15 @@ #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) #define ULTIPANEL #define NEWPANEL + + #define ENCODER_FEEDRATE_DEADZONE 4 + + #ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP 1 + #endif + #ifndef ENCODER_STEPS_PER_MENU_ITEM + #define ENCODER_STEPS_PER_MENU_ITEM 2 + #endif #endif // Shift register panels diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d00937402..1f0f309f4 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -177,31 +177,18 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to static void menu_action_sddirectory(const char* filename, char* longFilename); #endif - #if DISABLED(LCD_I2C_VIKI) - #ifndef ENCODER_FEEDRATE_DEADZONE - #define ENCODER_FEEDRATE_DEADZONE 10 - #endif - #ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM 5 - #endif - #ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP 1 - #endif - #else - #ifndef ENCODER_FEEDRATE_DEADZONE - #define ENCODER_FEEDRATE_DEADZONE 4 - #endif - #ifndef ENCODER_STEPS_PER_MENU_ITEM - #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation - #endif - #ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP 1 - #endif - #endif - - /* Helper macros for menus */ + #ifndef ENCODER_FEEDRATE_DEADZONE + #define ENCODER_FEEDRATE_DEADZONE 10 + #endif + #ifndef ENCODER_STEPS_PER_MENU_ITEM + #define ENCODER_STEPS_PER_MENU_ITEM 5 + #endif + #ifndef ENCODER_PULSES_PER_STEP + #define ENCODER_PULSES_PER_STEP 1 + #endif + /** * START_SCREEN generates the init code for a screen function * From c9123adc59fa79716cf969e663f939902246837d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 17:39:20 -0700 Subject: [PATCH 574/580] Improved SCREEN / MENU macros --- Marlin/ultralcd.cpp | 77 +++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 42 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 1f0f309f4..6eb5eff2d 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -190,34 +190,54 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to #endif /** - * START_SCREEN generates the init code for a screen function + * START_SCREEN_OR_MENU generates init code for a screen or menu * * encoderLine is the position based on the encoder * encoderTopLine is the top menu line to display * _lcdLineNr is the index of the LCD line (e.g., 0-3) * _menuLineNr is the menu item to draw and process * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM + * _countedItems is the total number of items in the menu (after one call) */ - #define _START_SCREEN(CODE, SKIP) \ + #define START_SCREEN_OR_MENU(LIMIT) \ ENCODER_DIRECTION_MENUS(); \ encoderRateMultiplierEnabled = false; \ if (encoderPosition > 0x8000) encoderPosition = 0; \ + static int8_t _countedItems = 0; \ int8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ - NOMORE(encoderTopLine, encoderLine); \ + if (_countedItems > 0 && encoderLine >= _countedItems - LIMIT) { \ + encoderLine = _countedItems - LIMIT; \ + encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \ + } + + #define SCREEN_OR_MENU_LOOP() \ int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ - bool _skipStatic = SKIP; \ - CODE; \ for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \ - _thisItemNr = 0; - - #define START_SCREEN() _START_SCREEN(NOOP, false) + _thisItemNr = 0 /** - * START_MENU generates the init code for a menu function + * START_SCREEN Opening code for a screen having only static items. + * Do simplified scrolling of the entire screen. * - * wasClicked indicates the controller was clicked + * START_MENU Opening code for a screen with menu items. + * Scroll as-needed to keep the selected line in view. + * 'wasClicked' indicates the controller was clicked. */ - #define START_MENU() _START_SCREEN(bool wasClicked = LCD_CLICKED, true) + #define START_SCREEN() \ + START_SCREEN_OR_MENU(LCD_HEIGHT); \ + encoderTopLine = encoderLine; \ + bool _skipStatic = false; \ + SCREEN_OR_MENU_LOOP() + + #define START_MENU() \ + START_SCREEN_OR_MENU(1); \ + NOMORE(encoderTopLine, encoderLine); \ + if (encoderLine >= encoderTopLine + LCD_HEIGHT) { \ + encoderTopLine = encoderLine - (LCD_HEIGHT - 1); \ + } \ + bool wasClicked = LCD_CLICKED; \ + bool _skipStatic = true; \ + SCREEN_OR_MENU_LOOP() /** * MENU_ITEM generates draw & handler code for a menu item, potentially calling: @@ -252,7 +272,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to return; \ } \ } \ - _thisItemNr++ + ++_thisItemNr #define MENU_ITEM(TYPE, LABEL, ARGS...) do { \ _skipStatic = false; \ @@ -270,42 +290,15 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to if (lcdDrawUpdate) \ lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## ARGS); \ } \ - _thisItemNr++ - - /** - * - * END_SCREEN Closing code for a screen having only static items. - * Do simplified scrolling of the entire screen. - * - * END_MENU Closing code for a screen with menu items. - * Scroll as-needed to keep the selected line in view. - * - * At this point _thisItemNr equals the total number of items. - * - */ + ++_thisItemNr - // Simple-scroll by using encoderLine as encoderTopLine #define END_SCREEN() \ } \ - NOMORE(encoderLine, _thisItemNr - LCD_HEIGHT); \ - NOLESS(encoderLine, 0); \ - encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \ - if (encoderTopLine != encoderLine) { \ - encoderTopLine = encoderLine; \ - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ - } + _countedItems = _thisItemNr - // Scroll through menu items, scrolling as-needed to stay in view #define END_MENU() \ } \ - if (encoderLine >= _thisItemNr) { \ - encoderLine = _thisItemNr - 1; \ - encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \ - } \ - if (encoderLine >= encoderTopLine + LCD_HEIGHT) { \ - encoderTopLine = encoderLine - (LCD_HEIGHT - 1); \ - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ - } \ + _countedItems = _thisItemNr; \ UNUSED(_skipStatic) #if ENABLED(ENCODER_RATE_MULTIPLIER) From f26d5425bf03f5ea704371ca94a10b465f3e4030 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 18:51:31 -0700 Subject: [PATCH 575/580] Patch up CircularQueue - Use `size` and `count` instead of `length` and `size` - Fix bug: `peek` should return the item - Clean up comments, spacing, spelling --- Marlin/circularqueue.h | 89 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/Marlin/circularqueue.h b/Marlin/circularqueue.h index 99efd244e..9aafb99ac 100644 --- a/Marlin/circularqueue.h +++ b/Marlin/circularqueue.h @@ -26,120 +26,119 @@ #include /** - * @brief Circular Queue class + * @brief Circular Queue class * @details Implementation of the classic ring buffer data structure */ -template +template class CircularQueue { private: /** - * @brief Buffer structure + * @brief Buffer structure * @details This structure consolidates all the overhead required to handle - * a circular queue such as the pointers and the buffer vector. + * a circular queue such as the pointers and the buffer vector. */ struct buffer_t { uint8_t head; uint8_t tail; + uint8_t count; uint8_t size; - uint8_t length; T queue[N]; } buffer; public: /** - * @brief Class constructor + * @brief Class constructor * @details This class requires two template parameters, T defines the type - * of the items this queue will handle and N defines the maximum number of - * items that can be stored on the queue. + * of item this queue will handle and N defines the maximum number of + * items that can be stored on the queue. */ CircularQueue() { - this->buffer.length = N; - this->buffer.size = this->buffer.head = this->buffer.tail = 0; + this->buffer.size = N; + this->buffer.count = this->buffer.head = this->buffer.tail = 0; } /** - * @brief Removes and returns a item from the queue - * @details Removes the oldest item on the queue which is pointed by the - * buffer_t head variable, this item is then returned to the caller. - * @return type T item + * @brief Removes and returns a item from the queue + * @details Removes the oldest item on the queue, pointed to by the + * buffer_t head field. The item is returned to the caller. + * @return type T item */ T dequeue() { if (this->isEmpty()) return T(); - T const item = this->buffer.queue[this->buffer.head++]; - --this->buffer.size; + uint8_t index = this->buffer.head; - if (this->buffer.head == this->buffer.length) + --this->buffer.count; + if (++this->buffer.head == this->buffer.size) this->buffer.head = 0; - return item; + return this->buffer.queue[index]; } /** - * @brief Adds an item to the queue - * @details Adds a item to the queue on the location pointed by the buffer_t - * tail vairable, will return false if there is no queue space available. - * - * @param item Item to be added to the queue - * @return true if the operation was successfull + * @brief Adds an item to the queue + * @details Adds an item to the queue on the location pointed by the buffer_t + * tail variable. Returns false if no queue space is available. + * @param item Item to be added to the queue + * @return true if the operation was successful */ bool enqueue(T const &item) { if (this->isFull()) return false; - this->buffer.queue[this->buffer.tail++] = item; - ++this->buffer.size; + this->buffer.queue[this->buffer.tail] = item; - if (this->buffer.tail == this->buffer.length) + ++this->buffer.count; + if (++this->buffer.tail == this->buffer.size) this->buffer.tail = 0; return true; } /** - * @brief Checks if the queue has no items + * @brief Checks if the queue has no items * @details Returns true if there are no items on the queue, false otherwise. - * @return true if queue is empty + * @return true if queue is empty */ bool isEmpty() { - return this->buffer.size == 0; + return this->buffer.count == 0; } /** - * @brief Checks if the queue is full + * @brief Checks if the queue is full * @details Returns true if the queue is full, false otherwise. - * @return true if queue is full + * @return true if queue is full */ bool isFull() { - return this->buffer.size == this->buffer.length; + return this->buffer.count == this->buffer.size; } /** - * @brief Gets the queue size + * @brief Gets the queue size * @details Returns the maximum number of items a queue can have. - * @return the queue lenght + * @return the queue size */ - uint8_t length() { - return this->buffer.length; + uint8_t size() { + return this->buffer.size; } /** - * @brief Gets the next item from the queue without removing it - * @details Returns the next item on the queue but the item is not removed - * from the queue nor the pointers updated. - * @return the queue size + * @brief Gets the next item from the queue without removing it + * @details Returns the next item in the queue without removing it + * or updating the pointers. + * @return first item in the queue */ - uint8_t peek() { + T peek() { return this->buffer.queue[this->buffer.head]; } /** * @brief Gets the number of items on the queue * @details Returns the current number of items stored on the queue. - * @return type T item + * @return number of items in the queue */ - uint8_t size() { - return this->buffer.size; + uint8_t count() { + return this->buffer.count; } }; From b73203a0b7a666381538cf9a786f290c4ec19d35 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 19:36:58 -0700 Subject: [PATCH 576/580] Move some includes around to uncover missing deps --- Marlin/Marlin.h | 1 - Marlin/MarlinSerial.cpp | 4 +++- Marlin/MarlinSerial.h | 7 +------ Marlin/Marlin_main.cpp | 1 + Marlin/cardreader.cpp | 4 +++- Marlin/cardreader.h | 4 ++++ Marlin/macros.h | 2 ++ Marlin/planner.cpp | 3 ++- Marlin/planner.h | 3 ++- Marlin/stepper.h | 1 + Marlin/temperature.h | 3 ++- 11 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 3aa0aff67..9f289f208 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -215,7 +215,6 @@ void manage_inactivity(bool ignore_stepper_queue = false); /** * The axis order in all axis related arrays is X, Y, Z, E */ -#define NUM_AXIS 4 #define _AXIS(AXIS) AXIS ##_AXIS void enable_all_steppers(); diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index 304b3be07..9ef900265 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -29,10 +29,12 @@ Modified 14 February 2016 by Andreas Hardtung (added tx buffer) */ -#include "Marlin.h" #include "MarlinSerial.h" + #include "stepper.h" +#include "Marlin.h" + #ifndef USBCON // this next line disables the entire HardwareSerial.cpp, // this is so I can support Attiny series and any other chip without a UART diff --git a/Marlin/MarlinSerial.h b/Marlin/MarlinSerial.h index a5e2ee71d..e76175228 100644 --- a/Marlin/MarlinSerial.h +++ b/Marlin/MarlinSerial.h @@ -31,13 +31,8 @@ #ifndef MarlinSerial_h #define MarlinSerial_h -#include "Marlin.h" - -#ifndef CRITICAL_SECTION_START - #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli(); - #define CRITICAL_SECTION_END SREG = _sreg; -#endif +#include "MarlinConfig.h" #ifndef SERIAL_PORT #define SERIAL_PORT 0 diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ccffdf7bb..84493cf92 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -61,6 +61,7 @@ #include "math.h" #include "nozzle.h" #include "duration_t.h" +#include "types.h" #if ENABLED(USE_WATCHDOG) #include "watchdog.h" diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index dd6ff9f53..2cc1b2ad6 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -20,13 +20,15 @@ * */ -#include "Marlin.h" #include "cardreader.h" + #include "ultralcd.h" #include "stepper.h" #include "temperature.h" #include "language.h" +#include "Marlin.h" + #if ENABLED(SDSUPPORT) CardReader::CardReader() { diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h index 31b82386c..8c22e581c 100644 --- a/Marlin/cardreader.h +++ b/Marlin/cardreader.h @@ -23,11 +23,15 @@ #ifndef CARDREADER_H #define CARDREADER_H +#include "MarlinConfig.h" + #if ENABLED(SDSUPPORT) #define MAX_DIR_DEPTH 10 // Maximum folder depth #include "SdFile.h" + +#include "types.h" #include "enum.h" class CardReader { diff --git a/Marlin/macros.h b/Marlin/macros.h index c228ac3ed..5eec73e34 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -23,6 +23,8 @@ #ifndef MACROS_H #define MACROS_H +#define NUM_AXIS 4 + #define FORCE_INLINE __attribute__((always_inline)) inline // Bracket code that shouldn't be interrupted diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index f738d56c4..4e4d4a189 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -58,13 +58,14 @@ * */ -#include "Marlin.h" #include "planner.h" #include "stepper.h" #include "temperature.h" #include "ultralcd.h" #include "language.h" +#include "Marlin.h" + #if ENABLED(MESH_BED_LEVELING) #include "mesh_bed_leveling.h" #endif diff --git a/Marlin/planner.h b/Marlin/planner.h index eac1ae5c6..740553668 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -32,7 +32,8 @@ #ifndef PLANNER_H #define PLANNER_H -#include "Marlin.h" +#include "types.h" +#include "MarlinConfig.h" #if ENABLED(AUTO_BED_LEVELING_FEATURE) #include "vector_3.h" diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 3ecf93a71..1dd1531e4 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -47,6 +47,7 @@ #include "speed_lookuptable.h" #include "stepper_indirection.h" #include "language.h" +#include "types.h" class Stepper; extern Stepper stepper; diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 9a1de04ca..ffb47a59f 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -27,10 +27,11 @@ #ifndef TEMPERATURE_H #define TEMPERATURE_H -#include "Marlin.h" #include "planner.h" #include "thermistortables.h" +#include "MarlinConfig.h" + #if ENABLED(PID_EXTRUSION_SCALING) #include "stepper.h" #endif From 6110d57c164cf4186e9d8c5f50eef0f3c0a08041 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 19:13:04 -0700 Subject: [PATCH 577/580] Prevent the 'tone(f,d)' function from being interrupted --- Marlin/buzzer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/buzzer.h b/Marlin/buzzer.h index 4548acfaa..199d64e41 100644 --- a/Marlin/buzzer.h +++ b/Marlin/buzzer.h @@ -23,6 +23,7 @@ #ifndef __BUZZER_H__ #define __BUZZER_H__ +#include "types.h" #include "fastio.h" #include "circularqueue.h" #include "temperature.h" @@ -127,7 +128,9 @@ class Buzzer { if (this->state.tone.frequency > 0) { #if ENABLED(SPEAKER) + CRITICAL_SECTION_START; ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration); + CRITICAL_SECTION_END; #else this->on(); #endif From 229f70f1940eb45bcc066ee359636860853b4bf9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 19:56:35 -0700 Subject: [PATCH 578/580] Only report finished prints longer than 1 min --- Marlin/cardreader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index dd6ff9f53..f56439060 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -614,7 +614,8 @@ void CardReader::printingHasFinished() { if (SD_FINISHED_STEPPERRELEASE) enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); print_job_timer.stop(); - enqueue_and_echo_commands_P(PSTR("M31")); + if (print_job_timer.duration() > 60) + enqueue_and_echo_commands_P(PSTR("M31")); } } From 9cb596e88c4512da309c580400c4960ff39b0556 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 20:31:44 -0700 Subject: [PATCH 579/580] Define Z_MIN_PROBE_PIN always, allowing override --- Marlin/pins_AZTEEG_X3_PRO.h | 8 ++------ Marlin/pins_BRAINWAVE_PRO.h | 11 +++++++---- Marlin/pins_RAMBO.h | 16 ++++++++++------ Marlin/pins_RAMPS.h | 23 +++++++++++------------ Marlin/pins_RIGIDBOARD.h | 15 ++++----------- Marlin/pins_RUMBA.h | 3 +-- 6 files changed, 35 insertions(+), 41 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index b531ec30d..f4114c568 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -60,14 +60,10 @@ #define Z_MAX_PIN 18 #endif - -#if ENABLED(Z_MIN_PROBE_ENDSTOP) - //#undef Z_MIN_PIN - //#define Z_MIN_PIN 15 - // Define a pin to use as the signal pin on Arduino for the Z probe endstop. +#ifndef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN 19 #endif -// + #define E2_STEP_PIN 23 #define E2_DIR_PIN 25 #define E2_ENABLE_PIN 40 diff --git a/Marlin/pins_BRAINWAVE_PRO.h b/Marlin/pins_BRAINWAVE_PRO.h index 3b33eeb28..cba0d4694 100644 --- a/Marlin/pins_BRAINWAVE_PRO.h +++ b/Marlin/pins_BRAINWAVE_PRO.h @@ -41,21 +41,24 @@ #define LARGE_FLASH true +#define X_STOP_PIN 47 +#define Y_STOP_PIN 18 +#define Z_MAX_PIN 36 +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 17 +#endif + #define X_STEP_PIN 33 #define X_DIR_PIN 32 #define X_ENABLE_PIN 11 -#define X_STOP_PIN 47 #define Y_STEP_PIN 31 #define Y_DIR_PIN 30 #define Y_ENABLE_PIN 8 -#define Y_STOP_PIN 18 #define Z_STEP_PIN 29 #define Z_DIR_PIN 28 #define Z_ENABLE_PIN 37 -#define Z_MAX_PIN 36 -#define Z_MIN_PROBE_PIN 17 // Bed Z probe #define E0_STEP_PIN 35 #define E0_DIR_PIN 34 diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index d1bd48bdd..278774caf 100644 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -42,26 +42,30 @@ #define SLED_PIN -1 #endif -#define X_STEP_PIN 37 -#define X_DIR_PIN 48 #define X_MIN_PIN 12 #define X_MAX_PIN 24 +#define Y_MIN_PIN 11 +#define Y_MAX_PIN 23 +#define Z_MIN_PIN 10 +#define Z_MAX_PIN 30 +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 10 +#endif + +#define X_STEP_PIN 37 +#define X_DIR_PIN 48 #define X_ENABLE_PIN 29 #define X_MS1_PIN 40 #define X_MS2_PIN 41 #define Y_STEP_PIN 36 #define Y_DIR_PIN 49 -#define Y_MIN_PIN 11 -#define Y_MAX_PIN 23 #define Y_ENABLE_PIN 28 #define Y_MS1_PIN 69 #define Y_MS2_PIN 39 #define Z_STEP_PIN 35 #define Z_DIR_PIN 47 -#define Z_MIN_PIN 10 -#define Z_MAX_PIN 30 #define Z_ENABLE_PIN 27 #define Z_MS1_PIN 68 #define Z_MS2_PIN 67 diff --git a/Marlin/pins_RAMPS.h b/Marlin/pins_RAMPS.h index 3280dd3e0..5f2e0d119 100644 --- a/Marlin/pins_RAMPS.h +++ b/Marlin/pins_RAMPS.h @@ -63,25 +63,29 @@ #define SERVO2_PIN 5 #define SERVO3_PIN 4 -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 #define X_MIN_PIN 3 #ifndef X_MAX_PIN #define X_MAX_PIN 2 #endif +#define Y_MIN_PIN 14 +#define Y_MAX_PIN 15 +#define Z_MIN_PIN 18 +#define Z_MAX_PIN 19 +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 32 +#endif + +#define X_STEP_PIN 54 +#define X_DIR_PIN 55 +#define X_ENABLE_PIN 38 #define Y_STEP_PIN 60 #define Y_DIR_PIN 61 #define Y_ENABLE_PIN 56 -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 #define Z_STEP_PIN 46 #define Z_DIR_PIN 48 #define Z_ENABLE_PIN 62 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 #define E0_STEP_PIN 26 #define E0_DIR_PIN 28 @@ -97,11 +101,6 @@ // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector #define FILWIDTH_PIN 5 // ANALOG NUMBERING -#if ENABLED(Z_MIN_PROBE_ENDSTOP) - // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop. - #define Z_MIN_PROBE_PIN 32 -#endif - // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector #define FIL_RUNOUT_PIN 4 diff --git a/Marlin/pins_RIGIDBOARD.h b/Marlin/pins_RIGIDBOARD.h index 6b7645205..a60e492ac 100644 --- a/Marlin/pins_RIGIDBOARD.h +++ b/Marlin/pins_RIGIDBOARD.h @@ -24,22 +24,15 @@ * RIGIDBOARD Arduino Mega with RAMPS v1.4 pin assignments */ -#include "pins_RAMPS.h" - -#undef BOARD_NAME #define BOARD_NAME "RigidBoard" -#if ENABLED(Z_MIN_PROBE_ENDSTOP) - #undef Z_MAX_PIN - #define Z_MAX_PIN -1 - #undef Z_MIN_PROBE_PIN +#define RAMPS_D10_PIN 9 // EXTRUDER 1 +#define MOSFET_D_PIN 12 // EXTRUDER 2 or FAN +#ifndef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN 19 // Z-MAX pin J14 End Stops #endif -#undef HEATER_0_PIN -#undef HEATER_1_PIN -#define HEATER_0_PIN 9 // EXTRUDER 1 -#define HEATER_1_PIN 12 // EXTRUDER 2 (FAN On Sprinter) +#include "pins_RAMPS.h" #undef TEMP_0_PIN #undef TEMP_1_PIN diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h index 642deb292..ec5e0236e 100644 --- a/Marlin/pins_RUMBA.h +++ b/Marlin/pins_RUMBA.h @@ -53,8 +53,7 @@ #define Z_MIN_PIN 33 #define Z_MAX_PIN 32 -#if ENABLED(Z_MIN_PROBE_ENDSTOP) - // Define a pin to use as the signal pin on Arduino for the Z probe endstop. +#ifndef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN 33 #endif From f1be87a85cc9c793e2fb555da9f855e3ccec6b23 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 2 Aug 2016 20:55:17 -0700 Subject: [PATCH 580/580] Move probe pin sanity checks out of ABL block --- Marlin/SanityCheck.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 92e21f0d3..6f1b73b1f 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -270,10 +270,16 @@ #endif /** - * Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * Require a Z min pin */ - #if HAS_Z_MIN && HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #error "A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN." + #if HAS_Z_MIN + // Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + #if HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #error "A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN." + #endif + #elif !HAS_Z_MIN_PROBE_PIN || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) + // A pin was set for the Z probe, but not enabled. + #error "A probe requires a Z_MIN or Z_PROBE pin. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin." #endif /** @@ -384,15 +390,6 @@ #error "You must use AUTO_BED_LEVELING_GRID for DELTA bed leveling." #endif - /** - * Require a Z min pin - */ - #if !PIN_EXISTS(Z_MIN) - #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z probe, but not enable it. - #error "AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin." - #endif - #endif - /** * Check if Probe_Offset * Grid Points is greater than Probing Range */