The crux of a PID controller is:-

output = Kp * error + Ki * integral + Kd * derivative

So typically there is proportionality and a continuously varying (analogue) output. In the case of a simple process like a domestic gas boiler, the boiler is either fully on or fully off. Or, say a cooling fan that can only be switched on or off to keep something cold.

In these cases, can a PID controller be used at all? There is still an error term. Or would an alternative form of control be necessary?

  • I wondered this when I was given the option to calibrate the PID on the heated bed of my 3D printer. I assumed they misappropriated the term, and it was calibrating by empirically measuring the heat-up-time and overshoot distance, so it can turn off “early”, to avoid overshooting. – Jonathan R Swift Sep 7 at 0:39
  • 3
    You can of course vary the output of a heater via PWM - this works even at a low frequency, particularly for systems with a slow response – Jonathan R Swift Sep 7 at 0:40
  • 1
    Most discrete PID controllers (type 1/32 DIN pid controller into google) have an output that is on/off. The 'PID'ness derives a proportional output, but that is then typically converted to PWM signal, so at any instant the controlled element is full on or full off, but over time it averages to the proportional element. This is how the PID on most 3D printers (bed and nozzle) works, and probably in most electrical heating operations (like, say, my espresso machine). – achrn Sep 7 at 7:17
  • Having just swapped a 30 year old heating system for a new one, domestic gas boilers are not "simple" any more, at least in the UK. I haven't figured out exactly what my new one is doing yet, but it seems to have "analogue" control of both the circulation pump speed and the heating water temperature - and it certainly keeps the room thermostat setting within 0.1C, 24 hours a day. It's not just a simple mechanical thermostat (with about 5 degrees C of backlash) and an on/off switch to the gas supply, like the old one was. – alephzero Sep 7 at 7:54
  • 1
    I seriously disagree with "nothing wrong". While PID can be used for this, first, it's totally an overkill and a waste of resources, and then it may result in pretty bad results, including accidents and device destruction in case you botch the parameters (and e.g. the boiler overheats because PID overshot the control so far it takes a long time to drop off below the 'off' threshold). Normally you use a simple hysteresis controller for such applications. T<Tmin: on. T>Tmax: off. Tmin<T<Tmax: hold current state. Cheap, and too simple to fail. – SF. Dec 6 at 12:05

Yes, a PID controller does not know of the system it is controlling. It is perfectly fine to turn the control signal to binary on/off that is beyond the scope of the controller itself.

What the system does is unknown to the PID. There might be some lag, some predictive component or anything in the system between it and the controller. So even though its a PID controller does not mean it has to controll what you think is obvious. Hell, the PID may be inside or control another controller**.

Second, the description of PID allows for many implementations to occur. The formula above is more a abstraction instrument, to categorize rather than a this is how you implement a PID*. A lot of things are PID controllers even though they may do the terms differently than the formula says. For example the integrative term may just be a history dependent term, nowhere does it say it has to integrate the error over the lifespan of the machine. Instead it may be a time limited slice too implemented like say a running average. The values may be capped and have some of the later systems features reduced into them.

* Although, since you can abstract to this then you might as well use it as a guide to implement. But then many things are PID controllers implicitly like spring/shock absorber systems and hydraulic pistons.

** So while one can be tuning a PID, does not mean the entire overall controller is a PID

  • So at what point does the controller turn on the thingie? That seems to require a threshold value, and it means introducing another variable into the PID system, which traditionally only has the three K coefficient variables. Or do you simply use PWM to emulate an analogue output? – Paul Uszak Sep 7 at 11:46
  • @PaulUszak can be a simple threshold or there can be hysteresis on it, However as joojaa said the PID can be just a part of the larger control system. – ratchet freak Sep 7 at 12:31
  • What I meant was that such a Boolean PID system would have four variables that require tuning, making the thing harder with yet another dimension. I've not seen anything about that... – Paul Uszak Sep 7 at 12:47
  • 1
    @PaulUszak No it does not need one the PID controllwer will automatically adjust itself to whatever the treshold is. So its totally irelevant – joojaa Sep 7 at 13:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.