Bladeren bron

Merge pull request #4299 from jbrazio/feature/g27-park-nozzle

Implements park nozzle feature
Scott Lahteine 8 jaren geleden
bovenliggende
commit
bf16ae5a70
25 gewijzigde bestanden met toevoegingen van 683 en 85 verwijderingen
  1. 8
    2
      .travis.yml
  2. 24
    0
      Marlin/Configuration.h
  3. 25
    2
      Marlin/Marlin_main.cpp
  4. 24
    0
      Marlin/example_configurations/Cartesio/Configuration.h
  5. 24
    0
      Marlin/example_configurations/Felix/Configuration.h
  6. 24
    0
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  7. 24
    0
      Marlin/example_configurations/Hephestos/Configuration.h
  8. 24
    0
      Marlin/example_configurations/Hephestos_2/Configuration.h
  9. 24
    0
      Marlin/example_configurations/K8200/Configuration.h
  10. 24
    0
      Marlin/example_configurations/K8400/Configuration.h
  11. 24
    0
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  12. 24
    0
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  13. 24
    0
      Marlin/example_configurations/RigidBot/Configuration.h
  14. 24
    0
      Marlin/example_configurations/SCARA/Configuration.h
  15. 24
    0
      Marlin/example_configurations/TAZ4/Configuration.h
  16. 24
    0
      Marlin/example_configurations/WITBOX/Configuration.h
  17. 24
    0
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  18. 24
    0
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  19. 24
    0
      Marlin/example_configurations/delta/generic/Configuration.h
  20. 24
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  21. 24
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  22. 24
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  23. 24
    0
      Marlin/example_configurations/makibox/Configuration.h
  24. 24
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  25. 122
    81
      Marlin/nozzle.h

+ 8
- 2
.travis.yml Bestand weergeven

@@ -211,10 +211,16 @@ script:
211 211
   - opt_enable PRINTCOUNTER
212 212
   - build_marlin
213 213
   #
214
-  # Test CLEAN_NOZZLE_FEATURE
214
+  # Test NOZZLE_PARK_FEATURE
215 215
   #
216 216
   - restore_configs
217
-  - opt_enable AUTO_BED_LEVELING_FEATURE CLEAN_NOZZLE_FEATURE FIX_MOUNTED_PROBE
217
+  - opt_enable NOZZLE_PARK_FEATURE
218
+  - build_marlin
219
+  #
220
+  # Test NOZZLE_CLEAN_FEATURE
221
+  #
222
+  - restore_configs
223
+  - opt_enable AUTO_BED_LEVELING_FEATURE NOZZLE_CLEAN_FEATURE FIX_MOUNTED_PROBE
218 224
   - build_marlin
219 225
   #
220 226
   #

+ 24
- 0
Marlin/Configuration.h Bestand weergeven

@@ -804,6 +804,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
804 804
 #define PREHEAT_2_FAN_SPEED     0 // Value from 0 to 255
805 805
 
806 806
 //
807
+// Nozzle Park -- EXPERIMENTAL
808
+//
809
+// When enabled allows the user to define a special XYZ position, inside the
810
+// machine's topology, to park the nozzle when idle or when receiving the G27
811
+// command.
812
+//
813
+// The "P" paramenter controls what is the action applied to the Z axis:
814
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
815
+//        be raised to reach Z-park height.
816
+//
817
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
818
+//        reach Z-park height.
819
+//
820
+//    P2: The nozzle height will be raised by Z-park amount but never going over
821
+//        the machine's limit of Z_MAX_POS.
822
+//
823
+//#define NOZZLE_PARK_FEATURE
824
+
825
+#if ENABLED(NOZZLE_PARK_FEATURE)
826
+  // Specify a park position as { X, Y, Z }
827
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
828
+#endif
829
+
830
+//
807 831
 // Clean Nozzle Feature -- EXPERIMENTAL
808 832
 //
809 833
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 25
- 2
Marlin/Marlin_main.cpp Bestand weergeven

