|
@@ -931,18 +931,18 @@ float junction_deviation = 0.1;
|
931
|
931
|
float safe_speed = vmax_junction;
|
932
|
932
|
|
933
|
933
|
if ((moves_queued > 1) && (previous_nominal_speed > 0.0001)) {
|
934
|
|
- float dx = current_speed[X_AXIS] - previous_speed[X_AXIS],
|
935
|
|
- dy = current_speed[Y_AXIS] - previous_speed[Y_AXIS],
|
936
|
|
- dz = fabs(csz - previous_speed[Z_AXIS]),
|
937
|
|
- de = fabs(cse - previous_speed[E_AXIS]),
|
938
|
|
- jerk = sqrt(dx * dx + dy * dy);
|
|
934
|
+ float dsx = current_speed[X_AXIS] - previous_speed[X_AXIS],
|
|
935
|
+ dsy = current_speed[Y_AXIS] - previous_speed[Y_AXIS],
|
|
936
|
+ dsz = fabs(csz - previous_speed[Z_AXIS]),
|
|
937
|
+ dse = fabs(cse - previous_speed[E_AXIS]),
|
|
938
|
+ jerk = sqrt(dsx * dsx + dsy * dsy);
|
939
|
939
|
|
940
|
940
|
// if ((fabs(previous_speed[X_AXIS]) > 0.0001) || (fabs(previous_speed[Y_AXIS]) > 0.0001)) {
|
941
|
941
|
vmax_junction = block->nominal_speed;
|
942
|
942
|
// }
|
943
|
943
|
if (jerk > max_xy_jerk) vmax_junction_factor = max_xy_jerk / jerk;
|
944
|
|
- if (dz > max_z_jerk) vmax_junction_factor = min(vmax_junction_factor, max_z_jerk / dz);
|
945
|
|
- if (de > max_e_jerk) vmax_junction_factor = min(vmax_junction_factor, max_e_jerk / de);
|
|
944
|
+ if (dsz > max_z_jerk) vmax_junction_factor = min(vmax_junction_factor, max_z_jerk / dsz);
|
|
945
|
+ if (dse > max_e_jerk) vmax_junction_factor = min(vmax_junction_factor, max_e_jerk / dse);
|
946
|
946
|
|
947
|
947
|
vmax_junction = min(previous_nominal_speed, vmax_junction * vmax_junction_factor); // Limit speed to max previous speed
|
948
|
948
|
}
|