What's new
What's new

Basic Gcode why does G18 G02 seem backwards and why G91 with G28

sendithard

Plastic
Joined
May 18, 2021
I'm new to CAM, but plenty of CAD experience. I'm looking at some gcode from a simple part. The G18 G02 is going counterclockwise when viewed from a typical front view in CAD. The typical front view of a part is you staring at the part from a -y distance. Why is the G02 created as if you are staring at the part from behind or in some +y distance?

Also, I saw in an autodesk paper that the below code is an ending code:
G91 G28 Z0.
G90

I don't understand why you put the machine in incremental mode(G91) to tell it to go to its machine home(G28). And why put the Z0 in there? From my ignorant understanding I would just put a simple G28 in there. Why the need for the other stuff?

Thanks for your time.
 
Look at your planes as though you are looking out of the spindle, not looking in through the door.

Never got the G28 G91 Z0 thing, either. Insanity left over from the fanuc days I suppose.
 
G28 G91 Z0

There are two moves commanded in that one line.
G28 goes home through a point, Z0. It doesn't command the tool to move to a machine Z0
If you were in absolute, the tool would move to it's Z0 (and maybe crash) and then travel to its home position. being in incremental, means Z will travel to a point 0 from its current point (and not move), then move to its home position.
A line like G28 G91 Z1.0 would move the Z plus one inch, then go home.
A line like G28 G90 X0 Y5.0 would move the table to X0 Y5.0 in the current work coordinate system, then move to home. Good clearance move if there was going to be something in the way.
 
As he ^ explained is how I understand it. Just a G28 could have potential for a crash depending on how/where your offsets are at. If you want you can skip that and use G53 (machine zero, no offset involved) Z0. (not sure if G53 is universal, so testing at low rapid would be advisable)

Also, IMO, a good post should output a safety line at the beginning of the program minimum, and some people like it at every tool - G20 G90 G80 G40 G17, etc so you *shouldn't* need the G90 after the Z home move.
 
AND
All planes (G17 - XY, G18 - XZ and G19 - YZ) are viewed/imagined from the perspective of the X+ Y+ Z+ quadrant. So, not only MIGHT the radii look backwards from the operator's standpoint, the cutter left/right compensation will also seem reversed.
 
AND
All planes (G17 - XY, G18 - XZ and G19 - YZ) are viewed/imagined from the perspective of the X+ Y+ Z+ quadrant. So, not only MIGHT the radii look backwards from the operator's standpoint, the cutter left/right compensation will also seem reversed.

That statement helped a lot. Just work from the plus quadrant, thanks.

Any chance you can comment on G94. I saw that in a safe block, but I see it means feed per minute. But I also saw in Fanuc controls it can mean facing operation. That seems weird to me and I've seen it told differently. My question would be what is the safe G94 in a fanuc for units per minute if it is in fact facing operation.

Thanks.
 
I think it depends on the control and its usage. I've seen Inch/metric as G20/21 and G70/71. And G50 used the same as G92 to set work coordinates and spindle speed., but G92 is also a threading cycle for a lathe. Best to refer to you particular machine's manual.
 








 
Back
Top