CNC Programming

CNC | C | C++ | Assembly | Python | R | Rust | Arduino | Solidworks | Embedded Systems

G81 TO G89 - CANNED CYCLES

Table Of Contents:
  1. G-code Table
  2. G00 - Rapid Linear Motion
  3. G01 - Linear Motion at Feed Rate
  4. G02 and G03 - Arc at Feed Rate
  5. G04 - Dwell
  6. G10 - Coordinate System Data Tool and Work Offset Tables
  7. G17, G18 and G19 - Plane Selection
  8. G20 and G21 - Length Units
  9. G28 and G30 - Return to Home
  10. G28.1 - Reference Axes
  11. G40, G41 and G42 - Cutter Radius Compensation
  12. G43, G44 and G49 - Tool Length Offsets
  13. G47 - Engrave Sequential Serial Number
  14. G53 - Move in Absolute Coordinates
  15. G54 to G59 and G59 P~ - Select Work Offset Coordinate System
  16. G61 and G64 - Set Path Control Mode
  17. G73 - Canned Cycle - High Speed Peck Drill
  18. G80 - Cancel Modal Motion
  19. G81 to G89 - Canned Cycles
  20. G90 and G91 - Distance Mode
  21. G92, G92.1, G92.2 and G92.3 - G92 Offsets
  22. G93, G94 and G95 - Set Path Control Mode
  23. G98 and G99 - Canned Cycle Return Level 

G81 TO G89 G-CODE CANNED CYCLES BACKGROUND

Details:
The canned cycles G81 through G89 have been implemented as described in this section. Two examples are given with the description of G81 below.
All canned cycles are performed with respect to the currently selected plane. Any of the three planes (XY, YZ, and ZX) may be selected. Throughout this section, most of the descriptions assume the XY-plane has been selected. The behavior is always analogous if the YZ or XZ-plane is selected.
Rotational axis words are allowed in canned cycles, but it is better to omit them. If rotational axis words are used, the numbers must be the same as the current position numbers so that the rotational axes do not move.
All canned cycles use X, Y, R and Z numbers in the NC-code. These numbers are used to determine X, Y, R and Z positions. The R (usually meaning retract) position is along the axis perpendicular to the currently selected plane (Z-axis for XY-plane, X-axis for YZ-plane, Y-axis for XZ-plane). Some canned cycles use additional arguments.
For canned cycles, we will call a number "sticky" if, when the same cycle is used on several lines of code in a row, the number must be used the first time, but is optional on the rest of the lines. Sticky numbers keep their value on the rest of the lines if they are not explicitly programmed to be different. The R number is always sticky.
In incremental distance mode: when the XY-plane is selected, X, Y and R numbers are treated as increments to the current position and Z as an increment from the Z-axis position before the move involving Z takes place; when the YZ or XZ-plane is selected, treatment of the axis words is analogous. In absolute distance mode, the X, Y, R and Z numbers are absolute positions in the current coordinate system.
The L number is optional and represents the number of repeats. L=0 is not allowed. If the repeat feature is used, it is normally used in incremental distance mode, so that the same sequence of motions is repeated in several equally spaced places along a straight line. In absolute distance mode, L > 1 means "do the same cycle in the same place several times," Omitting the L word is equivalent to specifying L=1. The L number is not sticky.
When L > 1 in incremental mode with the XY-plane selected, the X and Y positions are determined by adding the given X and Y numbers either to the current X and Y positions (on the first go-around) or to the X and Y positions at the end of the previous go-around (on the repetitions). The R and Z positions do not change during the repeats.
The height of the retract move at the end of each repeat (called "clear Z" in the descriptions below) is determined by the setting of the retract mode: either to the original Z position (if that is above the R position and the retract mode is G98) or otherwise to the R position.
It is an error if:
  • X, Y and Z words are all missing during a canned cycle;
  • A P number is required and a negative P number is used;
  • An L number is used that does not evaluate to a positive integer;
  • Rotational axis motion is used during a canned cycle;
  • Inverse time feed rate is active during a canned cycle;
  • Cutter radius compensation is active during a canned cycle.
When the XY plane is active, the Z number is sticky and it is an error if:
  • The Z number is missing and the same canned cycle was not already active;
  • The R number is less than the Z number.
When the XZ plane is active, the Y number is sticky and it is an error if:
  • The Y number is missing and the same canned cycle was not already active;
  • The R number is less than the Y number.
