Memorandum

 

To: Eric Tollestrup

From: Dan Clemens

Date: December  19, 2002

re: Mimir I/O Board Functionality (V5)

 

Scope: This memo describes the purpose and functionality of the eight Mimir I/O boards to be located in the electronics box mounted with the cryostat at the telescope. This memo should be consulted when designing and debugging software for driving Mimir’s electromechanical units within the cryostat using the STP100 stepper motor controller cards.

 

Assumptions: A fundamental assumption is that each stepper motor in the cryostat is associated with up to five electrical switches and may have an electrically powered brake or other similar device. This allows each filter wheel or similar device to be treated as a distinct “unit” and to be cabled to one I/O board using a standard cable. The same I/O board could be connected to a filter wheel or to a camera positioner or to a slit belt unit. All boards are interchangeable. All cables are interchangeable. Every board must be capable of discovering which motor unit it is attached to and be able to report that information back to the host computer. Every board must be uniquely identified back to the host computer.

 

Purpose: The I/O board serves to augment one STP100 stepper motor card for applications involving stepper motor motion and mechanical unit position sensing. In Mimir, these include the polarimeter (half-wave plate rotation unit), filter wheels, camera slit belt unit, and camera selection unit. The I/O board enhances the number of signals the STP100 can return to the host computer. The I/O board returns a unique cable identifier to the STP100 allowing the host computer to know which mechanical unit within the cryostat is attached to the board. The I/O board also returns a unique board identifier to the STP100 to allow checking for a match of I/O board with connected cable and STP100 internal board identification. The I/O board also handles hardware limit condition processing, by halting the flow of stepper motor power and setting any brake present in the motor unit. Finally, the I/O board displays a wide range of diagnostic signals to a 10-LED stack and to the 7-segment LED display.

 

Communication: The I/O board is accessed via the RS-232/485 channel of the piggyback STP100 card. The STP100 provides four signal lines that can be accessed via the PR (“pin read”), PS (“pin set”), PC (“pin clear”), and AD (“read A/D line”) commands of the STP100. Two of the four STP100 lines are used as control lines from the STP100 to the I/O board to select one of four operating modes for the I/O board.

            The control lines are the STP100 “Pin 5” and “Pin 6” connections of the STP100’s J7 connector. The I/O board considers “Pin 5” the more significant of the two control lines. In the I/O board schematic, the lines are called “STPOut1” and “STPOut0”, for pin 5 and 6, respectively.

            The other two STP100 lines, “Pin 3” and “Pin 8”, are used to send information from the I/O board to the STP100. In three of the I/O board modes, this information is in the form of TTL signals and can be read using the RP (“read pin”) digital mode of the STP100. In one mode of the I/O board, the signals are analog voltages (in the 0-5V range) and are read by the STP100 using the AD1 (“read analog voltage on pin 3”) and AD2 (“read analog voltage on pin 8”) commands.

 

Signals Captured: The following signals are collected by the I/O board and presented to the STP100:

 

Table 1: I/O Board Signals

Name

Type

Description

Cable ID

Analog

Unique identifier for the motor unit at the end of the cable (that is, inside the cryostat) – See Table 3 below

Board ID

Analog

Unique identifier for the I/O board being used – See Table 4 below

Panic/Home

TTL

Depending on the nature of the motor unit, returns either a “home” signal, or a “panic” signal. Panic is the logical OR of the four limits below. If any of the limits is reached, the panic line is asserted. This allows the STP100 to monitor this bit while moving the stepper motor.

Detent

TTL

Returns status of detent signal line to motor unit.

E1/SR

TTL

In Filter wheels, E1 is the LSB of the 4-bit filter position encoder. In slits and camera positioners, SR is the Software Right limit switch signal.

E2/SL

TTL

Similar to E1/SR, but for the second bit of the filter position sensor and/or the Software Left limit switch.

E3/HR

TTL

Third filter position sensor and/or the Hardware Right limit switch. “Hardware” limit switches have higher priority than “Software” limit switches on the I/O board and when asserted cause the motor power to disengage.

E4/HL

TTL

Similar to E3/HR, but MSB of filter position sensor and Hardware Left limit switch.

 

 

 

 

 

 

 

 


I/O Board Mode Selection: The two output lines of the STP100 are used to select the mode of the I/O board. The following table summarizes the modes and the signals returned to the STP100 in each mode.

 

Table 2: I/O Board Operating Modes

Out 1

“Pin 5”

Out 0

“Pin 6”

Mode Name

In 0

“Pin 8”

In 1

“Pin 3”

Signal

Type

Actions

Set (“1”)

Set

GETID

Cable ID

Board ID

Analog

Reads Cable ID; Can reset motor off condition; Brake set

Set

Clear (“0”)

MOVE

Panic/

Home

Detent

TTL

Brake Released; HL/HR limits cause motor off

Clear

Clear

READ A

E2/SR

E1/SL

TTL

Brake set

Clear

Set

READ B

E4/HR

E3/HL

TTL

Brake set

 

Cable ID: The Cable ID consists of a resistor-based voltage divider for which one of the resistors is located at the end of the wiring harness with its associated motor within the cryostat. By selecting particular resistors for each motor unit, a unique voltage from the voltage divider is generated. This voltage is fed back to pin 8 of the STP100 and read using the AD2 command. An on-board ADC on the I/O board also samples the voltage divider and resolves the information to a single digit cable ID number and presents this information on the 7-segment LED on the front panel of the I/O board. The encoding scheme is as shown in the following table:

