iCub-main
Public Member Functions | Protected Attributes | List of all members
iCub::ctrl::parallelPID Class Reference

General structure of parallel (non-interactive) PID. More...

#include <pids.h>

+ Inheritance diagram for iCub::ctrl::parallelPID:

Public Member Functions

 parallelPID (const double _Ts, const yarp::sig::Vector &_Kp, const yarp::sig::Vector &_Ki, const yarp::sig::Vector &_Kd, const yarp::sig::Vector &_Wp, const yarp::sig::Vector &_Wi, const yarp::sig::Vector &_Wd, const yarp::sig::Vector &_N, const yarp::sig::Vector &_Tt, const yarp::sig::Matrix &_satLim)
 Constructor. More...
 
virtual const yarp::sig::Vector & compute (const yarp::sig::Vector &ref, const yarp::sig::Vector &fb)
 Computes the PID output. More...
 
virtual void reset (const yarp::sig::Vector &u0)
 Resets the internal state of integral and derivative part. More...
 
virtual void getOptions (yarp::os::Bottle &options)
 Returns the current options used by the pid. More...
 
virtual void setOptions (const yarp::os::Bottle &options)
 Update the options used by the pid. More...
 
 ~parallelPID ()
 Destructor. More...
 

Protected Attributes

yarp::sig::Vector Kp
 
yarp::sig::Vector Ki
 
yarp::sig::Vector Kd
 
yarp::sig::Vector Wp
 
yarp::sig::Vector Wi
 
yarp::sig::Vector Wd
 
yarp::sig::Vector N
 
yarp::sig::Vector Tt
 
yarp::sig::Matrix satLim
 
yarp::sig::Vector P
 
yarp::sig::Vector I
 
yarp::sig::Vector D
 
yarp::sig::Vector u
 
yarp::sig::Vector uSat
 
unsigned int dim
 
double Ts
 
IntegratorInt
 
std::deque< Filter * > Der
 

Additional Inherited Members

