Klipper Firmware Migration: From Marlin to Klipper — Pressure Advance, Input Shaper, and Web Interface — 2026 Guide

Marlin works. It’s been the standard for a decade, it runs on every board, and it prints fine. But the moment you try Klipper, you realize what you’ve been missing: print speeds 2–3x faster with better quality, a web interface that doesn’t require OctoPrint plugins, and firmware changes that don’t require recompiling and reflashing. After migrating six printers from Marlin to Klipper, here’s the complete walkthrough.

What Klipper Does Differently

Marlin runs kinematics calculations on the printer’s mainboard MCU — typically an 8-bit or 32-bit microcontroller with limited processing power. Klipper offloads all trajectory planning, kinematics, and motion math to a Raspberry Pi (or any Linux computer), sending pre-calculated step timing commands to the printer board. The MCU becomes a “dumb” step generator running at maximum precision.

The result: smoother motion at higher speeds, because the Pi can calculate complex trajectories including input shaping and pressure advance in real time, while the MCU focuses exclusively on precise step pulse timing down to 25 nanoseconds.

Hardware Requirements

Component Minimum Recommended Notes
Host computer Raspberry Pi Zero 2 W Raspberry Pi 4B (2GB+) Any Linux SBC works. Pi 4 handles webcam streaming better
Printer mainboard Any 32-bit board BTT SKR Mini E3 V3, BTT Octopus 8-bit boards work but limit step rates
USB cable Data-capable micro-USB or USB-C Shielded, ferrite choke Generic charge-only cables cause communication errors
ADXL345 accelerometer Not required Included in input shaper kits Required for automatic input shaper calibration

The Pi Zero 2 W can run Klipper but struggles with webcam streaming and multiple concurrent features. If you want a camera, timelapse, and the web interface to feel responsive, use a Pi 4.

Step 1 — Install Klipper on the Raspberry Pi

Use KIAUH (Klipper Installation And Update Helper) — it automates the entire toolchain:

sudo apt update && sudo apt upgrade -y
sudo apt install git -y
cd ~
git clone https://github.com/dw-0/kiauh.git
cd kiauh
./kiauh.sh

From KIAUH’s menu:
1. Install → Klipper
2. Install → Moonraker (API server)
3. Install → Mainsail (web interface) or Fluidd (lighter alternative)
4. Install → Crowsnest (webcam support, optional)

KIAUH handles dependencies, creates systemd services, and sets up the initial configuration directory structure. The entire process takes about 15 minutes on a Pi 4.

Step 2 — Flash the Printer Mainboard

This is the step where most migrations fail. Every board has a different flashing method. The three most common:

BTT SKR Mini E3 V3 (Ender 3 / CR-10 class):

cd ~/klipper
make menuconfig  # Select STM32G0B1, 8KiB bootloader, USB communication
make
# Copy klipper.bin to SD card, rename to firmware.bin, insert in printer, power on

BTT SKR V1.4 / Octopus (STM32F4):

make menuconfig  # Select STM32F429, 32KiB bootloader, USB communication
make
# Flash via DFU: hold boot button, connect USB, run:
sudo dfu-util -a 0 -s 0x08000000:leave -D ~/klipper/out/klipper.bin

Creality 4.2.2 / 4.2.7 (GD32F303, Ender 3 V2 / Ender 5):

make menuconfig  # Select GD32F303, 28KiB bootloader, serial (USART1 PA10/PA9)
make
# Copy to SD as firmware.bin, power cycle printer

The critical detail: Klipper firmware replaces Marlin on the board. The board no longer runs any logic on its own — it only accepts step commands from the Pi. If the board shows up as /dev/serial/by-id/usb-Klipper_* after flashing, it worked.

Step 3 — Configure printer.cfg

Klipper’s configuration is a single text file. No recompiling for changes. Here’s the essential structure for a Cartesian printer:

[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_...

[stepper_x]
step_pin: PB13
dir_pin: PB12
enable_pin: !PB14
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC0
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_y]
# ... similar

[stepper_z]
# ... similar

[extruder]
step_pin: PB3
dir_pin: !PB4
enable_pin: !PD1
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC8
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA0
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114

[heater_bed]
heater_pin: PC9
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182

[fan]
pin: PC6

[display]
lcd_type: st7920
cs_pin: PB8
sclk_pin: PB15
sid_pin: PB14
encoder_pins: ^PB10, ^PB9
click_pin: ^!PB11

Don’t write this from scratch. Klipper’s GitHub repository has verified config files for most common printers in config/. Start with the closest match and adjust pin assignments for your specific board.

Step 4 — Pressure Advance Calibration

Pressure Advance (Klipper’s term; Linear Advance in Marlin) compensates for filament compression in the extruder. Without it, corners bulge and lines over-extrude at start and stop points. The calibration procedure:

  1. Print a 100mm square with a single wall, 0.4mm line width, 0.2mm layer height, at 100mm/s.
  2. In Mainsail, open the console and send tuning commands during the print:
    SET_PRESSURE_ADVANCE ADVANCE=0.05
  3. Wait 10mm of extrusion, observe corners, increase by 0.01:
    SET_PRESSURE_ADVANCE ADVANCE=0.06
  4. Repeat until corners are clean with no bulge at the end of lines.
  5. The correct value eliminates the “bulge-stop” pattern. Too high causes under-extrusion at line start (gap). Too low leaves a bulge at line end.

