|
@@ -915,16 +915,17 @@ Having the real displacement of the head, we can calculate the total movement le
|
915
|
915
|
else
|
916
|
916
|
{
|
917
|
917
|
block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
|
918
|
|
- // Limit acceleration per axis
|
919
|
|
- if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > axis_steps_per_sqr_second[X_AXIS])
|
920
|
|
- block->acceleration_st = axis_steps_per_sqr_second[X_AXIS];
|
921
|
|
- if(((float)block->acceleration_st * (float)block->steps_y / (float)block->step_event_count) > axis_steps_per_sqr_second[Y_AXIS])
|
922
|
|
- block->acceleration_st = axis_steps_per_sqr_second[Y_AXIS];
|
923
|
|
- if(((float)block->acceleration_st * (float)block->steps_e / (float)block->step_event_count) > axis_steps_per_sqr_second[E_AXIS])
|
924
|
|
- block->acceleration_st = axis_steps_per_sqr_second[E_AXIS];
|
925
|
|
- if(((float)block->acceleration_st * (float)block->steps_z / (float)block->step_event_count ) > axis_steps_per_sqr_second[Z_AXIS])
|
926
|
|
- block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
|
927
|
918
|
}
|
|
919
|
+ // Limit acceleration per axis
|
|
920
|
+ if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > axis_steps_per_sqr_second[X_AXIS])
|
|
921
|
+ block->acceleration_st = axis_steps_per_sqr_second[X_AXIS];
|
|
922
|
+ if(((float)block->acceleration_st * (float)block->steps_y / (float)block->step_event_count) > axis_steps_per_sqr_second[Y_AXIS])
|
|
923
|
+ block->acceleration_st = axis_steps_per_sqr_second[Y_AXIS];
|
|
924
|
+ if(((float)block->acceleration_st * (float)block->steps_e / (float)block->step_event_count) > axis_steps_per_sqr_second[E_AXIS])
|
|
925
|
+ block->acceleration_st = axis_steps_per_sqr_second[E_AXIS];
|
|
926
|
+ if(((float)block->acceleration_st * (float)block->steps_z / (float)block->step_event_count ) > axis_steps_per_sqr_second[Z_AXIS])
|
|
927
|
+ block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
|
|
928
|
+
|
928
|
929
|
block->acceleration = block->acceleration_st / steps_per_mm;
|
929
|
930
|
block->acceleration_rate = (long)((float)block->acceleration_st * (16777216.0 / (F_CPU / 8.0)));
|
930
|
931
|
|