docs: Input Shaper and Resonances docs improvements (#3627)
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
This commit is contained in:
parent
85300a4aad
commit
4a41d228eb
|
@ -1348,9 +1348,9 @@ the [command reference](G-Codes.md#resonance-compensation).
|
||||||
#damping_ratio_x: 0.1
|
#damping_ratio_x: 0.1
|
||||||
#damping_ratio_y: 0.1
|
#damping_ratio_y: 0.1
|
||||||
# Damping ratios of vibrations of X and Y axes used by input shapers
|
# Damping ratios of vibrations of X and Y axes used by input shapers
|
||||||
# to improve vibration suppression. Should not be changed without
|
# to improve vibration suppression. Default value is 0.1 which is a
|
||||||
# some proper measurements, e.g. with an accelerometer. Default
|
# good all-round value for most printers. In most circumstances this
|
||||||
# value is 0.1 which is a good all-round value for most printers.
|
# parameter requires no tuning and should not be changed.
|
||||||
```
|
```
|
||||||
|
|
||||||
## [adxl345]
|
## [adxl345]
|
||||||
|
|
|
@ -48,33 +48,28 @@ An example of mounting ADXL345 on the SmartEffector:
|
||||||
![ADXL345 on SmartEffector](img/adxl345-mount.jpg)
|
![ADXL345 on SmartEffector](img/adxl345-mount.jpg)
|
||||||
|
|
||||||
Note that on a bed slinger printer one must design 2 mounts: one for the
|
Note that on a bed slinger printer one must design 2 mounts: one for the
|
||||||
toolhead and one for the bed, and run the measurements twice.
|
toolhead and one for the bed, and run the measurements twice. See the
|
||||||
|
corresponding [section](#bed-slinger-printers) for more details.
|
||||||
|
|
||||||
## Software installation
|
## Software installation
|
||||||
|
|
||||||
Note that resonance measurements and shaper auto-calibration require additional
|
Note that resonance measurements and shaper auto-calibration require additional
|
||||||
software dependencies not installed by default. You will have to run on your
|
software dependencies not installed by default. First, you will have to run on
|
||||||
Raspberry Pi
|
your Raspberry Pi the following command:
|
||||||
```
|
```
|
||||||
$ ~/klippy-env/bin/pip install -v numpy
|
~/klippy-env/bin/pip install -v numpy
|
||||||
```
|
```
|
||||||
to install `numpy` package. Note that, depending on the performance of the
|
to install `numpy` package. Note that, depending on the performance of the
|
||||||
CPU, it may take *a lot* of time, up to 10-20 minutes. Be patient and wait
|
CPU, it may take *a lot* of time, up to 10-20 minutes. Be patient and wait
|
||||||
for the completion of the installation. On some occasions, if the board has
|
for the completion of the installation. On some occasions, if the board has
|
||||||
too little RAM, the installation may fail and you will need to enable swap.
|
too little RAM, the installation may fail and you will need to enable swap.
|
||||||
|
|
||||||
If installing prerequisites takes too much time or fail for whatever reason,
|
Next, run the following command to install the additional dependencies:
|
||||||
there is, in principle, another possibility to run a stand-alone script to
|
|
||||||
automatically tune the input shapers (will be covered later in the guide).
|
|
||||||
|
|
||||||
In order to run stand-alone scripts, one must run the following command to
|
|
||||||
install the required dependencies (either on Raspberry Pi, or on host,
|
|
||||||
depending on where the scripts will be executed):
|
|
||||||
```
|
```
|
||||||
$ sudo apt install python-numpy python-matplotlib
|
sudo apt install python-numpy python-matplotlib
|
||||||
```
|
```
|
||||||
|
|
||||||
Afterwards, follow the instructions in the
|
Afterwards, check and follow the instructions in the
|
||||||
[RPi Microcontroller document](RPi_microcontroller.md) to setup the
|
[RPi Microcontroller document](RPi_microcontroller.md) to setup the
|
||||||
"linux mcu" on the Raspberry Pi.
|
"linux mcu" on the Raspberry Pi.
|
||||||
|
|
||||||
|
@ -111,11 +106,14 @@ free-fall acceleration, e.g.
|
||||||
Recv: // adxl345 values (x, y, z): 470.719200, 941.438400, 9728.196800
|
Recv: // adxl345 values (x, y, z): 470.719200, 941.438400, 9728.196800
|
||||||
```
|
```
|
||||||
|
|
||||||
Try running `MEASURE_AXES_NOISE` in Octoprint, you should get some baseline
|
If you get an error like `Invalid adxl345 id (got xx vs e5)`, where `xx`
|
||||||
numbers for the noise of accelerometer on the axes (should be somewhere
|
is some other ID, it is indicative of the connection problem with ADXL345,
|
||||||
in the range of ~1-100). Note that this feature will not be available if
|
or the faulty sensor. Double-check the power, the wiring (that it matches
|
||||||
`numpy` package was not installed (see
|
the schematics, no wire is broken or loose, etc.), and soldering quality.
|
||||||
[Software installation](#software-installation) for more details).
|
|
||||||
|
Next, try running `MEASURE_AXES_NOISE` in Octoprint, you should get some
|
||||||
|
baseline numbers for the noise of accelerometer on the axes (should be
|
||||||
|
somewhere in the range of ~1-100).
|
||||||
|
|
||||||
## Measuring the resonances
|
## Measuring the resonances
|
||||||
|
|
||||||
|
@ -138,26 +136,7 @@ Run the following command:
|
||||||
```
|
```
|
||||||
TEST_RESONANCES AXIS=X
|
TEST_RESONANCES AXIS=X
|
||||||
```
|
```
|
||||||
Note that it will create vibrations on X axis. If that works, run for Y axis
|
Note that it will create vibrations on X axis.
|
||||||
as well:
|
|
||||||
```
|
|
||||||
TEST_RESONANCES AXIS=Y
|
|
||||||
```
|
|
||||||
This will generate 2 CSV files (`/tmp/resonances_x_*.csv` and
|
|
||||||
`/tmp/resonances_y_*.csv`).
|
|
||||||
|
|
||||||
Note that the commands above require `numpy` to be installed installed. If you
|
|
||||||
haven't installed it, you can instead pass `OUTPUT=raw_data` argument to the
|
|
||||||
above commands (2 files `/tmp/raw_data_x_*.csv` and `/tmp/raw_data_y_*.csv`
|
|
||||||
will be written). One can then run stand-alone scripts on Raspberry Pi
|
|
||||||
(specify the correct file name on the command line):
|
|
||||||
```
|
|
||||||
$ ~/klipper/scripts/graph_accelerometer.py /tmp/raw_data_x_*.csv -o /tmp/resonances_x.png
|
|
||||||
$ ~/klipper/scripts/calibrate_shaper.py /tmp/raw_data_x_*.csv -o /tmp/shaper_calibrate_x.png
|
|
||||||
```
|
|
||||||
or copy the data to the host and run the scripts there. See
|
|
||||||
[Offline processing of the accelerometer data](#offline-processing-of-the-accelerometer-data)
|
|
||||||
section for more details.
|
|
||||||
|
|
||||||
**Attention!** Be sure to observe the printer for the first time, to make sure
|
**Attention!** Be sure to observe the printer for the first time, to make sure
|
||||||
the vibrations do not become too violent (`M112` command can be used to abort
|
the vibrations do not become too violent (`M112` command can be used to abort
|
||||||
|
@ -171,42 +150,21 @@ accel_per_hz: 50 # default is 75
|
||||||
probe_points: ...
|
probe_points: ...
|
||||||
```
|
```
|
||||||
|
|
||||||
Generated CSV files show power spectral density of the vibrations depending on the
|
If it works for X axis, run for Y axis as well:
|
||||||
frequency. Usually, the charts generated from these CSV files are relatively easy
|
|
||||||
to read, with the peaks corresponding to the resonance frequencies:
|
|
||||||
|
|
||||||
![Resonances](img/test-resonances-x.png)
|
|
||||||
|
|
||||||
The chart above shows the resonances for X axis at approx. 50 Hz, 56 Hz, 63 Hz,
|
|
||||||
80 Hz and 104 Hz and one cross-resonance for Y axis at ~ 56 Hz. From this, one
|
|
||||||
can derive that a good input shaper config in this case could be `2hump_ei` at
|
|
||||||
around `shaper_freq_y = 45` (Hz):
|
|
||||||
|
|
||||||
|![2-hump EI shaper](img/2hump_ei_65hz.png)|
|
|
||||||
|:--:|
|
|
||||||
|Input Shaper response to vibrations, lower is better.|
|
|
||||||
|
|
||||||
Note that the smaller resonance at 104 Hz requires less of vibration suppression
|
|
||||||
(if at all).
|
|
||||||
|
|
||||||
## Input Shaper auto-calibration
|
|
||||||
|
|
||||||
Besides manually choosing the appropriate parameters for the input shaper
|
|
||||||
feature, it is also possible to run an experimental auto-tuning for the
|
|
||||||
input shaper.
|
|
||||||
|
|
||||||
In order to attempt to measure the resonance frequencies and automatically
|
|
||||||
determine the best parameters for `[input_shaper]`, run the following command
|
|
||||||
via Octoprint terminal:
|
|
||||||
```
|
```
|
||||||
SHAPER_CALIBRATE
|
TEST_RESONANCES AXIS=Y
|
||||||
```
|
```
|
||||||
|
This will generate 2 CSV files (`/tmp/resonances_x_*.csv` and
|
||||||
This will test all frequencies in range 5 Hz - 120 Hz and generate
|
`/tmp/resonances_y_*.csv`). These files can be processed with the stand-alone
|
||||||
the csv output (`/tmp/calibration_data_*.csv` by default) for the frequency
|
script on a Raspberry Pi. To do that, run running the following commands:
|
||||||
response and the suggested input shapers. You will also get the suggested
|
```
|
||||||
frequencies for each input shaper, as well as which input shaper is recommended
|
~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_*.csv -o /tmp/shaper_calibrate_x.png
|
||||||
for your setup, on Octoprint console. For example:
|
~/klipper/scripts/calibrate_shaper.py /tmp/resonances_y_*.csv -o /tmp/shaper_calibrate_y.png
|
||||||
|
```
|
||||||
|
This script will generate the charts `/tmp/shaper_calibrate_x.png` and
|
||||||
|
`/tmp/shaper_calibrate_y.png` with frequency responses. You will also get the
|
||||||
|
suggested frequencies for each input shaper, as well as which input shaper is
|
||||||
|
recommended for your setup. For example:
|
||||||
|
|
||||||
![Resonances](img/calibrate-y.png)
|
![Resonances](img/calibrate-y.png)
|
||||||
```
|
```
|
||||||
|
@ -215,26 +173,37 @@ Fitted shaper 'mzv' frequency = 52.9 Hz (vibrations = 10.9%)
|
||||||
Fitted shaper 'ei' frequency = 62.0 Hz (vibrations = 8.9%)
|
Fitted shaper 'ei' frequency = 62.0 Hz (vibrations = 8.9%)
|
||||||
Fitted shaper '2hump_ei' frequency = 59.0 Hz (vibrations = 4.9%)
|
Fitted shaper '2hump_ei' frequency = 59.0 Hz (vibrations = 4.9%)
|
||||||
Fitted shaper '3hump_ei' frequency = 65.0 Hz (vibrations = 3.3%)
|
Fitted shaper '3hump_ei' frequency = 65.0 Hz (vibrations = 3.3%)
|
||||||
Recommended shaper_type_y = 2hump_ei, shaper_freq_y = 59.0 Hz
|
Recommended shaper is 2hump_ei @ 59.0 Hz
|
||||||
```
|
|
||||||
If you agree with the suggested parameters, you can execute `SAVE_CONFIG`
|
|
||||||
now to save them and restart the Klipper.
|
|
||||||
|
|
||||||
|
|
||||||
If your printer is a bed slinger printer, you will need to repeat the
|
|
||||||
measurements twice: measure the resonances of X axis with the accelerometer
|
|
||||||
attached to the toolhead and the resonances of Y axis - to the bed (the usual
|
|
||||||
bed slinger setup). In this case, you can specify the axis you want to run the
|
|
||||||
test for (by default the test is performed for both axes):
|
|
||||||
```
|
|
||||||
SHAPER_CALIBRATE AXIS=Y
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can execute `SAVE_CONFIG` twice - after calibrating each axis.
|
The suggested configuration can be added to `[input_shaper]` section of
|
||||||
|
`printer.cfg`:
|
||||||
|
```
|
||||||
|
[input_shaper]
|
||||||
|
shaper_freq_x: 59.0
|
||||||
|
shaper_type_x: 2hump_ei
|
||||||
|
shaper_freq_y: ...
|
||||||
|
shaper_type_y: ...
|
||||||
|
```
|
||||||
|
or you can choose some other configuration yourself based on the generated
|
||||||
|
charts: peaks in the power spectral density on the charts correspond to
|
||||||
|
the resonance frequencies of the printer.
|
||||||
|
|
||||||
However, you can connect two accelerometers simultaneously, though they must be
|
Note that alternatively you can run the input shaper autocalibration
|
||||||
connected to different boards (say, to an RPi and printer MCU board), or to two
|
from Klipper [directly](#input-shaper-auto-calibration), which can be
|
||||||
different physical SPI interfaces on the same board (rarely available).
|
convenient, for example, for the input shaper
|
||||||
|
[re-calibration](#input-shaper-re-calibration).
|
||||||
|
|
||||||
|
## Bed-slinger printers
|
||||||
|
|
||||||
|
If your printer is a bed slinger printer, you will need to change the location
|
||||||
|
of the accelerometer between the measurements for X and Y axes: measure the
|
||||||
|
resonances of X axis with the accelerometer attached to the toolhead and the
|
||||||
|
resonances of Y axis - to the bed (the usual bed slinger setup).
|
||||||
|
|
||||||
|
However, you can also connect two accelerometers simultaneously, though they
|
||||||
|
must be connected to different boards (say, to an RPi and printer MCU board), or
|
||||||
|
to two different physical SPI interfaces on the same board (rarely available).
|
||||||
Then they can be configured in the following manner:
|
Then they can be configured in the following manner:
|
||||||
```
|
```
|
||||||
[adxl345 adxl345_x]
|
[adxl345 adxl345_x]
|
||||||
|
@ -250,14 +219,65 @@ accel_chip_x: adxl345_x
|
||||||
accel_chip_y: adxl345_y
|
accel_chip_y: adxl345_y
|
||||||
probe_points: ...
|
probe_points: ...
|
||||||
```
|
```
|
||||||
then one can simply run `SHAPER_CALIBRATE` without specifying an axis to
|
|
||||||
calibrate the input shaper for both axes in one go.
|
|
||||||
|
|
||||||
After the autocalibration is finished, you will still need to choose the
|
Then the commands `TEST_RESONANCES AXIS=X` and `TEST_RESONANCES AXIS=Y`
|
||||||
`max_accel` value that does not create too much smoothing in the printed
|
will use the correct accelerometer for each axis.
|
||||||
parts. Follow [this](Resonance_Compensation.md#selecting-max_accel) part of
|
|
||||||
|
## Selecting max_accel
|
||||||
|
|
||||||
|
Keep in mind that the input shaper can create some smoothing in parts,
|
||||||
|
especially at high accelerations. Therefore, after the calibration
|
||||||
|
is finished, you will still need to choose the `max_accel` value that
|
||||||
|
does not create too much smoothing in the printed parts. Follow
|
||||||
|
[this](Resonance_Compensation.md#selecting-max_accel) part of
|
||||||
the input shaper tuning guide and print the test model.
|
the input shaper tuning guide and print the test model.
|
||||||
|
|
||||||
|
The same notice applies to the input shaper
|
||||||
|
[auto-calibration](#input-shaper-auto-calibration) with
|
||||||
|
`SHAPER_CALIBRATE` command: it is still necessary to choose the right
|
||||||
|
`max_accel` value after the auto-calibration.
|
||||||
|
|
||||||
|
|
||||||
|
# Input Shaper auto-calibration
|
||||||
|
|
||||||
|
Besides manually choosing the appropriate parameters for the input shaper
|
||||||
|
feature, it is also possible to run the auto-tuning for the input shaper
|
||||||
|
directly from Klipper. Run the following command via Octoprint terminal:
|
||||||
|
```
|
||||||
|
SHAPER_CALIBRATE
|
||||||
|
```
|
||||||
|
|
||||||
|
This will run the full test for both axes and generate the csv output
|
||||||
|
(`/tmp/calibration_data_*.csv` by default) for the frequency response
|
||||||
|
and the suggested input shapers. You will also get the suggested
|
||||||
|
frequencies for each input shaper, as well as which input shaper is
|
||||||
|
recommended for your setup, on Octoprint console. For example:
|
||||||
|
|
||||||
|
```
|
||||||
|
Fitted shaper 'zv' frequency = 56.7 Hz (vibrations = 23.2%)
|
||||||
|
Fitted shaper 'mzv' frequency = 52.9 Hz (vibrations = 10.9%)
|
||||||
|
Fitted shaper 'ei' frequency = 62.0 Hz (vibrations = 8.9%)
|
||||||
|
Fitted shaper '2hump_ei' frequency = 59.0 Hz (vibrations = 4.9%)
|
||||||
|
Fitted shaper '3hump_ei' frequency = 65.0 Hz (vibrations = 3.3%)
|
||||||
|
Recommended shaper_type_y = 2hump_ei, shaper_freq_y = 59.0 Hz
|
||||||
|
```
|
||||||
|
If you agree with the suggested parameters, you can execute `SAVE_CONFIG`
|
||||||
|
now to save them and restart the Klipper.
|
||||||
|
|
||||||
|
|
||||||
|
If your printer is a bed slinger printer, you can specify which axis
|
||||||
|
to test, so that you can change the accelerometer mounting point between
|
||||||
|
the tests (by default the test is performed for both axes):
|
||||||
|
```
|
||||||
|
SHAPER_CALIBRATE AXIS=Y
|
||||||
|
```
|
||||||
|
|
||||||
|
You can execute `SAVE_CONFIG` twice - after calibrating each axis.
|
||||||
|
|
||||||
|
However, if you connected two accelerometers simultaneously, you simply run
|
||||||
|
`SHAPER_CALIBRATE` without specifying an axis to calibrate the input shaper
|
||||||
|
for both axes in one go.
|
||||||
|
|
||||||
## Input Shaper re-calibration
|
## Input Shaper re-calibration
|
||||||
|
|
||||||
`SHAPER_CALIBRATE` command can be also used to re-calibrate the input shaper in
|
`SHAPER_CALIBRATE` command can be also used to re-calibrate the input shaper in
|
||||||
|
@ -279,22 +299,24 @@ increased risk of some parts unscrewing or becoming loose. Always check that
|
||||||
all parts of the printer (including the ones that may normally not move) are
|
all parts of the printer (including the ones that may normally not move) are
|
||||||
securely fixed in place after each auto-tuning.
|
securely fixed in place after each auto-tuning.
|
||||||
|
|
||||||
Also, due to some noise in measurements, it is possible the the tuning results
|
Also, due to some noise in measurements, it is possible that the tuning results
|
||||||
will be slightly different from one calibration run to another one. Still, it
|
will be slightly different from one calibration run to another one. Still, it
|
||||||
is not expected that the resulting print quality will be affected too much.
|
is not expected that the noise will affect the print quality too much.
|
||||||
However, it is still advised to double-check the suggested parameters, and
|
However, it is still advised to double-check the suggested parameters, and
|
||||||
print some test prints before using them to confirm they are good.
|
print some test prints before using them to confirm they are good.
|
||||||
|
|
||||||
## Offline processing of the accelerometer data
|
# Offline processing of the accelerometer data
|
||||||
|
|
||||||
It is possible to generate the raw accelerometer data and process it offline
|
It is possible to generate the raw accelerometer data and process it offline
|
||||||
(e.g. on a host machine), for example to find resonances. In order to do so,
|
(e.g. on a host machine), for example to find resonances. In order to do so,
|
||||||
run the following command via Octoprint terminal:
|
run the following commands via Octoprint terminal:
|
||||||
```
|
```
|
||||||
|
SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0
|
||||||
TEST_RESONANCES AXIS=X OUTPUT=raw_data
|
TEST_RESONANCES AXIS=X OUTPUT=raw_data
|
||||||
```
|
```
|
||||||
(specify the desired test axis and the desired template for the raw
|
ignoring any errors for `SET_INPUT_SHAPER` command. For `TEST_RESONANCES`
|
||||||
accelerometer output, the data will be written into `/tmp` directory).
|
command, specify the desired test axis. The raw data will be written into
|
||||||
|
`/tmp` directory on the RPi.
|
||||||
|
|
||||||
The raw data can also be obtained by running the command `ACCELEROMETER_MEASURE`
|
The raw data can also be obtained by running the command `ACCELEROMETER_MEASURE`
|
||||||
command twice during some normal printer activity - first to start the
|
command twice during some normal printer activity - first to start the
|
||||||
|
@ -305,6 +327,7 @@ The data can be processed later by the following scripts:
|
||||||
`scripts/graph_accelerometer.py` and `scripts/calibrate_shaper.py`. Both
|
`scripts/graph_accelerometer.py` and `scripts/calibrate_shaper.py`. Both
|
||||||
of them accept one or several raw csv files as the input depending on the
|
of them accept one or several raw csv files as the input depending on the
|
||||||
mode. The graph_accelerometer.py script supports several modes of operation:
|
mode. The graph_accelerometer.py script supports several modes of operation:
|
||||||
|
|
||||||
* plotting raw accelerometer data (use `-r` parameter), only 1 input is
|
* plotting raw accelerometer data (use `-r` parameter), only 1 input is
|
||||||
supported;
|
supported;
|
||||||
* plotting a frequency response (no extra parameters required), if multiple
|
* plotting a frequency response (no extra parameters required), if multiple
|
||||||
|
@ -318,9 +341,12 @@ mode. The graph_accelerometer.py script supports several modes of operation:
|
||||||
`-a x`, `-a y` or `-a z` parameter (if none specified, the sum of vibrations
|
`-a x`, `-a y` or `-a z` parameter (if none specified, the sum of vibrations
|
||||||
for all axes is used).
|
for all axes is used).
|
||||||
|
|
||||||
|
Note that graph_accelerometer.py script supports only the raw_data\*.csv files
|
||||||
|
and not resonances\*.csv or calibration_data\*.csv files.
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
```
|
```
|
||||||
$ ~/klipper/scripts/graph_accelerometer.py /tmp/raw_data_x_*.csv -o /tmp/resonances_x.png -c -a z
|
~/klipper/scripts/graph_accelerometer.py /tmp/raw_data_x_*.csv -o /tmp/resonances_x.png -c -a z
|
||||||
```
|
```
|
||||||
will plot the comparison of several `/tmp/raw_data_x_*.csv` files for Z axis to
|
will plot the comparison of several `/tmp/raw_data_x_*.csv` files for Z axis to
|
||||||
`/tmp/resonances_x.png` file.
|
`/tmp/resonances_x.png` file.
|
||||||
|
@ -333,6 +359,7 @@ the CSV file if `-c output.csv` parameter is specified.
|
||||||
|
|
||||||
Providing several inputs to shaper_calibrate.py script can be useful if running
|
Providing several inputs to shaper_calibrate.py script can be useful if running
|
||||||
some advanced tuning of the input shapers, for example:
|
some advanced tuning of the input shapers, for example:
|
||||||
|
|
||||||
* Running `TEST_RESONANCES AXIS=X OUTPUT=raw_data` (and `Y` axis) for a single
|
* Running `TEST_RESONANCES AXIS=X OUTPUT=raw_data` (and `Y` axis) for a single
|
||||||
axis twice on a bed slinger printer with the accelerometer attached to the
|
axis twice on a bed slinger printer with the accelerometer attached to the
|
||||||
toolhead the first time, and the accelerometer attached to the bed the
|
toolhead the first time, and the accelerometer attached to the bed the
|
||||||
|
|
|
@ -9,19 +9,19 @@ printed surface as a subtle 'echo':
|
||||||
|![Ringing test](img/ringing-test.jpg)|![3D Benchy](img/ringing-3dbenchy.jpg)|
|
|![Ringing test](img/ringing-test.jpg)|![3D Benchy](img/ringing-3dbenchy.jpg)|
|
||||||
|
|
||||||
Ringing is caused by mechanical vibrations in the printer due to quick changes
|
Ringing is caused by mechanical vibrations in the printer due to quick changes
|
||||||
of the printing direction.
|
of the printing direction. Note that ringing usually has mechanical origins:
|
||||||
|
insufficiently rigid printer frame, non-tight or too springy belts, alignment
|
||||||
|
issues of mechanical parts, heavy moving mass, etc. Those should be checked
|
||||||
|
and fixed first, if possible.
|
||||||
|
|
||||||
|
|
||||||
[Input shaping](https://en.wikipedia.org/wiki/Input_shaping) is an open-loop
|
[Input shaping](https://en.wikipedia.org/wiki/Input_shaping) is an open-loop
|
||||||
control technique which creates a commanding signal that cancels its
|
control technique which creates a commanding signal that cancels its
|
||||||
own vibrations.
|
own vibrations. Input shaping requires some tuning and measurements before it
|
||||||
|
can be enabled. Besides ringing, Input Shaping typically reduces the vibrations
|
||||||
|
and shaking of the printer in general, and may also improve the reliability
|
||||||
|
of the stealthChop mode of Trinamic stepper drivers.
|
||||||
|
|
||||||
**Warning**: Input Shaping support is experimental. You should consider using it
|
|
||||||
only if you already have ghosting and ringing in prints, otherwise it is not
|
|
||||||
advised to enable it. Input shaping requires some tuning and measurements
|
|
||||||
before it can be enabled.
|
|
||||||
|
|
||||||
Note that ringing usually has mechanical origins: insufficiently rigid printer
|
|
||||||
frame, non-tight or too springy belts, alignment issues of mechanical parts,
|
|
||||||
heavy moving mass, etc. Those should be checked and fixed first.
|
|
||||||
|
|
||||||
Tuning
|
Tuning
|
||||||
===========================
|
===========================
|
||||||
|
@ -36,9 +36,13 @@ Slice the ringing test model, which can be found in
|
||||||
* Suggested layer height is 0.2 or 0.25 mm.
|
* Suggested layer height is 0.2 or 0.25 mm.
|
||||||
* Infill and top layers can be set to 0.
|
* Infill and top layers can be set to 0.
|
||||||
* Use 1-2 perimeters, or even better the smooth vase mode with 1-2 mm base.
|
* Use 1-2 perimeters, or even better the smooth vase mode with 1-2 mm base.
|
||||||
* Use sufficiently high speed, around 80-100 mm/sec, for *external* perimeters.
|
* Use sufficiently high speed, around 80-100 mm/sec, for **external** perimeters.
|
||||||
* Make sure that the minimum layer time is *at most* 3 seconds.
|
* Make sure that the minimum layer time is **at most** 3 seconds.
|
||||||
* Make sure any "dynamic acceleration control" is disabled in the slicer.
|
* Make sure any "dynamic acceleration control" is disabled in the slicer.
|
||||||
|
* Do not turn the model. The model has X and Y marks at the back of the model.
|
||||||
|
Note the unusual location of the marks vs. the axes of the printer - it is
|
||||||
|
not a mistake. The marks can be used later in the tuning process as a
|
||||||
|
reference, because they show which axis the measurements correspond to.
|
||||||
|
|
||||||
## Ringing frequency
|
## Ringing frequency
|
||||||
|
|
||||||
|
@ -48,36 +52,44 @@ First, measure the **ringing frequency**.
|
||||||
`printer.cfg` to 7000. Note that this is only needed for tuning, and more
|
`printer.cfg` to 7000. Note that this is only needed for tuning, and more
|
||||||
proper value will be selected in the corresponding
|
proper value will be selected in the corresponding
|
||||||
[section](#selecting-max_accel).
|
[section](#selecting-max_accel).
|
||||||
2. Restart the firmware: `RESTART`.
|
2. If `square_corner_velocity` parameter was changed, revert it back to 5.0.
|
||||||
3. Disable Pressure Advance: `SET_PRESSURE_ADVANCE ADVANCE=0`.
|
It is not advised to increase it when using the input shaper because it can
|
||||||
4. If you have already added `[input_shaper]` section to the printer.cfg,
|
cause more smoothing in parts - it is better to use higher acceleration
|
||||||
|
value instead.
|
||||||
|
3. Restart the firmware: `RESTART`.
|
||||||
|
4. Disable Pressure Advance: `SET_PRESSURE_ADVANCE ADVANCE=0`.
|
||||||
|
5. If you have already added `[input_shaper]` section to the printer.cfg,
|
||||||
execute `SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0` command. If you
|
execute `SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0` command. If you
|
||||||
get "Unknown command" error, you can safely ignore it at this point and
|
get "Unknown command" error, you can safely ignore it at this point and
|
||||||
continue with the measurements.
|
continue with the measurements.
|
||||||
5. Execute the command
|
6. Execute the command
|
||||||
`TUNING_TOWER COMMAND=SET_VELOCITY_LIMIT PARAMETER=ACCEL START=1250 FACTOR=100 BAND=5`.
|
`TUNING_TOWER COMMAND=SET_VELOCITY_LIMIT PARAMETER=ACCEL START=1250 FACTOR=100 BAND=5`.
|
||||||
Basically, we try to make ringing more pronounced by setting different large
|
Basically, we try to make ringing more pronounced by setting different large
|
||||||
values for acceleration.
|
values for acceleration. This command will increase the acceleration every
|
||||||
6. Print the test model sliced with the suggested parameters.
|
5 mm starting from 1500 mm/sec^2: 1500 mm/sec^2, 2000 mm/sec^2, 2500 mm/sec^2
|
||||||
7. You can stop the print earlier if the ringing is clearly visible and you see
|
and so forth up until 7000 mm/sec^2 at the last band.
|
||||||
|
7. Print the test model sliced with the suggested parameters.
|
||||||
|
8. You can stop the print earlier if the ringing is clearly visible and you see
|
||||||
that acceleration gets too high for your printer (e.g. printer shakes too
|
that acceleration gets too high for your printer (e.g. printer shakes too
|
||||||
much or starts skipping steps).
|
much or starts skipping steps).
|
||||||
8. Measure the distance *D* (in mm) between *N* oscillations for X axis near
|
9. Use X and Y marks at the back of the model for reference. The measurements
|
||||||
the notches, preferably skipping the first oscillation or two. Pay attention
|
from the side with X mark should be used for X axis *configuration*, and
|
||||||
to the notches X axis corresponds to - the test model has large 'X' and 'Y'
|
Y mark - for Y axis configuration. Measure the distance *D* (in mm) between
|
||||||
marks on the back side for convenience. Note that 'X' mark is on Y axis and
|
several oscillations on the part with X mark, near the notches, preferably
|
||||||
vice versa, it is not a mistake - ringing of X axis shows *along* Y axis.
|
skipping the first oscillation or two. To measure the distance between
|
||||||
To measure the distance between oscillations more easily, mark the
|
oscillations more easily, mark the oscillations first, then measure the
|
||||||
oscillations first, then measure the distance between the marks with a ruler
|
distance between the marks with a ruler or calipers:
|
||||||
or calipers:
|
|
||||||
|
|
||||||
|![Mark ringing](img/ringing-mark.jpg)|![Measure ringing](img/ringing-measure.jpg)|
|
|![Mark ringing](img/ringing-mark.jpg)|![Measure ringing](img/ringing-measure.jpg)|
|
||||||
|
|
||||||
9. Compute the ringing frequency = *V* · *N* / *D* (Hz) where *V* is the
|
10. Count how many oscillations *N* the measured distance *D* corresponds to.
|
||||||
velocity for outer perimeters (mm/sec). For the example above, we marked 6
|
If you are unsure how to count the oscillations, refer to the picture
|
||||||
oscillations, and the test was printed at 100 mm/sec velocity, so the
|
above, which shows *N* = 6 oscillations.
|
||||||
frequency is 100 * 6 / 12.14 ≈ 49.4 Hz.
|
11. Compute the ringing frequency of X axis as *V* · *N* / *D* (Hz),
|
||||||
10. Do (8) - (9) for Y axis as well.
|
where *V* is the velocity for outer perimeters (mm/sec). For the example
|
||||||
|
above, we marked 6 oscillations, and the test was printed at 100 mm/sec
|
||||||
|
velocity, so the frequency is 100 * 6 / 12.14 ≈ 49.4 Hz.
|
||||||
|
12. Do (9) - (11) for Y mark as well.
|
||||||
|
|
||||||
Note that ringing on the test print should follow the pattern of the curved
|
Note that ringing on the test print should follow the pattern of the curved
|
||||||
notches, as in the picture above. If it doesn't, then this defect is not really
|
notches, as in the picture above. If it doesn't, then this defect is not really
|
||||||
|
@ -123,8 +135,8 @@ After the ringing frequencies for X and Y axes are measured, you can add the
|
||||||
following section to your `printer.cfg`:
|
following section to your `printer.cfg`:
|
||||||
```
|
```
|
||||||
[input_shaper]
|
[input_shaper]
|
||||||
shaper_freq_x: ...
|
shaper_freq_x: ... # frequency for the X mark of the test model
|
||||||
shaper_freq_y: ...
|
shaper_freq_y: ... # frequency for the Y mark of the test model
|
||||||
```
|
```
|
||||||
|
|
||||||
For the example above, we get shaper_freq_x/y = 49.4.
|
For the example above, we get shaper_freq_x/y = 49.4.
|
||||||
|
@ -195,14 +207,15 @@ A few notes on shaper selection:
|
||||||
## Selecting max_accel
|
## Selecting max_accel
|
||||||
|
|
||||||
You should have a printed test for the shaper you chose from the previous step
|
You should have a printed test for the shaper you chose from the previous step
|
||||||
(if you don't, print the test model with the pressure advance disabled
|
(if you don't, print the test model sliced with the
|
||||||
|
[suggested parameters](#tuning) with the pressure advance disabled
|
||||||
`SET_PRESSURE_ADVANCE ADVANCE=0` and with the tuning tower enabled as
|
`SET_PRESSURE_ADVANCE ADVANCE=0` and with the tuning tower enabled as
|
||||||
`TUNING_TOWER COMMAND=SET_VELOCITY_LIMIT PARAMETER=ACCEL START=1250 FACTOR=100 BAND=5`).
|
`TUNING_TOWER COMMAND=SET_VELOCITY_LIMIT PARAMETER=ACCEL START=1250 FACTOR=100 BAND=5`).
|
||||||
Note that at very high accelerations, depending on the resonance frequency and
|
Note that at very high accelerations, depending on the resonance frequency and
|
||||||
the input shaper you chose (e.g. EI shaper creates more smoothing than MZV),
|
the input shaper you chose (e.g. EI shaper creates more smoothing than MZV),
|
||||||
input shaping may cause too much smoothing and rounding of the parts. So,
|
input shaping may cause too much smoothing and rounding of the parts. So,
|
||||||
max_accel should be chosen such as to prevent that. Another parameter that can
|
max_accel should be chosen such as to prevent that. Another parameter that can
|
||||||
impact smoothing is square_corner_velocity, so it is not advisable to increase
|
impact smoothing is `square_corner_velocity`, so it is not advisable to increase
|
||||||
it above the default 5 mm/sec to prevent increased smoothing.
|
it above the default 5 mm/sec to prevent increased smoothing.
|
||||||
|
|
||||||
In order to select a suitable max_accel value, inspect the model for the chosen
|
In order to select a suitable max_accel value, inspect the model for the chosen
|
||||||
|
@ -214,8 +227,8 @@ in the wall (0.15 mm):
|
||||||
|
|
||||||
![Test gap](img/smoothing-test.png)
|
![Test gap](img/smoothing-test.png)
|
||||||
|
|
||||||
As the acceleration increases, so does the smoothing, and the actual gap
|
As the acceleration increases, so does the smoothing, and the actual gap in
|
||||||
widens:
|
the print widens:
|
||||||
|
|
||||||
![Shaper smoothing](img/shaper-smoothing.jpg)
|
![Shaper smoothing](img/shaper-smoothing.jpg)
|
||||||
|
|
||||||
|
@ -269,7 +282,7 @@ to 7000 already, complete the following steps for each of the axes X and Y:
|
||||||
|
|
||||||
1. Make sure Pressure Advance is disabled: `SET_PRESSURE_ADVANCE ADVANCE=0`.
|
1. Make sure Pressure Advance is disabled: `SET_PRESSURE_ADVANCE ADVANCE=0`.
|
||||||
2. Execute `SET_INPUT_SHAPER SHAPER_TYPE=ZV`.
|
2. Execute `SET_INPUT_SHAPER SHAPER_TYPE=ZV`.
|
||||||
2. From the existing ringing test model with your chosen input shaper select
|
3. From the existing ringing test model with your chosen input shaper select
|
||||||
the acceleration that shows ringing sufficiently well, and set it with:
|
the acceleration that shows ringing sufficiently well, and set it with:
|
||||||
`SET_VELOCITY_LIMIT ACCEL=...`.
|
`SET_VELOCITY_LIMIT ACCEL=...`.
|
||||||
4. Calculate the necessary parameters for the `TUNING_TOWER` command to tune
|
4. Calculate the necessary parameters for the `TUNING_TOWER` command to tune
|
||||||
|
@ -320,9 +333,9 @@ between the oscillations is not stable, you may still be able to take advantage
|
||||||
of input shaping techniques, but the results may not be as good as with proper
|
of input shaping techniques, but the results may not be as good as with proper
|
||||||
measurements of the frequencies, and will require a bit more tuning and printing
|
measurements of the frequencies, and will require a bit more tuning and printing
|
||||||
the test model. Note that another possibility is to purchase and install an
|
the test model. Note that another possibility is to purchase and install an
|
||||||
accelerometer and measure the resonances with it (there is a separate
|
accelerometer and measure the resonances with it (refer to the
|
||||||
[branch](https://github.com/dmbutyugin/klipper/blob/adxl345-spi/docs/Measuring_Resonances.md)
|
[docs](Measuring_Resonances.md) describing the required hardware and the setup
|
||||||
with ADXL345 support) - but this option requires some crimping and soldering.
|
process) - but this option requires some crimping and soldering.
|
||||||
|
|
||||||
|
|
||||||
For tuning, add empty `[input_shaper]` section to your `printer.cfg`. Then,
|
For tuning, add empty `[input_shaper]` section to your `printer.cfg`. Then,
|
||||||
|
@ -396,7 +409,10 @@ between the oscillations is not stable, it might mean that the printer has
|
||||||
several resonance frequencies on the same axis. One may try to follow the
|
several resonance frequencies on the same axis. One may try to follow the
|
||||||
tuning process described in
|
tuning process described in
|
||||||
[Unreliable measurements of ringing frequencies](#unreliable-measurements-of-ringing-frequencies)
|
[Unreliable measurements of ringing frequencies](#unreliable-measurements-of-ringing-frequencies)
|
||||||
section and still get something out of the input shaping technique.
|
section and still get something out of the input shaping technique. Another
|
||||||
|
possibility is to install an accelerometer, [measure](Measuring_Resonances.md)
|
||||||
|
the resonances with it, and auto-tune the input shaper using the results of
|
||||||
|
those measurements.
|
||||||
|
|
||||||
### After enabling [input_shaper], I get too smoothed printed parts and fine details are lost
|
### After enabling [input_shaper], I get too smoothed printed parts and fine details are lost
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 74 KiB |
Binary file not shown.
Before Width: | Height: | Size: 62 KiB |
Loading…
Reference in New Issue