Kobayashi Akihiro / ActiveCaster

Dependents:   ActiveCaster_ ActiveCaster_2

PIDclass.h

Committer:
e5119053f6
Date:
2022-01-24
Revision:
0:5e4f1e288e2a

File content as of revision 0:5e4f1e288e2a:

#ifndef PIDCLASS_h
#define PIDCLASS_h

#include "mbed.h"

class PID
{
public:
    PID(float xKp, float xKi, float xKd, float xint_time);
    float getCmd(float ref, float act, float maxcmd);
    void PIDinit(float ref, float act);
    void setPara(float xKp, float xKi, float xKd);

private:
    float preError;
    float intError;
    float Kp;
    float Ki;
    float Kd;
    float int_time;
    
    bool init_done;
    
};

#endif