emlabcpp
modern opinionated embedded C++ library
emlabcpp::pid< TimeType > Struct Template Reference

Implementation of PID regulator, the object should be constructed and populated with pid<T>::conf structure with configuration values (p,i,d coeficients, min/max output vals). More...

#include <pid.h>

+ Collaboration diagram for emlabcpp::pid< TimeType >:

Public Types

using time_type = TimeType
 
using config = pid_config
 

Public Member Functions

 pid (time_type now, config const &conf=config{})
 

Public Attributes

config cfg
 
float i_sum = 0
 
float last_measured = 0
 
time_type last_time
 
float output
 

Detailed Description

template<typename TimeType>
struct emlabcpp::pid< TimeType >

Implementation of PID regulator, the object should be constructed and populated with pid<T>::conf structure with configuration values (p,i,d coeficients, min/max output vals).

The object contains all relevantstate data and should be called regularly.

based on http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

Member Typedef Documentation

◆ config

template<typename TimeType >
using emlabcpp::pid< TimeType >::config = pid_config

◆ time_type

template<typename TimeType >
using emlabcpp::pid< TimeType >::time_type = TimeType

Constructor & Destructor Documentation

◆ pid()

template<typename TimeType >
emlabcpp::pid< TimeType >::pid ( time_type  now,
config const &  conf = config{} 
)
inline

Member Data Documentation

◆ cfg

template<typename TimeType >
config emlabcpp::pid< TimeType >::cfg

◆ i_sum

template<typename TimeType >
float emlabcpp::pid< TimeType >::i_sum = 0

◆ last_measured

template<typename TimeType >
float emlabcpp::pid< TimeType >::last_measured = 0

◆ last_time

template<typename TimeType >
time_type emlabcpp::pid< TimeType >::last_time

◆ output

template<typename TimeType >
float emlabcpp::pid< TimeType >::output

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