AI Generated GCODE Software

My boss wants me to look into software options to automate the CNC program creation using AI. Has anyone seen anything that has that kind of capability?

We recently lost our head programmer/machinist and I think my boss is trying to find a way to work with less or hire a lower skilled operator instead of an equivalently skilled programmer/machinist.

My first thought was, “hahaha, No way!”

But you are not asking about this as a joke. This is a real question and I want to give you a serious answer. I don’t have any experience with the solution you are trying to get to (AI generation of gcode). Nor do I have much experience with what an actual “head programmer/machinist” would be doing day to day. So take this opinion with a grain of salt.

But I will give you my serious opinion on it.

I can see a workflow with AI where and expert acts as an “editor” to let an AI program generate the majority of the output. And the editor does work like changes the prompts and changes the output based on problems they recognize. That kind of workflow could work well for writing buzzfeed articles or writing python programs. But the editor needs to have at least enough knowledge and expertise to know when the AI is doing it wrong. So they probably have enough expertise to do it themselves. That workflow would be valuable because they can 10x their production by being an editor instead of a code monkey.

The inverse of that, where someone who doesn’t understand the details uses AI to generate the final product will get a lot of stuff that looks right, but has bug mistakes (and the mistakes would be hard to find).

GCODE, in particular, would be a bad fit. CAM is already doing the grunt work for you. And the inputs you give it are exactly the information you need to generate the gcode. You can start with a part from and SVG or DXF and give it feed rates and DOC to make it cut it out. You can review it in the preview and find ways to optimize it by reordering operations or using multiple tools. That “intellectual work” is what you would have to feed into any AI. So generating those inputs would need to be done first. If you have the ability to generate those parameters, then the most effective way to turn that into GCODE is CAM.

Maybe, if you are doing complex CAD in something like Rhino and using a lot of scripts, then you can get assistance from AI to generate the first draft. But you won’t be able to use that unless you have a competent editor.

That doesn’t mean don’t try it. If there is some fractional chance that this would work, then it would be very valuable. You definitely need to find a way to measure the performance of something and present the results in a consumable way. Hopefully someone has tried it, or looked into it, and can give you some threads to pull on. I know there are a few posts here where people have poked it a little and gotten some results.

4 Likes

Bad gcode is going to waste workpiece raw materials and may very well crash the machine. My impression is that crashing a machine can be very expensive to repair. I don’t think it would take too many machine crashes to offset any savings from the programmer salary.

I would think the salary for someone able to effectively implement an AI machining solution would be way higher than replacing the CNC programmer/machinist would have been.

2 Likes

I’ve tried making chatgpt do simple plots for me, based on a visual description. It didn’t go very well. You might find the thread if you search around here. But I’ve been wondering how it’ll work if I thaugth it how to draw svg and take it from there. As Jeff already points out, the whole process would be quite complicated to embed in a workflow. If you figure it out, you might save a lot of time, but that depends if you are making the same similar operations over and over again. And at the end of the day, do you want to trust the AI with thousands of watt spinning at thousands of rpms? I’m not saying it’ll turn against you, but in the end we have to trust the gcode…

3 Likes

I’m wasting too much time writing a response and deleting it because it’s too snarky. Just smack your boss with a rolled up newspaper and tell him no.

4 Likes

I guess my title and description is slightly wrong. I should have said that he’s looking for a way to automate the CAM process. Possibly shave days to hours or hours to minutes for each project.

I believe Protolabs and Xometry have some homegrown software to do something similar for simple parts but I imagine they still have a machinists verifying the program before those are run and they manually do the complex parts.

We currently use MasterCAM which is very powerful but still has a workflow that has not really been updated from the UNIX/non-GUI days. So there are a lot of clicks, menus, hidden settings… which makes things a bit cumbersome.

We used Fusion for a couple years but our software security team did not allow us to renew the license since it’s cloud based. :roll_eyes:

