Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Info
titleRevision Info

This page currently corresponds to the Ns=94 96 revision of the MCode. This revision resides in release R2.35.130 of pcds_motion.

Note
titleMotors with PCDS MCode Loaded

Any motors with standard PCDS MCode loaded should be purged and reset with the FD command before being loaded with pulse picker MCode. This avoids any interference between variables and code labels.

...

  • Signal state change to 10 (One-Shot Init)
  • Load One-Shot speeds (CL V1)
  • Move the shutter to the nearest closed position (CL X5)
  • If the shutter is in the negative closed position:
    • Specify One-Shot ISR 2 (J2) to run on Input Trip
  • Else
    • Specify One-Shot ISR 1 (J1) to run on Input Trip
  • EndIf
  • Arm Input Trip (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)
      • Branch to Mode Select (Mode 0)
    • EndIf
    • If user requests fast close (Se=5)
      • Branch to Fast Close (Mode 5)
    • EndIf
  • One-Shot Loop END

...

  • Signal state change to 20 (Flip-Flop Init)
  • Load Flip-Flop speeds (CL V2)
  • Move the shutter to the nearest closed position (CL X5)
  • If the shutter is in the negative closed position:
    • Specify Flip-Flop ISR 2 (J6) to run on Input Trip
  • Else
    • Specify Flip-Flop ISR 1 (J5) to run on Input Trip
  • EndIf
  • Arm Input Trip (TE=4)
  • Signal state change to 21 (Flip-Flop Loop)
  • Flip-Flop Loop START (forever):
    • Increment heartbeat
    • Hold for 100ms
    • If user sets the soft reset (Se=0)
      • Branch to Mode Select (Mode 0)
    • EndIf
    • If user requests fast close (Se=5)
      • Branch to Fast Close (Mode 5)
    • EndIf
  • Flip-Flop Loop END

...

  • Signal state change to 30 (Burst Mode Init)
  • Load Burst speeds (V3)
  • Move the shutter to the nearest closed position (CL X5)
  • Specify Burst Open ISR (J3) to run on Input Trip
  • Arm Input Trip (TE=4)
  • Signal state change to 31 (Burst Loop)
  • Burst Loop START (forever):
    • Increment heartbeat
    • Hold for 100ms
    • If user sets the soft reset (Se=0)
      • Branch to Fast Close Mode Select (Mode 50)
    • EndIf
  • Burst Loop END
    • If user requests fast close (Se=5)
      • Branch to Fast Close (Mode 5)
    • EndIf
  • Burst Loop END

NOTE: Once in the burst loop, you must set Se=0 to get back to Mode Select. Burst mode is continuous, that is, each subsequent trigger pulse will open and close the shutter.

...

  • Signal state change to 50 (Fast close init)
  • Load fast close speeds (CL V5)
  • If neither at Df=1 (positive closed) nor at Df=-1 (negative closed), then
    • Move (MA) to the positive closed position (P1)
    • Hold until movement complete
    • Copy current encoder count to Cs for future drift checks
    • Set Df=1 to indicate that slits are in positive closed position
  • EndIf
  • Signal state change to 51 (Fast close complete)
  • Goto mode select

Mode

...

