|
@@ -20,8 +20,8 @@
|
20
|
20
|
*
|
21
|
21
|
*/
|
22
|
22
|
|
23
|
|
-#ifndef __CLEAN_NOZZLE_H__
|
24
|
|
-#define __CLEAN_NOZZLE_H__
|
|
23
|
+#ifndef __NOZZLE_H__
|
|
24
|
+#define __NOZZLE_H__
|
25
|
25
|
|
26
|
26
|
#include "Marlin.h"
|
27
|
27
|
#include "point_t.h"
|
|
@@ -30,7 +30,7 @@
|
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 AUTO_BED_LEVELING_FEATURE to be active
|
|
33
|
+ * @todo: Currently this feature needs HAS_BED_PROBE to be active
|
34
|
34
|
* due to the do_blocking_move_to*() functions.
|
35
|
35
|
*/
|
36
|
36
|
class Nozzle {
|
|
@@ -45,6 +45,17 @@ class Nozzle {
|
45
|
45
|
*/
|
46
|
46
|
static void stroke(point_t const &start, point_t const &end, uint8_t const &strokes)
|
47
|
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
|
+
|
48
|
59
|
// Move to the starting point
|
49
|
60
|
do_blocking_move_to_xy(start.x, start.y);
|
50
|
61
|
do_blocking_move_to_z(start.z);
|
|
@@ -54,6 +65,12 @@ class Nozzle {
|
54
|
65
|
do_blocking_move_to_xy(end.x, end.y);
|
55
|
66
|
do_blocking_move_to_xy(start.x, start.y);
|
56
|
67
|
}
|
|
68
|
+
|
|
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
|
57
|
74
|
}
|
58
|
75
|
|
59
|
76
|
/**
|
|
@@ -74,13 +91,15 @@ class Nozzle {
|
74
|
91
|
// Don't allow impossible triangles
|
75
|
92
|
if (A <= 0.0f || P <= 0.0f ) return;
|
76
|
93
|
|
77
|
|
- // Store the current coords
|
78
|
|
- point_t const home = {
|
79
|
|
- current_position[X_AXIS],
|
80
|
|
- current_position[Y_AXIS],
|
81
|
|
- current_position[Z_AXIS],
|
82
|
|
- current_position[E_AXIS]
|
83
|
|
- };
|
|
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
|
84
|
103
|
|
85
|
104
|
for (uint8_t j = 0; j < strokes; j++) {
|
86
|
105
|
for (uint8_t i = 0; i < (objects << 1); i++) {
|
|
@@ -99,9 +118,11 @@ class Nozzle {
|
99
|
118
|
}
|
100
|
119
|
}
|
101
|
120
|
|
102
|
|
- // Move to home/start position
|
103
|
|
- do_blocking_move_to_z(home.z);
|
104
|
|
- do_blocking_move_to_xy(home.x, home.y);
|
|
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
|
105
|
126
|
}
|
106
|
127
|
|
107
|
128
|
public:
|
|
@@ -118,14 +139,14 @@ class Nozzle {
|
118
|
139
|
switch (pattern) {
|
119
|
140
|
case 1:
|
120
|
141
|
Nozzle::zigzag(
|
121
|
|
- CLEAN_NOZZLE_START_PT,
|
122
|
|
- CLEAN_NOZZLE_END_PT, strokes, objects);
|
|
142
|
+ NOZZLE_CLEAN_START_PT,
|
|
143
|
+ NOZZLE_CLEAN_END_PT, strokes, objects);
|
123
|
144
|
break;
|
124
|
145
|
|
125
|
146
|
default:
|
126
|
147
|
Nozzle::stroke(
|
127
|
|
- CLEAN_NOZZLE_START_PT,
|
128
|
|
- CLEAN_NOZZLE_END_PT, strokes);
|
|
148
|
+ NOZZLE_CLEAN_START_PT,
|
|
149
|
+ NOZZLE_CLEAN_END_PT, strokes);
|
129
|
150
|
}
|
130
|
151
|
}
|
131
|
152
|
};
|