Browse Source

Merge pull request #5910 from thinkyhead/rc_more_nozzle_wipe

Bidirectional Zig-Zag Nozzle Wipe
Scott Lahteine 7 years ago
parent
commit
493e738575

+ 9
- 5
Marlin/Configuration.h View File

@@ -981,13 +981,13 @@
981 981
 //
982 982
 // Available list of patterns:
983 983
 //   P0: This is the default pattern, this process requires a sponge type
984
-//       material at a fixed bed location, the cleaning process is based on
985
-//       "strokes" i.e. back-and-forth movements between the starting and end
986
-//       points.
984
+//       material at a fixed bed location. S defines "strokes" i.e.
985
+//       back-and-forth movements between the starting and end points.
987 986
 //
988 987
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
989 988
 //       defines the number of zig-zag triangles to be done. "S" defines the
990
-//       number of strokes aka one back-and-forth movement. As an example
989
+//       number of strokes aka one back-and-forth movement. Zig-zags will
990
+//       be performed in whichever dimension is smallest. As an example,
991 991
 //       sending "G12 P1 S1 T3" will execute:
992 992
 //
993 993
 //          --
@@ -1000,6 +1000,7 @@
1000 1000
 //                       |________|_________|_________|
1001 1001
 //                           T1        T2        T3
1002 1002
 //
1003
+//
1003 1004
 // Caveats: End point Z should use the same value as Start point Z.
1004 1005
 //
1005 1006
 // Attention: This is an EXPERIMENTAL feature, in the future the G-code arguments
@@ -1008,8 +1009,11 @@
1008 1009
 //#define NOZZLE_CLEAN_FEATURE
1009 1010
 
1010 1011
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1011
-  // Number of pattern repetitions
1012
+  // Default number of pattern repetitions
1012 1013
   #define NOZZLE_CLEAN_STROKES  12
1014
+  
1015
+  // Default number of triangles
1016
+  #define NOZZLE_CLEAN_TRIANGLES  3
1013 1017
 
1014 1018
   // Specify positions as { X, Y, Z }
1015 1019
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -3157,7 +3157,7 @@ inline void gcode_G4() {
3157 3157
 
3158 3158
     uint8_t const pattern = code_seen('P') ? code_value_ushort() : 0;
3159 3159
     uint8_t const strokes = code_seen('S') ? code_value_ushort() : NOZZLE_CLEAN_STROKES;
3160
-    uint8_t const objects = code_seen('T') ? code_value_ushort() : 3;
3160
+    uint8_t const objects = code_seen('T') ? code_value_ushort() : NOZZLE_CLEAN_TRIANGLES;
3161 3161
 
3162 3162
     Nozzle::clean(pattern, strokes, objects);
3163 3163
   }

+ 8
- 5
Marlin/example_configurations/Cartesio/Configuration.h View File

@@ -981,13 +981,13 @@
981 981
 //
982 982
 // Available list of patterns:
983 983
 //   P0: This is the default pattern, this process requires a sponge type
984
-//       material at a fixed bed location, the cleaning process is based on
985
-//       "strokes" i.e. back-and-forth movements between the starting and end
986
-//       points.
984
+//       material at a fixed bed location. S defines "strokes" i.e.
985
+//       back-and-forth movements between the starting and end points.
987 986
 //
988 987
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
989 988
 //       defines the number of zig-zag triangles to be done. "S" defines the
990
-//       number of strokes aka one back-and-forth movement. As an example
989
+//       number of strokes aka one back-and-forth movement. Zig-zags will
990
+//       be performed in whichever dimension is smallest. As an example,
991 991
 //       sending "G12 P1 S1 T3" will execute:
992 992
 //
993 993
 //          --
@@ -1008,8 +1008,11 @@
1008 1008
 //#define NOZZLE_CLEAN_FEATURE
1009 1009
 
1010 1010
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1011
-  // Number of pattern repetitions
1011
+  // Default number of pattern repetitions
1012 1012
   #define NOZZLE_CLEAN_STROKES  12
1013
+  
1014
+  // Default number of triangles
1015
+  #define NOZZLE_CLEAN_TRIANGLES  3
1013 1016
 
1014 1017
   // Specify positions as { X, Y, Z }
1015 1018
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/Felix/Configuration.h View File

@@ -964,13 +964,13 @@
964 964
 //
965 965
 // Available list of patterns:
