瀏覽代碼

✨ BLTouch High Speed mode runtime configuration (#22916)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
InsanityAutomation 3 年之前
父節點
當前提交
2893048e29
沒有連結到貢獻者的電子郵件帳戶。

+ 4
- 2
Marlin/Configuration_adv.h 查看文件

897
   //#define BLTOUCH_FORCE_MODE_SET
897
   //#define BLTOUCH_FORCE_MODE_SET
898
 
898
 
899
   /**
899
   /**
900
-   * Use "HIGH SPEED" mode for probing.
900
+   * Enable "HIGH SPEED" option for probing.
901
    * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems.
901
    * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems.
902
    * This feature was designed for Deltabots with very fast Z moves; however, higher speed Cartesians
902
    * This feature was designed for Deltabots with very fast Z moves; however, higher speed Cartesians
903
    * might be able to use it. If the machine can't raise Z fast enough the BLTouch may go into ALARM.
903
    * might be able to use it. If the machine can't raise Z fast enough the BLTouch may go into ALARM.
904
+   *
905
+   * Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset.
904
    */
906
    */
905
-  //#define BLTOUCH_HS_MODE
907
+  //#define BLTOUCH_HS_MODE true
906
 
908
 
907
   // Safety: Enable voltage mode settings in the LCD menu.
909
   // Safety: Enable voltage mode settings in the LCD menu.
908
   //#define BLTOUCH_LCD_VOLTAGE_MENU
910
   //#define BLTOUCH_LCD_VOLTAGE_MENU

+ 13
- 11
Marlin/src/feature/bltouch.cpp 查看文件

28
 
28
 
29
 BLTouch bltouch;
29
 BLTouch bltouch;
30
 
30
 
31
-bool BLTouch::last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
31
+bool BLTouch::od_5v_mode;         // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
32
+#ifdef BLTOUCH_HS_MODE
33
+  bool BLTouch::high_speed_mode;  // Initialized by settings.load, 0 = Low Speed; 1 = High Speed
34
+#else
35
+  constexpr bool BLTouch::high_speed_mode;
36
+#endif
32
 
37
 
33
 #include "../module/servo.h"
38
 #include "../module/servo.h"
34
 #include "../module/probe.h"
39
 #include "../module/probe.h"
64
   #else
69
   #else
65
 
70
 
66
     if (DEBUGGING(LEVELING)) {
71
     if (DEBUGGING(LEVELING)) {
67
-      DEBUG_ECHOLNPGM("last_written_mode - ", last_written_mode);
68
-      DEBUG_ECHOLNPGM("config mode - "
69
-        #if ENABLED(BLTOUCH_SET_5V_MODE)
70
-          "BLTOUCH_SET_5V_MODE"
71
-        #else
72
-          "OD"
73
-        #endif
74
-      );
72
+      PGMSTR(mode0, "OD");
73
+      PGMSTR(mode1, "5V");
74
+      DEBUG_ECHOPGM("BLTouch Mode: ");
75
+      DEBUG_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
76
+      DEBUG_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
75
     }
77
     }
76
 
78
 
77
-    const bool should_set = last_written_mode != ENABLED(BLTOUCH_SET_5V_MODE);
79
+    const bool should_set = od_5v_mode != ENABLED(BLTOUCH_SET_5V_MODE);
78
 
80
 
79
   #endif
81
   #endif
80
 
82
 
193
   _mode_store();
195
   _mode_store();
194
   if (M5V) _set_5V_mode(); else _set_OD_mode();
196
   if (M5V) _set_5V_mode(); else _set_OD_mode();
195
   _stow();
197
   _stow();
196
-  last_written_mode = M5V;
198
+  od_5v_mode = M5V;
197
 }
199
 }
198
 
200
 
199
 #endif // BLTOUCH
201
 #endif // BLTOUCH

+ 10
- 5
Marlin/src/feature/bltouch.h 查看文件

23
 
23
 
24
 #include "../inc/MarlinConfigPre.h"
24
 #include "../inc/MarlinConfigPre.h"
25
 
25
 
26
-#if DISABLED(BLTOUCH_HS_MODE)
27
-  #define BLTOUCH_SLOW_MODE 1
28
-#endif
29
-
30
 // BLTouch commands are sent as servo angles
