Hello

PID.h

Committer:
ChengHan
Date:
2018-11-22
Revision:
0:004c04a30fce

File content as of revision 0:004c04a30fce:

#ifndef PID_H
#define PID_H

#include "mbed.h"

class PID{
    public:

        PID(float setKp, float setKi, float setKd, float setSampletime);       
        void SetOutputLimits(float setoutputLimits_H, float setoutputLimits_L);
        void SetInputLimits(float setinputLimits_H, float setinputLimits_L);
        void Compute(float setreference, float setfeedbackvalue); 
        void PID::EnableAntiWindUp(float Ka_); 
        
        float Kp;
        float Ki;
        float Kd;
        float Ka;
 
        float error[3];
        float output;
        float reference;

        

        
        float sampletime;
        
        

    private:
    
        bool Outputlimit_bool;
        bool Inputlimit_bool;
        bool AntiWindUp_bool;
        
        float outputLimits_H;
        float outputLimits_L;
        float inputLimits_H;
        float inputLimits_L;
        
        float feedbackvalue;
 //       Ticker PID_timer;

};

#endif /* PID_H*/