How do you calibrate a CNC machine?

how to calibrate a CNC machine title page

How do you calibrate a CNC machine?

The first thing you need to do is to roughly calibrate the X and Y settings in GRBL. If you have a machine like the Work-Bee or the any of the 3018 CNC machines they will already be roughly about right but if you have built you’re own machine you could be miles off. After I had finished my first CNC machine I ran some G code that I had downloaded as a simple test. When I attempted to engrave it the image was much smaller than it should have been. I quick check with a ruler showed that when I moved the X axis 100mm it only moved 50mm.

The settings in GRBL for the X, Y and Z steps are:-

$100 for the X axis steps

$101 for the Y axis steps

$102 for the Z axis steps

My home built CNC machine used an 8mm thread on all of the axis but I didn’t have much of an idea of what the values should be so I just experimented and altered the value of $100 and then tested how far it moved. It didn’t take long to get to the value of 800 for $100 so I then put that value in for $101 and $102 as they all used the same 8mm screw thread.

This incidentally is the default settings for 3018 CNC machines and probably most machines that use an 8mm lead screw.

My CNC machine now moved the right distances and ran G code to cut and engrave to the correct dimensions however you will need to accurately calibrate your machine if you want to use it for more exacting jobs.

How to calibrate a CNC X and Y axis?

To get anywhere calibrating your CNC machine you’re going to need something accurate to measure with. You’re not going to be able to measure to .1 of a mm using a simple ruler. I bought a calliper type measuring device from Amazon, capable of measuring to .1mm, this wasn’t too expensive but to get something more accurate you have to pay more money.

There are a couple of different methods that you can use to calibrate your CNC machine. The first way is to create a G code file to cut a square of 100mm by 100mm. Make sure you mark the X and Y on the finished square. You will then need to do a bit of mathematics. Start with the X axis and measure it, for me that came to 100.6, you need to divide 800 by the actual measurement you got. Then multiply that by 100 so that’s;-

800/100.0 =7.952286282

7.952286282 x 100 = 795.228628231

As this is for the X axis figure you overwrite the $100 = figure with 795.2286.

Then you do exactly the same procedures for the Y axis and put that figure in $101=.

The other method is to use the following formula.

Distance that should be moved / actual distance that was moved and then multiply that by 800.

So for my example above I wanted it to cut 100 and it actually cut 100.6 so that’s 100/100.6 = 0.9940357 and then multiply that by 800 = 795.2286. So the figure is of course the same just using a different formula.

There is an argument that says once you have calibrated your X and Y axis you should now cut another 100mm by 100mm square and do the whole thing again but the practical problem is you can just end up chasing something you will never achieve “perfection” the measuring device is not 100 per cent accurate linear guides and movement will vary as will material and the machine with temperature. For me doing this once is enough.

How to calibrate a CNC Z axis

For most hobbyist CNC machines you could argue that calibrating the X and Y axis is much more important than calibrating the Z axis. I have to admit that for several months I didn’t bother to calibrate the Z axis and just used it with the default setting of $102 = 800. All I was using it for was to cut 3mm acrylic sheets and as I used a probe to set the depth then 3mm cuts aren’t going to be far off even if you don’t do any calibration.

The easiest way to calibrate the Z axis is to first measure how far your machine is capable of moving the Z axis as this is usually a lot less than you can move the X and Y axis and then route a piece of off cut MDF to as thick as you CNC machine will allow so if your machine can route a thickness of 70mm then do that and measure it and use the same formula as in the above example.

Thickness that the material should be dived by the actual measured thickness and then multiply by 800.

So you get 70/70.03 = 0.999571612

0.999571612 x 800 = 799.657289733

So in practical terms that would make $102 = 799.657

It’s hard to get the Z axis as accurate because the movement is small to start with and flatness of the bed will also be a factor but as with the methods above for X and Y you have to accept that you are calibrating a machine and you won’t achieve perfection.