From 8c2f21f5d4a082e5946feb801874e7ab514db454 Mon Sep 17 00:00:00 2001 From: bilsef Date: Wed, 16 Sep 2020 11:44:49 -0700 Subject: [PATCH 1/4] Fixes for 6 axis Fixed some typos and made some improvements --- Marlin/Configuration.h | 18 +++++++++--------- Marlin/src/core/language.h | 28 ++++++++++++++-------------- Marlin/src/core/types.h | 10 +++++----- Marlin/src/module/motion.cpp | 12 +++++++++--- Marlin/src/module/stepper.cpp | 9 +++++---- 5 files changed, 42 insertions(+), 35 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 367a8bb3f1c6e..13424efb26e33 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -833,18 +833,18 @@ * Override with M92 * X, Y, Z, [I ,[J ,[K ,]]] E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } +#define DEFAULT_AXIS_STEPS_PER_UNIT {LIST_N(LINEAR_AXES, 80, 80, 4000, 80, 80, 80), 500} /** * Default Max Feed Rate (mm/s) * Override with M203 * X, Y, Z, [I ,[J ,[K ,]]] E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +#define DEFAULT_MAX_FEEDRATE {LIST_N(LINEAR_AXES, 300, 300, 5, 300, 300, 300), 25 } //#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 #if ENABLED(LIMITED_MAX_FR_EDITING) - #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits + #define MAX_FEEDRATE_EDIT_VALUES {LIST_N(LINEAR_AXES, 600, 600, 10, 600, 600, 600), 50 } // ...or, set your own edit limits #endif /** @@ -853,11 +853,11 @@ * Override with M201 * X, Y, Z, [I ,[J ,[K ,]]] E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +#define DEFAULT_MAX_ACCELERATION {LIST_N(LINEAR_AXES, 3000, 3000, 100, 3000, 3000, 3000), 10000 } //#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 #if ENABLED(LIMITED_MAX_ACCEL_EDITING) - #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits + #define MAX_ACCEL_EDIT_VALUES {LIST_N(LINEAR_AXES, 6000, 6000, 200, 6000, 6000, 6000), 20000 } // ...or, set your own edit limits #endif /** @@ -885,15 +885,15 @@ #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 - //#define DEFAULT_IJERK 0.3 - //#define DEFAULT_JJERK 0.3 - //#define DEFAULT_KJERK 0.3 + #define DEFAULT_IJERK 10.0 + #define DEFAULT_JJERK 10.0 + #define DEFAULT_KJERK 10.0 //#define TRAVEL_EXTRA_XYJERK 0.0 // Additional jerk allowance for all travel moves //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 #if ENABLED(LIMITED_JERK_EDITING) - #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #define MAX_JERK_EDIT_VALUES {LIST_N(LINEAR_AXES, 20, 20, 0.6, 20, 20, 20), 10 } // ...or, set your own edit limits #endif #endif diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index cbfbdb8699e1d..4fac0308f265e 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -208,26 +208,26 @@ #if LINEAR_AXES >= 6 #if AXIS6_NAME == 'A' - #define STR_J_MIN "a_min" - #define STR_J_MAX "a_max" + #define STR_K_MIN "a_min" + #define STR_K_MAX "a_max" #elif AXIS6_NAME == 'B' - #define STR_J_MIN "b_min" - #define STR_J_MAX "b_max" + #define STR_K_MIN "b_min" + #define STR_K_MAX "b_max" #elif AXIS6_NAME == 'C' - #define STR_J_MIN "c_min" - #define STR_J_MAX "c_max" + #define STR_K_MIN "c_min" + #define STR_K_MAX "c_max" #elif AXIS6_NAME == 'U' - #define STR_J_MIN "u_min" - #define STR_J_MAX "u_max" + #define STR_K_MIN "u_min" + #define STR_K_MAX "u_max" #elif AXIS6_NAME == 'V' - #define STR_J_MIN "v_min" - #define STR_J_MAX "v_max" + #define STR_K_MIN "v_min" + #define STR_K_MAX "v_max" #elif AXIS6_NAME == 'W' - #define STR_J_MIN "w_min" - #define STR_J_MAX "w_max" + #define STR_K_MIN "w_min" + #define STR_K_MAX "w_max" #else - #define STR_J_MIN "j_min" - #define STR_J_MAX "j_max" + #define STR_K_MIN "k_min" + #define STR_K_MAX "k_max" #endif #endif diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 2b115fd1c28db..9a92d6ea82685 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -431,14 +431,14 @@ struct XYZEval { FI void set(const T px, const T py, const T pz, const T pi) { x = px; y = py; z = pz; i = pi; } FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; } FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; } - FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pe) { x = px; y = py; z = pz; e = pe; } + FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pe) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; e = pe; } FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } FI void set(const XYval pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; } + FI void set(const XYval pxy, const T pz, const T pi) { x = pxy.x; y = pxy.y; z = pz; i = pi; } + FI void set(const XYval pxy, const T pz, const T pi, const T pj) { x = pxy.x; y = pxy.y; z = pz; i = pi; j = pj; } + FI void set(const XYval pxy, const T pz, const T pi, const T pj, const T pk) { x = pxy.x; y = pxy.y; z = pz; i = pi; j = pj; k = pk; } FI void set(const XYZval pxyz) { x = pxyz.x; y = pxyz.y; z = pxyz.z; i = pxyz.i; j = pxyz.j; k = pxyz.k; } - FI void set(const XYval pxy, const T pz, const T pe) { x = pxy.x; y = pxy.y; z = pz; e = pe; } - FI void set(const XYval pxy, const T pz, const T pi, const T pe) { x = pxy.x; y = pxy.y; z = pz; i = pi.i; e = pe; } - FI void set(const XYval pxy, const T pz, const T pi, const T pj, const T pe) { x = pxy.x; y = pxy.y; z = pz; i = pi.i; j = pj.j; e = pe; } - FI void set(const XYval pxy, const T pz, const T pi, const T pj, const T pk, const T pe) { x = pxy.x; y = pxy.y; z = pz; i = pi.i; j = pj.j; k = pk.k; e = pe; } + FI void set(const XYval pxy, const T pz, const T pi, const T pj, const T pk, const T pe) { x = pxy.x; y = pxy.y; z = pz; i = pi.i; j = pj.j; ; k = pk.k; e = pe; } FI void set(const XYval pxy, const T pi, const T pj, const T pk, const XYval pze) { x = pxy.x; y = pxy.y; z = pze.z; i = pi.i; j = pj.j; k = pk.k; e = pze.e; } FI void set(const XYZval pxyz, const T pe) { x = pxyz.x; y = pxyz.y; z = pxyz.z; i = pxyz.i; j = pxyz.j; k = pxyz.k; e = pe; } FI XYZEval copy() const { XYZval o = *this; return o; } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index e6b9434563763..53afee7f77c9c 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -245,7 +245,7 @@ void report_real_position() { npos.y = cartes.y; npos.z = cartes.z; #if LINEAR_AXES >= 4 - npos.i = planner.get_axis_position_mm(I_AXIS); + npos.i = planner.get_axis_position_mm(I_AXIS) * 4.0; // FIXME (DerAndere): Multiplication by 4.0 is a work-around for issue with wrong internal steps per mm #endif #if LINEAR_AXES >= 5 npos.j = planner.get_axis_position_mm(J_AXIS); @@ -419,7 +419,7 @@ void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/ } /** - * Plan a move to (X, Y, Z) and set the current_position + * Plan a move to (X, Y, Z, [I, [J, [K]]]) and set the current_position */ void do_blocking_move_to( LIST_N(LINEAR_AXES, const float rx, const float ry, const float rz, const float ri, const float rj, const float rk), @@ -552,7 +552,7 @@ void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s/*=0.0*/) { do_blocking_move_to_xy_z(current_position, rz, fr_mm_s); } -#if LINEAR_AXES >= 4 +#if LINEAR_AXES == 4 void do_blocking_move_to_i(const float &ri, const feedRate_t &fr_mm_s/*=0.0*/) { do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s); } @@ -562,6 +562,12 @@ void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s/*=0.0*/) { #endif #if LINEAR_AXES >= 5 + void do_blocking_move_to_i(const float &ri, const feedRate_t &fr_mm_s/*=0.0*/) { + do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s); + } + void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const float &i, const feedRate_t &fr_mm_s/*=0.0f*/) { + do_blocking_move_to(raw.x, raw.y, raw.z, i, raw.j, fr_mm_s); + } void do_blocking_move_to_j(const float &rj, const feedRate_t &fr_mm_s/*=0.0*/) { do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s); } diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 06601aac76af4..274ca8c8c810b 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2823,17 +2823,18 @@ void Stepper::report_a_position(const xyz_long_t &pos) { #if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA) SERIAL_ECHOLNPAIR(" C:", pos.z); #else - SERIAL_ECHOLNPAIR_P(SP_Z_LBL, pos.z); + SERIAL_ECHOPAIR_P(SP_Z_LBL, pos.z); #endif #if LINEAR_AXES >= 4 - SERIAL_ECHOLNPAIR_P(SP_I_LBL, pos.i); + SERIAL_ECHOPAIR_P(SP_I_LBL, pos.i); #endif #if LINEAR_AXES >= 5 - SERIAL_ECHOLNPAIR_P(SP_J_LBL, pos.j); + SERIAL_ECHOPAIR_P(SP_J_LBL, pos.j); #endif #if LINEAR_AXES >= 6 - SERIAL_ECHOLNPAIR_P(SP_K_LBL, pos.k); + SERIAL_ECHOPAIR_P(SP_K_LBL, pos.k); #endif + SERIAL_EOL(); } void Stepper::report_positions() { From 429a74b5b6c1a4e4e6aa3400937661e09de67a72 Mon Sep 17 00:00:00 2001 From: bilsef Date: Wed, 16 Sep 2020 18:06:13 -0700 Subject: [PATCH 2/4] Update language.h One more type --- Marlin/src/core/language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 4fac0308f265e..5b116b288ea24 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -411,7 +411,7 @@ #elif AXIS6_NAME == 'W' #define AXIS6_STR "W" #else - #define AXIS6_STR "J" + #define AXIS6_STR "K" #endif #else #define AXIS6_STR "" From 83ae4560aedfb7acd4634cbdd46bfbe8fa93f4bc Mon Sep 17 00:00:00 2001 From: bilsef Date: Thu, 17 Sep 2020 14:40:30 -0700 Subject: [PATCH 3/4] Fix more typos in types.h This fixes the issue with I axis multiply and divide by 4 so I removed those workarounds. --- Marlin/src/core/types.h | 18 +++++++++--------- Marlin/src/gcode/config/M92.cpp | 4 ++-- Marlin/src/module/motion.cpp | 2 +- Marlin/src/module/planner.cpp | 14 ++------------ Marlin/src/module/settings.cpp | 2 -- 5 files changed, 14 insertions(+), 26 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 9a92d6ea82685..7eb1609c4d788 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -371,7 +371,7 @@ struct XYZval { FI XYZval operator* (const XYZEval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.i *= rs.i; ls.j *= rs.j; ls.k *= rs.k; return ls; } FI XYZval operator/ (const XYZEval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.i /= rs.i; ls.j /= rs.j; ls.k /= rs.k; return ls; } FI XYZval operator/ (const XYZEval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.i /= rs.i; ls.j /= rs.j; ls.k /= rs.k; return ls; } - FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.x *= v; ls.j *= v; ls.k *= v; return ls; } //TODO: Test if ls.z = v or ls.z = z is correct + FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; ls.j *= v; ls.k *= v; return ls; } //TODO: Test if ls.z = v or ls.z = z is correct FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; ls.j *= v; ls.k *= v; return ls; } FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; ls.j *= v; ls.k *= v; return ls; } FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; ls.j *= v; ls.k *= v; return ls; } @@ -495,8 +495,8 @@ struct XYZEval { FI XYZEval operator/ (const int &v) { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; ls.i /= v; ls.j /= v; ls.k /= v; return ls; } FI XYZEval operator>>(const int &v) const { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.i); _RS(ls.j); _RS(ls.k); _RS(ls.e); return ls; } FI XYZEval operator>>(const int &v) { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.i); _RS(ls.j); _RS(ls.k); _RS(ls.e); return ls; } - FI XYZEval operator<<(const int &v) const { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _RS(ls.i); _LS(ls.j); _LS(ls.k); _LS(ls.e); return ls; } - FI XYZEval operator<<(const int &v) { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _RS(ls.i); _LS(ls.j); _LS(ls.k); _LS(ls.e); return ls; } + FI XYZEval operator<<(const int &v) const { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.i); _LS(ls.j); _LS(ls.k); _LS(ls.e); return ls; } + FI XYZEval operator<<(const int &v) { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.i); _LS(ls.j); _LS(ls.k); _LS(ls.e); return ls; } FI XYZEval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } FI XYZEval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } FI XYZEval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } @@ -591,7 +591,7 @@ struct XYZval { FI XYZval operator* (const XYZEval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.i *= rs.i; ls.j *= rs.j; return ls; } FI XYZval operator/ (const XYZEval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.i /= rs.i; ls.j /= rs.j; return ls; } FI XYZval operator/ (const XYZEval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.i /= rs.i; ls.j /= rs.j; return ls; } - FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.x *= v; ls.j *= v; return ls; } //TODO: Test if ls.z = v or ls.z = z is correct + FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; ls.j *= v; return ls; } //TODO: Test if ls.z = v or ls.z = z is correct FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; ls.j *= v; return ls; } FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; ls.j *= v; return ls; } FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; ls.j *= v; return ls; } @@ -713,8 +713,8 @@ struct XYZEval { FI XYZEval operator/ (const int &v) { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; ls.i /= v; ls.j /= v; return ls; } FI XYZEval operator>>(const int &v) const { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.i); _RS(ls.j); _RS(ls.e); return ls; } FI XYZEval operator>>(const int &v) { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.i); _RS(ls.j); _RS(ls.e); return ls; } - FI XYZEval operator<<(const int &v) const { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _RS(ls.i); _LS(ls.j); _LS(ls.e); return ls; } - FI XYZEval operator<<(const int &v) { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _RS(ls.i); _LS(ls.j); _LS(ls.e); return ls; } + FI XYZEval operator<<(const int &v) const { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.i); _LS(ls.j); _LS(ls.e); return ls; } + FI XYZEval operator<<(const int &v) { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.i); _LS(ls.j); _LS(ls.e); return ls; } FI XYZEval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } FI XYZEval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } FI XYZEval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } @@ -806,7 +806,7 @@ struct XYZval { FI XYZval operator* (const XYZEval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.i *= rs.i; return ls; } FI XYZval operator/ (const XYZEval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.i /= rs.i; return ls; } FI XYZval operator/ (const XYZEval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.i /= rs.i; return ls; } - FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.x *= v; return ls; } //TODO: Test if ls.z = v or ls.z = z is correct + FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; return ls; } //TODO: Test if ls.z = v or ls.z = z is correct FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; return ls; } FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; return ls; } FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.i *= v; return ls; } @@ -925,8 +925,8 @@ struct XYZEval { FI XYZEval operator/ (const int &v) { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; ls.i /= v; return ls; } FI XYZEval operator>>(const int &v) const { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.i); _RS(ls.e); return ls; } FI XYZEval operator>>(const int &v) { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.i); _RS(ls.e); return ls; } - FI XYZEval operator<<(const int &v) const { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _RS(ls.i); _LS(ls.e); return ls; } - FI XYZEval operator<<(const int &v) { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _RS(ls.i); _LS(ls.e); return ls; } + FI XYZEval operator<<(const int &v) const { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.i); _LS(ls.e); return ls; } + FI XYZEval operator<<(const int &v) { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.i); _LS(ls.e); return ls; } FI XYZEval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } FI XYZEval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } FI XYZEval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index f84c4d131d3c1..f3870a9ab6791 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -29,7 +29,7 @@ void report_M92(const bool echo=true, const int8_t e=-1) { PSTR(" M92 X"), LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]), SP_Y_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]), SP_Z_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]), - SP_I_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[I_AXIS]), // FIXME: Devision by 4.0 to work around issue that seemmingly, internally used steps_per_mm[I_AXIS] = DEFAULT_STEPS_PER_UNIT[I_AXIS]/4.0 ? + SP_I_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[I_AXIS]), SP_J_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[J_AXIS]), SP_K_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[K_AXIS])) ); @@ -91,7 +91,7 @@ void GcodeSuite::M92() { else { planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i); #if LINEAR_AXES >= 4 // FIXME (DerAndere): Work around issue that actual internal steps_per_mm for the I_AXIS is only a quater of the STEPS_PER_UNIT - if (i == 3) planner.settings.axis_steps_per_mm[i] *= 4.0f; + //if (i == 3) planner.settings.axis_steps_per_mm[i] *= 4.0f; #endif } } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 53afee7f77c9c..912dd329cf7c9 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -245,7 +245,7 @@ void report_real_position() { npos.y = cartes.y; npos.z = cartes.z; #if LINEAR_AXES >= 4 - npos.i = planner.get_axis_position_mm(I_AXIS) * 4.0; // FIXME (DerAndere): Multiplication by 4.0 is a work-around for issue with wrong internal steps per mm + npos.i = planner.get_axis_position_mm(I_AXIS); #endif #if LINEAR_AXES >= 5 npos.j = planner.get_axis_position_mm(J_AXIS); diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 7b0396e008056..aebcb61c300e9 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -3201,18 +3201,8 @@ void Planner::set_max_feedrate(const uint8_t axis, float targetValue) { #endif limit_and_warn(targetValue, axis, PSTR("Feedrate"), max_fr_edit_scaled); #endif - #if LINEAR_AXES >= 4 - // FIXME (DerAndere):!!! Work-around for issue with internal feedrate for I_AXIS - - if (axis == 3) { - settings.max_feedrate_mm_s[axis] = targetValue * 4.0; - } - else { - settings.max_feedrate_mm_s[axis] = targetValue; - } - #else - settings.max_feedrate_mm_s[axis] = targetValue; - #endif + + settings.max_feedrate_mm_s[axis] = targetValue; } void Planner::set_max_jerk(const AxisEnum axis, float targetValue) { diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index a5b6c1f69ec32..f11584b817bf7 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -2493,9 +2493,7 @@ void MarlinSettings::postprocess() { void MarlinSettings::reset() { LOOP_NUM_AXIS_N(i) { planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword(&_DMA[ALIM(i, _DMA)]); - // FIXME (DerAndere):!!! Work around issue where actual internally-used steps_per_mm for I_AXIS are only 1/4 of STEPS_PER_UNIT planner.settings.axis_steps_per_mm[i] = pgm_read_float(&_DASU[ALIM(i, _DASU)]); - if (LINEAR_AXES >= 4 && i == 3) planner.settings.axis_steps_per_mm[i] *= 4.0f; planner.settings.max_feedrate_mm_s[i] = pgm_read_float(&_DMF[ALIM(i, _DMF)]); } From 09bb7efdda18f5996eb3795f9beae2da6cd00604 Mon Sep 17 00:00:00 2001 From: bilsef Date: Thu, 17 Sep 2020 14:46:42 -0700 Subject: [PATCH 4/4] Update M92.cpp Missed one --- Marlin/src/gcode/config/M92.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index f3870a9ab6791..0491639459e99 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -90,9 +90,6 @@ void GcodeSuite::M92() { } else { planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i); - #if LINEAR_AXES >= 4 // FIXME (DerAndere): Work around issue that actual internal steps_per_mm for the I_AXIS is only a quater of the STEPS_PER_UNIT - //if (i == 3) planner.settings.axis_steps_per_mm[i] *= 4.0f; - #endif } } }