Klipper + ADXL345 Input Shaper guide: Difference between revisions
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
# <blockquote><code>sudo cp ~/klipper/scripts/klipper-mcu-start.sh /etc/init.d/klipper_mcu</code></blockquote> | # <blockquote><code>sudo cp ~/klipper/scripts/klipper-mcu-start.sh /etc/init.d/klipper_mcu</code></blockquote> | ||
# <blockquote><code>sudo update-rc.d klipper_mcu defaults</code></blockquote> | # <blockquote><code>sudo update-rc.d klipper_mcu defaults</code></blockquote> | ||
# Rebuild the microcontroller code | # Rebuild the microcontroller code: | ||
# <blockquote><code>cd ~/klipper/</code></blockquote> | # <blockquote><code>cd ~/klipper/</code></blockquote> | ||
# <blockquote><code>make menuconfig</code></blockquote> | # <blockquote><code>make menuconfig</code></blockquote> | ||
# Select "Micro-controller Architecture (Linux process)" | |||
# Select "(X) Linux process" - make sure the X is set. | |||
# Press Q | |||
# Respond Yes to save changes. | |||
# Stop the klipper service: | |||
# <blockquote><code>sudo service klipper stop</code></blockquote> | |||
# Build and flash the new code to the microcontroller. | |||
# <blockquote><code>make flash</code></blockquote> | |||
# Start the klipper service again. | |||
# <blockquote><code>sudo service klipper start</code></blockquote> | |||
# Make sure the Linux SPI driver is enabled: | |||
# <blockquote><code>sudo raspi-config</code></blockquote> | |||
# Select "3 Interface Options" | |||
# Select "P4 SPI" | |||
# Respond Yes to the question "Would you like the SPI interface to be enabled?" | |||
# Respond Ok to the information that "The SPI interface is enabled" | |||
# Press TAB twice to mark the "Finish" button. | |||
# Press Enter. | |||
# Open your klipper configuration file in your favorite linux text-editor. I use nano. | |||
# <blockquote><code>nano ~/printer.cfg</code></blockquote> | |||
# | # | ||
# | # | ||
Line 26: | Line 46: | ||
# | # | ||
# | # | ||
<pre> | |||
[mcu rpi] | |||
# | serial: /tmp/klipper_host_mcu | ||
[adxl345] | |||
cs_pin: rpi:None | |||
[resonance_tester] | |||
accel_chip: adxl345 | |||
probe_points: | |||
150,150,20 # an example | |||
</pre> | |||
=== Credits === | === Credits === | ||
I wrote this guide using NERO 3Ds Youtube video as inspiration, so I hade the commands needed handy to cut'n paste into my Raspberry Pi when ever I want to rerun the calibration. | I wrote this guide using NERO 3Ds Youtube video as inspiration, so I hade the commands needed handy to cut'n paste into my Raspberry Pi when ever I want to rerun the calibration. |
Revision as of 10:34, 27 November 2021
Guide
- Aquire an ADXL345
- Solder 6 wires on to the ADXL345.
- 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!
- 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 ;-)
- Install the software - if you havent done so already.
- Update your Raspberry Pi:
sudo apt update -y
sudo apt upgrade -y
- Install "numpy" - Note: this will take quite some time - NERO says 20 minutes. It was faster on my Raspberry Pi 4 but still...
~/klippy-env/bin/pip install -v numpy
- Install additional dependencies
sudo apt install python-numpy python-matplotlib
- Configure your Raspberry Pi as a secondary MCU - Note: I got this working together with screen on my Creality Ender 5 Plus :-)
sudo cp ~/klipper/scripts/klipper-mcu-start.sh /etc/init.d/klipper_mcu
sudo update-rc.d klipper_mcu defaults
- Rebuild the microcontroller code:
cd ~/klipper/
make menuconfig
- Select "Micro-controller Architecture (Linux process)"
- Select "(X) Linux process" - make sure the X is set.
- Press Q
- Respond Yes to save changes.
- Stop the klipper service:
sudo service klipper stop
- Build and flash the new code to the microcontroller.
make flash
- Start the klipper service again.
sudo service klipper start
- Make sure the Linux SPI driver is enabled:
sudo raspi-config
- Select "3 Interface Options"
- Select "P4 SPI"
- Respond Yes to the question "Would you like the SPI interface to be enabled?"
- Respond Ok to the information that "The SPI interface is enabled"
- Press TAB twice to mark the "Finish" button.
- Press Enter.
- Open your klipper configuration file in your favorite linux text-editor. I use nano.
nano ~/printer.cfg
[mcu rpi] serial: /tmp/klipper_host_mcu [adxl345] cs_pin: rpi:None [resonance_tester] accel_chip: adxl345 probe_points: 150,150,20 # an example
Credits
I wrote this guide using NERO 3Ds Youtube video as inspiration, so I hade the commands needed handy to cut'n paste into my Raspberry Pi when ever I want to rerun the calibration.