Skip to end of metadata
Go to start of metadata

TTL board

The communication between PI mercury stage (Z-axis) and PRIOR microscope stage (XY-axis) is synchronized with TTL signals. Input and output signals of the two devices are connected on a separate TTL board (dark grey box) on top of Prior controller. The pin combinations are shown in the table below. Colors indicate which input/output connections are established, with the color representing the color of the connecting wires in the TLL board.

 

Prior

Mercury

Pin 1

+5V

Pin 1

Input 1

Pin 2

TTL_OUT 1

Pin 2

Input 2

Pin 3

TTL_OUT 3

Pin 3

Input 3

Pin 4

TTL_IN 1

Pin 4

Input 4

Pin 5

TTL_IN 3

Pin 5

Output 1

Pin 6

GND

Pin 6

Output 2

Pin 7

TTL_OUT 2

Pin 7

Output 3

Pin 8

TTL_OUT 4

Pin 8

Output 4

Pin 9

TTL_IN 2

Pin 9

+5V

 

 

LabVIEW code

Three VIs contain code for TLL commands. At first the individual VIs and their code are analyzed separately, in a second part, the actual result of the commands will be described.

MakePattern.vi

This VI defines the writing pattern that is needed to write the sample onto a support. It defines a small PRIOR macro program with several repeats of relative X and Y movements. The VI prepares the macro and the controller waits for a trigger signal (trigger point TTL input 2 high) from the Mercury controller (see table above).

Prior

MACRO

Enter macro mode

 

TTLDEL 2

 

Deletes all trigger points and actions associated with TTL input 2

 

TTLMOT 2 1

 

Changes TTL output 2 to high while stage is moving

 

TTLTP 2 1

 

Adds a trigger point to TTL input 2, which is activated by a rising edge or high

 

TTLACT 2 40 X 0 0

TTLACT 2 40 0 Y 0

TTLACT 2 40 -X 0 0

TTLACT 2 40 0 Y 0

Etc.

 

Adds an action to the trigger point, 40 stands for move XY relative. Command is send several times (X direction, Y direction, reverse X direction etc.)

TTLTRG 1

 

Arms the global flag

MACRO

 

Leaves macro mode

AutoWrite.vi

This VI is used for deposition in automated mode. It is run once the nozzle is at the starting position for writing. In macro script for automation, use as follows:

!tellmodule::SCL.Stage
.AutoWrite
.!waitModule
.!wait::1000 (this value needs to be higher than the WaitTimeBeforeStart value in the user interface, because the stage has to move when getStatus is requested)
.getStatus 

 

Mercury

CF1

Turns I/O output channel 1 to low

 

CF2

Turns I/O output channel 2 to low

 

CN2

Turns I/O output channel 2 to high

 

WA100

Waits for 100 ms

 

CF2

Turns I/O output channel 2 to low (reset trigger)

 

WA100

Waits for 100 ms

 

CN2

Turns I/O output channel 2 to high (second trigger) - Prior macro limited to 16 sequences (i.e. 8 lines), in order to write more lines the macro needs to be restarted. This is achieved by resetting and retriggering channel 2.

 

 

GomnPositionInPatter.vi

This VI is called when the pattern writing is executed. It tells the absolute starting position in XYZ and synchronizes XY and Z movements.

Mercury

CF1

Turns I/O output channel 1 to low

 

CF2

Turns I/O output channel 2 to low

 

 

Prior

Macro

Enter macro mode

 

TTL 1 0

Sets TTL output 2 to low (caution: TTL m n command counts from 0 to 3!)

 

TTLDEL 1

Deletes all trigger points and actions associated with TTL input 1

 

TTLMOT 1 1

Changes TTL output 1 to high while stage is moving

 

TTLTP 1 1

Adds a trigger point to TTL input 1, which is activated by a rising edge or high

 

TTLACT 1 41 X Y 0

Adds an action to the trigger point, 41 stands for move XY absolute. This will move the nozzle to the start position of the pattern.

 

TTLTRG 1

Arms the global flag

 

MACRO

Leaves macro mode

 

 

Mercury

MA{value}

Moves to absolute position (travel height z above pattern starting position)

 

WS30

Waits until motor on target, then waits 30 ms

 

CN1

Sets I/O output channel 1 to high

 

WA300

Waits for 300 ms

 

WF1

Waits for I/O input channel 1 to be low

 

MA{value}

Moves to absolute position (approaches final writing position)

 

WS30

