...
- Signal state change to 70 (Homing init)
- Load homing/alignment speeds
- Execute home-to-index (HI) with option 3 (slew at VM in + direction, creep in - direction)
- Hold until movement complete
- Relative move (MR) by Mo to positive closed position
- Set C1 to P1, C2 to N1, Cs to N1
- Set Df to 1 (positive closed position, known)
- Signal state change to 79 (Homing complete)
Subroutines
...
Realign by computing new open-loop position (X7)
This routine updates the open-loop position based on the encoder reading. The target position of any subsequent move will be better aligned.
- Declare local variables L1, L2
- Compute the new open-loop position: C2 * <encoder counts per rev> / <microsteps per rev> = (C2 * EL * 8) / (MS * 200)
- Write the new open-loop position to C1. (C1=L1/L2)
Drift Check at Positive Closed Position (X8)
...