TrackingActuator

class lsst.ts.simactuators.TrackingActuator(min_position: float, max_position: float, max_velocity: float, max_acceleration: float, dtmax_track: float, nsettle: int = 2, tai: Optional[float] = None, start_position: Optional[float] = None)

Bases: object

Simulate an actuator that slews to and tracks a path defined by regular calls to set_target.

Parameters:
min_positionfloat

Minimum allowed position

max_positionfloat

Maximum allowed position

max_velocityfloat

Maximum allowed velocity (position units/second)

max_accelerationfloat

Maximum allowed acceleration (position units/second^2)

dtmax_trackfloat

Maximum allowed time interval (tai - time of last segment) for set_target to compute a tracking path (second). If this limit is not met then set_target computes a slewing path. This should be larger than the maximum expected time between calls to set_target, but not much more than that.

nsettleint, optional

Number of calls to set_target after a slew finishes (meaning self.path.kind is tracking) before self.kind(tai) reports tracking instead of slewing.

taifloat, optional

TAI time for self.target and self.path (unix seconds, e.g. from lsst.ts.utils.current_tai()). If None then use current TAI. This is primarily for unit tests; None is usually what you want.

start_positionfloat or None

Initial position. If None use 0 if 0 is in range [min_position, max_position] else use min_position.

Raises:
ValueError

If min_position >= max_position, max_velocity <= 0, max_acceleration <= 0, start_position is not None and start_position < min_position, or start_position > max_position.

Notes

Attributes:

  • target: target set by set_target (a PathSegment).

  • path: actual actuator path (a Path).

Attributes Summary

path

Get or set the actuator path, a path.Path.

Methods Summary

abort([tai, position])

Stop motion immediately, with infinite acceleration.

kind([tai])

Kind of path at the specified time.

set_target(tai, position, velocity)

Set the target position, velocity and time.

stop([tai])

Stop the axis using maximum acceleration.

Attributes Documentation

path

Get or set the actuator path, a path.Path.

Methods Documentation

abort(tai: Optional[float] = None, position: Optional[float] = None) None

Stop motion immediately, with infinite acceleration.

Do not change the commanded position.

Parameters:
taifloat, optional

TAI time for self.target and self.path (unix seconds, e.g. from lsst.ts.utils.current_tai()). If None then use current TAI. This is primarily for unit tests; None is usually what you want.

positionfloat, optional

Position at which to stop (deg); if None then stop at position at time tai.

kind(tai: Optional[float] = None) Kind

Kind of path at the specified time.

Parameters:
taifloat, optional

TAI time at which to evaluate the kind of path (TAI unix seconds, e.g. from lsst.ts.utils.current_tai()). If None then use current TAI. Ignored unless stopping.

The result will always match ``self.path.kind`` except as follows:
- After a slew we report ``path.kind.Slewing`` until ``nsettle``

consecutive calls to set_target result in a path that is tracking.

- If self.path.kind is stopping and tai > start time of the

last segment, then the kind is reported as stopped.

set_target(tai: float, position: float, velocity: float) None

Set the target position, velocity and time.

The actuator will track, if possible, else slew to match the specified path.

Parameters:
taifloat

TAI time (unix seconds, e.g. from lsst.ts.utils.current_tai()).

positionfloat

Position (deg)

velocityfloat

Velocity (deg/sec)

Raises:
ValueError

If tai <= self.target.tai, where self.target.tai is the time of the previous call to set_target.

Notes

The actuator will track if the following is true:

  • tai - self.target.tai < self.dtmax_track where self.target.tai is the time of the previous call to set_target.

  • The tracking segment path obeys the position, velocity and acceleration limits.

stop(tai: Optional[float] = None) None

Stop the axis using maximum acceleration.

Update the commanded position to match the end point of the stop.

Parameters:
taifloat, optional

TAI time for self.target and self.path (unix seconds, e.g. from lsst.ts.utils.current_tai()). If None then use current TAI. This is primarily for unit tests; None is usually what you want.