Removed useless class PIDController

This commit is contained in:
f4exb 2018-02-14 20:12:51 +01:00
parent 67e664ef06
commit af5579ad7d
2 changed files with 0 additions and 45 deletions

View File

@ -1,17 +0,0 @@
#include "pidcontroller.h"
PIDController::PIDController() :
m_p(0.0),
m_i(0.0),
m_d(0.0),
m_int(0.0),
m_diff(0.0)
{
}
void PIDController::setup(Real p, Real i, Real d)
{
m_p = p;
m_i = i;
m_d = d;
}

View File

@ -1,28 +0,0 @@
#ifndef INCLUDE_PIDCONTROLLER_H
#define INCLUDE_PIDCONTROLLER_H
#include "dsp/dsptypes.h"
class PIDController {
private:
Real m_p;
Real m_i;
Real m_d;
Real m_int;
Real m_diff;
public:
PIDController();
void setup(Real p, Real i, Real d);
Real feed(Real v)
{
m_int += v * m_i;
Real d = m_d * (m_diff - v);
m_diff = v;
return (v * m_p) + m_int + d;
}
};
#endif // INCLUDE_PIDCONTROLLER_H