Xlj Fast
xlj_fast
XLJ (X-ray Liquid Jet) fast motor control with interactive keyboard interface.
Provides real-time keyboard control for liquid jet positioning with support for translational (X, Y, Z) and rotational (RX, RY, RZ) axes.
Attributes
KEYS
module-attribute
KEYS = {'up': '\x1b[A', 'down': '\x1b[B', 'right': '\x1b[C', 'left': '\x1b[D', 'shift_up': '\x1b[1;2A', 'shift_down': '\x1b[1;2B', 'shift_right': '\x1b[1;2C', 'shift_left': '\x1b[1;2D', 'plus': '+', 'equal': '=', 'minus': '-', 'under': '_'}
Classes
BypassPositionCheck
Bases: PVPositionerDone
PV positioner with position check bypass for fast movements.
Extends PVPositionerDone to skip position verification, allowing faster continuous motion for interactive control.
Components
setpoint : EpicsSignal Target position PV actuate : EpicsSignal Move command trigger
Notes
Bypassing Position Check: - Standard positioners wait for position reached - Interactive control needs immediate response - This class starts move and returns immediately - Position tracking happens asynchronously
Use Cases: - Interactive jogging - Continuous motion - Fast scanning - Real-time adjustments
Warnings
- No verification that position reached
- Responsibility on user to monitor
- Not suitable for precision positioning
Examples:
XLJController
XLJController(motors: List, orientation: str = 'horizontal', scale: float = 0.1, mode: str = 'translation')
Interactive keyboard controller for XLJ motors.
Provides real-time keyboard-based control with visual feedback and configurable step sizes.
Attributes:
| Name | Type | Description |
|---|---|---|
motors |
List
|
List of motor objects to control |
orientation |
str
|
Camera view orientation: 'horizontal' or 'vertical' |
scale |
float
|
Current step size for movements |
mode |
str
|
Control mode: 'translation', 'rotation', or '6axis' |
xlj |
BeckhoffJet
|
Full XLJ device for status monitoring |
Methods:
| Name | Description |
|---|---|
run |
Start interactive control loop |
print_help |
Display control instructions |
process_key |
Handle keyboard input |
update_scale |
Adjust step size |
Notes
Control Modes:
Translation (X, Y, Z): - Arrow keys: Move X and Y - Shift+Up/Down: Move Z - Direct spatial control - Units: mm
Rotation (RX, RY, RZ): - Arrow keys: Rotate RX and RY - Shift+Up/Down: Rotate RZ - Angular adjustments - Units: degrees
6-Axis (X, Y, Z, RX, RY, RZ): - Arrow keys: Move X and Y - Shift+Up/Down: Move Z - W/S: Rotate RY (horizontal) or RX (vertical) - A/D: Rotate RX (horizontal) or RY (vertical) - Shift+W/S: Rotate RZ - Full control of all DOF
Orientation: - Horizontal: Standard camera view - Vertical: 90° rotated camera - Affects arrow key mapping - Matches visual feedback
Step Size Control: - +/=: Double current step - -/_: Halve current step - Shift+Right: Double step - Shift+Left: Halve step - Dynamic adjustment during use
Visual Feedback: - Current positions displayed - Step size shown - Motor names labeled - Updates after each move
Examples:
Create controller:
>>> from xlj_fast import XLJController
>>> motors = [xlj_x, xlj_y, xlj_z]
>>> ctrl = XLJController(motors, 'horizontal', 0.1, 'translation')
>>> ctrl.run()
See Also
xlj_fast : Translation control function xlj_fast_rot : Rotation control function xlj_6axis : Full 6-axis control function
Initialize XLJ controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
motors
|
List
|
Motor objects to control |
required |
orientation
|
str
|
Camera orientation. Default is 'horizontal'. |
'horizontal'
|
scale
|
float
|
Initial step size. Default is 0.1. |
0.1
|
mode
|
str
|
Control mode. Default is 'translation'. |
'translation'
|
Source code in mfx/xlj_fast.py
Attributes
Functions
execute_move
Execute relative motor move.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
motor
|
Motor object to move |
required | |
direction
|
int
|
Direction multiplier: +1 or -1 |
required |
Source code in mfx/xlj_fast.py
print_help
Display control instructions.
Source code in mfx/xlj_fast.py
print_status
Display current motor positions and step size.
Source code in mfx/xlj_fast.py
run
Run interactive control loop.
Captures keyboard input and controls motors until user quits with 'q'.
Source code in mfx/xlj_fast.py
update_scale
Update step size by multiplication factor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
factor
|
float
|
Multiplication factor (e.g., 2.0 to double, 0.5 to halve) |
required |
Source code in mfx/xlj_fast.py
Functions
xlj_6axis
Interactive XLJ 6-axis control (X, Y, Z, RX, RY, RZ).
Provides complete keyboard-based control for all liquid jet degrees of freedom.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
str
|
Camera view. Default is 'horizontal'. |
'horizontal'
|
scale
|
float
|
Initial step size (mm for translation, deg for rotation). Default is 0.1. |
0.1
|
Returns:
| Type | Description |
|---|---|
None
|
|
Notes
Controls: - Arrow keys: Move X and Y - Shift+↑ ↓ : Move Z - W/S: Rotate RY (horizontal) or RX (vertical) - A/D: Rotate RX (horizontal) or RY (vertical) - Shift+W/S: Rotate RZ - ± : Adjust step size - h : Help - q : Quit
Examples:
See Also
xlj_fast : Translation only xlj_fast_rot : Rotation only
Source code in mfx/xlj_fast.py
xlj_fast
Interactive XLJ translation control (X, Y, Z).
Provides keyboard-based control for liquid jet X, Y, and Z positioning.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
str
|
Camera view: 'horizontal' or 'vertical'. Default is 'horizontal'. |
'horizontal'
|
scale
|
float
|
Initial step size in mm. Default is 0.1. |
0.1
|
Returns:
| Type | Description |
|---|---|
None
|
|
Notes
Controls: - Arrow keys: Move X and Y - Shift+↑ ↓ : Move Z upstream/downstream - ± : Adjust step size - h : Help - q : Quit
Examples:
See Also
xlj_fast_rot : Rotation control xlj_6axis : Full 6-axis control
Source code in mfx/xlj_fast.py
xlj_fast_rot
Interactive XLJ rotation control (RX, RY, RZ).
Provides keyboard-based control for liquid jet rotation axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
str
|
Camera view. Default is 'horizontal'. |
'horizontal'
|
scale
|
float
|
Initial step size in degrees. Default is 0.1. |
0.1
|
Returns:
| Type | Description |
|---|---|
None
|
|
Notes
Controls: - Arrow keys: Rotate RX and RY - Shift+↑ ↓ : Rotate RZ - ± : Adjust step size - h : Help - q : Quit
Examples:
See Also
xlj_fast : Translation control xlj_6axis : Full 6-axis control