This Fanuc 0i Mate-TC lathe has no tool change point in use and no electrical chuck control. Every tool call needs a hand-programmed Z+ retract before T0202. The hydraulic chuck does not respond to the usual M-codes or to the two unassigned F keys. Neither function was commissioned. The tool change point needs one parameter entry and one G-code line. The chuck needs PMC ladder work: the solenoid valves on the hydraulic block are already wired, but no ladder logic drives them.
Check 1: Reference return state of X and Z
G28 and G30 depend on a valid machine coordinate system. Confirm it before anything else.
- Prerequisite: power up and perform manual reference return on X and Z, unless the machine uses absolute encoders. On the POSITION screen, open the MACHINE coordinates. The reference-return lamps or indicators must be lit for both axes.
- In MDI, set rapid override to its lowest step. Run
G0 G28 U0;and confirm X travels to machine zero. Then runG28 W0;and confirm Z travels to machine zero. - Read the MACHINE coordinates after each move. Each axis should show the reference value, normally 0.
With U0 and W0, the incremental address sets the intermediate point equal to the current position. The axis therefore goes straight to the reference point with no detour. G28 sends Z to machine zero, which is the full Z travel away from the chuck. For long parts this is the safe choice. For short parts it wastes cycle time on every tool change.
| Reading | Meaning | Next |
|---|---|---|
| Both axes reach machine zero, coordinates read 0 | Reference system valid | Check 2 |
| Alarm on G28/G30 after power-up | Reference return not completed | Reference the axes manually, repeat step 2 |
| Axis stops short or overtravels | Reference/deceleration dog or grid problem | Fix referencing before defining any change point |
Check 2: Second reference position values for G30
G30 U0 W0 moves the axes to the second reference position. That position is stored per axis in machine coordinates in the reference-position parameter group. On this control family the group sits in the 1200–1300 range. Read the exact parameter number for "second reference position" from the parameter manual for your control. Do not write into neighbouring parameters by trial. On a machine that was never commissioned, this parameter is often 0, which makes G30 behave the same as G28.
- In MDI, run
G30 U0 W0;at low rapid override. Record where the turret stops. - If it stops at machine zero, the parameter is unset. Jog the turret to the change position you want. Keep the longest tool clear of the chuck jaws and the tailstock, and leave room to index. Read X and Z from the MACHINE coordinate page.
- Enable parameter write on the SETTING screen, which raises alarm 100. Enter the X and Z machine coordinates into the second-reference-position parameter for each axis. Check the value units against the parameter manual for your increment system. Disable parameter write and clear the alarm.
- Jog away and run
G30 U0 W0;again. The MACHINE coordinates must match the entered values.
A common setup puts the G30 Z position at roughly half the Z travel. Short parts then get a quick retract through G30, and G28 stays available for full clearance. X goes to its second reference value in the same move. The address V0 only applies to machines with a Y axis. Leave it out on a two-axis lathe.
Selecting the change point strategy per job
A single fixed point suits one-off work. Series production usually needs a point tuned during run-in.
| Method | Program line | Where the point comes from | Use when |
|---|---|---|---|
| Machine zero | G0 G28 U0 W0; |
Reference position | Long parts, long boring bars, maximum clearance |
| Second reference | G0 G30 U0 W0; |
Parameter (Check 2) | Single parts, one standard point for every tool call |
| Programmed X/Z | G0 X__ Z__; |
Program, adjusted at run-in | Series parts where the point depends on tool length and jaw height |
| Split axis retract |
G0 G30 U0; then G30 W0;
|
Parameter | A tool or jaw would collide on a simultaneous X/Z move |
For series parts, set the change point during run-in. Allow for the longest tool in the turret and for the chuck jaw outline. If the G30 point is too close for loading and unloading parts, split the two jobs. Set G30 U0 W0 to the part-loading position. Then set each tool change point inside the program with absolute X and Z moves. None of this needs a macro:
N10 G0 G30 U0 W0; (part change / load position from parameter)
N20 T0202;
...
N80 G0 X__ Z__; (tool change point for this job, set at run-in)
N90 T0404;
...
N200 G0 G30 U0 W0; (back to load position)
N210 M30;
Watch for this pitfall with the programmed-X/Z method. The move runs in work coordinates with the current tool's offset active. The turret's physical stop point therefore changes with the offset of each tool. Size the clearance for the worst-case tool, not the one that happens to be active.
Check 3: Custom macro availability for a one-line tool call
A custom macro can move the tool change sequence behind the scenes, so the main program only reads N13 T0404. The control must have the macro function first.
- Open the macro variable page under OFFSET/SETTING and look for common variables
#500onward. If#500–#549appear and accept values, custom macro is available. These variables keep their values through power cycles, so they can hold per-job change point coordinates. - If the page is missing or the variables will not accept input, the macro option is not installed. Use the G30 or programmed X/Z method from the table above.
- If macros are available, choose how the macro is called:
- T-code macro call: a parameter bit makes every T command call a fixed macro program instead of indexing directly. Inside that macro you retract with G30 and then issue the real T command. A T word inside the called macro indexes the turret normally and does not call the macro again. Read the enabling bit and the reserved program number from the custom macro section of the parameter manual.
-
Explicit subprogram: write a short program containing
G0 G30 U0 W0;andM99;. Call it withM98 P____;before each T word. This needs no parameter changes and is easier to debug on the first job.
With a T-code macro call, the retract becomes invisible in the main program. That means an operator who edits the program cannot see the move. Document the call in the machine's setup notes. If you store the change point in variables, the programmed-X/Z method becomes G0 X#500 Z#501;. The operator then sets the values once per job on the macro variable screen, with no program edit.
Check 4: What currently actuates the hydraulic chuck
M-codes for chuck open and close are not standard across Fanuc lathes. The machine builder assigns them in the PMC ladder. One Doosan lathe on a 0i control uses M68 to open and M69 to close. Another builder may use different numbers, or none. If no builder M-code is decoded, the CNC either raises an M-code alarm or completes the code without any output.
This machine has a hydraulic lever that also makes the chuck move. It switches the direction of oil flow. It may be a manual directional valve that opens and closes the chuck. It may instead be the OD/ID clamping-direction selector. Trace the hydraulic lines to decide which:
- If the lever sits in series ahead of the solenoid valve, it is a direction selector.
- If it bypasses the solenoid valve, it is a manual override.
| Observation | Likely cause | Next check |
|---|---|---|
| Chuck moves only by the lever | Solenoids never energised; lever is a manual valve or direction selector | Trace hydraulics, then PMC signal diagnosis |
| Chuck M-code gives an alarm | M-code not decoded in ladder | Builder's M-code list; ladder M-decode |
| M-code completes, nothing moves | Code decoded, output not driven or valve unpowered | Watch solenoid output bits during the M-code |
| F keys do nothing | Key inputs not assigned in ladder | Watch key input bits on the PMC status screen |
| No foot switch fitted | Input hardware absent | Electrical diagram for a spare or pre-wired input |
- Get the machine electrical diagram. Identify the chuck solenoid outputs, any clamp-confirmation pressure switch, and any foot switch input terminal. Note their PMC addresses from the diagram.
- Open the PMC signal status/diagnosis screen. Monitor the solenoid output addresses while you run a candidate chuck M-code from the builder's manual in MDI.
- Monitor the F key input bits while you press each key. A bit that changes state is wired to the PMC but unused. A bit that never changes has no wiring to the PMC.
If the outputs never change under any M-code, the chuck logic does not exist in the ladder. The fix is the PMC work below.
PMC changes for chuck M-codes, foot switch, and interlocks
Chuck control on this machine needs a PMC adaptation. No part program or macro can drive the valves on its own. Treat ladder editing as a controlled change: a mistake here can release a spinning workpiece.
- Prerequisite: back up the PMC ladder, the CNC parameters, and the PMC parameters to a memory card. Confirm the backup files open before you edit anything.
- Choose two unused M-codes for open and close. Using the pair common on other lathes in the shop, such as
M68/M69, cuts operator errors. Confirm in the builder's M-code list that both are free. - Decode the M-codes in the ladder. Drive the open and close solenoid outputs, holding them (latched) if the valve design requires it. Send the completion signal (FIN) only after the clamp confirmation input, such as a pressure switch, reports the new state. If no confirmation switch exists, use a timed completion as a stopgap and add the switch later.
- Add the interlocks:
- No chuck open while the spindle is turning.
- No spindle start unless clamp is confirmed.
- Spindle stop and alarm if clamp pressure drops during rotation.
- For manual loading, wire a foot switch to a spare input. Program it as open/close toggle or as two pedals, allowed only when the spindle is stopped and the machine is not in automatic cycle. A foot switch is more practical than the F keys because the operator keeps both hands on the part. Map the F keys only if they already show up as PMC inputs in Check 4.
- Write the ladder back. Save it to the control's flash memory so it survives a power cycle, and make a second backup of the modified version.
Proving out the change point and chuck on the machine
Run every test with the spindle stopped first, then empty, then with a part. Rapid override stays at its lowest setting until the moves are confirmed.
- Mount the longest tool. Run
G0 G30 U0 W0;and index through every turret station at the change point. Confirm visually that no tool clears the jaws or tailstock by only a small margin. If one does, move the point further out. - Run a dry program that calls every tool through the chosen method: G30, programmed X/Z, or macro. Confirm the MACHINE coordinates at each change match the intended point for the active offset.
- If you use a T-code macro, confirm in single block that
T0404produces the retract and then the index, and that the correct offset is active afterwards. - With the spindle stopped, run the open and close M-codes from MDI. On the PMC status screen, confirm each solenoid output switches and the clamp confirmation input follows. The block must not complete before confirmation.
- Test the interlocks one at a time:
- Start the spindle with the chuck open. It must refuse.
- Command chuck open with the spindle turning. It must refuse.
- Disconnect the pressure switch signal during low-speed rotation. The spindle must stop.
- Operate the foot switch in manual mode, then in automatic cycle. It must work only in manual mode with the spindle stopped.
- Cycle power. Confirm the G30 point, the
#500-series values, and the chuck logic all survive the restart. Then run the first real part with single block active through the first tool change and the first chuck command.
FAQ
Can I use G28 U0 W0 as the tool change point on a Fanuc 0i lathe?
Yes. G0 G28 U0 W0; sends X and Z directly to machine zero, giving maximum clearance on every tool call. It costs a full Z retract each time, so short parts usually run faster with G30 U0 W0 set to a closer point.
Does G30 need a parameter setting on a Fanuc 0i Mate-TC?
Yes. G30 moves to the second reference position, which is stored per axis in machine coordinates in the reference-position parameter group, in the 1200–1300 range. Jog to the desired point, read the MACHINE coordinates, and enter them into the parameter number listed in your parameter manual.
Can I open and close a hydraulic chuck with M68 and M69 on any Fanuc lathe?
No. Chuck M-codes are assigned by the machine builder in the PMC ladder. M68/M69 is one builder's convention, and if the ladder does not decode a chuck M-code, you must add the decode, solenoid outputs, and interlocks in the PMC.
Can a T-code trigger the tool change retract automatically?
Yes, if the custom macro function is installed, which you can check by whether #500–#549 exist on the variable screen. A parameter-enabled T-code macro call runs a macro that performs G30 U0 W0 and then the real T command, so the main program block stays T0404.