Template for group 4
Dependencies: mbed
Fork of RT2_P3_students_G4 by
PI_Cntrl.cpp@0:78ca29b4c49e, 2018-04-03 (annotated)
- Committer:
- altb
- Date:
- Tue Apr 03 08:47:41 2018 +0000
- Revision:
- 0:78ca29b4c49e
- Child:
- 2:769ce5f06d3e
Cuboid Lab RT2 FS 2018
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb | 0:78ca29b4c49e | 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; |
altb | 0:78ca29b4c49e | 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 | |
altb | 0:78ca29b4c49e | 24 | // ... |
altb | 0:78ca29b4c49e | 25 | |
altb | 0:78ca29b4c49e | 26 | // -------- Anti-Windup -------- |
altb | 0:78ca29b4c49e | 27 | // ... |
altb | 0:78ca29b4c49e | 28 | // -------- Timeshift -------- |
altb | 0:78ca29b4c49e | 29 | |
altb | 0:78ca29b4c49e | 30 | |
altb | 0:78ca29b4c49e | 31 | } |