YARP
Yet Another Robot Platform
yarp::dev::Pid Class Reference

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...
 

Detailed Description

Contains the parameters for a PID.

Definition at line 28 of file ControlBoardPid.h.

Constructor & Destructor Documentation

◆ Pid() [1/3]

Pid::Pid ( )

Default Constructor.

Definition at line 44 of file ControlBoardPid.cpp.

◆ ~Pid()

Pid::~Pid ( )
default

Destructor.

◆ Pid() [2/3]

Pid::Pid ( double  kp,
double  kd,
double  ki,
double  int_max,
double  scale,
double  out_max 
)

Basic constructor.

Parameters
kpproportional gain
kdderivative gain
kiintegrative gain
int_maxintegrator max output
scalescaling factor
out_maxcap on output

Definition at line 14 of file ControlBoardPid.cpp.

◆ Pid() [3/3]

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.

Parameters
kpproportional gain
kdderivative gain
kiintegrative gain
int_maxintegrator max output
scalescaling factor
out_maxcap on output
st_upup stiction offset
st_downdown stiction offset
kfffeedforward gain

Definition at line 28 of file ControlBoardPid.cpp.

Member Function Documentation

◆ clear()

void Pid::clear ( )

Set all pid parameters to zero.

Definition at line 49 of file ControlBoardPid.cpp.

◆ operator==()

bool Pid::operator== ( const yarp::dev::Pid p) const

return true if all params are equal

Parameters
ppid to be compared

Definition at line 109 of file ControlBoardPid.cpp.

◆ setKd()

void Pid::setKd ( double  d)

Set derivative gain.

Parameters
dnew gain

Definition at line 73 of file ControlBoardPid.cpp.

◆ setKff()

void Pid::setKff ( double  Kff)

Set the feedforward gain for the pid.

Parameters
Kffnew gain

Definition at line 104 of file ControlBoardPid.cpp.

◆ setKi()

void Pid::setKi ( double  i)

Set integrative gain.

Parameters
inew gain

Definition at line 68 of file ControlBoardPid.cpp.

◆ setKp()

void Pid::setKp ( double  p)

Set proportional gain.

Parameters
pnew gain

Definition at line 63 of file ControlBoardPid.cpp.

◆ setMaxInt()

void Pid::setMaxInt ( double  m)

Set max threshold for the integrative part.

Parameters
mnew max

Definition at line 78 of file ControlBoardPid.cpp.

◆ setMaxOut()

void Pid::setMaxOut ( double  m)

Set max output value for the pid.

Parameters
mnew value

Definition at line 88 of file ControlBoardPid.cpp.

◆ setOffset()

void Pid::setOffset ( double  o)

Set offset value for the pid.

Parameters
onew offset value

Definition at line 93 of file ControlBoardPid.cpp.

◆ setScale()

void Pid::setScale ( double  sc)

Set output scale for the pid.

Parameters
scscale value

Definition at line 83 of file ControlBoardPid.cpp.

◆ setStictionValues()

void Pid::setStictionValues ( double  up_value,
double  down_value 
)

Set the two stiction values for the pid.

Parameters
up_valuethe new up value
down_valuethe new down value

Definition at line 98 of file ControlBoardPid.cpp.

Member Data Documentation

◆ kd

double yarp::dev::Pid::kd

derivative gain

Definition at line 32 of file ControlBoardPid.h.

◆ kff

double yarp::dev::Pid::kff

feedforward gain

Definition at line 40 of file ControlBoardPid.h.

◆ ki

double yarp::dev::Pid::ki

integrative gain

Definition at line 33 of file ControlBoardPid.h.

◆ kp

double yarp::dev::Pid::kp

proportional gain

Definition at line 31 of file ControlBoardPid.h.

◆ max_int

double yarp::dev::Pid::max_int

saturation threshold for the integrator

Definition at line 34 of file ControlBoardPid.h.

◆ max_output

double yarp::dev::Pid::max_output

max output

Definition at line 36 of file ControlBoardPid.h.

◆ offset

double yarp::dev::Pid::offset

pwm offset added to the pid output

Definition at line 37 of file ControlBoardPid.h.

◆ scale

double yarp::dev::Pid::scale

scale for the pid output

Definition at line 35 of file ControlBoardPid.h.

◆ stiction_down_val

double yarp::dev::Pid::stiction_down_val

down stiction offset added to the pid output

Definition at line 39 of file ControlBoardPid.h.

◆ stiction_up_val

double yarp::dev::Pid::stiction_up_val

up stiction offset added to the pid output

Definition at line 38 of file ControlBoardPid.h.


The documentation for this class was generated from the following files: