A CNC router can be perfectly programmed and still cut inaccurate parts if its frame is twisted, gantry is out of square, spindle is tilted, or axis travel is scaled incorrectly. Squaring, tramming, and calibration correct three different problems, and they must be completed in the right order. If you adjust software before correcting the mechanics, you may hide one error while creating another.
This guide applies to most hobby and prosumer gantry-style CNC routers, including belt-, leadscrew-, ballscrew-, and rack-and-pinion machines. The adjustment points vary by manufacturer, so keep the machine manual open and use its specifications whenever they differ from the general procedure below.
Squaring, tramming, and calibration are not the same
| Procedure | What it corrects | Typical symptom |
|---|---|---|
| Leveling/stabilizing | Twist or rocking in the machine base | Measurements change across the table or after the machine is moved |
| Squaring | X and Y axes not perpendicular | A programmed rectangle becomes a parallelogram; diagonals do not match |
| Tramming | Spindle axis not perpendicular to the XY plane | A surfacing bit leaves ridges, scallops, or a washboard finish |
| Travel calibration | Commanded distance differs from actual movement | Parts are consistently too large or too small |
| Backlash/repeatability testing | Lost motion, looseness, or skipped steps | Results change with direction or the machine fails to return to zero |
Avid CNC's calibration instructions use the same basic sequence: table leveling, gantry squaring, and spindle/router tramming. That order matters because every later measurement depends on the geometry established earlier.
Tools you will need
- A reliable machinist square or verified precision square
- A tape measure or steel rule for rough setup
- Digital calipers for shorter measurements
- A dial indicator or dial test indicator with a rigid spindle-mounted tramming arm
- A flat reference plate, ground plate, thick glass, or known-flat aluminum
- Feeler gauges or thin shim stock
- Hex keys, wrenches, and the correct torque information for the machine
- A straight cutter, a surfacing bit, and scrap MDF
- Two accurately sized dowel pins or drill rod for diagonal testing
- A notebook or spreadsheet for recording measurements and controller values
A carpenter's square and tape measure are useful for rough assembly, but they may not be precise enough for final calibration. Before trusting any square, perform a flip test against a straight reference edge. A square that draws two diverging lines is not a calibration standard.
Safety before adjustment
Disconnect power before loosening motor mounts, spindle clamps, gantry fasteners, couplers, belts, or bearing hardware. Remove the cutter whenever it is not required. A dial indicator should only be rotated by hand with the spindle electrically disabled. Never start the spindle with a tramming arm installed.
When powered movement is required, clear the table, reduce jog speed, and keep one hand near the emergency stop. Review the complete CNC router safety guide and complete the 15-check CNC preflight checklist before any powered test cut.
Step 1: Stabilize and level the machine
“Level” is not the same as “flat” or “square,” but a stable support prevents the frame from twisting while you measure it. Place the machine on a rigid stand that does not rock. Check the support along X, along Y, and across both diagonals. Adjust the feet or shim the stand until all feet carry load and the frame remains stable.
Do not force a flexible CNC frame to conform to a warped bench. Loosen frame-to-stand mounting points if necessary, stabilize the base, and then tighten fasteners in a controlled sequence. Recheck after tightening. A long machine may need time to settle, especially when its spoilboard or support structure is wood.
If the machine is moved, the floor changes, or seasonal humidity affects the table, repeat this check. Avid CNC specifically recommends rechecking table leveling after relocation. Also inspect for loose frame bolts, cracked brackets, damaged leveling feet, and debris trapped beneath the machine.
Step 2: Inspect the motion system before measuring
Calibration cannot fix mechanical looseness. With power disconnected, inspect every axis through its full travel. The motion should feel consistent without binding, obvious free play, or tight spots.
- Belts: look for damaged teeth, uneven tension, loose clamps, and pulleys slipping on motor shafts.
- Leadscrews and ballscrews: inspect couplers, bearing blocks, anti-backlash nuts, lubrication, and axial movement.
- Rack and pinion: verify pinion engagement, spring tension, cleanliness, and secure set screws.
- V-wheels or linear bearings: check preload and confirm the carriage cannot rock.
- Spindle mount: verify the clamp, mounting plate, and Z carriage are secure.
- Homing sensors: confirm brackets and targets are rigid and repeatable.
Correct looseness before proceeding, then follow the preventive checks in the CNC router maintenance guide. If the machine loses position under load, investigate couplers, pulley set screws, motor current, acceleration, and binding before changing steps-per-unit.
Step 3: Square the gantry to the travel axis
On a typical gantry router, squaring means making the X axis perpendicular to Y. Start by homing the machine according to its manual. On a dual-motor Y axis with independent home sensors, each side stops at its own sensor; adjusting the sensor or target position changes the gantry angle. On machines that home both sides against mechanical stops, confirm both stops are clean and equally positioned.
Method A: large square check
- Place a verified large square against a reliable machine reference, not an unverified spoilboard edge.
- Jog the gantry slowly and compare travel with the square.
- Measure near both ends of the usable travel.
- Adjust the appropriate sensor, hard stop, or gantry side according to the manufacturer procedure.
- Re-home before measuring again.
This method is fast, but its accuracy is limited by the square and reference edge.
Method B: four-hole diagonal test
- Create four hole locations at the corners of the largest practical rectangle.
- Use a straight cutter to machine shallow holes for two equal dowels or tool shanks.
- Measure between opposite dowels across both diagonals using the same contact method.
- If the diagonals match, the rectangle is square. If they differ, adjust the gantry and repeat.
For a true rectangle, the diagonals are equal. The larger the test rectangle, the easier it is to detect a small angular error. Avid CNC's official procedure uses four machined dowel locations and compares the diagonals, then adjusts the two home-sensor positions until the measurements agree.
Method C: 3-4-5 layout
A right triangle with side lengths in a 3:4:5 ratio provides another useful check. Scale it up—300, 400, and 500 mm is better than 30, 40, and 50 mm—because measurement uncertainty becomes a smaller percentage of the test. Use engraved points or dowels rather than judging the edges of a wide toolpath.
Step 4: Verify the Z-axis assembly
Spindle tram and Z-axis alignment are related but not identical. The Z carriage must travel perpendicular to the XY plane, and the spindle centerline must be parallel to that travel. If the entire Z assembly leans, shimming only the spindle mount may make the cutter appear trammed at one height while it shifts in X or Y as Z moves.
Place a machinist square on a known-flat reference surface and indicate or compare the Z carriage as it moves vertically. Check from the front and the side. Correct the Z assembly or carriage mounting first, using the machine maker's prescribed adjustment points. Only then adjust the spindle within its mount.
A quick square against the spindle body can reveal a major error, and ShopBot's gantry tune-up guidance describes this type of check. Final tram, however, should reference the cutter axis with an indicator or a controlled surfacing test.
Step 5: Tram the router or spindle
Tramming makes the spindle's rotational axis perpendicular to the machine's XY plane. Left-to-right tilt is often called roll; front-to-back tilt is often called nod. Both must be checked.
Dial-indicator sweep method
- Disconnect spindle power and remove the cutting tool.
- Secure a rigid tramming arm in a clean collet and mount the dial indicator at a practical sweep radius.
- Place a clean, flat reference plate beneath the indicator. Secure it so it cannot move.
- Bring the indicator into light contact and preload it within its measurement range.
- Rotate the spindle by hand so the indicator reads the left and right positions. Record both readings.
- Repeat at the front and back positions.
- Loosen only the fasteners required by the machine's tramming system. Make a very small adjustment or add a measured shim.
- Snug the fasteners in stages, rotate the spindle by hand, and remeasure all four positions.
- Repeat until opposing readings are acceptably close, then torque fasteners and verify again.
Always compare the same indicator locations on the same reference plate. If the plate itself is tilted, a full 180-degree comparison still reveals relative spindle error, but using a truly flat, clean reference makes the process easier. Keep the tramming arm rigid; flex in a long arm can create false readings.
Surfacing-test method
If you do not have an indicator, mount a flat surfacing cutter and machine a shallow area of MDF with a large stepover. Alternating ridges show that one edge of the cutter is lower than the other. Avid CNC recommends a flat cutter at least 1/2 inch in diameter and a test stepover near 90% of cutter radius so tram marks are easier to see. Adjust in small increments and repeat in more than one area of the bed.
This method is practical, but it combines cutter runout, spoilboard condition, machine deflection, and tram into one visual result. A dial indicator is better for diagnosis; the surfacing test is an excellent final proof.
Step 6: Surface the spoilboard
Surface the spoilboard only after the machine is stable, square, and trammed. Surfacing creates a working plane parallel to XY travel. It does not straighten a twisted frame, square the gantry, or correct a leaning Z axis.
Use a sharp surfacing bit, shallow depth, dust collection, and a toolpath that covers the usable cutting area without exceeding travel. If ridges remain, stop and correct tram rather than repeatedly removing material. Confirm safe stepdown with the CNC depth-per-pass guide and address unexpected lines with the CNC chatter troubleshooting guide.
Step 7: Calibrate X, Y, and Z travel
Travel calibration corrects scale, not squareness. Measure over a long distance to reduce percentage error: 300 to 600 mm on a larger router, or as much safe travel as a compact machine permits. Use a dial indicator for short Z tests and a fixed steel rule, gauge block, or two-point measurement method for longer X and Y tests.
- Warm up the control electronics and move each axis through normal travel.
- Record the current steps-per-unit or axis calibration value before changing anything.
- Approach the starting point from the same direction to remove backlash from the measurement.
- Command a known distance at a conservative feed rate.
- Measure actual travel without moving the reference.
- Calculate the corrected value, enter it for that axis, then repeat the test.
Example: the current setting is 200 steps/mm, the commanded move is 500 mm, and actual travel is 499.2 mm. The corrected value is 200 Ă— 500 Ă· 499.2 = 200.321 steps/mm. Enter the new value, then repeat the measurement over the same distance.
For GRBL-based controllers, the official configuration uses $100, $101, and $102 for X-, Y-, and Z-axis travel resolution. The official GRBL command documentation explains how settings are viewed and written. Do not copy another machine's numbers; belt pitch, pulley teeth, screw lead, gearing, and microstepping determine the theoretical value for your hardware.
When not to change steps per unit
If repeated tests produce different measurements, the issue is not a simple scale error. Look for backlash, loose pulleys, coupler slip, lost steps, binding, motor stalls, inconsistent homing, or measurement technique. Axis calibration should be based on repeatable motion. Changing the value to compensate for a loose component only makes the machine wrong in a different way.
Step 8: Test backlash, repeatability, and runout
Backlash test
Place an indicator against the axis and zero it after approaching from one direction. Command a small move away, then return by the same commanded distance. Any motion commanded before the indicator begins moving in the reverse direction is lost motion. Inspect drive components and preload adjustments before applying software compensation.
Repeatability test
Command several moves away from and back to the same position. A repeatable machine returns to nearly the same indicator reading. If the error grows or changes randomly, suspect skipped steps, slipping hardware, electrical noise, excessive acceleration, or binding.
Spindle and tool runout
Tram does not correct runout. Measure a clean precision pin near the collet and again farther down the pin. Rotate the spindle by hand. Excess movement may come from debris, a damaged collet, a poor tool shank, spindle bearings, or the taper. Follow the safe bit-change and collet-care procedure before blaming the spindle.
Step 9: Validate with test cuts
Finish with a repeatable test file that includes an outside square, an inside pocket, a circle, and two holes spaced far apart. Measure:
- Both sides and both diagonals of the square
- Outside and inside dimensions to separate tool-diameter or deflection errors
- Circle diameter in X and Y
- Hole center-to-center spacing
- Pocket depth at several points
- Return-to-zero accuracy after the job
Use a finishing pass when judging dimensional accuracy. A roughing cut can deflect the cutter and machine. If outside dimensions are wrong but hole spacing is correct, investigate cutter diameter, runout, stock allowance, and tool deflection before changing axis calibration.
Practical calibration targets
The machine manufacturer's published tolerance always takes priority. For a well-built hobby router, the following are useful starting goals rather than universal specifications:
| Check | Useful starting goal | If it fails |
|---|---|---|
| Gantry square | Diagonals within 0.5 mm over a 600 mm test | Adjust sensors, stops, or gantry alignment |
| Spindle tram | Opposing readings within 0.05 mm over a 150 mm sweep | Adjust mount or use controlled shims |
| Axis travel | Within 0.1 mm over 300 mm | Verify repeatability, then correct steps per unit |
| Return to zero | Consistent with the machine's specified repeatability | Inspect backlash, slipping, binding, and motor tuning |
Do not chase a number smaller than your tools and measurement method can reliably resolve. Wood movement alone may exceed a very tight tolerance. Calibrate to the needs of the work while keeping the machine mechanically sound.
Common mistakes that waste time
- Surfacing first: this masks bed variation but does not fix machine geometry.
- Calibrating from a cut part only: cutter diameter, deflection, CAM allowance, and material movement contaminate the result.
- Measuring over a short distance: a small reading error becomes a large percentage error.
- Tramming to a dirty spoilboard: dust or a ridge beneath the reference plate corrupts the reading.
- Tightening one bolt fully: the mount shifts while other fasteners are tightened. Snug gradually and recheck.
- Ignoring Z travel alignment: the spindle may appear trammed at one height but shift as Z moves.
- Changing software to hide lost steps: random error is a mechanical or motion-control problem, not calibration.
- Failing to re-home: any sensor or hard-stop adjustment changes the machine reference.
When to recheck calibration
Perform a full baseline after assembly. Recheck the affected measurements after moving the machine, changing the spindle mount, replacing motion components, adjusting belts or bearing preload, resurfacing or replacing the spoilboard, striking a clamp, experiencing a crash, or seeing unexplained dimensional errors. A short verification should also be part of seasonal maintenance when temperature or humidity changes affect a wood-based table.
Final checklist
- The stand is rigid and the frame does not rock or twist.
- Fasteners, belts, pulleys, couplers, bearings, and rails are secure.
- The gantry homes square and the test rectangle has matching diagonals.
- The Z carriage travels perpendicular to the XY plane.
- The spindle is trammed left-to-right and front-to-back.
- The spoilboard is surfaced only after mechanical alignment.
- X, Y, and Z travel are repeatable before scale values are corrected.
- Backlash, return to zero, and runout are within useful limits.
- A measured test cut confirms square, size, circles, spacing, and depth.
- Final controller values and measurements are recorded for comparison later.
A calibrated CNC router should not merely produce one accurate part—it should repeat that part across the work area and after another homing cycle. Work from the frame toward the cutter, change one variable at a time, and record every result. That discipline is what turns calibration from guesswork into a dependable maintenance procedure.
Continue With a Full CNC Accuracy Diagnosis
Squaring and tramming establish the machine geometry, but they do not explain every dimensional error. Use the CNC Accuracy and Precision Complete Guide to test repeatability, runout, backlash, tool deflection, workholding, and CAM compensation in the correct order.
Acceptance Checks Before Calling the CNC Calibrated
| Check | Pass condition | If it fails |
|---|---|---|
| Homing repeatability | Returns consistently without abnormal motion | Review homing and machine zero |
| Large rectangle diagonals | Match within the project’s required tolerance | Correct gantry squareness before scale |
| Long commanded axis move | Measured travel is repeatable and acceptably close | Use the steps-per-unit calibration guide |
| Direction-reversal test | Little or no lost motion for the required work | Compare backlash and machine flex |
| Spindle and tool runout | Stable enough for the cutter and tolerance required | Follow the runout measurement workflow |
| Repeated test cut | Produces the same result under the same conditions | Use the complete accuracy guide |