From c3f64fa24bbd6c0ff00ae9ffa08e0bba0890dba0 Mon Sep 17 00:00:00 2001 From: Dlloydev Date: Sat, 10 Jun 2023 15:40:52 -0400 Subject: [PATCH] Update Adds the SetOutputSum(sum); function --- README.md | 1 + library.json | 2 +- library.properties | 2 +- src/QuickPID.cpp | 7 ++++++- src/QuickPID.h | 3 +++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ba8c4ec..c913885 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ void SetSampleTimeUs(uint32_t NewSampleTimeUs); // Set PID compute sample time, void SetProportionalMode(pMode pMode); // Set pTerm based on error (default), measurement, or both void SetDerivativeMode(dMode dMode); // Set the dTerm, based error or measurement (default). void SetAntiWindupMode(iAwMode iAwMode); // Set iTerm anti-windup to iAwCondition, iAwClamp or iAwOff +void SetOutputSum(float sum); // sets the output summation value ``` ### Autotuner diff --git a/library.json b/library.json index 3a8ff31..acf6266 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "QuickPID", - "version": "3.1.8", + "version": "3.1.9", "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 cb41dbc..f264393 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=QuickPID -version=3.1.8 +version=3.1.9 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 fd1792d..3753611 100644 --- a/src/QuickPID.cpp +++ b/src/QuickPID.cpp @@ -1,5 +1,5 @@ /********************************************************************************** - QuickPID Library for Arduino - Version 3.1.8 + QuickPID Library for Arduino - Version 3.1.9 by dlloydev https://github.com/Dlloydev/QuickPID Based on the Arduino PID_v1 Library. Licensed under the MIT License. **********************************************************************************/ @@ -262,6 +262,11 @@ void QuickPID::Reset() { dTerm = 0; } +// sets the output summation value +void QuickPID::SetOutputSum(float sum) { + outputSum = sum; +} + /* Status Functions************************************************************ These functions query the internal state of the PID. ******************************************************************************/ diff --git a/src/QuickPID.h b/src/QuickPID.h index 5f327ac..66352e9 100644 --- a/src/QuickPID.h +++ b/src/QuickPID.h @@ -73,6 +73,9 @@ class QuickPID { void SetAntiWindupMode(iAwMode iAwMode); void SetAntiWindupMode(uint8_t IawMode); + // sets the output summation value + void SetOutputSum(float sum); + void Initialize(); // Ensure a bumpless transfer from manual to automatic mode void Reset(); // Clears pTerm, iTerm, dTerm and outputSum values