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.
Dependents: Tourobo2022_TBCMotorDriver
Diff: Pid.cpp
- Revision:
- 1:4bc4c63ea283
- Parent:
- 0:630126b8994f
- Child:
- 2:7fede27af6ca
diff -r 630126b8994f -r 4bc4c63ea283 Pid.cpp
--- a/Pid.cpp Wed Dec 19 15:46:32 2018 +0000
+++ b/Pid.cpp Sun Jun 09 01:35:07 2019 +0000
@@ -34,13 +34,17 @@
break;
}
- if(duty > 0.95f) {
- duty = 0.95f;
- } else if (duty < -0.95f) {
- duty = -0.95f;
+ if(duty > 1.0f) {
+ duty = 1.0f;
+ } else if (duty < -1.0f) {
+ duty = -1.0f;
}
};
+void Pid::reset() {
+ duty = 0.0f;
+}
+
float Pid::getDuty() {
return duty;
}