Klipper is a 3D printer “firmware” that decouples motor timings and core kinematics from Gcode parsing and path optimization, leaving low-end MCUs to actually drive the servos running a very small core (based on Marlin) while a beefier controller (typically a Raspberry Pi) performs all the high-level calculations and runs all the UI.
One of the major quality of life improvements it brings (besides faster printing speeds and higher quality thanks to bed leveling, input shaping and other optimizations) is the ability to reconfigure your printer by just editing a configuration file (instead of re-flashing all of the defaults), and since it is largely written in Python, it has sprouted a veritable cornucopia of tooling and add-ons.
Flashing Steps - KP3S Pro
This is what I do to update my KP3S Pro, which runs off a Pi 3B:
make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32F103) --->
[ ] Only 10KiB of RAM (for rare stm32f103x6 variant) (NEW)
[ ] Disable SWD at startup (for GigaDevice stm32f103 clones)
Bootloader offset (28KiB bootloader) --->
Clock Reference (8 MHz crystal) --->
Communication interface (Serial (on USART3 PB11/PB10)) --->
(250000) Baud rate for serial port
(!PC6, !PD13) GPIO pins to set at micro-controller startup
make clean; make
./scripts/update_mks_robin.py ./out/klipper.bin ./out/Robin_nano.bin
Then plug in the accelerometer and run the calibration.
Flashing Steps - Prusa
This is what I do to update my Prusa, which also runs off a Pi 3B:
cd klipper
# RP2040 Accelerometer
make menuconfig # select RP2040
make clean; make # it will output to out/klipper.uf2
dmesg # hold down Boot button and re-insert USB cable
sudo mount /dev/sda1 /mnt
sudo cp out/klipper.uf2 /mnt
sudo umount /mnt # will automatically re-attach as ttyACM1
# verify working by resetting and issuing ACCELEROMETER_QUERY
# atmega2560
make menuconfig # select ATmega AVR -> atmega2560
make clean; make # it will output to out/klipper.elf.hex
sudo service klipper stop
FLASH_DEVICE=/dev/ttyUSB0 make flash
sudo service klipper start
# verify working by checking version number
# Linux process (deprecated since I no longer use GPIO accelerometers)
make menuconfig # select linux process
make clean; make # it will output to out/klipper.elf
sudo service klipper stop
make flash
sudo service klipper start
# verify working by checking version number
Resources
Category | Date | Link | Notes |
---|---|---|---|
Front-Ends | 2022-07 | Mainsail | My web UI of choice |
Macros | 2023-11 | jschuh/klipper-macros | A collection of useful macros |
Plugins | 2024-03 | Adaptive Bed Mesh | Another approach to localized bed leveling |
2023-04 | Adaptive Mesh Leveling and Purging | Very clever way to do localized bed leveling |