G28 G-Code: CNC Return To Reference [ Easy Tutorial & Guide ]

Có thể bạn quan tâm

Specifying the G28 Intermediate Position on Mills

The intermediate position is specified using one or more axes (X, Y, or Z) after the G28. If the machine is in absolute mode, those position coordinates are relative to program zero (part zero). In relative mode, the coordinates are relative to the tool’s current position. Let’s try some examples:

Basic Example: Move Straight to the Reference Position

G91 G28 X0 Y0 Z0

In this case, we’re telling the machine the incremental position is at 0, 0, 0 relative to the tool’s position. Since it thinks it is already at the intermediate position, this version essentially causes the intermediate position to be ignored and we get coordinated motion straight to the zero position.

Move straight a distance, then on to the Zero Position

G91 G28 X0 Y0 Z4.0

This variation is telling G28 that the intermediate position is 4″ above the current tool position, hence the machine moves up 4″ before heading straight from there to the reference position. This z-axis move makes it much less likely to hit some errant fixture or part of the workpiece than just commanding a move straight to the reference position.

Beware absolute mode!

You’ll notice the examples started with a G91 to put the machine in incremental mode. In absolute mode, the intermediate point is relative to part zero. That means it will bounce the tip off part zero, which could easily result in a crash.

It’s really hard to know a safe intermediate point in absolute mode, whereas it’s pretty easy to use the relative mode with X0 Y0 Zn to make a safe move to an intermediate position that’s straight up from the current tool position.

What to Think About When Using a G28 G Code

The main thing to think about is where is the right Intermediate Position that gives a safe straight line to the zero position. You will want to make sure the point you pick doesn’t add too much extra travel because that will slow down your machine each time it runs. Probably the best way to avoid collisions is to move the Z-axis first. Move it up and away from the workpiece until you have that straight-line access to the zero position.

Từ khóa » G0 X0 Y0