From 8be91677df714b6c28db5ebfee4824a07239d5be Mon Sep 17 00:00:00 2001 From: Jacob Jordan Date: Thu, 29 Nov 2018 09:39:31 -0800 Subject: [PATCH] Fix Skew factors (#12555) - Ensure Skew factors are calculated from test square measurements --- Marlin/src/inc/Conditionals_post.h | 36 +++++++++++++----------------- Marlin/src/module/planner.h | 6 +---- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 4e1097f93b..02334fa1ff 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1208,34 +1208,28 @@ #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 = ( - #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) - _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) - #else - 0.0 - #endif - ); + #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) + #define XY_SKEW_FACTOR _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) + #else + #define XY_SKEW_FACTOR 0.0 + #endif #endif #ifndef XZ_SKEW_FACTOR #if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD) #define XZ_SIDE_AD XY_SIDE_AD #endif - constexpr float XZ_SKEW_FACTOR = ( - #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) - _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) - #else - 0.0 - #endif - ); + #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) + #define XZ_SKEW_FACTOR _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) + #else + #define XZ_SKEW_FACTOR 0.0 + #endif #endif #ifndef YZ_SKEW_FACTOR - constexpr float YZ_SKEW_FACTOR = ( - #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) - _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) - #else - 0.0 - #endif - ); + #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) + #define YZ_SKEW_FACTOR _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) + #else + #define YZ_SKEW_FACTOR 0.0 + #endif #endif #endif // SKEW_CORRECTION diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 8cf37f0758..4fe90b9fa7 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -175,13 +175,9 @@ typedef struct { min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate } planner_settings_t; -#ifndef XY_SKEW_FACTOR +#if DISABLED(SKEW_CORRECTION) #define XY_SKEW_FACTOR 0 -#endif -#ifndef XZ_SKEW_FACTOR #define XZ_SKEW_FACTOR 0 -#endif -#ifndef YZ_SKEW_FACTOR #define YZ_SKEW_FACTOR 0 #endif