Klipper + ADXL345 Input Shaper guide: Difference between revisions

From munkjensen.net/wiki
No edit summary
Line 50: Line 50:
# You should get a resonse that looks like this:
# You should get a resonse that looks like this:
# <blockquote><code>Recv: // adxl345 values (x, y, z): 611.934960, 305.967480, 11473.780500</code></blockquote>
# <blockquote><code>Recv: // adxl345 values (x, y, z): 611.934960, 305.967480, 11473.780500</code></blockquote>
# You are now ready to run the actual test on the two axis.
=== You are now ready to run the actual tests on the two axis. ===
# "Home" your printer:
# "Home" your printer:
# Issue the "G28 X0 Y0 Z0" command in your klipper terminal window - I use OctoPrint for this.
# Issue the "G28 X0 Y0 Z0" command in your klipper terminal window - I use OctoPrint for this.

Revision as of 11:00, 27 November 2021

Guide

  1. Aquire an ADXL345
  2. Solder 6 wires on to the ADXL345.
  3. Monut the ADXL to you Extruder. If you got a moving printbed as X you need to move the ADXL345 halfway into the calibration guide. Watch NEROs video!
  4. Connect the 6 wires to your Raspberry Pi - DO it correct please or you COULD risk frying either your ADXL345, Your Raspberry Pi... or both ;-)
  5. Install the software - if you havent done so already.
  6. Update your Raspberry Pi:
  7. sudo apt update -y

  8. sudo apt upgrade -y

  9. Install "numpy" - Note: this will take quite some time - NERO says 20 minutes. It was faster on my Raspberry Pi 4 but still...
  10. ~/klippy-env/bin/pip install -v numpy

  11. Install additional dependencies
  12. sudo apt install python-numpy python-matplotlib

  13. Configure your Raspberry Pi as a secondary MCU - Note: I got this working together with screen on my Creality Ender 5 Plus :-)
  14. sudo cp ~/klipper/scripts/klipper-mcu-start.sh /etc/init.d/klipper_mcu

  15. sudo update-rc.d klipper_mcu defaults

  16. Rebuild the microcontroller code:
  17. cd ~/klipper/

  18. make menuconfig

  19. Select "Micro-controller Architecture (Linux process)"
  20. Select "(X) Linux process" - make sure the X is set.
  21. Press Q
  22. Respond Yes to save changes.
  23. Stop the klipper service:
  24. sudo service klipper stop

  25. Build and flash the new code to the microcontroller.
  26. make flash

  27. Start the klipper service again.
  28. sudo service klipper start

  29. Make sure the Linux SPI driver is enabled:
  30. sudo raspi-config

  31. Select "3 Interface Options"
  32. Select "P4 SPI"
  33. Respond Yes to the question "Would you like the SPI interface to be enabled?"
  34. Respond Ok to the information that "The SPI interface is enabled"
  35. Press TAB twice to mark the "Finish" button.
  36. Press Enter.
  37. Open your klipper configuration file in your favorite linux text-editor. I use nano.
  38. nano ~/printer.cfg

  39. copy the Additional lines below.
  40. paste the Additional lines into your klipper configuration file above the [mcu] section.
  41. In the [printer] section set max_accel: to 10000
  42. In the [printer] section set max_accel_to_decel: to 10000
  43. Save the changes in the klipper configuration file.
  44. Exit the texteditor.
  45. Issue the "restart" command in your klipper terminal window - I use OctoPrint for this.
  46. Software is now fully installed and configured.
  47. Test if the ADXL345 is recognised and talking with Klipper.
  48. Issue the "ACCELEROMETER_QUERY" command in your klipper terminal window - I use OctoPrint for this.
  49. You should get a resonse that looks like this:
  50. Recv: // adxl345 values (x, y, z): 611.934960, 305.967480, 11473.780500

You are now ready to run the actual tests on the two axis.

  1. "Home" your printer:
  2. Issue the "G28 X0 Y0 Z0" command in your klipper terminal window - I use OctoPrint for this.
  3. Run the test on X axis:
  4. Issue the "TEST_RESONANCES AXIS=X" command in your klipper terminal window - I use OctoPrint for this.
  5. Run the test on Y axis:
  6. Issue the "TEST_RESONANCES AXIS=Y" command in your klipper terminal window - I use OctoPrint for this.

Additional lines

[mcu rpi]
serial: /tmp/klipper_host_mcu

[adxl345]
cs_pin: rpi:None

[resonance_tester]
accel_chip: adxl345
probe_points:
    150,150,20  # This is where the extruder will be positioned during the resonance test.

Credits

I wrote this guide using NERO 3Ds Youtube video as inspiration, so I had the commands needed handy to cut'n paste into my Raspberry Pi when ever I want to rerun the calibration.