Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Updated SetTunings to clear outputSum variable if Ki parameter = 0.
Suggested by @brN2k, issue#48.
  • Loading branch information
Dlloydev committed Apr 3, 2022
1 parent a6cd128 commit d0611bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -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":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=QuickPID
version=3.1.1
version=3.1.2
author=David Lloyd
maintainer=David Lloyd <dlloydev@testcor.ca>
sentence=A fast PID controller with multiple options. Various Integral anti-windup, Proportional and Derivative control modes.
Expand Down
3 changes: 2 additions & 1 deletion src/QuickPID.cpp
Original file line number Diff line number Diff line change
@@ -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.
**********************************************************************************/
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d0611bc

Please sign in to comment.