-
Notifications
You must be signed in to change notification settings - Fork 0
/
input_shaper.cfg
143 lines (136 loc) · 6.08 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#####################################################################
# G Sensor definition
#####################################################################
[adxl345]
cs_pin: SPI3_CS
spi_bus: spi1a
#spi3
## 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: y,x,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:
90,90,20
# 150,150,200
# 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: 200
## 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: 125
## 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_type_x: mzv
shaper_freq_x: 92.4
shaper_type_y: mzv
shaper_freq_y: 81.8
## A type of the intput shaper for X or Y axia.
## 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:
_CG28 ; home if needed
TURN_OFF_HEATERS ; turn off heaters
M107 ; turn off fan
# M141 S0 ; exhaust fan off
# _SET_FILTER S=0.0 ; 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"
_PRINT_AR T="INPUT SHAPER: Mesasure X axis"
TEST_RESONANCES AXIS=X ; measure X
_PRINT_AR T="INPUT SHAPER: Mesasure Y axis"
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 PARAMS=SHAPER
[gcode_macro BELT_TEST]
description: Run resonance test to analyze belts
gcode:
_CG28 ; home if needed
TURN_OFF_HEATERS ; turn off heaters
M107 ; turn off fan
# M141 S0 ; exhaust fan off
# _SET_FILTER S=0.0 ; filter off
_PRINT_AR T="BELT TEST: Noise values, check if sensor is installed"
MEASURE_AXES_NOISE ; get noise value in log
_PRINT_AR T="BELT TEST: Resonance Tests starting ..."
_PRINT_AR T="BELT TEST: Mesasure B belt"
TEST_RESONANCES AXIS=1,1 OUTPUT=raw_data NAME=b
_PRINT_AR T="BELT TEST: Mesasure A belt"
TEST_RESONANCES AXIS=1,-1 OUTPUT=raw_data NAME=a
_PRINT_AR T="BELT TEST: Resonance Tests done"
_PRINT_AR T="BELT TEST: Generate graph in backround"
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=BELT
[gcode_shell_command plot_graph]
command: bash /home/pi/klipper_config/scripts/plot_graphs.sh
timeout: 300.0
verbose: True