CAD CAM EDM DRO - Yahoo Group Archive

G28 G91

on 2001-06-02 23:35:10 UTC
Hi,

Currently struggling with G-code. Below is a sample program to
explain G-code from Mike Lynch's lesson:

Program:
O0001 (Program number)
N005 G54 G90 S400 M03 (Select coordinate system, absolute mode, and
turn spindle on CW at 400 RPM)
N010 G00 X1. Y1. (Rapid to XY location of first hole)
N015 G43 H01 Z.1 M08 (Instate tool length compensation, rapid in Z to
clearance position above surface to drill, turn on coolant)
N020 G01 Z-1.25 F3.5 (Feed into first hole at 3.5 inches per minute)
N025 G00 Z.1 (Rapid back out of hole)
N030 X2. (Rapid to second hole)
N035 G01 Z-1.25 (Feed into second hole)
N040 G00 Z.1 M09 (Rapid out of second hole, turn off coolant)
N045 G91 G28 Z0 (Return to reference position in Z)
N050 M30 (End of program command)

Below is a down-to-earth language explaination of what should
happen:

N005 use cood system G54, absolute
N010 go quickly to z=? above point (1,1)
N015 go to z=0.1
N020 drill to z=-1.25
N025 withdraw to z=0.1
N030 go quickly to point (2,1)
N035 drill to z=-1.25
N040 withdraw to z=0.1
N045 return to z=? (?absolute or relative?)

MY QUESTION:
In sequence N045, why should be the command G91 (relative
coordinates) be given prior to G28 (return to reference) ?

G28 is relative to what? To the last point z=0.1? or another point?

To bring things into sharper focus, what if N40 was

N040 G00 Z2.0

Will the "return to reference point" 1.9 higher than the first
example?

_____________________________________________
In another example:

Program
O0002 (Program number)
N005 G54 G90 S350 M03 (Select coordinate system, absolute mode, and
start spindle CW at 350 RPM)
N010 G00 X-.625 Y-.25 (Rapid to point 1)
N015 G43 H01 Z-.25 (Instate tool length compensation, rapid tool down
to work surface)
N020 G01 X5.25 F3.5 (Machine in straight motion to point 2)
N025 G03 X6.25 Y.75 R1.0 (CCW circular motion to point 3)
N030 G01 Y3.25 (Machine in straight motion to point 4)
N035 G03 X5.25 Y4.25 R1.0 (CCW circular motion to point 5)
N040 G01 X.75 (Machine in straight motion to point 6)
N045 G03 X-.25 Y3.25 R1.0 (CCW circular motion to point 7)
N050 G01 Y.75 ((Machine in straight motion to point 8)
N055 G03 X.75 Y-.25 R1.0 (CCW circular motion to point 9)
N060 G00 Z.1 (Rapid away from workpiece in Z)
N065 G91 G28 Z0 (Go to the machine's reference point in Z)
N070 M30 (End of program)

DOWN TO EARTH EXPLANATION:

N005 coord system G43, absolute mode
N010 go quickly to point (-0.625,-0.25)
N015 cut down to z=-0.25
N020 cut st. line to point (5.25,-0.25)
N025 cut CCW arc to point (6.25,0.75)
N030 cut st. line to point (6.25,3.25)
N035 cut CCW arc to point (5.25,4.25)
N040 cut st. line to point (0.75,4.25)
N045 cut CCW arc to point (-0.75,3.25)
N050 cut st. line to point (-0.75,0.75)
N055 cut CCW arc to point (0.75,-0.25)
N060 withdraw to z=0.1
N065 go quickly to reference point? But where is reference point?

Thanking you in advance.

Ed.

Discussion Thread

edwardhall@a... 2001-06-02 23:35:10 UTC G28 G91