966 966
 //   P0: This is the default pattern, this process requires a sponge type
967
-//       material at a fixed bed location, the cleaning process is based on
968
-//       "strokes" i.e. back-and-forth movements between the starting and end
969
-//       points.
967
+//       material at a fixed bed location. S defines "strokes" i.e.
968
+//       back-and-forth movements between the starting and end points.
970 969
 //
971 970
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
972 971
 //       defines the number of zig-zag triangles to be done. "S" defines the
973
-//       number of strokes aka one back-and-forth movement. As an example
972
+//       number of strokes aka one back-and-forth movement. Zig-zags will
973
+//       be performed in whichever dimension is smallest. As an example,
974 974
 //       sending "G12 P1 S1 T3" will execute:
975 975
 //
976 976
 //          --
@@ -991,8 +991,11 @@
991 991
 //#define NOZZLE_CLEAN_FEATURE
992 992
 
993 993
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
994
-  // Number of pattern repetitions
994
+  // Default number of pattern repetitions
995 995
   #define NOZZLE_CLEAN_STROKES  12
996
+  
997
+  // Default number of triangles
998
+  #define NOZZLE_CLEAN_TRIANGLES  3
996 999
 
997 1000
   // Specify positions as { X, Y, Z }
998 1001
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

@@ -964,13 +964,13 @@
964 964
 //
965 965
 // Available list of patterns:
966 966
 //   P0: This is the default pattern, this process requires a sponge type
967
-//       material at a fixed bed location, the cleaning process is based on
968
-//       "strokes" i.e. back-and-forth movements between the starting and end
969
-//       points.
967
+//       material at a fixed bed location. S defines "strokes" i.e.
968
+//       back-and-forth movements between the starting and end points.
970 969
 //
971 970
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
972 971
 //       defines the number of zig-zag triangles to be done. "S" defines the
973
-//       number of strokes aka one back-and-forth movement. As an example
972
+//       number of strokes aka one back-and-forth movement. Zig-zags will
973
+//       be performed in whichever dimension is smallest. As an example,
974 974
 //       sending "G12 P1 S1 T3" will execute:
975 975
 //
976 976
 //          --
@@ -991,8 +991,11 @@
991 991
 //#define NOZZLE_CLEAN_FEATURE
992 992
 
993 993
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
994
-  // Number of pattern repetitions
994
+  // Default number of pattern repetitions
995 995
   #define NOZZLE_CLEAN_STROKES  12
996
+  
997
+  // Default number of triangles
998
+  #define NOZZLE_CLEAN_TRIANGLES  3
996 999
 
997 1000
   // Specify positions as { X, Y, Z }
998 1001
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -973,13 +973,13 @@
973 973
 //
974 974
 // Available list of patterns:
975 975
 //   P0: This is the default pattern, this process requires a sponge type
976
-//       material at a fixed bed location, the cleaning process is based on
977
-//       "strokes" i.e. back-and-forth movements between the starting and end
978
-//       points.
976
+//       material at a fixed bed location. S defines "strokes" i.e.
977
+//       back-and-forth movements between the starting and end points.
979 978
 //
980 979
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
981 980
 //       defines the number of zig-zag triangles to be done. "S" defines the
982
-//       number of strokes aka one back-and-forth movement. As an example
981
+//       number of strokes aka one back-and-forth movement. Zig-zags will
982
+//       be performed in whichever dimension is smallest. As an example,
983 983
 //       sending "G12 P1 S1 T3" will execute:
984 984
 //
985 985
 //          --
@@ -1000,8 +1000,11 @@
1000 1000
 //#define NOZZLE_CLEAN_FEATURE
1001 1001
 
1002 1002
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1003
-  // Number of pattern repetitions
1003
+  // Default number of pattern repetitions
1004 1004
   #define NOZZLE_CLEAN_STROKES  12
1005
+  
1006
+  // Default number of triangles
1007
+  #define NOZZLE_CLEAN_TRIANGLES  3
1005 1008
 
1006 1009
   // Specify positions as { X, Y, Z }
1007 1010
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/Hephestos_2/Configuration.h View File

@@ -975,13 +975,13 @@
975 975
 //
976 976
 // Available list of patterns:
977 977
 //   P0: This is the default pattern, this process requires a sponge type
978
-//       material at a fixed bed location, the cleaning process is based on
979
-//       "strokes" i.e. back-and-forth movements between the starting and end
980
-//       points.
978
+//       material at a fixed bed location. S defines "strokes" i.e.
979
+//       back-and-forth movements between the starting and end points.
981 980
 //
