Using Cameras to Enhance CNC Accuracy

by | Nov 13, 2020 | DMS Custom, Freedom

Camera lense on table

Innovation is what makes for excellence. At Diversified Machine Systems (DMS), we know that the moment we stop innovating is the moment we become irrelevant. And because the projects we tackle are constantly adapting, we know that we must be even more adaptive in our solutions.

For a CNC machine, accuracy is a great place to apply innovative technologies. Perfection is often an ideal that we fall short of in reality. Machines are not perfect, and pieces can be skewed in the X and Y axes during cutting. This is a problem we typically mitigate by using pop-up pins to brace against our parts. However, as much as we want to put a part on a machine perfectly every time, tiny defects are still possible.

At DMS, we began exploring the possibilities that a camera might offer. We equipped a camera with a light ring on a Freedom Machine. This would move in conjunction with the spindle.

Here’s how we set it up on a test project:

Three Steps to Align the Camera

Our primary purpose was to run a program that would allow the vision system to align with a marker—or fiducial. These markers, in this case dots that we printed on acrylic parts, allow for higher accuracy.

To setup these fiducials, we had to connect the vision system with the dots.

  1. We started by finding the master dot. We snapped the offset for the part’s program to the master dot—an instantaneous shift that helps align the part to the machine. Because one dot cannot provide any real orientation, we needed more points of reference.
  2. Next we looked for an orientation dot. Without an orientation dot, the markers are indistinguishable and the whole system fails. An orientation dot ensures that the operator of the machine put the part on the machine properly.
  3. From there we found the alignment dots. If you picture an L, the master dot would be at the elbow, the orientation dot would be on one arm, and the alignment dot would be on the other arm.

Once these three markers were in place, we could rotate the coordinate system.

This system allows for much greater accuracy. Even if a part was put on the machine at an angle that was a half-degree incorrect, the program would adapt to the orientation of the part. Not only that, but you would get scaling in both the X and the Y axes as well. Fiducial positions allow the program to cut the physical part with greater precision.

A User-Friendly System

From the start, our goal was to make this camera system as user-friendly as possible. That’s why we made sure that only four lines of code are needed. You input the X and Y locations for each of the fiducials, activate the offset for the program, and then run the M code that activates this operation—in our test case, M200. At this point it has everything it needs. It will automatically run this part according to the information you’ve input.

We also built up some strong functionality that allows the vision system to be largely self-healing. It finds its own orientation relative to the spindle. This works by putting a piece of MDF on the table, clamping it down, drilling a hole, bringing the spindle straight up, and executing the calibration M code. The camera will automatically find the center of the hole and simultaneously find the optimal focal height in Z. Then it will define the X-Y location of the hole. The program already knows the distance from the spindle to the center of the camera, so this is a streamlined procedure.

Another sub-routine that we wrote allows you to place the camera above a hole and run this M code to find specific holes or markers, bring the Z to an optimal focal height, and place the center of the spindle over the center of the hole. This is an incredibly useful sub-routine. It helps to ensure that everything is aligned correctly, to check the calibration process, and also to quickly find the locations of holes.

A Camera with Many Uses

Customers can choose to include this camera option on a 3 or 5-axis DMS machine. The 3-axis routers are a good fit, and the 5-axis options work even better. We can train the vision system to identify not only dots but a wide range of fiducial markers, customizing to meet your specific needs.

Our camera system improves your accuracy almost to the point of perfection and gives you confidence in your final product. This has many practical applications for a number of manufacturers. Whether you print signs and displays or work with acrylics, we know you’ll be pleased with the results.

If you would like to discuss putting his exciting functionality on your DMS machine, contact our team of experts at or 855-266-5064.

DMS Axis Logo

Subscribe To the Manufacturing Minute

The Manufacturing Minute is our monthly enewsletter. We deliver the latest manufacturing industry news, updates on DMS events, and the latest content from our blog. Subscribe today to stay in the loop on what's happening in manufacturing and at DMS.

Thanks for subscribing!