Troubleshooting
Why a gantry pattern will not unload the sub spindle only
Short answer
You cannot fake a fixed gantry pattern into an unload-only cycle: it chains a main-spindle load, and its interlock demands the main chuck open, which would let a bar through the spindle shift. The real routes are a standalone unload command if your manual documents one, a user-written gantry-side program where the control accepts editable robot programs, or a vendor pattern change, and the gripper must hold the part before the sub chuck opens.

On this page
- Why do the fixed sub-spindle patterns also want to load the main spindle?
- Can you lie to the pattern and leave the pallet empty?
- Which robot command unloads the second spindle?
- When does the gantry side accept a program you write yourself?
- Which route should you take for an unload-only cycle?
- How should the robot grip before the sub chuck opens?
- How do you prove the cycle before you run the lot?
- Questions asked
The fixed gantry patterns on a bar-fed twin-spindle lathe cannot be tricked into unloading the sub spindle alone: every one of them chains a pallet pick and a main-spindle load in front of the sub unload, and that load step commands the main chuck open, which would let the bar through the spindle shift. The workable routes are three: call the unload robot command standalone if your control's manual documents it that way, write your own gantry-side program if your control generation accepts editable robot programs, or have the machine builder change the pattern. Whichever route you take, sequence the grip so the robot holds the part before the sub chuck opens.
Why do the fixed sub-spindle patterns also want to load the main spindle? #
Gantry loader controllers are shipped with load-and-unload pairs, not separate services: the pattern that picks the finished part off the second spindle starts by picking raw stock from the pallet and loading it into the main spindle, and only then returns to remove the part.
The core constraint is the interlock, not the wasted travel. The pattern expects the main chuck open before the robot enters the work envelope, because it assumes there is a blank in the first spindle to exchange. On a bar-pull job there is bar through the main spindle, so an unclamp command lets the stock move. The pattern is mechanically wrong for the application, not merely inefficient.
The cost of not solving it is real. A calculated example for the job in question: 500 pieces at a 3.5-minute machine cycle means 500 × 3.5 min = 1750 min of cycles, and standing an operator at the door to unload each part costs that same 1750 ÷ 60 ≈ 29.2 h of manual handling. That figure is computed for these example inputs; rescale it with your own lot size and cycle time.
Can you lie to the pattern and leave the pallet empty? #
An empty pallet removes nothing from the sequence: the pattern still executes its main-spindle load step, still commands the main chuck open, and still risks shifting the bar through the spindle, so the robot grabs air and you pay the wasted motion every cycle.
Calling only the unload command from the part program is a test, not an assumption. It works only where the control treats the second-spindle removal as a standalone routine. Patterns that chain the load and unload together will fault, sit waiting for a handshake that never arrives, or run the load step anyway. The three common workarounds fail in predictable ways:
| Workaround idea | What goes wrong |
|---|---|
| Leave the pallet empty so the robot grabs air | The load step still runs and still commands the main chuck open |
| Call only the unload command | Valid only where the manual documents the removal as standalone; chained patterns fault or wait on a missing handshake |
| Run the full pattern and ignore the load | Adds the pallet pick and load time to every cycle and still unclamps the main chuck |
Before you test anything, find the line in the pattern documentation that performs the main-spindle load and check whether a parameter can skip it. If your pattern list carries a sub-only or unload-only option, use it and stop there.
Which robot command unloads the second spindle? #
Check your own manual before trusting any M-code list: some control generations name M20 as the robot command that loads the first spindle and M21 as the command that removes the part from the second, while others list M21 as unused and M20 as only a call for robot service.
Find the M-code table for robot commands in your programming manual and write down every code in the robot range, M20 through M29 as defined on your control, before you plan anything. The programs left in a used machine are the fastest map of the call convention: part programs on these setups typically open with an air blast on the chuck and a chuck-orient block, then a first robot command that loads head 1, and close with the same air blast and orient block, then a second robot command that removes the part from head 2. Pick two or three programs that unload from head 2 and note which pattern each one selects.
Treat your own manual as the authority on all of this. The code list differs between control generations, and one generation's documentation marks the head-2 command as unused while another names it explicitly, so a code that works on one machine does not transfer to the next.
When does the gantry side accept a program you write yourself? #
Open the program directory in the gantry control box: where the robot program is a macro-style program running on the gantry side of the control, you can write your own unload sequence from the documented command list, and where the box exposes fixed patterns only, you cannot write one.
Two checks settle it. First, note the gantry controller model from its nameplate or version display and the machine control's software level from its version screen, because control generations differ sharply here: some are documented around fixed robot commands and built-in patterns, others treat the gantry program as an ordinary program you edit like any other. Second, open the program directory and see whether it lists patterns only or also editable programs, then open one existing program in the editor, view only, no edits. If you can state in one line that the gantry side accepts user-written programs, the custom-program route is open to you.
A gantry loader is ultimately a set of external axes driven under the machine's control, and the division of who commands what on that chain is laid out in what a robot controller needs to run gantry external axes.
Which route should you take for an unload-only cycle? #
Take the route your documentation supports, in this order: a standalone unload command if your manual lists one, a gantry-side program you write yourself if the control accepts editable robot programs, and a vendor pattern change when neither is true.
| Route | What it needs | Choose it when |
|---|---|---|
| Call only the unload command from the part program | A manual that lists the head-2 removal as standalone | The single-block test runs the unload with no load step and no main-chuck unclamp |
| Write a gantry-side program | Editable robot programs and the full command list for your control | The program directory accepts user-written programs; you own every interlock and collision check |
| Vendor pattern change | Machine builder or integrator applications support | Neither route above exists; expect lead time |
Whatever route you take, the gantry axes remain servo axes that need their own command and drive path between the controller and each motor, which is the subject of why a robot needs a servo controller between it and the motor. Route two puts every interlock in your hands, including the collision checks the fixed patterns once owned, so keep the turrets clear, the second spindle at its unload position, and the door state the original pattern required.
How should the robot grip before the sub chuck opens? #
Grip first, open second: command the robot to the approach position while the sub chuck is still clamped, close the gripper on the part, confirm the clamp-complete signal, and only then open the sub chuck and retract.
This order is what makes the chuck-open safe. A sequence that opens the chuck first lets the part drop, tilt or ding as the jaws release, and some factory patterns force exactly that exposure by requiring the chuck open on entry — one more reason the fixed pattern does not fit this job.
Size the grip on the worst handling case before you trust it. Calculated example: a 1.0 kg part, a friction coefficient of 0.2 between jaws and part, and a handling acceleration of 5 m/s². The required total normal force is F = m·a/μ = 1.0 kg × 5 m/s² ÷ 0.2 = 25 N across the jaws, or 12.5 N per jaw on a two-jaw gripper; applying a safety factor of 2 gives 25 N per jaw. These are example inputs, so take the friction pair and the actual acceleration from your gripper datasheet and your own axis motion, not from this paragraph.
How do you prove the cycle before you run the lot? #
Prove it in simulation, then in single block, then one real part: back up every program first, run the cycle with the gantry in a no-motion test mode if the control offers one, and watch the chuck status indicators through a full cycle.
- Back up every program in the machine and in the gantry control box before you open anything for study or edit.
- Write the part program so the main chuck never receives a robot-service call, and confirm no line between part-off and program end commands the main clamp state to change.
- Run in single block with the gantry disabled or in its no-motion test mode, and confirm the main chuck stays clamped for the whole cycle while the sub chuck changes state only when the unload call is active.
- Run the gantry at reduced speed for the first part and confirm the gripper clamp-complete signal arrives before the sub chuck unclamps.
- Treat the interlock change as a machine modification: keep the guards, door interlocks and light curtains active for the first cycles and re-check them against the machine's risk assessment.
Decided, the answer reads: an empty pallet fools nothing; a standalone unload command is valid only if the single-block test proves it on your control; editable gantry programs mean you write the macro and own its interlocks; and when neither applies, the vendor pattern change is the route — with the gripper closing while the sub chuck still holds the part in every case.
Questions asked
Does the bar pull belong in the part program or the robot program?
In the part program. CAM systems expose it as a part-handling feature under turning: you select bar pull and set a grab distance measured from the stock face, and the sub spindle pulls the stock as a machine move. The robot unload call is separate and sits at the end of the cycle; neither replaces the other.
What does the air-blast and chuck-orient block before a robot command do?
It is a chip-clearing and positioning convention: the air blast blows chips out of the chuck jaws and the orient block turns the chuck to a known jaw position, so the gripper meets the same geometry at every call. Programs inherited on a used machine usually carry it in front of each robot command.
Will every control run a lone unload command without the load step?
No. Documentation differs by control generation: some manuals name a second robot command that removes the part from the second spindle on its own, while others list that code as unused and fold every move into the fixed patterns. The single-block test with the gantry in no-motion mode is the only confirmation that counts.
