Allow nozzle clean with limited Axis (#14619)

This commit is contained in:
InsanityAutomation
2019-07-14 07:58:53 -04:00
committed by Scott Lahteine
parent 6dcb85927a
commit d2f20803ba
114 changed files with 483 additions and 122 deletions

View File

@ -46,7 +46,11 @@
#endif
// Move to the starting point
do_blocking_move_to(start.x, start.y, start.z);
#if ENABLED(NOZZLE_CLEAN_NO_Z)
do_blocking_move_to_xy(start.x, start.y);
#else
do_blocking_move_to(start.x, start.y, start.z);
#endif
// Start the stroke pattern
for (uint8_t i = 0; i < (strokes >> 1); i++) {
@ -76,7 +80,11 @@
const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS];
#endif
do_blocking_move_to(start.x, start.y, start.z);
#if ENABLED(NOZZLE_CLEAN_NO_Z)
do_blocking_move_to_xy(start.x, start.y);
#else
do_blocking_move_to(start.x, start.y, start.z);
#endif
const uint8_t zigs = objects << 1;
const bool horiz = ABS(diffx) >= ABS(diffy); // Do a horizontal wipe?
@ -119,7 +127,11 @@
const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS];
#endif
do_blocking_move_to(start.x, start.y, start.z);
#if ENABLED(NOZZLE_CLEAN_NO_Z)
do_blocking_move_to_xy(start.x, start.y);
#else
do_blocking_move_to(start.x, start.y, start.z);
#endif
for (uint8_t s = 0; s < strokes; s++)
for (uint8_t i = 0; i < NOZZLE_CLEAN_CIRCLE_FN; i++)
@ -143,7 +155,13 @@
* @param pattern one of the available patterns
* @param argument depends on the cleaning pattern
*/
void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects/*=0*/) {
void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const bool clean_x, const bool clean_y, const bool clean_z) {
point_t start = NOZZLE_CLEAN_START_POINT;
point_t end = NOZZLE_CLEAN_END_POINT;
if (!clean_x) start.x = end.x = current_position[X_AXIS];
if (!clean_y) start.y = end.y = current_position[Y_AXIS];
if (!clean_z) start.z = end.z = current_position[Z_AXIS];
switch (pattern) {
case 1:
zigzag(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT, strokes, objects);
@ -162,9 +180,9 @@
#if ENABLED(NOZZLE_PARK_FEATURE)
void Nozzle::park(const uint8_t z_action, const point_t &park /*= NOZZLE_PARK_POINT*/) {
const float fr_xy = NOZZLE_PARK_XY_FEEDRATE;
const float fr_z = NOZZLE_PARK_Z_FEEDRATE;
void Nozzle::park(const uint8_t z_action, const point_t &park/*=NOZZLE_PARK_POINT*/) {
const float fr_xy = NOZZLE_PARK_XY_FEEDRATE,
fr_z = NOZZLE_PARK_Z_FEEDRATE;
switch (z_action) {
case 1: // Go to Z-park height

View File

@ -78,7 +78,7 @@ class Nozzle {
* @param pattern one of the available patterns
* @param argument depends on the cleaning pattern
*/
static void clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects=0) _Os;
static void clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const bool clean_x, const bool clean_y, const bool clean_z) _Os;
#endif // NOZZLE_CLEAN_FEATURE