- Static Public Member Functions inherited from iCub::ctrl::helperPID
static void addVectorToOption (yarp::os::Bottle &option, const char *key, const yarp::sig::Vector &val)
 Add the data contained in the specified vector to the specified bottle, using property-like form (i.e. More...
 
static bool getVectorFromOption (const yarp::os::Bottle &options, const char *key, yarp::sig::Vector &val, int &size)
 Fill the specified vector with the data associated with the specified key in the specified property-like bottle. More...
 

Detailed Description

General structure of parallel (non-interactive) PID.

u = sat(P + I + D)

Components expressed in Laplace transform:

Definition at line 210 of file pids.h.

Constructor & Destructor Documentation

◆ parallelPID()

iCub::ctrl::parallelPID::parallelPID ( const double  _Ts,
const yarp::sig::Vector &  _Kp,
const yarp::sig::Vector &  _Ki,
const yarp::sig::Vector &  _Kd,
const yarp::sig::Vector &  _Wp,
const yarp::sig::Vector &  _Wi,
const yarp::sig::Vector &  _Wd,
const yarp::sig::Vector &  _N,
const yarp::sig::Vector &  _Tt,
const yarp::sig::Matrix &  _satLim 
)

Constructor.

Parameters
_Tsis the block sample time in seconds.
_Kpare the proportional gains.
_Kiare the integral gains.
_Kdare the derivative gains.
_Wpare the setpoint weigths for proportional part.
_Wiare the setpoint weigths for integral part.
_Wdare the setpoint weigths for derivative part.
_Nare derivative low-pass filter bandwidth (3 to 20, typ. 10, must be > 0).
_Ttare anti-windup reset time (0.1 to 1 times the value of Ti=Kp/Ki, greater than Td).
_satLimis the saturation thresholds matrix (min_i=satLim(i,0), max_i=satLim(i,1)).

◆ ~parallelPID()

parallelPID::~parallelPID ( )

Destructor.

Definition at line 373 of file pids.cpp.

Member Function Documentation

◆ compute()

const Vector & parallelPID::compute ( const yarp::sig::Vector &  ref,
const yarp::sig::Vector &  fb 
)
virtual

Computes the PID output.

Parameters
refthe actual reference to track.
fbthe actual plant feedback.
Returns
the actual PID output.

Definition at line 213 of file pids.cpp.

◆ getOptions()

void parallelPID::getOptions ( yarp::os::Bottle &  options)
virtual

Returns the current options used by the pid.

Parameters
optionsis a property-like bottle containing the current configuration used by the pid.
Note
The returned bottle looks like as follows: (Kp (1 2 ...)) (Ki (1 2 ...)) (Kd (1 2 ...)) (Wp (...)) ...
the satLim property is returned ordered by rows.

Definition at line 264 of file pids.cpp.

◆ reset()

void parallelPID::reset ( const yarp::sig::Vector &  u0)
virtual

Resets the internal state of integral and derivative part.

Parameters
u0is the new value of output vector.

Definition at line 247 of file pids.cpp.

◆ setOptions()

void parallelPID::setOptions ( const yarp::os::Bottle &  options)
virtual

Update the options used by the pid.

Parameters
optionsis a property-like bottle containing the new configuration used by the pid.
Note
The property parameter should look like as follows: (Kp (1 2 ...)) (Ki (1 2 ...)) (Kd (1 2 ...)) (Wp (...)) ...
The vectors dimension at pid creation time is always retained.
The satLim property must be given ordered by rows.
The special property (reset (u0[0] u0[1] ...)) serves to call the reset(u0) method straightaway.

Definition at line 289 of file pids.cpp.

Member Data Documentation

◆ D

yarp::sig::Vector iCub::ctrl::parallelPID::D
protected

Definition at line 231 of file pids.h.

◆ Der

std::deque<Filter*> iCub::ctrl::parallelPID::Der
protected

Definition at line 239 of file pids.h.

◆ dim

unsigned int iCub::ctrl::parallelPID::dim
protected

Definition at line 235 of file pids.h.

◆ I

yarp::sig::Vector iCub::ctrl::parallelPID::I
protected

Definition at line 230 of file pids.h.

◆ Int

Integrator* iCub::ctrl::parallelPID::Int
protected

Definition at line 238 of file pids.h.

◆ Kd

yarp::sig::Vector iCub::ctrl::parallelPID::Kd
protected

Definition at line 219 of file pids.h.

◆ Ki

yarp::sig::Vector iCub::ctrl::parallelPID::Ki
protected

Definition at line 218 of file pids.h.

◆ Kp

yarp::sig::Vector iCub::ctrl::parallelPID::Kp
protected

Definition at line 217 of file pids.h.

◆ N

yarp::sig::Vector iCub::ctrl::parallelPID::N
protected

Definition at line 225 of file pids.h.

◆ P

yarp::sig::Vector iCub::ctrl::parallelPID::P
protected

Definition at line 229 of file pids.h.

◆ satLim

yarp::sig::Matrix iCub::ctrl::parallelPID::satLim
protected

Definition at line 227 of file pids.h.

◆ Ts

double iCub::ctrl::parallelPID::Ts
protected

Definition at line 236 of file pids.h.

◆ Tt

yarp::sig::Vector iCub::ctrl::parallelPID::Tt
protected

Definition at line 226 of file pids.h.

◆ u

yarp::sig::Vector iCub::ctrl::parallelPID::u
protected

Definition at line 232 of file pids.h.

◆ uSat

yarp::sig::Vector iCub::ctrl::parallelPID::uSat
protected

Definition at line 233 of file pids.h.

◆ Wd

yarp::sig::Vector iCub::ctrl::parallelPID::Wd
protected

Definition at line 223 of file pids.h.

◆ Wi

yarp::sig::Vector iCub::ctrl::parallelPID::Wi
protected

Definition at line 222 of file pids.h.

◆ Wp

yarp::sig::Vector iCub::ctrl::parallelPID::Wp
protected

Definition at line 221 of file pids.h.


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