Delta support for multiple hotends with offsets (#10118)

This commit is contained in:
Scott Lahteine
2018-03-16 00:46:42 -05:00
committed by GitHub
parent 899b4df7a3
commit a6feb58837
7 changed files with 46 additions and 15 deletions

View File

@@ -115,18 +115,29 @@ void recalc_delta_settings() {
}
#endif
#define DELTA_DEBUG() do { \
SERIAL_ECHOPAIR("cartesian X:", raw[X_AXIS]); \
SERIAL_ECHOPAIR(" Y:", raw[Y_AXIS]); \
SERIAL_ECHOLNPAIR(" Z:", raw[Z_AXIS]); \
#define DELTA_DEBUG(VAR) do { \
SERIAL_ECHOPAIR("cartesian X:", VAR[X_AXIS]); \
SERIAL_ECHOPAIR(" Y:", VAR[Y_AXIS]); \
SERIAL_ECHOLNPAIR(" Z:", VAR[Z_AXIS]); \
SERIAL_ECHOPAIR("delta A:", delta[A_AXIS]); \
SERIAL_ECHOPAIR(" B:", delta[B_AXIS]); \
SERIAL_ECHOLNPAIR(" C:", delta[C_AXIS]); \
}while(0)
void inverse_kinematics(const float raw[XYZ]) {
DELTA_IK(raw);
// DELTA_DEBUG();
#if HOTENDS > 1
// Delta hotend offsets must be applied in Cartesian space with no "spoofing"
const float pos[XYZ] = {
raw[X_AXIS] - hotend_offset[X_AXIS][active_extruder],
raw[Y_AXIS] - hotend_offset[Y_AXIS][active_extruder],
raw[Z_AXIS]
};
DELTA_IK(pos);
//DELTA_DEBUG(pos);
#else
DELTA_IK(raw);
//DELTA_DEBUG(raw);
#endif
}
/**
@@ -136,10 +147,10 @@ void inverse_kinematics(const float raw[XYZ]) {
float delta_safe_distance_from_top() {
float cartesian[XYZ] = { 0, 0, 0 };
inverse_kinematics(cartesian);
float distance = delta[A_AXIS];
float centered_extent = delta[A_AXIS];
cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS;
inverse_kinematics(cartesian);
return FABS(distance - delta[A_AXIS]);
return FABS(centered_extent - delta[A_AXIS]);
}
/**