José Claudio / Mbed 2 deprecated QuadCopter-Sensor-Serial

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PID.h Source File

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