Browse Source

Merge pull request #4464 from thinkyhead/rc_fix_steps_per_mm_handling

Account for DELTA in Planner::refresh_positioning
pull/1/head
Scott Lahteine 8 years ago
committed by GitHub
parent
commit
c68ca95345
  1. 1
      Marlin/Marlin.h
  2. 4
      Marlin/Marlin_main.cpp
  3. 7
      Marlin/planner.cpp

1
Marlin/Marlin.h

@ -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]);

4
Marlin/Marlin_main.cpp

@ -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

7
Marlin/planner.cpp

@ -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];
set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
#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();
}

Loading…
Cancel
Save