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
Diff: PID2.h
- Revision:
- 9:cefa177c1353
- Parent:
- 6:477382219bcf
diff -r 5ed6685f6edd -r cefa177c1353 PID2.h
--- a/PID2.h Sun Mar 31 20:31:30 2019 +0000
+++ b/PID2.h Fri Apr 05 16:11:28 2019 +0000
@@ -28,7 +28,7 @@
float compute (float currVal)
{
- float currErr = setPoint - currVal;
+ float currErr = currVal - setPoint;
float controlAction;
if (currVal > inMax_) {inMax_ = currVal;}
@@ -65,8 +65,8 @@
void assignLimitAddress(float *outMax, float *outMin)
{
- outMin_ = outMax;
- outMax_ = outMin;
+ outMin_ = outMin;
+ outMax_ = outMax;
}
float scaler(float prevMin, float prevMax, float newMin, float newMax, float var)