Library containing essential automation elements with parameters in continuous Laplace domain, and implemented with fixed sample time. This means that "out" member functions should be called using Ticker object.
Dependents: CurrentMeasurement Zavrsni_rad_NXP_cup HC-SR04 Nucleo_SSD1306_DS1302_ESP8266_AM2320_BME280 ... more
I.h
- Committer:
- tbjazic
- Date:
- 2015-01-22
- Revision:
- 1:b9e11da0f2eb
- Parent:
- 0:3dd7aeceee65
File content as of revision 1:b9e11da0f2eb:
#ifndef I_H #define I_H #include "mbed.h" /** Transfer function of an integrator. * G(s) = Y(s) / U(s) = K_I / s * * Author(s): TVZ Mechatronics Team * */ class I { public: /** Default constructor. * K_I = 1, sampleTime = 0.1 */ I(); /** Integrator gain and sample time in seconds. */ I(double K_I, double sampleTime); /** Update integrator gain and sample time. */ void setParameters(double K_I, double sampleTime); /** Calculate the output y. */ double out(); /** Set the input u. */ void in(double u); private: double K_I, T_d, y, y_p1, u, u_p1; }; #endif // I_H