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_position
float
Minimum allowed position
- max_position
float
Maximum allowed position
- max_velocity
float
Maximum allowed velocity (position units/second)
- max_acceleration
float
Maximum allowed acceleration (position units/second^2)
- dtmax_track
float
Maximum allowed time interval (tai - time of last segment) for
set_target
to compute a tracking path (second). If this limit is not met thenset_target
computes a slewing path. This should be larger than the maximum expected time between calls toset_target
, but not much more than that.- nsettle
int
, optional Number of calls to
set_target
after a slew finishes (meaningself.path.kind
is tracking) beforeself.kind(tai)
reports tracking instead of slewing.- tai
float
, optional TAI time for
self.target
andself.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_position
float
orNone
Initial position. If
None
use 0 if 0 is in range[min_position, max_position]
else usemin_position
.
- 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 byset_target
(aPathSegment
).path
: actual actuator path (aPath
).
Attributes Summary
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
- tai
float
, optional TAI time for
self.target
andself.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.- position
float
, optional Position at which to stop (deg); if
None
then stop at position at timetai
.
- tai
- kind(tai: Optional[float] = None) Kind ¶
Kind of path at the specified time.
- Parameters
- tai
float
, 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.
- tai
- 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
- Raises
- ValueError
If
tai <= self.target.tai
, whereself.target.tai
is the time of the previous call toset_target
.
Notes
The actuator will track if the following is true:
tai - self.target.tai < self.dtmax_track
whereself.target.tai
is the time of the previous call toset_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
- tai
float
, optional TAI time for
self.target
andself.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.
- tai