From e616093d4c07f7de0dc2723c78da91aaf7ae3284 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 27 Jun 2016 18:09:22 +0200 Subject: [PATCH 1/3] 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 989134316b1a..d501be804457 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 2/3] 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 d501be804457..c797981b4826 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 fbfb4dd0cbde..968fa5168f92 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 c86e97b7d827..3fc7a5bee78f 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 8866c9e6f15c..9c2ba49d3062 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 40f1908a30b8..e2306a401d66 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 bd8ae6d59ddb..cc8508e14690 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 42d8dfa50c92..55c9fd48c6b5 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 d4d5c3c9833f..58acd952783c 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 e85d342d0fc5..8f20bc030622 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 cf1785c79047..9722ccd2ef92 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 8af3aab55bad..f87ac2f1c194 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 87cbb1fc4d8d..be3db646c581 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 7536d53a8607..f22abce00f3f 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 5363010e859b..f4e4639fc319 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 f3bf014f5593..d48e58ccb14b 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 6e305e1b3e27..481b725abf66 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 80c4224623b2..7eb6f592a5d4 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 1188c63d321f..8a35e7cef8e1 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 dcac94019d8e..c74ad8fbd76f 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 8a54f6484565..bbaae33cd5bb 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 3bc25d9af5c0..cc37f31dae91 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 a746ad6b956e..feb38b496851 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 e4bb049a822f..4c857a7c1dae 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 02b46bd9258b..c2fab4d63677 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 3/3] 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 c797981b4826..aaddca033b84 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