Special G Codes of CNC Programming
Special G Codes of CNC Programming
Mirror image mode can be turned on and off for each axis using G-codes. Higher priority is given to the mirror image setting with the G-codes over setting by any other methods. Programming Format G51.1 X__ Y__ Z__ G50.1 X__ Y__ Z__ Detailed:
Use the address and coordinates in a G51.1 block to specify the mirroring axis and mirroring center
(using absolute or incremental data), respectively
If the coordinate word is designated in G50.1, then this denotes the axis for which the mirror image is to be cancelled .Coordinate data, even if specified, is ignored in that case
After mirror image processing has been performed for only one of the axes forming a plane, the
rotational direction and the offset direction become reverse during arc interpolation, tool diameter
offsetting, or coordinate rotation
Since the mirror image processing function is valid only for local coordinate systems, the center of mirror image processing moves according to the particular counter preset data or workpiece coordinate offsetting data
Sample Programs
G00 G90 G40 G49 G80 M98 P100 G51.1 X0.0 M98 P100 G51.1 Y0.0 M98 P100 G50.1 X0.0 M98 P100 G50.1 Y0.0 M30. (SUB PROGRAM O100) O0100 G91 G28 X0.0 Y0.0 G90 G00 X20.0 Y20.0 G42 G01 X40. D.01F120 Y40. X20. Y20. G40 X0.0 Y0.0 M99
Mirror can also be performed with M21 Mirror image along the X axis M22 Mirror image along the Y axis M23 Mirror image cancel
A rotation transformation can be applied to the controlled point coordinates commanded by a part program or by the MDI line. To do this program G68 X__Y__R__ The X and Y words specify the center about which the rotation is to be applied in the current coordinate system. R is the angle of rotation in degrees with positive values being counter-clockwise. If X or Y are omitted then zero is assumed. A and B can be used as synonyms for X and Y respectively. To cancel rotation program G69. If a G68 is used while rotation is in operation a G69 is implied before it. In other words successive G68s are not cumulative and the X and Y points are always in an un-rotated system. When a rotation is in use the X and Y axis DROs will be red to remind the operator that these values are program coordinate values which will be rotated
An Example
G68 X0 Y0 R30 M98 P0001 G68 X0 Y0 R60 M98 P0001 G68 X0 Y0 R120 M98 P0001 G68 X0 Y0 R180 M98 P0001
Note:
And effect will be non-intuitive so it is wiser not to program this. Indeed care O0001 should be taken proving any program including transformations. G83 G99 R2 Z-10 Q1 F100 There is very little standardization of the functions of this code across different CNC controls so careful checks should be made on code written for X 20 Y-20 other machines. <etc > Jogging always takes place in the direction of the machine axes. The tool M99 path display frame is oriented to the physical axes and will show the part at
the angle at which it will be cut
It is possible for G0 and G1 moves in the X/Y plane only to specify coordinates as a radius and angle relative to a temporary center point; program G16 to enter this mode. The current coordinates of the controlled point are the temporary center Format G15 to revert to normal Cartesian coordinates G0 X2.0 Y2.0
( normal G0 move to 2.0,2.0 ) G16 - start of polar mode. G01 X1.0 Y45 ( this will move to X = 2.7071, Y = 2.7071 which is a spot on a circle) (of radius 1.0 at 45 degrees from the initial coordinates of 2.0,2.0 )
The code below moves to a circle of holes every 90 degrees on a circle of radius 2.5", center X = 0.5, Y = 0.6 and high- speed peck drills to Z = -0.6 G00 Z0.0; G01 X0.5 Y0.6; (go to the center point) G16; (enable Polar coordinates) G81 X2.5 Y0.0 R0.0 Z-.6 F3;(in G16 mode the X becomes the offset from center and the Y becomes the degrees of rotation from the center) X2.5 Y90; X2.5 Y180; X2.6 Y270; G15; (cancels the g16) G80; (cancels the canned cycle) G01 Z0.0; G00 X0.0 Y0.0; M30;
No relationship between program and diagram It is just a model
Note: (1) You must not make X or Y moves other than by using G0 or G1 when G16 is active; (2) This G16 is different to a Fanuc implementation in that it uses the current point as the polar center. The Fanuc version requires a lot of origin shifting to get the desired result for any circle not centered on 0, 0
Q Radius step over Increment (must be used with K) D Cutter Comp. number
(Enter cutter size into offset display register number)
N10 M30;
Thanks
M.Ganesh Murugan