CNC Programming Handbook

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Tin Falcon

Well-Known Member
Joined
Jul 9, 2007
Messages
7,207
Reaction score
787
As many of you know I am in the process of converting my mini mill to CNC as part of the project I am learning CNC programing. I have had a little formal training on the prototrack Mill , Have operated a CNC lathe for over a year and have taken a couple of computer programming classes over the years. But programming CNC is new.
So to help in this endeavor I ordered a copy of CNC Programming Handbook, Third Edition by peter Schid published by industrial press. The Same folks that do the Machinery Handbook. More info at industrialpress.com
I odered from Enco it is on sale for $57.95 free shipping and a free promo Enco baseball cap to cover the balding head. Or is to prevent hair being pulled out in the process of learning CNC programming? LOL!!
BTW the folks at mach 3 are using this book as a standard to modify and upgrade there product.
The book can be previewed at Google books
Tin
 
In my view I would not spend much time learning CNC programming.

Sure, in the old days you had to do that, and so there are lots of text books, and guys seem to think if you are going to use CNC you need to learn to write it.

Of the parts Ive made all but the most trivial have been made using CAD and CAM software. And the most trivial parts are best made using wizards.

Yes, you should be able to look at a piece of Gcode and understand what its doing, but there are only 4 or 5 codes you need for 99% of a program.

Many of the parts Ive made have thousands of lines if code. No one is ever going to write something like that 'by hand'

I have been using Sheetcam for 2 or 3 years now and it has done almost all Ive ever needed. I did do a couple of 3D jobs and I used MeshCAM for that.

Pick a CAM package and learn to use that- dont waste your time studying the internals of Gcode.
 
I haven't spent five minutes to learn anything about Mach3 software; but I have a lot of years spent on industrial CNC equipment.

Learning G-code can't hurt, although in the last few years I haven't done much manual programming. The CAM software I had been using did a very nice job of posting the program correctly, and some programs had over fifty-thousand lines of code. The reliability of the software, as Ron stated, in a way negates the need to learn "everything" about G-code.

One reason that CAM generated programs get so large is that they don't make use of the G02, and G03 for circular moves. Most break it down into short segments, how short depends on the software setup. That alone makes it very difficult to dig a bad move out of a program anyway. If you write it manually, or if the software you're using has the option to output G03-G03, it makes it much easier to edit if necessary, and makes a shorter program in some cases.

A benefit of manual G-code is making the machine do things it wasn't intended to do. I used to use our VMC for a lathe (we didn't have a CNC lathe) by making arbors for the parts and putting the turning tools in toolholders on the table. It worked very well; but the CAM software didn't like to co-operate, so I manually programmed these jobs.

A feature of (some, anyway) industrial controls is parametric programming. This allows you to use variables in your program and you can change the program by changing the variables instead of the entire program. Very handy for similar features like pockets. Canned cycles are basically parametric programs.

In a nutshell, yes, you can do most if not all of your program with CAM software; but learning the G-code is not a waste of time in my opinion.

I would be interested to hear what features Mach3 has as far as parametric programming, canned cycles, work offsets, etc. I have been thinking of retrofitting an older machine, and I've just started looking into the possibility of using Mach3.

Kevin
 
My work experience started out operating a Mazak turning center.
The Mazatrol conversational programing is relatively easy.
You can go to the Modal screens and watch the G codes flip by.

Then I was moved to an older machine that had been retrofitted with
Fanuc G code control. Programing was line for line.
Whole new world there!

Rick
 
When I get up and running I plan to get the wizard upgrade. I know the wizards will likely handle 90-95% of What I need to do. I will look into the sheetcam program as well. I tend to be a sponge when it comes to books on technical subjects.
I know CNC can be a different world and requires a different perspective. CNC can be intimidating. Unfortunately most of the shops I worked in the CNC machines were little used and often only used in manual mode. The exception was the one ROMI Bridgeport Lathe that I often ran And If I was not running it someone else was that probably ran 35 hours a week.
More than becoming an expert on line by line programming I want a good foundational understanding of CNC and G code.
I know there are many approaches to any machining task and and any good machinist is good at outside the box thinking. Right now I am trying to learn all the good stuff that is in the box of tricks labeled CNC.
And I like bargains according to Enco I am getting a $110.00 book for $ 57 Thought some other might be interested.
Do I NEED to learn a lot of G Code ? Probably not. Do I want to? Yes!
Thanks for all the input. .
Tin

 
I would be interested to hear what features Mach3 has as far as parametric programming, canned cycles, work offsets, etc. I have been thinking of retrofitting an older machine, and I've just started looking into the possibility of using Mach3.

