M1M3 Support System
|
Controls M1M3 position. More...
#include <PositionController.h>
Public Member Functions | |
int | getRaiseTimeout () |
Returns raise and lower timeout. | |
int | getLowerTimeout () |
bool | enableChaseAll () |
void | disableChaseAll () |
void | startRaise () |
void | startLower () |
bool | hpRaiseLowerForcesInTolerance (bool raise) |
Checks that hardpoint forces are in tolerance for mirror raising and lowering. | |
bool | motionComplete () |
bool | moveHardpoint (int32_t steps, int hpIndex) |
Move single hardpoint specified number of steps. | |
bool | move (int32_t *steps) |
Move HPs by given steps. | |
bool | moveToEncoder (int32_t *encoderValues) |
bool | moveToAbsolute (double x, double y, double z, double rX, double rY, double rZ) |
Commands mirror to move to new position. | |
bool | moveToReferencePosition () |
bool | moveToLowerPosition () |
Moves mirror to position ideal for lowering. | |
bool | translate (double x, double y, double z, double rX, double rY, double rZ) |
void | stopMotion (int hardpointIndex=-1) |
Stops HP motion. | |
void | updateSteps () |
Called in any enabled state (raised, parked, ..). | |
void | checkLimits (int hp) |
Check the hardpoint doesn't try to move past limits. | |
Controls M1M3 position.
This controller is used in active state to command M1M3 hardpoints, which in turn moves M1M3 platform position and tip/tilt.
Hardpoints are (for this application) linear actuators forming hexapod. They are driven by a stepper motor. The position of the actuator is sensed by SSI encoder. Force (=weight) applied on actuator is sensed by a load cell, similar to the force actuator load cells. Loop between encoder and stepper motor is closed by M1M3 CsC (=this application).
Steppers are commanded via ILC code 66 in small increments. Encoders are read back, and according to difference between commanded and target position, HP is either in Standby (not moving), Chasing (moving with the mirror so measured actuator force is close to 0), Quick and Fine positioning (moving to target position).
Small increments send to the ILC are stored in SAL/DDS MTM1M3_hardpointActuatorDataC stepsCommanded. Target steps are stored in stepsQueued.
|
inline |
Returns raise and lower timeout.
bool PositionController::hpRaiseLowerForcesInTolerance | ( | bool | raise | ) |
Checks that hardpoint forces are in tolerance for mirror raising and lowering.
Records raise/lowering forces status in RaisingLoweringInfo.waitHardpoint field.
raise | true if mirror is being raised - raising limits are then used |
bool PositionController::move | ( | int32_t * | steps | ) |
Move HPs by given steps.
Switch HP that needs to move into Stepping state. updateSteps then moves HP as needed.
steps | array of 6 HP steps offsets |
bool PositionController::moveHardpoint | ( | int32_t | steps, |
int | hpIndex ) |
Move single hardpoint specified number of steps.
steps | step offset |
hpIndex | index of the hardpoint to move |
bool PositionController::moveToAbsolute | ( | double | x, |
double | y, | ||
double | z, | ||
double | rX, | ||
double | rY, | ||
double | rZ ) |
Commands mirror to move to new position.
x | target x position (m) |
y | target y position (m) |
z | target z position (m) |
rX | target x rotation (deg) |
rY | target y rotation (deg) |
rZ | target z rotation (deg) |
bool PositionController::moveToLowerPosition | ( | ) |
Moves mirror to position ideal for lowering.
This position depends on telescope elevation. It is position defined in PositionControllerSettings/Lower/PositionOffset, multiplied by sin(elevation) for Z and cos(elevation) for Y. The multiplication tries to position mirror opposite to its gravity vectory. It is exactly what LBTO uses for off-zenith mirror lowering.
void PositionController::stopMotion | ( | int | hardpointIndex = -1 | ) |
Stops HP motion.
If index is negative, all hardpoints are stopped.
hardpointIndex | index of the hardpoint to stop, or negative value to stop all hardpoints, Defaults to -1. |
void PositionController::updateSteps | ( | ) |
Called in any enabled state (raised, parked, ..).
Sets stepsCommanded and stepsQueued. What is happening with the actuators is governed by its state.
This loop also monitors if encoder is following expected trajectory. If relative following error is outside prescribed range for configured loop, HardpointActuatorFollowingError is triggered.