@@ -2736,9 +2736,12 @@ inline void gcode_G4() {
2736 2736
 
2737 2737
 #endif //FWRETRACT
2738 2738
 
2739
-#if ENABLED(NOZZLE_CLEAN_FEATURE) && ENABLED(AUTO_BED_LEVELING_FEATURE)
2739
+#if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE
2740 2740
   #include "nozzle.h"
2741 2741
 
2742
+  /**
2743
+   * G12: Clean the nozzle
2744
+   */
2742 2745
   inline void gcode_G12() {
2743 2746
     // Don't allow nozzle cleaning without homing first
2744 2747
     if (axis_unhomed_error(true, true, true)) { return; }
@@ -2795,6 +2798,20 @@ inline void gcode_G4() {
2795 2798
 
2796 2799
 #endif // QUICK_HOME
2797 2800
 
2801
+#if ENABLED(NOZZLE_PARK_FEATURE)
2802
+  #include "nozzle.h"
2803
+
2804
+  /**
2805
+   * G27: Park the nozzle
2806
+   */
2807
+  inline void gcode_G27() {
2808
+    // Don't allow nozzle parking without homing first
2809
+    if (axis_unhomed_error(true, true, true)) { return; }
2810
+    uint8_t const z_action = code_seen('P') ? code_value_ushort() : 0;
2811
+    Nozzle::park(z_action);
2812
+  }
2813
+#endif // NOZZLE_PARK_FEATURE
2814
+
2798 2815
 /**
2799 2816
  * G28: Home all axes according to settings
2800 2817
  *
@@ -6884,7 +6901,7 @@ void process_next_command() {
6884 6901
 
6885 6902
       #if ENABLED(NOZZLE_CLEAN_FEATURE) && HAS_BED_PROBE
6886 6903
         case 12:
6887
-          gcode_G12(); // G12: Clean Nozzle
6904
+          gcode_G12(); // G12: Nozzle Clean
6888 6905
           break;
6889 6906
       #endif // NOZZLE_CLEAN_FEATURE
6890 6907
 
@@ -6898,6 +6915,12 @@ void process_next_command() {
6898 6915
           break;
6899 6916
       #endif // INCH_MODE_SUPPORT
6900 6917
 
6918
+      #if ENABLED(NOZZLE_PARK_FEATURE)
6919
+        case 27: // G27: Nozzle Park
6920
+          gcode_G27();
6921
+          break;
6922
+      #endif // NOZZLE_PARK_FEATURE
6923
+
6901 6924
       case 28: // G28: Home all axes, one at a time
6902 6925
         gcode_G28();
6903 6926
         break;

+ 24
- 0
Marlin/example_configurations/Cartesio/Configuration.h Bestand weergeven

@@ -804,6 +804,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
804 804
 #define PREHEAT_2_FAN_SPEED     0 // Value from 0 to 255
805 805
 
806 806
 //
807
+// Nozzle Park -- EXPERIMENTAL
808
+//
809
+// When enabled allows the user to define a special XYZ position, inside the
810
+// machine's topology, to park the nozzle when idle or when receiving the G27
811
+// command.
812
+//
813
+// The "P" paramenter controls what is the action applied to the Z axis:
814
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
815
+//        be raised to reach Z-park height.
816
+//
817
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
818
+//        reach Z-park height.
819
+//
820
+//    P2: The nozzle height will be raised by Z-park amount but never going over
821
+//        the machine's limit of Z_MAX_POS.
822
+//
823
+//#define NOZZLE_PARK_FEATURE
824
+
825
+#if ENABLED(NOZZLE_PARK_FEATURE)
826
+  // Specify a park position as { X, Y, Z }
827
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
828
+#endif
829
+
830
+//
807 831
 // Clean Nozzle Feature -- EXPERIMENTAL
808 832
 //
809 833
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/Felix/Configuration.h Bestand weergeven

@@ -787,6 +787,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
787 787
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
788 788
 
789 789
 //
790
+// Nozzle Park -- EXPERIMENTAL
791
+//
792
+// When enabled allows the user to define a special XYZ position, inside the
793
+// machine's topology, to park the nozzle when idle or when receiving the G27
794
+// command.
795
+//
796
+// The "P" paramenter controls what is the action applied to the Z axis:
797
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
798
+//        be raised to reach Z-park height.
799
+//
800
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
801
+//        reach Z-park height.
802
+//
803
+//    P2: The nozzle height will be raised by Z-park amount but never going over
804
+//        the machine's limit of Z_MAX_POS.
805
+//
806
+//#define NOZZLE_PARK_FEATURE
807
+
808
+#if ENABLED(NOZZLE_PARK_FEATURE)
809
+  // Specify a park position as { X, Y, Z }
810
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
811
+#endif
812
+
813
+//
790 814
 // Clean Nozzle Feature -- EXPERIMENTAL
791 815
 //
792 816
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/Felix/DUAL/Configuration.h Bestand weergeven

@@ -785,6 +785,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
785 785
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
786 786
 
787 787
 //
788
+// Nozzle Park -- EXPERIMENTAL
789
+//
790
+// When enabled allows the user to define a special XYZ position, inside the
791
+// machine's topology, to park the nozzle when idle or when receiving the G27
792
+// command.
793
+//
794
+// The "P" paramenter controls what is the action applied to the Z axis:
795
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
796
+//        be raised to reach Z-park height.
797
+//
798
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
799
+//        reach Z-park height.
800
+//
801
+//    P2: The nozzle height will be raised by Z-park amount but never going over
802
+//        the machine's limit of Z_MAX_POS.
803
+//
804
+//#define NOZZLE_PARK_FEATURE
805
+
806
+#if ENABLED(NOZZLE_PARK_FEATURE)
807
+  // Specify a park position as { X, Y, Z }
808
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
809
+#endif
810
+
811
+//
788 812
 // Clean Nozzle Feature -- EXPERIMENTAL
789 813
 //
790 814
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/Hephestos/Configuration.h Bestand weergeven

@@ -796,6 +796,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
796 796
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
797 797
 
798 798
 //
799
+// Nozzle Park -- EXPERIMENTAL
800
+//
801
+// When enabled allows the user to define a special XYZ position, inside the
802
+// machine's topology, to park the nozzle when idle or when receiving the G27
803
+// command.
804
+//
805
+// The "P" paramenter controls what is the action applied to the Z axis:
806
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
807
+//        be raised to reach Z-park height.
808
+//
809
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
810
+//        reach Z-park height.
811
+//
812
+//    P2: The nozzle height will be raised by Z-park amount but never going over
813
+//        the machine's limit of Z_MAX_POS.
814
+//
815
+//#define NOZZLE_PARK_FEATURE
816
+
817
+#if ENABLED(NOZZLE_PARK_FEATURE)
818
+  // Specify a park position as { X, Y, Z }
819
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
820
+#endif
821
+
822
+//
799 823
 // Clean Nozzle Feature -- EXPERIMENTAL
800 824
 //
801 825
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/Hephestos_2/Configuration.h Bestand weergeven

@@ -798,6 +798,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
798 798
 #define PREHEAT_2_FAN_SPEED     0 // Value from 0 to 255
799 799
 
800 800
 //
801
+// Nozzle Park -- EXPERIMENTAL
802
+//
803
+// When enabled allows the user to define a special XYZ position, inside the
804
+// machine's topology, to park the nozzle when idle or when receiving the G27
805
+// command.
806
+//
807
+// The "P" paramenter controls what is the action applied to the Z axis:
808
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
809
+//        be raised to reach Z-park height.
810
+//
811
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
812
+//        reach Z-park height.
813
+//
814
+//    P2: The nozzle height will be raised by Z-park amount but never going over
815
+//        the machine's limit of Z_MAX_POS.
816
+//
817
+//#define NOZZLE_PARK_FEATURE
818
+
819
+#if ENABLED(NOZZLE_PARK_FEATURE)
820
+  // Specify a park position as { X, Y, Z }
821
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
822
+#endif
823
+
824
+//
801 825
 // Clean Nozzle Feature -- EXPERIMENTAL
802 826
 //
803 827
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/K8200/Configuration.h Bestand weergeven

@@ -821,6 +821,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
821 821
 #define PREHEAT_2_FAN_SPEED     0 // Value from 0 to 255
822 822
 
823 823
 //
824
+// Nozzle Park -- EXPERIMENTAL
825
+//
826
+// When enabled allows the user to define a special XYZ position, inside the
827
+// machine's topology, to park the nozzle when idle or when receiving the G27
828
+// command.
829
+//
830
+// The "P" paramenter controls what is the action applied to the Z axis:
831
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
832
+//        be raised to reach Z-park height.
833
+//
834
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
835
+//        reach Z-park height.
836
+//
837
+//    P2: The nozzle height will be raised by Z-park amount but never going over
838
+//        the machine's limit of Z_MAX_POS.
839
+//
840
+//#define NOZZLE_PARK_FEATURE
841
+
842
+#if ENABLED(NOZZLE_PARK_FEATURE)
843
+  // Specify a park position as { X, Y, Z }
844
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
845
+#endif
846
+
847
+//
824 848
 // Clean Nozzle Feature -- EXPERIMENTAL
825 849
 //
826 850
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/K8400/Configuration.h Bestand weergeven

@@ -804,6 +804,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
804 804
 #define PREHEAT_2_FAN_SPEED   165 // Value from 0 to 255
805 805
 
806 806
 //
807
+// Nozzle Park -- EXPERIMENTAL
808
+//
809
+// When enabled allows the user to define a special XYZ position, inside the
810
+// machine's topology, to park the nozzle when idle or when receiving the G27
811
+// command.
812
+//
813
+// The "P" paramenter controls what is the action applied to the Z axis:
814
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
815
+//        be raised to reach Z-park height.
816
+//
817
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
818
+//        reach Z-park height.
819
+//
820
+//    P2: The nozzle height will be raised by Z-park amount but never going over
821
+//        the machine's limit of Z_MAX_POS.
822
+//
823
+//#define NOZZLE_PARK_FEATURE
824
+
825
+#if ENABLED(NOZZLE_PARK_FEATURE)
826
+  // Specify a park position as { X, Y, Z }
827
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
828
+#endif
829
+
830
+//
807 831
 // Clean Nozzle Feature -- EXPERIMENTAL
808 832
 //
809 833
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/K8400/Dual-head/Configuration.h Bestand weergeven

@@ -804,6 +804,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
804 804
 #define PREHEAT_2_FAN_SPEED   165 // Value from 0 to 255
805 805
 
806 806
 //
807
+// Nozzle Park -- EXPERIMENTAL
808
+//
809
+// When enabled allows the user to define a special XYZ position, inside the
810
+// machine's topology, to park the nozzle when idle or when receiving the G27
811
+// command.
812
+//
813
+// The "P" paramenter controls what is the action applied to the Z axis:
814
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
815
+//        be raised to reach Z-park height.
816
+//
817
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
818
+//        reach Z-park height.
819
+//
820
+//    P2: The nozzle height will be raised by Z-park amount but never going over
821
+//        the machine's limit of Z_MAX_POS.
822
+//
823
+//#define NOZZLE_PARK_FEATURE
824
+
825
+#if ENABLED(NOZZLE_PARK_FEATURE)
826
+  // Specify a park position as { X, Y, Z }
827
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
828
+#endif
829
+
830
+//
807 831
 // Clean Nozzle Feature -- EXPERIMENTAL
808 832
 //
809 833
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Bestand weergeven

@@ -804,6 +804,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
804 804
 #define PREHEAT_2_FAN_SPEED     0 // Value from 0 to 255
805 805
 
806 806
 //
807
+// Nozzle Park -- EXPERIMENTAL
808
+//
809
+// When enabled allows the user to define a special XYZ position, inside the
810
+// machine's topology, to park the nozzle when idle or when receiving the G27
811
+// command.
812
+//
813
+// The "P" paramenter controls what is the action applied to the Z axis:
814
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
815
+//        be raised to reach Z-park height.
816
+//
817
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
818
+//        reach Z-park height.
819
+//
820
+//    P2: The nozzle height will be raised by Z-park amount but never going over
821
+//        the machine's limit of Z_MAX_POS.
822
+//
823
+//#define NOZZLE_PARK_FEATURE
824
+
825
+#if ENABLED(NOZZLE_PARK_FEATURE)
826
+  // Specify a park position as { X, Y, Z }
827
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
828
+#endif
829
+
830
+//
807 831
 // Clean Nozzle Feature -- EXPERIMENTAL
808 832
 //
809 833
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/RigidBot/Configuration.h Bestand weergeven

@@ -802,6 +802,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
802 802
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
803 803
 
804 804
 //
805
+// Nozzle Park -- EXPERIMENTAL
806
+//
807
+// When enabled allows the user to define a special XYZ position, inside the
808
+// machine's topology, to park the nozzle when idle or when receiving the G27
809
+// command.
810
+//
811
+// The "P" paramenter controls what is the action applied to the Z axis:
812
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
813
+//        be raised to reach Z-park height.
814
+//
815
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
816
+//        reach Z-park height.
817
+//
818
+//    P2: The nozzle height will be raised by Z-park amount but never going over
819
+//        the machine's limit of Z_MAX_POS.
820
+//
821
+//#define NOZZLE_PARK_FEATURE
822
+
823
+#if ENABLED(NOZZLE_PARK_FEATURE)
824
+  // Specify a park position as { X, Y, Z }
825
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
826
+#endif
827
+
828
+//
805 829
 // Clean Nozzle Feature -- EXPERIMENTAL
806 830
 //
807 831
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/SCARA/Configuration.h Bestand weergeven

@@ -812,6 +812,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
812 812
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
813 813
 
814 814
 //
815
+// Nozzle Park -- EXPERIMENTAL
816
+//
817
+// When enabled allows the user to define a special XYZ position, inside the
818
+// machine's topology, to park the nozzle when idle or when receiving the G27
819
+// command.
820
+//
821
+// The "P" paramenter controls what is the action applied to the Z axis:
822
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
823
+//        be raised to reach Z-park height.
824
+//
825
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
826
+//        reach Z-park height.
827
+//
828
+//    P2: The nozzle height will be raised by Z-park amount but never going over
829
+//        the machine's limit of Z_MAX_POS.
830
+//
831
+//#define NOZZLE_PARK_FEATURE
832
+
833
+#if ENABLED(NOZZLE_PARK_FEATURE)
834
+  // Specify a park position as { X, Y, Z }
835
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
836
+#endif
837
+
838
+//
815 839
 // Clean Nozzle Feature -- EXPERIMENTAL
816 840
 //
817 841
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/TAZ4/Configuration.h Bestand weergeven

@@ -825,6 +825,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
825 825
 #define PREHEAT_2_FAN_SPEED     0 // Value from 0 to 255
826 826
 
827 827
 //
828
+// Nozzle Park -- EXPERIMENTAL
829
+//
830
+// When enabled allows the user to define a special XYZ position, inside the
831
+// machine's topology, to park the nozzle when idle or when receiving the G27
832
+// command.
833
+//
834
+// The "P" paramenter controls what is the action applied to the Z axis:
835
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
836
+//        be raised to reach Z-park height.
837
+//
838
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
839
+//        reach Z-park height.
840
+//
841
+//    P2: The nozzle height will be raised by Z-park amount but never going over
842
+//        the machine's limit of Z_MAX_POS.
843
+//
844
+//#define NOZZLE_PARK_FEATURE
845
+
846
+#if ENABLED(NOZZLE_PARK_FEATURE)
847
+  // Specify a park position as { X, Y, Z }
848
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
849
+#endif
850
+
851
+//
828 852
 // Clean Nozzle Feature -- EXPERIMENTAL
829 853
 //
830 854
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/WITBOX/Configuration.h Bestand weergeven

@@ -796,6 +796,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
796 796
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
797 797
 
798 798
 //
799
+// Nozzle Park -- EXPERIMENTAL
800
+//
801
+// When enabled allows the user to define a special XYZ position, inside the
802
+// machine's topology, to park the nozzle when idle or when receiving the G27
803
+// command.
804
+//
805
+// The "P" paramenter controls what is the action applied to the Z axis:
806
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
807
+//        be raised to reach Z-park height.
808
+//
809
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
810
+//        reach Z-park height.
811
+//
812
+//    P2: The nozzle height will be raised by Z-park amount but never going over
813
+//        the machine's limit of Z_MAX_POS.
814
+//
815
+//#define NOZZLE_PARK_FEATURE
816
+
817
+#if ENABLED(NOZZLE_PARK_FEATURE)
818
+  // Specify a park position as { X, Y, Z }
819
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
820
+#endif
821
+
822
+//
799 823
 // Clean Nozzle Feature -- EXPERIMENTAL
800 824
 //
801 825
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/adafruit/ST7565/Configuration.h Bestand weergeven

@@ -804,6 +804,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
804 804
 #define PREHEAT_2_FAN_SPEED     0 // Value from 0 to 255
805 805
 
806 806
 //
807
+// Nozzle Park -- EXPERIMENTAL
808
+//
809
+// When enabled allows the user to define a special XYZ position, inside the
810
+// machine's topology, to park the nozzle when idle or when receiving the G27
811
+// command.
812
+//
813
+// The "P" paramenter controls what is the action applied to the Z axis:
814
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
815
+//        be raised to reach Z-park height.
816
+//
817
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
818
+//        reach Z-park height.
819
+//
820
+//    P2: The nozzle height will be raised by Z-park amount but never going over
821
+//        the machine's limit of Z_MAX_POS.
822
+//
823
+//#define NOZZLE_PARK_FEATURE
824
+
825
+#if ENABLED(NOZZLE_PARK_FEATURE)
826
+  // Specify a park position as { X, Y, Z }
827
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
828
+#endif
829
+
830
+//
807 831
 // Clean Nozzle Feature -- EXPERIMENTAL
808 832
 //
809 833
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/delta/biv2.5/Configuration.h Bestand weergeven

@@ -899,6 +899,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
899 899
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
900 900
 
901 901
 //
902
+// Nozzle Park -- EXPERIMENTAL
903
+//
904
+// When enabled allows the user to define a special XYZ position, inside the
905
+// machine's topology, to park the nozzle when idle or when receiving the G27
906
+// command.
907
+//
908
+// The "P" paramenter controls what is the action applied to the Z axis:
909
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
910
+//        be raised to reach Z-park height.
911
+//
912
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
913
+//        reach Z-park height.
914
+//
915
+//    P2: The nozzle height will be raised by Z-park amount but never going over
916
+//        the machine's limit of Z_MAX_POS.
917
+//
918
+//#define NOZZLE_PARK_FEATURE
919
+
920
+#if ENABLED(NOZZLE_PARK_FEATURE)
921
+  // Specify a park position as { X, Y, Z }
922
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
923
+#endif
924
+
925
+//
902 926
 // Clean Nozzle Feature -- EXPERIMENTAL
903 927
 //
904 928
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/delta/generic/Configuration.h Bestand weergeven

@@ -893,6 +893,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
893 893
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
894 894
 
895 895
 //
896
+// Nozzle Park -- EXPERIMENTAL
897
+//
898
+// When enabled allows the user to define a special XYZ position, inside the
899
+// machine's topology, to park the nozzle when idle or when receiving the G27
900
+// command.
901
+//
902
+// The "P" paramenter controls what is the action applied to the Z axis:
903
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
904
+//        be raised to reach Z-park height.
905
+//
906
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
907
+//        reach Z-park height.
908
+//
909
+//    P2: The nozzle height will be raised by Z-park amount but never going over
910
+//        the machine's limit of Z_MAX_POS.
911
+//
912
+//#define NOZZLE_PARK_FEATURE
913
+
914
+#if ENABLED(NOZZLE_PARK_FEATURE)
915
+  // Specify a park position as { X, Y, Z }
916
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
917
+#endif
918
+
919
+//
896 920
 // Clean Nozzle Feature -- EXPERIMENTAL
897 921
 //
898 922
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h Bestand weergeven

@@ -896,6 +896,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
896 896
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
897 897
 
898 898
 //
899
+// Nozzle Park -- EXPERIMENTAL
900
+//
901
+// When enabled allows the user to define a special XYZ position, inside the
902
+// machine's topology, to park the nozzle when idle or when receiving the G27
903
+// command.
904
+//
905
+// The "P" paramenter controls what is the action applied to the Z axis:
906
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
907
+//        be raised to reach Z-park height.
908
+//
909
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
910
+//        reach Z-park height.
911
+//
912
+//    P2: The nozzle height will be raised by Z-park amount but never going over
913
+//        the machine's limit of Z_MAX_POS.
914
+//
915
+//#define NOZZLE_PARK_FEATURE
916
+
917
+#if ENABLED(NOZZLE_PARK_FEATURE)
918
+  // Specify a park position as { X, Y, Z }
919
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
920
+#endif
921
+
922
+//
899 923
 // Clean Nozzle Feature -- EXPERIMENTAL
900 924
 //
901 925
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h Bestand weergeven

@@ -896,6 +896,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
896 896
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
897 897
 
898 898
 //
899
+// Nozzle Park -- EXPERIMENTAL
900
+//
901
+// When enabled allows the user to define a special XYZ position, inside the
902
+// machine's topology, to park the nozzle when idle or when receiving the G27
903
+// command.
904
+//
905
+// The "P" paramenter controls what is the action applied to the Z axis:
906
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
907
+//        be raised to reach Z-park height.
908
+//
909
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
910
+//        reach Z-park height.
911
+//
912
+//    P2: The nozzle height will be raised by Z-park amount but never going over
913
+//        the machine's limit of Z_MAX_POS.
914
+//
915
+//#define NOZZLE_PARK_FEATURE
916
+
917
+#if ENABLED(NOZZLE_PARK_FEATURE)
918
+  // Specify a park position as { X, Y, Z }
919
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
920
+#endif
921
+
922
+//
899 923
 // Clean Nozzle Feature -- EXPERIMENTAL
900 924
 //
901 925
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h Bestand weergeven

@@ -898,6 +898,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
898 898
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
899 899
 
900 900
 //
901
+// Nozzle Park -- EXPERIMENTAL
902
+//
903
+// When enabled allows the user to define a special XYZ position, inside the
904
+// machine's topology, to park the nozzle when idle or when receiving the G27
905
+// command.
906
+//
907
+// The "P" paramenter controls what is the action applied to the Z axis:
908
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
909
+//        be raised to reach Z-park height.
910
+//
911
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
912
+//        reach Z-park height.
913
+//
914
+//    P2: The nozzle height will be raised by Z-park amount but never going over
915
+//        the machine's limit of Z_MAX_POS.
916
+//
917
+//#define NOZZLE_PARK_FEATURE
918
+
919
+#if ENABLED(NOZZLE_PARK_FEATURE)
920
+  // Specify a park position as { X, Y, Z }
921
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
922
+#endif
923
+
924
+//
901 925
 // Clean Nozzle Feature -- EXPERIMENTAL
902 926
 //
903 927
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/makibox/Configuration.h Bestand weergeven

@@ -807,6 +807,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
807 807
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
808 808
 
809 809
 //
810
+// Nozzle Park -- EXPERIMENTAL
811
+//
812
+// When enabled allows the user to define a special XYZ position, inside the
813
+// machine's topology, to park the nozzle when idle or when receiving the G27
814
+// command.
815
+//
816
+// The "P" paramenter controls what is the action applied to the Z axis:
817
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
818
+//        be raised to reach Z-park height.
819
+//
820
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
821
+//        reach Z-park height.
822
+//
823
+//    P2: The nozzle height will be raised by Z-park amount but never going over
824
+//        the machine's limit of Z_MAX_POS.
825
+//
826
+//#define NOZZLE_PARK_FEATURE
827
+
828
+#if ENABLED(NOZZLE_PARK_FEATURE)
829
+  // Specify a park position as { X, Y, Z }
830
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
831
+#endif
832
+
833
+//
810 834
 // Clean Nozzle Feature -- EXPERIMENTAL
811 835
 //
812 836
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 24
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration.h Bestand weergeven

@@ -798,6 +798,30 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
798 798
 #define PREHEAT_2_FAN_SPEED   255 // Value from 0 to 255
799 799
 
800 800
 //
801
+// Nozzle Park -- EXPERIMENTAL
802
+//
803
+// When enabled allows the user to define a special XYZ position, inside the
804
+// machine's topology, to park the nozzle when idle or when receiving the G27
805
+// command.
806
+//
807
+// The "P" paramenter controls what is the action applied to the Z axis:
808
+//    P0: (Default) If current Z-pos is lower than Z-park then the nozzle will
809
+//        be raised to reach Z-park height.
810
+//
811
+//    P1: No matter the current Z-pos, the nozzle will be raised/lowered to
812
+//        reach Z-park height.
813
+//
814
+//    P2: The nozzle height will be raised by Z-park amount but never going over
815
+//        the machine's limit of Z_MAX_POS.
816
+//
817
+//#define NOZZLE_PARK_FEATURE
818
+
819
+#if ENABLED(NOZZLE_PARK_FEATURE)
820
+  // Specify a park position as { X, Y, Z }
821
+  #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
822
+#endif
823
+
824
+//
801 825
 // Clean Nozzle Feature -- EXPERIMENTAL
802 826
 //
803 827
 // When enabled allows the user to send G12 to start the nozzle cleaning

+ 122
- 81
Marlin/nozzle.h Bestand weergeven

@@ -30,8 +30,6 @@
30 30
  * @brief Nozzle class
31 31
  *
32 32
  * @todo: Do not ignore the end.z value and allow XYZ movements
33
- * @todo: Currently this feature needs HAS_BED_PROBE to be active
34
- *  due to the do_blocking_move_to*() functions.
35 33
  */
36 34
 class Nozzle {
37 35
   private:
@@ -43,34 +41,40 @@ class Nozzle {
43 41
      * @param end point_t defining the ending point
44 42
      * @param strokes number of strokes to execute
45 43
      */
46
-    static void stroke(point_t const &start, point_t const &end, uint8_t const &strokes)
47
-    __attribute__ ((optimize ("Os"))) {
48
-
49
-      #if ENABLED(NOZZLE_CLEAN_PARK)
50
-        // Store the current coords
51
-        point_t const initial = {
52
-          current_position[X_AXIS],
53
-          current_position[Y_AXIS],
54
-          current_position[Z_AXIS],
55
-          current_position[E_AXIS]
56
-        };
57
-      #endif
58
-
59
-      // Move to the starting point
60
-      do_blocking_move_to_xy(start.x, start.y);
61
-      do_blocking_move_to_z(start.z);
62
-
63
-      // Start the stroke pattern
64
-      for (uint8_t i = 0; i < (strokes >>1); i++) {
65
-        do_blocking_move_to_xy(end.x, end.y);
44
+    static void stroke(
45
+      __attribute__((unused)) point_t const &start,
46
+      __attribute__((unused)) point_t const &end,
47
+      __attribute__((unused)) uint8_t const &strokes
48
+    ) __attribute__((optimize ("Os"))) {
49
+      #if ENABLED(NOZZLE_CLEAN_FEATURE)
50
+
51
+        #if ENABLED(NOZZLE_CLEAN_PARK)
52
+          // Store the current coords
53
+          point_t const initial = {
54
+            current_position[X_AXIS],
55
+            current_position[Y_AXIS],
56
+            current_position[Z_AXIS],
57
+            current_position[E_AXIS]
58
+          };
59
+        #endif // NOZZLE_CLEAN_PARK
60
+
61
+        // Move to the starting point
66 62
         do_blocking_move_to_xy(start.x, start.y);
67
-      }
63
+        do_blocking_move_to_z(start.z);
68 64
 
69
-      #if ENABLED(NOZZLE_CLEAN_PARK)
70
-        // Move the nozzle to the initial point
71
-        do_blocking_move_to_z(initial.z);
72
-        do_blocking_move_to_xy(initial.x, initial.y);
73
-      #endif
65
+        // Start the stroke pattern
66
+        for (uint8_t i = 0; i < (strokes >>1); i++) {
67
+          do_blocking_move_to_xy(end.x, end.y);
68
+          do_blocking_move_to_xy(start.x, start.y);
69
+        }
70
+
71
+        #if ENABLED(NOZZLE_CLEAN_PARK)
72
+          // Move the nozzle to the initial point
73
+          do_blocking_move_to_z(initial.z);
74
+          do_blocking_move_to_xy(initial.x, initial.y);
75
+        #endif // NOZZLE_CLEAN_PARK
76
+
77
+      #endif // NOZZLE_CLEAN_FEATURE
74 78
     }
75 79
 
76 80
     /**
@@ -82,47 +86,53 @@ class Nozzle {
82 86
      * @param strokes number of strokes to execute
83 87
      * @param objects number of objects to create
84 88
      */
85
-    static void zigzag(point_t const &start,
86
-      point_t const &end, uint8_t const &strokes, uint8_t const &objects)
87
-    __attribute__ ((optimize ("Os"))) {
88
-      float A = fabs(end.y - start.y); // [twice the] Amplitude
89
-      float P = fabs(end.x - start.x) / (objects << 1); // Period
90
-
91
-      // Don't allow impossible triangles
92
-      if (A <= 0.0f || P <= 0.0f ) return;
93
-
94
-      #if ENABLED(NOZZLE_CLEAN_PARK)
95
-        // Store the current coords
96
-        point_t const initial = {
97
-          current_position[X_AXIS],
98
-          current_position[Y_AXIS],
99
-          current_position[Z_AXIS],
100
-          current_position[E_AXIS]
101
-        };
102
-      #endif
103
-
104
-      for (uint8_t j = 0; j < strokes; j++) {
105
-        for (uint8_t i = 0; i < (objects << 1); i++) {
106
-          float const x = start.x + i * P;
107
-          float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
108
-
109
-          do_blocking_move_to_xy(x, y);
110
-          if (i == 0) do_blocking_move_to_z(start.z);
89
+    static void zigzag(
90
+      __attribute__((unused)) point_t const &start,
91
+      __attribute__((unused)) point_t const &end,
92
+      __attribute__((unused)) uint8_t const &strokes,
93
+      __attribute__((unused)) uint8_t const &objects
94
+    ) __attribute__((optimize ("Os"))) {
95
+      #if ENABLED(NOZZLE_CLEAN_FEATURE)
96
+        float A = fabs(end.y - start.y); // [twice the] Amplitude
97
+        float P = fabs(end.x - start.x) / (objects << 1); // Period
98
+
99
+        // Don't allow impossible triangles
100
+        if (A <= 0.0f || P <= 0.0f ) return;
101
+
102
+        #if ENABLED(NOZZLE_CLEAN_PARK)
103
+          // Store the current coords
104
+          point_t const initial = {
105
+            current_position[X_AXIS],
106
+            current_position[Y_AXIS],
107
+            current_position[Z_AXIS],
108
+            current_position[E_AXIS]
109
+          };
110
+        #endif // NOZZLE_CLEAN_PARK
111
+
112
+        for (uint8_t j = 0; j < strokes; j++) {
113
+          for (uint8_t i = 0; i < (objects << 1); i++) {
114
+            float const x = start.x + i * P;
115
+            float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
116
+
117
+            do_blocking_move_to_xy(x, y);
118
+            if (i == 0) do_blocking_move_to_z(start.z);
119
+          }
120
+
121
+          for (int i = (objects << 1); i > -1; i--) {
122
+            float const x = start.x + i * P;
123
+            float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
124
+
125
+            do_blocking_move_to_xy(x, y);
126
+          }
111 127
         }
112 128
 
113
-        for (int i = (objects << 1); i > -1; i--) {
114
-          float const x = start.x + i * P;
115
-          float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
129
+        #if ENABLED(NOZZLE_CLEAN_PARK)
130
+          // Move the nozzle to the initial point
131
+          do_blocking_move_to_z(initial.z);
132
+          do_blocking_move_to_xy(initial.x, initial.y);
133
+        #endif // NOZZLE_CLEAN_PARK
116 134
 
117
-          do_blocking_move_to_xy(x, y);
118
-        }
119
-      }
120
-
121
-      #if ENABLED(NOZZLE_CLEAN_PARK)
122
-        // Move the nozzle to the initial point
123
-        do_blocking_move_to_z(initial.z);
124
-        do_blocking_move_to_xy(initial.x, initial.y);
125
-      #endif
135
+      #endif // NOZZLE_CLEAN_FEATURE
126 136
     }
127 137
 
128 138
   public:
@@ -133,21 +143,52 @@ class Nozzle {
133 143
      * @param pattern one of the available patterns
134 144
      * @param argument depends on the cleaning pattern
135 145
      */
136
-    static void clean(uint8_t const &pattern,
137
-      uint8_t const &strokes, uint8_t const &objects = 0)
138
-    __attribute__ ((optimize ("Os"))) {
139
-      switch (pattern) {
140
-        case 1:
141
-          Nozzle::zigzag(
142
-            NOZZLE_CLEAN_START_PT,
143
-            NOZZLE_CLEAN_END_PT, strokes, objects);
144
-          break;
145
-
146
-        default:
147
-          Nozzle::stroke(
148
-            NOZZLE_CLEAN_START_PT,
149
-            NOZZLE_CLEAN_END_PT, strokes);
150
-      }
146
+    static void clean(
147
+      __attribute__((unused)) uint8_t const &pattern,
148
+      __attribute__((unused)) uint8_t const &strokes,
149
+      __attribute__((unused)) uint8_t const &objects = 0
150
+    ) __attribute__((optimize ("Os"))) {
151
+      #if ENABLED(NOZZLE_CLEAN_FEATURE)
152
+        switch (pattern) {
153
+          case 1:
154
+            Nozzle::zigzag(
155
+              NOZZLE_CLEAN_START_PT,
156
+              NOZZLE_CLEAN_END_PT, strokes, objects);
157
+            break;
158
+
159
+          default:
160
+            Nozzle::stroke(
161
+              NOZZLE_CLEAN_START_PT,
162
+              NOZZLE_CLEAN_END_PT, strokes);
163
+        }
164
+      #endif // NOZZLE_CLEAN_FEATURE
165
+    }
166
+
167
+    static void park(
168
+      __attribute__((unused)) uint8_t const &z_action
169
+    ) __attribute__((optimize ("Os"))) {
170
+      #if ENABLED(NOZZLE_PARK_FEATURE)
171
+        float const z = current_position[Z_AXIS];
172
+        point_t const park = NOZZLE_PARK_POINT;
173
+
174
+        switch(z_action) {
175
+          case 1: // force Z-park height
176
+            do_blocking_move_to_z(park.z);
177
+            break;
178
+
179
+          case 2: // Raise by Z-park height
180
+            do_blocking_move_to_z(
181
+              (z + park.z > Z_MAX_POS) ? Z_MAX_POS : z + park.z);
182
+            break;
183
+
184
+          default: // Raise to Z-park height if lower
185
+            if (current_position[Z_AXIS] < park.z)
186
+              do_blocking_move_to_z(park.z);
187
+        }
188
+
189
+        do_blocking_move_to_xy(park.x, park.y);
190
+
191
+      #endif // NOZZLE_PARK_FEATURE
151 192
     }
152 193
 };
153 194
 

Laden…
Annuleren
Opslaan