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.
Dependencies: mbed
PID_Cntrl.h
00001 #ifndef PID_CNTRL_H_ 00002 #define PID_CNTRL_H_ 00003 00004 // PID Controller Class 00005 class PID_Cntrl 00006 { 00007 public: 00008 00009 PID_Cntrl(float Kp, float Ki, float Kd, float Tf, float Ts, float uMin, float uMax); 00010 00011 float operator()(float error) { 00012 return update((double)error); 00013 } 00014 00015 virtual ~PID_Cntrl(); 00016 00017 void reset(float initValue); 00018 float update(double error); 00019 00020 private: 00021 00022 // controller parameters (member variables) 00023 float Kp; 00024 float Ki; 00025 float Kd; 00026 float Tf; 00027 float Ts; 00028 float uMin; 00029 float uMax; 00030 00031 // storage for signals (member variables) 00032 float e_old; 00033 float uI_old; 00034 float uD_old; 00035 00036 }; 00037 00038 #endif 00039
Generated on Wed Jul 13 2022 01:08:03 by
1.7.2