Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CNC language 3

Status
Not open for further replies.

EngJW

Mechanical
Feb 25, 2003
682
I would like to learn something about CNC programming. I am a design engineer and don't do any programming, but I know how to use Visual Basic and learned it on my own. We don't have any manufacturing engineers here anymore so it might be a good thing to learn (they will probably give me all the rope I want!).

Is there a typical language to start with, or is every machine different. If there is a common one I might be able to find something in the local or college library.

Thanks,
John Woodward
 
Replies continue below

Recommended for you

Most controls run G codes and M functions. This is a simple language to describe the equivalent of manual movements, and turn things on and off. The difficult part is each machine will have some differences in what code do what, so one programs won’t just work run on a different machine.
We do manual G code programming for most simple parts almost as fast as CAM software, and in some cases faster. Turning is easier to program than milling, and they have some different codes for the respective machine.
Most machines have programming examples in their operators manuals and a list if the codes they use for programming.
Most machines use G01 for linear feed moves, G02 and G03 for arcs, G00 for rapid linear moves. There will be several canned cycles to reduce programming steps and time. M functions turn thing on and off, M3 is spindle CW, M4 is spindle CCW, M5 stops the spindle, M8 turns coolant on, M9 is coolant off.
 
If you want to get into variable type programming, the language is a BASIC type code. You can establish variables, If..Then conditional statements, Goto, looping, and calls to sub-programs are about it. Depending on the control, both local and global variables could be available. Some controls also allow you to prompt the user for input.

If you know any programming at all, this will be easy to pick up once you learn you controls naming conventions.

These type programs in the CNC world are called macros (if you want to do any research). First make sure your machine/controller have macro capability and that that option is turned on. Then try to figure out the language.

The 2 websites I recommend for info are:

-->There's an excellent book available from Mike Lynch there too called something like Intro to Parametric Programming. It covers the main control languages out there.

and


I've been out of the CNC programming world for a couple years, but at that time these were the only worthwhile sites out there...and I doubt there's much more available now.

Good luck,
Ken
 
I suggest that you check out the following site. There is a powerful and free CNC programming aid/tutorial available for downloading. The author has an extensive background in technical education, and has also written an inexpensive CNC programming book which is available for purchase.



Manufacturing Freeware and Shareware
 
Most cnc programmng is done with a CAD program like Mastercam, Smartcam, Surfcam etc. And basicly what you do is draw the part and describe the cutters to use, and the program will do all the calculating for you. And then posts the actual program that the machine will use. And like the others have said it is in the form of dimensional points, and then the use of special commands that turn on an operating function in the machine tool, like to start the spindle rotation and go into linear or circlular interpolation etc. The commands being either M or G codes for those functions.
 
Before you start your endevour, there are some things you should consider and investigate.

1) The CNC programming is usually the easiest part of the job. Understanding tooling, machining, workholding, and troubleshooting are equally important and usually more demanding.

2) What machines/controls do you have and are they all pretty much the same age? Your task will be complicated if you have a variety of ages or of control manufacturers. There is an ANSI standard (or was at one time at least) for G/M codes, but it only covered the more basic points. Room was always left for the control/machine manufacturer to customize, and, as controls evolved, there was more custimization and therfore more variety.

3) There are at least 4 means of part programming in existance. Two were previously listed -- G/M coding (manual programming) and CAD system based programming. In addition, there are "language" programming systems (APT, Compact II, NiCAM, etc.) These have fallen out of favor with the advent and improvement of CAD systems, but do have some advantages if your environment is a production environment rather than prototype/job shop. Finally, some controls offer on-board programming that is similar to a CAD based system. You will want to determine what systems you have available and concentrate on that one. Even if you have a higher level system, you should at least understand the G/M code.

4) KenBolen commented about variable type programming previously. If you have a control with the type of variable programming he discusses, you are a lucky man indeed! Newer controls are more likely to have this type of system. However, there are as many different systems for parametric programming as there are control manufacturers. Additionally, each generation of control could have a different system! Some earlier controls actually put parametric programming features into the G/M codes and earlier ones did not have it at all! Again, it is important to know your equipment and to look at the manuals that came with it. Usually, there is a Programmer's manual in addition to the Operator's manual which will give you more specific programming info.

Good Luck!
 
There's a brand new, free visual tool designed to work with a subset of the APT language here. Has an editor, sample post processors, and 3-D backplotter. Would be a fantastic learning tool - down side is, documentation still being developed.



Manufacturing Freeware and Shareware
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor