Object managing one PID control.
More...
#include <PID.h>
Object managing one PID control.
Definition at line 13 of file PID.h.
◆ PID()
PID::PID |
( |
const float & |
initial_p = 0.0f , |
|
|
const float & |
initial_i = 0.0f , |
|
|
const float & |
initial_d = 0.0f , |
|
|
const int16_t & |
initial_imax = 0 |
|
) |
| |
|
inline |
Definition at line 16 of file PID.h.
◆ _get_pid()
float PID::_get_pid |
( |
float |
error, |
|
|
uint16_t |
dt, |
|
|
float |
scaler |
|
) |
| |
|
private |
◆ get_integrator()
float PID::get_integrator |
( |
| ) |
const |
|
inline |
Definition at line 95 of file PID.h.
◆ get_pid()
float PID::get_pid |
( |
float |
error, |
|
|
float |
scaler = 1.0 |
|
) |
| |
Iterate the PID, return the new control value
Positive error produces positive output.
- Parameters
-
error | The measured error value |
scaler | An arbitrary scale factor |
- Returns
- The updated control output.
Definition at line 37 of file PID.cpp.
Referenced by PID(), and AP_Landing_Deepstall::update_steering().
◆ get_pid_info()
◆ imax() [1/2]
int16_t PID::imax |
( |
| ) |
const |
|
inline |
Definition at line 78 of file PID.h.
◆ imax() [2/2]
void PID::imax |
( |
const int16_t |
v | ) |
|
|
inline |
Definition at line 91 of file PID.h.
◆ kD() [1/2]
Definition at line 75 of file PID.h.
◆ kD() [2/2]
void PID::kD |
( |
const float |
v | ) |
|
|
inline |
Definition at line 88 of file PID.h.
◆ kI() [1/2]
float PID::kI |
( |
void |
| ) |
const |
|
inline |
Definition at line 72 of file PID.h.
◆ kI() [2/2]
void PID::kI |
( |
const float |
v | ) |
|
|
inline |
Definition at line 85 of file PID.h.
◆ kP() [1/2]
float PID::kP |
( |
void |
| ) |
const |
|
inline |
Definition at line 69 of file PID.h.
◆ kP() [2/2]
void PID::kP |
( |
const float |
v | ) |
|
|
inline |
Definition at line 82 of file PID.h.
◆ load_gains()
Load gain properties
Definition at line 128 of file PID.cpp.
Referenced by PID().
◆ operator()()
void PID::operator() |
( |
const float |
p, |
|
|
const float |
i, |
|
|
const float |
d, |
|
|
const int16_t |
imaxval |
|
) |
| |
|
inline |
Overload the function call operator to permit relatively easy initialisation.
Definition at line 62 of file PID.h.
◆ reset()
◆ reset_I()
◆ save_gains()
Save gain properties
Definition at line 137 of file PID.cpp.
Referenced by PID().
◆ _fCut
const uint8_t PID::_fCut = 20 |
|
staticprivate |
◆ _imax
◆ _integrator
◆ _kd
◆ _ki
◆ _kp
◆ _last_derivative
float PID::_last_derivative |
|
private |
◆ _last_error
last error for derivative
Definition at line 110 of file PID.h.
Referenced by get_pid().
◆ _last_t
◆ _pid_info
◆ var_info
Initial value:
Definition at line 99 of file PID.h.
Referenced by PID().
The documentation for this class was generated from the following files: