Improve kinematic optimization options

This commit is contained in:
Scott Lahteine 2016-09-21 17:43:06 -05:00
parent 2846531f0b
commit 85e607153b

View file

@ -7843,15 +7843,19 @@ void ok_to_send() {
) \ ) \
) )
#define DELTA_RAW_IK() do { \
delta[A_AXIS] = DELTA_Z(1); \
delta[B_AXIS] = DELTA_Z(2); \
delta[C_AXIS] = DELTA_Z(3); \
} while(0)
#define DELTA_LOGICAL_IK() do { \ #define DELTA_LOGICAL_IK() do { \
const float raw[XYZ] = { \ const float raw[XYZ] = { \
RAW_X_POSITION(logical[X_AXIS]), \ RAW_X_POSITION(logical[X_AXIS]), \
RAW_Y_POSITION(logical[Y_AXIS]), \ RAW_Y_POSITION(logical[Y_AXIS]), \
RAW_Z_POSITION(logical[Z_AXIS]) \ RAW_Z_POSITION(logical[Z_AXIS]) \
}; \ }; \
delta[A_AXIS] = DELTA_Z(1); \ DELTA_RAW_IK(); \
delta[B_AXIS] = DELTA_Z(2); \
delta[C_AXIS] = DELTA_Z(3); \
} while(0) } while(0)
#define DELTA_DEBUG() do { \ #define DELTA_DEBUG() do { \
@ -8138,15 +8142,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
// Send all the segments to the planner // Send all the segments to the planner
#if ENABLED(DELTA) && ENABLED(USE_RAW_KINEMATICS) #if ENABLED(USE_RAW_KINEMATICS)
#define DELTA_E raw[E_AXIS]
#define DELTA_NEXT(ADDEND) LOOP_XYZE(i) raw[i] += ADDEND;
#define DELTA_IK() do { \
delta[A_AXIS] = DELTA_Z(1); \
delta[B_AXIS] = DELTA_Z(2); \
delta[C_AXIS] = DELTA_Z(3); \
} while(0)
// Get the raw current position as starting point // Get the raw current position as starting point
float raw[ABC] = { float raw[ABC] = {
@ -8155,7 +8151,19 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
RAW_CURRENT_POSITION(Z_AXIS) RAW_CURRENT_POSITION(Z_AXIS)
}; };
#define DELTA_E raw[E_AXIS]
#define DELTA_NEXT(ADDEND) LOOP_XYZE(i) raw[i] += ADDEND;
#if ENABLED(DELTA)
#define DELTA_IK() DELTA_RAW_IK()
#else #else
#define DELTA_IK() inverse_kinematics(raw)
#endif
#else
// Get the logical current position as starting point
LOOP_XYZE(i) logical[i] = current_position[i];
#define DELTA_E logical[E_AXIS] #define DELTA_E logical[E_AXIS]
#define DELTA_NEXT(ADDEND) LOOP_XYZE(i) logical[i] += ADDEND; #define DELTA_NEXT(ADDEND) LOOP_XYZE(i) logical[i] += ADDEND;
@ -8166,9 +8174,6 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
#define DELTA_IK() inverse_kinematics(logical) #define DELTA_IK() inverse_kinematics(logical)
#endif #endif
// Get the logical current position as starting point
LOOP_XYZE(i) logical[i] = current_position[i];
#endif #endif
#if ENABLED(USE_DELTA_IK_INTERPOLATION) #if ENABLED(USE_DELTA_IK_INTERPOLATION)