Optimizing Klipper Input Shaper with ADXL345 Accelerometers

Calibrate Klipper's Input Shaping using an ADXL345 accelerometer to eliminate print ghosting and ringing at high print accelerations.

Optimizing Klipper Input Shaper with ADXL345 Accelerometers

The open-source 3D printing community has seen a massive leap in speed performance thanks to the widespread adoption of Klipper firmware. Klipper offloads complex kinematic calculations to a host computer like a Raspberry Pi. However, pushing a 3D printer's acceleration past 5,000 mm/s squared introduces severe frame vibrations that appear as "ghosting" or "ringing" artifacts on the printed part's outer walls.

To cancel out these artifacts, Klipper utilizes an open-loop control algorithm called Input Shaping. The firmware pre-distorts the stepper motor motion pulses to counteract the natural resonant frequencies of the printer's mechanical frame. To calibrate this system precisely, makers mount a low-cost ADXL345 3-axis accelerometer directly to the toolhead and print bed.

The accelerometer communicates via an SPI interface, measuring raw acceleration data while the printer shakes each axis over a broad frequency sweep. Klipper analyzes this real-time vibration data, identifies the precise resonance spikes (typically between 30 and 60 Hz), and calculates the ideal input shaping mathematical model—such as MZV or EI—to apply to the motion planner. This tuning allows standard desktop printers to double or triple their print speeds without sacrificing dimensional accuracy or surface finish quality.