Sfoglia il codice sorgente

Combine Z_AFTER_DEACTIVATE with UNKNOWN_Z_NO_RAISE (#20444)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
swissnorp 4 anni fa
parent
commit
bcda46e3f3
Nessun account collegato all'indirizzo email del committer

+ 7
- 2
Marlin/Configuration.h Vedi File

569
  * the issues involved, don't use chamber PID until someone else verifies that your hardware works.
569
  * the issues involved, don't use chamber PID until someone else verifies that your hardware works.
570
  */
570
  */
571
 //#define PIDTEMPCHAMBER
571
 //#define PIDTEMPCHAMBER
572
-
573
 //#define CHAMBER_LIMIT_SWITCHING
572
 //#define CHAMBER_LIMIT_SWITCHING
574
 
573
 
575
 /**
574
 /**
1196
 
1195
 
1197
 //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed. Also enable HOME_AFTER_DEACTIVATE for extra safety.
1196
 //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed. Also enable HOME_AFTER_DEACTIVATE for extra safety.
1198
 //#define HOME_AFTER_DEACTIVATE   // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety.
1197
 //#define HOME_AFTER_DEACTIVATE   // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety.
1199
-//#define UNKNOWN_Z_NO_RAISE      // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.
1198
+
1199
+/**
1200
+ * Set Z_IDLE_HEIGHT if the Z-Axis moves on its own when steppers are disabled.
1201
+ *  - Use a low value (i.e., Z_MIN_POS) if the nozzle falls down to the bed.
1202
+ *  - Use a large value (i.e., Z_MAX_POS) if the bed falls down, away from the nozzle.
1203
+ */
1204
+//#define Z_IDLE_HEIGHT Z_HOME_POS
1200
 
1205
 
1201
 //#define Z_HOMING_HEIGHT  4      // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
1206
 //#define Z_HOMING_HEIGHT  4      // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
1202
                                   // Be sure to have this much clearance over your Z_MAX_POS to prevent grinding.
1207
                                   // Be sure to have this much clearance over your Z_MAX_POS to prevent grinding.

+ 0
- 3
Marlin/Configuration_adv.h Vedi File

869
 #define DISABLE_INACTIVE_Z true  // Set 'false' if the nozzle could fall onto your printed part!
869
 #define DISABLE_INACTIVE_Z true  // Set 'false' if the nozzle could fall onto your printed part!
870
 #define DISABLE_INACTIVE_E true
870
 #define DISABLE_INACTIVE_E true
871
 
871
 
872
-// If the Nozzle or Bed falls when the Z stepper is disabled, set its resting position here.
873
-//#define Z_AFTER_DEACTIVATE Z_HOME_POS
874
-
875
 // Default Minimum Feedrates for printing and travel moves
872
 // Default Minimum Feedrates for printing and travel moves
876
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // (mm/s) Minimum feedrate. Set with M205 S.
873
 #define DEFAULT_MINIMUMFEEDRATE       0.0     // (mm/s) Minimum feedrate. Set with M205 S.
877
 #define DEFAULT_MINTRAVELFEEDRATE     0.0     // (mm/s) Minimum travel feedrate. Set with M205 T.
874
 #define DEFAULT_MINTRAVELFEEDRATE     0.0     // (mm/s) Minimum travel feedrate. Set with M205 T.

+ 2
- 4
Marlin/src/gcode/calibrate/G28.cpp Vedi File

326
 
326
 
327
     #endif
327
     #endif
328
 
328
 
329
-    const float z_homing_height = TERN1(UNKNOWN_Z_NO_RAISE, axis_is_trusted(Z_AXIS))
330
-                                  ? (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT)
331
-                                  : 0;
329
+    const float z_homing_height = parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT;
332
 
330
 
333
     if (z_homing_height && (doX || doY || TERN0(Z_SAFE_HOMING, doZ))) {
331
     if (z_homing_height && (doX || doY || TERN0(Z_SAFE_HOMING, doZ))) {
334
       // Raise Z before homing any other axes and z is not already high enough (never lower z)
332
       // Raise Z before homing any other axes and z is not already high enough (never lower z)
335
       if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) by ", z_homing_height);
333
       if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) by ", z_homing_height);
336
-      do_z_clearance(z_homing_height, axis_is_trusted(Z_AXIS), DISABLED(UNKNOWN_Z_NO_RAISE));
334
+      do_z_clearance(z_homing_height);
337
     }