I’m trying to keep an open mind for this investigation but I’m not holding my breath. Thanks for all the feedback. :grin:

1 Like

Oh OK. I see. Sorry I’ve had a lot of bad bosses so I got triggered when I saw the initial post.

If you don’t come up with anything, you might want to look into having an expert consultant come in and assess the situation. Switching a system can be potentially devastating if not done right. I work with several companies that were crippled because their new ERP systems weren’t implemented correctly. One couldn’t ship for an entire month! And don’t get me started about bad Lean implementation… they go through a lot of brooms in those places!

I completely understand and I’ll keep that in mind. I’ve found a couple possible options but we’ll see if they actually do what they claim. I’ll keep you guys posted if I find any that work.

1 Like

This is probably not true…

Sad, but it happened in the computer industry, and I don’t think machining is far behind, if indeed it has not already inverted. Programmers who could save a few machine cycles per operation were worth gold, then machines and machine time got cheap, and programmers were suddenly more valuable if they wrote stuff that a student straight from school could read and understand.

Let’s say a machine costs $30k. Not sure what a good machinist gets paid these days, but I’d bet on that being 3-4 months pay tops. Totalling the machine isn’t that much if it saves you $60k/year in salaries, payroll taxes, not to mention benefits…

What does still cost big is downtime, because that costs the salaries and repairs plus the work that normally pays for everything else as well.

I don’t know that I’d use untested AI generated gcode on an expensive machine, but could think that an inexpensive machine like a LR or Primo could probably be set up with a similar OS, even MACH for low dollar and could be used to test programs on softer materials, at least mitigating some issues in debugging.

2 Likes

So does my boss! Keep us in the loop!

1 Like

This has me thinking. CAM is backwards. We program the cuts in excruciating detail. If you had a program that could learn from your mistakes it would make CAM really easy.

Let’s just say you open a file, and STL or step, something 3D. After some initial setup you should be able to say pocket here, chamfer here, drill, carve (at first to train it). But the feeds and speed should all be automated. It should know what bit and how fast. As you makes some cuts you can say, that was a bit too much for my machine, or there is room to go faster. It should then know to either go deeper per pass or just move faster.

I think it could happen.

Eventually it would know what you want and the capabilities of your machine, and your endmills.

2 Likes

I watched YouTube videos on this application of AI and done a bit of play myself. These are experiments using ChatGPT. I’ve seen:

  • direct creation of g-code
  • 3D model creation
  • creating scripts for OpenSCAD

I found the results interesting, but not ready for any real-world use. None produced anything usable for a real CNC project. I doubt you will be able to replace/downgrade your programmer/machinist in the near future. I expect the early, successful AI tools will make your programmer/machinist more productive (so perhaps avoid the need of a second programmer), but you will still need the expertise to get safe, usable results.

1 Like

Well we’ve spent close to $3M over the last couple years in new machines and renovations to house them. We’ve invested in equipment/technology but for what ever reason they don’t want to invest in the people needed to run the equipment. It’s rather frustrating.

I believe this could be doable with today’s technology. Maybe the tricky part would be how to reliably get the feedback from the machine back to the AI. I guess that’s where the digital twin approach would come in but then you’d have to add a bunch of sensors to the machine. You’d also need to provide the visual feedback on the finished part but eventually you could possibly correlate the vibrations read by the sensors to the surface quality. Interesting. I’d also like that for my personal use.

I have the same thoughts. But AI driven technology is accelerating so rapidly recently we may see something usable sooner than later.

The machines can’t quit and go work for someone else who pays better.

Indeed I think it’s the CAM that could benefit from AI

If you have a 3d model, a software like fusion should be able to determine the appropriate sequence of drill, bore, pockets, cleans, contours to produce the modeled body out of your stock

Maybe think of it as an “auto-generate” button that produces a minimal viable opérations list you’d still need to review and validate

That would still be a time saver, even if you then adjust the feeds to better suit your machine

