Fertig

Dependencies:   mbed

Fork of RT2_P3_students by TeamSurface

Committer:
Kiwicjam
Date:
Tue Apr 17 12:03:20 2018 +0000
Revision:
4:16f47c056c7c
Parent:
3:769ce5f06d3e
letzter stand;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kiwicjam 4:16f47c056c7c 1 #include "PI_Cntrl.h"
altb 0:78ca29b4c49e 2
altb 0:78ca29b4c49e 3 using namespace std;
altb 0:78ca29b4c49e 4
altb 0:78ca29b4c49e 5 PI_Cntrl::PI_Cntrl(float Kp, float Tn){
altb 0:78ca29b4c49e 6 this->Kp = Kp;
Kiwicjam 4:16f47c056c7c 7 this->Tn = Tn;
altb 0:78ca29b4c49e 8
altb 0:78ca29b4c49e 9 //...
altb 0:78ca29b4c49e 10
altb 0:78ca29b4c49e 11
altb 0:78ca29b4c49e 12 }
altb 0:78ca29b4c49e 13
altb 0:78ca29b4c49e 14
altb 0:78ca29b4c49e 15 PI_Cntrl::~PI_Cntrl() {}
altb 0:78ca29b4c49e 16
altb 0:78ca29b4c49e 17 void PI_Cntrl::reset(float initValue) {
altb 0:78ca29b4c49e 18 //...
altb 0:78ca29b4c49e 19
altb 0:78ca29b4c49e 20 }
altb 0:78ca29b4c49e 21
altb 0:78ca29b4c49e 22 float PI_Cntrl::doStep(float error){
altb 0:78ca29b4c49e 23
Kiwicjam 4:16f47c056c7c 24 // P
Kiwicjam 4:16f47c056c7c 25 return error*this->Kp;
altb 0:78ca29b4c49e 26 // -------- Anti-Windup --------
altb 0:78ca29b4c49e 27 // ...
altb 0:78ca29b4c49e 28 // -------- Timeshift --------
altb 0:78ca29b4c49e 29
altb 0:78ca29b4c49e 30
Kiwicjam 4:16f47c056c7c 31 }
Kiwicjam 4:16f47c056c7c 32