Contains the parameters for a PID. More...
#include <yarp/dev/ControlBoardPid.h>
Inheritance diagram for yarp::dev::Pid: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 Member Functions inherited from yarp::dev::PidGainsData | |
| PidGainsData ()=default | |
| PidGainsData (const double kp, const double kd, const double ki, const double max_int, const double scale, const double max_output, const double offset, const double stiction_up_val, const double stiction_down_val, const double kff) | |
| bool | read (yarp::os::idl::WireReader &reader) override |
| bool | read (yarp::os::ConnectionReader &connection) override |
| Read this object from a network connection. | |
| bool | write (const yarp::os::idl::WireWriter &writer) const override |
| bool | write (yarp::os::ConnectionWriter &connection) const override |
| Write this object to a network connection. | |
| std::string | toString () const |
Public Member Functions inherited from yarp::os::idl::WirePortable | |
| virtual bool | readBare (yarp::os::ConnectionReader &reader) |
| virtual bool | writeBare (yarp::os::ConnectionWriter &writer) const |
| virtual bool | readBottle (yarp::os::ConnectionReader &reader) |
| virtual bool | writeBottle (yarp::os::ConnectionWriter &writer) const |
Public Member Functions inherited from yarp::os::Portable | |
| virtual Type | getType () const |
Public Member Functions inherited from yarp::os::PortReader | |
| virtual | ~PortReader () |
| Destructor. | |
| virtual Type | getReadType () const |
Public Member Functions inherited from yarp::os::PortWriter | |
| virtual | ~PortWriter () |
| Destructor. | |
| virtual void | onCompletion () const |
| This is called when the port has finished all writing operations. | |
| virtual void | onCommencement () const |
| This is called when the port is about to begin writing operations. | |
| virtual yarp::os::Type | getWriteType () const |
Additional Inherited Members | |
Public Types inherited from yarp::dev::PidGainsData | |
| typedef yarp::os::idl::Unwrapped< PidGainsData > | unwrapped |
Static Public Member Functions inherited from yarp::os::Portable | |
| static bool | copyPortable (const PortWriter &writer, PortReader &reader) |
| Copy one portable to another, via writing and reading. | |
Public Attributes inherited from yarp::dev::PidGainsData | |
| double | kp {0.0} |
| proportional gain | |
| double | kd {0.0} |
| derivative gain | |
| double | ki {0.0} |
| integrative gain | |
| double | max_int {0.0} |
| saturation threshold for the integrator | |
| double | scale {0.0} |
| scale for the pid output | |
| double | max_output {0.0} |
| max output | |
| double | offset {0.0} |
| pwm offset added to the pid output | |
| double | stiction_up_val {0.0} |
| up stiction offset added to the pid output | |
| double | stiction_down_val {0.0} |
| down stiction offset added to the pid output | |
| double | kff {0.0} |
| feedforward gain | |
Contains the parameters for a PID.
Definition at line 30 of file ControlBoardPid.h.
| Pid::Pid | ( | ) |
Default Constructor.
Definition at line 23 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 16 of file ControlBoardPid.cpp.
| void Pid::clear | ( | ) |
Set all pid parameters to zero.
Definition at line 28 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 88 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 83 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 57 of file ControlBoardPid.cpp.
| void Pid::setMaxOut | ( | double | m | ) |
Set max output value for the pid.
| m | new value |
Definition at line 67 of file ControlBoardPid.cpp.
| void Pid::setOffset | ( | double | o | ) |
Set offset value for the pid.
| o | new offset value |
Definition at line 72 of file ControlBoardPid.cpp.
| void Pid::setScale | ( | double | sc | ) |
Set output scale for the pid.
| sc | scale value |
Definition at line 62 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 77 of file ControlBoardPid.cpp.