aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/__init__.py
diff options
context:
space:
mode:
authorDmitry Butyugin <dmbutyugin@google.com>2020-07-06 02:54:38 +0200
committerGitHub <noreply@github.com>2020-07-05 20:54:38 -0400
commit4bdc11a8b3843b73079a2c8dfc8d8c0928c29662 (patch)
treee75986fe8573bda848f60f94af2b43f8c3553779 /klippy/chelper/__init__.py
parent09a3d018a895ac7ea80ada4c16a212b795375c26 (diff)
downloadkutter-4bdc11a8b3843b73079a2c8dfc8d8c0928c29662.tar.gz
kutter-4bdc11a8b3843b73079a2c8dfc8d8c0928c29662.tar.xz
kutter-4bdc11a8b3843b73079a2c8dfc8d8c0928c29662.zip
input_shaper: Initial support of input shaping (#3032)
Input shaping can help to reduce printer vibrations due to resonances and eliminate or reduce ghosting in prints. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Diffstat (limited to 'klippy/chelper/__init__.py')
-rw-r--r--klippy/chelper/__init__.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/klippy/chelper/__init__.py b/klippy/chelper/__init__.py
index 1a4b2d74..d87c0b31 100644
--- a/klippy/chelper/__init__.py
+++ b/klippy/chelper/__init__.py
@@ -17,7 +17,7 @@ COMPILE_CMD = ("gcc -Wall -g -O2 -shared -fPIC"
SOURCE_FILES = [
'pyhelper.c', 'serialqueue.c', 'stepcompress.c', 'itersolve.c', 'trapq.c',
'kin_cartesian.c', 'kin_corexy.c', 'kin_delta.c', 'kin_polar.c',
- 'kin_rotary_delta.c', 'kin_winch.c', 'kin_extruder.c',
+ 'kin_rotary_delta.c', 'kin_winch.c', 'kin_extruder.c', 'kin_shaper.c',
]
DEST_LIB = "c_helper.so"
OTHER_FILES = [
@@ -104,6 +104,27 @@ defs_kin_extruder = """
, double smooth_time);
"""
+defs_kin_shaper = """
+ enum INPUT_SHAPER_TYPE {
+ INPUT_SHAPER_ZV = 0,
+ INPUT_SHAPER_ZVD = 1,
+ INPUT_SHAPER_MZV = 2,
+ INPUT_SHAPER_EI = 3,
+ INPUT_SHAPER_2HUMP_EI = 4,
+ INPUT_SHAPER_3HUMP_EI = 5,
+ };
+
+ double input_shaper_get_step_generation_window(int shaper_type
+ , double shaper_freq, double damping_ratio);
+ int input_shaper_set_shaper_params(struct stepper_kinematics *sk
+ , int shaper_type_x, int shaper_type_y
+ , double shaper_freq_x, double shaper_freq_y
+ , double damping_ratio_x, double damping_ratio_y);
+ int input_shaper_set_sk(struct stepper_kinematics *sk
+ , struct stepper_kinematics *orig_sk);
+ struct stepper_kinematics * input_shaper_alloc(void);
+"""
+
defs_serialqueue = """
#define MESSAGE_MAX 64
struct pull_queue_message {
@@ -147,7 +168,8 @@ defs_all = [
defs_pyhelper, defs_serialqueue, defs_std,
defs_stepcompress, defs_itersolve, defs_trapq,
defs_kin_cartesian, defs_kin_corexy, defs_kin_delta, defs_kin_polar,
- defs_kin_rotary_delta, defs_kin_winch, defs_kin_extruder
+ defs_kin_rotary_delta, defs_kin_winch, defs_kin_extruder,
+ defs_kin_shaper,
]
# Return the list of file modification times