Servo Motor Tuning for CNC: Complete Step-by-Step Guide
Every CNC axis lives or dies by how well its control loops are configured. Servo motor tuning is the process of adjusting the gains and filters inside a servo drive so a motor follows the controller’s commands quickly, accurately, and without vibration. Done well, it delivers tight positioning, clean surface finish, and stable motion across the full feedrate range. Done poorly, it produces chatter marks, audible howl, thermal alarms, and following-error faults that halt production.
The reason tuning matters so much is that a servo axis is a closed loop fighting inertia, friction, and cutting forces in real time. If the loop reacts too slowly, the tool lags behind the path and part accuracy suffers. If it reacts too aggressively, the axis overshoots and oscillates, leaving witness marks on the workpiece and stressing the mechanics. The goal is not maximum aggressiveness — it is predictable, repeatable motion that holds up under load, shift after shift.
This article is the complete step-by-step procedure, from the innermost current loop out to the position loop, plus the feedforward and filtering that separate a merely stable axis from a genuinely precise one. Whether you are commissioning a new machine or troubleshooting an existing axis, the sequence below will get you to a reliable result without guesswork.
Understanding the Servo Control Loops Before You Tune
Almost every industrial servo runs three nested control loops, each wrapped around the one inside it. Understanding this hierarchy is the single most important prerequisite for servo motor tuning, because instability in an inner loop can never be fixed by adjusting an outer loop.
From innermost to outermost:
- Current (torque) loop — the fastest loop, running at the highest sample rate. It regulates motor phase current to produce a commanded torque. On modern drives it is usually configured automatically from the motor’s electrical parameters.
- Velocity loop — wrapped around the current loop. It compares commanded speed to the speed derived from encoder feedback and outputs a torque command. This loop is the primary source of dynamic stiffness and damping.
- Position loop — the outermost loop. It compares the commanded position to the actual encoder position and outputs a velocity command. It determines positional stiffness and how tightly the axis tracks the toolpath.
The rule that governs the whole procedure is simple: tune from the inside out. Set the current loop first, then close and tune the velocity loop, then close and tune the position loop. Each outer loop assumes the loop beneath it is already fast and stable. Skip that order and you will chase symptoms that have nothing to do with the parameter you are adjusting.
Before You Start — Prerequisites and Safety
Software cannot compensate for bad mechanics or bad feedback. Confirm the following before touching a single gain, or the tuning will be unstable and non-repeatable no matter what values you enter.
- Mechanical integrity. Check for backlash in couplings, pulleys, and the ball screw. Verify the motor mount is tight, bearings are sound, belts are correctly tensioned, and the screw is properly lubricated and aligned. Any looseness becomes resonance and hunting once the loop is closed.
- Encoder feedback and wiring. Encoder noise, signal dropouts, or poor grounding look identical to poor tuning — random vibration and jitter. Verify encoder resolution, shielding, and grounding first. Know your counts-per-revolution and the resulting resolution at the load, because it sets the realistic floor for following error.
- Inertia ratio. A load-to-motor inertia ratio kept in a moderate range simplifies control and improves robustness. Very high ratios make the axis far harder to stabilise and should be addressed in the mechanical design, not papered over in software.
- Safe limits. Set conservative torque limits, soft limits, and following-error thresholds before you move. Keep the E-stop within reach, clear the work envelope, and be ready for an axis that oscillates or runs away during early iterations.
- A way to measure. Tuning by ear alone is guesswork. Use the drive’s built-in scope or an external oscilloscope to capture position command versus feedback, velocity, and following error. You cannot optimise what you cannot see.
Step-by-Step Servo Motor Tuning Procedure
With the prerequisites confirmed, work through the loops in order. Move only one parameter at a time and re-test after each change.
Step 1 — Set the Current (Torque) Loop
The current loop is the foundation. On most modern digital drives it is derived automatically from the motor’s electrical constants — resistance, inductance, and the torque constant — either from a motor data file or a short auto-commutation routine. In the large majority of setups you should accept the drive’s calculated current-loop bandwidth rather than adjust it by hand.
Your job here is verification, not creativity: confirm the correct motor is selected, the encoder is aligned to the motor’s electrical angle, and the drive reports no current-loop faults. If the current loop is wrong, everything above it is built on sand. Once it is confirmed stable, leave it alone and move outward.
Step 2 — Tune the Velocity Loop
The velocity loop does most of the work in servo motor tuning, because it sets the axis’s dynamic stiffness and damping. It is typically a PI controller: a proportional gain that reacts to present velocity error, and an integral gain that eliminates steady-state error.
Start with the drive’s default or auto-tuned values, then refine:
- Raise the velocity proportional gain gradually. The axis should feel progressively stiffer and reject small disturbances more firmly.
- Keep increasing until you hear the onset of buzz or see high-frequency oscillation on the scope, then back off to a comfortable margin below that threshold. This is your stability limit for the velocity loop.
- Set the integral gain to remove the steady-state velocity error. Too little and the axis is sluggish to settle; too much and you introduce overshoot, low-frequency oscillation, and motor heating.
A well-tuned velocity loop responds crisply to a speed command with minimal overshoot and settles quickly. Resist the urge to push it to the ragged edge — a velocity loop tuned right at the vibration threshold will destabilise as soon as the machine warms up or the load changes.
Step 3 — Tune the Position Loop (Gain)
With a stiff, stable velocity loop underneath, close the position loop. The dominant term here is the position-loop proportional gain (often called Kp or servo gain), which sets how hard the axis pulls toward the commanded position and directly governs following error and positional stiffness.
Increase position gain incrementally and watch the following-error trace on a moderate move. Higher gain reduces following error and tightens tracking — up to the point where the axis begins to overshoot at the end of a move or shows sustained oscillation. Back off from that limit to leave a safe margin.
The gain your axis can tolerate depends heavily on its mechanics: rigid ball-screw and rack-and-pinion axes accept higher position gain, while belt-driven or compliant axes reach oscillation at much lower values. Do not copy a number from another machine.
Because the gain parameter deserves a treatment of its own, we cover its internal behaviour — the error-to-torque relationship, PID interaction, and how gain maps to stiffness — in a dedicated article. This guide is the complete tuning procedure; the gain page is the deep dive on that single parameter. See Radonix’s guide, Servo Motor Gain Explained, before you push position gain to its limit.
Suggested anchor text: “Servo Motor Gain Explained” or “how servo gain works in CNC.”
Step 4 — Add Feedforward and Reduce Following Error
Even a well-tuned position loop lags during constant-velocity and accelerating moves, because feedback loops only react after an error appears. Feedforward predicts the required command and applies it in advance, cutting following error dramatically without raising loop gain.
- Velocity feedforward injects a velocity command proportional to the commanded speed, collapsing the steady-state following error during constant-velocity segments. Increase it until following error during a constant-speed move approaches zero.
- Acceleration feedforward adds a torque command proportional to commanded acceleration, reducing the transient error spikes at the start and end of moves and during direction reversals.
Tune feedforward after the feedback loops are stable, and use the following-error trace as your guide. Correctly applied, feedforward is what lets a CNC axis track a curved path or a corner with the tool sitting on the commanded line rather than trailing behind it.
Step 5 — Verify With a Step/Move Test and Check Overshoot
Tuning is not finished until it is validated with real motion. Command a small step or a representative point-to-point move and capture the response on the scope.
Read the trace against these targets:
- Rise time — the axis should reach the commanded position quickly, without lag.
- Overshoot — minimal is ideal. Significant overshoot means the loop is too aggressive or under-damped; reduce gain or add damping.
- Settling — the axis should settle to the in-position window fast, with no ringing or hunting around the target.
- Following error — should stay well within your fault threshold throughout the move, not just at rest.
Then confirm the result under realistic conditions: run the move at production feedrates, with the actual load, and across the axis’s full travel. An axis that looks perfect in a short unloaded test can misbehave under cutting load or at a different point in its travel. Monitor motor current and temperature afterward — aggressive tuning can look precise on the scope while quietly overheating the motor.
Servo Motor Tuning Tips for Precision
Once the basic loops are stable, these servo motor tuning refinements push an axis from good enough to genuinely accurate.
Handle resonance deliberately. Mechanical resonance — a two-mass system formed by the motor, coupling, and load — puts a hard ceiling on how far you can raise gain. Sweep the axis across a range of speeds and note where vibration peaks; that is your resonant frequency. FFT analysis on the drive, where available, identifies it precisely.
Use notch filters at the resonant frequency. A notch filter attenuates a narrow band at the resonance, letting you raise loop gain further without exciting the mechanics. A general low-pass filter in the velocity or torque loop can suppress broadband high-frequency excitation, but it costs control bandwidth — use it sparingly.
Balance stiffness against stability. This is the central trade-off in servo motor tuning. More gain means a stiffer axis that rejects cutting forces and tracks tightly, but every increase erodes stability margin. Aim for the highest stiffness that still leaves comfortable margin against oscillation when the machine is warm and fully loaded — not the highest number that survives a cold, unloaded bench test.
Smooth the motion profile. Enabling an S-curve (jerk-limited) profile and trimming acceleration slightly reduces the shock that excites structural modes, often improving finish more than another round of gain tweaking.
Common Servo Motor Tuning Mistakes and How to Avoid Them
Most servo motor tuning problems trace back to a handful of recurring errors. Use this table to move from symptom to fix quickly.
| Symptom | Likely Cause | Fix |
| Audible buzz or high-frequency whine at standstill | Velocity or position gain too high; unfiltered resonance | Reduce gain to leave margin; apply a notch filter at the resonant frequency |
| Overshoot and ringing at end of moves | Loop too aggressive or under-damped; excessive integral gain | Lower position gain or integral term; add damping |
| Large following error during constant-speed moves | Insufficient feedforward | Add velocity feedforward; then acceleration feedforward for transients |
| Vibration only during direction reversal | Backlash, friction, or mechanical play | Fix mechanics first — preload the screw, address coupling backlash — before adding gain |
| Random jitter unrelated to gain changes | Encoder noise, dropouts, or grounding fault | Inspect encoder wiring, shielding, and grounding |
| Motor overheating after tuning | Over-aggressive gains or integral windup | Reduce gains; monitor RMS current; verify inertia ratio and sizing |
| Axis stable on the bench, unstable in production | Tuned unloaded and at wrong speed | Re-verify with real load, at production feedrate, across full travel |
The four mistakes worth calling out explicitly:
Over-gaining. Pushing gain to the point of vibration in pursuit of stiffness. It looks impressive briefly, then destabilises with temperature and load. Always tune for margin, not for the maximum number the axis will momentarily tolerate.
Ignoring the mechanics. No gain value fixes backlash, a loose coupling, a dry screw, or misalignment. If error grows on direction reversals, the problem is mechanical — correct it before returning to the loops.
Tuning at the wrong speed. An axis tuned only at low speed or at standstill can be unstable at rapid feedrates, where resonance and profile shock appear. Test across the full operating range.
Skipping load testing. Unloaded tuning is a starting point, not a result. The real inertia and cutting forces change the loop behaviour, so validation under actual load is non-negotiable.
FAQ
How long does servo motor tuning take?
For a well-built axis with sound mechanics and a drive that supports auto-tuning, a solid starting tune can take under an hour per axis. Refining feedforward, handling resonance, and validating under load can extend a demanding, high-precision axis to a half-day or more. Poor mechanics are what turn a one-hour job into a multi-day fight.
What are the signs of an under-tuned axis?
Sluggish response, large following error that grows with feedrate, visible lag at corners, poor surface finish, and an inability to hold position under cutting load. On the scope, feedback trails the command with a wide, slow-closing gap.
Manual or auto-tuning — which should I use?
Use auto-tuning to establish a stable, sensible baseline for servo motor tuning, especially when the drive supports frequency-response or mechanical identification. Then refine manually for the last increment of precision, resonance handling, and feedforward. Auto-tuning is an excellent starting point; it is rarely the final word on a high-performance axis.
Why does my axis vibrate only under load or at speed?
That pattern points to resonance excited by higher speeds, or to gains set too high for the loaded inertia. Identify the resonant frequency by sweeping speed, apply a notch filter, and re-verify gains with the real load in place.
Do I need to re-tune after a mechanical change?
Yes. Changing the coupling, screw, belt, load, or gearbox alters the system’s inertia and stiffness, which shifts the stability limits. Re-verify the tune after any significant mechanical modification.
Get the Right Result on Every Axis
Disciplined servo motor tuning — sound mechanics first, then current, velocity, and position loops in order, refined with feedforward and filters and validated under real load — is what makes a CNC axis accurate, stable, and dependable for its full service life. The parameter values matter far less than the method.
Radonix designs PC-based CNC controllers built to integrate cleanly with mainstream servo drives, with sensible defaults, clear commissioning workflows, and technical support for getting every axis dialled in. If you are commissioning a new machine, retrofitting an existing one, or troubleshooting a stubborn axis, contact the Radonix technical team for guidance tailored to your drive, mechanics, and application.


