Public Member Functions | Protected Member Functions | Protected Attributes
robot_controllers::PID Class Reference

#include <pid.h>

List of all members.

Public Member Functions

bool init (const ros::NodeHandle &nh)
 initialize gain settings from ROS parameter values
 PID (double p, double i, double d, double i_max, double i_min)
 Constructor.
 PID ()
 Constructor. Starts all gains and limits at zero.
void reset ()
 Reset integral wind-up term.
double update (double error, double dt)
 Run PID calculation and return control result.
double update (double error, double error_dot, double dt)
 Run PID calculation and return control result.

Protected Member Functions

bool checkGains ()
 Checks and fixes gain settings.

Protected Attributes

double d_gain_
 derivative gain
double error_last_
 Last error value, used for calculating error_dot when not provided.
double i_gain_
 integral gain
double i_max_
 integral gain min and max limits
double i_min_
double i_term_
 integral wind-up term
double p_gain_
 proportial gain

Detailed Description

Definition at line 45 of file pid.h.


Constructor & Destructor Documentation

robot_controllers::PID::PID ( double  p,
double  i,
double  d,
double  i_max,
double  i_min 
)

Constructor.

Parameters:
pproportional gain
iintegral gain
dderivative gain
i_maxintegral wind-up max value
i_minintegral wind-up min value

Definition at line 47 of file pid.cpp.

Constructor. Starts all gains and limits at zero.

Definition at line 58 of file pid.cpp.


Member Function Documentation

bool robot_controllers::PID::checkGains ( ) [protected]

Checks and fixes gain settings.

Returns:
true is gains are ok, false if gains are invalid

Definition at line 92 of file pid.cpp.

initialize gain settings from ROS parameter values

Definition at line 68 of file pid.cpp.

Reset integral wind-up term.

Definition at line 140 of file pid.cpp.

double robot_controllers::PID::update ( double  error,
double  dt 
)

Run PID calculation and return control result.

Parameters:
errorerror term (goal-actual)
dttimestep used for calculating derivative term and integral windup
Returns:
calculated PID command

PID derivate term is calculated from change in error value and dt

Definition at line 146 of file pid.cpp.

double robot_controllers::PID::update ( double  error,
double  error_dot,
double  dt 
)

Run PID calculation and return control result.

Parameters:
errorerror term (goal-actual)
error_dotvalue that is used for derivative term calculation
dttimestep used for integral windup
Returns:
calculated PID command

Definition at line 164 of file pid.cpp.


Member Data Documentation

double robot_controllers::PID::d_gain_ [protected]

derivative gain

Definition at line 99 of file pid.h.

Last error value, used for calculating error_dot when not provided.

Definition at line 107 of file pid.h.

double robot_controllers::PID::i_gain_ [protected]

integral gain

Definition at line 97 of file pid.h.

double robot_controllers::PID::i_max_ [protected]

integral gain min and max limits

Definition at line 101 of file pid.h.

double robot_controllers::PID::i_min_ [protected]

Definition at line 101 of file pid.h.

double robot_controllers::PID::i_term_ [protected]

integral wind-up term

Definition at line 104 of file pid.h.

double robot_controllers::PID::p_gain_ [protected]

proportial gain

Definition at line 95 of file pid.h.


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


robot_controllers
Author(s): Michael Ferguson
autogenerated on Wed Jun 14 2017 04:09:10