owl.instruments.X_LSM_E¶
- class owl.instruments.X_LSM_E(port=None, *, ftdi_serial_number=None, communication_adapter_serial_number=None, ensure_homed=True, stage_serial_number=None, connection_manager=None, controller_type='axis', controller_id=1, device=None, device_address=None, set_default_parameters=True, flip_axis=None, **kwargs)[source]¶
Bases:
objectZaber Miniature Motorized linear stage with encoder and controller.
Tested with the X-LSM-E series stages.
- Parameters:
communication_adapter_serial_number (str) – Serial number for the port on which to connect to for the motor.
port (str) – USB port on which to connect to for the motor.
stage_serial_number (str) – The serial number of the Zaber motor to connect to.
connection_manager (MotorConnectionManager) – The MotorConnectionManager which manages the connection this motor should use. The connection manager should currently be active and in use. This will override a supplied serial_number or port.
ensure_homed (bool) – If True, ensures that the stage is homed upon connection. Motors that have not been homed do not report an accurate position offset.
controller_type (str) – One of “lockstep” or “axis”. The type of controller to be used for this stage.
controller_id (int) – The id of the axis or lockstep group being used for this stage.
device (zaber_motion.ascii.Device) – An open device to be used with this stage. Using a pre-opened device may speed up the opening process
device_address (int) – Numerical order of the device on the connection. If provided, this can speed up opening the device.
Examples
>>> from owl.instruments import X_LSM_E >>> z_stage = X_LSM_E() >>> # Set the stage position to 3 mm >>> z_stage.position = 3E-3
- classmethod by_axis(axis, *args, connection_managers=None, **kwargs)[source]¶
Connect to an X_LSM_E stage by device axis.
- Parameters:
axis (str) – The axis direction of the stage. One of ‘z’, ‘x’, or ‘y’.
connection_managers (List[MotorConnectionManager] or List[FakeMotorConnectionManager]) – If the device may be on an open connection, the
MotorConnectionManagerobject(s) for the possible connection(s) must be provided.
- open(*)[source]¶
Open the device for communication.
This function is automatically called at the end of the object creation. It is mostly useful for users that need to manually close the device and reopen it later for communication.
- property homed¶
A property describing whether or not the stage has been homed.
Stages require homing every time they are power cycled.
- ensure_homed(wait_until_idle=True)[source]¶
Ensures that the stage has been homed.
Returns immediately if the stage is already homed.
- Parameters:
wait_until_idle (bool) – If True, the call will return immediately. If False, the caller must monitor the busy signal themselves to ensure the stage has stopped moving.
- wait_until_idle(*, sleep_time=0.01)[source]¶
Wait until the device is idle.
- Parameters:
sleep_time (float) – Amount of time to wait between polling the device.
- property busy¶
A property describing if the device is busy processing a command.
A device is typically busy when moving to a specified position or when homing.
See also
- set_position(value, *, wait=True, ignore_flip=False, anti_backlash=0.0, position_tolerance=1e-06)[source]¶
Set the device to a specified position.
- Parameters:
value (float) – Position to provide to the stage in meters.
wait (bool) – If True, the call will wait until the stage is idle before returning.
anti_backlash (float) –
The distance and direction in which to travel to avoid backlash. If the direction of the travel is already the same as that the stage is travelling is, there is be no backlash movement.
If the direction of travel is opposite to that of the anti-backlash a movement the size of the anti-backlash amount will be attempted.
This parameter will be ignored near the edges of the travel.
position_tolerance (float) – The tolerance in meters for the position to be considered reached. This is used when determining if anti_backlash is needed.
See also
- set_position_mm(value, *args, anti_backlash=0.0, **kwargs)[source]¶
Sets the position of the stage in millimeters.
See also
- property acceleration¶
Stage accelreation in meters per second squared.
- property position¶
Position of the stage in meters.
- property position_mm¶
Current position of the stage in millimeters.
- property maximum_speed¶
Maximum speed setpoint for the stage in meters per second.
- property stage_serial_number¶
The serial number of the stage as a string.
- property communication_adapter_serial_number¶
The serial number of the FTDI USB->Serial adapter for the stage.
- property firmware_version¶
Firmware version of the stage controller.
- move_sin(*, amplitude, frequency, duration=1, count=None)[source]¶
Move the stage in a sinusoidal fashion.
Examples
>>> from owl.instruments import X_LSM_E >>> stage = X_LSM_E() >>> stage.move_sin(amplitude=1E-6, frequency=300)
- stream_prepare_smoothed_vibration(*, amplitude, frequency, duration=1, stream_index=0, buffer_index=0, tqdm=None)[source]¶
Prepare a precisely control vibration motion on the stage.
The motion uses a Tukey Window to create a smooth transition from the resting position for the maximum amplitude.
The first and last 10 oscillations are appodized using a raised cosine to smoothly increase the amplitude of the motion from 0 to the desired amplitude.
Examples
>>> from owl.instruments import MCAM, X_LSM_E >>> from tqdm import tqdm
>>> stage = X_LSM_E.by_axis('z') >>> # Streams can be customized but each should be unique >>> # to a given buffer_index >>> stage.stream_prepare_smoothed_vibration( ... amplitude=1E-6, ... frequency=300, ... duration=1, ... buffer_index=1, ... tqdm=tqdm, ... )
>>> # The creation of streams can be a lengthy process >>> # A tqdm constructor can be used to show an indication of progress >>> stage.stream_prepare_smoothed_vibration( ... amplitude=1E-6, ... frequency=250, ... duration=2, ... buffer_index=0, ... tqdm=tqdm, ... )
>>> stage.stream_prepare_smoothed_vibration( ... amplitude=1E-6, ... frequency=350, ... duration=0.5, ... buffer_index=2, ... tqdm=tqdm, ... )
>>> # Stream can be played back in any order >>> print("250 Hz") >>> stage.stream_call(buffer_index=0) >>> print("350 Hz") >>> stage.stream_call(buffer_index=2) >>> print("300 Hz") >>> stage.stream_call(buffer_index=1)
>>> stage.close()
- Parameters:
amplitude (float) – In meters, the amplitude of the oscillations at maximum intensity. The peak to peak amplitude is twice this value. Typical values range between 0.25E-6 and 1E-6.
frequency (float) – In Hertz, the frequency of oscillation of the movement.
duration (float) – In seconds, the duration of the oscillation from start to finish (including the ramp up time from the window function).
stream_index (int) – The stream index to use for this movement. Typically this parameter is left at 0.
buffer_index (int) – The index where to store the motion in the device. Typical values range between 0 and 99 inclusively but the legal value can range from device to device.
- property stream_num_buffers¶
The number of allowable buffers used to define stream sequences.
- property stream_num_streams¶
The number of allowable streams.