335
     }
338
 
336
 
339
     #if ENABLED(QUICK_HOME)
337
     #if ENABLED(QUICK_HOME)

+ 4
- 0
Marlin/src/inc/SanityCheck.h Vedi File

539
   #endif
539
   #endif
540
 #elif defined(ASSISTED_TRAMMING_MENU_ITEM)
540
 #elif defined(ASSISTED_TRAMMING_MENU_ITEM)
541
   #error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
541
   #error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
542
+#elif defined(UNKNOWN_Z_NO_RAISE)
543
+  #error "UNKNOWN_Z_NO_RAISE is replaced by setting Z_IDLE_HEIGHT to Z_MAX_POS."
544
+#elif defined(Z_AFTER_DEACTIVATE)
545
+  #error "Z_AFTER_DEACTIVATE is replaced by Z_IDLE_HEIGHT."
542
 #endif
546
 #endif
543
 
547
 
544
 /**
548
 /**

+ 9
- 4
Marlin/src/module/motion.cpp Vedi File

83
  *   Used by 'line_to_current_position' to do a move after changing it.
83
  *   Used by 'line_to_current_position' to do a move after changing it.
84
  *   Used by 'sync_plan_position' to update 'planner.position'.
84
  *   Used by 'sync_plan_position' to update 'planner.position'.
85
  */
85
  */
86
-xyze_pos_t current_position = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS };
86
+xyze_pos_t current_position = { X_HOME_POS, Y_HOME_POS,
87
+  #ifdef Z_IDLE_HEIGHT
88
+    Z_IDLE_HEIGHT
89
+  #else
90
+    Z_HOME_POS
91
+  #endif
92
+};
87
 
93
 
88
 /**
94
 /**
89
  * Cartesian Destination
95
  * Cartesian Destination
494
   do_blocking_move_to(raw.x, raw.y, z, fr_mm_s);
500
   do_blocking_move_to(raw.x, raw.y, z, fr_mm_s);
495
 }
501
 }
496
 
502
 
497
-void do_z_clearance(const float &zclear, const bool z_trusted/*=true*/, const bool raise_on_untrusted/*=true*/, const bool lower_allowed/*=false*/) {
498
-  const bool rel = raise_on_untrusted && !z_trusted;
499
-  float zdest = zclear + (rel ? current_position.z : 0.0f);
503
+void do_z_clearance(const float &zclear, const bool lower_allowed/*=false*/) {
504
+  float zdest = zclear;
500
   if (!lower_allowed) NOLESS(zdest, current_position.z);
505
   if (!lower_allowed) NOLESS(zdest, current_position.z);
501
   do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), TERN(HAS_BED_PROBE, z_probe_fast_mm_s, homing_feedrate(Z_AXIS)));
506
   do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), TERN(HAS_BED_PROBE, z_probe_fast_mm_s, homing_feedrate(Z_AXIS)));
502
 }
507
 }

+ 1
- 1
Marlin/src/module/motion.h Vedi File

278
 void remember_feedrate_scaling_off();
278
 void remember_feedrate_scaling_off();
279
 void restore_feedrate_and_scaling();
279
 void restore_feedrate_and_scaling();
280
 
280
 
281
-void do_z_clearance(const float &zclear, const bool z_trusted=true, const bool raise_on_untrusted=true, const bool lower_allowed=false);
281
+void do_z_clearance(const float &zclear, const bool lower_allowed=false);
282
 
282
 
