User Tools

Site Tools


leia_display_protocol

Leia Display Protocol

Overview

The electrical system of the Leia Display is currently (Thu 27 Apr 2017) as follows:

The components' details are as follows:

  • Red, Green, Blue lasers - These are analog-adjustable lasers that determine the particle's color. They require an external DAC to provide the analog signal. It's not expected for a person to perceive more than 256 different values for each channel.
  • Ultraviolet (UV) - This is the laser that is used to hold the particle. It is binary - either on or off.
  • Z Stage - This controls the position of the focusing lens. As of Thu 27 Apr 2017 it uses a PI Linear Stage, with input values ranging from -10,000 to 10,000 (minimum 15 bits).
  • X/Y Galvos - These are analog galvos controlled internally by 16-bit DACs.
  • Supply Servo - This is a simple servo that extends a tray of black liquor into the particle scan range for pickup. It's a binary operation - either in or out.

Summarizing, the maximum number of bits needed for these components are:

Component Max # Bits
Red Laser 8
Green Laser 8
Blue Laser 8
UV Laser 1
Z Stage 15
X Galvo 16
Y Galvo 16
Servo 1

Protocol

After some consideration of the capabilities and typical use of the Leia system, a proposal and explanation of the protocol is as follows. Eight main commands are provided to sufficiently address most uses. This results in a need for 3 bits for the command variable.

This protocol was inspired by the SVG file format.

Some commands can span a varying amount of bytes for different degrees of precision. This is determined by the ''SCALE'' variable, which is set with an "other" subcommand.

Commands are “received” from a host computer, processed by the microcontroller controlling the Leia system, which then “issues” updates to the lasers, galvos, translational stage, and servo.

Command i Shorthand Description # Bytes
0 XYZ xyz absolute move 7
1 x x relative move 1 to 2
2 y y relative move 1 to 2
3 z z relative move 1 to 2
4 xy xy relative move 2 to 3
5 xyz xyz relative move 2 to 4
6 color color of particle 1 to 4
7 other other commands 1 to 2

Descriptions of each of these commands are as follows:

Command 0 - XYZ absolute move

This is used to set the beginning of a draw path, at least after device initialization.

This directly sets the values going to the galvos and translational stage.

It is always 7 bytes long regardless of the SCALE value.

The Z stage is given an extra bit (16 total) for programmers' convenience.

Scale # Bytes # Bits per Argument Bitmap
all 7 16 [CCC00000|XXXXXXXX|XXXXXXXX|YYYYYYYY|YYYYYYYY|ZZZZZZZZ|ZZZZZZZZ]
Bits Desc
C The command bits. It will always read 000b = 0d here.
X The direct value for the X galvo (0 to 65,535).
Y The direct value for the Y galvo (0 to 65,535).
Z The signed value for the Z stage (-10,000 to 10,000).

Command 1 - X relative move

This makes a relative change to the current X galvo value.

Scale # Bytes # Bits per Argument Bitmap Range
0 1 5 [CCCxxxxx] -16 to 15
1 2 13 [CCCxxxxx|xxxxxxxx] -4096 to 4095
Bits Desc
C The command bits. It will always read 001b = 1d here.
x The signed delta value for the X galvo.

Command 2 - Y relative move

This makes a relative change to the current Y galvo value.

Scale # Bytes # Bits per Argument Bitmap Range
0 1 5 [CCCyyyyy] -16 to 15
1 2 13 [CCCyyyyy|yyyyyyyy] -4096 to 4095
Bits Desc
C The command bits. It will always read 010b = 2d here.
y The signed delta value for the Y galvo.

Command 3 - Z relative move

This makes a relative change to the current Z stage value.

Scale # Bytes # Bits per Argument Bitmap Range
0 1 5 [CCCzzzzz] -16 to 15
1 2 13 [CCCzzzzz|zzzzz] -4096 to 4095
Bits Desc
C The command bits. It will always read 011b = 3d here.
z The signed delta value for the Z stage.

Command 4 - XY relative move

