mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 10:05:46 -05:00
Removed useless class PIDController
This commit is contained in:
parent
67e664ef06
commit
af5579ad7d
@ -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;
|
||||
}
|
@ -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
|
Loading…
Reference in New Issue
Block a user