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.
Diff: pid.h
- Revision:
- 10:332a4ad5911d
- Parent:
- 8:1ce513eff545
- Child:
- 11:8faa068940f1
--- a/pid.h Fri Dec 04 06:01:59 2015 +0000 +++ b/pid.h Sat Dec 05 00:41:23 2015 +0000 @@ -37,11 +37,31 @@ #ifndef PID_H #define PID_H + + + #include"mbed.h" #include "util.h" + + class ctrl{ public: + ctrl(){ + setKp(0); + setKi(0); + setKd(0); + setprevErr(0); + setErr(0); + setCorrection(0); + floategrater=1; + decay=1; + TErr=0; + RErr=0; + prevTime=0; + timer.start(); + } + void setKp(float num); void setKi(float num); @@ -63,6 +83,7 @@ float error; float ki; float kd; + float prevTime; float kp; float prevErr; float correction; @@ -70,7 +91,7 @@ float decay; float TErr; float RErr; - + Timer timer; }; #endif //PID_H