Category Archives: CNC Programming

2 vs. 3 Axis Machining – CNC Profiling

Traditional 2-axis milling on a CNC machine is still very common, you adding another axis to the equation greatly expands your possibilities. You can make parts that you might not have been able to before when just using 2-axis programming, and it can possibly reduce cycle times.

First, we must establish the difference between two and three axis machining. Most CNC mills these days should be able to accept and perform programs with 3-axis machining. Two and three axis machines both have an X, Y, and Z axis, but using that third axis for milling profiles can allow you to profile the surface of a part.

In 2-axis milling, you can move in the X and Y-axis at the same time if you’re milling the outside or inside profile of a part. If you’re using the third axis, you can make X and Z-axis moves while milling a profile, such as a waving contour. You can also move in the Y and Z-axis if you simply change the plane that you program in.2 vs. 3 Axis Machining - CNC Profiling

If you’re hand-writing the program, G17, G18, and G19 are the CNC commands for selecting which plane you want to machine on.

G17 is the XY plane.

G18 is the XZ plane.

G19 is the YZ plane.

Other than that, programming is virtually the same as any other G-code program. If you want to make a positive Z and negative Y move, an example would be:

G90 G20 G19 (To set the YZ plane and absolute)

 

G1 Y-.5 Z2.23

If you want to go back to the traditional XY plane, a line with G17 will be needed.

If you have rendering software or a program that simulates your program, I strongly recommend using it on a new program, especially if this full 3-axis machining is new to you. Good luck, and go experiment! The best is experience is with machine time and trying new things.

CNC Programmer Salary – How Much Am I Worth?

Are you good at programming on CAM/CAD software? Programmers are in high demand in most areas around the United States. The salary, or wage, for CNC programmers depends on a couple things. There’s a wide spectrum of programmers because not everyone has the same experience. However, just because you have 10 years of programming ‘experience’ doesn’t mean you’re worth more than the other guy that gas only 3 years. More on this later…

Master The Systems

While a programmer with less years on the job can get paid more, the more you know the better. Having 8 years of experience on Mastercam is great, but if you know how to program on Gibbs, Surfcam, as well as multi-axis on CAM systems, you’re worth more to certain companies.

Knowing how to run multiple CAM or CAD systems gives you an edge over the competition if you’re looking for a job because you’ll fit the “requirements” for a lot more companies that are looking for a programmer.

CNC Programmer Salary - How Much Am I Worth
Programming on Mastercam

Even if you haven’t worked with a certain software that a company you want to work for uses, having experience with multiple other systems makes you more versatile, which will making it much easier for them to train you in on their programming software. Every CAM/CAD system is different, but you’re essentially doing the same thing with all of them; programming. If you’re used to being acclimated to a new software, learning how to use one more shouldn’t be an issue.

What’s the Demand?

If there’s no demand in your area for a programmer like you, don’t expect to get a high paying job offer in the near future. Big cities with Machining, such as Houston, Minneapolis, and Ohio have a high demand for any and all kinds of Machinists or Programmers. Finding a job in these areas isn’t too difficult today because the manufacturing demand is high.

If you want to get started as a programmer, you can find easier jobs at shops that will start you at the bottom and work your way up if you only have school experience. It’s not going to be a wealthy salary, but it’s better paying than most operators.

Let’s See Some Numbers

Okay, this is probably the real reason why you’re here… Programmers are usually paid more than machine operators, which is a big reason why so many machinists go to school for programming. Before I throw any digits out there, you should know that these are not set in stone. Every market and area of the country/continent is a little bit different. These numbers are a general starting point to show you what a CNC programmer can make for a living.

If you’re looking for a first just as a programmer, even if you’ve been a machinist for a few years, you’ll probably start towards the bottom of the pay scale. Right now, most full-time programmers start out around the 18-20 dollar an hour mark. It won’t make you rich, but if you’re looking for a good starting job, there’s usually a good amount of room for improvement.

If you look in the classifieds of Job listings, you’ll often see Programmer wanted ads with 3-5 years of experience. With more experience, comes more money (for the most part). The compensation is usually in the low-mid 20s for wages, and if you’re working overtime like a lot of shops do these days, that could be a pretty decent paycheck. However, like mentioned before, not only do you have to have the years of experience qualification, but also the right kind of experience as far as programming on CAM/CAD systems.

