aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper
diff options
context:
space:
mode:
authorDmitry Butyugin <dmbutyugin@google.com>2023-04-16 00:31:45 +0200
committerKevinOConnor <kevin@koconnor.net>2023-06-06 20:17:49 -0400
commite15bad484403b1ef8a9b0ffc2abe6b092fd3c3f6 (patch)
tree5e98e88c832312d483bf29c723c008a98e33041f /klippy/chelper
parent345934bd681caf11a52810291d9255d6987c6e7a (diff)
downloadkutter-e15bad484403b1ef8a9b0ffc2abe6b092fd3c3f6.tar.gz
kutter-e15bad484403b1ef8a9b0ffc2abe6b092fd3c3f6.tar.xz
kutter-e15bad484403b1ef8a9b0ffc2abe6b092fd3c3f6.zip
input_shaper: Fixed tracking of step_generation_scan_time
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Diffstat (limited to 'klippy/chelper')
-rw-r--r--klippy/chelper/__init__.py4
-rw-r--r--klippy/chelper/kin_shaper.c13
2 files changed, 6 insertions, 11 deletions
diff --git a/klippy/chelper/__init__.py b/klippy/chelper/__init__.py
index 6166363e..8183fd62 100644
--- a/klippy/chelper/__init__.py
+++ b/klippy/chelper/__init__.py
@@ -144,8 +144,8 @@ defs_kin_extruder = """
"""
defs_kin_shaper = """
- double input_shaper_get_step_generation_window(int n, double a[]
- , double t[]);
+ double input_shaper_get_step_generation_window(
+ struct stepper_kinematics *sk);
int input_shaper_set_shaper_params(struct stepper_kinematics *sk, char axis
, int n, double a[], double t[]);
int input_shaper_set_sk(struct stepper_kinematics *sk
diff --git a/klippy/chelper/kin_shaper.c b/klippy/chelper/kin_shaper.c
index 133f46a9..dd9cf619 100644
--- a/klippy/chelper/kin_shaper.c
+++ b/klippy/chelper/kin_shaper.c
@@ -210,16 +210,11 @@ input_shaper_set_shaper_params(struct stepper_kinematics *sk, char axis
}
double __visible
-input_shaper_get_step_generation_window(int n, double a[], double t[])
+input_shaper_get_step_generation_window(struct stepper_kinematics *sk)
{
- struct shaper_pulses sp;
- init_shaper(n, a, t, &sp);
- if (!sp.num_pulses)
- return 0.;
- double window = -sp.pulses[0].t;
- if (sp.pulses[sp.num_pulses-1].t > window)
- window = sp.pulses[sp.num_pulses-1].t;
- return window;
+ struct input_shaper *is = container_of(sk, struct input_shaper, sk);
+ return is->sk.gen_steps_pre_active > is->sk.gen_steps_post_active
+ ? is->sk.gen_steps_pre_active : is->sk.gen_steps_post_active;
}
struct stepper_kinematics * __visible