Your print has ghost lines trailing every sharp corner — echoes of the feature repeating at regular intervals across flat surfaces. That’s ringing, and it’s the physical resonance of your printer’s frame vibrating after every direction change. Input shaping cancels those vibrations before they reach the nozzle. The result: faster prints with fewer artifacts.
What Input Shaping Actually Does
When the print head changes direction, the motor applies force to accelerate it. The frame absorbs that force and vibrates at its natural frequency — typically 30-70Hz on bedslingers, 50-100Hz on CoreXY. That vibration transfers to the nozzle, which wiggles slightly for a few dozen milliseconds after each direction change, printing a ghost image of the corner.
Input shaping pre-compensates. It filters the motion commands so that the motor applies force in a pattern that cancels the frame’s natural vibration. The nozzle moves smoothly because the controller is actively fighting the resonance. Mathematically, it’s a convolution of the motion command with the inverse of the frame’s impulse response. But you don’t need the math — you need the measurement.
Step-by-Step: Measuring Resonance With an ADXL345
1. Hardware Required
- ADXL345 accelerometer module ($5 on AliExpress, $12 on Amazon)
- 4 Dupont wires (female-to-female, 20cm)
- Mounting bracket (print a clip that attaches to the nozzle or toolhead)
The ADXL345 is a 3-axis accelerometer with 13-bit resolution and ±16g range. It measures vibration up to 3200Hz — far above anything a 3D printer produces.
2. Wiring for Klipper
On a Raspberry Pi running Klipper (or a printer mainboard with SPI pins):
ADXL345 → Pi GPIO
VCC → 3.3V (pin 1)
GND → GND (pin 6)
CS → GPIO8 (pin 24, CE0)
SDO → GPIO9 (pin 21, MISO)
SDA → GPIO10 (pin 19, MOSI)
SCL → GPIO11 (pin 23, SCLK)
Add to printer.cfg:
[adxl345]
cs_pin: rpi:None
spi_bus: spidev0.0
[resonance_tester]
accel_chip: adxl345
probe_points: 150,150,20
3. Running the Resonance Test
Mount the ADXL345 to the nozzle using a printed clip. The accelerometer must be rigidly attached — tape or zip ties allow flex that creates false readings. Tighten the mounting screw.
In Klipper console:
SHAPER_CALIBRATE AXIS=X
SHAPER_CALIBRATE AXIS=Y
The printer vibrates each axis through a frequency sweep (usually 5-133Hz). The ADXL345 records acceleration data. Klipper analyzes the frequency peaks and recommends shaper parameters.
4. Reading the Results
The output shows the dominant resonance frequency for each axis and a recommended shaper type:
Fitted shaper 'zv' frequency = 48.8 Hz (vibrations = 4.2%, smoothing ~= 0.051)
Recommended shaper is mzv @ 48.8 Hz
“Vibrations” is the remaining vibration as a percentage of original — lower is better. Below 5% is excellent. “Smoothing” represents how much the shaper rounds sharp corners — below 0.1 is negligible.
Shaper Types and When to Use Them
| Shaper | Vibration Reduction | Smoothing | Best For |
|---|---|---|---|
| ZV (Zero Vibration) | Good | Lowest | Minimal smoothing trade-off |
| MZV (Modified ZV) | Better | Low | General purpose, best balance |
| EI (Extra Insensitive) | Best | Moderate | Frames with frequency drift (temperature-dependent) |
| 2HUMP_EI | Excellent | High | Very resonant frames, if MZV/EI can’t handle it |
| 3HUMP_EI | Maximum | Highest | Last resort for extremely resonant printers |
In practice, MZV at the measured frequency works for most printers. If your printer’s resonance frequency shifts when the enclosure heats up (common on enclosed CoreXY), use EI instead — it tolerates ±15% frequency drift without losing effectiveness.
Manual Tuning Without an Accelerometer
If you don’t have an ADXL345, print a ringing test tower and measure the artifacts. Print a 20mm square tower with sharp corners at increasing speeds (50mm/s, 75mm/s, 100mm/s). Measure the distance between ghost lines:
Ringing frequency (Hz) = print_speed (mm/s) / distance_between_lines (mm)
Set speed to 100mm/s. If the ghost lines are 2mm apart, your resonance is 50Hz. Enter this value manually in the input shaper config.
This method is approximate (±5Hz) but works. The ADXL345 is more accurate (±0.5Hz) and measures both axes in 2 minutes versus 20 minutes of printing towers. For $5, buy the accelerometer.
Configuration: Klipper vs Marlin
Klipper
Add to printer.cfg after measurement:
[input_shaper]
shaper_freq_x: 48.8
shaper_type_x: mzv
shaper_freq_y: 52.1
shaper_type_y: mzv
Klipper applies input shaping in firmware. No slicer changes needed. Increase print speed immediately — the shaper handles the resonance.
Marlin 2.1+
Marlin added input shaping in 2.1. Enable in Configuration_adv.h:
#define INPUT_SHAPING_X
#define INPUT_SHAPING_Y
#define SHAPING_FREQ_X 48.8
#define SHAPING_FREQ_Y 52.1
#define SHAPING_TYPE_X MZV
#define SHAPING_TYPE_Y MZV
Marlin’s implementation is less sophisticated than Klipper’s — it processes fewer samples and doesn’t auto-calibrate. But it works. Compile and flash after changing these values.
Parameter Table: Pre vs Post Input Shaping
| Metric | Without Shaping | With MZV Shaping | Improvement |
|---|---|---|---|
| Ringing amplitude (50mm/s) | Visible 3-4 ghost lines | Zero visible lines | 100% reduction |
| Ringing amplitude (100mm/s) | Severe, 5+ ghost lines | Barely visible, 1 faint line | 90% reduction |
| Print speed limit (acceptable quality) | 60mm/s | 120mm/s+ | 2x |
| XY dimensional accuracy | ±0.15mm | ±0.08mm | 47% better |
| Corner sharpness | Rounded from vibration | Sharp | Subjective but clear |
Common Mistakes & How to Avoid Them
Mistake 1: Measuring Resonance With Loose Belts
Loose belts shift the resonance frequency down and broaden the peak. Measure, tighten belts, and measure again. If the frequency changed by more than 5Hz, belts were loose during the first measurement. Always measure with properly tensioned belts — otherwise you’re tuning for a printer that doesn’t match what you’ll actually print on.
Mistake 2: Applying the Same Shaper to Both Axes
X and Y axes on a bedslinger have completely different moving masses. X moves the toolhead (light, high frequency). Y moves the bed (heavy, low frequency). They will have different resonance frequencies. Measure both axes separately and apply different shaper parameters to each.
Mistake 3: Not Re-Measuring After Mechanical Changes
Changed to a direct drive extruder? Added a BLTouch? Swapped to a heavier hot end? All of these change the moving mass and, therefore, the resonance frequency. Re-measure. A shaper tuned for a Bowden setup with a stock hot end is wrong after a direct drive conversion.
Mistake 4: Choosing ZV for “Minimal Smoothing” When You Need MZV
ZV has less smoothing — but if the resonance frequency drifts even 5Hz (which it will on a printer in an enclosure), ZV stops working and the ringing returns. MZV tolerates 10% frequency drift with minimal additional smoothing. It’s the safe choice for most printers. Reserve ZV for printers that print exclusively in temperature-controlled rooms without enclosures.
Mistake 5: Running the Test With the ADXL345 Loose
The accelerometer must be rigidly attached. A loose mount creates its own vibration signature that masquerades as a resonance peak. The slicer applies a shaper for that phantom frequency and makes ringing worse. Tighten the mounting screw. If possible, bolt the ADXL345 to the toolhead using an existing screw hole rather than a clip.
⚠️ Safety Notice: Input shaping tuning involves high-speed printer motion. Ensure all frame bolts are tight, belts are properly tensioned, and the printer is on a stable surface before running resonance tests. The vibration test sweeps through frequencies that can excite structural resonances — keep hands clear of moving parts. Ensure fire safety measures are in place, including smoke detectors and thermal runaway protection. Comply with your region’s electrical safety certifications.
For Klipper users, our Klipper firmware installation guide covers the complete migration from Marlin, including the resonance testing workflow. Pair input shaping with linear advance tuning for the full motion quality optimization stack.
When printing FPV drone parts that require tight tolerances — like the GoPro mounts we covered in our 3D printed FPV parts guide — input shaping makes the difference between a mount that fits perfectly and one that needs filing.
The KUSBA USB Accelerometer is a plug-and-play alternative to wiring an ADXL345 to GPIO pins. It connects via USB-C, appears as a serial device, and works with Klipper’s resonance tester with zero wiring. For builders who don’t want to deal with Dupont wires and GPIO pinout diagrams, the KUSBA saves 30 minutes of setup and eliminates the most common source of measurement errors — loose connections.