For you programming masters out there, high 20s and into the $30+/Hr mark is not uncommon. Some machine shops just need a lead programmer that can do it all, and to some companies, that person may be worth 35 bucks an hour.

Lathe and basic mill programmers are usually at the bottom of spectrum because they require the least amount of skill and training. The high-end jobs are usually multi-axis or special milling programmers that require a lot more training.

Once again, these salaries aren’t going to make you a millionaire. But that’s not why you chose CNC Manufacturing as a career, otherwise you would have gone a different and probably less interesting route.

If you have any questions, feel free to post a comment…

Manual CNC Programming – Pros & Cons

Manual programming for a CNC mill or lathe has been the most common way to program over the years that CNC machines have been used. Manual programming is done either by hand and transferred to a computer file, or punched in by hand on the machine controller.

Pros

Lets look at the good stuff first… Manual programming is limitless when it comes to developing a part program. You can set and adjust every fine detail to your exact touch, whether it’s tweaking feeds and speeds, changing cycle parameters, or using different cycles.

Another big advantage is that manual programming teaches strong discipline. The machinist writing and/or editing a program must grasp the skill and techniques of CNC programming to be proficient. Every number, every letter, every decimal, must all be to perfection for the program to run smoothly. In addition, being able to do all of your programming gives you an edge over the competition when it comes to looking for a job.

A bonus if you’re going be programming on a CAM/CAD system, is that you will be able to understand what exactly is going on and why. Programming software can get pretty complex these days, and it’s your job to know every little detail on how the part is being programmed.

Cons

Manual programming definitely has its disadvantages. The time it takes to make a complete program is probably the biggest downfall. Compared to making a program/toolpaths on a CAM system, hand writing can take considerably longer, depending on the machinist. Not to mention the time it takes to run the program out and make sure everything works.Manual CNC Programming - Pros & Cons

Another important disadvantage would be the number of errors in the program. When you’re writing a program by hand or punching it in the controller, it’s very easy to make a mistake. All it takes is on wrong number, letter, is a misplaced decimal.

Other areas that make manual programming inferior include: not being able to see your toolpaths, as well as the complication of needing to edit a program and more.

While there are some huge downfalls to manually writing a CNC program, having the ability to manual edit a program is still extremely important in this industry. Just like giving a kid a blow torch; not knowing the basics before using high-tech software is a bad idea.

Basic Programming Terms – CNC Structure In 4 Steps

Character

The smallest unit in CNC programming is a character. It can be a letter, digit, or a symbol. They are combined to make ‘words’ in the CNC language. A letter is just what it sounds like; a letter from the alphabet. While 26 letters are usable for programming, read this article for a list of commonly used letter codes.

There’s ten digits, 0 to 9, used to make numbers in programs. They are used in two different ways; with or without decimals. It depends on the mode, as well as the control. A number can also be used in place of a decimal-number if the controller allows it.

Symbols are the third type of character used in CNC programming. It depends on the control options, but the symbols used most often include: a decimal point, parenthesis, minus sign, as well as a percentage sign.

Word

Words are the next step in the structure, and they are simply a combination of characters. A word consists of a capital letter, followed by a number, and sometimes a symbol, depending on the code. Words are used to specify speed, feedrate, position, commands, and other functions.

Block

Basic Programming Terms - CNC Structure In 4 Steps

A Block, also known as a Sequence block, is multiple Words. A word is just one piece of information or instruction, while a block uses at least one word to make a complete command or cycle. Blocks are written on separate lines, and are separated by an “End-of-Block” code.

Program

How do you get a CNC Program? You put a bunch of Blocks together that will machine a part. As simple as that sounds, you have to have all the right characters and words to get each command to work. A program will begin with a program number, and will be sequenced by blocks in order of operations, and end with a program stop or cancel code.

Character > Word > Block > Program

Letter Codes List For CNC Machine Programming

If you’ve already learned all of the Preparatory and Miscellaneous function codes, it’s time to move on to the Letter codes for CNC programming. Most of the letters of the alphabet are used on milling machines.

