You are on page 1of 10

CHAPTER 12 Advanced CNC Features Objective upon completion of this chapter, you will be able to:           Explain the concept

of mirror imaging. Decide when the use of mirror imaging is appropriate. Write simple programs in Machinist Shop Language and word address that employ mirror imaging. Explain the concept of polar rotation. Decide when the use of polar rotation is appropriate. Write simple programs in Machinist Shop Language and word address that employ polar rotation. Write simple programs in Machinist Shop Language and word address that employ polar rotation used in a do loop. Explain the concept of helical interpolation. Decide when the use of helical interpolation in appropriate. Describe the relationship of spindle RPM, length of helix, and lead of helix in programming helical interpolation, performing the necessary calculation with that information to program a part. Write simple programs in Machinist Shop Language and word address that employ helical interpolation. Write simple programs in Machinist Shop Language and word address that employ helical interpolation used in a subroutine.

 

MIRROR IMAGING Mirror imaging is a simple concept that can be very useful in programming. In essence, mirror imaging reverses the sign ( + or -) of an axis direction. For example ,mirror imaging can be employed to shorten the amount of programming required to make the part shown in Figures 12-1 and 12-2.Calling the centerline of this part X0/Y0,the pattern of holes to the right of the centerline can be programmed in a subroutine. After this pattern is drilled, mirror imaging along the X axis can be instituted and the subroutine called again. This will drill the same pattern of hole in the second quadrant, with no additional programming save the mirror imaging command. The process can be repeated, mirror imaging the Y axis to drill the pattern in the third quadrant. Canceling the mirror image on the X axis and leaving it active on Y will drill the pattern in the fourth quadrant.

5.The program used a combination drill/center drill. considering the number of holes. mirror imaging is instituted by use of an auxiliary ( AUX ) code. These codes are generally used for the same purposed for which miscellaneous functions are used in word address format. DRILL 1. 9.1 G81 Z-. Appendix 2 lists various auxiliary codes used with Machinist Shop Language.7 CALL 1 A RA RA REM : TO TOOL CHANGE REM : TO X0/YO RA REM : DRILL PATTERN #A . The Machinist Shop Language program used to drill this part ( see Figures 12-1 and 12-2 ) is figures 12-3. 6. TOOL 1001 Z2 X-2 Y2 ZO TOOL 1 X0 Y0 V20 5 V21 . when the right combination of machine features and tooling is used. 3. GAMBAR FIGURE 12 – 1 Tool path for the part shown in figure 12 – 1 X0/Y0 = center of part TOOL CHANGE = X-2 Y2 TOOLS: 5/16 DIA.GAMBAR FIGURE 12 – 1 Part drawing Machinist Shop Language In machinist shop language. 7. COMB. 4. 8. Notice how short the program is. 2.

AUX 100 11.5 Y. R Specifies a rapid move. . Rapid traverse will be used throughout since this a drilling program. Y-1 29. AUX 300 14. with no spindle movement taking place. END 24. CALL 1 12. 5 EVENT   X0 Y0  Position the part to the X0/Y0 point. X-2 Y2 23. CALL 1 15. SUBR 1 25. TOOL 0 21. Machinist Shop Language PROGRAM EXPLANATION EVENTS  1-4 These events assign and call up the tool information. The machine stops only momentarily at this location. AUX 800 16. AUX 200 17. AUX 800 13.10.5 27. G80 20. X-1 30. X-. The reason for this move is to allow the subroutine to control movement to the center hole in each of the hole pattern. AUX 800 19. END FIGURE 12-3 REM : MIRROR IMAGE IN X REM : DRILL PATTERN #B REM : MIRROR IMAGE OFF REM : MIRROR X AND Y REM : DRILL PATTERN #C REM : MIRROR IMAGE OFF REM : MIRROR IMAGE Y REM : DRILL PATTERN D REM : MIRROR IMAGE OFF RA REM : TO DRILL CHANGE REM : START SUBR 1 REM : DRILL HOLE #1 REM : DRILL HOLE #2 REM : DRILL HOLE #3 REM : DRILL HOLE #4 REM : DRILL HOLE #5 REM : END OF SUBROUTINE RA RI RI RI RI Mirror imaging program for the part in Figure 12-1. CALL 1 18. X1 Y1 26. Z0 22. X1 28. which is the center of the part.

