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
ensure_synced_before_move
OG behavior: compare jet readback to fast motor readback. If mismatch, log error and resync motor to jet position.
Source code in mfx/xlj_fast.py
execute_move
Execute a relative move for the motor identified by axis
(x,y,z,rx,ry,rz) with OG-style X/Y/Z sync check + resync.
Source code in mfx/xlj_fast.py
format_status_line
Source code in mfx/xlj_fast.py
print_help
Display control instructions.
Source code in mfx/xlj_fast.py
print_status_line
run
Interactive control loop with OG-style one-line status output. - Status line updates in-place using ESC[2K + \r - Press 'h' prints the full help (your print_help) and returns to status line - Unknown keys print help (like OG)
Source code in mfx/xlj_fast.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 | |
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