Just like the G and M codes, not every machine uses the same Letter codes. Also, there are several letters that are used in more than one function, but that depends on the input units.

Below is a list of the most commonly used letter codes when programming on a milling center. However, I recommend reading through your machine’s manual to confirm that they have the same function, or if your machine uses different letters/codes.

  • A – Rotary or indexing axis around the X-axis (unit in degrees)
  • B – Rotary or indexing axis around the Y-axis (unit in degrees)
  • D – Cutter radius compensation offset number
  • F – Feedrate function (may vary)
  • G – Preparatory command (G-code)
  • H – Tool length offset number
  • I – Arc center modifier for X-axis (radius)
  • J – Arc center modifier for Y-axis (radius)
  • K – Arc center modifier for Z-axis
  • L – Repetition count for subprogram/fixed cycle
  • M – Miscellaneous function (M-code)
  • N – Block or sequence number
  • O – Program number
  • P – Subprogram number call; Work offset number (used with G10); Dwell time in milliseconds; Block number in main program when used with M99
  • Q – Depth of peck in fixed cycles G73 & G83; Shift amount in fixed cycle G76 & G87
  • R – Retract point in fixed cycles
  • S – Spindle speed in Rotations per minute (RPM)
  • T – Tool function
  • X – X-axis coordinate value designation
  • Y – Y-axis coordinate value designation
  • Z – Z-axis coordinate value designation

Letter Codes List For CNC Machine ProgrammingMost of these letters you will be using over and over again in your programs. A and B are used if you have a four or five axis machine, otherwise you won’t need to use them.

Some letters have multiple uses that you may have to incorporate in your program. “P”, for example, can call out the time that you want to dwell (pause) with a tool, or it can call up a subprogram number.

It’s up to you to learn these if you want to know how to create and edit programs. A lot of the letters are easy to remember, so if you already memorized all of most of the G/M codes then this is a piece of cake.

M-Codes List For CNC Machine Programming

Miscellaneous Functions is another name for M-Codes. How are they different from the G-codes in my previous post? The G-code is a preparatory command for CNC programming, which presets, or prepares, the machine to use a certain cycle or mode. An M-code is an actual machine function.

A machine function is something that the actual machine does, whether it’s turning on the spindle or ending your program. Not every machine is the same because there are many different CNC machine manufacturers, as well as different controllers, so I recommend reading through your machine’s manual to see what M-codes you can use.

  • M00 – Compulsory program stop
  • M01 – Optional stop
  • M02 – End of program (no rewind, usually with reset)
  • M03 – Spindle on (rotate CW for R/H tools)
  • M04 – Spindle on reverse (CCW for R/H tools)
  • M05 – Spindle stop
  • M06 – Automatic tool change (ATC)
  • M07 – Coolant mist ON (optional)
  • M08 – Coolant ON
  • M09 – Coolant OFF
  • M19 – Spindle orientation
  • M30 – Program end (always resets & rewinds)
  • M48 – Feedrate override cancel OFF (deactivated)
  • M49 – Feedrate override cancel ON (activated)
  • M60 – Automatic pallet change (APC)
  • M78 – B axis clamp (nonstandard)
  • M79 – B axis unclamp (nonstandard)
  • M98 – Subprogram call
  • M99 – Subprogram end

M-Codes List For CNC Machine ProgrammingUnlike a G-code, you can only use one M-code per line/block of code. Using an M03 and M04 is not possible because they do two opposite functions.

The more M-codes you try out, the more efficient you can become. M98 can significantly decrease programming and possibly cycle time because it calls up a sub-program that can be repeated over and over any given number of times.

There are more Miscellaneous functions than listed above, which are referred to as ‘machine specific codes’. You will have to learn the codes used by your individual machine and controller to get the most out of your CNC machine, whether it’s a milling or turning center.

Absolute Vs. Incremental – CNC Programming

To be able to write and edit programs, you must know when and how to use Absolute and Incremental modes effectively. More programs are in absolute, but there are times when it’s easier to use incremental.

There are major differences between to the two, so if you don’t know how each one works, don’t start programming until you read this. Mixing the two up can and will cause a disaster