Since the event preceding this one canceled any active mirror imaging. This time the AUX 100 is active. 11 EVENT  CALL 1 – Call the subroutine again. EVENT  6 V20  Sets the drilling federate to 5 inches per minute. the identical sequence of event will take place with the exception of the X axis moves. so that pattern B is drilled. the movement with AUX 300 active will be reversed on both the X and Y axes. Although some controllers may allow the command to be issued one after another without a cancel command in between. 8 EVENT   G81  Initiates the drilling cycle. 10 EVENT  AUX 100  Mirror images the X axis. which will now be reversed. This program will demonstrate value of manipulating absolute and incremental positioning. pattern A is drilled. it is necessary to cancel the active command. When the subroutine is called again.  A  Specifies absolute positioning. 13 EVENT  AUX 300 – Mirror images the X and Y axes.1  Defines the buffer as . 12 EVENT  AUX 800 – Turns off the mirror image.100 inches. it is always wise to play is safe. 9 EVENT  CALL 1  Calls the subroutine. Before issuing a mirror image command a second time. 14 EVENT . Z  .7  Is the Z axis depth for drilling. 7 EVENT  V21.

17 EVENT  CALL 1 – Calls the subroutine again. pattern C will be drilled. 22 EVENT  X – 2 Y2 – Are the tool change coordinates. 23 EVENT  END – Signals the end of the program. CALL 1 – Calls the subroutine again. 16 EVENT  AUX 200 – Mirror images the Y axis. EVENT  15 AUX 800 – Cancels the mirror image. 18 EVENT  AUX 800 – Cancels the mirror imaging. This time. with both X and Y reversed from pattern A. 19 EVENT  G80 – Cancels the active drilling cycle. 21 EVENT  Z0 – Retracts the spindle. 20 EVENT  TOOL 0 – Cancels the active tool offside. . and pattern D is drilled. This time through the Y axis movement are reversed A. 24 EVENT  SUBR 1 – Defines the start of subroutine #1.

The program to drill the part is shown in figure 12 – 4. 29 EVENT  X – 1 – Incremental coordinates to move from hole #4 to hole #5.EVENT  25   X1 Y1 – Are the absolute coordinates from the X0/Y0 point to hole #1 in pattern A. mirror imaging is selected at the MDI console by means of a switch. . the same procedure is accomplished through either G codes or M functions. 26 EVENT    X – .5 – Incremental coordinates to move from hole #1 to hole #2. In the following example. R – Specifies rapid traverse mode. When mirror imaging commands are active. 30 EVENT  END – Signals the end of the subroutine. R – Specifies rapid traverse mode. M functions are used as follow: M21 – Mirror image X axis. Word Address Format In word address. 27 EVENT  X1 – Incremental coordinates to move from hole #2 to hole #3. depending on the controller. A – Specifies that this is an absolute coordinate. I – Specifies incremental positioning. the positioning will take place to the center holes of other patterns. a dwell must be programmed at the place where mirror imaging is to be instituted. When programming such a machine. M23 – Mirror image off. M22 – Mirror image Y axis. On some CNC machines. 28 EVENT  Y – 1 – Incremental coordinates to move from hole #3 to hole #4. and instruction given for the operator to set the switches prior the restarting the program.5Y. depending on the active mirror imaging code.

