Offset Mirrors

OffsetMirror

class pcdsdevices.epics.OffsetMirror(prefix, prefix_xy, *, name=None, read_attrs=None, parent=None, configuration_attrs=None, settle_time=0, tolerance=0.5, timeout=None, nominal_position=None, **kwargs)

X-Ray offset mirror class for each individual mirror system used in the FEE and XRT. Controls for the pitch, and primary gantry x and y motors are included.

When controlling the pitch motor, if the piezo is set to ‘PID’ mode, then the pitch mechanism is setup to first move the stepper as close to the desired position, then the piezo will kick in to constantly try and correct any positional changes. When in this mode the piezo cannot be controlled via EPICS, and must first be switched to ‘manual’ mode.

Note: Interfaces to the coupling motor and both secondary gantry motors are not provided.

Parameters:
  • prefix (str) – The EPICS base PV of the pitch motor
  • prefix_xy (str) – The EPICS base PV of the gantry x and y gantry motors
  • read_attrs (sequence of attribute names, optional) – The signals to be read during data acquisition (i.e., in read() and describe() calls)
  • configuration_attrs (sequence of attribute names, optional) – The signals to be returned when asked for the motor configuration (i.e. in read_configuration(), and describe_configuration() calls)
  • name (str, optional) – The name of the offset mirror
  • parent (instance or None, optional) – The instance of the parent device, if applicable
  • settle_time (float, optional) – The amount of time to wait after the pitch motor moves to report status completion
  • tolerance (float, optional) – Tolerance used to judge if the pitch motor has reached its final position
alpha

Pitch motor readback position. Alias for the position property.

Returns:alpha
Return type:float
gan_x_p

FormattedComponent attribute

FormattedComponent(OMMotor, '{self._prefix_xy}:X:P')
gan_y_p

FormattedComponent attribute

FormattedComponent(OMMotor, '{self._prefix_xy}:Y:P')
high_limit

Returns the upper limit fot the pitch motor.

Returns:high_limit
Return type:float
limits

Returns the EPICS limits of the user_setpoint pv.

Returns:limits
Return type:tuple
low_limit

Returns the lower limit fot the pitch motor.

Returns:low_limit
Return type:float
motor_stop

Component attribute

Component(Signal, value=0)
move(position, wait=False, **kwargs)

Move the pitch motor to the inputted position, optionally waiting for the move to complete.

Parameters:
  • position (float) – Position to move to
  • wait (bool, optional) – Wait for the status object to complete the move before returning
  • moved_cb (callable, optional) – Call this callback when movement has finished. This callback must accept one keyword argument: ‘obj’ which will be set to this positioner instance
  • timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used
Returns:

status – Status object of the move

Return type:

MoveStatus

Raises:
  • TimeoutError – When motion takes longer than timeout
  • ValueError – On invalid positions
  • RuntimeError – If motion fails other than timing out
mv(position, wait=False, **kwargs)

Move the pitch motor to the inputted position, optionally waiting for the move to complete.

Parameters:
  • position (float) – Position to move to
  • wait (bool, optional) – Wait for the status object to complete the move before returning
  • moved_cb (callable, optional) – Call this callback when movement has finished. This callback must accept one keyword argument: ‘obj’ which will be set to this positioner instance
  • timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used
Returns:

status – Status object of the move

Return type:

MoveStatus

Raises:
  • TimeoutError – When motion takes longer than timeout
  • ValueError – On invalid positions
  • RuntimeError – If motion fails other than timing out
pitch

FormattedComponent attribute

FormattedComponent(OMMotor, '{self.prefix}')
position

Readback the current pitch position. Alias for the pitch.position property.

Returns:position
Return type:float
settle_time

Returns the settle time of the pitch motor.

Returns:settle_time
Return type:float
tolerance

Returns the tolerance of the pitch motor.

Returns:settle_time
Return type:float
x

Primary gantry X readback position. Alias for the gan_x_p.position property.

Returns:position
Return type:float
y

Primary gantry Y readback position. Alias for the gan_y_p.position property.

Returns:position
Return type:float

Major Components

class pcdsdevices.epics.mirror.Piezo(prefix, *, read_attrs=None, configuration_attrs=None, name=None, parent=None, **kwargs)

Class to handle the piezo motor on the mirror pitch mechanism.

Note: If the motor is set to ‘PID’ mode then none of the PVs will be controllable.

Parameters:
  • prefix (str) – The EPICS base pv to use
  • read_attrs (sequence of attribute names, optional) – The signals to be read during data acquisition (i.e., in read() and describe() calls)
  • configuration_attrs (sequence of attribute names, optional) – The signals to be returned when asked for the motor configuration (i.e. in read_configuration(), and describe_configuration() calls)
  • name (str, optional) – The name of the piezo
  • parent (instance or None, optional) – The instance of the parent device, if applicable
check_value(pos)

Check that the position is within the soft limits.

Raises:ValueError – On invalid positions, or outside the limits
enable

Component attribute

Component(EpicsSignalRO, ':Enable')
high_limit

Component attribute

Component(EpicsSignal, ':VMAX')
limits

Returns the minimum and maximum voltage of the piezo.

Returns:limits – Tuple of (low_limit, high_limit)
Return type:tuple
low_limit