6: Follower (LB

...

Z6)

  • Signal state change to 70 (Homing init60 (Follower Mode Init)
  • Load homing/alignment speeds (CL V9)
  • 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
  • Hold until movement complete
  • Set C1 to P1 - tell the motor where it is
  • Set C2 to N1 - tell the encoder where it is
  • Set Cs to C2 - copy the encoder count to shadow register
  • Set Df to 1 (positive closed position, known)
  • Reset limit violation counters Ld and Ud to 0
  • Signal state change to 79 (Homing complete)
  • Goto mode select

Subroutines

Blocking move to nearest closed position (LB X5)

This routine closes the pulse picker to the positive closed position P1 if it is not already closed.

  • If not already in the positive or negative closed position (Df<>1 AND Df<>-1)
    • Move to positive closed position (P1)
    • Hold until movement is complete
    • Copy current encoder count to Cs for future drift checks
    • Signal at positive closed position (Df=1)
  • EndIf

Realign by computing new open-loop position (LB 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)
    • L1=C2*EL*8
    • L2=MS*200
  • Write the new open-loop position to C1. (C1=L1/L2)
  • Set Df=98 (Realigned)
  • Return

Mode/State Tables

Se - Mode Select

  • Follower speeds (V6)
  • Move the shutter to the nearest closed position (CL X5)
  • Set hi-speed trip input to trigger on HIGH-going edge
  • Specify Follower Open ISR (J7) to run on Input Trip
  • Arm Input Trip (TE=4)
  • Signal state change to 61 (Follower Loop)
  • Burst Loop START (forever):
    • Increment heartbeat
    • Hold for 100ms
    • If user sets the soft reset (Se=0)
      • Branch to Mode Select (Mode 0)
    • EndIf
    • If user requests fast close (Se=5)
      • Branch to Fast Close (Mode 5)
    • EndIf
  • Burst Loop END

NOTE: Once you enter follower mode, you should cycle the EVR line (high-low-high or low-high-low) at least once to synchronize the shutter and the input. This limitation will be fixed in a later picker hardware revision.

NOTE: Once in the follower loop, you must set Se=0 to get back to Mode Select. Follower mode is continuous, that is, each subsequent trigger pulse will open and close the shutter.

Follower Open ISR (LB J7)

  • Move (MA) to open position (P0)
  • If error checking is enabled (Ec=1) AND last position was P1 (Df==1)
    • Calculate drift at previous position P1: Dr=N1-Cs
    • If calculated drift is out of spec (Dr>=Dl)
      • Increment lower drift violation counter Ld
    • EndIf
  • EndIf
  • Specify Follower Close ISR (J8) to run on Input Trip
  • Hold until movement complete
  • Copy current encoder count (C2) to shadow register Cs
  • Set Df=0 to indicate slits are at open position
  • Set high-speed trip input to trigger on LOW-going edge
  • Re-arm input trip (TE=4)
  • Return

Follower Close ISR (LB J8)

  • Move (MA) to positive closed position (P1)
  • If error checking is enabled (Ec=1)
    • Calculate drift at previous position P0: Dr=Cs-N0
    • If calculated drift is out of spec (Dr>=Dl)
      • Increment upper drift violation counter Ud
    • EndIf
  • EndIf
  • Specify Follower Open ISR (J7) to run on Input Trip
  • Hold until movement complete
  • Copy current encoder count (C2) to shadow register Cs
  • Set Df=1 to indicate slits are at positive closed position
  • Set high-speed trip input to trigger on HIGH-going edge
  • Re-arm input trip (TE=4)
  • Return

Mode 7: Home to Index Mark (LB Z7)

  • Signal state change to 70 (Homing init)
  • Load homing/alignment speeds (CL V9)
  • 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
  • Hold until movement complete
  • Set C1 to P1 - tell the motor where it is
  • Set C2 to N1 - tell the encoder where it is
  • Set Cs to C2 - copy the encoder count to shadow register
  • Set Df to 1 (positive closed position, known)
  • Reset limit violation counters Ld and Ud to 0
  • Signal state change to 79 (Homing complete)
  • Goto mode select

Subroutines

Blocking move to nearest closed position (LB X5)

This routine closes the pulse picker to the positive closed position P1 if it is not already closed.

  • If not already in the positive or negative closed position (Df<>1 AND Df<>-1)
    • Move to positive closed position (P1)
    • Hold until movement is complete
    • Copy current encoder count to Cs for future drift checks
    • Signal at positive closed position (Df=1)
  • EndIf

Realign by computing new open-loop position (LB 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)
    • L1=C2*EL*8
    • L2=MS*200
  • Write the new open-loop position to C1. (C1=L1/L2)
  • Set Df=98 (Realigned)
  • Return

Mode/State Tables

Se - Mode Select

Se

Mode Description

0

Soft Reset - interpreted at start-up to bypass hard reset initialization routine

1

One-Shot mode: one pulse on the input line

Se

Mode Description

0

Soft Reset - interpreted at start-up to bypass hard reset initialization routine

1

One-Shot mode: one pulse on the input line results in a single sweep of the pulse picker. Does not automatically return to mode select.

2

Flip-Flop mode: will sweep the pulse picker each time a pulse is received on the input line. Does not automatically return to mode select.

3

Burst mode: will open the pulse picker on the first input pulse received, and close on the second. Does not automatically return to mode select.

4

Fast Open: moves the pulse picker to the full open position (P0). Automatically returns to mode select.

5

Fast Close: moves the pulse picker to the positive closed position (P1). Automatically returns to mode select.

7

Homing: moves the pulse picker to the home index mark, and then by magic offset to the positive closed position P1. Automatically returns to mode select.

...

Sd

Status Description

0

Waiting for Se mode selection

10

One-Shot Initialization

11

One-Shot Loop Waiting

12

One-Shot Complete

20

Flip-Flop Initialization

21

Flip-Flop Loop Waiting

22

Flip-Flop Loop Active

30

Burst Initialization

31

Burst Armed and Waiting

32

Burst Open Pulse Received

33

Burst Close Pulse Received

39

Burst Complete

40

Fast Open Initialization

41

Fast Open Complete

50

Fast Close Initialization

51

Fast Close CompleteClose Complete

60Follower Mode Initialization
61Follower Mode Loop

70

Homing Initialization

79

Homing Complete

80

Hard Reset/Power-Up Initialization

81

Soft Reset/Power-Up Initialization

90

Toggle Move Complete

91

Move to Positive Closed Position Complete

92

Move to Negative Closed Position Complete

94

Move to Open Position Complete

95

Close move did not execute because pulse picker is already closed

...

V5 speeds are identical to V4 speeds.

Follower Velocity Defaults (V6)

V6 speeds are identical to V0 speeds.

Homing/Alignment Velocity Defaults (V9)

...

Installation

Date

Mo

Spindle PV

Verified By

XPP

2013-10-14

-245

XPP:SB2:MMS:29

klg

MEC

2013-1012-1420

-255240

MEC:HXM:MMS:18

klg

XCS

2013-10-14

-250

XCS:SB2:MMS:09

klg

The magic offsets are normally stored in IMS NVRAM, but in case they are lost, refer to the table above.

...

:MMS:18

alexd

XCS

2014-01-13

-246

XCS:SB2:MMS:09

klg & alexd

CXI2013-12-20-286CXI:ATC:MMS:29alexd

The magic offsets are normally stored in IMS NVRAM, but in case they are lost, refer to the table above.

Changelog

Version Ns=96 (pcds_motion R2.5.0)

  • Added Follower mode (mode 6), in which the state of the picker shutter follows the state of the EVR input line, with 0V == closed and 5V == open.
  • Added the ability to trigger Fast Close directly from One-Shot, Flip-Flop, Burst, and Follower modes

Version Ns=94 (pcds_motion R2.3.14)

...