Giter VIP home page Giter VIP logo

Comments (7)

bakingbaking avatar bakingbaking commented on May 27, 2024

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.

bakingbaking avatar bakingbaking commented on May 27, 2024

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.

bakingbaking avatar bakingbaking commented on May 27, 2024

I wanted to add, thank you for both of your terrific PID packages!

from stune.

Dlloydev avatar Dlloydev commented on May 27, 2024

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:

image

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.

bakingbaking avatar bakingbaking commented on May 27, 2024

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.

Dlloydev avatar Dlloydev commented on May 27, 2024

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.

bakingbaking avatar bakingbaking commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.