982 981
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
983 982
 //       defines the number of zig-zag triangles to be done. "S" defines the
984
-//       number of strokes aka one back-and-forth movement. As an example
983
+//       number of strokes aka one back-and-forth movement. Zig-zags will
984
+//       be performed in whichever dimension is smallest. As an example,
985 985
 //       sending "G12 P1 S1 T3" will execute:
986 986
 //
987 987
 //          --
@@ -1002,8 +1002,11 @@
1002 1002
 #define NOZZLE_CLEAN_FEATURE
1003 1003
 
1004 1004
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1005
-  // Number of pattern repetitions
1005
+  // Default number of pattern repetitions
1006 1006
   #define NOZZLE_CLEAN_STROKES  12
1007
+  
1008
+  // Default number of triangles
1009
+  #define NOZZLE_CLEAN_TRIANGLES  3
1007 1010
 
1008 1011
   // Specify positions as { X, Y, Z }
1009 1012
   #define NOZZLE_CLEAN_START_POINT { X_MIN_POS + 10, Y_MAX_POS - 9, (Z_MIN_POS + 0.5)}

+ 8
- 5
Marlin/example_configurations/K8200/Configuration.h View File

@@ -1010,13 +1010,13 @@
1010 1010
 //
1011 1011
 // Available list of patterns:
1012 1012
 //   P0: This is the default pattern, this process requires a sponge type
1013
-//       material at a fixed bed location, the cleaning process is based on
1014
-//       "strokes" i.e. back-and-forth movements between the starting and end
1015
-//       points.
1013
+//       material at a fixed bed location. S defines "strokes" i.e.
1014
+//       back-and-forth movements between the starting and end points.
1016 1015
 //
1017 1016
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
1018 1017
 //       defines the number of zig-zag triangles to be done. "S" defines the
1019
-//       number of strokes aka one back-and-forth movement. As an example
1018
+//       number of strokes aka one back-and-forth movement. Zig-zags will
1019
+//       be performed in whichever dimension is smallest. As an example,
1020 1020
 //       sending "G12 P1 S1 T3" will execute:
1021 1021
 //
1022 1022
 //          --
@@ -1037,8 +1037,11 @@
1037 1037
 //#define NOZZLE_CLEAN_FEATURE
1038 1038
 
1039 1039
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1040
-  // Number of pattern repetitions
1040
+  // Default number of pattern repetitions
1041 1041
   #define NOZZLE_CLEAN_STROKES  12
1042
+  
1043
+  // Default number of triangles
1044
+  #define NOZZLE_CLEAN_TRIANGLES  3
1042 1045
 
1043 1046
   // Specify positions as { X, Y, Z }
1044 1047
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/K8400/Configuration.h View File

@@ -981,13 +981,13 @@
981 981
 //
982 982
 // Available list of patterns:
983 983
 //   P0: This is the default pattern, this process requires a sponge type
984
-//       material at a fixed bed location, the cleaning process is based on
985
-//       "strokes" i.e. back-and-forth movements between the starting and end
986
-//       points.
984
+//       material at a fixed bed location. S defines "strokes" i.e.
985
+//       back-and-forth movements between the starting and end points.
987 986
 //
988 987
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
989 988
 //       defines the number of zig-zag triangles to be done. "S" defines the
990
-//       number of strokes aka one back-and-forth movement. As an example
989
+//       number of strokes aka one back-and-forth movement. Zig-zags will
990
+//       be performed in whichever dimension is smallest. As an example,
991 991
 //       sending "G12 P1 S1 T3" will execute:
992 992
 //
993 993
 //          --
@@ -1008,8 +1008,11 @@
1008 1008
 //#define NOZZLE_CLEAN_FEATURE
1009 1009
 
1010 1010
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1011
-  // Number of pattern repetitions
1011
+  // Default number of pattern repetitions
1012 1012
   #define NOZZLE_CLEAN_STROKES  12
1013
+  
1014
+  // Default number of triangles
1015
+  #define NOZZLE_CLEAN_TRIANGLES  3
1013 1016
 
1014 1017
   // Specify positions as { X, Y, Z }
1015 1018
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

@@ -981,13 +981,13 @@
981 981
 //
982 982
 // Available list of patterns:
