G28.1 and G28.2 are advanced CNC diagnostic commands used for axis homing, encoder restoration, and recovery after overtravel or power-loss errors. These commands are essential when a machine cannot home normally, when absolute encoders lose reference, or when the machine overtravels past hard limits. Modern CNC controls use G28.1 and G28.2 to re-establish machine zero, reset encoder reference counts, and safely bring the machine back to operational state without disassembly. Mastering these codes is critical for professional CNC technicians in 2025.
1. What G28.1 Does
G28.1 performs zero return check mode:
- Moves the selected axis slowly toward its home switch
- Searches for proximity/home sensor
- Re-aligns absolute position counters
- Recovers homing position after errors
- Verifies encoder consistency
It is the “safe diagnostic homing” command.
Syntax:
G28.1 X
G28.1 Y
G28.1 Z
Each axis can be recovered independently.
2. What G28.2 Does
G28.2 performs machine zero return operation:
- Homes axis forcibly
- Resets reference position
- Re-initializes servo position
- Clears most zero-return alarms
This is used after:
- Power failure mid-move
- Servo disconnection
- Overtravel lock
- Encoder mismatch alarms
Example:
G28.2 Z0.
3. When You Must Use G28.1 / G28.2 (Real Situations)
✔ After overtravel alarm
Axis has gone past soft limit → machine refuses normal homing.
✔ After power off during motion
Servo lost absolute reference.
✔ After absolute encoder error
Machine requires re-sync with home switch.
✔ After motor or ballscrew work
Axis must be re-zeroed.
✔ After collision event
Safe diagnostic homing prevents further damage.
4. Real Example — Recover Z-Axis After Overtravel
Scenario: Z-axis hit soft limit and locked.
Steps:
G28.1 Z
(Z retracts carefully, finds home switch)
If switch isn’t found:
G28.2 Z0.
(Forces the axis to redefine machine zero)
Machine becomes operational again.
5. Recover All Axes After Servo Failure
G28.1 X
G28.1 Y
G28.1 Z
(If needed)
G28.2 X0. Y0. Z0.
This avoids full control reboot or parameter reloading.
6. Using G28.1 for Encoder Drift Compensation
Absolute encoders sometimes drift after long operation or thermal changes.
Solution:
G28.1 X
(Re-aligns encoder’s internal counter with real home switch)
This restores perfect axis calibration.
7. Manual Jogging + G28.2 Method (Technician Trick)
When an axis is stuck HARD against a limit:
- Power ON with servo OFF
- Manually crank ballscrew away from hard stop
- Apply:
G28.2 X0.
This re-initializes the axis reference even if home switch wasn’t reached normally.
Advanced CNC shops use this daily.
8. G28.1 for Linear Scale Machines (High Accuracy Mills)
For machines with:
- Renishaw linear scales
- Heidenhain glass scales
- High-precision grinders
G28.1 ensures:
- Counter resets
- Scale synchronization
- Thermal drift correction
- Perfect interpolation alignment
9. Difference Between G28 / G28.1 / G28.2
| Code | Purpose | Safe? | Diagnostic? |
|---|---|---|---|
| G28 | Return to home via midpoint | Yes | No |
| G28.1 | Home search & encoder re-sync | Yes | Yes |
| G28.2 | Hard zero return & reference reset | Medium | Yes |
Only G28.1 and G28.2 restore axis calibration.
10. Common Problems & Fixes
Problem: Axis moves opposite direction during G28.1
– Check motor phase
– Check encoder direction parameter
Problem: Home switch never triggers
– Sensor misaligned
– Broken wire
– Wrong parameter bit for switch type
Problem: After G28.2, machine cuts dimensionally wrong
– Tool offsets incorrect
– Work offsets unaffected but machine coordinate shifted
Problem: Alarm persists after G28.1
– Encoder battery dead
– Servo encoder requires replacement
11. Technician-Level Safety Rules
- Never run G28.2 at rapid unless safe
- Clear fixtures before homing
- Avoid running G28.2 blindly on 5-axis heads
- Always verify machine coordinate position after recovery
- Re-home ALL axes after a major alarm
12. Summary
G28.1 and G28.2 are essential diagnostic commands for restoring CNC axis homing, repairing encoder alignment, recovering from servo errors, and safely resetting machine zero after overtravel alarms or power failure. These commands prevent disassembly, reduce downtime, and restore full machine functionality in minutes—making them indispensable for advanced CNC technicians in 2025.
Leave a comment