Contains the parameters for a PID. More...
#include <yarp/dev/ControlBoardPid.h>
Public Member Functions | |
Pid () | |
Default Constructor. | |
~Pid () | |
Destructor. | |
Pid (double kp, double kd, double ki, double int_max, double scale, double out_max) | |
Basic constructor. | |
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. | |
void | setKp (double p) |
Set proportional gain. | |
void | setKi (double i) |
Set integrative gain. | |
void | setKd (double d) |
Set derivative gain. | |
void | setMaxInt (double m) |
Set max threshold for the integrative part. | |
void | setScale (double sc) |
Set output scale for the pid. | |
void | setMaxOut (double m) |
Set max output value for the pid. | |
void | setOffset (double o) |
Set offset value for the pid. | |
void | setStictionValues (double up_value, double down_value) |
Set the two stiction values for the pid. | |
void | setKff (double Kff) |
Set the feedforward gain for the pid. | |
bool | operator== (const yarp::dev::Pid &p) const |
return true if all params are equal | |
void | clear () |
Set all pid parameters to zero. | |
Public Attributes | |
double | kp |
proportional gain | |
double | kd |
derivative gain | |
double | ki |
integrative gain | |
double | max_int |
saturation threshold for the integrator | |
double | scale |
scale for the pid output | |
double | max_output |
max output | |
double | offset |
pwm offset added to the pid output | |
double | stiction_up_val |
up stiction offset added to the pid output | |
double | stiction_down_val |
down stiction offset added to the pid output | |
double | kff |
feedforward gain | |
Contains the parameters for a PID.
Definition at line 23 of file ControlBoardPid.h.
Pid::Pid | ( | ) |
Default Constructor.
Definition at line 41 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 11 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 25 of file ControlBoardPid.cpp.
void Pid::clear | ( | ) |
Set all pid parameters to zero.
Definition at line 46 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 106 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 101 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 75 of file ControlBoardPid.cpp.
void Pid::setMaxOut | ( | double | m | ) |
Set max output value for the pid.
m | new value |
Definition at line 85 of file ControlBoardPid.cpp.
void Pid::setOffset | ( | double | o | ) |
Set offset value for the pid.
o | new offset value |
Definition at line 90 of file ControlBoardPid.cpp.
void Pid::setScale | ( | double | sc | ) |
Set output scale for the pid.
sc | scale value |
Definition at line 80 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 95 of file ControlBoardPid.cpp.
double yarp::dev::Pid::kd |
derivative gain
Definition at line 27 of file ControlBoardPid.h.
double yarp::dev::Pid::kff |
feedforward gain
Definition at line 35 of file ControlBoardPid.h.
double yarp::dev::Pid::ki |
integrative gain
Definition at line 28 of file ControlBoardPid.h.
double yarp::dev::Pid::kp |
proportional gain
Definition at line 26 of file ControlBoardPid.h.
double yarp::dev::Pid::max_int |
saturation threshold for the integrator
Definition at line 29 of file ControlBoardPid.h.
double yarp::dev::Pid::max_output |
max output
Definition at line 31 of file ControlBoardPid.h.
double yarp::dev::Pid::offset |
pwm offset added to the pid output
Definition at line 32 of file ControlBoardPid.h.
double yarp::dev::Pid::scale |
scale for the pid output
Definition at line 30 of file ControlBoardPid.h.
double yarp::dev::Pid::stiction_down_val |
down stiction offset added to the pid output
Definition at line 34 of file ControlBoardPid.h.
double yarp::dev::Pid::stiction_up_val |
up stiction offset added to the pid output
Definition at line 33 of file ControlBoardPid.h.