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).

 (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=#200G0 X#100 Y#101 Z#102G17M98 P101 L#202(XZ plane)#100=0#101=#200#102=0#103=#200#104=#200#105=0G0 X#100 Y#101 Z#102G18M98 P101 L#202(YZ plane)#100=#200#101=0#102=0#103=#200#104=#200#105=0G0 X#100 Y#101 Z#102G19M98 P101 L#202o101G68 X#100 Y#101 Z#102 R#110G1 X#103 Y#104 Z#105G1 X#100 Y#101 Z#102G69#110=#110+#201M99

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

 (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 #