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

General structure of series (interactive) PID. More...

#include <pids.h>

+ Inheritance diagram for iCub::ctrl::seriesPID:

Public Member Functions

 seriesPID (const double _Ts, const yarp::sig::Vector &_Kp, const yarp::sig::Vector &_Ti, const yarp::sig::Vector &_Kd, const yarp::sig::Vector &_N, 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 ()
 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...
 
 ~seriesPID ()
 Destructor. More...
 

Protected Attributes

yarp::sig::Vector Kp
 
yarp::sig::Vector Ti
 
yarp::sig::Vector Kd
 
yarp::sig::Vector N
 
yarp::sig::Matrix satLim
 
yarp::sig::Vector e
 
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
 
std::deque< Filter * > Int
 
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 series (interactive) PID.

u = sat((P + I) * (1 + D) * (ref-fb))

Components expressed in Laplace transform:

Definition at line 323 of file pids.h.

Constructor & Destructor Documentation

◆ seriesPID()

iCub::ctrl::seriesPID::seriesPID ( const double  _Ts,
const yarp::sig::Vector &  _Kp,
const yarp::sig::Vector &  _Ti,
const yarp::sig::Vector &  _Kd,
const yarp::sig::Vector &  _N,
const yarp::sig::Matrix &  _satLim 
)

Constructor.

Parameters
_Tsis the block sample time in seconds.
_Kpare the proportional gains.
_Tiare the integral time constants (so that integral part cannot be switched off).
_Kdare the derivative gains.
_Nare derivative low-pass filter bandwidth (3 to 20, typ. 10, must be > 0).
_satLimis the saturation thresholds matrix (min_i=satLim(i,0), max_i=satLim(i,1)).

◆ ~seriesPID()

seriesPID::~seriesPID ( )

Destructor.

Definition at line 578 of file pids.cpp.

Member Function Documentation

◆ compute()

const Vector & seriesPID::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 428 of file pids.cpp.

◆ getOptions()

void seriesPID::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 ...)) (Ti (1 2 ...)) (Kd (1 2 ...)) (N (...)) ...
The satLim property is returned ordered by rows.

Definition at line 480 of file pids.cpp.

◆ reset()

void seriesPID::reset ( )
virtual

Resets the internal state of integral and derivative part.

Definition at line 468 of file pids.cpp.

◆ setOptions()

void seriesPID::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 ...)) (Ti (1 2 ...)) (Kd (1 2 ...)) (N (...)) ...
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 501 of file pids.cpp.

Member Data Documentation

◆ D

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

Definition at line 340 of file pids.h.

◆ Der

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

Definition at line 348 of file pids.h.

◆ dim

unsigned int iCub::ctrl::seriesPID::dim
protected

Definition at line 344 of file pids.h.

◆ e

yarp::sig::Vector iCub::ctrl::seriesPID::e
protected

Definition at line 337 of file pids.h.

◆ I

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

Definition at line 339 of file pids.h.

◆ Int

std::deque<Filter*> iCub::ctrl::seriesPID::Int
protected

Definition at line 347 of file pids.h.

◆ Kd

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

Definition at line 332 of file pids.h.

◆ Kp

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

Definition at line 330 of file pids.h.

◆ N

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

Definition at line 334 of file pids.h.

◆ P

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

Definition at line 338 of file pids.h.

◆ satLim

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

Definition at line 335 of file pids.h.

◆ Ti

yarp::sig::Vector iCub::ctrl::seriesPID::Ti
protected

Definition at line 331 of file pids.h.

◆ Ts

double iCub::ctrl::seriesPID::Ts
protected

Definition at line 345 of file pids.h.

◆ u

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

Definition at line 341 of file pids.h.

◆ uSat

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

Definition at line 342 of file pids.h.


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