Numerical Control Programming
Chapter 2
How Does Numerical Control Work?


Commands

To arrive at a desired destination via a complicated path, one must have a good set of directions. Each line of NC code will consist of one or more commands. There are a few type of CNC commands.

Modal vs. Nonmodal Commands

Commands may either stay in effect until they are changed (deactivated &/or canceled) or be "one-shot" commands.

Commands that stay in effect until changed or canceled are said to be modal commands. A feedrate command is an example of a modal command. It stays in effect (the feedrate remains the same) until it is changed later in the program. EIA 274 G-codes for positioning and unit selection are also modal. To change from absolute positioning mode (G90), the incremental positioning mode command (G91) needs to be given. Once given, the controller will stay in incremental mode until a G90 command is received. Likewise, the G-code command for setting the measurement units is modal (G70 for the inch system or G71 for metric system).

One-shot commands are nonmodal. Commands calling "canned cycles" (a controller's internal set of preprogrammed subroutines for generating commonly machined features such as internal pockets and drilled holes) are nonmodal and only function once when called.

On some older controllers, cutter positioning (axis) commands (e.g., G00, G01, G02, G03, & G04) are nonmodal requiring a new positioning command to be entered each time the cutter (or axis) is moved to another location.

Back to the top of this page

Axis Commands

A block in an N/C program can contain commands to move one, two, or all three axes simultaneously. Each axis command consists of the axis address word (X, Y, or Z) followed by the digits that represent the magnitude of the axis move (incremental positioning) or the cutter's new destination (absolute positioning). Most controllers assume that axis commands are for motion in the positive direction (incremental) or quadrant (absolute), unless told otherwise, and do not require a plus (+) sign. All negative moves do require a minus (-) sign, however. A few of the older N/C controllers require both positive and negative axis commands to be signed. Some older controllers also require the sign to be placed in front of the axis address word (e.g., +X or -Y); newer controllers place the sign after the axis address word (e.g., X+ [or simply X] or Y-).

Axis Priority

Continuous path N/C controllers execute all of the axis commands contained in a G01 (linear interpolation at feedrate) block simultaneously. They coordinate the velocity of each axis (interpolate) to cause each axis to arrive at its destination at the same time, yielding an angular linear path. But it is different for the rapid travel mode for machines that have axis priority. With axis priority, the Z-axis command (if any) in a G00 (rapid travel) block will not be executed at the same time as the X- and/or Y-axis commands. If the Z-axis command requires the cutter to travel in the positive direction, it will occur before any X or Y motion. If it requires Z-axis cutter motion in negative direction, it will occur after the X- and/or Y-axis motion. This prevents accidentally cutting into the wall of a pocket when the cutter is in the pocket and a command is issued to send the cutter to a home point.

Back to the top of this page

Next:  Cutting Tool Length

Back to Contents Page


Updated Jan. 9, 2002
Copyright © 1988-2002 by George Stanton and Bill Hemphill
All Rights Reserved