Learn how the rapid move command works.
- In this movie we're going to be learning about the G-zero command. Now, G zero command is what we call a rapid move. Now, even though it's called G-zero, it's pretty easy to think about if you just said G-O because an O looks a lot like a zero. Just go ahead and say Go, or when you think of a G-zero just think about where do you want to go. Now, the logical question is when you say, "Where do you want to go," is the position. So, the X, the Y, or the Z position where you'd like to go to, and that's all you need on a G-zero line, the G-zero command plus an X, a Y, or a Z move and the machine will very rapidly move over to that location.
The one caveat that you do have to keep in mind, though, on a G-zero command is it doesn't necessarily take a straight line path. Over here on the screen you can see I've got a tool and I've got this line right here from point to point. That is where you'd expect the machine to go between. Unfortunately, a CNC machine will generally take its own path, whichever way it figures out is the easiest and quickest way to get over there. So, it could move this tool here. It could come down this way first and X, and then over here in Z. It could come over here first and then diagonal and then come across.
It can make a move this direction and then make another diagonal. I could even take some other random path we just don't know about. So, definitely keep in mind that the machine will move however it wants to get from point A to point B. That is why we generally move in Z first and then we move in X and Y, because again, this machine's going to be moving very quickly, especially with some of the brand new machines. They're literally lightning fast, so definitely make sure you turn that rapid speed down at first and make sure you're aware of how the machine's going to move from point A to point B.
Now, let me show you exactly what we're going to be looking at as we jump into the code. After we've already taken a look at running this code right here you see on the screen, which we're going to be moving from point A to point B. In my second example I'm going to be drawing a star. Let me show you the star, here he is. Here's my star, and we're going to have the machine basically trace that star pattern out using a rapid move, and we'll see if it actually draws something similar to this or what's really going to happen when I actually run through it on the machine. All right, let's take a look at the code real quick.
So, here is our rapid move example number one. I'm just going to be basically going from the G-55 position, I'm going to go to a negative 15, negative Y, 6.0 move and then we're going to be moving up in Z. I'm also going to then move that Z command into the same line, and then I'm going to also separate the X and Y moves so we can see how the machine will break that move up depending on which values happen to be on which line. My second example is that star, and you can see here I've modified the code a little bit to make it all rapid moves.
When we jump into learning about G-01, or a feed move, we're going to be using the same exact program and it's going to be doing it in a feed operation, so you can see the difference between running it as a rapid move as well as a feed move. All right, now let's head over to the CNC machine and see what happens. Now that we're back at the CNC machine we are going to run through a couple of examples that we developed earlier and see how the machine does. The first example is a move from point to point and then a Z move. Any values that we put on the same line will be handled at the same time, so calling a G-zero X move will move only the X axis.
However, if we add a Y value to the same line, the machine will move both the axes at the same time. Let's run the program and see how it does. (machine humming) (machine beeps) (machine humming continues) As you can see from that program we made two straight line moves, one in the X and one in the Y. Now I'm going to modify the code and put both the X and the Y on the same line and we'll run it again.
(machine humming) (machine buttons beeping) (machine humming continues) As you can see, which commands that are on each line of code will have a lot of control over how the machine moves.
Generally we want to do Z moves on their own line and X and Y moves together. Let's run a more complex program and see how the machine handles drawing a star. (machine humming) (machine buttons beeping) (machine humming continues) The G-zero code is one of the most common G-codes and is used any time we want to position the machine.
This code will operate the machine as fast as possible, so make sure to go slow at first to make sure the program operates as intended. All CNC machines have a rapid override control knob that allows you to slow down the rapid moves. A lot of the new machines are extremely fast, so make sure you're aware that the G-zero rapid moves don't normally go directly in straight lines.
- CNC concepts
- G-code editor and simulator software
- G-codes: G00-G84
- M-codes: M00-M09
- Writing a sample program in G-Code