sequencer
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sequencer [2016/05/18 15:54] – [Incorporating XY Stage Positions] vik | sequencer [2024/11/26 18:31] (current) – make warning bold brandon | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== SEQUENCER MODULE ====== | ||
| + | <WRAP center round important 60%> | ||
| + | **WARNING: | ||
| + | The [[tiger_programmable_logic_card|Tiger Programmable Logic Card]] can replace most of the functionality. | ||
| + | </ | ||
| + | |||
| + | ===== Overview ===== | ||
| + | Old documentation that you can download in PDF form: \\ | ||
| + | [[legacy|ASI MS2000 SEQUENCER MODULE]] | ||
| + | |||
| + | The SEQUENCER module consists of several hardware signal outputs, both TTL signals (TTL#) and Analog Voltage Outputs (AVO# | ||
| + | |||
| + | ===== Conditions ===== | ||
| + | |||
| + | Condition codes connect events with logical progressions of the BLOCKS and OUTPUTS. | ||
| + | |||
| + | ^CONDITION | ||
| + | |NEVER |0 |* |* |* |* |* |* | | ||
| + | |TTL_TRIGGER_RECEIVED |1 |* |* |* |* |* |*| | ||
| + | |ARM_COMMAND_RCVD |2 |* |* |* |* |* |*| | ||
| + | |AT_BUTTON_PRESSED |3 |* |* |* |* |* |*| | ||
| + | |XYZ_STAGE_NOT_BUSY |4 |* |* |* |* |* |*| | ||
| + | |BLOCK_# | ||
| + | |BLOCK_# | ||
| + | |BLOCK_# | ||
| + | |BLOCK_# | ||
| + | |BLOCK_# | ||
| + | |BLOCK_# | ||
| + | |BLOCK_# | ||
| + | |ALWAYS |12 |* |* |NA |NA |NA |NA| | ||
| + | |ARRAY_MOVE_DONE | ||
| + | |||
| + | Unused BLOCKS and OUTPUTS are set up by default with all codes set to NEVER . | ||
| + | |||
| + | The condition codes number 5 through 11 refer to the state change of a particular block. | ||
| + | |||
| + | ===== Actions ===== | ||
| + | |||
| + | Action codes connect BLOCK completion with MS-2000 controller actions. | ||
| + | |||
| + | ^Description ^Firmware Module Used ^Code ^BLK END ^^ | ||
| + | |ACTION_IDLE |none |0 |* || | ||
| + | |ACTION_RING_BUFFER_NEXT_POSITION |RING_BUFFER |1 |*|| | ||
| + | |ACTION_INITIATE_AUTOFOCUS |AFOCUS |2 |* || | ||
| + | |ACTION_ARRAY_NEXT_POSITION |ARRAY_MODULE |3 |*|| | ||
| + | |ACTION_ARRAY_START |ARRAY_MODULE |4 |*|| | ||
| + | |ACTION_SEND _WHERE |none |5 |*|| | ||
| + | |ACTION_SEND_TIMESTAMP* |none |6 |*|| | ||
| + | |ACTION_SEND_STATESTAMP* |none |7 |*|| | ||
| + | *Presently not Implemented | ||
| + | |||
| + | **Actions** let the sequencer direct certain MS2000 controller functions. | ||
| + | |||
| + | |||
| + | ===== BLOCKS ===== | ||
| + | |||
| + | The BLOCK state logic structure is shown in the illustration below. | ||
| + | |||
| + | [{{ sequencer_flowchart.png? | ||
| + | |||
| + | BLOCKs are defined with the BLK command with syntax and parameter values: | ||
| + | Both delay times and repetitions are handled with the block logic. | ||
| + | |||
| + | Repetitions are processed before the delays are timed out. | ||
| + | |||
| + | BLOCKS without repetitions programmed can be used as delay generators. | ||
| + | |||
| + | BLOCKS without delays programmed can be used looping counters. | ||
| + | |||
| + | BLOCKS with both delays and repetitions can be used as timed sequence generators. | ||
| + | |||
| + | ===== BLOCK SEQUENCING ===== | ||
| + | |||
| + | The transitions points in the BLOCK sequence progression can be used as conditions to start, repeat, stop, step, or reset other sequencer components. | ||
| + | |||
| + | [{{ basic_block_sequence_execution.png? | ||
| + | |||
| + | Transition states in one block can be used to place another block in a transition state. | ||
| + | |||
| + | ===== INTERACTIVE CONTROL ===== | ||
| + | |||
| + | |||
| + | The SEQUENCER is programmed via the serial RS232 or USB port on the controller using the commands described in the sections below. | ||
| + | |||
| + | Systems that include the '' | ||
| + | |||
| + | |||
| + | ===== BLK (BLOCK) command syntax ===== | ||
| + | |||
| + | |||
| + | Blocks are defined with BLK keyword followed immediately by the integer block number. | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | ^ Comma delimited parameter list: ^^ | ||
| + | ^START |BLK START condition code. | | ||
| + | ^Start Block # | ||
| + | ^Rep # | ||
| + | ^REPEAT |BLK REPEAT condition code. | | ||
| + | ^Repeat Block # | ||
| + | ^# of repetitions |any integer < | ||
| + | ^Delay time |in milliseconds, | ||
| + | ^END |BLK END action code. | | ||
| + | |||
| + | BLOCKS with repeats must include both a valid BLK REPEAT condition code and a non-zero number of repetitions. | ||
| + | |||
| + | ==== EXAMPLES: ==== | ||
| + | | ||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | |||
| + | ===== TTL (TTL_OUTPUT) command syntax ===== | ||
| + | |||
| + | TTL outputs are defined with TTL keyword followed immediately by the integer output number. | ||
| + | |||
| + | '' | ||
| + | '' | ||
| + | |||
| + | ^ Comma delimited parameter list: ^^ | ||
| + | ^START |TTL START condition code. | | ||
| + | ^Start Block # | ||
| + | ^Rep # | ||
| + | ^STOP |TTL STOP condition code. | | ||
| + | ^Stop Block # | ||
| + | ^Pulse Width |output pulse width in milliseconds (<64k); \\ zero will cause the output toggle rather than time a pulse. | ||
| + | ^Polarity |1 for normally low positive pulse; \\ -1 for normally high low-going pulse| | ||
| + | |||
| + | When no STOP condition is supplied, the Pulse Width parameter determines the duration of the output pulse. | ||
| + | |||
| + | ==== EXAMPLES: ==== | ||
| + | | ||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | ===== AVO (ANALOG_VOLTAGE_OUT) command syntax ===== | ||
| + | |||
| + | |||
| + | Analog voltage outputs are defined with AVO keyword followed immediately by the integer output number. | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | ^ Comma delimited parameter list: ^^ | ||
| + | ^STEP |AVO STEP condition code. | | ||
| + | ^Step Block # | ||
| + | ^Rep # | ||
| + | ^RESET |AVO RESET condition code | | ||
| + | ^Reset Block # | ||
| + | ^V0 |Start Waveform voltage in millivolts (< | ||
| + | ^dV |Step size in millivolts (-10000 to 10000) | ||
| + | |||
| + | The AVO channels supply 0 to 10V DC and are controlled with a 12 bit DAC on the microprocessor. | ||
| + | |||
| + | ==== EXAMPLES: | ||
| + | |||
| + | '' | ||
| + | Analog Output 1 steps each time Block1 repeats. | ||
| + | |||
| + | ===== STG (STAGE) command syntax ===== | ||
| + | |||
| + | Incremental stage movements are defined with STG keyword followed immediately by the integer axis index. | ||
| + | The STG command has the same parameter list as the AVO command. | ||
| + | |||
| + | '' | ||
| + | '' | ||
| + | |||
| + | ^ Comma delimited parameter list: ^^ | ||
| + | ^STEP |STG STEP condition code. | | ||
| + | ^Step Block # | ||
| + | ^Rep # | ||
| + | ^RESET |STG RESET condition code | | ||
| + | ^Reset Block # | ||
| + | ^P0 |Start position (units are 0.1µm)* | ||
| + | ^dP |Step size (units are 0.1µm) | ||
| + | |||
| + | Stage channels can be either motorized stage axes or the DAC-controlled piezo axis. | ||
| + | |||
| + | *If a Start Position is not specified or is 0.0, the RESET condition will move the stage back to the original position before the first step was commanded. | ||
| + | |||
| + | ==== EXAMPLES: ==== | ||
| + | | ||
| + | '' | ||
| + | |||
| + | |||
| + | ===== LST (LIST) command syntax ===== | ||
| + | |||
| + | The LST function adds flexibility to the other commands. | ||
| + | '' | ||
| + | '' | ||
| + | |||
| + | ^ Comma delimited parameter list: ^^ | ||
| + | ^STEP |STG STEP condition code. | | ||
| + | ^Step Block # | ||
| + | ^VAR |Variable Code – see table. | ||
| + | ^m |number of values. Must be no more than 10. | | ||
| + | ^Value_1 |first value, | ||
| + | ^Value_2 |second value, | ||
| + | ^Etc… | ||
| + | |||
| + | The LST command will set the AVO voltage when the step happens. | ||
| + | |||
| + | LISTS can be defined for the variables defined in the table below. | ||
| + | |||
| + | ^VAR code ^Variable ^ | ||
| + | ^0 |None | ||
| + | ^1 |AVO1 Output Voltage | | ||
| + | ^2 |AVO2 Output Voltage | | ||
| + | ^3 |BLK1 Delay Time | | ||
| + | ^4 |BLK2 Delay Time | | ||
| + | ^5 |BLK3 Delay Time | | ||
| + | ^6 |BLK4 Delay Time | | ||
| + | ^7 |BLK5 Delay Time | | ||
| + | ^8 |BLK6 Delay Time | | ||
| + | |||
| + | (This table might expand as necessary.) | ||
| + | |||
| + | ==== EXAMPLES: | ||
| + | |||
| + | '' | ||
| + | |||
| + | ===== Auxiliary Commands ===== | ||
| + | |||
| + | In addition to the commands that set up BLOCKS, OUTPUTS, and STAGE moves, there are several | ||
| + | |||
| + | ARM, SAVESET, and TTL. | ||
| + | |||
| + | ====== Command:ARM ====== | ||
| + | |||
| + | ^Shortcut | ||
| + | ^Format | ||
| + | ^Remembered |Using SS Z | | ||
| + | |||
| + | Without arguments, this command establishes the **ARM_COMMAND_RCVD** event. | ||
| + | |||
| + | **ARM X** re-initializes the SEQUENCER. | ||
| + | |||
| + | **ARM Y=1** turns on or ARM Y=0 turns off the serial log file creation. | ||
| + | |||
| + | **ARM Z** forces a “sequence stop” condition. | ||
| + | ===== End of Block Actions to control MS2000 functions ===== | ||
| + | |||
| + | When the '' | ||
| + | |||
| + | If hardware video '' | ||
| + | |||
| + | Time and stage position information can be requested using '' | ||
| + | |||
| + | ===== Programming Tasks ===== | ||
| + | |||
| + | There are several ways to accomplish sequencing of repetitive tasks. | ||
| + | ==== Simple Tasks ==== | ||
| + | |||
| + | === Go-forever timing block: === | ||
| + | |||
| + | '' | ||
| + | |||
| + | === Continuous Pulse Generator: === | ||
| + | |||
| + | '' | ||
| + | |||
| + | === Go-once timing block: === | ||
| + | |||
| + | '' | ||
| + | |||
| + | === Single Pulse Generator: === | ||
| + | |||
| + | '' | ||
| + | |||
| + | |||
| + | |||
| + | ===== Sequencer Timing as Master ===== | ||
| + | |||
| + | In this example, the sequencer will command camera acquisitions, | ||
| + | |||
| + | Let us assume we have a camera that requires 40ms to expose an image and read out the data, and that the camera can be triggered with an external signal. | ||
| + | |||
| + | We will set up a BLOCK that will loop 10 times with a fixed delay to allow time for the camera to take an image and transfer data. | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | These settings will generate the camera trigger just as the stage is commanded to move to a new position. | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | Now let’s add a block to control a wavelength switcher. | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | Even though BLK3 only has 2 repetitions, | ||
| + | |||
| + | [{{ seq_timing.png? | ||
| + | |||
| + | |||
| + | ===== Camera as Master ===== | ||
| + | |||
| + | In the previous example, the sequencer provided all of the delay intervals and timing information for all of the tasks. | ||
| + | |||
| + | '' | ||
| + | Start on BLK3 as before, repeat on TTL Trigger, 10 repetitions. | ||
| + | |||
| + | We need to change the stage step condition (since we no longer have the delay) to the Repeat: | ||
| + | |||
| + | '' | ||
| + | Let’s change TTL1 to monitor when we get the external trigger. | ||
| + | |||
| + | '' | ||
| + | Send 10ms pulse when BLK1 repeats | ||
| + | |||
| + | Perhaps we need to send a TTL enable signal to the camera to start it taking pictures. | ||
| + | TTL3 8, | ||
| + | |||
| + | [{{ seq_timing2.png? | ||
| + | |||
| + | ===== Incorporating XY Stage Positions ===== | ||
| + | |||
| + | Simple XY moves can be programmed using the STGn sequencer command, but considerably more XY control is possible by including the ARRAY_MODULE firmware package. | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | [{{ seq_timing3.png? | ||
| + | |||
| + | To start this sequence, the master timing loop is waiting for the ARRAY_MOVE_DONE condition. | ||
| + | |||
| + | ===== Debugging Sequence Programming ===== | ||
| + | |||
| + | |||
| + | As with any flexible programming system, it is easy to generate programs that don’t do what you think they should. | ||
| + | |||
| + | '' | ||
| + | |||
| + | The states for the BLOCKS are listed in order of block number from left to right. | ||
| + | |||
| + | ^ BLK and TTL State Codes^^ | ||
| + | ^Code ^State Description ^ | ||
| + | |I |IDLE | ||
| + | |R |WAITING_FOR_REPEAT_CONDITION | ||
| + | |D |WAITING_FOR_DELAY_TIMEOUT | ||
| + | |s |START – transient state | | ||
| + | |r |REPEAT – transient state | | ||
| + | |c |COMPLETE – transient state | | ||
| + | |A |TTL Active | ||
| + | |T |TTL – timing output pulse | | ||
| + | |||
| + | Using this display you can determine if blocks are hung up or not performing as desired. | ||
| + | |||
| + | ===== Sequence Log ===== | ||
| + | |||
| + | A log of sequence events can be turned on using the serial command **ARM Y=1**. | ||
| + | |||
| + | <asi> T: 40274 EXT | ||
| + | T: 40285 AT PRESS | ||
| + | T: 0 BLK 1 START | ||
| + | T: 0 BLK 2 START | ||
| + | T: 0 TTL 1 START | ||
| + | T: 480 EXT | ||
| + | T: 480 BLK 1 REPET | ||
| + | T: 480 TTL 2 START | ||
| + | T: 971 EXT | ||
| + | T: 971 BLK 1 REPET | ||
| + | T: 971 TTL 2 START | ||
| + | T: 1462 EXT | ||
| + | T: 1463 BLK 1 REPET | ||
| + | T: 1463 TTL 2 START | ||
| + | T: 1953 EXT | ||
| + | T: 1954 BLK 1 REPET | ||
| + | T: 1954 TTL 2 START | ||
| + | |||
| + | Most external events, block START and REPEAT events, and TTL START events are given entries in the log. You will note that several events can happen at a single time step. In the sample log, when the **@** button was pressed, the time stamp was reset to zero. BLOCKS 1 and 2 were started, as was the TTL1 pulse. | ||
| + | |||
| + | <WRAP center round important 60%> | ||
| + | **WARNING: | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Troubleshooting Techniques ===== | ||
| + | |||
| + | * Build simple test examples. | ||
| + | * Set up TTL outputs that you can monitor on an oscilloscope. If you don’t have an oscilloscope, | ||
| + | * Slow everything down and use the log file. | ||
| + | * Substitute the @ Button Press for External Trigger conditions so you can step through your sequence. | ||
| + | |||
| + | ===== Sequencer Timing Performance ===== | ||
| + | |||
| + | The SEQUENCER module shares the MS2000' | ||
| + | |||
| + | {{tag> | ||
Address: 29391 W Enid Rd. Eugene, OR 97402, USA | Phone: +1 (541) 461-8181
