Short answer: To tune a servo motor on a CNC machine, first confirm the mechanics and encoder feedback are sound. Then tune from the inside out: verify the current loop, raise velocity-loop gain until the axis nearly oscillates and back off, set position gain, add velocity and acceleration feedforward, apply a notch filter at any resonance, and validate under real load.
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.
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 guide is the complete 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.
What Does “Properly Tuned” Mean?
A servo axis is properly tuned when it follows position and velocity commands quickly and accurately, without vibration, excessive noise, abnormal temperature rise, or following error beyond the allowed limit. In practice that means three measurable things: low and predictable following error, minimal overshoot with fast settling, and a motor that stays cool under production duty.
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 most important prerequisite for 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 with 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 with 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.
Key Servo Tuning Parameters
Parameter names vary between manufacturers, but their functional roles are consistent:
| Parameter | What it does | Risk when too high |
| Proportional gain (Kp) | Raises response speed and stiffness | Oscillation, audible noise |
| Integral gain (Ki) | Removes steady-state error | Overshoot, low-frequency oscillation, motor heating |
| Derivative / damping (Kd) | Adds damping and reduces overshoot | Amplified noise, rough motion |
| Velocity / acceleration feedforward | Cuts following error during fast moves without raising loop gain | Overshoot if set above the real system need |
| Notch / anti-resonance / low-pass filters | Suppress mechanical resonance and high-frequency noise | Lost bandwidth and added delay |
For a deeper look at how the gain parameter itself behaves, see our guide to servo gain.
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 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. Start with reduced speed and acceleration, keep the E-stop within reach, and clear the work envelope.
- 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.
Step-by-Step Servo Motor Tuning Procedure
With the prerequisites confirmed, work through the loops in order. Use repeatable test profiles (short reciprocating moves, then velocity steps, then position steps), 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 torque constant), either from a motor data file or a short auto-commutation routine. In the large majority of setups, accept the drive’s calculated current-loop bandwidth rather than adjusting it by hand.
Your job here is verification: confirm the correct motor is selected, the encoder is aligned to the motor’s electrical angle, and the drive reports no current-loop faults. A stable torque loop is the prerequisite for raising velocity-loop gain safely. Once it is confirmed, 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 or ringing after a stop, then back off to a comfortable margin below that threshold. This is the stability limit of the velocity loop.
- Set the integral gain to remove the steady-state velocity error. Too little and the axis is slow to settle; too much and you introduce overshoot, low-frequency oscillation and motor heating.
- If ringing persists, evaluate damping or filters rather than increasing the integral term.
A well-tuned velocity loop responds crisply to a speed command with minimal overshoot. Resist the urge to push it to the ragged edge: a 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
With a stiff, stable velocity loop underneath, close the position loop. The dominant term 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 overshoots at the end of a move or shows sustained oscillation. Back off from that limit to leave a safe margin. Micro-vibration or audible hunting at standstill indicates excessive gain or an unresolved mechanical resonance.
The gain an axis can tolerate depends heavily on its mechanics. Ball-screw and rack-and-pinion axes typically accept higher position gain, while belt-driven or compliant axes reach oscillation at much lower values. Do not copy a number from another machine. Before you push position gain to its limit, read how servo gain works inside the loop.
Step 4: Add Feedforward to 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 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 error spikes at the start and end of moves and during direction reversals.
Tune feedforward only 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 on the commanded line instead of trailing behind it.
Step 5: Apply Filters for Frequency-Specific Vibration
Vibration in a narrow speed range typically indicates mechanical resonance. Sweep the axis across a range of speeds and note where vibration peaks; that is the resonant frequency. FFT analysis on the drive, where available, identifies it precisely.
A notch filter at that frequency attenuates the resonance and lets you raise loop gain further without exciting the mechanics. A low-pass filter in the velocity or torque loop suppresses broadband high-frequency noise, but it costs control bandwidth, so use it sparingly.
Step 6: Verify With a Step or Move Test
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. Oscilloscope traces of position, velocity and following error show command versus feedback during real motion and are the most reliable way to confirm the result.
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 into the in-position window fast, with no ringing or hunting.
- Following error: it should stay well within your fault threshold throughout the move, not just at rest.
Then confirm the result under realistic conditions: production feedrates, the actual load, and the full axis 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 afterwards, because aggressive tuning can look precise on the scope while quietly overheating the motor.
Auto-Tuning or Manual Tuning?
Auto-tuning gives a fast and often reliable starting point, particularly when the drive supports frequency-response analysis or mechanical identification. Use it to establish a stable baseline, then refine manually.
Manual tuning becomes necessary when:
- the mechanical system is compliant or belt-driven,
- two-mass or multi-inertia systems are present,
- severe resonance limits the achievable bandwidth, or
- maximum surface quality and minimal following error are required.
Servo Motor Tuning Tips for Precision
Once the basic loops are stable, these refinements move an axis from good enough to genuinely accurate.
- Balance stiffness against stability. This is the central trade-off. 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 when the machine is warm and fully loaded, not the highest number that survives a cold, unloaded bench test.
- Smooth the motion profile. An S-curve (jerk-limited) profile and slightly trimmed acceleration reduce the shock that excites structural modes, often improving finish more than another round of gain tweaking.
- Match axes that work together. Axes that interpolate together should have comparable dynamic response; mismatched tuning shows up as distorted circles and corners.
- Know your axis type. Ball-screw and rack-and-pinion axes tolerate higher position gain than belt-driven or compliant ones. If errors grow on direction reversals, fix backlash, friction and play before increasing gain.
- Re-check temperature and current. Always monitor motor temperature and current after tuning. Excessively aggressive tuning may appear precise but reduces reliability.
Quick Diagnosis: Common Servo Tuning Problems and Fixes
Most 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 (hunting) | Velocity or position gain too high, unfiltered resonance, dry friction | Reduce gain to leave margin, add damping or a notch filter, inspect mechanics |
| Overshoot and ringing at the end of moves | Loop too aggressive or under-damped, excessive integral gain | Lower position gain or the integral term, add damping or filtering |
| Slow or compliant motion | Gain too low, insufficient feedforward | Increase gain in small steps, add feedforward |
| Large following error during constant-speed moves | Insufficient velocity feedforward | Add velocity feedforward, then acceleration feedforward for transients |
| High following error during acceleration | Insufficient acceleration feedforward or torque limits | Increase acceleration and velocity feedforward, verify torque and current limits |
| Vibration only at a specific speed | Mechanical resonance | Apply a notch filter at the resonance frequency |
| Vibration only on direction reversal | Backlash, friction or mechanical play | Fix the mechanics first: preload the screw, address coupling backlash |
| Random jitter unrelated to gain changes | Encoder noise, dropouts or a 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 |
| Stable on the bench, unstable in production | Tuned unloaded and at the wrong speed | Re-verify with the real load, at production feedrate, across the full travel |
The Four Mistakes Worth Avoiding
- 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 the axis will momentarily tolerate.
- Ignoring the mechanics. No gain value fixes backlash, a loose coupling, a dry screw or misalignment.
- 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.
- Skipping load testing. Unloaded tuning is a starting point, not a result. Real inertia and cutting forces change the loop behaviour.
Related Servo Topics
Servo motor tuning is one part of getting an axis right. To go further, read about how a servo motor works in a CNC machine, how to adjust servo motor speed, and how to calibrate and reset a servo motor. If you want to reduce audible whine, see reducing servo motor noise.
FAQ
How do you tune a servo motor?
Confirm the mechanics and encoder wiring, verify the current loop, raise velocity-loop proportional gain until the axis nearly oscillates and back off, add integral gain to remove steady-state error, increase position gain, then add velocity and acceleration feedforward and a notch filter if needed. Validate on the scope with the real load at production feedrate.
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.
Should I use auto-tuning or tune manually?
Use auto-tuning to establish a stable, sensible baseline, 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 and 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 the 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 work with mainstream servo drives, with clear commissioning workflows and technical support. 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. To see how a controller fits your machine, compare Radonix CNC controller hardware for independent multi-axis motion, pulse/direction signals and industrial I/O.
For machine integration, compare Radonix CNC controller hardware for independent multi-axis motion, pulse/direction signals and industrial I/O. Radonix CNC controller hardware.