This makes a simultaneous relative change to the X and Y galvos' current value.

Scale # Bytes # Bits per Argument Bitmap Range
0 2 6 [CCC0xxxx|xxyyyyyy] -32 to 32
1 3 10 [CCC0xxxx|xxxxxxyy|yyyyyyyy] -512 to 511
Bits Desc
C The command bits. It will always read 100b = 4d here.
x The signed delta value for the X galvo.
y The signed delta value for the Y galvo.

Command 5 - XYZ relative move

This makes a simultaneous relative change to the X and Y galvos' and Z stage's current value.

Scale # Bytes # Bits per Argument Bitmap Range
0 2 4 [CCC0xxxx|yyyyzzzz] -8 to 7
1 3 7 [CCCxxxxx|xxyyyyyy|yzzzzzzz] -64 to 63
2 4 9 [CCC00xxx|xxxxxxyy|yyyyyyyz|zzzzzzzz] -256 to 255
Bits Desc
C The command bits. It will always read 101b = 5d here.
x The signed delta value for the X galvo.
y The signed delta value for the Y galvo.
z The signed delta value for the Z stage.

Command 6 - Color

This command specifies the color of the particle.

If a color command is received after another color command, the last relative move command will be repeated before the new color command is issued.

Note that the analog output range is always between 0% and 100% and is not affected by the SCALE factor. IE, if there's 16 different values, they still result in a minimum (0) and maximum (15) output of 0% and 100% respectively.

Scale # Bytes # Bits per Argument Bitmap Range
0 1 1 [CCC00RGB] 0 to 1
1 2 4 [CCC0RRRR|GGGGBBBB] 0 to 15
2 3 7 [CCCRRRRR|RRGGGGGG|GBBBBBBB] 0 to 128
3 4 8 [CCC00000|RRRRRRRR|GGGGGGGG|BBBBBBBB] 0 to 255
Bits Desc
C The command bits. It will always read 110b = 6d here.
R The bits for the red channel.
G The bits for the green channel.
B The bits for the blue channel.

Command 7 - Other

These commands control other parts of the system.

Scale # Bytes # Bits per Argument Bitmap Range
any 1 5 [CCCccccc] 0 to 32
Bits Desc
C The command bits. It will always read 111b = 7d here.
c The subcommand number.
Subcommand Bitmap Action
0-3 [111000ss] Set SCALE to ss
4 [11100100] Turn UV laser OFF
5 [11100101] Turn UV laser ON
6 [11100110] Retract supply tray
7 [11100111] Extend supply tray
8-15 [11101ttt] Set STREAM to ttt
16 [11110000] Turn system supply* OFF
17 [11110001] Turn system supply* ON
31 [11111111] Self-Destruct

*System supply is the power going to the lasers, galvos, and translational stage, but not the microcontroller.

SCALE Variable

The SCALE variable is used to specify the number of bytes used for an argument command. There are, internal to the microcontroller, two different SCALE variables: one for position, one for color. When a Scale command is emitted, it does not change either of these two internal variables until either a position command is issued (in which case it changes the position scale variable) or a color command is issued (in which case it changes the color scale variable).

STREAM Variable

This specifies the rate at which position commands are issued to the hardware (the rate of issue events). The order of other commands is preserved, but they are issued in the same issue event as the previous position command. A stream value of 7 (111b) indicates 'issue immediately', as soon as they are received from the host computer. Otherwise, position update commands are issued at the following rate:

FIXME - explain what an issue event is

FIXME - talk about the [movement, color] command buffer

FIXME - these constants will probably have to be adjusted

f_pos_update = 16 * 2^STREAM (Hz)

A buffer is needed to store position and color commands until they are issued. If position change commands are issued while the buffer is full, the last entry in the buffer is modified to contain a summation of all the deltas of the lost relative move commands. An absolute move command replaces the last buffer entry.

The default value of STREAM on powerup is 0.

leia_display_protocol.txt · Last modified: 2017/06/13 15:09 by drhe0208