RasPi/CopterController/PID.h

23 lines
304 B
C
Raw Normal View History

2015-02-12 14:51:36 -07:00
/*
* pid.h
*/
#ifndef PID_H
#define PID_H
#include <ctime>
class PID
2015-02-12 14:51:36 -07:00
{
public:
PID( double p = 0, double i = 0, double d = 0 );
2015-02-12 14:51:36 -07:00
double update( double current, double desired );
private:
double pGain, iGain, dGain;
clock_t lastUpdate;
double integral, lastPosition;
};
#endif