Merge pull request #4464 from thinkyhead/rc_fix_steps_per_mm_handling
Account for DELTA in Planner::refresh_positioning
This commit is contained in:
commit
c68ca95345
3 changed files with 9 additions and 3 deletions
|
@ -314,6 +314,7 @@ float code_value_temp_diff();
|
||||||
void adjust_delta(float cartesian[3]);
|
void adjust_delta(float cartesian[3]);
|
||||||
#endif
|
#endif
|
||||||
#elif ENABLED(SCARA)
|
#elif ENABLED(SCARA)
|
||||||
|
extern float delta[3];
|
||||||
extern float axis_scaling[3]; // Build size scaling
|
extern float axis_scaling[3]; // Build size scaling
|
||||||
void inverse_kinematics(const float cartesian[3]);
|
void inverse_kinematics(const float cartesian[3]);
|
||||||
void forward_kinematics_SCARA(float f_scara[3]);
|
void forward_kinematics_SCARA(float f_scara[3]);
|
||||||
|
|
|
@ -456,7 +456,7 @@ static uint8_t target_extruder;
|
||||||
#define TOWER_2 Y_AXIS
|
#define TOWER_2 Y_AXIS
|
||||||
#define TOWER_3 Z_AXIS
|
#define TOWER_3 Z_AXIS
|
||||||
|
|
||||||
float delta[3] = { 0 };
|
float delta[3];
|
||||||
float cartesian_position[3] = { 0 };
|
float cartesian_position[3] = { 0 };
|
||||||
#define SIN_60 0.8660254037844386
|
#define SIN_60 0.8660254037844386
|
||||||
#define COS_60 0.5
|
#define COS_60 0.5
|
||||||
|
@ -489,7 +489,7 @@ static uint8_t target_extruder;
|
||||||
|
|
||||||
#if ENABLED(SCARA)
|
#if ENABLED(SCARA)
|
||||||
float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND;
|
float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND;
|
||||||
static float delta[3] = { 0 };
|
float delta[3];
|
||||||
float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1
|
float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1183,7 +1183,12 @@ void Planner::reset_acceleration_rates() {
|
||||||
// Recalculate position, steps_to_mm if axis_steps_per_mm changes!
|
// Recalculate position, steps_to_mm if axis_steps_per_mm changes!
|
||||||
void Planner::refresh_positioning() {
|
void Planner::refresh_positioning() {
|
||||||
LOOP_XYZE(i) planner.steps_to_mm[i] = 1.0 / planner.axis_steps_per_mm[i];
|
LOOP_XYZE(i) planner.steps_to_mm[i] = 1.0 / planner.axis_steps_per_mm[i];
|
||||||
|
#if ENABLED(DELTA) || ENABLED(SCARA)
|
||||||
|
inverse_kinematics(current_position);
|
||||||
|
set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
|
||||||
|
#else
|
||||||
set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
||||||
|
#endif
|
||||||
reset_acceleration_rates();
|
reset_acceleration_rates();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue