From 5c6061ea5a906e79a4731dd901ee467d2dde04e5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 22 Jan 2018 08:03:53 -0600 Subject: [PATCH 1/2] More precision in M852 skew report --- Marlin/configuration_store.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 26cbee9a0..9fc000a53 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -2230,8 +2230,11 @@ void MarlinSettings::reset() { #if ENABLED(SKEW_CORRECTION_FOR_Z) SERIAL_ECHO(" M852 I"); SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); - SERIAL_ECHOPAIR(" J", LINEAR_UNIT(planner.xz_skew_factor)); - SERIAL_ECHOLNPAIR(" K", LINEAR_UNIT(planner.yz_skew_factor)); + SERIAL_ECHOPGM(" J"); + SERIAL_ECHO_F(LINEAR_UNIT(planner.xz_skew_factor), 6); + SERIAL_ECHOPGM(" K"); + SERIAL_ECHO_F(LINEAR_UNIT(planner.yz_skew_factor), 6); + SERIAL_EOL(); #else SERIAL_ECHO(" M852 S"); SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6); From 1cea0b6f70e42870c4b24e70eecd1c9516f51ec7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 22 Jan 2018 08:22:28 -0600 Subject: [PATCH 2/2] Fix Skew Correction pre-calculation overflow error --- Marlin/Conditionals_post.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 244fe8851..027e4bad0 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -867,7 +867,7 @@ #define _GET_SIDE(a,b,c) (SQRT(2*sq(a)+2*sq(b)-4*sq(c))*0.5) #define _SKEW_SIDE(a,b,c) tan(M_PI*0.5-acos((sq(a)-sq(b)-sq(c))/(2*c*b))) - #define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(a,_GET_SIDE(a,b,c),c) + #define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(float(a),_GET_SIDE(float(a),float(b),float(c)),float(c)) #ifndef XY_SKEW_FACTOR constexpr float XY_SKEW_FACTOR = (