Mach has all of that- parametric programming, many canned cycles, 256 work offsets, full tool table support, support for auto tool changes, support for modbus to control PLCs for very complex machine controls, probing, full 6 axis support. In short it is just about as capable as any commercial controller, for a lot less money. Thats why over 17,000 licenses have been sold.

 
Knowing Gcode can save some time. If you want to do a simple cut there is no need for running CAM software to get what you want. Sometimes the CAM won't do exactly what you want and you can manually add it if you know how.

I'm going to take a look at the book. The google preview is fairly complete. A local library actually has a copy. I added it to my half.com wish list.

I decided to get Visual Mill 5 Basic last year and have been happy with it. The interface isn't exactly intuitive, but once you figure out it's quirks it can do quite a bit. I specifically looked for software that would write arc commands and when set up correctly, it does. Surfacing still seems to be broken into segments, but I haven't really tried to figure it out. I'm running EMC2 with Gecko drives on servos.
 
Ron,

I did a little reading on Mach3, and it appears that it is very capable. I'm considering purchasing it even though I haven't really a need for it yet.

The fact that it does have parametric programming capability makes it very useful for common operations like pockets, bolt circles, facing, etc..

Dieselpilot,

I think that arcs in surfacing will be output as segments because of plane changes. I have used CAM software that would output plane changes and arc commands, but only if the arc is actually on one of the three planes. If all three axes need to move simultaneously, the output has to be segmented. Possibly axis rotation would make arc command output work?

Kevin
 
joeby said:
Dieselpilot,

I think that arcs in surfacing will be output as segments because of plane changes. I have used CAM software that would output plane changes and arc commands, but only if the arc is actually on one of the three planes. If all three axes need to move simultaneously, the output has to be segmented. Possibly axis rotation would make arc command output work?

Kevin

VisualMill is a little picky about settings. I think the biggest problem with surfacing most moves are going to be very short arcs or lines. Even when doing a cut in one vertical plane the odds of making an arc move are small. For instance you are surfacing a round section that is horizontal with a tool path that travels from the equator to the top to the other equator(trying to help visualize). With a square end mill the path should be an arc equal to the part radius with center offset to the outside by the tool radius. This is fine and should theoretically output an arc command. But if you use a ball mill and the program is writing code to the tip, this is not the case. Asking VisualMill to program to the center of the tool radius should output arc commands. I have not had a chance to try the different methods, so it may or may not result is what I want. Arc commands do shorten code substantially. I had a small part that was being written in line segments totaled 175kB, and when programmed with arcs ended up 8kB or so.
 
Greg,

With a square end-mill, you are looking at more or less an ellipse, correct?

One thing that has made a difference in segment or arc output for me is the accuracy settings for the toolpath.

Not familiar with VisualMill, so I don't know what settings are available to you.

Kevin
 
No, with a square end you are still cutting an arc, just offset to the side by half of the tool diameter. If you keep going over the top to the other side and back down, there would be a line movement equal to the tool diameter before the arc going down on the other side. A ball mill programmed to the tip would be somewhat elliptical.

VM has those settings too. It seems you have to set them in a several places to get it to do what you want.
 
I have read the 3rd edition and found it a very good book, I wish they had it back when I was learning CNC. I feel that even if you have CAM programs you need a very good basis in manual programing. For most of the type of work home machinist do you could do most of it in manual G-code. I have found a link to the 2nd edition on line.
http://books.google.com/books?id=JN...a=X&oi=book_result&resnum=3&ct=result#PPP1,M1
Regards,
Gerald
 


