Skip to content

Class Controller

template <typename refs_T, typename meas_T, typename outputs_T, typename params_T>

ClassList > Controller

Controller interface for various inherited class like pid, rst, pr,...More...

  • #include <controller.h>

Public Functions

Type Name
virtual void calculate (void) = 0
calculate a new command value according to a reference fixed using setReference method and a measuremnt fixed usingsetMeasurement .
virtual outputs_T calculateWithReturn (refs_T yref, meas_T y)
calculate a new command value according the argument values
virtual outputs_T getOutput ()
retrieve the last command value calculated.
virtual int8_t init (params_T parameters) = 0
initialize the controller.
virtual void reset (void) = 0
reset internal states and the last command of the controller.
virtual outputs_T saturate (outputs_T u)
limit the argument u betweenupper_bound andlower_bound it is called by thecalculate method.
virtual void setMeasurement (meas_T measure)
capture a new measurement.
virtual void setReference (refs_T reference)
capture a new reference.

Protected Attributes

Type Name
float32_t _Ts
outputs_T _lower_bound
meas_T _measure
outputs_T _output
refs_T _reference
outputs_T _upper_bound

Detailed Description

Date:

2024

Author:

RĂ©gis Ruelland [email protected]

Author:

Luiz Villa [email protected]

Author:

Guillaume Arthaud.

Template parameters:

  • refs_T type of the reference
  • meas_T type of the measure
  • outputs_T type of the output
  • params_T type of the parameter

Parameters:

  • parameters structure including all parameters needs to make calculations.

we assume that outputs_T has already an order relation implemented.

Public Functions Documentation

function calculate

calculate a new command value according to a reference fixed using setReference method and a measuremnt fixed usingsetMeasurement .

virtual void Controller::calculate (
    void
) = 0

The new command value can be captured using the get_output method.


function calculateWithReturn

calculate a new command value according the argument values

inline virtual outputs_T Controller::calculateWithReturn (
    refs_T yref,
    meas_T y
) 

Parameters:

  • yrefs reference
  • y measure

Returns:

new command value.


function getOutput

retrieve the last command value calculated.

inline virtual outputs_T Controller::getOutput () 

Returns:


function init

initialize the controller.

virtual int8_t Controller::init (
    params_T parameters
) = 0

Parameters:

  • parameters

Returns:

0 if ok -EINVAL else.


function reset

virtual void Controller::reset (
    void
) = 0

function saturate

limit the argument u betweenupper_bound andlower_bound it is called by thecalculate method.

inline virtual outputs_T Controller::saturate (
    outputs_T u
) 

Parameters:

  • u should be a command value.

Returns:


function setMeasurement

capture a new measurement.

inline virtual void Controller::setMeasurement (
    meas_T measure
) 

Parameters:

  • measure

function setReference

capture a new reference.

inline virtual void Controller::setReference (
    refs_T reference
) 

Parameters:

  • reference

Protected Attributes Documentation

variable _Ts

float32_t Controller< refs_T, meas_T, outputs_T, params_T >::_Ts;

variable _lower_bound

outputs_T Controller< refs_T, meas_T, outputs_T, params_T >::_lower_bound;

variable _measure

meas_T Controller< refs_T, meas_T, outputs_T, params_T >::_measure;

variable _output

outputs_T Controller< refs_T, meas_T, outputs_T, params_T >::_output;

variable _reference

refs_T Controller< refs_T, meas_T, outputs_T, params_T >::_reference;

variable _upper_bound

outputs_T Controller< refs_T, meas_T, outputs_T, params_T >::_upper_bound;


The documentation for this class was generated from the following file docs/controlLibrary/src/controller.h