# Planner module configuration : Look-ahead and acceleration configuration
planner_queue_size 32 # DO NOT CHANGE THIS UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING
acceleration 3000 # Acceleration in mm/second/second.
-#z_acceleration 500 # Acceleration for Z only moves in mm/s^2, 0 disables it, disabled by default. DO NOT SET ON A DELTA
+#z_acceleration 500 # Acceleration for Z only moves in mm/s^2, 0 uses acceleration which is the default. DO NOT SET ON A DELTA
acceleration_ticks_per_second 1000 # Number of times per second the speed is updated
junction_deviation 0.05 # Similar to the old "max_jerk", in millimeters,
- # see https://github.com/grbl/grbl/blob/master/planner.c#L409
+ # see https://github.com/grbl/grbl/blob/master/planner.c
# and https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.8
# Lower values mean being more careful, higher values means being
# faster and have more jerk
+#z_junction_deviation 0.0 # for Z only moves, -1 uses junction_deviation, zero disables junction_deviation on z moves DO NOT SET ON A DELTA
#minimum_planner_speed 0.0 # sets the minimum planner speed in mm/sec
# Stepper module configuration
#define z_acceleration_checksum CHECKSUM("z_acceleration")
#define max_jerk_checksum CHECKSUM("max_jerk")
#define junction_deviation_checksum CHECKSUM("junction_deviation")
+#define z_junction_deviation_checksum CHECKSUM("z_junction_deviation")
#define minimum_planner_speed_checksum CHECKSUM("minimum_planner_speed")
// The Planner does the acceleration math for the queue of Blocks ( movements ).
this->acceleration = THEKERNEL->config->value(acceleration_checksum)->by_default(100.0F )->as_number(); // Acceleration is in mm/s^2
this->z_acceleration = THEKERNEL->config->value(z_acceleration_checksum)->by_default(0.0F )->as_number(); // disabled by default
- this->junction_deviation = THEKERNEL->config->value(junction_deviation_checksum)->by_default( 0.05F)->as_number();
+ this->junction_deviation = THEKERNEL->config->value(junction_deviation_checksum)->by_default(0.05F)->as_number();
+ this->z_junction_deviation = THEKERNEL->config->value(z_junction_deviation_checksum)->by_default(-1)->as_number(); // disabled by default
this->minimum_planner_speed = THEKERNEL->config->value(minimum_planner_speed_checksum)->by_default(0.0f)->as_number();
}
// Append a block to the queue, compute it's speed factors
void Planner::append_block( float actuator_pos[], float rate_mm_s, float distance, float unit_vec[] )
{
- float acceleration;
+ float acceleration, junction_deviation;
// Create ( recycle ) a new block
Block* block = THEKERNEL->conveyor->queue.head_ref();
block->steps[i] = labs(steps);
}
+ acceleration= this->acceleration;
+ junction_deviation= this->junction_deviation;
+
// use either regular acceleration or a z only move accleration
- if(this->z_acceleration > 0.0F && block->steps[ALPHA_STEPPER] == 0 && block->steps[BETA_STEPPER] == 0) {
+ if(block->steps[ALPHA_STEPPER] == 0 && block->steps[BETA_STEPPER] == 0) {
// z only move
- acceleration= this->z_acceleration;
- } else{
- acceleration= this->acceleration;
+ if(this->z_acceleration > 0.0F) acceleration= this->z_acceleration;
+ if(this->z_junction_deviation >= 0.0F) junction_deviation= this->z_junction_deviation;
}
// Max number of steps, for all axes
{
float previous_nominal_speed = THEKERNEL->conveyor->queue.item_ref(THEKERNEL->conveyor->queue.prev(THEKERNEL->conveyor->queue.head_i))->nominal_speed;
- if (previous_nominal_speed > 0.0F) {
+ if (previous_nominal_speed > 0.0F && junction_deviation > 0.0F) {
// Compute cosine of angle between previous and current path. (prev_unit_vec is negative)
// NOTE: Max junction velocity is computed without sin() or acos() by trig half angle identity.
float cos_theta = - this->previous_unit_vec[X_AXIS] * unit_vec[X_AXIS]
if (cos_theta > -0.95F) {
// Compute maximum junction velocity based on maximum acceleration and junction deviation
float sin_theta_d2 = sqrtf(0.5F * (1.0F - cos_theta)); // Trig half angle identity. Always positive.
- vmax_junction = min(vmax_junction, sqrtf(acceleration * this->junction_deviation * sin_theta_d2 / (1.0F - sin_theta_d2)));
+ vmax_junction = min(vmax_junction, sqrtf(acceleration * junction_deviation * sin_theta_d2 / (1.0F - sin_theta_d2)));
}
}
}