update with altimeter, swimfile.txt endleg.txt, etc see changes_13sep.txt also reset_PI()
Dependencies: mbed MODSERIAL FATFileSystem
Diff: OuterLoop/OuterLoop.cpp
- Revision:
- 11:3b241ecb75ed
- Parent:
- 10:085ab7328054
- Child:
- 14:85b64a4d08e8
--- a/OuterLoop/OuterLoop.cpp Mon Oct 23 12:50:53 2017 +0000 +++ b/OuterLoop/OuterLoop.cpp Fri Oct 27 00:37:32 2017 +0000 @@ -70,8 +70,13 @@ _pid.writeSetPoint(_SetPoint); } +float OuterLoop::getCommand() { + return _SetPoint; +} + float OuterLoop::getOutput() { - return _pid.getOutput(); + /* PID output + offset to drive the motors to the correct position */ + return _pid.getOutput() + _offset; } void OuterLoop::refreshPVState() { @@ -127,4 +132,12 @@ bool OuterLoop::toggleDeadband(bool toggle) { _pid.toggleDeadBand(toggle); return toggle; -} \ No newline at end of file +} + +void OuterLoop::setOutputOffset(float offset) { + _offset = offset; +} + +float OuterLoop::getOutputOffset() { + return _offset; +} \ No newline at end of file