enhanced functionality in V01 vs. V00, V02 finished, conversion to double precsision in V03

Dependencies:   mbed

PI_Cntrl.h

Committer:
pmic
Date:
19 months ago
Revision:
12:e54941459353
Parent:
1:2e118d67eeae

File content as of revision 12:e54941459353:

class PI_Cntrl
{
public:

    PI_Cntrl(float Kp, float Tn, float Ts);
    PI_Cntrl(float Kp, float Tn, float Ts, float uMax);
    PI_Cntrl(float Kp, float Tn, float Ts, float uMax, float uMin);

    float operator()(float error) {
        return doStep((double)error);
    }

    virtual     ~PI_Cntrl();

    void        reset(float initValue);
    float       doStep(double error);

private:

    double b0;
    double b1;
    double b2;
    double s;
    double uMax;
    double uMin;
    
    void        setCoefficients(float Kp, float Tn, float Ts);

};