rusefi-1/firmware/controllers/math/pid.h

30 lines
446 B
C
Raw Normal View History

2014-09-15 22:03:07 -07:00
/**
* @file pid.h
*
* @date Sep 16, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef PID_H_
#define PID_H_
class Pid {
public:
2014-09-16 14:03:03 -07:00
Pid(float pFactor, float iFactor, float dFactor, float minResult, float maxResult);
2014-09-15 23:02:58 -07:00
float getValue(float target, float input, float dTime);
2014-09-15 22:03:07 -07:00
private:
float pFactor;
float iFactor;
float dFactor;
2014-09-16 14:03:03 -07:00
float minResult;
float maxResult;
2014-09-15 22:03:07 -07:00
2014-09-15 23:02:58 -07:00
float integration;
float prevError;
2014-09-15 22:03:07 -07:00
};
#endif /* PID_H_ */