283
 /**
283
 /**
284
  * Homing and Trusted Axes
284
  * Homing and Trusted Axes

+ 1
- 8
Marlin/src/module/probe.cpp Vedi File

401
     constexpr bool z_raise_wanted = true;
401
     constexpr bool z_raise_wanted = true;
402
   #endif
402
   #endif
403
 
403
 
404
-  // For beds that fall when Z is powered off only raise for trusted Z
405
-  #if ENABLED(UNKNOWN_Z_NO_RAISE)
406
-    const bool z_is_trusted = axis_is_trusted(Z_AXIS);
407
-  #else
408
-    constexpr float z_is_trusted = true;
409
-  #endif
410
-
411
-  if (z_is_trusted && z_raise_wanted)
404
+  if (z_raise_wanted)
412
     do_z_raise(_MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE));
405
     do_z_raise(_MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE));
413
 
406
 
414
   #if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY)
407
   #if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY)

+ 2
- 2
Marlin/src/module/probe.h Vedi File

100
 
100
 
101
     static void move_z_after_probing() {
101
     static void move_z_after_probing() {
102
       #ifdef Z_AFTER_PROBING
102
       #ifdef Z_AFTER_PROBING
103
-        do_z_clearance(Z_AFTER_PROBING, true, true, true); // Move down still permitted
103
+        do_z_clearance(Z_AFTER_PROBING, true); // Move down still permitted
104
       #endif
104
       #endif
105
     }
105
     }
106
     static float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true);
106
     static float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true);
120
 
120
 
121
   static void move_z_after_homing() {
121
   static void move_z_after_homing() {
122
     #ifdef Z_AFTER_HOMING
122
     #ifdef Z_AFTER_HOMING
123
-      do_z_clearance(Z_AFTER_HOMING, true, true, true);
123
+      do_z_clearance(Z_AFTER_HOMING, true);
124
     #elif BOTH(Z_AFTER_PROBING, HAS_BED_PROBE)
124
     #elif BOTH(Z_AFTER_PROBING, HAS_BED_PROBE)
125
       move_z_after_probing();
125
       move_z_after_probing();
126
     #endif
126
     #endif

+ 2
- 2
Marlin/src/module/stepper/indirection.h Vedi File

862
 #define  ENABLE_AXIS_Z() if (SHOULD_ENABLE(z))  {  ENABLE_STEPPER_Z();  ENABLE_STEPPER_Z2();  ENABLE_STEPPER_Z3();  ENABLE_STEPPER_Z4(); AFTER_CHANGE(z, true); }
862
 #define  ENABLE_AXIS_Z() if (SHOULD_ENABLE(z))  {  ENABLE_STEPPER_Z();  ENABLE_STEPPER_Z2();  ENABLE_STEPPER_Z3();  ENABLE_STEPPER_Z4(); AFTER_CHANGE(z, true); }
863
 #define DISABLE_AXIS_Z() if (SHOULD_DISABLE(z)) { DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); AFTER_CHANGE(z, false); set_axis_untrusted(Z_AXIS); Z_RESET(); }
863
 #define DISABLE_AXIS_Z() if (SHOULD_DISABLE(z)) { DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); AFTER_CHANGE(z, false); set_axis_untrusted(Z_AXIS); Z_RESET(); }
864
 
864
 
865
-#ifdef Z_AFTER_DEACTIVATE
866
-  #define Z_RESET() do{ current_position.z = Z_AFTER_DEACTIVATE; sync_plan_position(); }while(0)
865
+#ifdef Z_IDLE_HEIGHT
866
+  #define Z_RESET() do{ current_position.z = Z_IDLE_HEIGHT; sync_plan_position(); }while(0)
867
 #else
867
 #else
868
   #define Z_RESET()
868
   #define Z_RESET()
869
 #endif
869
 #endif

+ 1
- 1
buildroot/tests/STM32F103RC_btt-tests Vedi File

17
 opt_set Y_DRIVER_TYPE TMC2209
17
 opt_set Y_DRIVER_TYPE TMC2209
18
 opt_set Z_DRIVER_TYPE TMC2209
18
 opt_set Z_DRIVER_TYPE TMC2209
19
 opt_set E0_DRIVER_TYPE TMC2209
19
 opt_set E0_DRIVER_TYPE TMC2209
20
-opt_enable PINS_DEBUGGING
20
+opt_enable PINS_DEBUGGING Z_IDLE_HEIGHT
21
 
21
 
22
 exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3"
22
 exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3"
23
 
23
 

Loading…
Annulla
Salva