CMM basics

It was a rainy day and I had an Additive manufacturing exam the day after. I couldn’t understand what are codes 38.2 or 43.1 in the coordinate measurement systems and I was searching the net but nothing could I find! So I decided to write this post to share what I know now with others.
I will try to cover all the necessary information on CMM basics and to help you understand and do manual coding for CMM machines.

What is CMM?

CMM stands for Coordinate Measurement Machine. The idea is to use existing CNC systems for measuring objects with very high accuracy. It is important to be able to verify the dimensions of parts produced by CNC or other manufacturing systems to comply with the requirements of high-tech applications like aerospace and pharmaceuticals.

A CMM machine works similarly to a CNC and basic principals of movement for both systems, which is G-Code, are the same.

CMM Equipment

The Machine

CMM machines come in different shapes and sizes. The most widely used CMM machine type is Bridge type, which delivers high accuracy and less Hysteresis error, However, different machines are used for specific needs. In the image below you can see different types of CMM machines.

CMM basics
CMM machine types

A very well-known Manufacturer of machines is a Mitutoyo company. They have a wide range of machines for different applications.

The probe

The probe holder in a CMM machine is the part that attaches the probe to the moving arm of the machine. It has sensing capability which is necessary to understand the position of the probe.

There are 2 main types of probe holders:

  1. Resistive (simple, Compact and Rugged)
  2. Strain gauge (High accuracy, long life, and low hysteresis error)

Probes come in different lengths and properties. They have a sphere at the touching end which is made from Rouby which is a material that has a very low compression when applied to contact forces. This is crucial because we are working with very high accuracy and even a nanometer of compression can introduce an error.

A very well-known producer of Probes is Renishaw. They invented the technology and are making high accuracy and high-quality probes since 1974.

CMM specific G-code

The G-code is used to operate the CMM machines as in CNC machines with some extra codes for specific applications. If you are familiar with G-code go on and read the rest of this article. If you are not familiar, just search the net and there is a ton of information and training.


G38.2 is the move to touch and measure code for the CMM machine. Let me explain with an example.

Imagine we want to measure the height of the object as shown in the figure. The code will be:

G00 X50 Z25 (Rapid movement until a safe position)
G38.2 Z15 F20 (Slow down and move until contact)

We need a rapid movement in order to have a time-efficient operation. Then we need to slowly touch and measure the values. That is why we use a very low feed to have high accuracy and avoid any damage to part or probe.

So what happens after contact ? The machine saves the position in the variables from #5061 to #5069. So we have:
X => #5061
Y => #5062
Z=> #5063

If you need to save a value you simply write
which means that you tell the machine to save the X value of the measured point in Variable #1001. You can use this saved value later.

Since you cannot put the object on the machine very accurately, for finding the initial position of the part on the machine, you need to calculate the initial orientation of the part.

For this purpose, you will measure 2 points and store Y and X values in the variables ranging from 1001 to 1004. Then with a very simple calculation, you can find the angular position of the part and rotate the coordinate system of the machine accordingly. This is a must for measuring different slopes in parts.


G43.1 is the probe length compensation. It will facilitate programming just like G41 and G42 in CNC, therefore you can use the same code with different sized probes.

Finally, I hope this article helps you to understand the CMM basics. If you find an error or have any doubts please ask me in the comments below.


Leave a Reply

Your email address will not be published. Required fields are marked *