How to Calibrate a DIY CNC Machine
A step-by-step procedure for squaring the frame, setting steps per mm, measuring backlash, and proving the result with a test cut. Written for machine builders and small-shop engineers who need to know when a hobby router is good enough and when it is not.

In this article
- 1
- 2
- 3
- 4
- 5
- 6
- 7
What matters before you turn a screw
Prepare the machine to calibrate DIY CNC machine axes
Calibration is not a firmware task. It is a mechanical task that ends with firmware numbers. If the frame flexes, the rails are not parallel, or the spindle mount moves under load, no amount of controller tuning will save the part. Spend the first hour making the machine rigid, then start measuring. When you calibrate a DIY CNC machine, you are correcting three separate error sources: geometry, scale, and lost motion. Each one has a different tool and a different procedure.
Clean the machine before you measure anything. Chips under a linear rail, dust packed into a ball screw nut, or swarf on the spoilboard will show up as a fake error. Wipe the rails, blow out the nuts and check that the gantry moves by hand without a rough spot. If you feel a tight section, stop and fix it. A binding axis will stall mid-cut and give you a scrap part plus a broken cutter.
Check every fastener on the load path. Gantry plates, rail mounting bolts, motor couplers, and the Z-axis plate all take vibration. Use a torque wrench if you have one and a marker line if you do not. A coupler that slips by 2° on a 5 mm pitch screw is 0.03 mm of error, and it will not repeat. That kind of fault is impossible to tune out later.
Set up a flat reference. A granite surface plate is ideal, but a piece of 12 mm cast aluminium tooling plate works for most hobby frames. The plate needs to be flat to better than the accuracy you are chasing. If you want ±0.05 mm on the part, the reference should be flat to about ±0.01 mm. Anything worse and you are measuring the plate, not the machine.
Log every reading in a notebook with the date. Machine geometry drifts as the frame settles, and a baseline of old numbers tells you whether a new error is real or just noise. Write down the original firmware value before you change it. Most controller software lets you export the settings file, so keep a copy on a USB stick.
- 1Torque the load pathGantry plates, rail bolts, couplers, and the Z plate.
- 2Clean before measuringChips on a rail read as a geometry error.
- 3Use a flat referenceGranite plate or 12 mm cast tooling plate.
- 4Back up the settings fileKeep the original values before any edit.
Square the frame before you calibrate diy cnc machine electronics
Squareness comes first because it is the only error that changes with position. If the X and Y axes are 0.2° out of square, a 300 mm part will be off by roughly 1 mm across the diagonal. No steps-per-mm value can fix that. You need a machinist square, a dial indicator on a magnetic base, and patience. Some builders use the 3-4-5 triangle method with a tape measure, but a dial indicator on a square is faster and more honest.
Mount the square against the X rail and sweep the indicator along the Y rail. Zero the indicator at one end, then move the Y axis to the far end and read the deviation. Take the reading at least twice and average them. A tenth of a millimeter over 300 mm is about 0.02°, which is acceptable for a hobby router but marginal for aluminium parts with tight bore spacing. Adjust the gantry plate bolts and re-measure until the number stops improving.
Check the Z axis next. The spindle must be perpendicular to the table in both directions, or every face mill cut will leave a step. Chuck a dial indicator in the collet, or use an edge finder with a known shank, and sweep a circle of about 100 mm radius on the table. Adjust the Z plate shims until the total indicator reading is under 0.02 mm for a router and under 0.01 mm for a benchtop mill.
Level the table or spoilboard after the axes are square. Sweep the indicator across the table in a grid pattern and note the high and low spots. If the deviation is more than 0.1 mm, skim the spoilboard with a 25 mm surfacing bit at 12,000 rpm, 2,000 mm/min, and a 0.3 mm depth of cut. Take light passes and let the cutter cool. A bowed board will spring back after surfacing and undo your work, so use a thick, well-supported sheet.
Re-check squareness after leveling. Surfacing removes material and can release internal stress in the board, which moves the geometry a little. This is normal. Run the squareness sweep one more time and tighten the final bolts. From here on, do not touch the frame again until you finish the electronic calibration.
- 1Square X to YDial indicator on a machinist square, average two readings.
- 2Tram the spindleTotal indicator reading under 0.02 mm on a router.
- 3Surface the spoilboard0.3 mm depth of cut, light passes, let it cool.
Set steps per mm and measure backlash on each axis
Steps per mm is the number that tells the controller how many motor pulses equal one millimeter of travel. It is a ratio, not an opinion. The starting value comes from the mechanics: motor steps per revolution, microstepping, and screw pitch or pulley pitch. For a 200-step motor on a 1.8° stepper, with 8 microsteps and a 5 mm pitch ball screw, the math gives 320 steps per mm. Use that as your starting point and then correct it with a measurement.
The measurement is simple. Clamp a dial indicator or a long-travel digital gauge to the table, touch off on a solid block, and command a 100 mm move. Read the actual travel and divide the commanded distance by the measured distance, then multiply by the current steps per mm value. If the machine moved 99.6 mm when asked for 100 mm, the new value is the old value times 1.004. Change one axis at a time and re-test. Do not adjust two axes in the same pass.
Backlash is the lost motion when an axis reverses direction. It shows up as rounded corners, oval bores, and dimensions that change depending on which way the cutter approached the part. Measure it by moving the axis 20 mm in one direction, zeroing the indicator, then moving 20 mm back and reading the difference. Repeat three times and average. On a hobby router with belt drive, 0.05–0.15 mm is common. On a ball screw machine, 0.01–0.03 mm is a normal range.
Correct backlash in firmware with a backlash compensation value, not by over-tightening the nut. Over-tightening adds friction and wears the screw. Software compensation works well for milling because the cutter is always moving in the same direction on a finishing pass. It works badly for boring and for any toolpath that reverses inside a cut. If your machine shows more than 0.1 mm of backlash, plan to leave a finishing allowance and take a light spring pass in the same direction.
Re-check steps per mm after the backlash correction. The two values interact. A machine with a lot of lost motion will read a slightly different scale depending on how the test move was approached. Run the 100 mm test twice, once from each side, and use the average. Write both numbers in your log so you can tell later whether the error is growing.
- 1Calculate before you measureMotor steps × microsteps ÷ screw pitch.
- 2One axis per passChange and re-test before moving to the next axis.
- 3Compensate, do not crushFirmware value beats an over-tight nut.
Run a test cut to confirm the calibration holds
Numbers on a dial indicator are not the same as a good part. Cut a test piece that exercises the errors you just corrected. A 100 mm × 100 mm square with a 50 mm circle inside and four 10 mm bores at the corners will show squareness, scale, and backlash in one setup. Use the same material and the same cutter you plan to use in production. Aluminium 6061 cuts cleanly and shows tool marks clearly.
Measure the part with a micrometer or a good caliper, and measure the bores with a bore gauge or pin gauges. Check the diagonal distances, not just the side lengths. A square with equal sides but unequal diagonals is a squareness problem, not a scale problem. Check the bore positions from a common datum. If the error grows with distance from the datum, you have a scale issue. If the error is constant and changes with approach direction, you have backlash.
Cut a second part without changing anything. Repeatability matters more than absolute accuracy for most small-batch work. If the second part measures within 0.02 mm of the first, the machine is stable. If it drifts, look for thermal growth, a loose coupler, or a stepper that is losing steps under load. A stepper that skips steps usually does it on the acceleration ramp, not at constant speed, so reduce the acceleration by 20 percent and test again.
Record the final numbers and the cut parameters in a single sheet. Steps per mm, backlash values, acceleration, feed rate, spindle speed, cutter, material, and measured result. This sheet becomes your baseline. Any time a part comes out wrong, you compare against the baseline before you change anything. It saves a lot of guessing. When you calibrate a DIY CNC machine regularly, the log is what keeps the process honest.
- 1One test part, four checksSquare, circle, corner bores, and diagonals.
- 2Repeat before you trustTwo parts within 0.02 mm means the machine is stable.
- 3Losing steps?Cut acceleration by 20% and re-test.
Step by step
Work in this order. Skipping ahead makes the later numbers meaningless.
- 1Clean and inspectWipe rails, blow out ball nuts, check for rough spots by hand. Fix binding before measuring anything.
- 2Torque the load pathGantry plates, rail bolts, motor couplers, Z plate. Mark and re-check after the first test cut.
- 3Square X to YDial indicator on a machinist square. Average two sweeps. Target under 0.1 mm over 300 mm.
- 4Tram the spindleSweep a 100 mm radius circle. Target total indicator reading under 0.02 mm for a router.
- 5Level and surface the spoilboardMap with an indicator. If deviation exceeds 0.1 mm, skim at 0.3 mm depth, light passes.
- 6Set steps per mmCommand 100 mm, measure actual travel, scale the value. One axis at a time.
- 7Measure and compensate backlashMove 20 mm and return. Average three readings. Compensate in firmware, not with a tighter nut.
- 8Cut and measure a test part100 mm square, 50 mm circle, four corner bores. Check diagonals, bore positions, and repeatability.
When a DIY machine is enough and when to outsource
Accuracy figures are typical ranges for each machine class, not guarantees.
| Part requirement | DIY router can do it | Send to a CNC shop |
|---|---|---|
| Wood, foam, plastic sheet | Yes, holds ±0.1 mm | Only for volume runs |
| Aluminium bracket, loose fits | Usually, holds ±0.1 mm | If tolerance is under ±0.05 mm |
| Bores with H7 fit | Risky, backlash hurts | Yes, needs ±0.005 mm class |
| Pocket depth over 20 mm | Limited by Z stiffness | Yes, 5-axis handles it |
| One-off prototype | Good for form checks | Quicker if you need it this week |
| 10,000+ parts | Not practical | Yes, mill-turn and automation |
| Titanium or Inconel | No, spindle too weak | Yes, 16 five-axis centers |
Calibrate what you can, outsource what you cannot
A dial indicator, a square, and an hour of work will get a hobby router to ±0.1 mm. If the drawing calls for ±0.005 mm, tighter fits, or difficult alloys, send it to a shop that measures every part before it ships.
Questions engineers ask after calibrating
How often should I recalibrate?
Check steps per mm and backlash after every hard crash, after moving the machine, and at the start of a job that needs tight tolerance. A hobby router on a wooden bench drifts more than a machine on a concrete floor.
For normal hobby use, a full check every three to six months is enough. Keep the log and compare numbers instead of re-measuring everything from scratch.
My steps per mm is right but parts are still oversized. Why?
Cutter deflection and tool runout are the usual causes. A 6 mm end mill in aluminium can push away from the wall by 0.03–0.05 mm on a heavy cut. Take a lighter finishing pass and measure again.
Check runout at the cutter tip with a dial indicator. Over 0.02 mm total indicator reading means the collet or the spindle taper needs attention.
Can firmware backlash compensation replace mechanical repair?
No. It hides the error on toolpaths that move in one direction, which covers most milling. It fails on boring, thread milling, and any path that reverses inside a cut.
If the backlash is over 0.1 mm, fix the nut, the belt tension, or the coupler first. Use compensation for the last 0.02–0.03 mm.
What accuracy can I realistically expect?
A well-built belt-driven router with a stiff gantry typically holds ±0.1 mm on aluminium and ±0.05 mm on plastic. A benchtop mill with ball screws can reach ±0.02 mm with careful setup.
Getting below ±0.01 mm needs a temperature-stable room, a rigid frame, and a spindle with low runout. That is production machine territory.
Does the spoilboard need surfacing every time?
Only when the deviation exceeds your tolerance budget. Map it with an indicator first. If the low spot is 0.05 mm and you are cutting brackets to ±0.1 mm, leave it alone.
Surface when you change the board, when you see inconsistent depth across the table, or after the board gets wet and dries out.
When is it cheaper to send the part out?
When the tolerance is under ±0.05 mm, when the material is titanium or Inconel, or when the part has features that need five sides in one setup. Setup time on a hobby machine often exceeds the cost of a machined part.
For prototypes and small runs, a shop with 127 CNC machines can quote in 12 hours and ship in 3–5 days, which is often faster than tuning a router for a new material.
Need parts that hold ±0.005 mm?
Upload your drawings and get a quotation with free DFM analysis within 12 hours. No minimum order quantity, from one prototype to 10,000+ parts.
12-hour quote100% inspectionNo MOQ