Note that the Cable ID must be read multiple times, using several AD2 calls. The returned values should be averaged (perhaps with outlier removal). The deviation of the measured average from the averages listed in the table below should be less than the uncertainty listed in the table below to be able to claim a valid unit identification.

 

Table 3: Cable ID Encoding on I/O Board

ID #

Unit Name

in Mimir

Resistors in cryostat

I/O Board

7-seg LED

STP100 AD2 Count Values

Average

Uncertainty

0

Fail

short

0

<66

 

1

HWP

6.0k

1

73

3

2

Polar

7.9k

2

86

3

3

FW1

10.4k

3

102

3

4

FW2

13.7k

4

120

3

5

FW3

17.7k

5

136

3

6

22.6k

6

150

3

7

29.9k

7

167

3

8

Camera

41.4k

8

183

3

9

Slit Unit A

59.3k

9

198

3

c

Slit Unit B

94k

“c”

215

3

d

230k

“d”

231

3

>9

Fail

open

“u”

>236

 

 

Board ID: A resistor-based voltage divider is also used to identify the I/O board back to the STP100 and then on to the host computer. The voltage output is selected by a DIP switch (one of eight switches) that also gives a visual identification to the individual I/O board. In the Get ID mode, the voltage divider returns an analog voltage that is digitized by the STP100 via the AD1 command. The encoding is as shown in the following table:

 

Table 4: Board ID Encoding on I/O Board

Board Number

DIP Switch

Selection

STP 100 AD1 Count Values

Average

Uncertainty

0

Do Not Use – This Activates all boards

1

1

68

2

2

2

89

2

3

3

102

2

4

4

113

2

5

5

128

2

6

6

153

2

7

7

165

2

8

8

178

2

 

Actions: The I/O board controls the stepper motor power being sent to the STP100 card as well as the power to any brake in the motor unit in the cryostat. In the MOVE or READ modes of the I/O board, if either the HR or HL signal is true (a hardware limit switch is closed), stepper motor power is removed and the brake is set.

            Motor power reset is accomplished either by pressing a front panel push button switch, or if the jumper is present, the driving computer may also reset motor power by issuing a GETID mode selection.

 

Front Panel Switches: There are two push buttons and one toggle switch on the front panel. The toggle switch enables the LED displays or extinguishes them. The top push button switch issues a GETID signal, independent of the STP100, which latches the cable ID onto the 7-segment LED display. This is useful for debugging cables when a computer is not present to communicate with the STP100 board. The lower push button resets stepper motor power after a hardware limit has been reached.

 


Front Panel LEDs: There is a 10-element LED stack and a 7-segment LED display. The 7-segment LED shows the most recent Cable ID value. The 10 element LED stack shows that status of the following signals:

 

Table 5: Front Panel 10 Element LED Stack

LED Number (from top)

Signal Name, Description

Motor/Brake Information Group

1 (red)

Brake Released – power is being sent to the brake unit

2 (red)

Motor Power Fail – the stepper motor power has been turned off because a hardware limit condition was sensed.

Command Group

3 (red)

STP Out 1 = “Pin 5”

4 (yellow)

STP Out 0 = “Pin 6”

High Level Information Group

5 (yellow)

Panic/Home

6 (yellow)

Detent

Low Level Information Group

7 (yellow)

E4/HR

8 (green)

E3/HL

9 (green)

E2/SR

10 (green)

E1/SL

 


Commanding Considerations: Because the brake release is tied directly to the MOVE mode condition, care must be exercised in designing the commanding sequences to the I/O board or a potentially dangerous condition could occur. This is particularly the case for the Mimir camera positioning unit, where stepper motor power is normally turned off after a move and the brake is set. If the I/O board is given a MOVE mode selection before stepper motor power is turned on by the STP100, the brake will be released and the camera block could hit a hardware limit (at which time the brake will be set).

            Useful programming sequences would be something like the following:

 

Table 6: Model STP100 & I/O Board Commanding Sequences

Desired Action

STP100 Commands

I/O Board Mode

Actions, Notes

Get Motor Unit ID

PS6

 

NOTE: set pin 6 BEFORE pin 5 to avoid passing through MOVE mode!!!

 

PS5

GETID

Loads ID for Cable

 

AD2

 

Read Cable ID

 

AD1

 

Read I/O Board ID

 

PC5

READ B

NOTE: clear pin 5 BEFORE pin 6 to avoid MOVE mode

 

PC6

READ A

Safe place to leave I/O board

 

 

 

 

Move Unit

PS6

 

 

 

PS5

GETID

Clear any motor off condition

 

SP

 

turn on stepper motor power

 

PC6

MOVE

Brake off, ready to move

 

RP8

 

read panic/home bit

 

RP3

 

read detent bit

 

TC3

 

set STP test condition on detent

 

II350

 

move 350 more steps

 

RP3

 

check detent bit

 

RP8

 

check panic/home bit

 

PS6

READA

set brake

 

SO

 

turn off motor power

 

 

 

 

Read Limits

PS6

 

 

 

PC5

READB

 

 

RP8

 

read E2/SR bit

 

RP3

 

read E1/SL bit

 

PC6

READA

 

 

RP8

 

read E4/HL bit

 

RP3

 

read E3/HR bit