Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MODSERIAL FATFileSystem
Diff: OuterLoop/OuterLoop.cpp
- Revision:
- 11:3b241ecb75ed
- Parent:
- 10:085ab7328054
- Child:
- 14:85b64a4d08e8
diff -r 085ab7328054 -r 3b241ecb75ed OuterLoop/OuterLoop.cpp
--- 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