983 983
 //   P0: This is the default pattern, this process requires a sponge type
984
-//       material at a fixed bed location, the cleaning process is based on
985
-//       "strokes" i.e. back-and-forth movements between the starting and end
986
-//       points.
984
+//       material at a fixed bed location. S defines "strokes" i.e.
985
+//       back-and-forth movements between the starting and end points.
987 986
 //
988 987
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
989 988
 //       defines the number of zig-zag triangles to be done. "S" defines the
990
-//       number of strokes aka one back-and-forth movement. As an example
989
+//       number of strokes aka one back-and-forth movement. Zig-zags will
990
+//       be performed in whichever dimension is smallest. As an example,
991 991
 //       sending "G12 P1 S1 T3" will execute:
992 992
 //
993 993
 //          --
@@ -1008,8 +1008,11 @@
1008 1008
 //#define NOZZLE_CLEAN_FEATURE
1009 1009
 
1010 1010
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1011
-  // Number of pattern repetitions
1011
+  // Default number of pattern repetitions
1012 1012
   #define NOZZLE_CLEAN_STROKES  12
1013
+  
1014
+  // Default number of triangles
1015
+  #define NOZZLE_CLEAN_TRIANGLES  3
1013 1016
 
1014 1017
   // Specify positions as { X, Y, Z }
1015 1018
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

@@ -981,13 +981,13 @@
981 981
 //
982 982
 // Available list of patterns:
983 983
 //   P0: This is the default pattern, this process requires a sponge type
984
-//       material at a fixed bed location, the cleaning process is based on
985
-//       "strokes" i.e. back-and-forth movements between the starting and end
986
-//       points.
984
+//       material at a fixed bed location. S defines "strokes" i.e.
985
+//       back-and-forth movements between the starting and end points.
987 986
 //
988 987
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
989 988
 //       defines the number of zig-zag triangles to be done. "S" defines the
990
-//       number of strokes aka one back-and-forth movement. As an example
989
+//       number of strokes aka one back-and-forth movement. Zig-zags will
990
+//       be performed in whichever dimension is smallest. As an example,
991 991
 //       sending "G12 P1 S1 T3" will execute:
992 992
 //
993 993
 //          --
@@ -1008,8 +1008,11 @@
1008 1008
 //#define NOZZLE_CLEAN_FEATURE
1009 1009
 
1010 1010
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1011
-  // Number of pattern repetitions
1011
+  // Default number of pattern repetitions
1012 1012
   #define NOZZLE_CLEAN_STROKES  12
1013
+  
1014
+  // Default number of triangles
1015
+  #define NOZZLE_CLEAN_TRIANGLES  3
1013 1016
 
1014 1017
   // Specify positions as { X, Y, Z }
1015 1018
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -980,13 +980,13 @@
980 980
 //
981 981
 // Available list of patterns:
982 982
 //   P0: This is the default pattern, this process requires a sponge type
983
-//       material at a fixed bed location, the cleaning process is based on
984
-//       "strokes" i.e. back-and-forth movements between the starting and end
985
-//       points.
983
+//       material at a fixed bed location. S defines "strokes" i.e.
984
+//       back-and-forth movements between the starting and end points.
986 985
 //
987 986
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
988 987
 //       defines the number of zig-zag triangles to be done. "S" defines the
989
-//       number of strokes aka one back-and-forth movement. As an example
988
+//       number of strokes aka one back-and-forth movement. Zig-zags will
989
+//       be performed in whichever dimension is smallest. As an example,
990 990
 //       sending "G12 P1 S1 T3" will execute:
991 991
 //
992 992
 //          --
@@ -1007,8 +1007,11 @@
1007 1007
 //#define NOZZLE_CLEAN_FEATURE
1008 1008
 
1009 1009
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1010
-  // Number of pattern repetitions
1010
+  // Default number of pattern repetitions
1011 1011
   #define NOZZLE_CLEAN_STROKES  12
1012
+  
1013
+  // Default number of triangles
1014
+  #define NOZZLE_CLEAN_TRIANGLES  3
1012 1015
 
1013 1016
   // Specify positions as { X, Y, Z }
1014 1017
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -996,13 +996,13 @@
996 996
 //
997 997
 // Available list of patterns:
998 998
 //   P0: This is the default pattern, this process requires a sponge type