Typical values: 0.04–0.06 for PLA with direct drive, 0.4–0.8 for PLA with Bowden, 0.05–0.10 for PETG direct drive, 0.1–0.3 for TPU.

Once found, add to [extruder] in printer.cfg: pressure_advance: 0.055

Step 5 — Input Shaper Calibration

Input shaping cancels ringing (ghosting) by applying a tuned counter-vibration to motion commands. Automatic calibration requires an ADXL345 accelerometer attached to the print head:

# Wire ADXL345 to Pi GPIO:
# VCC → 3.3V, GND → GND, CS → GPIO8 (SPI CE0), SDO → GPIO9 (SPI MISO)
# SDA → GPIO10 (SPI MOSI), SCL → GPIO11 (SPI SCLK)

# Add to printer.cfg:
# [adxl345]
# cs_pin: rpi:None
# spi_bus: spidev0.0
# [resonance_tester]
# accel_chip: adxl345
# probe_points: 100,100,20

# Run calibration:
TEST_RESONANCES AXIS=X
TEST_RESONANCES AXIS=Y
# In Mainsail, navigate to the resonance graph and run SHAPER_CALIBRATE

The tool recommends shaper type (MZV, ZV, EI, 2HUMP_EI, 3HUMP_EI) and frequency. MZV provides the best smoothing with slight smoothing of fine detail. EI provides less smoothing but slightly less detail softening. For most printers, MZV is the right choice.

Without an accelerometer, print a ringing test tower and measure the distance between ghost lines manually. This is tedious but works.

Parameter Comparison: Marlin vs Klipper Capabilities

Feature Marlin 2.1.x Klipper Advantage
Configuration changes Recompile + reflash Edit text file + RESTART Klipper
Print speed ceiling ~150mm/s (8-bit), ~250mm/s (32-bit) 300–600+ mm/s Klipper
Input shaping Manual tuning only Automatic with ADXL345 Klipper
Pressure/Linear Advance Per-extruder, fixed value Per-filament, adjustable mid-print Klipper
Web interface Requires OctoPrint Built-in (Mainsail/Fluidd) Klipper
Firmware ecosystem Standalone, works without Pi Requires host computer Marlin
Macro system G-code macros Python-like Jinja2 macros Klipper
Multi-MCU support No (single board) Yes (toolhead boards, multiple MCUs) Klipper

Common Mistakes & What Most Users Get Wrong

Mistake 1: Using a charge-only USB cable. The printer communicates with the Pi over USB serial. A cable that only carries power (common with cheap cables) produces a “mcu ‘mcu’: Unable to connect” error that looks like a firmware problem. Test with a known data-capable cable before reflashing.

Mistake 2: Forgetting to set rotation_distance correctly. Marlin uses steps/mm. Klipper uses rotation_distance (mm of belt/filament movement per full motor revolution). A Marlin value of 80 steps/mm does not directly translate to a Klipper rotation_distance of 80. Use the formula: rotation_distance = (full_steps_per_rotation × microsteps) / steps_per_mm. For a 1.8° stepper (200 full steps) with 16 microsteps: rotation_distance = (200 × 16) / steps_per_mm.

Mistake 3: Not calibrating PID after migration. Marlin and Klipper use different PID algorithms. The firmware change invalidates your old PID values. Run PID_CALIBRATE HEATER=extruder TARGET=210 and PID_CALIBRATE HEATER=heater_bed TARGET=60 before attempting any prints. Skipping this causes temperature oscillation of ±5°C that ruins first layers.

Mistake 4: Enabling pressure advance without tuning first. The default pressure_advance of 0 means it’s disabled. Setting an arbitrary value (a common “I saw someone use 0.1 online” mistake) without calibration causes dramatic under-extrusion at line ends and layer adhesion failures. Always calibrate per filament type — PLA and PETG have very different compression characteristics.

⚠️ Regulatory Notice: Modifying your 3D printer’s firmware by replacing Marlin with Klipper is a configuration change that may affect the printer’s safety certifications. In 2026, 3D printers sold in the EU must comply with CE machinery directives, which include thermal runaway protection. Klipper implements independent thermal runaway protection in firmware, but the configuration must be verified — test with PID_CALIBRATE and confirm the verify_heater section in printer.cfg is active. Always operate 3D printers in a well-ventilated area, especially when printing materials like ABS and ASA that release volatile organic compounds during extrusion. A smoke detector in the printing room is non-negotiable.

See Also

Klipper pairs well with hardware upgrades. If you’re considering an all-metal hotend to go with your new firmware, see our all-metal hotend upgrade guide. For the companion calibration you’ll need after migration, our PID autotune guide covers proper procedure. And if you’re chasing print speed, the input shaping calibration guide covers both manual and automatic methods.

A smooth Klipper migration starts with a reliable mainboard. The BTT SKR Mini E3 V3 has native Klipper support, silent TMC2209 drivers, and a dedicated USB port for Pi communication — it eliminates the serial communication gremlins that plague older boards on Klipper.

Leave a Comment

Scroll to Top