What Is Absolute?

When programming in absolute, all of your coordinates and movement values will come from the origin (0,0) point. If you want to be in Absolute, the G-code that defines this is G90, which is a modal code.

Absolute Programming
Absolute Dimensioning

Most CNC programs are written in absolute because it is easier to understand. Why is it easier, you ask? Because if you have a lot of coordinates to move, you always know where the center of the tool is in relation to the work offset.

What Is Incremental?

How is Incremental different from Absolute? Well, instead of all of your coordinates/numbers coming from one location (0,0 offset), each move is the distance from your current location. That means if you want 2 holes that are 4.000″ apart and start 4.000″ from your start location, you would use X4.0 twice, as opposed to using X4.0 and then X8.0 for the second hole if you were to use Absolute. G91 is the G-code that puts you in Incremental mode, and it is modal as well.

Incremental Programming
Incremental Dimensioning

Which one is better? That depends on what you’re doing, but 99% of the time Absolute programming will be easier. If you’re hand-programming, it may require a little more math, depending on how the blueprint is laid out, but it will be much easier to go back and read or edit the program if there is a mistake.

In G90 (absolute), no matter where your tool is, you can always go move to a certain location by inputting those coordinates, such as X1.625Y-.875. However, if you’re in G91, you can’t just punch those numbers in if your tool is somewhere other than the origin. If you put in those coordinates, your tool will move a positive 1.625 in the X direction, and a negative .875 in the Y direction from where it currently is.

So, how do you get to that location in G91? You have to know where you tool is, then add or subtract the distance of the location from where it is relative to the origin. You see now why incremental can be very confusing? If you’re in G91 and have dozens, or even hundreds of moves, one mistake in the middle of the program and all of the following numbers will be skewed because they all come from the previous location.

On the flip side, you can alternate between G90 and G91. If it’s easier to use incremental for a few moves, use G91, then when you want to go back to absolute, just put a G90 on the line of the next move.

CNC Software For Machining – What Is The Best CAD/CAM System?

If you want to be a programmer or make your own parts some day, you’ll want to get a good software for CNC machining. There are a lot of different systems out there, but you don’t always need the biggest and baddest one if you can make your parts with a cheaper software.

CAD vs. CAM??

First of all, lets answer this question on CAD versus CAM systems. CAD programs are used mainly for making part drawings, blueprints, and make an overall model for the part you are going to machine. CAD is for generating toolpaths for the designed part. This is usually with G-codes and M-codes. Why do I need these, you ask? Well, to be honest, you don’t. You don’t even need any kind of software for machining. That is, unless, you don’t want to write everything by hand.

Lets face it, technology has skyrocketed in the past few decades, and even in the last 5-10 years, efficiency and quality are in high demand. China still can’t compete with USA made stuff, but for everyone to start buying from the United States again, companies want to buy parts and tools at a Chinese price tag. In order to bring the cost down, efficiency is extremely important, and this doesn’t just include programming a part (Read more about this on my Keys To Being A Good Machinist post).

Computer-Aided-Design

In order to be efficient, buying a CAM system may be necessary if you get a lot of blueprints and drawings. You will be able to make part drawings, fixtures, and jigs, which can also help reduce set-up times (the ultimate money maker/loser).

You can draw 3D models of parts to see different views of it, which can help the programmer when making toolpaths for it. With Cad software, you can put pieces together with an Assembly feature. With this, you can see what it looks like when the part is in the fixture you also designed. You’ll be able to determine what tools to use and how to optimize the set-up before you even start cutting metal.

There’s a lot of CAD systems out there for CNC machining, but if you’re running a real machine shop and need to be competitive, you’ll have to shell out some dough to get one. Free software will not get you very far, which is why it’s free. However, you may be able to get a free trial for paid software, which I recommend if you have the time. The most popular CAD systems include: Solidworks, AutoDesk Inventor, BobCAD,

Computer-Aided-Manufacturing

When used together, Cam and Cad software can be a powerful combo because they save time, which relates to money. If you have to hog out a billet part, writing out a program on the machine or by hand can take hours, and sometimes days if the part is large and/or complex. While I believe that you should be able to hand-write CNC programs first, CAM software can make almost any part in a fraction of time.

