---
title: "Bar Puller G-Code on a Lathe: How the Program Works"
description: "A bar puller pulls fresh stock out of the collet for the next part. Here is the logic of the G-code behind it, explained conceptually for learners."
url: https://gcodepractice.com/journal/bar-puller-g-code-program-example-lathe/
canonical: https://gcodepractice.com/journal/bar-puller-g-code-program-example-lathe/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-02
updated: 2026-06-02
category: "Guides"
tags: ["lathe", "bar puller", "g-code", "example"]
lang: en
---

# Bar Puller G-Code on a Lathe: How the Program Works

> **TL;DR** On a CNC lathe, a bar puller is a gripper held in the turret that pulls fresh bar stock out of the open collet a set distance for the next part, instead of a powered bar feeder. The program opens the collet, rapids the gripper to the bar, grips it, feeds the stock out a set distance, releases, and retracts. The exact collet open and close codes vary by machine, so this is a conceptual overview, not a runnable program.

This is an educational overview of the logic behind a bar puller program, not a runnable program for your machine. The collet and chuck commands differ by lathe, and pulling stock is a real safety consideration, so always use your specific machine manual and work under supervision.

A bar puller is a clever, low-cost trick. Instead of a powered bar feeder, you put a simple spring or gripper tool in the turret. Between parts, the program uses that gripper to pull fresh bar out of the open collet a set distance, ready for the next cycle.

## The logic of the program

Strip away the machine-specific codes and the sequence is short:

1. **Open the collet or chuck** (a machine-specific command).
2. **Rapid the gripper to the bar** at a safe approach point.
3. **Grip the stock**, often by feeding onto it.
4. **Pull the bar out a set distance** with a controlled feed move.
5. **Release and retract** the gripper clear.
6. **Close the collet** and continue the part program.

The motion codes are the familiar ones: a rapid (`G00`) to approach and a feed (`G01`) for the controlled pull, which is exactly why [G00 vs G01](/journal/g00-vs-g01/) matters here. What is not universal is how the collet opens and closes, which is the part you take from your machine manual.

## Codes vs machine-specific commands

| Step | Type | Notes |
| --- | --- | --- |
| Approach the bar | `G00` rapid | Standard motion |
| Pull the stock | `G01` feed | Controlled, set distance |
| Open / close collet | Machine-specific | Varies by lathe and control |
| Retract gripper | `G00` rapid | To a safe position |

## Where this fits for a learner

Bar puller programs are a turning-side topic that builds on the [common G-codes](/journal/common-g-codes-for-cnc-beginners/) and [common M-codes](/journal/common-m-codes-for-cnc-beginners/). Get those automatic first with [beginner CNC code practice](/journal/beginner-cnc-code-practice/), and treat the collet commands as machine-specific knowledge. A free tool like [G-Code Sprint](/g-code-practice/) drills the foundational codes; the bar puller specifics come from your lathe's manual.

## Bottom line

A bar puller pulls fresh stock from the open collet using simple rapid-and-feed motion plus machine-specific collet commands. The logic is short, but the collet codes and the safety of pulling stock are specific to your machine, so follow its manual.

## Sources

- [CNCCookbook: G-code and M-code cheat sheet](https://www.cnccookbook.com/g-code-m-code-cnc-list-cheat-sheet/)
- [LinuxCNC G-code reference](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [Wikipedia: G-code](https://en.wikipedia.org/wiki/G-code)

## Frequently asked questions

### What is a bar puller on a lathe?
A gripper held in the tool turret that pulls fresh bar stock out of the open collet or chuck a set distance, readying the next part. It is a low-cost alternative to a powered bar feeder for shorter runs.

### What does a bar puller G-code program do?
It opens the collet, rapids the gripper to the bar, grips it, feeds the stock out a set distance, releases, and retracts. The motion is simple; the collet open and close commands depend on the specific machine.

### Is bar puller code the same on every lathe?
No. The motion logic is similar, but the codes that open and close the collet or chuck differ by machine and control. Always use the codes and procedure from your specific lathe's manual.

*G-Code Sprint is a study and practice tool only. It is not a CNC simulator, machine controller, or safety authority. Always follow your instructor, employer, machine manual, and shop safety procedures.*

---

Source: https://gcodepractice.com/journal/bar-puller-g-code-program-example-lathe/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
