Prius IPM controller

Dependencies:   mbed

Fork of analoghalls5_5 by N K

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers filters.h Source File

filters.h

00001 #ifndef __FILTERS_H
00002 #define __FILTERS_H
00003 
00004 class LtiFilter {
00005 public:
00006     virtual float Update(float x) {return x;}
00007 };
00008 
00009 class MeanFilter: public LtiFilter {
00010 public:
00011     MeanFilter(float strength);
00012     virtual float Update(float x);
00013 private:
00014     float _mean;
00015     float _strength;
00016 };
00017 
00018 class PidController {
00019 public:
00020     PidController(float ki, float kp, float kd, float out_max = 1.0f, float out_min = 0.0f);
00021     float Update(float ref, float in);
00022 private:
00023     float _ki, _kp, _kd;
00024     float _last_in, _integral;
00025     float _out_max, _out_min;
00026 }; 
00027 #endif