Measure resonances with Raspberry Pi Pico - Guilouz/Klipper-Flsun-Speeder-Pad GitHub Wiki
You can use ADXL345 with FLSUN Speeder Pad for measuring Resonances via USB with a Raspberry Pi Pico.
Needed:
- Raspberry Pi Pico
- ADXL345 Accelerometer
- USB-A/Male to Micro-USB/Male Cable
- Cable, tin and soldering iron
Wiring:
-
Some dependencies are required to use ADXL345, install them with this following commands (one at a time):
sudo apt updatesudo apt install python3-numpy python3-matplotlib libatlas-base-dev libopenblas-dev -
Followed by this command to install Numpy in Klipper's environment:
~/klippy-env/bin/pip install -v numpy -
If you have an error when installing Numpy, follow this steps, if not continue:
Show / Hide
- Enter the following commands (one at a time):
sudo apt updatesudo apt full-upgrade -ysudo apt install --reinstall python2* -ysudo service klipper stopcd ~ && mv klippy-env klippy-env.bakcd ~ && virtualenv -p python2 klippy-envcd ~/klippy-envbin/pip install -r ../klipper/scripts/klippy-requirements.txt~/klippy-env/bin/pip install -v numpysudo service klipper start - Numpy should install correctly.
- Enter the following commands (one at a time):
-
It's also necessary to compile firmware for Raspberry Pico, enter the following commands (one at a time):
cd ~/klipper/make menuconfig -
Select these settings:

-
Then on your keyboard press the
Qkey thenYto save configuration. -
Enter the following commands to compile firmware (one at a time):
make cleanmake -
Plug Raspberry Pi Pico into one of the Speeder Pad's USB ports while holding down the
BOOTSELbutton. -
Type this commands to flash firmware (one at a time):
cd ~ && sudo mount /dev/sda1 /mntsudo cp /home/pi/klipper/out/klipper.uf2 /mnt/ -
Now disconnect and reconnect the accelerometer, without holding the
BOOTSELbutton this time to restart it in normal mode. -
Then, type this command to retrieve the serial:
cd ~ && ls /dev/serial/by-id/* -
You should see 2 serials appear, one is your printer serial an other is the Raspberry Pi Pico, the one with the mention
Klipper Rp2040:
-
Go to your Mainsail Web interface then click on
Machinetab. -
Open
adxl345_pico.cfgfile and edit following line with serial you have just obtained:serial: /dev/serial/by-id/usb-Klipper_rp2040_E6605481DB318D34-if00 -
Click on
SAVE & RESTARTat the top right to save the file. -
Then uncomment (remove the #) to the following line in the
printer.cfgfile to enable ADXL support:[include adxl345_pico.cfg] -
Click on
SAVE & RESTARTat the top right to save the file. -
You should see the
ADXL MCUconnecting to Klipper. -
You can test accelerometer by entering this command:
ACCELEROMETER_QUERY -
Something like this must be returned:
accelerometer values (x, y, z): 5551.544565, 7048.078582, -1924.535449 -
Enter this command to measure the noise of the accelerometer for each axis:
MEASURE_AXES_NOISE -
You should get some baseline numbers for the noise of accelerometer on the axes (should be somewhere in the range of ~1-100). Too high axes noise (e.g. 1000 and more) can be indicative of the sensor issues, problems with its power, or too noisy imbalanced fans.
-
To measure the resonances on X axis run
ADXL_AXE_Xmacro. -
To measure the resonances on Y axis run
ADXL_AXE_Ymacro.
โ If you encounter an error while measuring the resonances. Replace microsteps to 16 in printer.cfg file just for the duration of the test.
Note: After tests, it's better to disable the ADXL by commenting out the [include adxl345_pico.cfg] line again.
See more documentation here: Measuring Resonances | Klipper
