Notifications
Clear all

Input Shaper Calibration with ADXL345  

  RSS
MustafaA
(@mustafaa)
Member
Input Shaper Calibration with ADXL345

Hi,

I've been working for a way to calculate Input Shaper values for my beloved Prusa Mini+ with modified extruder and hotend. My machine was preassembled but had bad XZ skew from the beginning. We learned to work together but I had some spare time and spare accelerometer so I decided why not!

ADXL345 taped on Prusa Mini

I attached ADXL345 on the Y axis, as the default factory setting is MZV with 32 Hz and there were no changes made in the Y axis, I tried to see if I can match it. I believe printing the calibration lines would be better so that will be my next step. I just opened this topic for other curious people that might try this.

I'm attaching the GCode I generated for vibrating the Mini, along with how I collected the data. I'm not sure how I can attach all these as it doesn't allow me to upload arbitrary files so I'm uploading them to IPFS for now.

https://ipfs.io/ipfs/bafybeif6sn2ymblidzd2mnumwjliebi7slu45knigiibkx7pjhz6mr6yx4/

y_resonance_chirp_p.gcode -> GCODE file for vibration

pico.py -> Code that is running on RPi Pico, has wirings on top commented

adxl_fft_quicktest.py -> Script that will be run on our PC to collect ADXL345 data, and save it to csv.

to_klipper_raw.py -> Converts our collected csv format to klippers input calibration script

As I did not want to fiddle with FFTs and power spectras that much, I decided to try using a script in the Klipper repository.

I'm attaching the plot it generated below, so far I'm not very confident in the values it outputted, I'm not sure if my vibration GCode is optimal here.

Commands to use for collecting your own data with the exact same setup

For collecting after running the gcode

python adxl_fft_quicktest.py --port COM4 --seconds 70 --channel y --low 10 --high 300 --save here.csv

For converting to Klipper format

python to_klipper_raw.py here.csv  raw_data_y_custom.csv

And after cloning/downloading the Klipper repo to your PC

python klipper/scripts/calibrate_shaper.py raw_data_y_custom.csv -o shaper_y.png

And below is my graph

Since I don't have a ground truth yet, I can't exactly say if this is the best solution out there, I will update after I do the manual calibrations with ringing towers etc.

Posted : 20/09/2025 11:02 am
1 people liked
Share: