1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Merge pull request #4464 from thinkyhead/rc_fix_steps_per_mm_handling

Account for DELTA in Planner::refresh_positioning
This commit is contained in:
Scott Lahteine 2016-07-29 19:34:59 -07:00 committed by GitHub
commit c68ca95345
3 changed files with 9 additions and 3 deletions

View File

@ -314,6 +314,7 @@ float code_value_temp_diff();
void adjust_delta(float cartesian[3]);
#endif
#elif ENABLED(SCARA)
extern float delta[3];
extern float axis_scaling[3]; // Build size scaling
void inverse_kinematics(const float cartesian[3]);
void forward_kinematics_SCARA(float f_scara[3]);

View File

@ -456,7 +456,7 @@ static uint8_t target_extruder;
#define TOWER_2 Y_AXIS
#define TOWER_3 Z_AXIS
float delta[3] = { 0 };
float delta[3];
float cartesian_position[3] = { 0 };
#define SIN_60 0.8660254037844386
#define COS_60 0.5
@ -489,7 +489,7 @@ static uint8_t target_extruder;
#if ENABLED(SCARA)
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
#endif

View File

@ -1183,7 +1183,12 @@ void Planner::reset_acceleration_rates() {
// Recalculate position, steps_to_mm if axis_steps_per_mm changes!
void Planner::refresh_positioning() {
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]);
#endif
reset_acceleration_rates();
}