|
controls
3.0.0
|
PID feedback controller with anti-windup integral clamping. More...
#include <FeedbackController.h>
Public Member Functions | |
| void | reset () override |
| Resets all internal state including the integral term. More... | |
| void | resetAllExceptDepthIntegral () |
| Resets all internal state except the depth (Z) integral term. More... | |
| Vector6d | getForce (const State &goal, const State &curr, double dt) override |
| Computes the PID feedback force from the goal and current state. More... | |
| void | save_integral () |
| Saves a snapshot of the current integral term for later restoration. More... | |
| void | load_integral () |
| Restores the integral term from the most recent saved snapshot. More... | |
| void | ramp_integral (double ratio) |
| Interpolates the integral term between its current value and the saved snapshot. More... | |
| Vector6d | getIntegralError () const |
| Returns the most recently computed body-frame integral error. More... | |
| Vector6d | getPoseError () const |
| Returns the most recently computed body-frame pose error. More... | |
| Vector6d | getTwistError () const |
| Returns the most recently computed body-frame twist error. More... | |
| Vector6d | getIntegralForce () const |
| Returns the most recently computed integral force contribution. More... | |
| void | setIntegral (const Vector6d &i) |
| Directly sets the integral accumulator. More... | |
| BaseControllerInterface ()=default | |
| BaseControllerInterface (std::shared_ptr< SystemDynamicsBase > auv, std::shared_ptr< ControllerConfig > config) | |
| Constructs a controller with the given dynamics model and config. More... | |
Public Member Functions inherited from BaseControllerInterface | |
| BaseControllerInterface ()=default | |
| BaseControllerInterface (std::shared_ptr< SystemDynamicsBase > auv, std::shared_ptr< ControllerConfig > config) | |
| Constructs a controller with the given dynamics model and config. More... | |
| virtual | ~BaseControllerInterface ()=default |
Public Attributes | |
| bool | saturatedOnYawXYAxis = false |
| True when the X, Y, or Yaw thruster axes are saturated. More... | |
| bool | saturatedOnDepthRollPitchAxis = false |
| True when the Z, Roll, or Pitch thruster axes are saturated. More... | |
Additional Inherited Members | |
Protected Attributes inherited from BaseControllerInterface | |
| std::shared_ptr< SystemDynamicsBase > | auv_ |
| Vehicle dynamics model shared with all controllers in a stack. More... | |
| std::shared_ptr< ControllerConfig > | config_ |
| Tuning parameters shared with all controllers in a stack. More... | |
PID feedback controller with anti-windup integral clamping.
Computes proportional, integral, and derivative forces from the body-frame pose, integral, and twist errors respectively. Separate gain sets can be activated near the water surface. The integral term is clamped when any thruster axis is saturated to prevent windup.
|
default |
|
inline |
Constructs a controller with the given dynamics model and config.
| auv | [in] Shared vehicle dynamics model |
| config | [in] Shared controller tuning parameters |
|
overridevirtual |
Computes the PID feedback force from the goal and current state.
| goal | [in] Desired vehicle state |
| curr | [in] Current vehicle state |
| dt | [in] Time step in seconds used for integral accumulation |
Implements BaseControllerInterface.
| Vector6d FeedbackController::getIntegralError | ( | ) | const |
Returns the most recently computed body-frame integral error.
| Vector6d FeedbackController::getIntegralForce | ( | ) | const |
Returns the most recently computed integral force contribution.
| Vector6d FeedbackController::getPoseError | ( | ) | const |
Returns the most recently computed body-frame pose error.
| Vector6d FeedbackController::getTwistError | ( | ) | const |
Returns the most recently computed body-frame twist error.
| void FeedbackController::load_integral | ( | ) |
Restores the integral term from the most recent saved snapshot.
| void FeedbackController::ramp_integral | ( | double | ratio | ) |
Interpolates the integral term between its current value and the saved snapshot.
| ratio | [in] Blending ratio in [0, 1]; 1.0 fully loads the saved integral |
|
overridevirtual |
Resets all internal state including the integral term.
Reimplemented from BaseControllerInterface.
| void FeedbackController::resetAllExceptDepthIntegral | ( | ) |
Resets all internal state except the depth (Z) integral term.
| void FeedbackController::save_integral | ( | ) |
Saves a snapshot of the current integral term for later restoration.
The snapshot is zeroed if either thruster axis group is saturated.
| void FeedbackController::setIntegral | ( | const Vector6d & | i | ) |
Directly sets the integral accumulator.
| i | [in] New integral value |
| bool FeedbackController::saturatedOnDepthRollPitchAxis = false |
True when the Z, Roll, or Pitch thruster axes are saturated.
| bool FeedbackController::saturatedOnYawXYAxis = false |
True when the X, Y, or Yaw thruster axes are saturated.