When the YZ plane is active, the X number is sticky and it is an error if:
  • The X number is missing and the same canned cycle was not already active;
  • The R number is less than the X number.

Preliminary and In-Between Motion

At the very beginning of the execution of any of the canned cycles, with the XY-plane selected, if the current Z position is below the R position, the Z-axis is traversed to the R position. This happens only once, regardless of the value of L.
In addition, at the beginning of the first cycle and each repeat, the following one or two moves are made:
  • A straight traverse parallel to the XY-plane to the given XY-position;
  • A straight traverse of the Z-axis only to the R position, if it is not already at the R position.
If the XZ or YZ plane is active, the preliminary and in-between motions are analogous.

G81 CYCLE

Details:
The G81 cycle is intended for drilling.
Program:
G81 X~ Y~ Z~ A~ R~ L~

  • Preliminary motion, as described above.
  • Move the Z-axis only at the current feed rate to the Z position.
  • Retract the Z-axis at traverse rate to clear Z.

Example 1:
Suppose the current position is (1, 2, 3) and the XY-plane has been selected and the following line of NC-code is interpreted. G90 G81 G98 X4 Y5 Z1.5 R2.8
This calls for absolute distance mode (G90), old "Z" retract mode (G98) and calls for the G81 drilling cycle to be performed once. The X number and X position are 4. The Y number and Y position are 5. The Z number and Z position are 1.5. The R number and clear Z are 2.8. The following moves take place.
  • a traverse parallel to the XY-plane to (4,5,3);
  • a traverse parallel to the Z-axis to (4,5,2.8);
  • a feed parallel to the Z-axis to (4,5,1.5);
  • a traverse parallel to the Z-axis to (4,5,3).
Example 2:
Suppose the current position is (1, 2, 3) and the XY-plane has been selected and the following line of NC-code is interpreted.
G91 G81 G98 X4 Y5 Z-0.6 R1.8 L3
This calls for incremental distance mode (G91), old "Z" retract mode and calls for the G81 drilling cycle to be repeated three times. The X number is 4, the Y number is 5, the Z number is -0.6 and the R number is 1.8. The initial X position is 5 (=1+4), the initial Y position is 7 (=2+5), the clear Z position is 4.8 (=1.8+3) and the Z position is 4.2 (=4.8-0.6). Old Z is 3.0
The first move is a traverse along the Z-axis to (1,2,4.8), since old Z < clear Z.
The first repeat consists of 3 moves.
  • a traverse parallel to the XY-plane to (5,7,4.8);
  • a feed parallel to the Z-axis to (5,7, 4.2);
  • a traverse parallel to the Z-axis to (5,7,4.8).
The second repeat consists of 3 moves. The X position is reset to 9 (=5+4) and the Y position to 12 (=7+5).
  • a traverse parallel to the XY-plane to (9,12,4.8);
  • a feed parallel to the Z-axis to (9,12, 4.2);
  • a traverse parallel to the Z-axis to (9,12,4.8).
The third repeat consists of 3 moves. The X position is reset to 13 (=9+4) and the Y position to 17 (=12+5).
  • a traverse parallel to the XY-plane to (13,17,4.8);
  • a feed parallel to the Z-axis to (13,17, 4.2);
  • a traverse parallel to the Z-axis to (13,17,4.8).
