giuliomoro@149: /* giuliomoro@149: * Pid.h giuliomoro@149: * giuliomoro@149: * Created on: 14 Sep 2015 giuliomoro@149: * Author: giulio giuliomoro@149: */ giuliomoro@149: giuliomoro@149: #ifndef PID_H_ giuliomoro@149: #define PID_H_ giuliomoro@149: #include giuliomoro@149: giuliomoro@149: class Pid{ giuliomoro@149: private: giuliomoro@149: float integralError; giuliomoro@149: float pastError; giuliomoro@149: float error; giuliomoro@149: float differentialError; giuliomoro@149: float output; giuliomoro@149: float kp; giuliomoro@149: float ki; giuliomoro@149: float kd; giuliomoro@149: float ts; giuliomoro@149: int idleTimeout; giuliomoro@149: int timeoutCount; giuliomoro@149: void updateIntegralError(); giuliomoro@149: void updateDifferentialError(); giuliomoro@149: public: giuliomoro@149: Pid(); giuliomoro@149: float setError(float anError); giuliomoro@149: void setIdleTimeout(int aIdleTimeout); giuliomoro@149: float getOutput(); giuliomoro@149: }; giuliomoro@149: giuliomoro@149: giuliomoro@149: giuliomoro@149: #endif /* PID_H_ */