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.
PID.h
00001 #ifndef PID_H 00002 #define PID_H 00003 00004 class PID 00005 { 00006 public: 00007 PID(float kp, float ki, float kd, float dt); 00008 00009 void setGains(float kp, float ki, float kd); 00010 void reset(); 00011 float compute(float setPoint, float currentPoint); 00012 00013 float getP(); 00014 float getI(); 00015 float getD(); 00016 00017 private: 00018 float kp, ki, kd, _pid; 00019 float dt; 00020 float lastErro, lastSumErro; 00021 float integral; 00022 }; 00023 00024 #endif
Generated on Tue Jul 19 2022 01:26:58 by
 1.7.2
 1.7.2