In the system itself, once you have the part model loaded, you don’t even have to write any kind of code; the computer does it for you! Let me explain… Lets say you have a 2 x 2″ square part that you want to mill down to a height of 1.5″. In the CAD program, you set the stock size and where the offsets will be (X, Y, Z zero). Once you have that, you pick the tool you want to use (we’ll just pick a 3″ face mill for this operation). Then you pick what kind of toolpath you want it to run; there’s a lot of options for this, but we’re just milling off the top. After that, it’s just setting your parameters for where you want the tool to start and end, how much material to take off, how much you want to take off each pass, and what you want it to do after the operation.

There are so many things you can do with a modern day CAM system that it can be rather intimidating to someone that hasn’t used one before. If you get a training book or have an experienced programmer teach you, starting out will make things a lot easier. The more time you get on the software, the more you’ll figure out what you can do with it, which will help reduce operation times, as well as being able to make more complex parts.

Mastercam is one of the most popular CAM systems because it is easy to use and is fairly versatile. Surfcam, BobCAD, EdgeCam, and RhinoCAM are also great software for machining. It also depends on what you’re machining as well. Are you just doing 2-axis milling? 5 axis? Turning on a lathe? Live tooling? Doing a little research will help you find out the advantages of each CNC software system.

When it comes down to it, it really depends on how comfortable and experienced you are at using a CAD/CAM system, as well as how complex your parts are going to be. If you’re just using a 2-3 axis vertical milling center or a CNC lathe, you will more than likely be able to do everything you want on them with a more inexpensive software. Finding one that is easy to use should be high on the list if you’re just starting out. However, this can be a compromise that will hold you back when you want to do more technical operations.

 

CNC Programming Training

CNC Programmer Training Requirements

In order to become a CNC programmer, you must have extensive knowledge and experience as a machinist and troubleshooter. Programs are written in G-codes and M-codes, but modern CAM/CAD software has made it easier to perform complex and precise operations. Depending on how quickly you catch on, it can take years to learn how to program parts from start to finish. You must know the ins-and-outs of machining; how machines work, how materials react, what kind of cuts to make, what tools to use and how to use them, how to order the operations, and the list goes on.

Machinists use to mill, cut, drill, and form parts on a manual machine. This resulted in much slower and less-than-consistent parts, depending on who was running the machine. However, being able to machine parts on a manual mill and lathe will greatly help you understand on how to program parts in the future. I also strongly recommend that you learn how to hand write your programs before delving into CAM/CAD software. It will take longer to learn, but being able to edit/fix your program after it is written on software is priceless.

The time of programming training you need depends on the machine shop you’re working in and how complex the parts are. A shop that makes fairly simple parts on 3-axis CNC mills will require much less training than a shop that does 4 or 5+ axis milling.

Most machinists learn on the job over the years from more experienced people and work their way up the ladder.

What Are the Benefits of Becoming a CNC Programmer?CNC Programming Training (2)

There’s several good reasons why you should train and work hard to become a programmer. Yes, it is more demanding with an increase in pressure, but what higher paying jobs aren’t?

The first reason is obvious, as you will be getting paid more than a machine operator. This reason alone is worth the time spent learning and practicing how to program. Learn from the best and you’ll be the best.

Second, it will open up more possibilities in the future if you plan on moving some place else. It’s always good to add things to your resume, and more companies will consider you with programming experience under your belt.

Another reason to train to become a cnc programmer is because you won’t be doing the dirty grunt work. No more cutting stock, deburring parts, or getting filthy from all the oils and dust. Programming is usually done in a separate room or part of the building that is clean with computers.

Where Do I Get CNC Programming Training?

If you are already on the job as a machinist, the best way to learn how to program is by “shadowing” someone that already knows how and is willing to teach you over time. If you have an experienced co-worker that has the ability to do that, take every advantage of that as you can!

That, and taking classes at your local Tech school are going to be the easiest ways to get trained in. If you have the time, it might be worth it to check your local Technical school for CNC Programming courses. There you will get hands-on work, and you will learn new things faster since you will be working on it every day.

