Browse Source

Account for DELTA in Planner::refresh_positioning

pull/1/head
Scott Lahteine 9 years ago
parent
commit
844a4e799e
  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]); 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]);

4
Marlin/Marlin_main.cpp

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

7
Marlin/planner.cpp

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

Loading…
Cancel
Save