Fix max acceleration limits in planner

The max acceleration limiting was in wrong place.
This commit is contained in:
alexborro 2015-03-11 15:07:35 -03:00
parent c7067edddf
commit c0b6075f77

View file

@ -915,6 +915,7 @@ Having the real displacement of the head, we can calculate the total movement le
else
{
block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
}
// Limit acceleration per axis
if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > axis_steps_per_sqr_second[X_AXIS])
block->acceleration_st = axis_steps_per_sqr_second[X_AXIS];
@ -924,7 +925,7 @@ Having the real displacement of the head, we can calculate the total movement le
block->acceleration_st = axis_steps_per_sqr_second[E_AXIS];
if(((float)block->acceleration_st * (float)block->steps_z / (float)block->step_event_count ) > axis_steps_per_sqr_second[Z_AXIS])
block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
}
block->acceleration = block->acceleration_st / steps_per_mm;
block->acceleration_rate = (long)((float)block->acceleration_st * (16777216.0 / (F_CPU / 8.0)));