999
-//       material at a fixed bed location, the cleaning process is based on
1000
-//       "strokes" i.e. back-and-forth movements between the starting and end
1001
-//       points.
999
+//       material at a fixed bed location. S defines "strokes" i.e.
1000
+//       back-and-forth movements between the starting and end points.
1002 1001
 //
1003 1002
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
1004 1003
 //       defines the number of zig-zag triangles to be done. "S" defines the
1005
-//       number of strokes aka one back-and-forth movement. As an example
1004
+//       number of strokes aka one back-and-forth movement. Zig-zags will
1005
+//       be performed in whichever dimension is smallest. As an example,
1006 1006
 //       sending "G12 P1 S1 T3" will execute:
1007 1007
 //
1008 1008
 //          --
@@ -1023,8 +1023,11 @@
1023 1023
 //#define NOZZLE_CLEAN_FEATURE
1024 1024
 
1025 1025
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1026
-  // Number of pattern repetitions
1026
+  // Default number of pattern repetitions
1027 1027
   #define NOZZLE_CLEAN_STROKES  12
1028
+  
1029
+  // Default number of triangles
1030
+  #define NOZZLE_CLEAN_TRIANGLES  3
1028 1031
 
1029 1032
   // Specify positions as { X, Y, Z }
1030 1033
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/TAZ4/Configuration.h View File

@@ -1002,13 +1002,13 @@
1002 1002
 //
1003 1003
 // Available list of patterns:
1004 1004
 //   P0: This is the default pattern, this process requires a sponge type
1005
-//       material at a fixed bed location, the cleaning process is based on
1006
-//       "strokes" i.e. back-and-forth movements between the starting and end
1007
-//       points.
1005
+//       material at a fixed bed location. S defines "strokes" i.e.
1006
+//       back-and-forth movements between the starting and end points.
1008 1007
 //
1009 1008
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
1010 1009
 //       defines the number of zig-zag triangles to be done. "S" defines the
1011
-//       number of strokes aka one back-and-forth movement. As an example
1010
+//       number of strokes aka one back-and-forth movement. Zig-zags will
1011
+//       be performed in whichever dimension is smallest. As an example,
1012 1012
 //       sending "G12 P1 S1 T3" will execute:
1013 1013
 //
1014 1014
 //          --
@@ -1029,8 +1029,11 @@
1029 1029
 //#define NOZZLE_CLEAN_FEATURE
1030 1030
 
1031 1031
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1032
-  // Number of pattern repetitions
1032
+  // Default number of pattern repetitions
1033 1033
   #define NOZZLE_CLEAN_STROKES  12
1034
+  
1035
+  // Default number of triangles
1036
+  #define NOZZLE_CLEAN_TRIANGLES  3
1034 1037
 
1035 1038
   // Specify positions as { X, Y, Z }
1036 1039
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -973,13 +973,13 @@
973 973
 //
974 974
 // Available list of patterns:
975 975
 //   P0: This is the default pattern, this process requires a sponge type
976
-//       material at a fixed bed location, the cleaning process is based on
977
-//       "strokes" i.e. back-and-forth movements between the starting and end
978
-//       points.
976
+//       material at a fixed bed location. S defines "strokes" i.e.
977
+//       back-and-forth movements between the starting and end points.
979 978
 //
980 979
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
981 980
 //       defines the number of zig-zag triangles to be done. "S" defines the
982
-//       number of strokes aka one back-and-forth movement. As an example
981
+//       number of strokes aka one back-and-forth movement. Zig-zags will
982
+//       be performed in whichever dimension is smallest. As an example,
983 983
 //       sending "G12 P1 S1 T3" will execute:
984 984
 //
985 985
 //          --
@@ -1000,8 +1000,11 @@
1000 1000
 //#define NOZZLE_CLEAN_FEATURE
1001 1001
 
1002 1002
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1003
-  // Number of pattern repetitions
1003
+  // Default number of pattern repetitions
1004 1004
   #define NOZZLE_CLEAN_STROKES  12
1005
+  
1006
+  // Default number of triangles
1007
+  #define NOZZLE_CLEAN_TRIANGLES  3
1005 1008
 
1006 1009
   // Specify positions as { X, Y, Z }
1007 1010
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

@@ -981,13 +981,13 @@
981 981
 //
982 982
 // Available list of patterns:
983 983
 //   P0: This is the default pattern, this process requires a sponge type