I did a little reading on Mach3, and it appears that it is very capable. I'm considering purchasing it even though I haven't really a need for it yet.
Joeby
Mach 3 can be downloaded and tried before you license it. Artsoft encourages this. Yes license it when you use it to cut chips.
Tin
 
Tin,

I very well may do just that. I still have some reading up to do on Mach3.

Does anyone have Mach3 running on a laptop? We have a couple of desktops at home, one claimed by my wife, and the other by the kids, so the only computer available for "experimentation" is my laptop. My concern is the "non-integrated video card" requirement. My laptop has, I believe, integrated video. I'm wondering if it's even worth experimenting with or should I be looking for another desktop?

Kevin
 
Joe
The Mach 3 web site has several manuals for download , many pages of reading. Certain lap tops will work but you need to be selective. IIRC A smooth stepper will eliminate laptop issues as the laptops can be a problem running off the parallel port but check the mach 3 forum on this. BTW smooth steppers run off a usb port,then convert to parallel. A regular USB to parallel port converter will not work.
Tin
 
Laptops with Mach are problematical- some work, some dont, and its hard to predict. It happens to work OK with my Compaq laptop, and I have used that to run it at shows.

The issue is that many laptops do strange things in the hardware, like cutting speed to save power, that are not under software control The shared memory of a video can be an example- when the hardware wants to update the display it simply stops running programs until its done. Its all unpredictable and uncontrollable, not what you want happening when you are controlling a real time machine.

If you are just planning to run it to see how it works, and not really drive a machine its fine. Or if you plan to drive a machine, and use a smoothstepper then laptops are OK.



 
Thanks for the information!

I had suspected that controlling a machine would be an issue with a laptop, and actually I would not be using the laptop for that purpose. I intend to get another desktop that I have up and running to actually use for the control, but until the time comes I would like to learn a little about Mach3.

My intended end-use is a retrofit instead of building, and I would probably be using an older CNC mill. The old Boss Bridgeports are probably what I'll be looking at, or possibly a newer Bridgeport VMC like a 308 or 412. I think Mach3 would work well in those applications, and the fact that it is capable of parametric programming and has canned cycles etc., would make it ideal for manual programming. I do not intend to be buying CAM software anytime in the near future.

Kevin
 
Tin Falcon have you visited www.cnczone.com a huge community of cnc'ers and a fast amount of helpful people and information on the website.

Mach3 is a awesome software package considering the price and what it can do. Ideal for hobbyists as it is a entry level to CNCing as apposed to some of the CNC programs out there for the industry that cost zillions of dollars.

CNC g code in its raw state is fairly easy to write but for some complex jobs it can be extremely time consuming and you better brush up on you mathematics.

And remember some of the g-code and m-codes commands are different from manufacturer to manufacture ie fanuc controller to Mazak " Mazatrol " to Okuma controllers and so on. So make sure you cross reference the machine that you are using for correct g and m code commands.

There are a few free g-code simulate software out on the net to aid in learn or teaching yourself.

http://www.cncsimulator.com/

http://www.ncplot.com/

I must mention this is a great website also
www.homemodelenginemachinist.com

cheers
 
I can get carried away at times and forget my manners!

Sorry, Tin, as I've been dragging this OT.

Anyway, I've seen the book you are referring to, and I would say that it's money well spent. I still think you should have an understanding of G-code even if you do use CAM software. It helps to know what your machine is going to do by looking a few lines ahead of it, if nothing else.

Kevin
 
This evening I'm starting my CNC Lathe programming course at Lanier Tech. While at present I have no intention of getting/building a CNC machine, I think it will be interesting to learn. The first quarter is just g-code programming; this summer, if I decide to pursue it, we can make some chips on the Haas.

I have had some "experience" watching other guys make parts on both the Haas mills and lathes. While they teach MasterCam for designing, all of the actual parts making seems to be hand-written g-code. I have been told that MaterCam generates pretty good code for the mill, but that its code for the lathe is quite inefficient. In any case, most of the lathe g-code I've seen at the machine seems to be simple (i.e., fairly few lines).
 

Latest posts

Back
Top