Skip to content

Commit d0611bc

Browse files
committed
Update
Updated SetTunings to clear outputSum variable if Ki parameter = 0. Suggested by @brN2k, issue#48.
1 parent a6cd128 commit d0611bc

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,4 @@ void SetAntiWindupMode(iAwMode iAwMode); // Set iTerm anti-windup to iAwC
100100
101101
#### 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)
102102
103-
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)
104-
103+
A very fast autotuner capable of on-the-fly tunings and more.

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "QuickPID",
3-
"version": "3.1.1",
3+
"version": "3.1.2",
44
"description": "A fast PID controller with multiple options. Various Integral anti-windup, Proportional, Derivative and timer control modes.",
55
"keywords": "PID, controller, signal, autotune, tuner, stune",
66
"repository":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=QuickPID
2-
version=3.1.1
2+
version=3.1.2
33
author=David Lloyd
44
maintainer=David Lloyd <dlloydev@testcor.ca>
55
sentence=A fast PID controller with multiple options. Various Integral anti-windup, Proportional and Derivative control modes.

src/QuickPID.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************************
2-
QuickPID Library for Arduino - Version 3.1.1
2+
QuickPID Library for Arduino - Version 3.1.2
33
by dlloydev https://github.com/Dlloydev/QuickPID
44
Based on the Arduino PID_v1 Library. Licensed under the MIT License.
55
**********************************************************************************/
@@ -125,6 +125,7 @@ void QuickPID::SetTunings(float Kp, float Ki, float Kd,
125125
iAwMode iAwMode = iAwMode::iAwCondition) {
126126

127127
if (Kp < 0 || Ki < 0 || Kd < 0) return;
128+
if (Ki == 0) outputSum = 0;
128129
pmode = pMode; dmode = dMode; iawmode = iAwMode;
129130
dispKp = Kp; dispKi = Ki; dispKd = Kd;
130131
float SampleTimeSec = (float)sampleTimeUs / 1000000;

0 commit comments

Comments
 (0)