984
-//       material at a fixed bed location, the cleaning process is based on
985
-//       "strokes" i.e. back-and-forth movements between the starting and end
986
-//       points.
984
+//       material at a fixed bed location. S defines "strokes" i.e.
985
+//       back-and-forth movements between the starting and end points.
987 986
 //
988 987
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
989 988
 //       defines the number of zig-zag triangles to be done. "S" defines the
990
-//       number of strokes aka one back-and-forth movement. As an example
989
+//       number of strokes aka one back-and-forth movement. Zig-zags will
990
+//       be performed in whichever dimension is smallest. As an example,
991 991
 //       sending "G12 P1 S1 T3" will execute:
992 992
 //
993 993
 //          --
@@ -1008,8 +1008,11 @@
1008 1008
 //#define NOZZLE_CLEAN_FEATURE
1009 1009
 
1010 1010
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1011
-  // Number of pattern repetitions
1011
+  // Default number of pattern repetitions
1012 1012
   #define NOZZLE_CLEAN_STROKES  12
1013
+  
1014
+  // Default number of triangles
1015
+  #define NOZZLE_CLEAN_TRIANGLES  3
1013 1016
 
1014 1017
   // Specify positions as { X, Y, Z }
1015 1018
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -1068,13 +1068,13 @@
1068 1068
 //
1069 1069
 // Available list of patterns:
1070 1070
 //   P0: This is the default pattern, this process requires a sponge type
1071
-//       material at a fixed bed location, the cleaning process is based on
1072
-//       "strokes" i.e. back-and-forth movements between the starting and end
1073
-//       points.
1071
+//       material at a fixed bed location. S defines "strokes" i.e.
1072
+//       back-and-forth movements between the starting and end points.
1074 1073
 //
1075 1074
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
1076 1075
 //       defines the number of zig-zag triangles to be done. "S" defines the
1077
-//       number of strokes aka one back-and-forth movement. As an example
1076
+//       number of strokes aka one back-and-forth movement. Zig-zags will
1077
+//       be performed in whichever dimension is smallest. As an example,
1078 1078
 //       sending "G12 P1 S1 T3" will execute:
1079 1079
 //
1080 1080
 //          --
@@ -1095,8 +1095,11 @@
1095 1095
 //#define NOZZLE_CLEAN_FEATURE
1096 1096
 
1097 1097
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1098
-  // Number of pattern repetitions
1098
+  // Default number of pattern repetitions
1099 1099
   #define NOZZLE_CLEAN_STROKES  12
1100
+  
1101
+  // Default number of triangles
1102
+  #define NOZZLE_CLEAN_TRIANGLES  3
1100 1103
 
1101 1104
   // Specify positions as { X, Y, Z }
1102 1105
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -1071,13 +1071,13 @@
1071 1071
 //
1072 1072
 // Available list of patterns:
1073 1073
 //   P0: This is the default pattern, this process requires a sponge type
1074
-//       material at a fixed bed location, the cleaning process is based on
1075
-//       "strokes" i.e. back-and-forth movements between the starting and end
1076
-//       points.
1074
+//       material at a fixed bed location. S defines "strokes" i.e.
1075
+//       back-and-forth movements between the starting and end points.
1077 1076
 //
1078 1077
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
1079 1078
 //       defines the number of zig-zag triangles to be done. "S" defines the
1080
-//       number of strokes aka one back-and-forth movement. As an example
1079
+//       number of strokes aka one back-and-forth movement. Zig-zags will
1080
+//       be performed in whichever dimension is smallest. As an example,
1081 1081
 //       sending "G12 P1 S1 T3" will execute:
1082 1082
 //
1083 1083
 //          --
@@ -1098,8 +1098,11 @@
1098 1098
 //#define NOZZLE_CLEAN_FEATURE
1099 1099
 
1100 1100
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1101
-  // Number of pattern repetitions
1101
+  // Default number of pattern repetitions
1102 1102
   #define NOZZLE_CLEAN_STROKES  12
1103
+  
1104
+  // Default number of triangles
1105
+  #define NOZZLE_CLEAN_TRIANGLES  3
1103 1106
 
1104 1107
   // Specify positions as { X, Y, Z }
1105 1108
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -1070,13 +1070,13 @@
1070 1070
 //
1071 1071
 // Available list of patterns:
1072 1072
 //   P0: This is the default pattern, this process requires a sponge type
