Skip to content

Stock VFA calibration

On the stock firmware

The VFA button on the stock touchscreen sends:

  1. G1 Z100, then G1 X130 Y130: the bed down and the head to the middle.
  2. STEPPER_RESONANCE_FACTORY_CALIBRATE, a macro in the stock printer.vibration.cfg.

That macro turns all compensation off, then calibrates X and Y with STEPPER_RESONANCE_SEARCH_CALIBRATE. For each ripple and each direction, the search:

  • moves the head back and forth along one motor's axis at the speed where that ripple should hit the resonance, worked out from a fixed 200 Hz (stepper_x_freq / stepper_y_freq). The macro's step that would measure the real frequency is commented out.
  • measures the vibration with no compensation, then probes four phases, then finer phases, then amplitudes, and settles on the best phase and amplitude. Each measurement is about 0.6 s from the middle of one move.
  • uses the larger of the two directions' amplitudes, because the motor has one amplitude for both.

The results are sent to the motors straight away. The macro's SAVE_CONFIG is commented out, and the stock touchscreen doesn't send one with it, so as far as we can tell the results last until the next restart. After that the factory-calibrated values in printer.cfg come back.

The stock config also has a STEPPER_RESONANCE_DAMP_ENABLE macro, but it sets fixed numbers rather than calibrated ones: X off, and one hard-coded set for Y. Anything that ran it would replace a calibration's results with those.

The calibration also doesn't check that its result is better than no compensation. It leaves the printer's acceleration at the test's 5000 mm/s², and the analysis code crashes if the accelerometer gives no usable data five times in a row.

The stock damping calibration

STEPPER_RESONANCE_FACTORY_CALIBRATE (what the stock VFA button sends) still calibrates the stock values (td1, td2, td4), with OpenCreator's fixes: it measures each motor's real resonance instead of assuming 200 Hz, uses the whole steady-speed part of each test move and measures a move again when the accelerometer dropped samples in it, moves the toolhead directly so a leftover M220 speed factor or G92 offset can't change the test, picks one amplitude for the least vibration over both directions, and keeps a ripple's values only if they're 5% better overall and no more than 10% worse in either direction. It puts the acceleration back afterwards. Those values only act on ripples the VFA correction has no table for, so it's no longer in the menus.

It takes AXIS=X or AXIS=Y (default both) and GRAPH=1. It holds the board fans at 50%, and for each motor sets the stock damping to zero and runs STEPPER_RESONANCE_AUTO_CALIBRATE STEPPER=stepper_x (or stepper_y). If that fails, the saved values are put back (MCLIB_APPLY_CALIBRATION). Its test speeds come from [stepper_resonance_tester] in printer.vibration.cfg (vel_range: 20, 300, 10), and the resonance it measures is saved as stepper_x_freq / stepper_y_freq by SAVE_CONFIG.

Use OpenCreator VFA calibration for the per-speed ripple tables. The stock damping calibration remains useful only for the older fixed-value correction path.

Side by side

Stock OpenCreator
Ripples corrected 1x, 2x, 4x per motor cycle 1x, 2x, 4x, 6x, 8x
Values One amplitude and a phase per direction for each Amplitude and phase per direction at each calibrated speed, at the speeds a sweep finds worst
Current control lag Not accounted for, so a value only fits the speed it was tuned at Compensated, so the correction holds at every speed
Checked against the old values No Yes, per ripple: new, old or off, whichever wins both alternating measurements by 5%
Saved No (lasts until restart) Yes, unless SAVE=0
Tools Must be docked by hand Docks a tool on the toolhead itself
Accelerometer failure Crashes Stops with a clear error