Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

CNC is programming "for keeps".

Any tiny little error in your gcode has a chance to crash the machine. Unlike a computer crash, a CNC crash results in broken metal flying across the room and anywhere from $5- to $5000 in damage. I programmed for a heavy machine shop for a year before I gave up and went back to making websites.

Hobby CNC is fun though, it is amazing what you can make out of wood when you can shape it with sub-millimeter precision. Also hobby machines are not strong enough to cause serious damage when you crash.



Yes. This article is about very low end CNC, just 2D routing.

Using a Dremel tool as a CNC router never works very well. The motor isn't constant speed, slows way down under load, and can overheat. The bearings can't take side loads for long, either. It's been tried. A Bosch router from Home Depot works much better. Those can cut wood all day. You can take off the handles, leaving a motor cylinder that can easily be clamped. Also, enclose the electronics in something that will keep the dust out. If the stepper motors are not dust-tight, they also need dust protection.

You need dust removal. Any CNC router doing useful work generates sawdust in huge quantities, much more dust than hand woodworking. Absolute minimum is a Shop-Vac sucking dust from the cutting area.

Trying to make a machine tool from low-end 3D printer parts does not work very well. There are some far better open source CNC wood router designs. The Maslow project [1] is especially clever and very useful, since it can make furniture-sized wood parts on a low-cost machine.

[1] https://www.maslowcnc.com/


I have to repeat the points in this comment. I've worked extensively with low-cost CNCs, and they can't really do anything more than light engraving of aluminum and slow cutting of wood. There are some straightforward physical reasons for this (there is no cheap and fast replacement for mass and torque).


You’re absolutely right. If you’ve been around industrial grade equipment, it’s painful to watch hobbyists fiddle with equipment that is not very productive, and soon abandoned.


You don't even need a commercial product like a ShopBot. There are some good low-cost DIY projects and kits using Bosch palm routers. Repurposed 3D printer parts are far too wimpy for this.


There are two types of dremels in the world, those about to overheat and those that are burned out.


A poorly programmed CNC machine can drill a gaping hole in itself, and into the table that it stands on. Don't ask me how I know.

If there was no table, it would be the ground, and yes, it would. Not many things can stand in the way of a spindle hell-bent on chopping chips off a block of titanium.

It's a very fun thing to play with, though. Probably the most high-stakes programming most of us are ever going to get.


In other words, don't mix up your G0 , G1 , G90 , and G91 .

Much sadness will ensue.


God, I hate how G commands are sticky in Mach 3. Much sadness indeed.


Can the CNC machine computer not simulate the program and see if it violates some safety rules like cutting into the table or removing too much material at a time?


It's not that easy. You need accurate models of your machine, the tools and the stock material. Your simulation has to be linked to the real machine movements and be ahead of time so you can estop the machine before the crash happens.

But that still doesn't help in case of insufficient workholding or breaking tools.


It seems like the machine itself could implement some safety checks, like if a motor is commanded to go outside of its range of motion you trigger a stop with an error code and let the operator sort it out.

Or go even more oldschool and have physical safeties on the machine that trip if your cutting tool attempts to exit the work area. I mean these aren't cheap machines, it seems like they could be engineered to be just a bit safer and error resistant.


I'm not a CNC machine operator, but I have written a lot of code for motion control systems. Typically, the machine can protect itself in that it knows where the limits are and how not to exceed them.

The problem usually comes up by crashing into something that is inside its known workspace. e.g., cutting into a vise instead of the object that's held in the vise, or an incorrect offset causing a crash into the table. The machine may know that it can only travel up or down by 12.500 inches, but it has to hold cutting tools that may be of unknown length and that can cause it to hit things (like its own table).


The machines do some sanity checking. Most of the issues come from the machine being improperly informed about what is on the table(height or shape) or the length of the tool in the spindle. The tool length can be tested if you have the hardware, but it's more difficult to scan the whole table for stuff that might get in the way.


If an axe could detect your thumb was in the way, it would no longer be useful.

There's a balance. Sometimes it really is up to the operator to maintain safety. Sometimes the machine can handle it. IMHO, other than reliably finding zero, everything else is up the the operator. The tool doesn't REALLY know how big it is or how fast it's going (just what it was told), and even if it did know, some operator would screw it up assuming that the tool was smart enough to adjust itself.


gotta disagree. I don't know anybody who works in a machine shop and doesn't want sawstop enabled, unless they need to disable it for a specific cut (wet wood).


Real CNC machines have limit switches, they monitor the load on the axis and spindle servos etc etc. But that doesn't prevent running your cutter into a fixture at positioning speed and ruining the spindle bearings.


My tin arse Cnc mill I made has stop switches. Probably the cheapest part of the whole thing and saves it grinding itself when you balls the code up :D


Do those stop switches prevent crashing the mill into a fixture? If so, how?

Do you manually monitor the entire job cycle?


High end CNC controls have chuck barrier software built in that makes this less likely. It needs to be skillfully set up. High end shops may also have good 3D rendering software that can be used to prove out toolpaths. The programmer will model his machines and fixtures accurately so he can then prevent crashes. Average CNC controls at least have line output graphics that prevent non-subtle mistakes. Finally, the operator will run the first part peering into the machine, with non-cutting rapid traverse moves artificially slowed down, and with her finger poised over the feed hold button.


"For keeps" is right!

Years ago I was helping a friend model a cam at the heart of a large piece of metals processing equipment for these guys: https://www.butechbliss.com

It was _almost_ right, but had a negative curvature on one surface. The effect was to lift a multi-ton piece of machinery off the floor – which it was bolted to.