Waits until motor on target, then waits 30 ms

 

WA{time}

Wait absolute time (defined by WaitBeforeStartTime)

 

CN2

Turns I/O output channel 2 to high

 

WA100

Waits for 100 ms

 

CF2

Turns I/O output channel 2 to be low (reset trigger)

 

WA100

Waits for 100 ms

 

CN2

Turns I/O output channel 2 to high (second trigger) - Prior macro limited to 16 sequences (i.e. 8 lines), in order to write more lines the macro needs to be restarted. This is achieved by resetting and retriggering channel 2.

 

WA10000

Wait 10 s for pattern to finish

 

MA{value}

Moves to absolute position (move up to travel height)

 

GoPosition.vi

Mercury

CF1

Turns I/O output channel 1 to low

 

Prior

Macro

Enters macro mode

 

TTLDEL 1

Deletes all trigger points and actions associated with TTL input 1

 

TTLMOT 1 1

Changes TTL output 1 to high while stage is moving

 

TTLTP 1 1

Adds a trigger point to TTL input 1, which is activated by a rising edge or high

 

TTLACT 1 41 X Y 0

Adds an action to the trigger point, 41 stands for move XY absolute. This will move the nozzle to the start position of the pattern.

 

TTLTRG 1

Arms the global flag

 

Macro

Leaves macro mode

 

Mercury

GH

Goes home (currently defined zero position)

 

WS50

Waits until motor on target, then waits 50 ms

 

CN1

Turns I/O output channel 1 to high

 

WN1 WA50

Waits for I/O input channel 1 to be high Waits 50 ms

Secondary x-axis (translation from microscope objective to writing stage (50 mm)). In some cases Prior coordinates (xy) might be the same, but one position is in reference to the objective, the other in reference to the grid holder.

Thus Prior stage will not move and WN1 does not work as it will not turn high. Therefore replaced WN1 by WA50 so that the z-axis will move after 50 ms.

 

WF1

Waits for I/O input channel 1 to be low

 

MA

Moves to absolute position on z-axis

 

Chronological order

A)     Pattern writing

MakePattern.vi is acting purely on the Prior controller and prepares the macro for the writing pattern as explained above. The macro gets triggered when Prior’s TTL input 2 is changed to high.

When the button "Make Pattern"  is pressed, GomnPositionInPatter.vi is executed. First Mercury output channels 1 and 2 are turned to low. Then a second Prior macro is defined which will be triggered when Prior’s TTL input 1 is changed to high.

Now the Mercury controller takes the lead and triggers all the action. First, the z-stage moves to the defined travel height (distance Z above the actual writing height). Then Mercury’s output channel 1 is turned to high, which triggers the trigger point 1 on the Prior controller. The XY-stage will thus move to the absolute XY position where the writing is supposed to start. As long as the Prior stage is moving, its TTL output 1 remains high. Meanwhile, the Mercury controller waits for the input channel 1 to get low. When position is reached, Prior TTL output 1 becomes low again and the Mercury controller sends the Z-stage to its final writing position. Here it waits for a user-defined time (time for the syringe pump to start running). After the wait time, Mercury’s output channel 2 is switched to high, which triggers TTL trigger point 2 on the Prior controller. This starts the pattern writing. Again, the Mercury controller waits for the input channel 2 to become low again. Once the pattern writing is over, the z-stage moves back to travel height.

 

B)      Move to an absolute position

GoPosition.vi works similarly. Initially, Mercury output channel 1 is switched to low. A Prior macro sequence is prepared that will move the stage to an absolute XY position once trigger point 1 is activated by a change to high on Prior TTL input 1.

The z-stage will now move to the zero (home) position, so that the nozzle will not crash into anything when moving across the stage. Once the z-stage is retracted, Mercury output 1 is turned high, which starts the Prior macro and moves the stage along XY. Once target position is reached, the z-stage will lower to its final position.

 

Known problems/bugs

  • When far away from the writing position and make pattern command is sent, the z-axis will move to travel height and then XY movement starts. This can break the nozzle if travel height is very low!
    • No problem if used in automated sampling mode, since command to go to writing position will be given via GoPosition.vi.

  • The rectangular pattern can only do 8 repeats (one repeat being a movement in x followed by a movement in y).
    • There is a limit of 16 actions in the Prior hardware. This limits the pattern to 8 lines in x directions and 8 lines in y direction. To allow more pattern lines the TTL action is repeated once by triggering trigger point 2 a second time.

 

  • No labels
Write a comment…