Controlpp
Loading...
Searching...
No Matches
controlpp::timevar::IControl< T > Class Template Reference

An I (Integrator) controller, with varying smaple-time. More...

#include <controlpp/TimeVariantControl.hpp>

Public Types

using value_type = T
 

Public Member Functions

constexpr IControl (const T &ki)
 Constructs an I (Integrator) controller.
 
constexpr IControl (const IControl &)=default
 Default copy constructor.
 
constexpr void set_param (const T &ki)
 Sets the integrator gain.
 
constexpr void reset ()
 resets (clears) the internal states
 
constexpr T input (const T &u, const T &Ts)
 Adds a new value input and sample time to calculate the next output.
 
constexpr T operator() (const T &u, const T &Ts)
 Adds a new value input and sample time to calculate the next output.
 

Friends

constexpr ValueSampletimePair< T > operator>> (const ValueSampletimePair< T > &p, IControl &c)
 

Detailed Description

template<class T>
class controlpp::timevar::IControl< T >

An I (Integrator) controller, with varying smaple-time.

An I controller with the following transfer function:

\[ I(s) = \frac{k_i}{s} \]

discretised with the tustin transformation:

\[ s = \frac{2}{T_s} \frac{1 - z^{-1}}{1 + z^{-1}} \]

to the time series:

\[ y_k = \frac{k_i T_s}{2} \left( u_k + u_{k-1} \right) + y_{k-1} \]

where:

  • \(k_i\) is the integral gain
  • \(T_s\) is the sample time interval between uk−1uk−1​ and ukuk​ (in seconds)

allows varying sample-times \(T_s\)

Template Parameters
Tthe data type the controller uses, like float or double
See also
controlpp::IAntiWindup

Member Typedef Documentation

◆ value_type

template<class T >
using controlpp::timevar::IControl< T >::value_type = T

Constructor & Destructor Documentation

◆ IControl() [1/2]

template<class T >
constexpr controlpp::timevar::IControl< T >::IControl ( const T &  ki)
inlineconstexpr

Constructs an I (Integrator) controller.

Parameters
kiThe integrator constant.

◆ IControl() [2/2]

template<class T >
constexpr controlpp::timevar::IControl< T >::IControl ( const IControl< T > &  )
constexprdefault

Default copy constructor.

Member Function Documentation

◆ input()

template<class T >
constexpr T controlpp::timevar::IControl< T >::input ( const T &  u,
const T &  Ts 
)
inlineconstexpr

Adds a new value input and sample time to calculate the next output.

Also advances the internal states

Returns
The control output

◆ operator()()

template<class T >
constexpr T controlpp::timevar::IControl< T >::operator() ( const T &  u,
const T &  Ts 
)
inlineconstexpr

Adds a new value input and sample time to calculate the next output.

Also advances the internal states

Returns
The control output
See also
controlpp::I::input(const T& u, const T& Ts)

◆ reset()

template<class T >
constexpr void controlpp::timevar::IControl< T >::reset ( )
inlineconstexpr

resets (clears) the internal states

resets the internal states to zero

◆ set_param()

template<class T >
constexpr void controlpp::timevar::IControl< T >::set_param ( const T &  ki)
inlineconstexpr

Sets the integrator gain.

Parameters
kiThe integrator gain for the next sample

Friends And Related Symbol Documentation

◆ operator>>

template<class T >
constexpr ValueSampletimePair< T > operator>> ( const ValueSampletimePair< T > &  p,
IControl< T > &  c 
)
friend

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