diff --git a/README.md b/README.md index 136d41d..b751f47 100644 --- a/README.md +++ b/README.md @@ -100,5 +100,4 @@ void SetAntiWindupMode(iAwMode iAwMode); // Set iTerm anti-windup to iAwC #### Get [sTune](https://github.com/Dlloydev/sTune) [![arduino-library-badge](https://www.ardu-badge.com/badge/sTune.svg?)](https://www.ardu-badge.com/sTune) [![PlatformIO Registry](https://badges.registry.platformio.org/packages/dlloydev/library/sTune.svg)](https://registry.platformio.org/packages/libraries/dlloydev/sTune) -A very fast autotuner capable of on-the-fly tunings and more. Example: [Autotune_QuickPID.ino](https://github.com/Dlloydev/sTune/blob/main/examples/Autotune_QuickPID/Autotune_QuickPID.ino) - +A very fast autotuner capable of on-the-fly tunings and more. diff --git a/library.json b/library.json index 23b664c..de004bb 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "QuickPID", - "version": "3.1.1", + "version": "3.1.2", "description": "A fast PID controller with multiple options. Various Integral anti-windup, Proportional, Derivative and timer control modes.", "keywords": "PID, controller, signal, autotune, tuner, stune", "repository": diff --git a/library.properties b/library.properties index dff7f03..f75d60f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=QuickPID -version=3.1.1 +version=3.1.2 author=David Lloyd maintainer=David Lloyd sentence=A fast PID controller with multiple options. Various Integral anti-windup, Proportional and Derivative control modes. diff --git a/src/QuickPID.cpp b/src/QuickPID.cpp index 1c38bed..3dfdcca 100644 --- a/src/QuickPID.cpp +++ b/src/QuickPID.cpp @@ -1,5 +1,5 @@ /********************************************************************************** - QuickPID Library for Arduino - Version 3.1.1 + QuickPID Library for Arduino - Version 3.1.2 by dlloydev https://github.com/Dlloydev/QuickPID Based on the Arduino PID_v1 Library. Licensed under the MIT License. **********************************************************************************/ @@ -125,6 +125,7 @@ void QuickPID::SetTunings(float Kp, float Ki, float Kd, iAwMode iAwMode = iAwMode::iAwCondition) { if (Kp < 0 || Ki < 0 || Kd < 0) return; + if (Ki == 0) outputSum = 0; pmode = pMode; dmode = dMode; iawmode = iAwMode; dispKp = Kp; dispKi = Ki; dispKd = Kd; float SampleTimeSec = (float)sampleTimeUs / 1000000;