Ramblings of an aging IT geek
← Ramblings of an aging IT geek
hardware

the day klipper made my old printer fast

Moving my ageing 3D printer from stock Marlin to Klipper roughly doubled its usable speed, and the reasons why are more interesting than the numbers.

A 3D printer mid-print in a workshop

My printer is not a good printer. It's a budget bedslinger I've owned for years, with a frame that flexes if you look at it wrong and a control board whose 8-bit processor was elderly when I bought it. For most of that time I accepted that it was slow, because every time I pushed the speeds in the slicer the quality fell off a cliff. Corners rounded over, infill turned to spaghetti, and the layers developed a kind of seasick wobble.

Then I moved it to Klipper, and the same physical machine started printing nearly twice as fast at better quality. That sentence sounds like an advert, so let me explain why it's actually true, because the reasons are the interesting part.

the processor was the bottleneck, not the motors

The first thing to understand is what Klipper actually does. Stock firmware like Marlin runs everything on the printer's own microcontroller: parsing G-code, planning the moves, calculating accelerations, and generating the step pulses for the motors. On an 8-bit AVR that's a lot to ask, and the maths for things like pressure advance and proper acceleration planning is expensive. When you ask an old board to go fast, it simply can't compute the step timings quickly enough, so it falls behind and the motion gets ragged.

Klipper splits the job. The heavy thinking, all the kinematics and look-ahead planning, runs on a Raspberry Pi. The microcontroller is demoted to a dumb step-pulse generator that just executes timings the Pi has already worked out, down to the microsecond. Suddenly the slow processor isn't doing the slow work any more. The Pi has the headroom to plan moves properly, so the machine can run accelerations that the AVR would have choked on.

A cluttered 3D printing workshop bench

input shaping is the bit that feels like magic

The single biggest win was input shaping. Every printer frame has resonant frequencies, and when the toolhead changes direction sharply it rings like a struck bell. That ringing shows up in prints as ghosting or echoes next to sharp features. The traditional fix is to print slowly enough that the vibrations damp out between moves.

Input shaping instead measures those resonant frequencies, in my case with a cheap ADXL345 accelerometer strapped to the toolhead for an afternoon, and then shapes the motion commands to actively cancel the ringing. You run a calibration that vibrates the head across a sweep of frequencies, Klipper works out where your frame resonates, and from then on it pre-compensates.

[input_shaper]
shaper_freq_x: 41.8
shaper_type_x: mzv
shaper_freq_y: 36.2
shaper_type_y: mzv

Those numbers are specific to my wobbly frame; yours will differ. But the effect is that I can now run accelerations that would previously have left visible echoes on every corner, and the prints come out clean. The frame is just as flexible as it was. Klipper is simply driving it in a way that doesn't excite the wobble.

pressure advance fixed the corners

The other quality jump came from pressure advance. Molten plastic in the nozzle behaves like a slightly springy fluid under pressure. When the toolhead decelerates into a corner, the pressure that built up keeps oozing filament out, so you get blobs on the outside of corners and gaps on the inside as it recovers. Pressure advance models that lag and adjusts the extruder ahead of time, backing off before a corner and pushing in coming out of one.

I'd technically had a version of this in Marlin (linear advance), but on the old board it was unreliable and I'd given up on it. With the timing-critical work moved to the Pi it just works, and tuning it was a single test print with a tower of varying values.

what it cost

A Raspberry Pi I already had, an old phone as a webcam, and an evening of reading documentation. The accelerometer was a few pounds. No new motors, no new frame, no hotend upgrade. The printer that I'd written off as "fine for slow prints" now does a benchy in a fraction of the time it used to and the surface finish is genuinely better than stock.

The honest caveat: the initial setup is fiddlier than flashing a Marlin binary. You're editing a config file, wiring an accelerometer, and learning a new web interface (I went with Mainsail). If you want plug-and-play, this isn't it. But if you have an old printer gathering dust because it's too slow to be worth the wait, the bottleneck might not be the hardware you assumed. Mine was the processor all along, and the fix cost almost nothing.

Tools and printer parts on a workbench

I'm slightly annoyed I waited this long.