Comments (7)
Sorry, I left in the setpoint test. The code should be:
if (input > setpoint) reachedSetpoint = true;
if (reachedSetpoint && !debounce && setpoint > 0 ) optimumOutput = output - 4;
else optimumOutput = output;
if (optimumOutput < 0) optimumOutput = 0;
from stune.
Maybe we don't even need the setpoint test:
if (!debounce && setpoint > 0 ) optimumOutput = output - 4;
else optimumOutput = output;
if (optimumOutput < 0) optimumOutput = 0;
from stune.
I wanted to add, thank you for both of your terrific PID packages!
from stune.
Thank you for your interest in this and your comments.
When using software PWM, the control resolution for PID or sTune is 1 ms, but when using an SSR each half cycle represents 8.33ms for 60Hz AC, or 10ms for 50Hz AC. When controlling a load at low power (say we only need 10 cycles ON in each second to maintain the power at setpoint), then each half cycle would represent 5% of the required power. In this case, there would be a dead-band of 5% power before the change in output has any effect. This issue causes drifting of the input about the setpoint resulting in poor control resolution and additional overshoot. This issue becomes less significant when controlling at higher load levels as we get closer to the upper control limit.
The SoftPWM function tackles this issue by dropping out or adding in almost 1 AC cycle of control value to the output, but only when the input crosses the setpoint. This oscillatory control action about the setpoint improves response and provides tighter control.
Example plot showing optimum output SSR control, which has the effect of reducing overshoot and maintaining tighter regulation at the setpoint:
Here, you can see the initial half cycle dropout in the output just as the input crosses above the setpoint. Then, the output gradually, but not completely, enters a half cycle oscillatory action. The hardware used was an SSR controlling a 140W, 220℃ PTC heater with temperature setpoint at only 80℃.
from stune.
Thanks for the quick response.
What is the time scale of the graph?
Also, please what outputSpan and tuning rule was used for the example?
from stune.
I had the outputSpan set to 1000 and was plotting every 3rd sample, so each 100 on the scale is 300 sec (5 min).
Tuning rule was ZN_PID.
from stune.
Thank you so much!
I just realized the plot is from one of the sTune_QuickPID_Less_Overshoot examples.
This was really helpful.
from stune.
Related Issues (18)
- How to use sTune. (Doc issue? PBCAK?) HOT 8
- PTC Heater Requires Using `direct5T` Test HOT 3
- SSR High Mass System HOT 10
- "outputStep" is not working correct HOT 2
- Reset() doesn't properly re-initialize internal variables HOT 2
- After PID has run the heater doesn't reach it's setpoint HOT 1
- Big overshoot in tuning with NoOvershoot_PID HOT 1
- error in example HOT 1
- output always nan HOT 17
- PID does not work properly on my environment. HOT 4
- Noisy thermocouple input HOT 44
- Example sTune QuickPID Example dont work
- softPwm --> ledcWrite
- Relay Heater sTune HOT 20
- Relay heater example HOT 7
- Can't compile Autotune_PID_v1 example. HOT 1
- On startup, Integral Term Adds to Overshoot HOT 1
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 stune.