26
 // BLTouch commands are sent as servo angles
31
 typedef unsigned char BLTCommand;
27
 typedef unsigned char BLTCommand;
32
 
28
 
70
 
66
 
71
 class BLTouch {
67
 class BLTouch {
72
 public:
68
 public:
69
+
73
   static void init(const bool set_voltage=false);
70
   static void init(const bool set_voltage=false);
74
-  static bool last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
71
+  static bool od_5v_mode;         // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
72
+
73
+  #ifdef BLTOUCH_HS_MODE
74
+    static bool high_speed_mode;  // Initialized by settings.load, 0 = Low Speed; 1 = High Speed
75
+  #else
76
+    static constexpr bool high_speed_mode = false;
77
+  #endif
78
+
79
+  static inline float z_extra_clearance() { return high_speed_mode ? 7 : 0; }
75
 
80
 
76
   // DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing
81
   // DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing
77
   static bool deploy()              { return deploy_proc(); }
82
   static bool deploy()              { return deploy_proc(); }

+ 5
- 1
Marlin/src/gcode/bedlevel/G35.cpp 查看文件

33
   #include "../../module/tool_change.h"
33
   #include "../../module/tool_change.h"
34
 #endif
34
 #endif
35
 
35
 
36
+#if ENABLED(BLTOUCH)
37
+  #include "../../feature/bltouch.h"
38
+#endif
39
+
36
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
40
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
37
 #include "../../core/debug_out.h"
41
 #include "../../core/debug_out.h"
38
 
42
 
102
     // In BLTOUCH HS mode, the probe travels in a deployed state.
106
     // In BLTOUCH HS mode, the probe travels in a deployed state.
103
     // Users of G35 might have a badly misaligned bed, so raise Z by the
107
     // Users of G35 might have a badly misaligned bed, so raise Z by the
104
     // length of the deployed pin (BLTOUCH stroke < 7mm)
108
     // length of the deployed pin (BLTOUCH stroke < 7mm)
105
-    do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, Z_CLEARANCE_BETWEEN_PROBES, 7));
109
+    do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance()));
106
     const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE, 0, true);
110
     const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE, 0, true);
107
 
111
 
