Skip to content

Ripple correction

A stepper motor doesn't turn perfectly evenly. Its detent torque and the shape of its current give it a small wobble at fixed multiples of its electrical cycle (four full steps). On the Creator 5 the strong ones are 2, 4, 6 and 8 times per cycle; 4 is once per full step. The wobble shakes the toolhead at those frequencies, so it moves with speed: at 10 mm/s the once-per-step wobble is at 49 Hz, at 20 mm/s at 99 Hz. That is most of the hum you hear at printing speeds.

Ripple correction adds a small opposite current to each motor at those multiples, timed to the motor's position. What the motor needs is the same at every speed, but the mainboard's current control lags behind what it's told, more so the faster the ripple. So the mainboard works out that lag from its own settings and sends each correction ahead of it, by the right amount for the current speed. A correction measured at slow speed then holds at fast speed: each multiple has up to six calibrated points, and past the fastest one the last value carries on instead of fading out. That covers travel speeds up to about 560 mm/s of belt travel, where the mainboard's high-speed mode takes over.

It is calibrated per motor, and per direction of travel, with the toolhead accelerometer. Run VFA from Calibrations in Fluidd or on the touchscreen, or send VFA_MOTORS; the full procedure is in OpenCreator VFA calibration, and all options are in VFA commands.

For each motor the test moves along the diagonal that turns only that motor. A quick sweep finds where it vibrates most, and calibration measures the 1, 2, 4, 6 and 8 times ripples together at up to six of those speeds. Each speed prints the vibration before and after, in nm:

stepper_x at 15 mm/s motor (nm): h2 fwd 2002.7 -> 63.0, rev 2063.6 -> 73.6; h4 fwd 2186.9 -> 162.7, rev 1321.3 -> 248.1; ...

Run it again after changing motors or belts. Corrections saved before Beta 1 (ripple_<n> in printer.cfg) are ignored, because they had the lag inside them; the new ones are saved as vfa_<n>. While a motor has only old ones, Klipper lists a warning, and every start shows a red console error and a RECALIBRATE VFA NOW dialog with a red Calibrate now button.

How it finds the correction

Each multiple shakes the toolhead at its own frequency, so one move measures all of them. At each speed it measures with the corrections as they are, then with two small test corrections on every multiple at once; the vibration changes in proportion, which gives the correction that cancels each one. Two more moves refine them together, and a correction is only kept if it takes off at least 20%. Both directions are measured on the same out-and-back move, and each speed starts from the last one's corrections. A multiple is only calibrated at a speed where its frequency is between 20 and 700 Hz: below 20 Hz the accelerometer's noise swamps it. Corrections are capped at 0.06 A; good ones on the Creator 5 stay under 0.05 A.

Then it checks the mainboard's lag: if any were left over, each multiple's corrections would turn steadily with speed. It tries delays from 0 to 400 µs and takes the one that makes them agree best, but only if it tightens them by at least 20%; otherwise the old delay stays. It saves it with them (vfa_delay).

Last, the new corrections, the old ones and none at all are measured alternately (old, new, off, off, new, old), so a drift during the run weighs on all three alike. The 1x and 2x multiples are measured at the calibrated speeds: their corrections change slowly with speed, and the quick sweep's short moves are too noisy for them. The 4x to 8x multiples are measured over the quick sweep's 20 speeds, with each reading's noise taken off: between its points the table is interpolated and past its ends held, their corrections turn fast with speed, and before the check covered the sweep, tables that were best at every calibrated speed added vibration at 10 and 20 mm/s. Each multiple is judged on its own: it takes the new correction only if that beats the old one in both pairs and by at least 5% on average. Then, per direction, if no correction beats the chosen one the same way, that direction is turned off. When the delay changed, old or new is first chosen for all multiples together, since old corrections only fit their own delay. If nothing changes, the old correction stays, nothing is saved, and the console says the calibration didn't reduce the vibration. Otherwise it prints, per multiple, which it kept and the mean vibration with the new, the previous and no correction, forward and reverse.

MCLIB_RIPPLE_MEASURE STEPPER=stepper_x SPEED=30 shows the vibration at each multiple at one speed, and MCLIB_SET_RIPPLE STEPPER=stepper_x shows the saved corrections and delay. How the mainboard applies them is on MCLib and motor control.

With stock VFA compensation

Stock VFA compensation corrects the 1, 2 and 4 times ripples with one value each. On the mainboard both are now one correction: a ripple with a calibrated table uses the table at every speed, and one without uses its VFA value as before. See Stock VFA calibration for that older path.

Fans during calibration

Calibration holds the mainboard and power supply fans at 50% and waits for them to settle before measuring, like input shaper and VFA calibration do. Otherwise they speed up as the mainboard warms during the test, and their changing vibration throws the measurements off. The normal temperature- and load-based control is described in Sensors and safety.