DUNE: Uniform Navigational Environment  2019.02.1
DUNE::Control::DiscretePID Class Reference

Public Member Functions

 DiscretePID (void)
 
 ~DiscretePID (void)
 
void setGains (const std::vector< float > &gains)
 
void setProportionalGain (float gain)
 
void setIntegralGain (float gain)
 
void setDerivativeGain (float gain)
 
void setOutputLimits (float lower, float upper)
 
void setIntegralLimits (float value)
 
void enableParcels (Tasks::Task *t, IMC::ControlParcel *p)
 
float step (double timestep, float error)
 
float step (double timestep, float error, float err_derivative)
 
void reset (void)
 

Constructor & Destructor Documentation

DUNE::Control::DiscretePID::DiscretePID ( void  )

Constructor.

References reset().

DUNE::Control::DiscretePID::~DiscretePID ( void  )

Destructor.

Member Function Documentation

void DUNE::Control::DiscretePID::enableParcels ( Tasks::Task t,
IMC::ControlParcel p 
)

Enable debug using control parcels logged using bus dispatch.

Parameters
[in]tpointer to a task object.
[in]ppointer to control parcel message.
void DUNE::Control::DiscretePID::reset ( void  )

Reset pid variables.

Referenced by DiscretePID().

void DUNE::Control::DiscretePID::setDerivativeGain ( float  gain)

Set derivative gain.

Parameters
[in]gainderivative gain p.
void DUNE::Control::DiscretePID::setGains ( const std::vector< float > &  gains)

Set PID gains using vector.

Parameters
[in]gainspid gains vector in order p, i, d.
void DUNE::Control::DiscretePID::setIntegralGain ( float  gain)

Set integral gain.

Parameters
[in]gainintegral gain i.
void DUNE::Control::DiscretePID::setIntegralLimits ( float  value)

Set integral bounds (limits).

Parameters
[in]valueabsolute value of bound, lower bound will be negative.
void DUNE::Control::DiscretePID::setOutputLimits ( float  lower,
float  upper 
)

Set output upper and lower limit.

Parameters
[in]lowerlower limit.
[in]upperupper limit.
void DUNE::Control::DiscretePID::setProportionalGain ( float  gain)

Set proportional gain.

Parameters
[in]gainproportional gain p.
float DUNE::Control::DiscretePID::step ( double  timestep,
float  error 
)

Step forward, using an internal error derivative estimate.

Parameters
[in]timestepamount of time to be used in derivative and integral part.
[in]errorerror between reference and measure.
Returns
pid output.
float DUNE::Control::DiscretePID::step ( double  timestep,
float  error,
float  err_derivative 
)

Step forward, using the supplied error derivative.

Parameters
[in]timestepamount of time to be used in derivative and integral part.
[in]errorerror between reference and measure.
[in]err_derivativeerror derivative.
Returns
pid output.

References DUNE::IMC::ControlParcel::d, DUNE::Tasks::Task::dispatch(), DUNE::IMC::ControlParcel::i, DUNE::IMC::ControlParcel::p, and DUNE::Math::trimValue().

Collaboration diagram for DUNE::Control::DiscretePID:
Collaboration graph