Why use a Spindle Camera?
CNC Spindle Cameras Part II
--
Cameras on CNC spindles are essential for two reasons.
- They provide non-intrusive positioning and measurement at incredible accuracy.
- They allow you to measure and then fix physical errors such as rails not parallel, axes not at right angles, nonlinear leadscrews, … in software.
What is a camera for?
A camera is incredible at settings positions and measuring stuff. This also lets a camera (in software) fix physical errors.
Fixing errors is something you do once (or maybe an annual tuneup). Using the camera for positioning and measurement is an every-day thing.
Absolute Positioning
Finding the origin
I use this a lot: instead of physical probing I use the camera to find (0,0) of the workpiece.
- Compared to mill probing with a probe or mill bit this is incredibly faster. Center the camera on the corner and click zero — or position the probe near the left edge and probe (wait) then position it near the bottom edge and probe (wait). No contest.
- Compared to CNC probing with a laser it is much more precise. A laser probe is accurate and repeatable to maybe 0.1 inches. The spindle camera on my mill is accurate and repeatable to .0004 inches (optimistically).
- Only physical stops are comparable and they are usually impractical.
Finding the Origin Again
The camera shines every time I finish a piece and remove it from the CNC and find out either I forgot a cut or a hole is too small. Then I can put the piece back exactly where it was and get the missing cut exactly in the right spot.
For most cutting I use a left hand rail that never moves. I slap the material against the rail, clamp it and then use the camera to tell exactly where X0Y0 is. Takes zero time and perfectly good.
Finding a feature
When I need to widen a hole it’s a simple matter to use the camera to exactly center the spindle on the hole.
Non-invasive
Finding a position doesn’t require putting in a special probe or moving the head slowly and carefully. Just move the camera center to near the spot and click.
Measurement
Use the camera to measure distances, hole sizes, positioning. This is a great way to validate cuts and stock sizes.
Measuring distance for holes center-to-center is easy with a camera to look down the middle.
Generally I use a 5MP camera with a final resolution of about 1,000–3,000DPI and fix the focus at 3–5 inches depending on machine.
How to Do it
It takes two things.
- A Streaming Camera — here the Wi-Fi TinyCam in my last article is great. Any other image web source can also work.
- Software — the SpindleView application lets you use a camera with the CNC for measurement and positioning. It runs in a browser and supports any operating system since it’s written in Javascript.
A USB Camera
For machinery that generates a lot of electrical noise I use processors that are a distance from the machine along with a cabled camera, usually USB although ethernet has better noise resistance.
Some pictures of a USB camera. This camera is completely sealed and made from aluminum so it is very rigid and it can act as a passive heat sink for the camera module (which otherwise overheats quickly).
Here are two views of the case (exploded).
Background on Physical Mistakes
tldr; feel free to skip this but it’s instructive
This is a rather long but, I think, interesting and relevant story, so here goes.
Some time ago I bought a 1000lb 3'x4' CNC router to do woodworking with. The rails and carriages are topnotch, and the frame is steel. I was pretty sure I could do a repeatability of about 3 mils. (.003").
Then, I got this call out of the blue from a local fellow asking to borrow some time on the CNC to make two speaker enclosures. Speaker enclosures are very tweaky things made from sheets of MDF and ideal for a CNC. The holes have to be just right for the speaker drivers so they fit snugly with no gaps for sound to reflect from. I’ve made them by hand and they’re hellish. They always use butt joints (no joint — just glue and thick wood).
To save time I cut the enclosure panels in pairs across the CNC — since the enclosures were identical. We got all done and voila — or no — the boxes in fact were different. The left hand box the midrange driver didn’t fit. The right hand box it was loose. The panels between front and back were so different in width that the boxes wouldn’t seal not to mention close. I apologized profusely and spent time manually removing wood to get it all to fit.
Hmmmm.
I ended up CNC engraving a ruler in hardwood and comparing it to a known reference ruler — and it was way off. Sometimes as much as 1/32", sometimes not.
After much investigating I realized that the rails had been mounted on the carriage imperfectly. Not much off but off. It looked like they had to mill the rail guide in two steps and the two rail segments were at slightly different angles. In a few spots there were noticeable Y dimension errors, probably due to non-parallel rails or microscopic dirt smudges on the rail mounting guide.
How to Fix Physical Mistakes
I tried to move the rails to be perfectly parallel and not 2-segments and failed at both. So instead I decided to fix this in software.
- Measure the error very accurately.
- Enter correction tables into the CNC controller or alter the Gcode results to allow the CNC to correctly mill/route.
There is really only one effective way to measure the error and that is with a high resolution camera.
The error is caused by the spindle tilting in both dimensions. To capture the error requires looking down the spindle. Measuring motor move accuracy does nothing here.
So, it seems dumb, but the most accurate approach is to mount a camera on the spindle and have it look at a precise ruler. It sounds barbaric but it’s absolutely right.
I wrote an application that would look at the ruler (with the camera) and figure out the error, move the CNC 1 inch to the right, do it again 35 more times and then store the (X,Y) errors. Then it would do the same in the Y dimension. When completed, it stores the measured errors in a calibration table.
The above image shows the result of running this process and entering the X axis error terms into the CNC controller. The max error drops from about .031" to about .002". Mean error is even better.
The inlaid ring boxes above show how well it works. The dark and light pieces match wonderfully yet are cut in different spots of the CNC (and mirrored).
Onward
The next article in this series is all about SpindleView.