Component attribute

Component(EpicsSignal, ':VMIN')
motor_stop

Component attribute

Component(Signal, value=0)
move(position, wait=False, **kwargs)

Move to a specified position, optionally waiting for motion to complete.

Note: This will only work if the motor is in ‘manual’ mode.

Parameters:
  • position (float) – Position to move to
  • wait (bool, optional) – Wait for the status object to complete the move before returning
  • moved_cb (callable, optional) – Call this callback when movement has finished. This callback must accept one keyword argument: ‘obj’ which will be set to this positioner instance
  • timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used
Returns:

status – Status object of the move

Return type:

MoveStatus

Raises:
  • TimeoutError – When motion takes longer than timeout
  • ValueError – On invalid positions
  • RuntimeError – If motion fails other than timing out
mv(position, wait=False, **kwargs)

Alias for the move() method.

Returns:status – Status object of the move
Return type:MoveStatus
position

The current position of the motor in its engineering units.

Returns:position
Return type:float
precision

The precision of the readback PV, as reported by EPICS.

Returns:precision
Return type:int
report

Returns a dictionary containing current report values of the motor.

Returns:rep
Return type:dict
set_current_position(pos)

Configure the motor user position to the given value.

Parameters:pos – Position to set.
user_readback

Component attribute

Component(EpicsSignalRO, ':VRBV')
user_setpoint

Component attribute

Component(EpicsSignal, ':VSET', limits=True)
class pcdsdevices.epics.mirror.OMMotor(prefix, *, read_attrs=None, configuration_attrs=None, name=None, parent=None, settle_time=0, tolerance=0.01, use_limits=True, nominal_position=None, **kwargs)

Base class for each motor in the LCLS offset mirror system.

Parameters:
  • prefix (str) – The EPICS base pv to use
  • read_attrs (sequence of attribute names, optional) – The signals to be read during data acquisition (i.e., in read() and describe() calls)
  • configuration_attrs (sequence of attribute names, optional) – The signals to be returned when asked for the motor configuration (i.e. in read_configuration(), and describe_configuration() calls)
  • name (str, optional) – The name of the motor
  • nominal_position (float, optional) – The position believed to be aligned to the beam. This can either be the previously aligned position, or the position given by the alignment team
  • parent (instance or None, optional) – The instance of the parent device, if applicable
  • settle_time (float, optional) – The amount of time to wait after moves to report status completion
  • tolerance (float, optional) – Tolerance used to judge if the motor has reached its final position
check_value(pos)

Check that the position is within the soft limits.

Raises:ValueError – On invalid positions, or outside the limits
egu

Engineering units of the readback PV, as reported by EPICS.

Returns:egu
Return type:str
enabled

Component attribute

Component(EpicsSignalRO, ':ENABLED')
high_limit

Returns the upper limit fot the user setpoint.

Returns:high_limit
Return type:float
high_limit_switch

Component attribute

Component(EpicsSignal, ':HLS')
interlock

Component attribute

Component(EpicsSignalRO, ':INTERLOCK')
limits

Returns the limits of the motor.

Returns:limits
Return type:tuple
low_limit

Returns the lower limit fot the user setpoint.

Returns:low_limit
Return type:float
low_limit_switch

Component attribute

Component(EpicsSignal, ':LLS')
lower_ctrl_limit

Component attribute

Component(EpicsSignal, ':VAL.DRVL')
motor_done_move

Component attribute

Component(EpicsSignalRO, ':DMOV', auto_monitor=True)
motor_egu

Component attribute

Component(EpicsSignalRO, ':RBV.EGU')
motor_is_moving

Component attribute

Component(EpicsSignalRO, ':MOVN')
motor_stop

Component attribute

Component(Signal, value=0)
move(position, wait=False, **kwargs)

Move to a specified position, optionally waiting for motion to complete.

Parameters:
  • position (float) – Position to move to
  • wait (bool, optional) – Wait for the status object to complete the move before returning
  • moved_cb (callable, optional) – Call this callback when movement has finished. This callback must accept one keyword argument: ‘obj’ which will be set to this positioner instance
  • timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used
Returns:

status – Status object of the move

Return type:

MoveStatus

Raises:
  • TimeoutError – When motion takes longer than timeout
  • ValueError – On invalid positions
  • RuntimeError – If motion fails other than timing out
moving

Whether or not the motor is moving.

Returns:moving
Return type:bool
mv(position, wait=False, **kwargs)

Alias for the move() method.

Returns:status – Status object of the move
Return type:MoveStatus
position

The current position of the motor in its engineering units.

Returns:position
Return type:float
precision

The precision of the readback PV, as reported by EPICS.

Returns:precision
Return type:int
report

Returns a dictionary containing current report values of the motor.

Returns:rep
Return type:dict
set_current_position(pos)

Configure the motor user position to the given value.

Parameters:pos (float) –
upper_ctrl_limit

Component attribute

Component(EpicsSignal, ':VAL.DRVH')
user_readback

Component attribute

Component(EpicsSignalRO, ':RBV', auto_monitor=True)
user_setpoint

Component attribute

Component(EpicsSignal, ':VAL', limits=True)
velocity

Component attribute

Component(EpicsSignal, ':VELO')