High Precision Trajectory Control of CNC Machine Tools: A 5-Step Tuning Method
This guide is for engineers who need a real contour to land inside ±0.005 mm, not just a single axis to repeat. It walks through dual-position feedback, interpolation settings, feed-forward tuning and thermal compensation. After reading it you can judge whether your machine needs a control change or a mechanical fix.

In this article
- 1
- 2
- 3
- 4
- 5
- 6
- 7
Key takeaways
Why high precision trajectory control of CNC machine tools fails on real contours
A machine can pass a ballbar test and still scrap a mold insert. The reason is that most shops check static positioning and repeatability, while the part is cut while every axis is moving at once. High precision trajectory control of CNC machine tools is about the path your tool center point actually follows, not the resting accuracy of each slide. Two machines with the same positioning spec can differ by a factor of three on a 50 mm radius arc at 8,000 mm/min.
The error shows up as three shapes. Corner rounding appears where the controller blends two blocks and the servo lags behind the command. Radius deviation appears on arcs, where the inside of the curve always runs smaller than programmed. Surface marks appear as regular pitch patterns, usually from ballscrew error or from a feedback loop that is tuned too stiff for the mechanical stiffness behind it. Each shape has a different cause, so each needs a different fix.
Traditional control uses one position loop per axis, closed on a motor-mounted encoder. It works well when the commanded motion is slow and the mechanical train is stiff. Push the feed rate up and the loop has to correct a growing following error, which the controller answers by adding gain. Too much gain and the machine starts to hum and leave chatter marks. That trade-off between speed and accuracy is where most shops sit today, and it is the reason a new control method is worth the setup time.
- 1Measure the contour, not the axisUse a ballbar or a test cut, not a dial indicator against a stopped slide.
- 2Separate the three error shapesCorner, radius and pitch errors come from different sources and need different corrections.
- 3Know your mechanical limitNo control loop can fix a ballscrew with 0.02 mm of backlash.
Dual-position feedback: what the second loop actually buys you
A dual-position closed loop uses two rings. The inner ring reads an optical code disk on the motor shaft, so it reacts in microseconds and keeps the motor stable. The outer ring reads a linear scale or an induction-type displacement sensor mounted close to the moving table, so it sees the true position of the load. The controller compares both and drives the inner loop until the outer error falls to zero. Wind-up in the coupling, thermal growth of the ballscrew and pitch error all get absorbed by the outer loop.
The gain split matters. Put the inner loop at roughly 5 to 10 times the bandwidth of the outer loop, or the two rings fight each other and the axis oscillates at a low frequency you can hear. During commissioning we set the inner loop first with the outer loop open, then close the outer loop and raise its gain until a step response shows about 10 to 15 percent overshoot. If the outer scale is noisy, lower the gain and raise the filter instead of adding stiffness.
This architecture costs money and needs clean mounting. A linear scale with 0.1 μm resolution is useless if the read head is 0.5 mm off alignment or the scale is covered in coolant mist. On a 4,000 mm travel machine, thermal drift along the bed can reach 0.03 mm over an eight-hour run, and only the outer loop sees it. That is the case where dual feedback pays for itself on the first tight part.
- 1Inner loop bandwidthSet 5–10× the outer loop bandwidth to avoid low-frequency oscillation.
- 2Outer loop step responseTarget 10–15 percent overshoot, then stop raising gain.
- 3Scale mountingAlign the read head within the manufacturer spec and shield it from coolant mist.
Interpolation and sampling settings that shape the tool path
The controller turns your G-code into a dense stream of setpoints. Block cycle time and interpolation resolution decide how smooth that stream is. A common setting is a 1 ms position loop with a 0.1 μm command resolution, and a look-ahead buffer of 100 to 300 blocks. Increase the look-ahead and the machine can slow down before a sharp corner instead of overshooting it. Decrease it and the path gets jerky at high feed.
Sampling frequency and command resolution work together. If the resolution is too coarse, the servo chases a staircase and you hear it in the cut. If it is too fine, the controller spends time on data that the mechanical system cannot follow. For most aluminum work at 8,000 to 15,000 mm/min, a 1 ms loop and 0.1 μm resolution is a good baseline. For hard steel at 500 to 1,500 mm/min, a 0.5 ms loop helps more than extra resolution.
The interpolation algorithm also decides how arcs are generated. Linearizing an arc into short chords leaves flats that show up under a profilometer. High-speed high-resolution interpolation computes the curve directly in the controller and keeps the chord error below the tolerance you set. Set that tolerance to about one-fifth of your part tolerance, so a ±0.005 mm part gets a 0.001 mm chord error budget.
- 1Look-ahead depth100–300 blocks for high-feed contouring; less for simple 2.5D work.
- 2Chord error budgetSet to one-fifth of the part tolerance to keep arcs smooth.
- 3Loop rate vs resolutionFaster loop for hard materials, finer resolution for light high-speed cuts.
Error correction and compensation: build a model before you correct
Correction only works when the error is repeatable. Map the axis first. Command a series of positions across the full travel, record the true position with the outer scale or a laser interferometer, and store the deviation as a lookup table. The controller then adds the inverse of that table to every command. Pitch error of 0.015 mm over 500 mm drops to a few microns after one mapping pass.
Thermal error is the harder half. Ballscrews grow as they warm, and the growth is not linear along the travel. Fit a simple first-order model using readings from temperature sensors on the screw, the bed and the ambient air, then apply a correction that changes with run time. On a machine cutting continuously for six hours, this is often worth 0.01 to 0.02 mm at the far end of the travel.
Two mistakes are common. The first is correcting a non-repeatable error, such as backlash that changes with load; fix the mechanics instead. The second is stacking corrections that fight each other, for example a pitch table plus a thermal model both tuned on a cold machine. Map pitch cold, then map thermal drift separately with a warm-up cycle of 30 to 60 minutes before you capture data.
- 1Map pitch coldCapture the lookup table before the machine warms up, or the table bakes in drift.
- 2Warm-up before thermal mappingRun 30–60 minutes at cutting speed, then record sensor and position data.
- 3Fix backlash mechanicallyCompensation tables cannot absorb a load-dependent mechanical error.
Step by step: tuning high precision trajectory control of CNC machine tools
Run these in order. Skipping a step usually pushes the error into a different shape instead of removing it.
- 1Baseline the contour errorCut a test part with a 50 mm radius arc and a 90° corner at your production feed rate. Measure with a ballbar or a CMM. Record corner rounding, radius deviation and surface pitch separately. Do not touch any gain until you have numbers.
- 2Check the mechanical train firstMeasure backlash at 0.002 mm or better. Check thrust bearing preload and coupling runout. If backlash exceeds 0.01 mm, stop here and repair the axis. No control setting will hide it.
- 3Tune the inner position loopOpen the outer loop. Raise inner loop gain until a step response gives 10–15 percent overshoot with no sustained oscillation. Verify the motor current stays below 80 percent of rated during a rapid move.
- 4Close the outer loop and set its gainBring the outer scale online and raise its gain slowly. Keep its bandwidth at one-fifth to one-tenth of the inner loop. Watch for a low-frequency growl, which means the two loops are too close in speed.
- 5Add feed-forwardEnable velocity feed-forward at 90–100 percent, then add acceleration feed-forward until corner rounding stops improving. Too much acceleration feed-forward makes the axis overshoot on short blocks.
- 6Set interpolation and look-aheadUse a 1 ms loop and 0.1 μm resolution for aluminum at 8,000–15,000 mm/min. Set look-ahead to 100–300 blocks and chord error to one-fifth of the part tolerance.
- 7Map pitch error, then thermal driftCapture the pitch table cold across the full travel. Then run a 30–60 minute warm-up and fit a thermal model from screw, bed and ambient sensors. Verify with a second test cut.
- 8Re-cut and confirmRepeat the baseline test part. Compare all three error shapes against step 1. Confirm the contour holds ±0.005 mm at production feed before releasing the machine.
Which control change to make, by symptom
Match the error shape you measured in step 1 to the fix that actually moves it.
| Symptom | Most likely cause | First fix | When it will not help |
|---|---|---|---|
| Corner rounding at high feed | Servo following error | Add velocity and acceleration feed-forward | Corner is a true sharp edge in hard steel |
| Arc runs small on inside radius | Servo lag plus chord error | Raise look-ahead, tighten chord error | Backlash above 0.01 mm |
| Regular pitch marks on surface | Ballscrew pitch error | Map pitch and load lookup table | Error changes with load |
| Drift grows over the shift | Thermal growth of screw and bed | Fit thermal model after warm-up | Machine runs under 30 minutes per cycle |
| Low-frequency growl, poor finish | Inner and outer loop too close | Lower outer loop gain | Outer scale is noisy or misaligned |
| Random error, no pattern | Mechanical looseness | Repair bearings and couplings | Control compensation of any kind |
When the control method is worth it, and when it is not
If your parts need contour accuracy inside ±0.005 mm at production feed, dual-position feedback plus a mapped error model is the practical route. If you cut simple profiles at moderate speed, fix the mechanics first and leave the controller alone.
Questions engineers ask before tuning
Do I need a linear scale on every axis?
No. Start with the axes that carry the contour, usually X and Y on a mill, and the axis with the longest travel. On a 4,000 mm bed, the long axis is where thermal drift hurts most.
Add the third axis when your parts need true 3D contouring, such as mold work or impeller blades. For 2.5D plates at moderate feed, one or two outer loops are often enough.
How long does commissioning take?
A single axis with a new outer loop takes about half a day: mounting, alignment, inner loop tune, then outer loop tune. Full-machine pitch and thermal mapping takes one to two days because the warm-up cycle cannot be rushed.
If you skip the warm-up, the thermal table captures cold-machine data and the correction makes the error worse at the far end of travel.
Can this fix a machine with 0.02 mm backlash?
No. Backlash is a mechanical gap, and it changes with load and direction. A compensation table can hide it on a slow test cut, then the error returns the moment the cutting force changes.
Repair the axis first. After backlash is under 0.005 mm, control tuning will hold what the mechanics deliver.
What feed rate range benefits most?
The gain is largest between 5,000 and 15,000 mm/min in aluminum, where following error grows quickly. Below 2,000 mm/min, standard control is usually fine and the extra setup buys little.
In hard steel at 500–1,500 mm/min, a faster position loop helps more than feed-forward, because the servo has time to settle between blocks.
Does the part program need to change?
Mostly no. The controller handles interpolation and compensation internally. What changes is the tolerance you set in the controller, the chord error budget and the look-ahead depth.
One exception is very short blocks. If your CAM output uses 0.05 mm segments, the controller spends its look-ahead on tiny moves. Filter the toolpath to 0.2–0.5 mm segments and the same settings perform better.
How do I verify the result without a ballbar?
Cut a test part you can measure. A 50 mm radius arc plus a 90° corner, machined at production feed, shows corner rounding and radius deviation on any CMM.
Measure the same part at the start and end of a shift. If the numbers drift by more than 0.005 mm, your thermal model needs another data pass.
Send us a part that has to hold its contour
Upload your drawing and we will review the geometry for trajectory risk before we quote. Quotation and free DFM analysis within 12 hours.
12-hour quote±0.005 mm tolerance100% inspectionNo minimum order quantity