2 Likes

So I’m a split decision on if it’s beneficial or not.

But I will weight in, with respect to my “paying” gig in IT. So far, “AI” is failing to adjust alarm thresholds for monitoring both performance and security, in the real world. Of course the expectations are “it’s right around the corner” from management. And of course everyone’s sales and marketing group “claim” they have it today. And yet, every time we put it into a “real world” environment, instead of someone’s demo lab, well… I guess I should only say it falls a bit short (so I don’t make myself sound like a skeptic or negative person).

Considering so much of my time is involved “tuning” performance monitoring, and I’m involved in more security conversations that I should be, I should be excited about it. Yet I’m not sure if I will benefit from it during my career, at least in respect to IT monitoring. Keep in mind I’m one of two people that developed a in-house solution to get alarms into a ticketing system, that runs circles around anything available on the market today. So it’s not that I’m anti-automation. (My involvement cost some people their jobs, even though I had to, because we couldn’t count on them to do their job).

My personal observation as I get closer to the end, is that there’s a lot that I have or see today, that I wish I had access to as a younger person. And yet I question if I would have the same level of skill sets, or would I not be as skilled at doing things myself, if these things were available to me at a young age? Most of our “new employees” seem to lack logical/critical thinking. Not sure which is the better label. Simple example is if they can’t get the GUI to work, they don’t know that CLI is an option. I can’t prove it, but if they knew, and got to it, I’m not sure they would know what to do in CLI.

Of course I also remember the same fears, thoughts, ideas about robot arms on assembly lines in Michigan, robot use in warehouses, etc. So to me it’s the same conversation with different variables.

But now I feel like I’m climbing up on a soap box, or yelling at kids to get off my lawn. So although point and click helps get things quicker and cheaper, when things go wrong and point and click doesn’t work……

But this is more philosophy or opinion, not trying to state right or wrong, just my observations in my not very long life on this planet.

For anyone that read this through this far, bless you, and thanks for your time.

4 Likes

The feedback is critical. If you give it free rein, it will make some complete disasters. And many of them. Before it starts getting in the range of success. If the feedback is, “You destroyed my workpiece and bit, try again”. Then that is a very bad way for it to learn. You might as well hire a preschooler to do it.

If you can aggregate results over hundreds of thousands of users, then you can teach that toddler quicker and copy/paste the results to others. Then you have a solution worth pursuing.

Another implicit thing you’re saying is that instead of control knobs for speed, DOC, and step over, you want one knob for “load” and the CAM adjusts accordingly. Maybe it even tries to determine why some geometries need more and some need less loads. That isn’t a job for learning. It is a job for traditional heuristics (IMHO).

There would certainly be a big market for a truly smarter CAM process. One which tries to make the user make fewer mundane decisions. It would have to end up being very reliable for people to trust it though. Especially on $3M worth of equipment.

1 Like

Also cloud based, kiri:moto automates a lot of the CAM but it only uses 3D objects. You could theoretically run your own instance, since it is open source.

Estlcam and freecad are local options. Estlcam is much simpler.

2 Likes

That gives me the thought of using a couple different CAM packages depending on the type of part we are going to machine. Maybe a simple plate with slots & holes could be quickly done with something like Estlcam and the more complex surface/multi-axis parts with multiple setups would need to stay on MasterCAM. :thinking:

But I see a couple challenges. First getting a typical machinist past the “hobby mental block” of using a program like Estlcam over a typical “industrial” CAM package.

Second creating the post processors for each machine. I don’t have any experience creating post processors but I know we have to go back and forth to fine tune the post for each new machine and each time we get a new version of MasterCAM.

2 Likes

I have no problem being snarky about “AI” doing anything. Right now it’s just a fancy programing. There’s not intelligence in there yet. I have to deal with “ChatGPT said do this to fix my computer, and now it won’t boot” on a weekly basis.

4 Likes