You’ve upgraded to Klipper and bumped print speeds to 120mm/s, but now every sharp corner leaves a ghost — faint vertical lines echoing the edge across your print. That’s ringing, caused by mechanical resonance in your printer’s motion system. Input shaping cancels these vibrations by pre-distorting the motion commands, and an ADXL345 accelerometer measures your printer’s exact resonant frequencies to tune the filter. No more guessing.
Input Shaping Calibration Walkthrough
Step 1: Wire the ADXL345 to Your Raspberry Pi
The ADXL345 is a 3-axis accelerometer that costs about $5. Wire it to the Pi’s GPIO pins:
| ADXL345 Pin | Raspberry Pi GPIO Pin |
|---|---|
| VCC | 3.3V (Pin 1) |
| GND | GND (Pin 6) |
| SDA | GPIO 2 / SDA (Pin 3) |
| SCL | GPIO 3 / SCL (Pin 5) |
| CS | 3.3V (Pull high for I2C mode) |
Mount the ADXL345 to your print head using a small bracket (printable STLs are all over Printables and Thingiverse) or zip-ties. The sensor must be rigidly attached — any play between the sensor and print head introduces false resonance readings. Double-sided tape works in a pinch but degrades measurement accuracy by 5-10%.
Enable I2C on the Pi:
sudo raspi-config
# Interface Options → I2C → Enable → Yes → Finish
sudo reboot
Verify the sensor is detected:
sudo apt install i2c-tools -y
i2cdetect -y 1
# Should show device at address 0x53
Step 2: Configure Klipper for the ADXL345
Add to printer.cfg:
[adxl345]
cs_pin: rpi:None
spi_speed: 2000000
spi_bus: spidev2.0
[resonance_tester]
accel_chip: adxl345
probe_points:
100, 100, 20 # Center of bed — adjust for your bed size
If connecting via I2C instead of SPI (the GPIO wiring above uses I2C), use:
[adxl345]
i2c_mcu: rpi
i2c_bus: i2c.1
Restart Klipper. Run ACCELEROMETER_QUERY in the console — it should return acceleration values on X, Y, and Z axes. If Z shows a steady ~9.8 m/s², the sensor is working (it’s measuring gravity).
Step 3: Run Resonance Testing
From the Mainsail console, run the X-axis test:
TEST_RESONANCES AXIS=X
The printer will vibrate the X-axis through a frequency sweep from ~5Hz to ~133Hz. This takes about 2 minutes. The test is loud — the printer deliberately excites mechanical resonances. Run it when no one is sleeping nearby.
Then run Y-axis:
TEST_RESONANCES AXIS=Y
Results appear in Mainsail under the “Resonances” section, or you can download the CSV files from the Machine page. The resonance graph shows amplitude peaks at specific frequencies — these are your printer’s resonant frequencies.
Step 4: Install the Input Shaper Plugin (For Non-Klipper Setups)
If you’re running Klipper, input shaping is built-in — skip to Step 5. For Marlin users, the Input Shaping plugin for OctoPrint uses the ADXL345 data to calculate filter parameters. Install it via OctoPrint’s Plugin Manager and follow the same mounting and testing procedure.
Step 5: Apply Input Shaper Settings
The resonance test output in the console suggests input shaper parameters. A typical recommendation:
Recommended shaper_type_x = mzv, shaper_freq_x = 48.2 Hz
Recommended shaper_type_y = zv, shaper_freq_y = 52.7 Hz
Add these to printer.cfg:
[input_shaper]
shaper_type_x = mzv
shaper_freq_x = 48.2
shaper_type_y = zv
shaper_freq_y = 52.7
Common shaper types explained:
– ZV (Zero Vibration): One cancellation impulse. Good for frequencies above 40Hz. Very little smoothing.
– MZV (Modified ZV): Two impulses. Better vibration suppression than ZV with slightly more smoothing. The default recommendation for most printers.
– EI (Extra Insensitive): Three impulses. Best vibration suppression, most corner smoothing. Use if ZV/MZV still shows ringing.
– 2HUMP_EI: Four impulses. Maximum suppression for printers with severe resonance (cheap frames, loose belts). Noticeable corner rounding.
Step 6: Print a Ringing Test
Print a test tower with sharp corners — the Klipper ringing tower model is on Printables. Print at your target speed (100-150mm/s external perimeters). Examine the surface under oblique lighting. If ringing/ghosting is gone, your shaper is tuned. If faint ghosts remain, re-run resonance testing with the ADXL345 mounted more securely, or try the next shaper type up (ZV → MZV → EI).
Input Shaping Parameter Table
| Shaper Type | Impulses | Vibration Reduction | Corner Smoothing | Best For | Min Recommended Frequency |
|---|---|---|---|---|---|
| ZV | 1 | Good | Minimal | Stiff frames (Voron, RatRig), high-resonance systems | >40 Hz |
| MZV | 2 | Better | Slight | Most Cartesian printers (Ender 3, CR-10, Prusa) | >25 Hz |
| EI | 3 | Excellent | Noticeable | Budget printers, loose belt systems | >20 Hz |
| 2HUMP_EI | 4 | Maximum | Obvious | Printers with severe resonance issues | >15 Hz |
| ZVD | 2 | Better than ZV | Minimal | High-speed CoreXY, compensated for frequency drift | >35 Hz |
Common Mistakes & How to Avoid Them
Mistake 1: Loose ADXL345 Mounting
A sensor attached with a single zip-tie or rested on the hotend without rigid mounting reads vibrations from the sensor rattling against its mount — not the printer’s resonances. You’ll get a “recommended” frequency of 20-30Hz on every axis because the sensor mount is ringing, not the printer.
Fix: Print or buy a rigid bracket that bolts to the toolhead. The sensor must move exactly with the print head — zero relative motion. After mounting, wiggle it by hand. If the sensor moves at all relative to the toolhead, remount it.
Mistake 2: Running Resonance Test With Loose Belts
A loose belt has a lower resonant frequency than a properly tensioned one. If you tune input shaping with loose belts, then tighten them, the shaper frequency is now wrong and ringing reappears.
Fix: Tension belts to the correct frequency first (110Hz for 6mm GT2 belts on most printers — pluck the belt and measure with a phone spectrum analyzer app). Then run resonance testing. Belt tension is a prerequisite, not an afterthought.
Mistake 3: Using the Same Shaper for X and Y
On Cartesian printers, the X and Y axes have different masses (bed vs gantry) and different belt paths. They almost always have different resonant frequencies. Using the same shaper on both axes leaves one axis under-damped.
Fix: TEST_RESONANCES produces separate recommendations for X and Y. Apply both. The X-axis recommendation is for the X motion system (toolhead moving left-right on most printers); Y is for bed movement on bedslingers.
Mistake 4: Chasing Perfect Ringing-Free Prints at 200mm/s
On a $200 printer, the mechanical stiffness ceiling limits achievable speeds regardless of input shaping. At 150mm/s and above, frame flex, V-wheel play, and Z-axis wobble become the dominant surface quality factors — input shaping can’t fix a frame that bends.
Fix: Input shaping is one tool. After tuning, if ringing persists above a certain speed, that’s your printer’s mechanical limit. Accept it or upgrade the motion system (linear rails, stiffer frame, dual Z).
⚠️ Safety Notice: 3D printers operate at high temperatures and involve moving mechanical components that can cause injury. The resonance testing procedure vibrates the printer at frequencies that can loosen screws and fasteners. After calibration, inspect all mechanical connections before printing. Follow the latest 2026 electrical safety standards and never leave a printer unattended during operation. Local regulations regarding workshop safety, electrical certification, and fire prevention vary by jurisdiction.
Input shaping works best on a mechanically sound printer. Belt tension is the foundation — see our 3D printer belt tensioning guide for frequency-based tensioning methods. And if you’re seeing artifacts that input shaping can’t fix, our over-extrusion diagnosis guide covers flow-related surface defects.
An ADXL345 accelerometer and a Raspberry Pi running Klipper unlock your printer’s true speed potential. We stock ADXL345 sensors, Raspberry Pi boards, and Klipper-compatible control boards at uavmodel — the complete input shaping stack for any printer upgrade.