MIN.5 REM : DRILL #2 REM : DRILL #3 N080 P190 M98 N090 M21 N100 P190 M98 N110 M22 N120 P190 M98 N130 M23 M140 M22 N150 P190 M98 N160 G80 N170 X—12 N180 M30 : 190 N010 X1 Y1 N020 G91 N030 X1 X-.X0/Y0 = CENTER OF PART TOOL CHANGE = X-2 Y2 TOOLS : 5/16 DIA. COMB. DRILL #1 Y.5 G49 . OFFSETS REM : MOVE TO PARK. N010 G00 N020 G10 N030 M06 G40 H01 T1 M03 REM : SET SPEED/FEED G49 Z2. DRILL BUFFER : 2.7 RO M08 REM : INITIATE DRILL CYCLE REM : JUMP TO SUBBROUTINE REM : MIRROR IMAGE X REM : JUMP TO SUBBROUTINE REM : MIRROR IMAGE Y REM : JUMP TO SUBBROUTINE REM : CANCEL MIRROR IMAGE REM : MIRROR IMAGE Y REM : JUMP TO SUBROUNTINE Z0 Y8 M09 M05 REM : CANCEL DRILLING. SPNDL OF REM : END OF MAIN PGRM REM : START SUBROUTINE.5 IN.5 G70 G90 Z0 REM : SAFETY LINE N040 S641 F5 N050 G45 N060 X0 N070 G81 H01 Y0 G99 REM : POSITION TO X0/Y0 Z-.

or X/Y move. Since a G81 code will not move the Z axis until after an X. word address format PROGRAM EXPLANATION ( Refer to Figure 12 – 4. ) N010  This is safety block. M08 – Turns the coolant on.7 – Z – axis depth for drilling. . no movement takes place along the Z axis yet.. F5 – Sets the federate to 5 inches per minute. G99 – Select a return to rapid level Z . These blocks assign the tool information and select the tool. S641 – Sets this spindle speed to 641 RPM. G45 H01 – Call up the tool offsets in register #1. canceling any codes that may have been left active following a previous program. R0 – Sets the start of the buffer ( Z0 with a tool offsets active ) at the rapid level. where the subroutine starts. Y.N040 Y – 1 N050 X – 1 N060 M99 FIGURE 12 – 4 REM : DRILL #4 REM : DRILL #5 Mirror imaging program for the part in Figure 12 – 1. M03 – Turns the spindle on clockwise. X0 Y0 – Position the machine to the center of the part. N020 – N030  N040    N050  N060  N070      G81 – Initiates the drilling cycle.

As in other word address examples. P190 M98 – Causes a jump to the subroutine. G80 – Cancels the drill cycle.N080  N090  N100  N110  N120  N130  N140  M22 – Mirror image the Y axis. It is assumed in these examples that the tool change location is at approximately X – 12. an M22 is used to reestablish the mirror image on the Y axis. M32 – Cancels the active mirror image commands. M09 – Turns off the coolant. any place that safely positions the tool out of the way can be used. it was necessary to cancel the mirror image in block N130 because the X axis was mirror imaged along with the Y. P190 M98 – Causes a jump to the subroutine. P190 M98 – Instruct the MCU to jump to the subroutine that starts in block 190. Z0 – Retracts the spindle. M21 – Mirror images the X axis. once canceled. M22 – Mirror images the Y axis P190 M98 – Causes a jump to the subroutine. Y8 from the art X0/Y0. G59 – Cancels the tool offset. M150  M160     N170  X – 12 Y8 – Coordinates of the park position. .

M30 – Signals the end of the main program and resets the computer memory.5 – Incremental coordinates to move from hole #1 to hole #2.5 Y. X .N180  :190    N020   N030  N040  N050  X – 1 – Incremental coordinates to move from hole #4 to hole #5. G91 – Selects incremental positioning. X1 Y1 – Absolute coordinates to move from the center of the part to hole #1. Y – 1 – Incremental coordinates to move from hole #3 to hole #4. X1 – Incremental coordinates to move from hole #2 to hole #3. . N010 – Further identifies this as block N010 of the subroutine.. :190 – Identifies this as block 190 of the main program.