ADXL345 Module, 3-Axis-Accelerometer is a sensor module equipped with a a 3-axis accelerometer.
It’s used for input shaper calibration on klipper.
This product is already soldered and with dupont connectors and crimps to connect the ADXL345 to your raspberry pi.
Included:
- ADXL345 with 8 pin already soldered
- One Single row 8 pin dupont conector for this adxl345
- One Double row 2×4 pin dupont conector to connect the adxl345 to you your raspberry pi
- 12 dupont terminal crimps
Specification:
Input Voltage: | 3 V – 5 V |
Resolution: | 13-bit, 4 mg/LSB |
Range: | +/- 16 g |
Interfaces: | I2C, SPI |
Dimensions: | 20 mm x 14 mm x 3 mm |
All products are sent in a nice ESD anti static bag.
How to connect the adxl345 to your raspberry pi?
How to auto tune the input shaper?
First, don’t forget to tune pressure advance and all the other parameters. Inpute shaper should be the very last fine tunning proccess.
install the necessary dependencies via ssh:
~/klippy-env/bin/pip install -v numpy sudo apt update sudo apt install python3-numpy python3-matplotlib
install raspberry as a secondary mcu
cd ~/klipper/ sudo cp "./scripts/klipper-mcu-start.sh" /etc/init.d/klipper_mcu sudo update-rc.d klipper_mcu defaults cd ~/klipper/ make menuconfig
In the menu, set “Microcontroller Architecture” to “Linux process,” then save and exit.
To build and install the new micro-controller code, run:
sudo service klipper stop make flash sudo service klipper start
back to the mainsail, edit printer.cfg and add these lines at the very end of the file:
[mcu rpi] serial: /tmp/klipper_host_mcu [adxl345] cs_pin: rpi:None [resonance_tester] accel_chip: adxl345 probe_points: 150, 150, 20 # an example
save and restar.
test the connection between adxl345 and rapsberry. in mainsail terminal run/send this code:
ACCELEROMETER_QUERY
you should receive something similar to this format:
Recv: // adxl345 values (x, y, z): 470.719200, 941.438400, 9728.196800
if not. please re-check your wiring. something is wrong.
edit once again printer.cfg but now, this time, edit the printer section
[printer] kinematics: corexy max_accel: 10000 square_corner_velocity: 5.0
now…. let’s run the auto tune.
in mainsail terminal run this code:
SET_VELOCITY_LIMIT ACCEL_TO_DECEL=10000 SET_PRESSURE_ADVANCE ADVANCE=0 SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0 SHAPER_CALIBRATE
when it’s done run this code
SAVE_CONFIG
revert max accel and decel to 4000.
restart and it should be it 🙂