Versions Compared

Key

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

...

  • Signal state change to 10 (One-Shot Init)
  • Load One-Shot speeds (V1)
  • Calculate target position using drift of current position (X9)
  • Specify One-Shot ISR (J1) to run on Input Trip
  • Arm Input Trip (TE=TE|4)
  • Signal state change to 11 (One-Shot Loop)
  • One-Shot Loop START (forever):
    • Increment heartbeat
    • Hold for 100ms
    • If user sets the soft reset (Se=0)
      • Go back to mode select
    • EndIf
    • If movement is complete (Sd=90)
      • Signal state change to 12 (One-Shot Complete)
    • EndIf
  • One-Shot Loop END

...

  • Copy current position to shadow variables
  • If currently in the positive closed position P1 (Df=1)
    • Move (MA) to negative closed position P2
    • Calculate new drift based on stored shadow variables
    • Check drift at previous, negative closed position (call X9)
    • Hold until movement complete
    • Set Df=1, indicating current position is positive closed positionCalculate new positive closed position P1 based on drift
  • Else (any other position but P1)
    • Move (MA) to positive closed position P1
    • Calculate new drift based on stored shadow variables
    • Calculate new negative closed position P2 based on drift
  • EndIf
    • Check drift at previous, positive closed position (call X8)
    • Hold until movement complete
    • Set Df=-1, indicating current position is negative closed position
  • EndIf
  • Copy current encoder count (C2) to shadow register CsHold until movement complete
  • Signal state change to 90 (Toggle movement complete)
  • Return

...