From 465c6d92307ec613d0b2a7355ce67a60ba23fc0c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 14 Sep 2019 03:05:10 -0500 Subject: [PATCH] Simpler Allen Key config. Fixes, cleanups from refactor (#15256) --- .../HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c | 2 +- Marlin/src/core/macros.h | 1 + Marlin/src/core/serial.cpp | 2 +- Marlin/src/core/serial.h | 2 +- Marlin/src/feature/I2CPositionEncoder.cpp | 4 +- Marlin/src/feature/backlash.h | 12 +- Marlin/src/feature/bedlevel/abl/abl.cpp | 6 +- Marlin/src/feature/bedlevel/bedlevel.h | 2 +- .../feature/bedlevel/mbl/mesh_bed_leveling.h | 8 +- Marlin/src/feature/bedlevel/ubl/ubl.h | 12 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 4 +- .../src/feature/bedlevel/ubl/ubl_motion.cpp | 20 +-- Marlin/src/feature/dac/stepper_dac.cpp | 4 +- Marlin/src/feature/filwidth.h | 2 +- Marlin/src/feature/runout.h | 3 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 6 +- Marlin/src/gcode/calibrate/G33.cpp | 3 +- Marlin/src/gcode/calibrate/G425.cpp | 47 +++---- Marlin/src/gcode/calibrate/M425.cpp | 10 +- Marlin/src/gcode/control/M605.cpp | 4 +- Marlin/src/gcode/feature/mixing/M166.cpp | 7 +- Marlin/src/gcode/host/M114.cpp | 6 +- Marlin/src/gcode/motion/G2_G3.cpp | 30 ++-- Marlin/src/gcode/probe/G30.cpp | 7 +- Marlin/src/inc/MarlinConfigPre.h | 2 + Marlin/src/inc/SanityCheck.h | 2 + .../lcd/dogm/status_screen_lite_ST7920.cpp | 20 ++- .../src/lcd/dogm/status_screen_lite_ST7920.h | 2 +- .../lib/lulzbot/screens/move_axis_screen.cpp | 3 +- Marlin/src/lcd/ultralcd.cpp | 2 +- Marlin/src/libs/L6470/L6470_Marlin.cpp | 4 +- Marlin/src/libs/least_squares_fit.h | 23 +-- Marlin/src/libs/nozzle.cpp | 16 +-- Marlin/src/libs/numtostr.cpp | 4 +- Marlin/src/libs/numtostr.h | 6 +- Marlin/src/libs/stopwatch.h | 4 +- Marlin/src/libs/vector_3.cpp | 7 +- Marlin/src/libs/vector_3.h | 4 + Marlin/src/module/configuration_store.cpp | 19 +-- Marlin/src/module/delta.cpp | 8 +- Marlin/src/module/motion.cpp | 4 +- Marlin/src/module/planner.cpp | 62 ++++---- Marlin/src/module/planner.h | 6 +- Marlin/src/module/probe.cpp | 132 +++--------------- Marlin/src/module/stepper.cpp | 39 +++--- Marlin/src/module/stepper.h | 3 + Marlin/src/module/temperature.cpp | 25 ++-- Marlin/src/module/tool_change.cpp | 57 ++++---- .../delta/Anycubic/Kossel/Configuration.h | 28 +--- .../delta/Dreammaker/Overlord/Configuration.h | 28 +--- .../Dreammaker/Overlord_Pro/Configuration.h | 28 +--- .../FLSUN/auto_calibrate/Configuration.h | 34 ++--- .../delta/FLSUN/kossel/Configuration.h | 34 ++--- .../delta/FLSUN/kossel_mini/Configuration.h | 36 ++--- .../Geeetech/Rostock 301/Configuration.h | 28 +--- .../delta/Hatchbox_Alpha/Configuration.h | 28 +--- .../examples/delta/MKS/SBASE/Configuration.h | 28 +--- .../delta/Tevo Little Monster/Configuration.h | 28 +--- config/examples/delta/generic/Configuration.h | 28 +--- .../delta/kossel_mini/Configuration.h | 36 ++--- .../examples/delta/kossel_pro/Configuration.h | 32 ++--- .../examples/delta/kossel_xl/Configuration.h | 28 +--- 62 files changed, 393 insertions(+), 689 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c index 41a19d430..8ffaa7a96 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c @@ -33,7 +33,7 @@ #include #include -#include "../../../core/millis_t.h" +typedef uint32_t millis_t; ////////////////////////////////////////////////////////////////////////////////////// diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index ce72247c5..d65b8221f 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -79,6 +79,7 @@ #define SBI32(n,b) (n |= _BV32(b)) #define CBI32(n,b) (n &= ~_BV32(b)) +#define cu(x) ((x)*(x)*(x)) #define RADIANS(d) ((d)*float(M_PI)/180.0f) #define DEGREES(r) ((r)*180.0f/float(M_PI)) #define HYPOT2(x,y) (sq(x)+sq(y)) diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 84b64b8b6..4a602d60d 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -68,7 +68,7 @@ void print_bin(const uint16_t val) { } } -void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z) { +void print_xyz(PGM_P const prefix, PGM_P const suffix, const float &x, const float &y, const float &z) { serialprintPGM(prefix); SERIAL_CHAR('('); SERIAL_ECHO(x); diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index add69ca5b..23f6240e1 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -186,7 +186,7 @@ void serial_spaces(uint8_t count); void print_bin(const uint16_t val); -void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z); void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]); +void print_xyz(PGM_P const prefix, PGM_P const suffix, const float &x, const float &y, const float &z); #define SERIAL_POS(SUFFIX,VAR) do { print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0) #define SERIAL_XYZ(PREFIX,V...) do { print_xyz(PSTR(PREFIX), nullptr, V); }while(0) diff --git a/Marlin/src/feature/I2CPositionEncoder.cpp b/Marlin/src/feature/I2CPositionEncoder.cpp index 6f3952fd9..8e879d8bb 100644 --- a/Marlin/src/feature/I2CPositionEncoder.cpp +++ b/Marlin/src/feature/I2CPositionEncoder.cpp @@ -168,7 +168,7 @@ void I2CPositionEncoder::update() { if (errPrstIdx >= I2CPE_ERR_PRST_ARRAY_SIZE) { float sumP = 0; LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i]; - const int32_t errorP = int32_t(sumP * (1.0f / (I2CPE_ERR_PRST_ARRAY_SIZE))); + const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE)); SERIAL_ECHO(axis_codes[encoderAxis]); SERIAL_ECHOLNPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis], "mm; correcting!"); babystep.add_steps(encoderAxis, -LROUND(errorP)); @@ -440,7 +440,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { total += new_steps_mm; // swap start and end points so next loop runs from current position - float tempCoord = startCoord[encoderAxis]; + const float tempCoord = startCoord[encoderAxis]; startCoord[encoderAxis] = endCoord[encoderAxis]; endCoord[encoderAxis] = tempCoord; } diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index e86955b95..1eb06fe77 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -60,27 +60,27 @@ public: static void measure_with_probe(); #endif - static inline float get_measurement(const uint8_t e) { + static inline float get_measurement(const AxisEnum a) { // Return the measurement averaged over all readings return ( #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - measured_count[e] > 0 ? measured_mm[e] / measured_count[e] : + measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : #endif 0 ); #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(e); + UNUSED(a); #endif } - static inline bool has_measurement(const uint8_t e) { + static inline bool has_measurement(const AxisEnum a) { return (false #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - || (measured_count[e] > 0) + || (measured_count[a] > 0) #endif ); #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(e); + UNUSED(a); #endif } diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/abl.cpp index c70cf6220..57c8ddb60 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/abl.cpp @@ -282,11 +282,9 @@ float bilinear_z_offset(const float raw[XYZ]) { ry = raw[Y_AXIS] - bilinear_start[Y_AXIS]; #if ENABLED(EXTRAPOLATE_BEYOND_GRID) - // Keep using the last grid box - #define FAR_EDGE_OR_BOX 2 + #define FAR_EDGE_OR_BOX 2 // Keep using the last grid box #else - // Just use the grid far edge - #define FAR_EDGE_OR_BOX 1 + #define FAR_EDGE_OR_BOX 1 // Just use the grid far edge #endif if (last_x != rx) { diff --git a/Marlin/src/feature/bedlevel/bedlevel.h b/Marlin/src/feature/bedlevel/bedlevel.h index e5f0db47f..fc5813373 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.h +++ b/Marlin/src/feature/bedlevel/bedlevel.h @@ -56,7 +56,7 @@ class TemporaryBedLevelingState { TemporaryBedLevelingState(const bool enable); ~TemporaryBedLevelingState() { set_bed_leveling_enabled(saved); } }; -#define TEMPORARY_BED_LEVELING_STATE(enable) TemporaryBedLevelingState tbls(enable) +#define TEMPORARY_BED_LEVELING_STATE(enable) const TemporaryBedLevelingState tbls(enable) #if HAS_MESH diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h index e39bd0e78..ef77896fe 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h @@ -73,22 +73,22 @@ public: } static int8_t cell_index_x(const float &x) { - int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); + int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST); return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2); } static int8_t cell_index_y(const float &y) { - int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); + int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2); } static int8_t probe_index_x(const float &x) { - int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * (1.0f / (MESH_X_DIST)); + int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * RECIPROCAL(MESH_X_DIST); return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } static int8_t probe_index_y(const float &y) { - int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * (1.0f / (MESH_Y_DIST)); + int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 20ff9b077..a231f9d43 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -145,14 +145,14 @@ class unified_bed_leveling { FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } static int8_t get_cell_index_x(const float &x) { - const int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); + const int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST); return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX } // position. But with this defined this way, it is possible // to extrapolate off of this point even further out. Probably // that is OK because something else should be keeping that from // happening and should not be worried about at this level. static int8_t get_cell_index_y(const float &y) { - const int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); + const int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX } // position. But with this defined this way, it is possible // to extrapolate off of this point even further out. Probably @@ -160,12 +160,12 @@ class unified_bed_leveling { // happening and should not be worried about at this level. static int8_t find_closest_x_index(const float &x) { - const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0f / (MESH_X_DIST)); + const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * RECIPROCAL(MESH_X_DIST); return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } static int8_t find_closest_y_index(const float &y) { - const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0f / (MESH_Y_DIST)); + const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } @@ -210,7 +210,7 @@ class unified_bed_leveling { ); } - const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0f / (MESH_X_DIST)), + const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * RECIPROCAL(MESH_X_DIST), z1 = z_values[x1_i][yi]; return z1 + xratio * (z_values[_MIN(x1_i, GRID_MAX_POINTS_X - 2) + 1][yi] - z1); // Don't allow x1_i+1 to be past the end of the array @@ -239,7 +239,7 @@ class unified_bed_leveling { ); } - const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0f / (MESH_Y_DIST)), + const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * RECIPROCAL(MESH_Y_DIST), z1 = z_values[xi][y1_i]; return z1 + yratio * (z_values[xi][_MIN(y1_i, GRID_MAX_POINTS_Y - 2) + 1] - z1); // Don't allow y1_i+1 to be past the end of the array diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index d49c9346f..650e9f9a6 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -441,7 +441,7 @@ #if HAS_BED_PROBE - case 1: + case 1: { // // Invalidate Entire Mesh and Automatically Probe Mesh in areas that can be reached by the probe // @@ -460,7 +460,7 @@ report_current_position(); probe_deployed = true; - break; + } break; #endif // HAS_BED_PROBE diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index 4bb29d7e0..105aee1c7 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -88,7 +88,7 @@ FINAL_MOVE: // The distance is always MESH_X_DIST so multiply by the constant reciprocal. - const float xratio = (end[X_AXIS] - mesh_index_to_xpos(cell_dest_xi)) * (1.0f / (MESH_X_DIST)); + const float xratio = (end[X_AXIS] - mesh_index_to_xpos(cell_dest_xi)) * RECIPROCAL(MESH_X_DIST); float z1 = z_values[cell_dest_xi ][cell_dest_yi ] + xratio * (z_values[cell_dest_xi + 1][cell_dest_yi ] - z_values[cell_dest_xi][cell_dest_yi ]), @@ -98,7 +98,7 @@ if (cell_dest_xi >= GRID_MAX_POINTS_X - 1) z1 = z2 = 0.0; // X cell-fraction done. Interpolate the two Z offsets with the Y fraction for the final Z offset. - const float yratio = (end[Y_AXIS] - mesh_index_to_ypos(cell_dest_yi)) * (1.0f / (MESH_Y_DIST)), + const float yratio = (end[Y_AXIS] - mesh_index_to_ypos(cell_dest_yi)) * RECIPROCAL(MESH_Y_DIST), z0 = cell_dest_yi < GRID_MAX_POINTS_Y - 1 ? (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end[Z_AXIS]) : 0.0; // Undefined parts of the Mesh in z_values[][] are NAN. @@ -373,10 +373,10 @@ #if IS_KINEMATIC const float seconds = cartesian_xy_mm / feedrate; // seconds to move xy distance at requested rate uint16_t segments = LROUND(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate - seglimit = LROUND(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length + seglimit = LROUND(cartesian_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // number of segments at minimum segment length NOMORE(segments, seglimit); // limit to minimum segment length (fewer segments) #else - uint16_t segments = LROUND(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length + uint16_t segments = LROUND(cartesian_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // cartesian fixed segment length #endif NOLESS(segments, 1U); // must have at least one segment @@ -440,8 +440,8 @@ // in top of loop and again re-find same adjacent cell and use it, just less efficient // for mesh inset area. - int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)), - cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); + int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST), + cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); LIMIT(cell_xi, 0, (GRID_MAX_POINTS_X) - 1); LIMIT(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1); @@ -462,15 +462,15 @@ float cx = raw[X_AXIS] - x0, // cell-relative x and y cy = raw[Y_AXIS] - y0; - const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0f / (MESH_X_DIST)), // z slope per x along y0 (lower left to lower right) - z_xmy1 = (z_x1y1 - z_x0y1) * (1.0f / (MESH_X_DIST)); // z slope per x along y1 (upper left to upper right) + const float z_xmy0 = (z_x1y0 - z_x0y0) * RECIPROCAL(MESH_X_DIST), // z slope per x along y0 (lower left to lower right) + z_xmy1 = (z_x1y1 - z_x0y1) * RECIPROCAL(MESH_X_DIST); // z slope per x along y1 (upper left to upper right) float z_cxy0 = z_x0y0 + z_xmy0 * cx; // z height along y0 at cx (changes for each cx in cell) const float z_cxy1 = z_x0y1 + z_xmy1 * cx, // z height along y1 at cx z_cxyd = z_cxy1 - z_cxy0; // z height difference along cx from y0 to y1 - float z_cxym = z_cxyd * (1.0f / (MESH_Y_DIST)); // z slope per y along cx from y0 to y1 (changes for each cx in cell) + float z_cxym = z_cxyd * RECIPROCAL(MESH_Y_DIST); // z slope per y along cx from y0 to y1 (changes for each cx in cell) // float z_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop) @@ -479,7 +479,7 @@ // each change by a constant for fixed segment lengths. const float z_sxy0 = z_xmy0 * diff[X_AXIS], // per-segment adjustment to z_cxy0 - z_sxym = (z_xmy1 - z_xmy0) * (1.0f / (MESH_Y_DIST)) * diff[X_AXIS]; // per-segment adjustment to z_cxym + z_sxym = (z_xmy1 - z_xmy0) * RECIPROCAL(MESH_Y_DIST) * diff[X_AXIS]; // per-segment adjustment to z_cxym for (;;) { // for all segments within this mesh cell diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index de497fdac..d1e101bd5 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -74,8 +74,8 @@ void dac_current_raw(uint8_t channel, uint16_t val) { mcp4728_simpleCommand(UPDATE); } -static float dac_perc(int8_t n) { return 100.0 * mcp4728_getValue(dac_order[n]) * (1.0f / (DAC_STEPPER_MAX)); } -static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0f / (DAC_STEPPER_SENSE)); } +static float dac_perc(int8_t n) { return 100.0 * mcp4728_getValue(dac_order[n]) * RECIPROCAL(DAC_STEPPER_MAX); } +static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE); } uint8_t dac_current_get_percent(AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } void dac_current_set_percents(const uint8_t pct[XYZE]) { diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index 6802b787f..74671b295 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -66,7 +66,7 @@ public: } // Convert raw measurement to mm - static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * (1.0f / 16383.0f); } + static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(16383.0f); } static inline float raw_to_mm() { return raw_to_mm(raw); } // A scaled reading is ready diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index faf2d8b11..672eea83c 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -27,7 +27,8 @@ #include "../sd/cardreader.h" #include "../module/printcounter.h" -#include "../module/stepper.h" +#include "../module/planner.h" +#include "../module/stepper.h" // for block_t #include "../gcode/queue.h" #include "../inc/MarlinConfig.h" diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index f8f51fb17..85af12c65 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -769,11 +769,7 @@ G29_TYPE GcodeSuite::G29() { if (!dryrun && !isnan(measured_z)) { vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); - if (planeNormal.z < 0) { - planeNormal.x *= -1; - planeNormal.y *= -1; - planeNormal.z *= -1; - } + if (planeNormal.z < 0) planeNormal *= -1; planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); // Can't re-enable (on error) until the new grid is written diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index effffac3d..455b5b267 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -369,10 +369,11 @@ static float auto_tune_a() { delta_r = {0.0}, delta_t[ABC] = {0.0}; + ZERO(delta_t); LOOP_XYZ(axis) { - LOOP_XYZ(axis_2) delta_t[axis_2] = 0.0; delta_t[axis] = diff; calc_kinematics_diff_probe_points(z_pt, delta_e, delta_r, delta_t); + delta_t[axis] = 0; a_fac += z_pt[uint8_t((axis * _4P_STEP) - _7P_STEP + NPP) % NPP + 1] / 6.0; a_fac -= z_pt[uint8_t((axis * _4P_STEP) + 1 + _7P_STEP)] / 6.0; } diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 996b1515b..93dbde669 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -314,18 +314,16 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { // The difference between the known and the measured location // of the calibration object is the positional error - m.pos_error[X_AXIS] = - #if HAS_X_CENTER - m.true_center[X_AXIS] - m.obj_center[X_AXIS]; - #else - 0; - #endif - m.pos_error[Y_AXIS] = - #if HAS_Y_CENTER - m.true_center[Y_AXIS] - m.obj_center[Y_AXIS]; - #else - 0; - #endif + m.pos_error[X_AXIS] = (0 + #if HAS_X_CENTER + + m.true_center[X_AXIS] - m.obj_center[X_AXIS] + #endif + ); + m.pos_error[Y_AXIS] = (0 + #if HAS_Y_CENTER + + m.true_center[Y_AXIS] - m.obj_center[Y_AXIS] + #endif + ); m.pos_error[Z_AXIS] = m.true_center[Z_AXIS] - m.obj_center[Z_AXIS]; } @@ -394,13 +392,13 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { inline void report_measured_nozzle_dimensions(const measurements_t &m) { SERIAL_ECHOLNPGM("Nozzle Tip Outer Dimensions:"); - #if HAS_X_CENTER - SERIAL_ECHOLNPAIR(" X", m.nozzle_outer_dimension[X_AXIS]); - #else - UNUSED(m); - #endif - #if HAS_Y_CENTER - SERIAL_ECHOLNPAIR(" Y", m.nozzle_outer_dimension[Y_AXIS]); + #if HAS_X_CENTER || HAS_Y_CENTER + #if HAS_X_CENTER + SERIAL_ECHOLNPAIR(" X", m.nozzle_outer_dimension[X_AXIS]); + #endif + #if HAS_Y_CENTER + SERIAL_ECHOLNPAIR(" Y", m.nozzle_outer_dimension[Y_AXIS]); + #endif #else UNUSED(m); #endif @@ -412,16 +410,11 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { // This function requires normalize_hotend_offsets() to be called // inline void report_hotend_offsets() { - for (uint8_t e = 1; e < HOTENDS; e++) { - SERIAL_ECHOPAIR("T", int(e)); - SERIAL_ECHOLNPGM(" Hotend Offset:"); - SERIAL_ECHOLNPAIR(" X: ", hotend_offset[X_AXIS][e]); - SERIAL_ECHOLNPAIR(" Y: ", hotend_offset[Y_AXIS][e]); - SERIAL_ECHOLNPAIR(" Z: ", hotend_offset[Z_AXIS][e]); - SERIAL_EOL(); - } + for (uint8_t e = 1; e < HOTENDS; e++) + SERIAL_ECHOLNPAIR("T", int(e), " Hotend Offset X", hotend_offset[X_AXIS][e], " Y", hotend_offset[Y_AXIS][e], " Z", hotend_offset[Z_AXIS][e]); } #endif + #endif // CALIBRATION_REPORTING /** diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index a9191d821..a15287a5e 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -46,10 +46,10 @@ void GcodeSuite::M425() { bool noArgs = true; - LOOP_XYZ(i) { - if (parser.seen(axis_codes[i])) { + LOOP_XYZ(a) { + if (parser.seen(axis_codes[a])) { planner.synchronize(); - backlash.distance_mm[i] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(i); + backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a)); noArgs = false; } } @@ -88,10 +88,10 @@ void GcodeSuite::M425() { #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) SERIAL_ECHOPGM(" Average measured backlash (mm):"); if (backlash.has_any_measurement()) { - LOOP_XYZ(a) if (backlash.has_measurement(a)) { + LOOP_XYZ(a) if (backlash.has_measurement(AxisEnum(a))) { SERIAL_CHAR(' '); SERIAL_CHAR(axis_codes[a]); - SERIAL_ECHO(backlash.get_measurement(a)); + SERIAL_ECHO(backlash.get_measurement(AxisEnum(a))); } } else diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index 4009a2370..84a75686a 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -137,8 +137,8 @@ DEBUG_EOL(); HOTEND_LOOP() { - DEBUG_ECHOPAIR(" nozzle:", int(e)); - LOOP_XYZ(j) DEBUG_ECHOPAIR(" hotend_offset[", axis_codes[j], "_AXIS][", int(e), "]=", hotend_offset[j][e]); + DEBUG_ECHOPAIR(" T", int(e)); + LOOP_XYZ(a) DEBUG_ECHOPAIR(" hotend_offset[", axis_codes[a], "_AXIS][", int(e), "]=", hotend_offset[a][e]); DEBUG_EOL(); } DEBUG_EOL(); diff --git a/Marlin/src/gcode/feature/mixing/M166.cpp b/Marlin/src/gcode/feature/mixing/M166.cpp index 1bb2e4b8f..8b74182cd 100644 --- a/Marlin/src/gcode/feature/mixing/M166.cpp +++ b/Marlin/src/gcode/feature/mixing/M166.cpp @@ -30,15 +30,12 @@ #include "../../../feature/mixing.h" inline void echo_mix() { - SERIAL_ECHOPAIR(" (", int(mixer.mix[0])); - SERIAL_ECHOPAIR("%|", int(mixer.mix[1])); - SERIAL_ECHOPGM("%)"); + SERIAL_ECHOPAIR(" (", int(mixer.mix[0]), "%|", int(mixer.mix[1]), "%)"); } inline void echo_zt(const int t, const float &z) { mixer.update_mix_from_vtool(t); - SERIAL_ECHOPAIR(" Z", z); - SERIAL_ECHOPAIR(" T", t); + SERIAL_ECHOPAIR(" Z", z, " T", t); echo_mix(); } diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 58d7ef3e3..c10b58f70 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -38,11 +38,11 @@ void report_xyze(const float pos[], const uint8_t n = 4, const uint8_t precision = 3) { char str[12]; - for (uint8_t i = 0; i < n; i++) { + for (uint8_t a = 0; a < n; a++) { SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[i]); + SERIAL_CHAR(axis_codes[a]); SERIAL_CHAR(':'); - SERIAL_ECHO(dtostrf(pos[i], 1, precision, str)); + SERIAL_ECHO(dtostrf(pos[a], 1, precision, str)); } SERIAL_EOL(); } diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 9f85d65d5..09762a995 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -280,20 +280,22 @@ void GcodeSuite::G2_G3(const bool clockwise) { float arc_offset[2] = { 0, 0 }; if (parser.seenval('R')) { - const float r = parser.value_linear_units(), - p1 = current_position[X_AXIS], q1 = current_position[Y_AXIS], - p2 = destination[X_AXIS], q2 = destination[Y_AXIS]; - if (r && (p2 != p1 || q2 != q1)) { - const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 - dx = p2 - p1, dy = q2 - q1, // X and Y differences - d = HYPOT(dx, dy), // Linear distance between the points - dinv = 1/d, // Inverse of d - h = SQRT(sq(r) - sq(d * 0.5f)), // Distance to the arc pivot-point - mx = (p1 + p2) * 0.5f, my = (q1 + q2) * 0.5f,// Point between the two points - sx = -dy * dinv, sy = dx * dinv, // Slope of the perpendicular bisector - cx = mx + e * h * sx, cy = my + e * h * sy; // Pivot-point of the arc - arc_offset[0] = cx - p1; - arc_offset[1] = cy - q1; + const float r = parser.value_linear_units(); + if (r) { + const float p1 = current_position[X_AXIS], q1 = current_position[Y_AXIS], + p2 = destination[X_AXIS], q2 = destination[Y_AXIS]; + if (p2 != p1 || q2 != q1) { + const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 + dx = p2 - p1, dy = q2 - q1, // X and Y differences + d = HYPOT(dx, dy), // Linear distance between the points + dinv = 1/d, // Inverse of d + h = SQRT(sq(r) - sq(d * 0.5f)), // Distance to the arc pivot-point + mx = (p1 + p2) * 0.5f, my = (q1 + q2) * 0.5f,// Point between the two points + sx = -dy * dinv, sy = dx * dinv, // Slope of the perpendicular bisector + cx = mx + e * h * sx, cy = my + e * h * sy; // Pivot-point of the arc + arc_offset[0] = cx - p1; + arc_offset[1] = cy - q1; + } } } else { diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 08f978bf9..9150f680f 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -54,11 +54,8 @@ void GcodeSuite::G30() { const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; const float measured_z = probe_pt(xpos, ypos, raise_after, 1); - if (!isnan(measured_z)) { - SERIAL_ECHOPAIR("Bed X: ", FIXFLOAT(xpos)); - SERIAL_ECHOPAIR(" Y: ", FIXFLOAT(ypos)); - SERIAL_ECHOLNPAIR(" Z: ", FIXFLOAT(measured_z)); - } + if (!isnan(measured_z)) + SERIAL_ECHOLNPAIR("Bed X: ", FIXFLOAT(xpos), " Y: ", FIXFLOAT(ypos), " Z: ", FIXFLOAT(measured_z)); clean_up_after_endstop_or_probe_move(); diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index 63c5a6095..a53a45523 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -43,3 +43,5 @@ #include "Conditionals_adv.h" #include HAL_PATH(../HAL, inc/Conditionals_adv.h) + +#include diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f6c8fe2f9..777a7f637 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -388,6 +388,8 @@ #error "SDPOWER is now SDPOWER_PIN. Please update your configuration and/or pins." #elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2) #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them from Configuration.h." +#elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X) + #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting. Please update your configuration." #endif #define BOARD_MKS_13 -1000 diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index f651945be..287e8d258 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -658,7 +658,7 @@ void ST7920_Lite_Status_Screen::draw_status_message() { #endif } -void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, const float z, bool position_known) { +void ST7920_Lite_Status_Screen::draw_position(const float (&pos)[XYZE], const bool position_known) { char str[7]; set_ddram_address(DDRAM_LINE_4); begin_data(); @@ -667,13 +667,13 @@ void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, cons const unsigned char alt_label = position_known ? 0 : (ui.get_blink() ? ' ' : 0); write_byte(alt_label ? alt_label : 'X'); - write_str(dtostrf(x, -4, 0, str), 4); + write_str(dtostrf(pos[X_AXIS], -4, 0, str), 4); write_byte(alt_label ? alt_label : 'Y'); - write_str(dtostrf(y, -4, 0, str), 4); + write_str(dtostrf(pos[Y_AXIS], -4, 0, str), 4); write_byte(alt_label ? alt_label : 'Z'); - write_str(dtostrf(z, -5, 1, str), 5); + write_str(dtostrf(pos[Z_AXIS], -5, 1, str), 5); } bool ST7920_Lite_Status_Screen::indicators_changed() { @@ -826,16 +826,14 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { } } - if (countdown == 0 && (forceUpdate || position_changed() || + if (countdown == 0 && (forceUpdate || position_changed() #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - blink_changed() + || blink_changed() #endif )) { - draw_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - #if ENABLED(DISABLE_REDUCED_ACCURACY_WARNING) - true - #else - all_axes_known() + draw_position(current_position, true + #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) + && all_axes_known() #endif ); } diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h index 1fb707ca1..18a5ed77f 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h @@ -86,7 +86,7 @@ class ST7920_Lite_Status_Screen { static void draw_print_time(const duration_t &elapsed); static void draw_feedrate_percentage(const uint16_t percentage); static void draw_status_message(); - static void draw_position(const float x, const float y, const float z, bool position_known = true); + static void draw_position(const float (&pos)[XYZE], bool position_known = true); static bool indicators_changed(); static bool position_changed(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/move_axis_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/move_axis_screen.cpp index 60229907b..5a5f70576 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/move_axis_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/move_axis_screen.cpp @@ -36,7 +36,7 @@ void MoveAxisScreen::onEntry() { // ourselves. The relative distances are reset to zero whenever this // screen is entered. - for(uint8_t i = 0; i < ExtUI::extruderCount; i++) { + for (uint8_t i = 0; i < ExtUI::extruderCount; i++) { screen_data.MoveAxisScreen.e_rel[i] = 0; } BaseNumericAdjustmentScreen::onEntry(); @@ -111,6 +111,7 @@ float MoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) { // connect segments and even out the motion. constexpr float max_manual_feedrate[XYZE] = MAX_MANUAL_FEEDRATE; return min(max_manual_feedrate[axis]/60, abs(increment_mm * TOUCH_REPEATS_PER_SECOND * 0.80)); + return min(max_manual_feedrate[axis] / 60, abs(increment_mm * TOUCH_REPEATS_PER_SECOND * 0.80)); } void MoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) { diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index d8db1a823..0e397f368 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -685,7 +685,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { // previous invocation is being blocked. Modifications to manual_move_offset shouldn't be made while // processing_manual_move is true or the planner will get out of sync. processing_manual_move = true; - prepare_move_to_destination(); // will call set_current_from_destination() + prepare_move_to_destination(); // will set current_position from destination processing_manual_move = false; feedrate_mm_s = old_feedrate; diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index 7dc2b2d1f..d8b0fb833 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -384,8 +384,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], } break; case 'Z': { - position_min = center[E_AXIS] - displacement; - position_max = center[E_AXIS] + displacement; + position_min = center[Z_AXIS] - displacement; + position_max = center[Z_AXIS] + displacement; echo_min_max('Z', position_min, position_max); if (false #ifdef Z_MIN_POS diff --git a/Marlin/src/libs/least_squares_fit.h b/Marlin/src/libs/least_squares_fit.h index 8eb47585e..164819b21 100644 --- a/Marlin/src/libs/least_squares_fit.h +++ b/Marlin/src/libs/least_squares_fit.h @@ -51,18 +51,19 @@ void inline incremental_LSF_reset(struct linear_fit_data *lsf) { void inline incremental_WLSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z, const float &w) { // weight each accumulator by factor w, including the "number" of samples // (analogous to calling inc_LSF twice with same values to weight it by 2X) - lsf->xbar += w * x; - lsf->ybar += w * y; - lsf->zbar += w * z; - lsf->x2bar += w * x * x; // don't use sq(x) -- let compiler re-use w*x four times - lsf->y2bar += w * y * y; - lsf->z2bar += w * z * z; - lsf->xybar += w * x * y; - lsf->xzbar += w * x * z; - lsf->yzbar += w * y * z; + const float wx = w * x, wy = w * y, wz = w * z; + lsf->xbar += wx; + lsf->ybar += wy; + lsf->zbar += wz; + lsf->x2bar += wx * x; + lsf->y2bar += wy * y; + lsf->z2bar += wz * z; + lsf->xybar += wx * y; + lsf->xzbar += wx * z; + lsf->yzbar += wy * z; lsf->N += w; - lsf->max_absx = _MAX(ABS(w * x), lsf->max_absx); - lsf->max_absy = _MAX(ABS(w * y), lsf->max_absy); + lsf->max_absx = _MAX(ABS(wx), lsf->max_absx); + lsf->max_absy = _MAX(ABS(wy), lsf->max_absy); } void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) { diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 3926bfc93..6a59c6d07 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -175,16 +175,9 @@ Nozzle nozzle; if (!TEST(cleans, Z_AXIS)) start.z = end.z = current_position[Z_AXIS]; switch (pattern) { - case 1: - zigzag(start, end, strokes, objects); - break; - - case 2: - circle(start, end, strokes, radius); - break; - - default: - stroke(start, end, strokes); + case 1: zigzag(start, end, strokes, objects); break; + case 2: circle(start, end, strokes, radius); break; + default: stroke(start, end, strokes); } } @@ -193,8 +186,7 @@ Nozzle nozzle; #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, - fr_z = NOZZLE_PARK_Z_FEEDRATE; + constexpr float fr_xy = NOZZLE_PARK_XY_FEEDRATE, fr_z = NOZZLE_PARK_Z_FEEDRATE; switch (z_action) { case 1: // Go to Z-park height diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index fabc5b498..6be9da7af 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -21,6 +21,8 @@ */ #include "numtostr.h" + +#include "../inc/MarlinConfigPre.h" #include "../core/utility.h" char conv[8] = { 0 }; @@ -183,7 +185,7 @@ char* ftostr52(const float &f) { return &conv[3]; } -#endif // LCD_DECIMAL_SMALL_XY +#endif // Convert float to fixed-length string with +123.4 / -123.4 format char* ftostr41sign(const float &f) { diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index 1c18fd6ed..6af2ac486 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../inc/MarlinConfigPre.h" +#include // Convert a full-range unsigned 8bit int to a percentage char* ui8tostr4pct(const uint8_t i); @@ -83,9 +83,13 @@ char* ftostr52sign(const float &x); // Convert unsigned float to string with 1234.5 format omitting trailing zeros char* ftostr51rj(const float &x); +#include "../core/macros.h" + // Convert float to rj string with 123 or -12 format FORCE_INLINE char* ftostr3(const float &x) { return i16tostr3(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } +#include "../inc/MarlinConfigPre.h" + #if ENABLED(LCD_DECIMAL_SMALL_XY) // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format char* ftostr4sign(const float &fx); diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index 77e9df98b..013c243cf 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -25,7 +25,9 @@ //#define DEBUG_STOPWATCH #include "../core/macros.h" // for FORCE_INLINE -#include "../core/millis_t.h" + +#include +typedef uint32_t millis_t; /** * @brief Stopwatch class diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index 9ffc852fe..e733cce3a 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -57,8 +57,11 @@ vector_3 vector_3::cross(const vector_3 &left, const vector_3 &right) { left.x * right.y - left.y * right.x); } -vector_3 vector_3::operator+(const vector_3 &v) { return vector_3((x + v.x), (y + v.y), (z + v.z)); } -vector_3 vector_3::operator-(const vector_3 &v) { return vector_3((x - v.x), (y - v.y), (z - v.z)); } +vector_3 vector_3::operator+(const vector_3 &v) { return vector_3(x + v.x, y + v.y, z + v.z); } +vector_3 vector_3::operator-(const vector_3 &v) { return vector_3(x - v.x, y - v.y, z - v.z); } + +vector_3 vector_3::operator* (const float &v) { return vector_3(x * v, y * v, z * v); } +vector_3& vector_3::operator*=(const float &v) { x *= v; y *= v; z *= v; return *this; } vector_3 vector_3::get_normal() const { vector_3 normalized = vector_3(x, y, z); diff --git a/Marlin/src/libs/vector_3.h b/Marlin/src/libs/vector_3.h index b56e1d60b..6f9153817 100644 --- a/Marlin/src/libs/vector_3.h +++ b/Marlin/src/libs/vector_3.h @@ -52,6 +52,10 @@ struct vector_3 { vector_3 operator+(const vector_3 &v); vector_3 operator-(const vector_3 &v); + + vector_3 operator* (const float &v); + vector_3& operator*=(const float &v); + void normalize(); float get_length() const; vector_3 get_normal() const; diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 5d0a0300b..905fde840 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -1205,9 +1205,7 @@ void MarlinSettings::postprocess() { const float backlash_smoothing_mm = 3; #endif _FIELD_TEST(backlash_distance_mm); - EEPROM_WRITE(backlash_distance_mm[X_AXIS]); - EEPROM_WRITE(backlash_distance_mm[Y_AXIS]); - EEPROM_WRITE(backlash_distance_mm[Z_AXIS]); + EEPROM_WRITE(backlash_distance_mm); EEPROM_WRITE(backlash_correction); EEPROM_WRITE(backlash_smoothing_mm); } @@ -2010,9 +2008,7 @@ void MarlinSettings::postprocess() { float backlash_smoothing_mm; #endif _FIELD_TEST(backlash_distance_mm); - EEPROM_READ(backlash_distance_mm[X_AXIS]); - EEPROM_READ(backlash_distance_mm[Y_AXIS]); - EEPROM_READ(backlash_distance_mm[Z_AXIS]); + EEPROM_READ(backlash_distance_mm); EEPROM_READ(backlash_correction); EEPROM_READ(backlash_smoothing_mm); } @@ -2805,9 +2801,8 @@ void MarlinSettings::reset() { CONFIG_ECHO_START(); for (uint8_t e = 1; e < HOTENDS; e++) { SERIAL_ECHOPAIR( - " M218 T", (int)e - , " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]) - , " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]) + " M218 T", (int)e, + " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]), " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]) ); SERIAL_ECHOLNPAIR_F(" Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]), 3); } @@ -2922,9 +2917,9 @@ void MarlinSettings::reset() { CONFIG_ECHO_HEADING("Endstop adjustment:"); CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR( - " M666 X", LINEAR_UNIT(delta_endstop_adj[X_AXIS]) - , " Y", LINEAR_UNIT(delta_endstop_adj[Y_AXIS]) - , " Z", LINEAR_UNIT(delta_endstop_adj[Z_AXIS]) + " M666 X", LINEAR_UNIT(delta_endstop_adj[A_AXIS]) + , " Y", LINEAR_UNIT(delta_endstop_adj[B_AXIS]) + , " Z", LINEAR_UNIT(delta_endstop_adj[C_AXIS]) ); CONFIG_ECHO_HEADING("Delta settings: L R H S B XYZ"); diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index e44fd8620..186b5adf3 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -101,12 +101,8 @@ void recalc_delta_settings() { */ #define DELTA_DEBUG(VAR) do { \ - SERIAL_ECHOPAIR("cartesian X:", VAR[X_AXIS]); \ - SERIAL_ECHOPAIR(" Y:", VAR[Y_AXIS]); \ - SERIAL_ECHOLNPAIR(" Z:", VAR[Z_AXIS]); \ - SERIAL_ECHOPAIR("delta A:", delta[A_AXIS]); \ - SERIAL_ECHOPAIR(" B:", delta[B_AXIS]); \ - SERIAL_ECHOLNPAIR(" C:", delta[C_AXIS]); \ + SERIAL_ECHOLNPAIR("Cartesian X", VAR[X_AXIS], " Y", VAR[Y_AXIS], " Z", VAR[Z_AXIS]); \ + SERIAL_ECHOLNPAIR("Delta A", delta[A_AXIS], " B", delta[B_AXIS], " C", delta[C_AXIS]); \ }while(0) void inverse_kinematics(const float (&raw)[XYZ]) { diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 552dabb74..a1f0cbf15 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -105,7 +105,7 @@ float current_position[XYZE] = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS }; * Cartesian Destination * The destination for a move, filled in by G-code movement commands, * and expected by functions like 'prepare_move_to_destination'. - * Set with 'get_destination_from_command' or 'set_destination_from_current'. + * G-codes can set destination using 'get_destination_from_command' */ float destination[XYZE]; // = { 0 } @@ -670,7 +670,7 @@ void clean_up_after_endstop_or_probe_move() { // For SCARA enforce a minimum segment size #if IS_SCARA - NOMORE(segments, cartesian_mm * (1.0f / float(SCARA_MIN_SEGMENT_LENGTH))); + NOMORE(segments, cartesian_mm * RECIPROCAL(SCARA_MIN_SEGMENT_LENGTH)); #endif // At least one segment is required diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 9618846f3..13e411b9b 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1174,7 +1174,10 @@ void Planner::recalculate() { * Maintain fans, paste extruder pressure, */ void Planner::check_axes_activity() { - uint8_t axis_active[NUM_AXIS] = { 0 }; + + #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) + uint8_t axis_active[NUM_AXIS] = { 0 }; + #endif #if FAN_COUNT > 0 uint8_t tail_fan_speed[FAN_COUNT]; @@ -1190,10 +1193,9 @@ void Planner::check_axes_activity() { #endif if (has_blocks_queued()) { - block_t* block; #if FAN_COUNT > 0 || ENABLED(BARICUDA) - block = &block_buffer[block_buffer_tail]; + block_t *block = &block_buffer[block_buffer_tail]; #endif #if FAN_COUNT > 0 @@ -1210,10 +1212,12 @@ void Planner::check_axes_activity() { #endif #endif - for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block = &block_buffer[b]; - LOOP_XYZE(i) if (block->steps[i]) axis_active[i]++; - } + #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) + for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { + block_t *block = &block_buffer[b]; + LOOP_XYZE(i) if (block->steps[i]) axis_active[i] = true; + } + #endif } else { #if FAN_COUNT > 0 @@ -1517,14 +1521,14 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { const bool was_enabled = STEPPER_ISR_ENABLED(); if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1 - // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2 - axis_steps = 0.5f * ( - axis == CORE_AXIS_2 ? CORESIGN(stepper.position(CORE_AXIS_1) - stepper.position(CORE_AXIS_2)) - : stepper.position(CORE_AXIS_1) + stepper.position(CORE_AXIS_2) - ); + const int32_t p1 = stepper.position(CORE_AXIS_1), + p2 = stepper.position(CORE_AXIS_2); if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + + // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1 + // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2 + axis_steps = (axis == CORE_AXIS_2 ? CORESIGN(p1 - p2) : p1 + p2) * 0.5f; } else axis_steps = stepper.position(axis); @@ -1551,11 +1555,11 @@ void Planner::synchronize() { * * Add a new linear movement to the planner queue (in terms of steps). * - * target - target position in steps units - * target_float - target position in direct (mm, degrees) units. optional - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known + * target - target position in steps units + * target_float - target position in direct (mm, degrees) units. optional + * fr_mm_s - (target) speed of the move + * extruder - target extruder + * millimeters - the length of the movement, if known * * Returns true if movement was properly queued, false otherwise */ @@ -1644,18 +1648,14 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif /* <-- add a slash to enable - SERIAL_ECHOPAIR(" _populate_block FR:", fr_mm_s); - SERIAL_ECHOPAIR(" A:", target[A_AXIS]); - SERIAL_ECHOPAIR(" (", da); - SERIAL_ECHOPAIR(" steps) B:", target[B_AXIS]); - SERIAL_ECHOPAIR(" (", db); - SERIAL_ECHOPAIR(" steps) C:", target[C_AXIS]); - SERIAL_ECHOPAIR(" (", dc); - #if EXTRUDERS - SERIAL_ECHOPAIR(" steps) E:", target[E_AXIS]); - SERIAL_ECHOPAIR(" (", de); - #endif - SERIAL_ECHOLNPGM(" steps)"); + SERIAL_ECHOLNPAIR(" _populate_block FR:", fr_mm_s, + " A:", target[A_AXIS], " (", da, " steps)" + " B:", target[B_AXIS], " (", db, " steps)" + " C:", target[C_AXIS], " (", dc, " steps)" + #if EXTRUDERS + " E:", target[E_AXIS], " (", de, " steps)" + #endif + ); //*/ #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) @@ -2633,7 +2633,7 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con //*/ // Queue the movement - if ( + if ( !_buffer_steps(target #if HAS_POSITION_FLOAT , target_float diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 16486b407..cb74065d9 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -507,8 +507,7 @@ class Planner { skew(pos); #endif #if HAS_LEVELING - if (leveling) - apply_leveling(pos); + if (leveling) apply_leveling(pos); #endif #if ENABLED(FWRETRACT) apply_retract(pos); @@ -529,8 +528,7 @@ class Planner { unapply_retract(pos); #endif #if HAS_LEVELING - if (leveling) - unapply_leveling(pos); + if (leveling) unapply_leveling(pos); #endif #if ENABLED(SKEW_CORRECTION) unskew(pos); diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 8535bf854..34ca2871c 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -155,167 +155,77 @@ float zprobe_zoffset; // Initialized by settings.load() #elif ENABLED(Z_PROBE_ALLEN_KEY) void run_deploy_moves_script() { - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_1 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0 #endif - const float deploy_1[] = { Z_PROBE_ALLEN_KEY_DEPLOY_1_X, Z_PROBE_ALLEN_KEY_DEPLOY_1_Y, Z_PROBE_ALLEN_KEY_DEPLOY_1_Z }; + constexpr float deploy_1[] = Z_PROBE_ALLEN_KEY_DEPLOY_1; do_blocking_move_to(deploy_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_2 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0 #endif - const float deploy_2[] = { Z_PROBE_ALLEN_KEY_DEPLOY_2_X, Z_PROBE_ALLEN_KEY_DEPLOY_2_Y, Z_PROBE_ALLEN_KEY_DEPLOY_2_Z }; + constexpr float deploy_2[] = Z_PROBE_ALLEN_KEY_DEPLOY_2; do_blocking_move_to(deploy_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0 #endif - const float deploy_3[] = { Z_PROBE_ALLEN_KEY_DEPLOY_3_X, Z_PROBE_ALLEN_KEY_DEPLOY_3_Y, Z_PROBE_ALLEN_KEY_DEPLOY_3_Z }; + constexpr float deploy_3[] = Z_PROBE_ALLEN_KEY_DEPLOY_3; do_blocking_move_to(deploy_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_4 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0 #endif - const float deploy_4[] = { Z_PROBE_ALLEN_KEY_DEPLOY_4_X, Z_PROBE_ALLEN_KEY_DEPLOY_4_Y, Z_PROBE_ALLEN_KEY_DEPLOY_4_Z }; + constexpr float deploy_4[] = Z_PROBE_ALLEN_KEY_DEPLOY_4; do_blocking_move_to(deploy_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_5 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0 #endif - const float deploy_5[] = { Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z }; + constexpr float deploy_5[] = Z_PROBE_ALLEN_KEY_DEPLOY_5; do_blocking_move_to(deploy_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE)); #endif } void run_stow_moves_script() { - #if defined(Z_PROBE_ALLEN_KEY_STOW_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_1_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_1_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Z - #define Z_PROBE_ALLEN_KEY_STOW_1_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_1 #ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0 #endif - const float stow_1[] = { Z_PROBE_ALLEN_KEY_STOW_1_X, Z_PROBE_ALLEN_KEY_STOW_1_Y, Z_PROBE_ALLEN_KEY_STOW_1_Z }; + constexpr float stow_1[] = Z_PROBE_ALLEN_KEY_STOW_1; do_blocking_move_to(stow_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_2_X) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_2_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Z - #define Z_PROBE_ALLEN_KEY_STOW_2_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_2 #ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0 #endif - const float stow_2[] = { Z_PROBE_ALLEN_KEY_STOW_2_X, Z_PROBE_ALLEN_KEY_STOW_2_Y, Z_PROBE_ALLEN_KEY_STOW_2_Z }; + constexpr float stow_2[] = Z_PROBE_ALLEN_KEY_STOW_2; do_blocking_move_to(stow_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_3_X) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_X - #define Z_PROBE_ALLEN_KEY_STOW_3_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Z - #define Z_PROBE_ALLEN_KEY_STOW_3_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_3 #ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0 #endif - const float stow_3[] = { Z_PROBE_ALLEN_KEY_STOW_3_X, Z_PROBE_ALLEN_KEY_STOW_3_Y, Z_PROBE_ALLEN_KEY_STOW_3_Z }; + constexpr float stow_3[] = Z_PROBE_ALLEN_KEY_STOW_3; do_blocking_move_to(stow_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_4_X) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_X - #define Z_PROBE_ALLEN_KEY_STOW_4_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Y - #define Z_PROBE_ALLEN_KEY_STOW_4_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Z - #define Z_PROBE_ALLEN_KEY_STOW_4_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_4 #ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0 #endif - const float stow_4[] = { Z_PROBE_ALLEN_KEY_STOW_4_X, Z_PROBE_ALLEN_KEY_STOW_4_Y, Z_PROBE_ALLEN_KEY_STOW_4_Z }; + constexpr float stow_4[] = Z_PROBE_ALLEN_KEY_STOW_4; do_blocking_move_to(stow_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_5_X) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_X - #define Z_PROBE_ALLEN_KEY_STOW_5_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Y - #define Z_PROBE_ALLEN_KEY_STOW_5_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Z - #define Z_PROBE_ALLEN_KEY_STOW_5_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_5 #ifndef Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0 #endif - const float stow_5[] = { Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z }; + constexpr float stow_5[] = Z_PROBE_ALLEN_KEY_STOW_5; do_blocking_move_to(stow_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE)); #endif } @@ -741,7 +651,7 @@ static float run_z_probe() { #endif - const float measured_z = probes_total * (1.0f / (MULTIPLE_PROBING)); + const float measured_z = probes_total * RECIPROCAL(MULTIPLE_PROBING); #elif TOTAL_PROBING == 2 diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 7595ac1f8..8163416cb 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -174,8 +174,8 @@ int32_t Stepper::delta_error[XYZE] = { 0 }; uint32_t Stepper::advance_dividend[XYZE] = { 0 }, Stepper::advance_divisor = 0, Stepper::step_events_completed = 0, // The number of step events executed in the current block - Stepper::accelerate_until, // The point from where we need to stop acceleration - Stepper::decelerate_after, // The point from where we need to start decelerating + Stepper::accelerate_until, // The count at which to stop accelerating + Stepper::decelerate_after, // The count at which to start decelerating Stepper::step_event_count; // The total event count for the current block #if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) @@ -2239,19 +2239,16 @@ void Stepper::endstop_triggered(const AxisEnum axis) { const bool was_enabled = STEPPER_ISR_ENABLED(); if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - #if IS_CORE - - endstops_trigsteps[axis] = 0.5f * ( - axis == CORE_AXIS_2 ? CORESIGN(count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]) - : count_position[CORE_AXIS_1] + count_position[CORE_AXIS_2] - ); - - #else // !COREXY && !COREXZ && !COREYZ - - endstops_trigsteps[axis] = count_position[axis]; - - #endif // !COREXY && !COREXZ && !COREYZ + endstops_trigsteps[axis] = ( + #if IS_CORE + (axis == CORE_AXIS_2 + ? CORESIGN(count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]) + : count_position[CORE_AXIS_1] + count_position[CORE_AXIS_2] + ) * 0.5f + #else // !IS_CORE + count_position[axis] + #endif + ); // Discard the rest of the move if there is a current block quick_stop(); @@ -2279,15 +2276,19 @@ int32_t Stepper::triggered_position(const AxisEnum axis) { void Stepper::report_positions() { - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); + #ifdef __AVR__ + // Protect the access to the position. + const bool was_enabled = STEPPER_ISR_ENABLED(); + if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); + #endif const int32_t xpos = count_position[X_AXIS], ypos = count_position[Y_AXIS], zpos = count_position[Z_AXIS]; - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + #ifdef __AVR__ + if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + #endif #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA SERIAL_ECHOPGM(MSG_COUNT_A); diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index c766054b2..c200787d7 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -321,6 +321,9 @@ class Stepper { static uint32_t acc_step_rate; // needed for deceleration start point #endif + // + // Exact steps at which an endstop was triggered + // static volatile int32_t endstops_trigsteps[XYZ]; // diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 6f46a86ef..6388530af 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1320,13 +1320,14 @@ void Temperature::manage_heater() { if (!WITHIN(t_index, 0, COUNT(user_thermistor) - 1)) return 25; - if (user_thermistor[t_index].pre_calc) { - // pre-calculate some variables - user_thermistor[t_index].pre_calc = false; - user_thermistor[t_index].res_25_recip = 1.0f / user_thermistor[t_index].res_25; - user_thermistor[t_index].res_25_log = logf(user_thermistor[t_index].res_25); - user_thermistor[t_index].beta_recip = 1.0f / user_thermistor[t_index].beta; - user_thermistor[t_index].sh_alpha = (1.0f / (THERMISTOR_RESISTANCE_NOMINAL_C - THERMISTOR_ABS_ZERO_C)) - (user_thermistor[t_index].beta_recip * user_thermistor[t_index].res_25_log) - (user_thermistor[t_index].sh_c_coeff * user_thermistor[t_index].res_25_log * user_thermistor[t_index].res_25_log * user_thermistor[t_index].res_25_log); + user_thermistor_t &t = user_thermistor[t_index]; + if (t.pre_calc) { // pre-calculate some variables + t.pre_calc = false; + t.res_25_recip = 1.0f / t.res_25; + t.res_25_log = logf(t.res_25); + t.beta_recip = 1.0f / t.beta; + t.sh_alpha = RECIPROCAL(THERMISTOR_RESISTANCE_NOMINAL_C - (THERMISTOR_ABS_ZERO_C)) + - (t.beta_recip * t.res_25_log) - (t.sh_c_coeff * cu(t.res_25_log)); } // maximum adc value .. take into account the over sampling @@ -1334,13 +1335,13 @@ void Temperature::manage_heater() { adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero const float adc_inverse = (adc_max - adc_raw) - 0.5f, - resistance = user_thermistor[t_index].series_res * (adc_raw + 0.5f) / adc_inverse, + resistance = t.series_res * (adc_raw + 0.5f) / adc_inverse, log_resistance = logf(resistance); - float value = user_thermistor[t_index].sh_alpha; - value += log_resistance * user_thermistor[t_index].beta_recip; - if (user_thermistor[t_index].sh_c_coeff != 0) - value += user_thermistor[t_index].sh_c_coeff * log_resistance * log_resistance * log_resistance; + float value = t.sh_alpha; + value += log_resistance * t.beta_recip; + if (t.sh_c_coeff != 0) + value += t.sh_c_coeff * cu(log_resistance); value = 1.0f / value; //#if (MOTHERBOARD == BOARD_RAMPS_14_EFB) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 1e5af33c9..608d47345 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -133,9 +133,11 @@ #endif // SWITCHING_NOZZLE -inline void fast_line_to_current(const AxisEnum fr_axis) { - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[fr_axis], active_extruder); +inline void _line_to_current(const AxisEnum fr_axis, const float fscale=1.0f) { + planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[fr_axis] * fscale, active_extruder); } +inline void slow_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.5f); } +inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis); } #if ENABLED(MAGNETIC_PARKING_EXTRUDER) @@ -150,13 +152,11 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { const float oldx = current_position[X_AXIS], grabpos = mpe_settings.parking_xpos[new_tool] + (new_tool ? mpe_settings.grab_distance : -mpe_settings.grab_distance), - offsetcompensation = + offsetcompensation = (0 #if HAS_HOTEND_OFFSET - hotend_offset[X_AXIS][active_extruder] * mpe_settings.compensation_factor - #else - 0 + + hotend_offset[X_AXIS][active_extruder] * mpe_settings.compensation_factor #endif - ; + ); if (axis_unhomed_error(true, false, false)) return; @@ -337,7 +337,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { planner.synchronize(); DEBUG_POS("(5) Unpark extruder", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.5, active_extruder); + slow_line_to_current(X_AXIS); // STEP 6 @@ -411,7 +411,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS; if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5f, active_extruder); + slow_line_to_current(Y_AXIS); // Wait for move to complete, then another 0.2s planner.synchronize(); @@ -446,7 +446,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { DEBUG_ECHOLNPGM("(4) Grab and lock new toolhead"); DEBUG_POS("Move Y SwitchPos", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5, active_extruder); + slow_line_to_current(Y_AXIS); // Wait for move to finish, pause 0.2s, move servo, pause 0.5s planner.synchronize(); @@ -491,21 +491,21 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { SERIAL_ECHOLNPAIR("(1) Place old tool ", int(active_extruder)); DEBUG_POS("Move Y SwitchPos + Security", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); + fast_line_to_current(Y_AXIS); current_position[X_AXIS] = placexclear; if (DEBUGGING(LEVELING)) { planner.synchronize(); DEBUG_POS("Move X SwitchPos + Security", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + fast_line_to_current(X_AXIS); current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS; if (DEBUGGING(LEVELING)) { planner.synchronize(); DEBUG_POS("Move Y SwitchPos", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); + fast_line_to_current(Y_AXIS); current_position[X_AXIS] = placexpos; if (DEBUGGING(LEVELING)) { @@ -541,7 +541,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[X_AXIS] = grabxpos; if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + fast_line_to_current(X_AXIS); // 4. Grab the new toolhead and move to security position @@ -559,7 +559,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { planner.synchronize(); DEBUG_POS("Move Y SwitchPos", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.2, active_extruder); + _line_to_current(Y_AXIS, 0.2f); #if ENABLED(PRIME_BEFORE_REMOVE) && (SWITCHING_TOOLHEAD_PRIME_MM || SWITCHING_TOOLHEAD_RETRACT_MM) #if SWITCHING_TOOLHEAD_PRIME_MM @@ -577,13 +577,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[X_AXIS] = grabxclear; if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X + Security", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.1, active_extruder); + _line_to_current(X_AXIS, 0.1f); planner.synchronize(); safe_delay(100); // Give switch time to settle current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); // move away from docked toolhead + fast_line_to_current(Y_AXIS); // move away from docked toolhead planner.synchronize(); // Always sync last tool-change move if (DEBUGGING(LEVELING)) DEBUG_POS("MST Tool-Change done.", current_position); @@ -620,7 +620,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[Z_AXIS] += SWITCHING_TOOLHEAD_Z_HOP; if (DEBUGGING(LEVELING)) DEBUG_POS("(1) Raise Z-Axis ", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); + fast_line_to_current(Z_AXIS); // 2. Move to position near active extruder parking @@ -629,9 +629,9 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { SERIAL_ECHOLNPAIR("(2) Move near active extruder parking", active_extruder); DEBUG_POS("Moving ParkPos", current_position); } - current_position[X_AXIS] = placexpos + hotend_offset[X_AXIS][active_extruder]; - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR + hotend_offset[Y_AXIS][active_extruder]; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + current_position[X_AXIS] = hotend_offset[X_AXIS][active_extruder] + placexpos; + current_position[Y_AXIS] = hotend_offset[Y_AXIS][active_extruder] + SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR; + fast_line_to_current(X_AXIS); // 3. Move gently to park position of active extruder @@ -642,7 +642,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { } current_position[Y_AXIS] -= SWITCHING_TOOLHEAD_Y_CLEAR; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5, active_extruder); + slow_line_to_current(Y_AXIS); // 4. Disengage magnetic field, wait for delay @@ -658,10 +658,11 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { } current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5f, active_extruder); - current_position[X_AXIS] = grabxpos + hotend_offset[X_AXIS][active_extruder]; - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR + hotend_offset[Y_AXIS][active_extruder]; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + slow_line_to_current(Y_AXIS); + + current_position[X_AXIS] = hotend_offset[X_AXIS][active_extruder] + grabxpos; + current_position[Y_AXIS] = hotend_offset[Y_AXIS][active_extruder] + SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR; + fast_line_to_current(X_AXIS); // 6. Move gently to park position of new extruder @@ -670,7 +671,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { planner.synchronize(); DEBUG_ECHOLNPGM("(6) Move near new extruder"); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5f, active_extruder); + slow_line_to_current(Y_AXIS); // 7. Engage magnetic field for new extruder parking @@ -682,7 +683,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(8) Unpark extruder"); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.5f, active_extruder); + slow_line_to_current(X_AXIS); planner.synchronize(); // Always sync the final move // 9. Apply Z hotend offset to current position diff --git a/config/examples/delta/Anycubic/Kossel/Configuration.h b/config/examples/delta/Anycubic/Kossel/Configuration.h index e442674b9..8a290cd45 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration.h @@ -1028,39 +1028,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/Dreammaker/Overlord/Configuration.h b/config/examples/delta/Dreammaker/Overlord/Configuration.h index dc3c7d03d..c42d48bd5 100644 --- a/config/examples/delta/Dreammaker/Overlord/Configuration.h +++ b/config/examples/delta/Dreammaker/Overlord/Configuration.h @@ -973,39 +973,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h index d0b2c6b2d..56f1be5ed 100644 --- a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h @@ -985,39 +985,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index 0f4efc8d9..368a0bf0d 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -975,41 +975,27 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) - - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/FLSUN/kossel/Configuration.h b/config/examples/delta/FLSUN/kossel/Configuration.h index 924cb8558..2f533ebf5 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/config/examples/delta/FLSUN/kossel/Configuration.h @@ -975,40 +975,26 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) - - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/config/examples/delta/FLSUN/kossel_mini/Configuration.h index fa7992626..2790a620e 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -975,40 +975,26 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) - - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration.h b/config/examples/delta/Geeetech/Rostock 301/Configuration.h index bea55460e..06e507924 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration.h @@ -964,39 +964,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/Hatchbox_Alpha/Configuration.h b/config/examples/delta/Hatchbox_Alpha/Configuration.h index 151fb8f61..3d972806b 100644 --- a/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -979,39 +979,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/MKS/SBASE/Configuration.h b/config/examples/delta/MKS/SBASE/Configuration.h index 7b7f8b989..2b1969d16 100644 --- a/config/examples/delta/MKS/SBASE/Configuration.h +++ b/config/examples/delta/MKS/SBASE/Configuration.h @@ -964,39 +964,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/Tevo Little Monster/Configuration.h b/config/examples/delta/Tevo Little Monster/Configuration.h index f8cafd089..51101aaba 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration.h +++ b/config/examples/delta/Tevo Little Monster/Configuration.h @@ -968,39 +968,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/generic/Configuration.h b/config/examples/delta/generic/Configuration.h index f8b6e8016..2a8613b2d 100644 --- a/config/examples/delta/generic/Configuration.h +++ b/config/examples/delta/generic/Configuration.h @@ -964,39 +964,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/kossel_mini/Configuration.h b/config/examples/delta/kossel_mini/Configuration.h index 2b44bab68..37348897a 100644 --- a/config/examples/delta/kossel_mini/Configuration.h +++ b/config/examples/delta/kossel_mini/Configuration.h @@ -965,40 +965,26 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) - - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/kossel_pro/Configuration.h b/config/examples/delta/kossel_pro/Configuration.h index 223ffa1f1..cb905a062 100644 --- a/config/examples/delta/kossel_pro/Configuration.h +++ b/config/examples/delta/kossel_pro/Configuration.h @@ -958,44 +958,28 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Pro - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { -105.00, 0.00, 100.0 } // Move left but not quite so far that we'll bump the belt #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { -110.00, -125.00, 100.0 } // Move outward to position deploy pin to the left of the arm #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { -110.00 * 0.75, -125.00 * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X 45.00 // Move right to trigger deploy pin - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z Z_PROBE_ALLEN_KEY_DEPLOY_3_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_4 { 45.00, -125.00, 100.0 } // Move right to trigger deploy pin #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip - #define Z_PROBE_ALLEN_KEY_STOW_1_Y -125.00 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { 36.00, -125.00, 75.0 } // Line up with bed retaining clip #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X // move down to retract probe - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { 36.00, -125.00, 0.0 } // move down to retract probe #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { 0.0, 0.0, 100.0 } // return to 0,0,100 #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 100.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY diff --git a/config/examples/delta/kossel_xl/Configuration.h b/config/examples/delta/kossel_xl/Configuration.h index 15fecea43..0dce15239 100644 --- a/config/examples/delta/kossel_xl/Configuration.h +++ b/config/examples/delta/kossel_xl/Configuration.h @@ -967,39 +967,25 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY