Contains the parameters for a PID. More...
#include <yarp/dev/ControlBoardPid.h>
Public Member Functions | |
Pid () | |
Default Constructor. More... | |
~Pid () | |
Destructor. More... | |
Pid (double kp, double kd, double ki, double int_max, double scale, double out_max) | |
Basic constructor. More... | |
Pid (double kp, double kd, double ki, double int_max, double scale, double out_max, double st_up, double st_down, double kff) | |
Advanced constructor. More... | |
void | setKp (double p) |
Set proportional gain. More... | |
void | setKi (double i) |
Set integrative gain. More... | |
void | setKd (double d) |
Set derivative gain. More... | |
void | setMaxInt (double m) |
Set max threshold for the integrative part. More... | |
void | setScale (double sc) |
Set output scale for the pid. More... | |
void | setMaxOut (double m) |
Set max output value for the pid. More... | |
void | setOffset (double o) |
Set offset value for the pid. More... | |
void | setStictionValues (double up_value, double down_value) |
Set the two stiction values for the pid. More... | |
void | setKff (double Kff) |
Set the feedforward gain for the pid. More... | |
bool | operator== (const yarp::dev::Pid &p) const |
return true if all params are equal More... | |
void | clear () |
Set all pid parameters to zero. More... | |
Public Attributes | |
double | kp |
proportional gain More... | |
double | kd |
derivative gain More... | |
double | ki |
integrative gain More... | |
double | max_int |
saturation threshold for the integrator More... | |
double | scale |
scale for the pid output More... | |
double | max_output |
max output More... | |
double | offset |
pwm offset added to the pid output More... | |
double | stiction_up_val |
up stiction offset added to the pid output More... | |
double | stiction_down_val |
down stiction offset added to the pid output More... | |
double | kff |
feedforward gain More... | |
Contains the parameters for a PID.
Definition at line 28 of file ControlBoardPid.h.
Pid::Pid | ( | ) |
Default Constructor.
Definition at line 44 of file ControlBoardPid.cpp.
|
default |
Destructor.
Pid::Pid | ( | double | kp, |
double | kd, | ||
double | ki, | ||
double | int_max, | ||
double | scale, | ||
double | out_max | ||
) |
Basic constructor.
kp | proportional gain |
kd | derivative gain |
ki | integrative gain |
int_max | integrator max output |
scale | scaling factor |
out_max | cap on output |
Definition at line 14 of file ControlBoardPid.cpp.
Pid::Pid | ( | double | kp, |
double | kd, | ||
double | ki, | ||
double | int_max, | ||
double | scale, | ||
double | out_max, | ||
double | st_up, | ||
double | st_down, | ||
double | kff | ||
) |
Advanced constructor.
kp | proportional gain |
kd | derivative gain |
ki | integrative gain |
int_max | integrator max output |
scale | scaling factor |
out_max | cap on output |
st_up | up stiction offset |
st_down | down stiction offset |
kff | feedforward gain |
Definition at line 28 of file ControlBoardPid.cpp.
void Pid::clear | ( | ) |
Set all pid parameters to zero.
Definition at line 49 of file ControlBoardPid.cpp.
bool Pid::operator== | ( | const yarp::dev::Pid & | p | ) | const |
return true if all params are equal
p | pid to be compared |
Definition at line 109 of file ControlBoardPid.cpp.
void Pid::setKd | ( | double | d | ) |
void Pid::setKff | ( | double | Kff | ) |
Set the feedforward gain for the pid.
Kff | new gain |
Definition at line 104 of file ControlBoardPid.cpp.
void Pid::setKi | ( | double | i | ) |
void Pid::setKp | ( | double | p | ) |
void Pid::setMaxInt | ( | double | m | ) |
Set max threshold for the integrative part.
m | new max |
Definition at line 78 of file ControlBoardPid.cpp.
void Pid::setMaxOut | ( | double | m | ) |
Set max output value for the pid.
m | new value |
Definition at line 88 of file ControlBoardPid.cpp.
void Pid::setOffset | ( | double | o | ) |
Set offset value for the pid.
o | new offset value |
Definition at line 93 of file ControlBoardPid.cpp.
void Pid::setScale | ( | double | sc | ) |
Set output scale for the pid.
sc | scale value |
Definition at line 83 of file ControlBoardPid.cpp.
void Pid::setStictionValues | ( | double | up_value, |
double | down_value | ||
) |
Set the two stiction values for the pid.
up_value | the new up value |
down_value | the new down value |
Definition at line 98 of file ControlBoardPid.cpp.
double yarp::dev::Pid::kd |
derivative gain
Definition at line 32 of file ControlBoardPid.h.
double yarp::dev::Pid::kff |
feedforward gain
Definition at line 40 of file ControlBoardPid.h.
double yarp::dev::Pid::ki |
integrative gain
Definition at line 33 of file ControlBoardPid.h.
double yarp::dev::Pid::kp |
proportional gain
Definition at line 31 of file ControlBoardPid.h.
double yarp::dev::Pid::max_int |
saturation threshold for the integrator
Definition at line 34 of file ControlBoardPid.h.
double yarp::dev::Pid::max_output |
max output
Definition at line 36 of file ControlBoardPid.h.
double yarp::dev::Pid::offset |
pwm offset added to the pid output
Definition at line 37 of file ControlBoardPid.h.
double yarp::dev::Pid::scale |
scale for the pid output
Definition at line 35 of file ControlBoardPid.h.
double yarp::dev::Pid::stiction_down_val |
down stiction offset added to the pid output
Definition at line 39 of file ControlBoardPid.h.
double yarp::dev::Pid::stiction_up_val |
up stiction offset added to the pid output
Definition at line 38 of file ControlBoardPid.h.