Skip to content

Instantly share code, notes, and snippets.

@kmobs
Last active March 21, 2025 23:02

Revisions

  1. kmobs revised this gist Mar 26, 2023. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -51,9 +51,15 @@ For me, I added the following to it:
    damping_ratio_y: 0.06

    ## Results
    bIRD#0068 had the following graphs and was able to calculate their damping ratio. These result images are the same gcode and frequency, but changing the damping ratio from the default of 0.1
    bIRD#0068 from Discord had the following graphs and was able to calculate their damping ratio. These result images are the same gcode and frequency, but changing the damping ratio from the default of 0.1 to the calculated ones

    | Before: | After |
    0.0468 on x
    0.0332 on y


    | Input shaper X | Input Shaper Y |
    :-----------------------------------:|:-----------------------------------:
    ![shaper_calibrate_x](https://user-images.githubusercontent.com/224365/227795130-d592f124-26c8-45a4-b50d-2fe499f11752.png) | ![shaper_calibrate_y](https://user-images.githubusercontent.com/224365/227795142-31a53655-fe1f-4dc5-8fde-60657db159c1.png)
    Before | After
    ![image](https://user-images.githubusercontent.com/224365/227794801-ff7f00d5-5e6b-4016-946e-9a401e46b03e.png) | ![image](https://user-images.githubusercontent.com/224365/227794966-ebdb3194-92b9-44f2-b948-b1f6e03c02e0.png)

  2. kmobs revised this gist Mar 26, 2023. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Prerequisite
    ## Prerequisite - Outdated. I don't use the resonance testing branch or pulses method anymore.
    I recommend running Dmitry’s latest resonance testing branch and using the pulses method outlined below:

    https://github.com/Klipper3d/klipper/issues/4560
    @@ -49,3 +49,11 @@ For me, I added the following to it:
    ...
    damping_ratio_x: 0.06
    damping_ratio_y: 0.06

    ## Results
    bIRD#0068 had the following graphs and was able to calculate their damping ratio. These result images are the same gcode and frequency, but changing the damping ratio from the default of 0.1

    | Before: | After |
    :-----------------------------------:|:-----------------------------------:
    ![image](https://user-images.githubusercontent.com/224365/227794801-ff7f00d5-5e6b-4016-946e-9a401e46b03e.png) | ![image](https://user-images.githubusercontent.com/224365/227794966-ebdb3194-92b9-44f2-b948-b1f6e03c02e0.png)

  3. kmobs revised this gist Feb 14, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,8 @@ The second formula is `Q=1/(2*damping ratio)`
    From this you can solve for your damping ratio.
    ```Damping ratio = (f2-f1)/(2f0)```

    Alternatively, look in the comments below for a nice R script and instructions for how to run it in a docker container if you don't have R installed.

    ## Verifying your damping ratio
    You can then test your value. To do this, you need to make a small (hacky) change to input_shaper.py if you want to iterate them both at the same time.
    In `input_shaper.py` in the extras folder of your klipper directory, change the line `damping_ratio_x, damping_ratio_y)` on line 135 to `damping_ratio_x, damping_ratio_x)`
  4. kmobs revised this gist Jan 21, 2022. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,14 @@ You’ll need to completely restart your klipper instance with `systemctl restar
    You can then use the resonance test STL and iterate your damping value with the tuning tower command.
    ```TUNING_TOWER COMMAND=SET_INPUT_SHAPER PARAMETER=DAMPING_RATIO_X START=<some value> = <some value>```

    Alternatively, you could create a new macro and iterate through that (from KenadyDawg44)
    ```[gcode_macro damping_ratio_set]
    gcode:
    {% set RATIO = params.RATIO|default(0.1) %}
    SET_INPUT_SHAPER DAMPING_RATIO_X={RATIO}
    SET_INPUT_SHAPER DAMPING_RATIO_Y={RATIO}
    ```

    I personally iterated from 0 to .11ish with a factor of .002.
    You can then inspect the output and where you think it looks best. Your calculated value should get you in just about the right space if your IS graphs are clean.

  5. kmobs revised this gist Oct 3, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ From this you can solve for your damping ratio.

    ## Verifying your damping ratio
    You can then test your value. To do this, you need to make a small (hacky) change to input_shaper.py if you want to iterate them both at the same time.
    In input_shaper.py in the extras folder of your klipper directory, change the line `damping_ratio_x, damping_ratio_y)` on line 135 to `damping_ratio_x, damping_ratio_x)`
    In `input_shaper.py` in the extras folder of your klipper directory, change the line `damping_ratio_x, damping_ratio_y)` on line 135 to `damping_ratio_x, damping_ratio_x)`
    You’ll need to completely restart your klipper instance with `systemctl restart klipper` via ssh. Or just restart your pi completely. Do not just restart via the UI of fluidd/mainsail

    You can then use the resonance test STL and iterate your damping value with the tuning tower command.
    @@ -30,6 +30,8 @@ You can then use the resonance test STL and iterate your damping value with the
    I personally iterated from 0 to .11ish with a factor of .002.
    You can then inspect the output and where you think it looks best. Your calculated value should get you in just about the right space if your IS graphs are clean.

    Don't forget to undo the change listed above in `input_shaper.py` and restart klipper again.

    To apply your newly found value add it to your `[input_shaper]` section of your config.
    For me, I added the following to it:

  6. kmobs revised this gist Oct 3, 2021. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    ## Prerequisite
    I recommend running Dmitry’s latest resonance testing branch and using the pulses method outlined below:
    https://github.com/Klipper3d/klipper/issues/4560
    https://github.com/dmbutyugin/klipper/tree/resonance-test-methods

    https://github.com/Klipper3d/klipper/issues/4560
    https://github.com/dmbutyugin/klipper/tree/resonance-test-methods

    I would only go down this path if you're getting ghosting with really high speed prints. On the Annex Engineering K3 for example, no matter how perfect the graphs looked, I was still getting some ghosting. That prompted me to go down this path. I'm now able to print at 20-30k acceleration, 250-350mm/s, and 15scv with perfect quality that can usually only be seen at significantly slower speeds.

  7. kmobs revised this gist Oct 3, 2021. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,10 @@ I recommend running Dmitry’s latest resonance testing branch and using the pul
    https://github.com/Klipper3d/klipper/issues/4560
    https://github.com/dmbutyugin/klipper/tree/resonance-test-methods

    I would only go down this path if you're getting ghosting with really high speed prints. On the Annex Engineering K3 for example, no matter how perfect the graphs looked, I was still getting some ghosting. That prompted me to go down this path. I'm now able to print at 20-30k acceleration, 250-350mm/s, and 15scv with perfect quality that can usually only be seen at significantly slower speeds.

    The default settings in Klipper have the damping ratio set to .1. This should be fine for most people with sane settings. I like to go for the insane.

    ## Calculating your damping ratio
    Once you have your graph generated, you can pull the raw CSV values into your favorite graphing software. We will use the half power method to calculate the damping ratio.
    Find your highest resonant frequency and divide the amplitude at this point 1.41 (or the square root of 2). Note the frequency of the intersects at this amplitude.
    @@ -20,7 +24,7 @@ In input_shaper.py in the extras folder of your klipper directory, change the li
    You’ll need to completely restart your klipper instance with `systemctl restart klipper` via ssh. Or just restart your pi completely. Do not just restart via the UI of fluidd/mainsail

    You can then use the resonance test STL and iterate your damping value with the tuning tower command.
    ```TUNING_TOWER COMMAND=SET_INPUT_SHAPER PARAMETER=DAMPING_RATIO_X START=<some value> Factor= <some value>```
    ```TUNING_TOWER COMMAND=SET_INPUT_SHAPER PARAMETER=DAMPING_RATIO_X START=<some value> = <some value>```

    I personally iterated from 0 to .11ish with a factor of .002.
    You can then inspect the output and where you think it looks best. Your calculated value should get you in just about the right space if your IS graphs are clean.
  8. kmobs revised this gist Oct 3, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -28,5 +28,7 @@ You can then inspect the output and where you think it looks best. Your calculat
    To apply your newly found value add it to your `[input_shaper]` section of your config.
    For me, I added the following to it:

    [input_shaper]
    ...
    damping_ratio_x: 0.06
    damping_ratio_y: 0.06
  9. kmobs revised this gist Oct 3, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -27,5 +27,6 @@ You can then inspect the output and where you think it looks best. Your calculat

    To apply your newly found value add it to your `[input_shaper]` section of your config.
    For me, I added the following to it:

    damping_ratio_x: 0.06
    damping_ratio_y: 0.06
    damping_ratio_y: 0.06
  10. kmobs revised this gist Oct 3, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -27,5 +27,5 @@ You can then inspect the output and where you think it looks best. Your calculat

    To apply your newly found value add it to your `[input_shaper]` section of your config.
    For me, I added the following to it:
    ```damping_ratio_x: 0.06
    damping_ratio_y: 0.06```
    damping_ratio_x: 0.06
    damping_ratio_y: 0.06
  11. kmobs revised this gist Oct 3, 2021. No changes.
  12. kmobs revised this gist Oct 3, 2021. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -24,3 +24,8 @@ You can then use the resonance test STL and iterate your damping value with the

    I personally iterated from 0 to .11ish with a factor of .002.
    You can then inspect the output and where you think it looks best. Your calculated value should get you in just about the right space if your IS graphs are clean.

    To apply your newly found value add it to your `[input_shaper]` section of your config.
    For me, I added the following to it:
    ```damping_ratio_x: 0.06
    damping_ratio_y: 0.06```
  13. kmobs revised this gist Oct 3, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ Find your highest resonant frequency and divide the amplitude at this point 1.41
    The two formulas that we will use are `Q=f0/(f2-f1)` where f0 is your highest resonant frequency, f2 is your higher frequency at the half power intersect, and f1 is the lower.
    The second formula is `Q=1/(2*damping ratio)`
    From this you can solve for your damping ratio.
    Damping ratio = (f2-f1)/(2f0)
    ```Damping ratio = (f2-f1)/(2f0)```

    ## Verifying your damping ratio
    You can then test your value. To do this, you need to make a small (hacky) change to input_shaper.py if you want to iterate them both at the same time.
  14. kmobs revised this gist Oct 3, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,7 @@ Once you have your graph generated, you can pull the raw CSV values into your fa
    Find your highest resonant frequency and divide the amplitude at this point 1.41 (or the square root of 2). Note the frequency of the intersects at this amplitude.

    ![image](https://user-images.githubusercontent.com/224365/135765527-05980b08-fc81-407f-804c-f424624dd3ef.png)

    The two formulas that we will use are `Q=f0/(f2-f1)` where f0 is your highest resonant frequency, f2 is your higher frequency at the half power intersect, and f1 is the lower.
    The second formula is `Q=1/(2*damping ratio)`
    From this you can solve for your damping ratio.
  15. kmobs revised this gist Oct 3, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ https://github.com/dmbutyugin/klipper/tree/resonance-test-methods
    Once you have your graph generated, you can pull the raw CSV values into your favorite graphing software. We will use the half power method to calculate the damping ratio.
    Find your highest resonant frequency and divide the amplitude at this point 1.41 (or the square root of 2). Note the frequency of the intersects at this amplitude.

    ![image](https://user-images.githubusercontent.com/224365/135765527-05980b08-fc81-407f-804c-f424624dd3ef.png)
    The two formulas that we will use are `Q=f0/(f2-f1)` where f0 is your highest resonant frequency, f2 is your higher frequency at the half power intersect, and f1 is the lower.
    The second formula is `Q=1/(2*damping ratio)`
    From this you can solve for your damping ratio.
  16. kmobs revised this gist Oct 3, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions DampingRatio.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ I recommend running Dmitry’s latest resonance testing branch and using the pul
    https://github.com/Klipper3d/klipper/issues/4560
    https://github.com/dmbutyugin/klipper/tree/resonance-test-methods

    ##Calculating your damping ratio
    ## Calculating your damping ratio
    Once you have your graph generated, you can pull the raw CSV values into your favorite graphing software. We will use the half power method to calculate the damping ratio.
    Find your highest resonant frequency and divide the amplitude at this point 1.41 (or the square root of 2). Note the frequency of the intersects at this amplitude.

    @@ -12,7 +12,7 @@ The second formula is `Q=1/(2*damping ratio)`
    From this you can solve for your damping ratio.
    Damping ratio = (f2-f1)/(2f0)

    ##Verifying your damping ratio
    ## Verifying your damping ratio
    You can then test your value. To do this, you need to make a small (hacky) change to input_shaper.py if you want to iterate them both at the same time.
    In input_shaper.py in the extras folder of your klipper directory, change the line `damping_ratio_x, damping_ratio_y)` on line 135 to `damping_ratio_x, damping_ratio_x)`
    You’ll need to completely restart your klipper instance with `systemctl restart klipper` via ssh. Or just restart your pi completely. Do not just restart via the UI of fluidd/mainsail
  17. kmobs renamed this gist Oct 3, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  18. kmobs revised this gist Oct 3, 2021. 1 changed file with 14 additions and 7 deletions.
    21 changes: 14 additions & 7 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -3,15 +3,22 @@ I recommend running Dmitry’s latest resonance testing branch and using the pul
    https://github.com/Klipper3d/klipper/issues/4560
    https://github.com/dmbutyugin/klipper/tree/resonance-test-methods


    ##Calculating your damping ratio
    Once you have your graph generated, you can pull the raw CSV values into your favorite graphing software. We will use the half power method to calculate the damping ratio.
    Find your highest resonant frequency and divide the amplitude at this point 1.41 (or the square root of 2). Note the frequency of the intersects at this amplitude.

    The two formulas that we will use are Q=f0/(f2-f1) where f0 is your highest resonant frequency, f2 is your higher frequency at the half power intersect, and f1 is the lower.
    The second formula is Q=1/(2*damping ratio)
    The two formulas that we will use are `Q=f0/(f2-f1)` where f0 is your highest resonant frequency, f2 is your higher frequency at the half power intersect, and f1 is the lower.
    The second formula is `Q=1/(2*damping ratio)`
    From this you can solve for your damping ratio.
    Damping ratio = (f2-f1)/(2f0)
    You can then test your value. To do this, you need to make a small (hacky) change to input_shaper.py if you want to iterate them both at the same time. In input_shaper.py in the extras folder of your klipper directory, change the line damping_ratio_x, damping_ratio_y) on line 135 to damping_ratio_x, damping_ratio_x)
    You’ll need to completely restart your klipper instance with systemctl restart klipper via ssh. Or just restart your pi completely. Do not just restart via the UI of fluidd/mainsail
    You can then use the resonance test STL and iterate your damping value with the tuning tower command. (TUNING_TOWER COMMAND=SET_INPUT_SHAPER PARAMETER=DAMPING_RATIO_X START=<some value> Factor= <some value>. I personally iterated from 0 to .11ish with a factor of .002.
    Damping ratio = (f2-f1)/(2f0)

    ##Verifying your damping ratio
    You can then test your value. To do this, you need to make a small (hacky) change to input_shaper.py if you want to iterate them both at the same time.
    In input_shaper.py in the extras folder of your klipper directory, change the line `damping_ratio_x, damping_ratio_y)` on line 135 to `damping_ratio_x, damping_ratio_x)`
    You’ll need to completely restart your klipper instance with `systemctl restart klipper` via ssh. Or just restart your pi completely. Do not just restart via the UI of fluidd/mainsail

    You can then use the resonance test STL and iterate your damping value with the tuning tower command.
    ```TUNING_TOWER COMMAND=SET_INPUT_SHAPER PARAMETER=DAMPING_RATIO_X START=<some value> Factor= <some value>```

    I personally iterated from 0 to .11ish with a factor of .002.
    You can then inspect the output and where you think it looks best. Your calculated value should get you in just about the right space if your IS graphs are clean.
  19. kmobs revised this gist Oct 3, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    I recommend running Dmitry’s latest resonance testing branch and using the pulses method:
    ## Prerequisite
    I recommend running Dmitry’s latest resonance testing branch and using the pulses method outlined below:
    https://github.com/Klipper3d/klipper/issues/4560
    https://github.com/dmbutyugin/klipper/tree/resonance-test-methods


    Once you have your graph generated, you can pull the raw CSV values into your favorite graphing software. We will use the half power method to calculate the damping ratio.
    Find your highest resonant frequency and divide the amplitude at this point 1.41 (or the square root of 2). Note the frequency of the intersects at this amplitude.

  20. kmobs created this gist Oct 3, 2021.
    15 changes: 15 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    I recommend running Dmitry’s latest resonance testing branch and using the pulses method:
    https://github.com/Klipper3d/klipper/issues/4560
    https://github.com/dmbutyugin/klipper/tree/resonance-test-methods

    Once you have your graph generated, you can pull the raw CSV values into your favorite graphing software. We will use the half power method to calculate the damping ratio.
    Find your highest resonant frequency and divide the amplitude at this point 1.41 (or the square root of 2). Note the frequency of the intersects at this amplitude.

    The two formulas that we will use are Q=f0/(f2-f1) where f0 is your highest resonant frequency, f2 is your higher frequency at the half power intersect, and f1 is the lower.
    The second formula is Q=1/(2*damping ratio)
    From this you can solve for your damping ratio.
    Damping ratio = (f2-f1)/(2f0)
    You can then test your value. To do this, you need to make a small (hacky) change to input_shaper.py if you want to iterate them both at the same time. In input_shaper.py in the extras folder of your klipper directory, change the line damping_ratio_x, damping_ratio_y) on line 135 to damping_ratio_x, damping_ratio_x)
    You’ll need to completely restart your klipper instance with systemctl restart klipper via ssh. Or just restart your pi completely. Do not just restart via the UI of fluidd/mainsail
    You can then use the resonance test STL and iterate your damping value with the tuning tower command. (TUNING_TOWER COMMAND=SET_INPUT_SHAPER PARAMETER=DAMPING_RATIO_X START=<some value> Factor= <some value>. I personally iterated from 0 to .11ish with a factor of .002.
    You can then inspect the output and where you think it looks best. Your calculated value should get you in just about the right space if your IS graphs are clean.