Another possible way of learning how to program is with a Programming Training Software. If you are good at learning things on your own, this may be the best route for you, as you can train on your own time. It’s cheaper than going to school, and you can always go back and re-learn things. However, if you are someone that asks a lot of questions and needs a mentor, this may not be for you.

Click Here To Buy My CNC Programming Handbook. I have found this book to be the most resourceful as far as programming goes. Everything you need to know about programming 3-axis parts is in this book.

G-Codes List For CNC Machine Programming

To be able to program CNC code, you must know most, if not all, of the G-codes and what they do. A CNC machinist will know how and when to use each code so that that part will run the most efficient. The program address “G” is a preparatory command. It prepares or presets the control system to use a certain mode or operation. Below is the list of G-codes that are used in most modern CNC Milling machines:

  • G00 – Rapid positioning
  • G01 – Linear interpolation
  • G02 – Circular interpolation clockwise (CW)
  • G03 – Circular interpolation counterclockwise (CCW)
  • G04 – Dwell – as a separate block only
  • G05 – High-speed machining on Fanuc control (Look ahead)
  • G09 – Exact stop check – one block only
  • G10 – Programmable data input – Data Setting
  • G11 – Data Setting mode cancel
  • G15 – Polar Coordinate Command cancel
  • G16 – Polar Coordinate Command
  • G17 – XY-plane designation
  • G18 – ZX-plane designation
  • G19 – YZ-plane designation
  • G20 – Imperial units of input (Inches)
  • G21 – Metric units of unput
  • G22 – Stored stroke check ON
  • G23 – Stored stroke check OFF
  • G25 – Spindle speed fluctuation detection ON
  • G26 – Spindle speed fluctuation detection OFF
  • G27 – Machine zero position check
  • G28 – Machine zero return (reference point 1)
  • G29 – Return from machine zero
  • G30 – Machine zero return (reference point 2)
  • G31 – Skip function
  • G40 – Cutter radius compensation cancel
  • G41 – Cutter radius compensation – left
  • G42 – Cutter radius compensation – right
  • G43 – Tool length compensation – positive
  • G44 – Tool length compensation – negative
  • G45 – Position compensation – single increase
  • G46 – Position compensation – single increase
  • G47 – Position compensation – double increase
  • G48 – Position compensation – double increase
  • G49 – Tool length offset cancel
  • G50 – Scaling function cancel
  • G51 – Scaling function
  • G52 – Local coordinate system setting
  • G53 – Machine coordinate system
  • G54 – Work coordinate offset 1
  • G55 – Work coordinate offset 2
  • G56 – Work coordinate offset 3
  • G57 – Work coordinate offset 4
  • G58 – Work coordinate offset 5
  • G59 – Work coordinate offset 6
  • G60 – Single direction positioning
  • G61 – Exact stop mode
  • G62 – Automatic corner override mode
  • G63 – Tapping mode
  • G64 – Cutting mode
  • G65 – Custom macro call
  • G66 – Custom macro modal call
  • G67 – Custom macro modal call cancel
  • G68 – Coordinate system rotation
  • G69 – Coordinate system rotation cancel
  • G73 – High speed peck drilling cycle (deep hole)
  • G74 – Left hand threading cycle
  • G76 – Fine boring cycle
  • G80 – Fixed cycle cancel
  • G81 – Drilling cycle
  • G82 – Spot-drilling cycle
  • G83 – Peck-drilling cycle (deep hole drilling cycle)
  • G84 – Right hand threading cycle
  • G85 – Boring cycle
  • G86 – Boring cycle
  • G87 – Back boring cycle
  • G88 – Boring cycle
  • G89 – Boring cycle
  • G90 – Absolute dimensioning mode
  • G91 – Incremental dimensioning mode
  • G92 – Tool position register
  • G98 – Return to initial level in a fixed cycle
  • G99 – Return to R-level in a fixed cycle
3rd Edition
3rd Edition

Two G-codes may be used in the same block (line), such as G00 and G90, if you want to Rapid to a position in the Absolute mode.

Not all of the listed G-codes are applicable to every CNC machine, so please refer your machine’s manual for confirmation.

For more info on programming, check out the CNC Programming Handbook. It is the most informative and accurate book that I have come across for for programming.