PID

Dependencies:   BLE_API mbed nRF51822

PID.h

Committer:
stoicancristi
Date:
2016-10-24
Revision:
0:1f4d5c5491b8
Child:
1:d3e12393b71d

File content as of revision 0:1f4d5c5491b8:

#ifndef _PID_H_
#define _PID_H_

#include "mbed.h"
#include "math.h"

#define Te 100
#define SUPERIOR_MARGIN 100
#define INFERIOR_MARGIN 0 

typedef struct
{
    float last_error;
    float integral;
}PID_static;

class PIDClass
{
     public:   
        PIDClass(int _Kr, int _Ki, int _Kd, int _SetPoint);

        float ComputeCommand(float inputADC);
        
     private:
        int Kr;
        int Ki;
        int Kd;   
        int SetPoint;
};

#endif