Home › G-codes › Mach3 Mach4 › G51
G51 Scaling and mirror
Mach3 Mach4 G-code · Mill
Multiplies programmed positions by a scale factor per axis. A negative factor mirrors that axis. DROs and offsets are not changed.
Format
G51 [X] [Y] [Z] [A]
Addresses
| Address | What it does |
|---|---|
X Y Z A | Scale factor for each axis, negative to mirror |
How it works
Modal, scaling group. Cancel with G50.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (SAFE START, INCH)
T1 M6 (TOOL CHANGE)
S5000 M3 (SPINDLE ON)
G43 H1 Z1.0 (LENGTH OFFSET)
…
T1 M6 (TOOL CHANGE)
S5000 M3 (SPINDLE ON)
G43 H1 Z1.0 (LENGTH OFFSET)
…
The full 8-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Unequal X and Y factors do not make an ellipse from an arc. Mach3 does not allow it.
- Mach scales about program zero. Fanuc style G51 with a center point P is not the same.
- Mirror swaps climb and conventional cutting and G41 with G42. Check the toolpath display.
Related codes
G51 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Scaling |
| Haas NGC | Scaling |
| Mazak (EIA) | Scaling on |
| Okuma OSP | Scaling on |
| Mitsubishi M70 M80 | Scaling on |
| Brother Speedio | Scaling on |
| Heidenhain TNC (ISO) | Tool preselection |
| Centroid CNC12 Acorn | Scaling and mirroring on |
| Hurco WinMax (NC) | Scaling |
| Fadal | Ramp slope control |
Every G-code for Mach3 Mach4 in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open G51 in the app All Mach3 Mach4 G-codes