forked from zellneralex/klipper_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input_shaper.cfg
123 lines (117 loc) · 5.51 KB
/
input_shaper.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#####################################################################
# G Sensor definition
#####################################################################
[adxl345]
cs_pin: rpi:None
## The SPI speed (in hz) to use when communicating with the chip.
## The default is 5000000.
#spi_speed: 5000000
## Output data rate for ADXL345. ADXL345 supports the following data
## rates: 3200, 1600, 800, 400, 200, 100, 50, and 25. Note that it is
## not recommended to change this rate from the default 3200, and
## rates below 800 will considerably affect the quality of resonance
## measurements.
#rate: 3200
## The accelerometer axis for each of the printer's x, y, and z axes.
## This may be useful if the accelerometer is mounted in an
## orientation that does not match the printer orientation. For
## example, one could set this to "y,x,z" to swap the x and y axes.
## It is also possible to negate an axis if the accelerometer
## direction is reversed (eg, "x,z,-y"). The default is "x,y,z".
## receck
axes_map: x,y,z
#####################################################################
# resonance tester definition
#####################################################################
[resonance_tester]
accel_chip: adxl345
## A list of X,Y,Z coordinates of points (one point per line) to test
## resonances at. At least one point is required. Make sure that all
## points with some safety margin in XY plane (~a few centimeters)
## are reachable by the toolhead.
probe_points:
175,175,20
# 175,175,160
# 175,175,300
## Maximum input shaper smoothing to allow for each axis during shaper
## auto-calibration (with 'SHAPER_CALIBRATE' command). By default no
## maximum smoothing is specified. Refer to Measuring_Resonances guide
## for more details on using this feature.
#max_smoothing:
## Minimum/Maximum frequency to test for resonances.
min_freq: 5
max_freq: 133
## This parameter is used to determine which acceleration to use to
## test a specific frequency: accel = accel_per_hz * freq. Higher the
## value, the higher is the energy of the oscillations. Can be set to
## a lower than the default value if the resonances get too strong on
## the printer. However, lower values make measurements of
## high-frequency resonances less precise. The default value is 75
## (mm/sec).
accel_per_hz: 75
## Determines the speed of the test. When testing all frequencies in
## range [min_freq, max_freq], each second the frequency increases by
## hz_per_sec. Small values make the test slow, and the large values
## will decrease the precision of the test. The default value is 1.0
## (Hz/sec == sec^-2).
hz_per_sec: 1
#####################################################################
# input shaper definition
#####################################################################
[input_shaper]
## A frequency (in Hz) of the input shaper for X or Y axis.
shaper_freq_x: 61.4
shaper_freq_y: 43.4
## A type of the intput shaper for X or Y axia.
shaper_type_x: mzv
shaper_type_y: mzv
## Damping ratios of vibrations of X and Y axes used by input shapers
## to improve vibration suppression. Default value is 0.1 which is a
## good all-round value for most printers. In most circumstances this
## parameter requires no tuning and should not be changed.
#damping_ratio_x: 0.1
#damping_ratio_y: 0.1
#####################################################################
# Macros
#####################################################################
# !!! This macro only works with the use of gcode_shell_command.py !!!
# you find both needed files at /klipper_config/script
# - gcode_shell_command.py -> klipper add on file
# - plot_graph.sh -> shell script that is executed
#
# Setup:
# - symlink or copy gcode_shell_command.py to /klipper/klippy/extra
# e.g ln -s /home/pi/klipper_config/script/gcode_shell_command.py /home/pi/klipper/klippy/extras/gcode_shell_command.py
# - klipper service restart
#
# Please inspect the shell scrip by your own and use it by your own risk
# Functions:
# - Remove _old files if exists
# - rename the current files to _old
# - copy current cvs files from /tmp to the specified folder
# - run the calibrate_shaper.py to generate the graphs and store them at the same location
#####################################################################
[gcode_macro RESONANCES_TEST]
description: Run input shaper test
gcode:
##### get hardware enables #####
{% set hw_ena = printer['gcode_macro _USER_VARIABLE'].hw_ena %}
## TEST_RESONANCES will set the accel and accel_to decel
_CG28 ; home if needed
TURN_OFF_HEATERS ; turn off heaters
M107 ; turn off fan
{% if hw_ena.chamber == 'fan' %} M141 {% endif %} ; exhaust fan off
{% if hw_ena.filter == 'true' %} _SET_FILTER {% endif %} ; filter off
_PRINT_AR T="INPUT SHAPER: Noise values, check if sensor is installed"
MEASURE_AXES_NOISE ; get noise value in log
_PRINT_AR T="INPUT SHAPER: Resonance Tests starting ..."
TEST_RESONANCES AXIS=X ; measure X
TEST_RESONANCES AXIS=Y ; measure Y
_PRINT_AR T="INPUT SHAPER: Resonance Tests done"
_PRINT_AR T="INPUT SHAPER: Generate graph in backround"
RUN_SHELL_COMMAND CMD=plot_graph
## Shell Comand is not supported by a default klipper installation
[gcode_shell_command plot_graph]
command: sh /home/pi/klipper_config/script/plot_graph.sh
timeout: 30.
verbose: True