Browse Source

General DELTA_IK macro

pull/1/head
Scott Lahteine 7 years ago
parent
commit
caa5093498
  1. 2
      Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp
  2. 2
      Marlin/src/module/delta.cpp
  3. 18
      Marlin/src/module/delta.h
  4. 2
      Marlin/src/module/motion.cpp

2
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp

@ -427,7 +427,7 @@
#if ENABLED(DELTA) // apply delta inverse_kinematics
DELTA_RAW_IK();
DELTA_IK(raw);
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], fr, active_extruder);
#elif IS_SCARA // apply scara inverse_kinematics (should be changed to save raw->logical->raw)

2
Marlin/src/module/delta.cpp

@ -121,7 +121,7 @@ void recalc_delta_settings() {
}while(0)
void inverse_kinematics(const float raw[XYZ]) {
DELTA_RAW_IK();
DELTA_IK(raw);
// DELTA_DEBUG();
}

18
Marlin/src/module/delta.h

@ -76,17 +76,17 @@ void recalc_delta_settings();
#endif
// Macro to obtain the Z position of an individual tower
#define DELTA_Z(T) raw[Z_AXIS] + _SQRT( \
delta_diagonal_rod_2_tower[T] - HYPOT2( \
delta_tower[T][X_AXIS] - raw[X_AXIS], \
delta_tower[T][Y_AXIS] - raw[Y_AXIS] \
) \
#define DELTA_Z(V,T) V[Z_AXIS] + _SQRT( \
delta_diagonal_rod_2_tower[T] - HYPOT2( \
delta_tower[T][X_AXIS] - V[X_AXIS], \
delta_tower[T][Y_AXIS] - V[Y_AXIS] \
) \
)
#define DELTA_RAW_IK() do { \
delta[A_AXIS] = DELTA_Z(A_AXIS); \
delta[B_AXIS] = DELTA_Z(B_AXIS); \
delta[C_AXIS] = DELTA_Z(C_AXIS); \
#define DELTA_IK(V) do { \
delta[A_AXIS] = DELTA_Z(V, A_AXIS); \
delta[B_AXIS] = DELTA_Z(V, B_AXIS); \
delta[C_AXIS] = DELTA_Z(V, C_AXIS); \
}while(0)
void inverse_kinematics(const float raw[XYZ]);

2
Marlin/src/module/motion.cpp

@ -613,7 +613,7 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
LOOP_XYZE(i) raw[i] += segment_distance[i];
#if ENABLED(DELTA)
DELTA_RAW_IK(); // Delta can inline its kinematics
DELTA_IK(raw); // Delta can inline its kinematics
#else
inverse_kinematics(raw);
#endif

Loading…
Cancel
Save