diff --git a/klippy/chelper/itersolve.c b/klippy/chelper/itersolve.c index b7119fa5..807ca190 100644 --- a/klippy/chelper/itersolve.c +++ b/klippy/chelper/itersolve.c @@ -152,7 +152,7 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time) struct move *m = list_first_entry(&sk->tq->moves, struct move, node); while (last_flush_time >= m->print_time + m->move_t) m = list_next_entry(m, node); - double force_steps_time = sk->last_move_time + sk->scan_past; + double force_steps_time = sk->last_move_time + sk->gen_steps_post_active; for (;;) { if (last_flush_time >= flush_time) return 0; @@ -162,11 +162,11 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time) if (end > flush_time) end = flush_time; if (check_active(sk, m)) { - if (sk->scan_future && start > last_flush_time) { + if (sk->gen_steps_pre_active && start > last_flush_time) { // Must generate steps leading up to stepper activity force_steps_time = start; - if (last_flush_time < start - sk->scan_future) - last_flush_time = start - sk->scan_future; + if (last_flush_time < start - sk->gen_steps_pre_active) + last_flush_time = start - sk->gen_steps_pre_active; while (m->print_time > last_flush_time) m = list_prev_entry(m, node); continue; @@ -176,7 +176,7 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time) if (ret) return ret; sk->last_move_time = last_flush_time = end; - force_steps_time = end + sk->scan_past; + force_steps_time = end + sk->gen_steps_post_active; } else if (start < force_steps_time) { // Must generates steps just past stepper activity if (end > force_steps_time) @@ -186,7 +186,7 @@ itersolve_generate_steps(struct stepper_kinematics *sk, double flush_time) return ret; last_flush_time = end; } - if (flush_time + sk->scan_future <= m->print_time + m->move_t) + if (flush_time + sk->gen_steps_pre_active <= m->print_time + m->move_t) return 0; m = list_next_entry(m, node); } diff --git a/klippy/chelper/itersolve.h b/klippy/chelper/itersolve.h index b7ab771a..c4061396 100644 --- a/klippy/chelper/itersolve.h +++ b/klippy/chelper/itersolve.h @@ -4,7 +4,7 @@ #include // int32_t enum { - AF_X = 1 << 0, AF_Y = 1 << 1, AF_Z = 1 <<2, + AF_X = 1 << 0, AF_Y = 1 << 1, AF_Z = 1 << 2, }; struct stepper_kinematics; @@ -17,9 +17,9 @@ struct stepper_kinematics { struct stepcompress *sc; double last_flush_time, last_move_time; - double scan_past, scan_future; struct trapq *tq; int active_flags; + double gen_steps_pre_active, gen_steps_post_active; sk_calc_callback calc_position_cb; sk_post_callback post_cb; diff --git a/klippy/chelper/kin_extruder.c b/klippy/chelper/kin_extruder.c index 41c30c90..d630f7dd 100644 --- a/klippy/chelper/kin_extruder.c +++ b/klippy/chelper/kin_extruder.c @@ -82,7 +82,8 @@ extruder_set_smooth_time(struct stepper_kinematics *sk, double smooth_time) { struct extruder_stepper *es = container_of(sk, struct extruder_stepper, sk); double hst = smooth_time * .5; - es->sk.scan_past = es->sk.scan_future = es->half_smooth_time = hst; + es->half_smooth_time = hst; + es->sk.gen_steps_pre_active = es->sk.gen_steps_post_active = hst; if (! hst) return; es->inv_smooth_time = 1. / smooth_time;