G28.1 and G28.2 are advanced CNC diagnostic commands used for axis zero-return calibration, encoder synchronization, and safe recovery from axis faults. These commands allow the machine to re-establish its home reference using encoder feedback, grid-shift positions, and servo alignment logic. G28.1 performs a controlled re-home routine, while G28.2 checks and verifies the axis zero-return position without actually moving the machine. These commands are essential for maintenance technicians, advanced CNC programmers, and anyone dealing with axis overtravel alarms, zero-return faults, or encoder misalignment in 2025 CNC environments.
1. What G28.1 Actually Does
G28.1 forces the machine to perform a controlled zero-return move, re-establishing:
- Machine home position
- Encoder index alignment
- Servo synchronization
- Soft-limit boundaries
It is the active zero-return calibration command.
Example:
G28.1 X0.
This homes the X-axis using encoder index pulses and machine markers.
2. What G28.2 Does (Diagnostic Mode)
G28.2 does not move the machine.
Instead, it:
- Checks encoder state
- Verifies home position
- Confirms axis reference consistency
- Detects misalignment
- Reports diagnostic codes
Example:
G28.2 X0.
Used for troubleshooting before attempting an actual home.
3. Real Example — Fixing a Zero-Return Alarm
If machine shows:
- EXCESS OVERTRAVEL
- ZERO RETURN INCOMPLETE
- SERVO ALARM 401, 414, 417
- AXIS HOME SWITCH NOT FOUND
Sequence:
G28.2 X0. (Check diagnostics)
G28.1 X0. (Re-home axis)
If successful → alarm cleared.
4. Using G28.1 After Power Loss Mid-Motion
If the machine lost power during a rapid move:
- Encoder position is unknown
- Machine cannot trust soft limits
- Zero return is required
Use:
G28.1 X0.
G28.1 Y0.
G28.1 Z0.
This re-synchronizes all axes properly.
5. Using G28.2 to Locate Encoder Index Errors
G28.2 reports:
- Incorrect grid shift
- Encoder pulse drift
- Misaligned reference position
Technicians use this before performing servo tuning.
6. Safe Recovery From Hard Overtravel Alarm
Hard overtravel requires manual release, then:
(1) Jog axis off limit switch
(2) Run diagnostic:
G28.2 Z0.
(3) Re-home:
G28.1 Z0.
This restores safe movement boundaries.
7. Using G28.1 After Ballscrew or Motor Replacement
Any mechanical work affecting:
- Ballscrew
- Servo motor
- Coupling
- Bearings
- Linear guides
requires a fresh zero-return routine:
G28.1 X0.
G28.1 Z0.
Restores machine accuracy and home reference.
8. Multi-Axis Example (Full Machine Calibration)
G91
G28.1 X0.
G28.1 Y0.
G28.1 Z0.
G28.1 B0.
G28.1 C0.
G90
This is common in 5-axis trunnion calibration work.
9. Advanced Diagnostics With G28.2
G28.2 returns diagnostic data such as:
- Encoder index offset value
- Grid shift
- Soft-limit mismatch
- Home-switch deviation
- Axis travel tolerance
Technicians check this before adjusting parameters.
10. Using G28.1 for Rotary Axis Calibration
Rotary zero-return is sensitive.
Example:
G28.1 B0.
Re-synchronizes B-axis with:
- Circular encoder ring
- Absolute position feedback
- Home marker
Critical for 4-axis and 5-axis accuracy.
11. Common Errors & Professional Fixes
Alarm: ZERO RETURN INCOMPLETE
– Axis could not find encoder index
Fix: Jog near home → retry G28.1
Alarm: SOFT LIMIT EXCEEDED
Fix: G28.1 reset soft limits
Axis moves opposite direction during G28.1
Fix: encoder reversed or misaligned
Rotary axis will not home
Fix: verify clamp released (M code)
12. Pro-Level Workflow for Safe Zero-Return Recovery
- Check diagnostics
G28.2 X0. - If error detected → perform full re-home
G28.1 X0. - Verify limits
G53 X0. Y0. - Run quick test program to confirm alignment
G01 X20. F300 - Log encoder offset values for maintenance
13. When Not to Use G28.1
- If mechanical crash damage is suspected
- If home sensor is physically broken
- If encoder cable is loose
- If the axis is binding
G28.1 assumes motion is safe—use with caution.
14. Summary
G28.1 and G28.2 are essential diagnostic tools for CNC zero-return alignment, encoder calibration, and safe axis recovery. G28.1 performs controlled homing, while G28.2 provides non-moving diagnostics for troubleshooting. In 2025’s precision CNC environment—especially with multi-axis machines—mastering these commands is critical for accuracy, uptime, and error-free machining.
Leave a comment