Home Documentation
Documentation
Article Index
Documentation
G-codes samples: Surface Measure
G-codes samples: Tool Length Measure
G-codes samples: Homing
G-codes samples: Helical interpolation
Polar coordinates G16 G15
Plane selection G17 G18 G19
G68 G69 Coordinate system rotation
G65 Simple macro call
All Pages
Coordinate system rotation.

 


By using codes G68/G69 a programmed shape can be rotated. Coordinate system rotation is turned on
by code G68 and turned off with G69.

In G68 block is programmed X, Y and Z values that are center of rotation and R value which is angle of rotation.
Positive R-value is counterclockwse rotation, negative value is clockwise rotation.

 

NC code samples, which uses coordinate rotation commands are shown below:

In the first sample ray is repeated by running O100 procedure many times (programmed in parameter). In  O100 procedure
the ray is rotated by using G68 code. The procedure is called three times for each plane selsction G17 (XY), G18(XZ),
G19(YZ).

 

 G68 G69 coordinate system rotation sample

(Coordinate system rotation sample)
G90G0X0Y0Z0

#200=100 (size)
#201=2   (delta angle)
#202=360/#201<->(number of lines)

(XY plane)
#100=0
#101=0
#102=#200

#103=#200
#104=0
#105=#200

G0 X#100 Y#101 Z#102
G17
M98 P101 L#202

(XZ plane)
#100=0
#101=#200
#102=0

#103=#200
#104=#200
#105=0

G0 X#100 Y#101 Z#102
G18
M98 P101 L#202

(YZ plane)
#100=#200

#101=0
#102=0

#103=#200
#104=#200
#105=0

G0 X#100 Y#101 Z#102
G19
M98 P101 L#202


o101
G68 X#100 Y#101 Z#102 R#110
G1 X#103 Y#104 Z#105
G1 X#100 Y#101 Z#102
G69
#110=#110+#201
M99
                                                                                                                  

In the second sample a shape defined in O100 subroutine is repeated a few times (parameter #11), each
time with rotation angle increment.

 g-code G68 G69 myCNC example

(Coordinate system rotation sample N2)
G90 G91.1
G0 X0 Y0 Z0

#10=0 (start angle)
#11=6 (number of shapes)
#12=360/#11 (angle increment)
M98 P100 L#11

O100
G90 G68 X0 Y0 Z0 R#10
G0 X20
G1 X30
G3 X35 Y5 I0 J5
G1 Y10
X15
Y5
G3 X20 Y0 I5 J0
#10=#10+#12
M99
                                                                                     

In the second sample a shape defined in O100 subroutine is repeated a few times (parameter #