#include <pidcontroller.h>
Public Member Functions | |
PIDController (std::string name, float Kp, float Ki, float Kd, float period, float outputlowerlimit, float outputupperlimit) | |
~PIDController () | |
float | doControl (float input) |
void | setTarget (float target) |
void | clearState () |
PIDController::PIDController | ( | std::string | mname, | |
float | mKp, | |||
float | mKi, | |||
float | mKd, | |||
float | mperiod, | |||
float | moutputlowerlimit, | |||
float | moutputupperlimit | |||
) |
PID Controller:
NUbots (c) 2008 All Rights Reserved
Create a generic PID Controller
mname | the name of the PID controller (this is used to idenitify it) | |
mKp | the proportional gain | |
mKi | the integra gain | |
mKd | the derivative gain | |
mperiod | the control loop period | |
moutputlowerlimit | the actuator lower limit | |
moutputupperlimit | the actuator upper limit |
PIDController::~PIDController | ( | ) |
Destroys the PID controller
void PIDController::clearState | ( | ) |
Clear the controller's state.
This will reset the integral and derivative terms, as well as reset any historical values. Use this just prior to turning the motor back on, or when turning the motor off
float PIDController::doControl | ( | float | input | ) |
The controller function; call this inside the control loop.
input | the measured value |
void PIDController::setTarget | ( | float | mtarget | ) |
Set the controller's set point
mtarget | the target current (A) |