Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of AutomationElements by
PT2cc.h
00001 #ifndef PT2cc_H 00002 #define PT2cc_H 00003 00004 #include "mbed.h" 00005 00006 /** Transfer function of a general PT2 form. cc stands for conjugate-complex. 00007 * G(s) = Y(s) / U(s) = K w_n^2 / ( s^2 + 2 zeta w_n + w_n^2 ) 00008 * 00009 * Author(s): TVZ Mechatronics Team 00010 * 00011 */ 00012 class PT2cc { 00013 public: 00014 /** Default constructor. 00015 * K = 1, zeta = 0.707, w_n = 1 rad/s, sampleTime = 0.1 s. 00016 */ 00017 PT2cc(); 00018 /** PT2cc transfer function parameters K, zeta, w_n and sample time in seconds. */ 00019 PT2cc(double K, double zeta, double w_n, double sampleTime); 00020 /** Update PT2cc transfer function parameters and sample time. */ 00021 void setParameters(double K, double zeta, double w_n, double sampleTime); 00022 /** Calculate the output y. */ 00023 double out(); 00024 /** Set the input u. */ 00025 void in(double u); 00026 private: 00027 double K, zeta, w_n, T_d, a, b, c, d, e, a_1, a_2, b_1, b_2, y, y_p1, y_p2, u, u_p1, u_p2; 00028 }; 00029 00030 #endif // PT2cc_H
Generated on Thu Jul 14 2022 20:25:49 by
1.7.2
