Object managing one PID control. More...
#include <PID.h>
Public Types | |
enum | storage_t { STORE_OFF, STORE_EEPROM_FLOAT, STORE_EEPROM_UINT16 } |
Public Member Functions | |
PID () | |
PID (uint16_t address, storage_t storage=STORE_EEPROM_UINT16) | |
PID (float *gain_array) | |
long | get_pid (int32_t error, uint16_t dt, float scaler=1.0) |
void | reset_I () |
void | load_gains () |
void | save_gains () |
float | get_integrator () |
parameter accessors | |
float | kP () |
float | kI () |
float | kD () |
float | imax () |
void | kP (const float v) |
void | kI (const float v) |
void | kD (const float v) |
void | imax (const float v) |
void | address (const uint16_t v) |
Public Attributes | |
enum PID::storage_t | _storage |
Object managing one PID control.
Definition at line 14 of file PID.h.
enum PID::storage_t |
PID::PID | ( | ) | [inline] |
PID::PID | ( | uint16_t | address, | |
storage_t | storage = STORE_EEPROM_UINT16 | |||
) | [inline] |
PID::PID | ( | float * | gain_array | ) | [inline] |
long PID::get_pid | ( | int32_t | error, | |
uint16_t | dt, | |||
float | scaler = 1.0 | |||
) |
Iterate the PID, return the new control value
Positive error produces positive output.
error | The measured error value | |
dt | The time delta in milliseconds (note that update interval cannot be more than 65.535 seconds due to limited range of the data type). | |
scaler | An arbitrary scale factor |