Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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 TODO magic offset to zero positive closed position
  • Set P (necessary?) to P1, C1 to P1, C2 to zeroto N1, Cs to N1
  • Set Df to 1 (positive closed position, known)
  • Signal state change to 71 (Homing complete)
  • Execute move to positive close position

...

Subroutines

Realignment

This routine updates the open-loop position based on the encoder reading. The target position of any subsequent move will be better aligned.

  • 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 P (necessary?) and C1.

Drift Check at Positive Closed Position (X8)

  • If Df==1 (position is positive closed position), then
    • Let Dr=N1-Cs, such that Dr is positive if the motor is slipping (missing steps while travelling traveling in the positive direction)
    • If Dr >= Dl (drift limit), then
      • Set Ld=1, indicating a drift limit violation in the negative direction
    • EndIf
  • EndIf
  • Return

...