Installing Klipper on Prusa i3 mk3
Innhold
Installation of the π and printer
Introduction
The Prusa i3 mk3 series originally runs Prusa's own firmware, which is based on Marlin. Marlin works well, but it's a small and by today's standards, old microcontroller in the mk3 (and earlier) are Atmega controllers. In the mk3(s), it's an ATmega2560, the same chip used in the Arduino Mega 2560. Asking such a small thing to do all the heavy lifting, is unfair!
Klipper architecture
Where Marlin is a monolithic build, Klipper is built on a two-level model where the tiny microcontroller in the printer is used for the realtime jobs, but only those. Then another, much larger and several hundred (or thousand) times more power than the tiny microcontroller. We're obviously talking about a Raspberry pi or similar SBC. In this article, I'll focus on the π. According to my and others testing, one should see a performance gain of about 50-100% with such an upgrade.
Installation
The installation is rather straight forward:
- Our current solution uses a Raspberry Pi Zero W with Octoprint, chosen since it fits neatly behind a cover on the Prusa RAMBo controller. This has a single core clocked at 700MHz and 512MB RAM. This is probably just enough, but may be a bit low if you want to do some video streaming on top of the printing. We chose to switch to a Raspberry Pi Zero 2 W after a a member came by with some. It's way faster CPU-wise, but still only has 512MB RAM. Low, but it'll probably do.
- Grab an SD card of 16GB or more (64 is nice) and install MainsailOS. It's readily available in the Raspberry Pi Imager. Choose the Raspbery pi you're using from the menus, choose "Other specific-purpose OS", "3D printing" and then "Mainsail OS". Choose the card, accept, fill out everything, accept, blabla, you're done.
- Start the π from the SD card and login. If you have chosen a temporary hostname (like klippertest42), you'll need to reset cloud-init. If you're on a pi zero, you really, really should reduce the amount of memory reserved for the GPU, since it's a lot.
- To change the hostname:
- sudo hostnamectl set-hostname newname
- sudo sed -i 's/oldname/newname/g' /etc/hosts
- sudo cloud-init clean
Old, Norwegian text below. This is not finished
- Åpne så /boot/firmware/config.txt med nano eller vim eller noe og se etter [pi0]. Der finner du gpu_mem=128. Siden en Pi Zero 2 W har 512MB minne, vil dette si at man allokerer 25% av minnet til stakkaren for å bruke til en GPU som bare skal sove søtt. Det er dårlig gjort! Det som i praksis da skjer, er at det funker, ish, å kjøre ting som det skal, helt til det kommer en automatisk oppdatering. Den vil jo spise minne, den også, som alt annet. Siden den bare er satt opp med 128 eller 256MB swap, så tryner den, gjerne midt i oppdateringa av kjerna, noe som gjør at den ikke klarer å boote igjen. Du kan alltids øke swap til 1 eller 2GB, evt pisse i buksa for å holde varmen, men løsninga er nok å redusere til gpu_mem=32. Da tåler den fint en oppgradering uten å krangle.
- Gi pi-en en omstart for å frigjøre GPU-minne som tidligere var holdt av.
- VIKTIG: Kjør en full oppgradering av alt. Denne må gå uavbrutt og gi den en omstart etterpå før du fortsetter!
- sudo apt-get -y update
- sudo apt-get -y dist-upgrade
- sudo apt-get autoremove
- sudo reboot