My understanding is that the cam is now used as a coffee table!


Spindle crashes are terrifying. I've had a few. I've destroyed tools and pieces. Cost thousands of dollars in damage from a single misplaced tool path or lead in/out.

There's also this very transitive nature to the programs. Unless you make a whole bunch of the same pieces your programs tend to be one time use. 99% of the things we make in our shop are fully custom meaning brand new programs for every single table.


I program non-ferrous CNCs. Someone-who-wasn't-me crashed the head (router motor). $35k. Instantly. Breaking $160 bits is trivially easy.


>I programmed for a heavy machine shop for a year before I gave up and went back to making websites.

Yeah, very few people seem to be able to transition from "ship it now, fix it later" tech to programming for industrial purposes where you can't test everything without risking physical hardware. The other way around seems to be a much easier transition.


>>Any tiny little error in your gcode has a chance to crash the machine.

I would assume that an emulator for the machine exists that allows you to test your program before trying it out on the real thing. Was that not the case?


Good CAD/CAM software will detect obvious errors in the toolpath, but there are things that require common sense. A large proportion of machine crashes are caused by a discrepancy between the computer model and the real state of the machine, which the software is obviously unable to detect or prevent. CNC machines generally have no sensing capabilities; they rely on the operator to provide accurate measurements on tool height and work positioning. A transposed digit or a value entered in the wrong field can easily cause an ugly crash.

Workholding is a common issue - a 3D model just floats in abstract space, but a real part needs to be securely held in place. It's quite easy to inadvertently crash a tool or spindle into a clamp or vise, or to apply cutting forces that exceed the clamping force and throw the part.

https://www.youtube.com/watch?v=PsFNeiAu04M


Is there no way to test? Or there is, just not everything?


The best shops use simulation tools, but you need the 3D models / configurations of everything to make them work, and then the machinist still needs to load everything correctly. It's very easy to make a mistake.

Check out a simulator here: https://www.ncsimul.com/


There are machines that are "self-aware" in the sense that they run a simulation parallel to the NC control, slightly advanded in time, to catch catastrophic crashes and ESTOP the machine. Cutting into the machine bed can be _very_ expensive.


Which machines are you referring to?

How aware? Do they have any vision? Can they "see" or otherwise "know" about the cutters / workholding?


I know of WFL millturns with crashguard.

AFAIK the crash guard is a separate component that relies on 3d models of the machine and the tools, it doesn't see anything.

If you workholding is weak and a piece comes loose the crash guard probably won't make a difference.


>machinist still needs to load everything correctly. It's very easy to make a mistake.

Tool configuration is kinda-sorta solved with ISO 13399, this is being supported in more and more CAM systems and tool vendors, but as you say it is very easy to make a mistake.

Assuming the mistakes are happening when the tool data is reduced from the comprehensive format that ISO 13399 supports to the barebones and simple TxDxHx format that is loaded on CNC machine. Would be nice if machine tools supported a comprehensive format directly.


Not to mention workholding, etc. that might be off.


Tooling data in a G-Code data structure bootstrapped with G65 and M98 would support fixture models.

Certainly a chicken and egg problem though, my ideal future would have CAD files generated from single source of truth CNC files:)


We use a very simple method: overlay the position of the head/arm of the machine on top of the DXF file of the table.

If the supports/bars are in the overlay, the operator DOES NOT run that part and takes it back to design.


There's a lot that can go wrong, and it's too much work & tech integration for most shops to make the investment.

Even if you have the 3D models for everything involved: tooling, tool holders, stock material, fixtures, CNC machine, along with the instructions for the movement of all of it, there are still many opportunities for both configuration errors and runtime crashes.

For instance, CAM tools usually simulation axis movements only, before they've been converted to gcode/NC. If there's a bug in your post-processor that generates gcode or if it doesn't perfectly match your machine configuration, you're going to crash.

Even if you use a simulation tool like Vericut or NCSIMUL, which both simulate using the actual gcode, the physical machine settings may be out of sync, or there could be a wrong piece of stock material loaded or some foreign object (a wrench) that causes a crash.

Probing routines and careful selection of Work Coordinate Systems can help verify/eliminate some of these unknowns at runtime, but it's still no guarantee that the part will come out right.

Hardware is hard!


Most decent CAM software has at least some simulation routines, which is helpful, but definitely not definitive. There can often be errors such as defaults that are bad in some situation that create a lead-in/out that tries to clear the tool, but actually digs the full length of it into the solid material, and this might not be noticed in the simulation.

I've also frequently mocked up styrofoam stock material and run the entire toolpath through that, which can be very helpful, but again, not definitive.

Ultimately, you need to just be really careful about the toolpath creation, and watch the first run like a hawk, which can take hours. Pausing and starting each new segment at a fraction of normal speed can help also.

The cool thing is that once you've run the toolpath a few times and can trust it, you can almost start it and ignore it while the part gets made (note that the operative word is almost).

Even with the difficulties, when you have a good machine and some skills (and patience), it is quite rewarding what you can make!


Some CNC machines, like the Bantam Tools "Othermill", have software that does a "test" and will tell you if you'll crash into the board, and can recommend drill bit sizes. I'd highly recommend this machine btw, excellent support and I've been very happy with the results for both wood and PCBs.



You can put all your workholding devices (vice, clamps, etc.) and toolholder into your CAM software and it will find some crashes during simulations.

Most CAM will do good simulations.

I usually run a new program without an actual cutter in the spindle. Then I run it with the cutter but 2-3" above the actual material to be cut.

Many people will do trial runs on machinable wax.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: