Comments (9)
Setting a high proportional constant (e.g. Kp=255, Kp=1e6...) makes the proportional band narrow, and then PID acts like bang-bang because either kPerror>outMax or kPerror<outMin.
Looks like AutoPID doesn't do anything at all to limit the integral:
Maybe it behaves as a sort of conditional integration, where integration is depends on being within the band.
AutoPID does expose the integral, so a user could periodically check if it was wound up above outMax or outMax-error*Kp, etc., and reset it as desired.
from arduino-pid-library.
I was playing around with it and added a SetIntegral(double)
and GetIntegral(double)
in this sample at Wokwi:
https://wokwi.com/projects/358122536159671297
(If you play with it, be sure to toggle the SerialMonitor/SerialPlotter graph icon in the lower right corner.
I added a pull request: #132
from arduino-pid-library.
will be taken care of in the next task cycle, no need to duplicate code.
from arduino-pid-library.
Why? If you don't reset the integral, then the tuning changes should be bumpless, per http://brettbeauregard.com/blog/2017/06/proportional-on-measurement-the-code/ and http://brettbeauregard.com/blog/2011/04/improving-the-beginner%e2%80%99s-pid-tuning-changes/
from arduino-pid-library.
In my case, resetting the integral helped a lot, it reduced the overshoot a lot.
from arduino-pid-library.
from arduino-pid-library.
Is this issue about overshoot? Or is it about SetTunings? I can't imagine the use-case for making SetTunings non- bumpless. I often operate heaters with PV far from zero, and resetting the integral to zero in SetTuning() would induce a bump.
If overshoot, I could see doing an integral reset to zero when crossing into the proportional zone at (SP-PV)>=outMax/kP.
from arduino-pid-library.
I used two parameters and they are toggled when the input is close to the setpoint.
Below 2.5 degrees uses a softer parameter, above 2.5 degrees difference uses a more aggressive parameter.
I saw an additional function in another library, maybe it's related to this behavior.
AutoPID::setBangBang
Ref.: AutoPID
from arduino-pid-library.
A smaller change to the library than #132 adding functions is to move the PID_v1.h:: outputSum variable from private up to public, which enables all sorts user-space tricks.
PR #133 -- Expose integral to enable user-space hacking:
It has a live example at https://wokwi.com/projects/358190033668210689
from arduino-pid-library.
Related Issues (20)
- Front-End download link is offline
- Systems with large time constant (Dead Time versus Time Constant)?
- Is the calculated PID result relative to the previous value or absolute on its own? HOT 2
- Is it possible to use the PID inside another class? HOT 2
- Output goes to 0 when above setpoint. HOT 2
- Add deadband HOT 1
- need esp32 PID example HOT 5
- basic example uses analogWrite(outputpin,DOUBLE) ! HOT 6
- Is there an Overflow in PID_RelayOutput.ino? HOT 2
- How to implement Interactive PID method with this library HOT 1
- No License File Included
- Where is version 1.2.0 ?
- Relay example seems backwards for digitalWrite(relayPin,HIGH) == On
- Microsecond update
- Proportional on measurement in PID::Compute seems to modify integral error
- esp32 adaptive tuning HOT 1
- PID Output Relay exemple HOT 2
- Kk
- Link to documentation just takes me to the Arduino Playground homepage HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-pid-library.