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
I.cpp
00001 #include "I.h" 00002 00003 I::I() { 00004 u = y = u_p1 = y_p1 = 0; 00005 setParameters(1, 0.1); 00006 } 00007 00008 I::I(double K_I_, double T_d_) { 00009 u = y = u_p1 = y_p1 = 0; 00010 setParameters(K_I_, T_d_); 00011 } 00012 00013 void I::setParameters(double K_I_, double T_d_) { 00014 if (T_d_ > 0) 00015 T_d = T_d_; 00016 else 00017 T_d = 0.1; 00018 K_I = K_I_; 00019 } 00020 00021 double I::out() { 00022 y = y_p1 + K_I * T_d * u_p1; 00023 y_p1 = y; 00024 u_p1 = u; 00025 return y; 00026 } 00027 00028 void I::in(double u_) { 00029 u = u_; 00030 }
Generated on Thu Jul 14 2022 20:25:49 by
1.7.2