1073
-//       material at a fixed bed location, the cleaning process is based on
1074
-//       "strokes" i.e. back-and-forth movements between the starting and end
1075
-//       points.
1073
+//       material at a fixed bed location. S defines "strokes" i.e.
1074
+//       back-and-forth movements between the starting and end points.
1076 1075
 //
1077 1076
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
1078 1077
 //       defines the number of zig-zag triangles to be done. "S" defines the
1079
-//       number of strokes aka one back-and-forth movement. As an example
1078
+//       number of strokes aka one back-and-forth movement. Zig-zags will
1079
+//       be performed in whichever dimension is smallest. As an example,
1080 1080
 //       sending "G12 P1 S1 T3" will execute:
1081 1081
 //
1082 1082
 //          --
@@ -1097,8 +1097,11 @@
1097 1097
 //#define NOZZLE_CLEAN_FEATURE
1098 1098
 
1099 1099
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1100
-  // Number of pattern repetitions
1100
+  // Default number of pattern repetitions
1101 1101
   #define NOZZLE_CLEAN_STROKES  12
1102
+  
1103
+  // Default number of triangles
1104
+  #define NOZZLE_CLEAN_TRIANGLES  3
1102 1105
 
1103 1106
   // Specify positions as { X, Y, Z }
1104 1107
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -1074,13 +1074,13 @@
1074 1074
 //
1075 1075
 // Available list of patterns:
1076 1076
 //   P0: This is the default pattern, this process requires a sponge type
1077
-//       material at a fixed bed location, the cleaning process is based on
1078
-//       "strokes" i.e. back-and-forth movements between the starting and end
1079
-//       points.
1077
+//       material at a fixed bed location. S defines "strokes" i.e.
1078
+//       back-and-forth movements between the starting and end points.
1080 1079
 //
1081 1080
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
1082 1081
 //       defines the number of zig-zag triangles to be done. "S" defines the
1083
-//       number of strokes aka one back-and-forth movement. As an example
1082
+//       number of strokes aka one back-and-forth movement. Zig-zags will
1083
+//       be performed in whichever dimension is smallest. As an example,
1084 1084
 //       sending "G12 P1 S1 T3" will execute:
1085 1085
 //
1086 1086
 //          --
@@ -1101,8 +1101,11 @@
1101 1101
 //#define NOZZLE_CLEAN_FEATURE
1102 1102
 
1103 1103
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1104
-  // Number of pattern repetitions
1104
+  // Default number of pattern repetitions
1105 1105
   #define NOZZLE_CLEAN_STROKES  12
1106
+  
1107
+  // Default number of triangles
1108
+  #define NOZZLE_CLEAN_TRIANGLES  3
1106 1109
 
1107 1110
   // Specify positions as { X, Y, Z }
1108 1111
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/makibox/Configuration.h View File

@@ -984,13 +984,13 @@
984 984
 //
985 985
 // Available list of patterns:
986 986
 //   P0: This is the default pattern, this process requires a sponge type
987
-//       material at a fixed bed location, the cleaning process is based on
988
-//       "strokes" i.e. back-and-forth movements between the starting and end
989
-//       points.
987
+//       material at a fixed bed location. S defines "strokes" i.e.
988
+//       back-and-forth movements between the starting and end points.
990 989
 //
991 990
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
992 991
 //       defines the number of zig-zag triangles to be done. "S" defines the
993
-//       number of strokes aka one back-and-forth movement. As an example
992
+//       number of strokes aka one back-and-forth movement. Zig-zags will
993
+//       be performed in whichever dimension is smallest. As an example,
994 994
 //       sending "G12 P1 S1 T3" will execute:
995 995
 //
996 996
 //          --
@@ -1011,8 +1011,11 @@
1011 1011
 //#define NOZZLE_CLEAN_FEATURE
1012 1012
 
1013 1013
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1014
-  // Number of pattern repetitions
1014
+  // Default number of pattern repetitions
1015 1015
   #define NOZZLE_CLEAN_STROKES  12
1016
+  
1017
+  // Default number of triangles
1018
+  #define NOZZLE_CLEAN_TRIANGLES  3
1016 1019
 
1017 1020
   // Specify positions as { X, Y, Z }
1018 1021
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 8
- 5
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -977,13 +977,13 @@
977 977
 //
978 978
 // Available list of patterns:
979 979
 //   P0: This is the default pattern, this process requires a sponge type