Execute the following to observe the G81 drill cycle. Remember, the G81 command follows a certain sequence.
  • G81 Example
    (Sample Program G81EX18:)
    (Workpiece Size: X4, Y3, Z1)
    (Tool: Tool #6, 3/4" HSS Drill)
    (Tool Start Position: X0, Y0, Z1)

    N2 G90 G80 G40 G54 G20 G17 G50 G94 G64 (safety block)
    N5 G90 G80 G20
    N10 M06 T6 G43 H6
    N15 M03 S1300
    N20 G00 X1 Y1
    N25 Z0.5
    N30 G81 Z-0.25 R0.125 F5 (Drill cycle invoked)
    N35 X2
    N40 X3
    N45 Y2
    N50 X2
    N55 X1
    N60 G80 G00 Z1 (Cancel canned cycles)
    N65 X0 Y0
    N70 M05
    N75 M30
    N80


    G82 CYCLE

    Details:
    The G82 cycle is intended for drilling.
    Program:
    G82 X~ Y~ Z~ A~ R~ L~ P~
    • Preliminary motion, as described above.
    • Move the Z-axis only at the current feed rate to the Z position.
    • Dwell for the P number of seconds.
    • Retract the Z-axis at traverse rate to clear Z.

    • G82 Example
      (Sample Program G82EX19:)
      (Workpiece Size: X4, Y3, Z1)
      (Tool: Tool #6, 3/4" HSS Drill)
      (Tool Start Position: X0, Y0, Z1)

      N2 G90 G80 G40 G54 G20 G17 G50 G94 G64 (safety block)
      N5 G90 G80 G20
      N10 M06 T6 G43 H6
      N15 M03 S1300
      N20 G00 X1 Y1
      N25 Z0.5
      N30 G82 Z-0.25 R0.125 P1.0 F5.0 (Invoke G82)
      N35 X2
      N40 X3
      N45 Y2
      N50 X2
      N55 X1
      N60 G80 G00 Z1
      N65 X0 Y0
      N70 M05
      N75 M30


      G83 CYCLE

      Details:
      The G83 cycle (often called peck drilling) is intended for deep drilling or milling with chip breaking. See also G73. The retracts in this cycle clear the hole of chips and cut off any long stringers (which are common when drilling in aluminum). This cycle takes a Q number which represents a "delta" increment along the Z-axis.
      Program: G83 X~ Y~ Z~ A~ R~ L~ Q~
      • Preliminary motion, as described above.
      • Move the Z-axis only at the current feed rate downward by delta or to the Z position, whichever is less deep.
      • Rapid back out to the clear Z.
      • Rapid back down to the current hole bottom, backed off a bit.
      • Repeat steps 1, 2 and 3 until the Z position is reached at step 1.
      • Retract the Z-axis at traverse rate to clear Z.
      It is an error if:
      • The Q number is negative or zero.

      • G83 Example
        (Sample Program G83EX20:)
        (Workpiece Size: X4, Y3, Z1)
        (Tool: Tool #3, 3/8" HSS Drill)
        (Tool Start Position: X0, Y0, Z1)

        N2 G90 G80 G40 G54 G20 G17 G50 G94 G64 (safety block)
        N5 G90 G80 G20
        N10 M06 T3 G43 H3
        N15 M03 S1200
        N20 G00 X1 Y1
        N25 G83 Z-0.75 R0.125 Q0.0625 F5 (Invoke G83 cycle)
        N30 X2
        N35 X3
        N40 Y2
        N45 X2
        N50 X1
        N55 G80 G00 Z1
        N60 X0 Y0
        N65 M05
        N70 M30


        G85 CYCLE

        Details:
        The G85 cycle is intended for boring or reaming, but could be used for drilling or milling.
        Program:
        G85 X~ Y~ Z~ A~ R~ L~
        • Preliminary motion, as described above.
        • Move the Z-axis only at the current feed rate to the Z position.
        • Retract the Z-axis at the current feed rate to clear Z.

        G86 CYCLE

        Details:
        The G86 cycle is intended for boring. This cycle uses a P number for the number of seconds to dwell.
        Program:
        G86 X~ Y~ Z~ A~ R~ L~ P~
        • Preliminary motion, as described above.
        • Move the Z-axis only at the current feed rate to the Z position.
        • Dwell for the P number of seconds.
        • Stop the spindle turning.
        • Retract the Z-axis at traverse rate to clear Z.
        • Restart the spindle in the direction it was going.
        The spindle must be turning before this cycle is used. It is an error if:
        • The spindle is not turning before this cycle is executed.

        G88 CYCLE

        Details:
        The G88 cycle is intended for boring. This cycle uses a P word, where P specifies the number of seconds to dwell.
        Program:
        G88 X~ Y~ Z~ A~ R~ L~ P~
        • Preliminary motion, as described above.
        • Move the Z-axis only at the current feed rate to the Z position.
        • Dwell for the P number of seconds.
        • Stop the spindle turning.
        • Stop the program so the operator can retract the spindle manually.
        • Restart the spindle in the direction it was going.

        G89 CYCLE

        Details:
        The G89 cycle is intended for boring. This cycle uses a P number, where P specifies the number of seconds to dwell.
        Program:
        G89 X~ Y~ Z~ A~ R~ L~ P~
        • Preliminary motion, as described above.
        • Move the Z-axis only at the current feed rate to the Z position.
        • Dwell for the P number of seconds.
        • Retract the Z-axis at the current feed rate to clear Z.

logoblog

No comments:

Post a Comment