|
@@ -1201,7 +1201,8 @@ void Planner::buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, float fr_mm_s, co
|
1201
|
1201
|
} // buffer_line()
|
1202
|
1202
|
|
1203
|
1203
|
/**
|
1204
|
|
- * Directly set the planner XYZ position (hence the stepper positions).
|
|
1204
|
+ * Directly set the planner XYZ position (and stepper positions)
|
|
1205
|
+ * converting mm (or angles for SCARA) into steps.
|
1205
|
1206
|
*
|
1206
|
1207
|
* On CORE machines stepper ABC will be translated from the given XYZ.
|
1207
|
1208
|
*/
|
|
@@ -1229,12 +1230,12 @@ void Planner::sync_from_steppers() {
|
1229
|
1230
|
}
|
1230
|
1231
|
|
1231
|
1232
|
/**
|
1232
|
|
- * Directly set the planner E position (hence the stepper E position).
|
|
1233
|
+ * Setters for planner position (also setting stepper position).
|
1233
|
1234
|
*/
|
1234
|
|
-void Planner::set_e_position_mm(const float& e) {
|
1235
|
|
- position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]);
|
1236
|
|
- stepper.set_e_position(position[E_AXIS]);
|
1237
|
|
- previous_speed[E_AXIS] = 0.0;
|
|
1235
|
+void Planner::set_position_mm(const AxisEnum axis, const float& v) {
|
|
1236
|
+ position[axis] = lround(v * axis_steps_per_mm[axis]);
|
|
1237
|
+ stepper.set_position(axis, v);
|
|
1238
|
+ previous_speed[axis] = 0.0;
|
1238
|
1239
|
}
|
1239
|
1240
|
|
1240
|
1241
|
// Recalculate the steps/s^2 acceleration rates, based on the mm/s^2
|