Hello Guest it is March 29, 2024, 07:10:59 AM

Author Topic: Lathe G28/G30  (Read 462 times)

0 Members and 1 Guest are viewing this topic.

Lathe G28/G30
« on: August 05, 2021, 08:32:13 AM »
As part of my work on developing a Mastercam Mach 4 Lathe postprocessor, the behavior of G28/G30 has come up.

Basically, it appears that the usual FANUC behavior - and how the Mastercam FANUC postprocessor is set up - is to move to G28 at the start and finish of each toolpath, as a safe place to execute the tool change.

The issue here, at least with my lathe (which is a converted bench lathe) the "home" position is NOT safe. Because there is a tailstock whose position is not under computer control, the limit switch Mach references at startup ('Reference All Axis") is chuck-side. Referencing retracts the carriage in X, then bumbles toward the chuck to pick up the Z reference. There is room for this when there is no tool on the post (it's a BXA QCTP), but with tools in place all bets are off.

So if G28 goes to the "reference all" position with a tool on the post, that is almost certainly a crash.

A reasonable compromise might be a full retract in X with no Z move... although boring bars exist, and moving to X max if the bar has not been retracted from the bore is a crash too.

Now Mastercam has the ability to specify a user-defined home position on a per-toolpath basis, which means that, if used, the postprocessor gets passed the coordinates the user specified. Off the shelf, the current postprocessor tries to get there through a G28 and a G50. I'm modifying that to use a G0 rapid move. But I wonder if maybe a G30 isn't a better answer. The postprocessor could put the user home in the appropriate variable and then use G30 to get there.

How do you put a value in a variable from a program?

So let's say the user-specified home position is X1.0 Z-5.0. We have to set # variable 5301 to 1.0 and # variable 5303 to -5.0. Then we could call

G30 P2

And the machine would move to X1.0 Z-5.0.

What is the format for that code?