|
@@ -81,7 +81,7 @@ volatile uint8_t Planner::block_buffer_head = 0; // Index of the next
|
81
|
81
|
volatile uint8_t Planner::block_buffer_tail = 0;
|
82
|
82
|
|
83
|
83
|
float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
|
84
|
|
-float Planner::axis_steps_per_unit[NUM_AXIS];
|
|
84
|
+float Planner::axis_steps_per_mm[NUM_AXIS];
|
85
|
85
|
unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS];
|
86
|
86
|
unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
|
87
|
87
|
|
|
@@ -549,10 +549,10 @@ void Planner::check_axes_activity() {
|
549
|
549
|
// Calculate target position in absolute steps
|
550
|
550
|
//this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow
|
551
|
551
|
long target[NUM_AXIS] = {
|
552
|
|
- lround(x * axis_steps_per_unit[X_AXIS]),
|
553
|
|
- lround(y * axis_steps_per_unit[Y_AXIS]),
|
554
|
|
- lround(z * axis_steps_per_unit[Z_AXIS]),
|
555
|
|
- lround(e * axis_steps_per_unit[E_AXIS])
|
|
552
|
+ lround(x * axis_steps_per_mm[X_AXIS]),
|
|
553
|
+ lround(y * axis_steps_per_mm[Y_AXIS]),
|
|
554
|
+ lround(z * axis_steps_per_mm[Z_AXIS]),
|
|
555
|
+ lround(e * axis_steps_per_mm[E_AXIS])
|
556
|
556
|
};
|
557
|
557
|
|
558
|
558
|
long dx = target[X_AXIS] - position[X_AXIS],
|
|
@@ -574,7 +574,7 @@ void Planner::check_axes_activity() {
|
574
|
574
|
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
|
575
|
575
|
}
|
576
|
576
|
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
|
577
|
|
- if (labs(de) > axis_steps_per_unit[E_AXIS] * (EXTRUDE_MAXLENGTH)) {
|
|
577
|
+ if (labs(de) > axis_steps_per_mm[E_AXIS] * (EXTRUDE_MAXLENGTH)) {
|
578
|
578
|
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
|
579
|
579
|
de = 0; // no difference
|
580
|
580
|
SERIAL_ECHO_START;
|
|
@@ -771,31 +771,31 @@ void Planner::check_axes_activity() {
|
771
|
771
|
#if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
|
772
|
772
|
float delta_mm[6];
|
773
|
773
|
#if ENABLED(COREXY)
|
774
|
|
- delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
|
775
|
|
- delta_mm[Y_HEAD] = dy / axis_steps_per_unit[B_AXIS];
|
776
|
|
- delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
|
777
|
|
- delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_unit[A_AXIS];
|
778
|
|
- delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_unit[B_AXIS];
|
|
774
|
+ delta_mm[X_HEAD] = dx / axis_steps_per_mm[A_AXIS];
|
|
775
|
+ delta_mm[Y_HEAD] = dy / axis_steps_per_mm[B_AXIS];
|
|
776
|
+ delta_mm[Z_AXIS] = dz / axis_steps_per_mm[Z_AXIS];
|
|
777
|
+ delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_mm[A_AXIS];
|
|
778
|
+ delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_mm[B_AXIS];
|
779
|
779
|
#elif ENABLED(COREXZ)
|
780
|
|
- delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
|
781
|
|
- delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
|
782
|
|
- delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS];
|
783
|
|
- delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_unit[A_AXIS];
|
784
|
|
- delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_unit[C_AXIS];
|
|
780
|
+ delta_mm[X_HEAD] = dx / axis_steps_per_mm[A_AXIS];
|
|
781
|
+ delta_mm[Y_AXIS] = dy / axis_steps_per_mm[Y_AXIS];
|
|
782
|
+ delta_mm[Z_HEAD] = dz / axis_steps_per_mm[C_AXIS];
|
|
783
|
+ delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_mm[A_AXIS];
|
|
784
|
+ delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_mm[C_AXIS];
|
785
|
785
|
#elif ENABLED(COREYZ)
|
786
|
|
- delta_mm[X_AXIS] = dx / axis_steps_per_unit[A_AXIS];
|
787
|
|
- delta_mm[Y_HEAD] = dy / axis_steps_per_unit[Y_AXIS];
|
788
|
|
- delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS];
|
789
|
|
- delta_mm[B_AXIS] = (dy + dz) / axis_steps_per_unit[B_AXIS];
|
790
|
|
- delta_mm[C_AXIS] = (dy - dz) / axis_steps_per_unit[C_AXIS];
|
|
786
|
+ delta_mm[X_AXIS] = dx / axis_steps_per_mm[A_AXIS];
|
|
787
|
+ delta_mm[Y_HEAD] = dy / axis_steps_per_mm[Y_AXIS];
|
|
788
|
+ delta_mm[Z_HEAD] = dz / axis_steps_per_mm[C_AXIS];
|
|
789
|
+ delta_mm[B_AXIS] = (dy + dz) / axis_steps_per_mm[B_AXIS];
|
|
790
|
+ delta_mm[C_AXIS] = (dy - dz) / axis_steps_per_mm[C_AXIS];
|
791
|
791
|
#endif
|
792
|
792
|
#else
|
793
|
793
|
float delta_mm[4];
|
794
|
|
- delta_mm[X_AXIS] = dx / axis_steps_per_unit[X_AXIS];
|
795
|
|
- delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
|
796
|
|
- delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
|
|
794
|
+ delta_mm[X_AXIS] = dx / axis_steps_per_mm[X_AXIS];
|
|
795
|
+ delta_mm[Y_AXIS] = dy / axis_steps_per_mm[Y_AXIS];
|
|
796
|
+ delta_mm[Z_AXIS] = dz / axis_steps_per_mm[Z_AXIS];
|
797
|
797
|
#endif
|
798
|
|
- delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0;
|
|
798
|
+ delta_mm[E_AXIS] = (de / axis_steps_per_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0;
|
799
|
799
|
|
800
|
800
|
if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) {
|
801
|
801
|
block->millimeters = fabs(delta_mm[E_AXIS]);
|
|
@@ -1127,10 +1127,10 @@ void Planner::check_axes_activity() {
|
1127
|
1127
|
apply_rotation_xyz(bed_level_matrix, x, y, z);
|
1128
|
1128
|
#endif
|
1129
|
1129
|
|
1130
|
|
- long nx = position[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]),
|
1131
|
|
- ny = position[Y_AXIS] = lround(y * axis_steps_per_unit[Y_AXIS]),
|
1132
|
|
- nz = position[Z_AXIS] = lround(z * axis_steps_per_unit[Z_AXIS]),
|
1133
|
|
- ne = position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]);
|
|
1130
|
+ long nx = position[X_AXIS] = lround(x * axis_steps_per_mm[X_AXIS]),
|
|
1131
|
+ ny = position[Y_AXIS] = lround(y * axis_steps_per_mm[Y_AXIS]),
|
|
1132
|
+ nz = position[Z_AXIS] = lround(z * axis_steps_per_mm[Z_AXIS]),
|
|
1133
|
+ ne = position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]);
|
1134
|
1134
|
stepper.set_position(nx, ny, nz, ne);
|
1135
|
1135
|
previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
|
1136
|
1136
|
|
|
@@ -1141,14 +1141,14 @@ void Planner::check_axes_activity() {
|
1141
|
1141
|
* Directly set the planner E position (hence the stepper E position).
|
1142
|
1142
|
*/
|
1143
|
1143
|
void Planner::set_e_position_mm(const float& e) {
|
1144
|
|
- position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]);
|
|
1144
|
+ position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]);
|
1145
|
1145
|
stepper.set_e_position(position[E_AXIS]);
|
1146
|
1146
|
}
|
1147
|
1147
|
|
1148
|
1148
|
// Recalculate the steps/s^2 acceleration rates, based on the mm/s^2
|
1149
|
1149
|
void Planner::reset_acceleration_rates() {
|
1150
|
1150
|
for (int i = 0; i < NUM_AXIS; i++)
|
1151
|
|
- max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_unit[i];
|
|
1151
|
+ max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_mm[i];
|
1152
|
1152
|
}
|
1153
|
1153
|
|
1154
|
1154
|
#if ENABLED(AUTOTEMP)
|