980
-//       material at a fixed bed location, the cleaning process is based on
981
-//       "strokes" i.e. back-and-forth movements between the starting and end
982
-//       points.
980
+//       material at a fixed bed location. S defines "strokes" i.e.
981
+//       back-and-forth movements between the starting and end points.
983 982
 //
984 983
 //   P1: This starts a zig-zag pattern between (X0, Y0) and (X1, Y1), "T"
985 984
 //       defines the number of zig-zag triangles to be done. "S" defines the
986
-//       number of strokes aka one back-and-forth movement. As an example
985
+//       number of strokes aka one back-and-forth movement. Zig-zags will
986
+//       be performed in whichever dimension is smallest. As an example,
987 987
 //       sending "G12 P1 S1 T3" will execute:
988 988
 //
989 989
 //          --
@@ -1004,8 +1004,11 @@
1004 1004
 //#define NOZZLE_CLEAN_FEATURE
1005 1005
 
1006 1006
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
1007
-  // Number of pattern repetitions
1007
+  // Default number of pattern repetitions
1008 1008
   #define NOZZLE_CLEAN_STROKES  12
1009
+  
1010
+  // Default number of triangles
1011
+  #define NOZZLE_CLEAN_TRIANGLES  3
1009 1012
 
1010 1013
   // Specify positions as { X, Y, Z }
1011 1014
   #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}

+ 14
- 6
Marlin/nozzle.h View File

@@ -26,6 +26,14 @@
26 26
 #include "Marlin.h"
27 27
 #include "point_t.h"
28 28
 
29
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
30
+  constexpr float nozzle_clean_start_point[4] = NOZZLE_CLEAN_START_POINT,
31
+                  nozzle_clean_end_point[4] = NOZZLE_CLEAN_END_POINT,
32
+                  nozzle_clean_length = fabs(nozzle_clean_start_point[X_AXIS] - nozzle_clean_end_point[X_AXIS]), //abs x size of wipe pad
33
+                  nozzle_clean_height = fabs(nozzle_clean_start_point[Y_AXIS] - nozzle_clean_end_point[Y_AXIS]); //abs y size of wipe pad
34
+  constexpr bool nozzle_clean_horizontal = nozzle_clean_length >= nozzle_clean_height; //whether to zig-zag horizontally or vertically
35
+#endif //NOZZLE_CLEAN_FEATURE
36
+
29 37
 /**
30 38
  * @brief Nozzle class
31 39
  *
@@ -92,8 +100,8 @@ class Nozzle {
92 100
       __attribute__((unused)) uint8_t const &objects
93 101
     ) __attribute__((optimize ("Os"))) {
94 102
       #if ENABLED(NOZZLE_CLEAN_FEATURE)
95
-        float A = fabs(end.y - start.y); // [twice the] Amplitude
96
-        float P = fabs(end.x - start.x) / (objects << 1); // Period
103
+        float A = nozzle_clean_horizontal ? nozzle_clean_height : nozzle_clean_length; // [twice the] Amplitude
104
+        float P = ( nozzle_clean_horizontal ? nozzle_clean_length : nozzle_clean_height ) / (objects << 1); // Period
97 105
 
98 106
         // Don't allow impossible triangles
99 107
         if (A <= 0.0f || P <= 0.0f ) return;
@@ -110,16 +118,16 @@ class Nozzle {
110 118
 
111 119
         for (uint8_t j = 0; j < strokes; j++) {
112 120
           for (uint8_t i = 0; i < (objects << 1); i++) {
113
-            float const x = start.x + i * P;
114
-            float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
121
+            float const x = start.x + ( nozzle_clean_horizontal ? i * P : (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)) );
122
+            float const y = start.y + (!nozzle_clean_horizontal ? i * P : (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)) );
115 123
 
116 124
             do_blocking_move_to_xy(x, y);
117 125
             if (i == 0) do_blocking_move_to_z(start.z);
118 126
           }
119 127
 
120 128
           for (int i = (objects << 1); i > -1; i--) {
121
-            float const x = start.x + i * P;
122
-            float const y = start.y + (A/P) * (P - fabs(fmod((i*P), (2*P)) - P));
129
+            float const x = start.x + ( nozzle_clean_horizontal ? i * P : (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)) );
130
+            float const y = start.y + (!nozzle_clean_horizontal ? i * P : (A/P) * (P - fabs(fmod((i*P), (2*P)) - P)) );
123 131
 
124 132
             do_blocking_move_to_xy(x, y);
125 133
           }

Loading…
Cancel
Save