108
     if (isnan(z_probed_height)) {
112
     if (isnan(z_probed_height)) {

+ 5
- 1
Marlin/src/gcode/calibrate/G34_M422.cpp 查看文件

45
   #include "../../libs/least_squares_fit.h"
45
   #include "../../libs/least_squares_fit.h"
46
 #endif
46
 #endif
47
 
47
 
48
+#if ENABLED(BLTOUCH)
49
+  #include "../../feature/bltouch.h"
50
+#endif
51
+
48
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
52
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
49
 #include "../../core/debug_out.h"
53
 #include "../../core/debug_out.h"
50
 
54
 
149
       // In BLTOUCH HS mode, the probe travels in a deployed state.
153
       // In BLTOUCH HS mode, the probe travels in a deployed state.
150
       // Users of G34 might have a badly misaligned bed, so raise Z by the
154
       // Users of G34 might have a badly misaligned bed, so raise Z by the
151
       // length of the deployed pin (BLTOUCH stroke < 7mm)
155
       // length of the deployed pin (BLTOUCH stroke < 7mm)
152
-      #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + 7.0f * BOTH(BLTOUCH, BLTOUCH_HS_MODE))
156
+      #define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance()))
153
 
157
 
154
       // Compute a worst-case clearance height to probe from. After the first
158
       // Compute a worst-case clearance height to probe from. After the first
155
       // iteration this will be re-calculated based on the actual bed position
159
       // iteration this will be re-calculated based on the actual bed position

+ 17
- 3
Marlin/src/gcode/probe/M401_M402.cpp 查看文件

28
 #include "../../module/motion.h"
28
 #include "../../module/motion.h"
29
 #include "../../module/probe.h"
29
 #include "../../module/probe.h"
30
 
30
 
31
+#ifdef BLTOUCH_HS_MODE
32
+  #include "../../feature/bltouch.h"
33
+#endif
34
+
31
 /**
35
 /**
32
  * M401: Deploy and activate the Z probe
36
  * M401: Deploy and activate the Z probe
37
+ *
38
+ * With BLTOUCH_HS_MODE:
39
+ *  S<bool> Set High Speed (HS) Mode and exit without deploy
33
  */
40
  */
34
 void GcodeSuite::M401() {
41
 void GcodeSuite::M401() {
35
-  probe.deploy();
36
-  TERN_(PROBE_TARE, probe.tare());
37
-  report_current_position();
42
+  if (parser.seen('S')) {
43
+    #ifdef BLTOUCH_HS_MODE
44
+      bltouch.high_speed_mode = parser.value_bool();
45
+    #endif
46
+  }
47
+  else {
48
+    probe.deploy();
49
+    TERN_(PROBE_TARE, probe.tare());
50
+    report_current_position();
51
+  }
38
 }
52
 }
39
 
53
 
40
 /**
54
 /**

+ 3
- 0
Marlin/src/inc/SanityCheck.h 查看文件

1577
       #endif
1577
       #endif
1578
     #endif
1578
     #endif
1579
 
1579
 
1580
+    #if ENABLED(BLTOUCH_HS_MODE) && BLTOUCH_HS_MODE == 0
1581
+      #error "BLTOUCH_HS_MODE must now be defined as true or false, indicating the default state."
1582
+    #endif
1580
     #if BLTOUCH_DELAY < 200
1583
     #if BLTOUCH_DELAY < 200
1581
       #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
1584
       #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
1582
     #endif
1585
     #endif

+ 1
- 0
Marlin/src/lcd/language/language_en.h 查看文件

491
   LSTR MSG_BLTOUCH_STOW                   = _UxGT("Stow");
491
   LSTR MSG_BLTOUCH_STOW                   = _UxGT("Stow");
492
   LSTR MSG_BLTOUCH_DEPLOY                 = _UxGT("Deploy");
492
   LSTR MSG_BLTOUCH_DEPLOY                 = _UxGT("Deploy");
493
   LSTR MSG_BLTOUCH_SW_MODE                = _UxGT("SW-Mode");
493
   LSTR MSG_BLTOUCH_SW_MODE                = _UxGT("SW-Mode");
494
+  LSTR MSG_BLTOUCH_SPEED_MODE             = _UxGT("High Speed");
494
   LSTR MSG_BLTOUCH_5V_MODE                = _UxGT("5V-Mode");
495
   LSTR MSG_BLTOUCH_5V_MODE                = _UxGT("5V-Mode");
495
   LSTR MSG_BLTOUCH_OD_MODE                = _UxGT("OD-Mode");
496
   LSTR MSG_BLTOUCH_OD_MODE                = _UxGT("OD-Mode");
496
   LSTR MSG_BLTOUCH_MODE_STORE             = _UxGT("Mode-Store");
497
   LSTR MSG_BLTOUCH_MODE_STORE             = _UxGT("Mode-Store");

+ 12
- 9
Marlin/src/lcd/menu/menu_bed_corners.cpp 查看文件

217
 
217
 
218
   bool _lcd_level_bed_corners_probe(bool verify=false) {
218
   bool _lcd_level_bed_corners_probe(bool verify=false) {
219
     if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed
219
     if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed
220
-    TERN_(BLTOUCH_SLOW_MODE, bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
220
+    TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
221
     do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
221
     do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
222
     if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
222
     if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
223
       endstops.hit_on_purpose();
223
       endstops.hit_on_purpose();
224
       set_current_from_steppers_for_axis(Z_AXIS);
224
       set_current_from_steppers_for_axis(Z_AXIS);
225
       sync_plan_position();
225
       sync_plan_position();
226
-      TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
226
+      TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
227
       // Triggered outside tolerance range?
227
       // Triggered outside tolerance range?
228
       if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) {
228
       if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) {
229
         last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
229
         last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
249
       }
249
       }
250
       idle();
250
       idle();
251
     }
251
     }
252
-    TERN_(BLTOUCH_SLOW_MODE, bltouch.stow());
252
+    TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow());
253
     ui.goto_screen(_lcd_draw_probing);
253
     ui.goto_screen(_lcd_draw_probing);
254
     return (probe_triggered);
254
     return (probe_triggered);
255
   }
255
   }
263
     do {
263
     do {
264
       ui.refresh(LCDVIEW_REDRAW_NOW);
264
       ui.refresh(LCDVIEW_REDRAW_NOW);
265
       _lcd_draw_probing();                                // update screen with # of good points
265
       _lcd_draw_probing();                                // update screen with # of good points
266
-      do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, current_position.z + LEVEL_CORNERS_Z_HOP, 7)); // clearance
266
+
267
+      do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance
267
 
268
 
268
       _lcd_level_bed_corners_get_next_position();         // Select next corner coordinates
269
       _lcd_level_bed_corners_get_next_position();         // Select next corner coordinates
269
       current_position -= probe.offset_xy;                // Account for probe offsets
270
       current_position -= probe.offset_xy;                // Account for probe offsets
270
       do_blocking_move_to_xy(current_position);           // Goto corner
271
       do_blocking_move_to_xy(current_position);           // Goto corner
271
 
272
 
272
-      TERN_(BLTOUCH_HS_MODE, bltouch.deploy());           // Deploy in HIGH SPEED MODE
273
+      TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE
273
       if (!_lcd_level_bed_corners_probe()) {              // Probe down to tolerance
274
       if (!_lcd_level_bed_corners_probe()) {              // Probe down to tolerance
274
         if (_lcd_level_bed_corners_raise()) {             // Prompt user to raise bed if needed
275
         if (_lcd_level_bed_corners_raise()) {             // Prompt user to raise bed if needed
275
           #if ENABLED(LEVEL_CORNERS_VERIFY_RAISED)        // Verify
276
           #if ENABLED(LEVEL_CORNERS_VERIFY_RAISED)        // Verify
290
 
291
 
291
     } while (good_points < nr_edge_points); // loop until all points within tolerance
292
     } while (good_points < nr_edge_points); // loop until all points within tolerance
292
 
293
 
293
-    #if ENABLED(BLTOUCH_HS_MODE)
294
-      // In HIGH SPEED MODE do clearance and stow at the very end
295
-      do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP);
296
-      bltouch.stow();
294
+    #if ENABLED(BLTOUCH)
295
+      if (bltouch.high_speed_mode)
296
+        // In HIGH SPEED MODE do clearance and stow at the very end
297
+        do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP);
298
+        bltouch.stow();
299
+      }
297
     #endif
300
     #endif
298
 
301
 
299
     ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling
302
     ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling

+ 10
- 4
Marlin/src/lcd/menu/menu_configuration.cpp 查看文件

217
 
217
 
218
   #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
218
   #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
219
     void bltouch_report() {
219
     void bltouch_report() {
220
-      SERIAL_ECHOLNPGM("EEPROM Last BLTouch Mode - ", bltouch.last_written_mode);
221
-      SERIAL_ECHOLNPGM("Configuration BLTouch Mode - " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD"));
220
+      PGMSTR(mode0, "OD");
221
+      PGMSTR(mode1, "5V");
222
+      SERIAL_ECHOPGM("BLTouch Mode: ");
223
+      SERIAL_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
224
+      SERIAL_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
222
       char mess[21];
225
       char mess[21];
223
-      strcpy_P(mess, PSTR("BLTouch Mode - "));
224
-      strcpy_P(&mess[15], bltouch.last_written_mode ? PSTR("5V") : PSTR("OD"));
226
+      strcpy_P(mess, PSTR("BLTouch Mode: "));
227
+      strcpy_P(&mess[15], bltouch.od_5v_mode ? mode1 : mode0);
225
       ui.set_status(mess);
228
       ui.set_status(mess);
226
       ui.return_to_status();
229
       ui.return_to_status();
227
     }
230
     }
235
     ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy);
238
     ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy);
236
     ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow);
239
     ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow);
237
     ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode);
240
     ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode);
241
+    #ifdef BLTOUCH_HS_MODE
242
+      EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode);
243
+    #endif
238
     #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
244
     #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
239
       CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
245
       CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
240
       CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
246
       CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));

+ 5
- 1
Marlin/src/lcd/menu/menu_tramming.cpp 查看文件

36
 #include "../../module/probe.h"
36
 #include "../../module/probe.h"
37
 #include "../../gcode/queue.h"
37
 #include "../../gcode/queue.h"
38
 
38
 
39
+#if ENABLED(BLTOUCH)
40
+  #include "../../feature/bltouch.h"
41
+#endif
42
+
39
 //#define DEBUG_OUT 1
43
 //#define DEBUG_OUT 1
40
 #include "../../core/debug_out.h"
44
 #include "../../core/debug_out.h"
41
 
45
 
51
 static bool probe_single_point() {
55
 static bool probe_single_point() {
52
   do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
56
   do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
53
   // Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
57
   // Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
54
-  const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true);
58
+  const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN0(BLTOUCH, bltouch.high_speed_mode) ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true);
55
   z_measured[tram_index] = z_probed_height;
59
   z_measured[tram_index] = z_probed_height;
56
   if (reference_index < 0) reference_index = tram_index;
60
   if (reference_index < 0) reference_index = tram_index;
57
   move_to_tramming_wait_pos();
61
   move_to_tramming_wait_pos();

+ 5
- 4
Marlin/src/module/motion.cpp 查看文件

1803
     if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home Fast: ", move_length, "mm");
1803
     if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home Fast: ", move_length, "mm");
1804
     do_homing_move(axis, move_length, 0.0, !use_probe_bump);
1804
     do_homing_move(axis, move_length, 0.0, !use_probe_bump);
1805
 
1805
 
1806
-    #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE)
1807
-      if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
1806
+    #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH)
1807
+      if (axis == Z_AXIS && !bltouch.high_speed_mode) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
1808
     #endif
1808
     #endif
1809
 
1809
 
1810
     // If a second homing move is configured...
1810
     // If a second homing move is configured...
1837
         }
1837
         }
1838
       #endif
1838
       #endif
1839
 
1839
 
1840
-      #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE)
1841
-        if (axis == Z_AXIS && bltouch.deploy()) return; // Intermediate DEPLOY (in LOW SPEED MODE)
1840
+      #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH)
1841
+        if (axis == Z_AXIS && !bltouch.high_speed_mode && bltouch.deploy())
1842
+          return; // Intermediate DEPLOY (in LOW SPEED MODE)
1842
       #endif
1843
       #endif
1843
 
1844
 
1844
       // Slow move towards endstop until triggered
1845
       // Slow move towards endstop until triggered

+ 11
- 6
Marlin/src/module/probe.cpp 查看文件

489
   #if BOTH(HAS_TEMP_HOTEND, WAIT_FOR_HOTEND)
489
   #if BOTH(HAS_TEMP_HOTEND, WAIT_FOR_HOTEND)
490
     thermalManager.wait_for_hotend_heating(active_extruder);
490
     thermalManager.wait_for_hotend_heating(active_extruder);
491
   #endif
491
   #endif
492
-
493
-  if (TERN0(BLTOUCH_SLOW_MODE, bltouch.deploy())) return true; // Deploy in LOW SPEED MODE on every probe action
492
+  #if ENABLED(BLTOUCH)
493
+    if (!bltouch.high_speed_mode && bltouch.deploy())
494
+      return true; // Deploy in LOW SPEED MODE on every probe action
495
+  #endif
494
 
496
 
495
   // Disable stealthChop if used. Enable diag1 pin on driver.
497
   // Disable stealthChop if used. Enable diag1 pin on driver.
496
   #if ENABLED(SENSORLESS_PROBING)
498
   #if ENABLED(SENSORLESS_PROBING)
531
     set_homing_current(false);
533
     set_homing_current(false);
532
   #endif
534
   #endif
533
 
535
 
534
-  if (probe_triggered && TERN0(BLTOUCH_SLOW_MODE, bltouch.stow())) // Stow in LOW SPEED MODE on every trigger
535
-    return true;
536
+  #if ENABLED(BLTOUCH)
537
+    if (probe_triggered && !bltouch.high_speed_mode && bltouch.stow())
538
+      return true; // Stow in LOW SPEED MODE on every trigger
539
+  #endif
536
 
540
 
537
   // Clear endstop flags
541
   // Clear endstop flags
538
   endstops.hit_on_purpose();
542
   endstops.hit_on_purpose();
762
     DEBUG_POS("", current_position);
766
     DEBUG_POS("", current_position);
763
   }
767
   }
764
 
768
 
765
-  #if BOTH(BLTOUCH, BLTOUCH_HS_MODE)
766
-    if (bltouch.triggered()) bltouch._reset();
769
+  #if ENABLED(BLTOUCH)
770
+    if (bltouch.high_speed_mode && bltouch.triggered())
771
+      bltouch._reset();
767
   #endif
772
   #endif
768
 
773
 
769
   // On delta keep Z below clip height or do_blocking_move_to will abort
774
   // On delta keep Z below clip height or do_blocking_move_to will abort

+ 31
- 12
Marlin/src/module/settings.cpp 查看文件

301
   //
301
   //
302
   // BLTOUCH
302
   // BLTOUCH
303
   //
303
   //
304
-  bool bltouch_last_written_mode;
304
+  bool bltouch_od_5v_mode;
305
+  #ifdef BLTOUCH_HS_MODE
306
+    bool bltouch_high_speed_mode;                       // M401 S
307
+  #endif
305
 
308
 
306
   //
309
   //
307
   // Kinematic Settings
310
   // Kinematic Settings
918
     // BLTOUCH
921
     // BLTOUCH
919
     //
922
     //
920
     {
923
     {
921
-      _FIELD_TEST(bltouch_last_written_mode);
922
-      const bool bltouch_last_written_mode = TERN(BLTOUCH, bltouch.last_written_mode, false);
923
-      EEPROM_WRITE(bltouch_last_written_mode);
924
+      _FIELD_TEST(bltouch_od_5v_mode);
925
+      const bool bltouch_od_5v_mode = TERN0(BLTOUCH, bltouch.od_5v_mode);
926
+      EEPROM_WRITE(bltouch_od_5v_mode);
927
+
928
+      #ifdef BLTOUCH_HS_MODE
929
+        _FIELD_TEST(bltouch_high_speed_mode);
930
+        const bool bltouch_high_speed_mode = TERN0(BLTOUCH, bltouch.high_speed_mode);
931
+        EEPROM_WRITE(bltouch_high_speed_mode);
932
+      #endif
924
     }
933
     }
925
 
934
 
926
     //
935
     //
1810
       // BLTOUCH
1819
       // BLTOUCH
1811
       //
1820
       //
1812
       {
1821
       {
1813
-        _FIELD_TEST(bltouch_last_written_mode);
1822
+        _FIELD_TEST(bltouch_od_5v_mode);
1814
         #if ENABLED(BLTOUCH)
1823
         #if ENABLED(BLTOUCH)
1815
-          const bool &bltouch_last_written_mode = bltouch.last_written_mode;
1824
+          const bool &bltouch_od_5v_mode = bltouch.od_5v_mode;
1816
         #else
1825
         #else
1817
-          bool bltouch_last_written_mode;
1826
+          bool bltouch_od_5v_mode;
1827
+        #endif
1828
+        EEPROM_READ(bltouch_od_5v_mode);
1829
+
1830
+        #ifdef BLTOUCH_HS_MODE
1831
+          _FIELD_TEST(bltouch_high_speed_mode);
1832
+          #if ENABLED(BLTOUCH)
1833
+            const bool &bltouch_high_speed_mode = bltouch.high_speed_mode;
1834
+          #else
1835
+            bool bltouch_high_speed_mode;
1836
+          #endif
1837
+          EEPROM_READ(bltouch_high_speed_mode);
1818
         #endif
1838
         #endif
1819
-        EEPROM_READ(bltouch_last_written_mode);
1820
       }
1839
       }
1821
 
1840
 
1822
       //
1841
       //
2827
   TERN_(HAS_PTC, ptc.reset());
2846
   TERN_(HAS_PTC, ptc.reset());
2828
 
2847
 
2829
   //
2848
   //
2830
-  // BLTOUCH
2849
+  // BLTouch
2831
   //
2850
   //
2832
-  //#if ENABLED(BLTOUCH)
2833
-  //  bltouch.last_written_mode;
2834
-  //#endif
2851
+  #ifdef BLTOUCH_HS_MODE
2852
+    bltouch.high_speed_mode = ENABLED(BLTOUCH_HS_MODE);
2853
+  #endif
2835
 
2854
 
2836
   //
2855
   //
2837
   // Kinematic settings
2856
   // Kinematic settings

Loading…
取消
儲存