Forums

PID Heater Control

Started by rickman November 22, 2015
Den mandag den 23. november 2015 kl. 23.08.39 UTC+1 skrev rickman:
> On 11/23/2015 4:11 PM, George Herold wrote: > > On Monday, November 23, 2015 at 3:07:59 PM UTC-5, Tim Wescott wrote: > >> On Mon, 23 Nov 2015 14:48:16 -0500, rickman wrote: > >> > >>> On 11/23/2015 2:17 PM, Tim Wescott wrote: > >>>> On Mon, 23 Nov 2015 13:43:30 -0500, rickman wrote: > >>>> > >>>>> On 11/23/2015 1:07 PM, Tim Wescott wrote: > >>>>>> On Sun, 22 Nov 2015 14:33:55 -0500, rickman wrote: > >>>>>> > >>>>>>> If a heater is controlled by turning it on and off, does a PID > >>>>>>> algorithm help in more closely controlling the temperature? > >>>>>>> > >>>>>>> Will running the PID loop faster than the temperature measurement > >>>>>>> improve anything? > >>>>>>> > >>>>>>> How would a PID control be an improvement over a simple temperature > >>>>>>> comparison with or without an anticipator? > >>>>>> > >>>>>> On a totally different line of thought than my previous response: > >>>>>> > >>>>>> A traditional thermostat/anticipator acts, more or less, like a > >>>>>> proportional-derivative controller with a relay output ("relay" is > >>>>>> just control systems jargon for an on-off switch). There's usually > >>>>>> hysteresis in the switch, but that's not uncommon with relay-output > >>>>>> controllers, and it's the anticipator that -- more or less -- > >>>>>> provides the derivative action. > >>>>>> > >>>>>> (Note the "more or less" -- "sorta-kinda" might be better. At any > >>>>>> rate, don't get wrapped around the axle if it's not exactly the same > >>>>>> -- > >>>>>> because it isn't.) > >>>>>> > >>>>>> Such a system will still show some sensitivity of the long-term > >>>>>> average controlled temperature to ambient conditions -- your plant > >>>>>> (or house, whatever) will be a bit colder on average when ambient is > >>>>>> colder, and warmer on average when ambient is warmer. > >>>>>> > >>>>>> Putting a bit of integrator action into a controller like that will, > >>>>>> perforce, guarantee that the average temperature of the plant is as > >>>>>> close to correct as can be achieved with available sensors. It won't > >>>>>> prevent the heat from cycling up and down, however -- that's a > >>>>>> consequence of turning the heat on and off close to, or slower than, > >>>>>> the thermal time constant of the plant. > >>>>>> > >>>>>> Whether the benefit from integral action in the controller is worth > >>>>>> the effort in such a circumstance is going to depend on the > >>>>>> individual cases. I suspect that in general it won't, but I'm sure > >>>>>> there are edge cases where it'll be all that's needed. > >>>>> > >>>>> It is not clear to me that your assumptions are correct. For example, > >>>>> ignoring the issue of the anticipator, the idea that without an > >>>>> integral term in the control loop, the average temperature will be > >>>>> sensitive to the ambient isn't clear to me. Consider the controlled > >>>>> temperature as a function of time in two cases. In one case the heat > >>>>> leaking from the chamber is 1/10 the rate at which the heating element > >>>>> adds heat and in the other case heat leaks at 1/2 the rate of the > >>>>> heater. The control loop is a simple temperature set point with a > >>>>> fixed amount of plus and minus hysteresis. In the 1/10 rate case the > >>>>> heat will be on 1/10 of the time. The graph will be a saw tooth with > >>>>> the warming slope being 1/9th the width of the cooling slope. The > >>>>> average temperature will be the set point. The 1/2 cooling rate will > >>>>> give a sawtooth graph with equal heating and cooling periods... and > >>>>> again the average temperature will be the set point. > >>>>> > >>>>> What periods of heating and cooling would you expect a PID controller > >>>>> could provide if it is not using PWM modulation of the heating, but > >>>>> rather the PID loop directly turns the heat on or off? > >>>>> > >>>>> If heating a house, the furnace should not be cycled too often, so > >>>>> there is no opportunity to modulate the heat cycle over short periods. > >>>>> However, the system is question is an electric oven so such modulation > >>>>> would be possible, but only by adding another layer of complexity to > >>>>> the code which is not what is being discussed. > >>>> > >>>> I'm not going to spend my free time simulating your system for you. > >>>> That's what you're paid to do. So why don't you spend your free -- or > >>>> paid -- time simulating your system for you? > >>>> > >>>> I've done this stuff before, it's too long for me to remember the > >>>> detailed answer, but I do remember that when you actually take the > >>>> trouble to simulate the system, or calculate it's behavior > >>>> mathematically, you find a dependency on average temperature with > >>>> ambient. > >>> > >>> I'm not asking you to simulate anything. I just described a system > >>> simple enough to be simulated in your head and gave you the result. It > >>> may be somewhat unrealistic given the vagaries of real world situations, > >>> but it is clear enough to show a set point controller maintains an > >>> average temperature controlled by the set point when the cooling losses > >>> are constant, at least to a first order approximation. > >> > >> Well, there you go. You're smarter than the resident control expert. > >> > >> Have fun! > > > > Rick may not want to be "prickly", but he often comes across that way. > > I'll take him at his word though. No insult intended Rick, but smart > > people sometimes are less adept at the social graces. > > Certainly there is no intent to tick people off. I guess it just comes > naturally... ?? I consider it to be a shortcoming of the medium. I > write with a deadpan emotional intent, most of the time, but I guess it > must be read as though I am trying to offend. > > I really don't know what Tim is ticked off about. I give a *very* > simple example that can be considered entirely in your mind and describe > the results. Tim seems to think it requires simulation and gets mad > about it when I point out how simple it is. Or maybe I'm not > understanding what he is upset about. Don't know. > > > > Besides driving the error signal to zero, doesn't a PI controller also > > have a faster response, compared to just P? Instead of a flat gain, > > you get more gain at lower frequencies. (That might not be right.. > > I'm far from a control expert :^) > > Ok, but your model assumes there is some variability to the control I > think. If the control consists of deciding on each cycle of the PID > loop whether to turn the heater on or off, how does a PID controller > improve response? If the desire is to turn the heater on at a smaller > deviation from the set point, the hysteresis can be set closer to the > set point, no? To be honest, if you don't care how often the heat is > turned on, why would you even need hysteresis? Just turn on the heat > when the temperature is below the set point and off again when the set > point is reached. Then the only issue is the overshoot from the thermal > mass of the heating element. An anticipator can help with that. > > The other point was that running the PID loop faster than the > temperature is updated seems pointless. The person who has designed > this approach creates a process for each part of the algorithm, one for > measuring the temperature, one for running the PID and others. I'm not > clear at all why he thinks the PID is usefully run faster than the > temperature is updated. I can't get anything out of him other than > because "it's fun". I'm just trying to understand how a PID controller > can work better than the set point controller when there is no > proportional control over the heat, just on and off. > > The only thing I can think is that the PID, when properly designed, will > inherently consider the thermal mass of the heating element while with > the set point controller it has to be accounted for by an anticipator. > Even so, I don't see the two as much similar, is that wrong? > > BTW, who is "the resident control expert"? >
http://www.amazon.com/Applied-Control-Embedded-Systems-Technology/dp/0750678399 -Lasse
Lasse Langwadt Christensen <langwadt@fonz.dk> wrote:
> Den mandag den 23. november 2015 kl. 23.08.39 UTC+1 skrev rickman: >> On 11/23/2015 4:11 PM, George Herold wrote: >> > On Monday, November 23, 2015 at 3:07:59 PM UTC-5, Tim Wescott wrote: >> >> On Mon, 23 Nov 2015 14:48:16 -0500, rickman wrote: >> >> >> >>> On 11/23/2015 2:17 PM, Tim Wescott wrote: >> >>>> On Mon, 23 Nov 2015 13:43:30 -0500, rickman wrote: >> >>>> >> >>>>> On 11/23/2015 1:07 PM, Tim Wescott wrote: >> >>>>>> On Sun, 22 Nov 2015 14:33:55 -0500, rickman wrote: >> >>>>>> >> >>>>>>> If a heater is controlled by turning it on and off, does a PID >> >>>>>>> algorithm help in more closely controlling the temperature? >> >>>>>>> >> >>>>>>> Will running the PID loop faster than the temperature measurement >> >>>>>>> improve anything? >> >>>>>>> >> >>>>>>> How would a PID control be an improvement over a simple temperature >> >>>>>>> comparison with or without an anticipator? >> >>>>>> >> >>>>>> On a totally different line of thought than my previous response: >> >>>>>> >> >>>>>> A traditional thermostat/anticipator acts, more or less, like a >> >>>>>> proportional-derivative controller with a relay output ("relay" is >> >>>>>> just control systems jargon for an on-off switch). There's usually >> >>>>>> hysteresis in the switch, but that's not uncommon with relay-output >> >>>>>> controllers, and it's the anticipator that -- more or less -- >> >>>>>> provides the derivative action. >> >>>>>> >> >>>>>> (Note the "more or less" -- "sorta-kinda" might be better. At any >> >>>>>> rate, don't get wrapped around the axle if it's not exactly the same >> >>>>>> -- >> >>>>>> because it isn't.) >> >>>>>> >> >>>>>> Such a system will still show some sensitivity of the long-term >> >>>>>> average controlled temperature to ambient conditions -- your plant >> >>>>>> (or house, whatever) will be a bit colder on average when ambient is >> >>>>>> colder, and warmer on average when ambient is warmer. >> >>>>>> >> >>>>>> Putting a bit of integrator action into a controller like that will, >> >>>>>> perforce, guarantee that the average temperature of the plant is as >> >>>>>> close to correct as can be achieved with available sensors. It won't >> >>>>>> prevent the heat from cycling up and down, however -- that's a >> >>>>>> consequence of turning the heat on and off close to, or slower than, >> >>>>>> the thermal time constant of the plant. >> >>>>>> >> >>>>>> Whether the benefit from integral action in the controller is worth >> >>>>>> the effort in such a circumstance is going to depend on the >> >>>>>> individual cases. I suspect that in general it won't, but I'm sure >> >>>>>> there are edge cases where it'll be all that's needed. >> >>>>> >> >>>>> It is not clear to me that your assumptions are correct. For example, >> >>>>> ignoring the issue of the anticipator, the idea that without an >> >>>>> integral term in the control loop, the average temperature will be >> >>>>> sensitive to the ambient isn't clear to me. Consider the controlled >> >>>>> temperature as a function of time in two cases. In one case the heat >> >>>>> leaking from the chamber is 1/10 the rate at which the heating element >> >>>>> adds heat and in the other case heat leaks at 1/2 the rate of the >> >>>>> heater. The control loop is a simple temperature set point with a >> >>>>> fixed amount of plus and minus hysteresis. In the 1/10 rate case the >> >>>>> heat will be on 1/10 of the time. The graph will be a saw tooth with >> >>>>> the warming slope being 1/9th the width of the cooling slope. The >> >>>>> average temperature will be the set point. The 1/2 cooling rate will >> >>>>> give a sawtooth graph with equal heating and cooling periods... and >> >>>>> again the average temperature will be the set point. >> >>>>> >> >>>>> What periods of heating and cooling would you expect a PID controller >> >>>>> could provide if it is not using PWM modulation of the heating, but >> >>>>> rather the PID loop directly turns the heat on or off? >> >>>>> >> >>>>> If heating a house, the furnace should not be cycled too often, so >> >>>>> there is no opportunity to modulate the heat cycle over short periods. >> >>>>> However, the system is question is an electric oven so such modulation >> >>>>> would be possible, but only by adding another layer of complexity to >> >>>>> the code which is not what is being discussed. >> >>>> >> >>>> I'm not going to spend my free time simulating your system for you. >> >>>> That's what you're paid to do. So why don't you spend your free -- or >> >>>> paid -- time simulating your system for you? >> >>>> >> >>>> I've done this stuff before, it's too long for me to remember the >> >>>> detailed answer, but I do remember that when you actually take the >> >>>> trouble to simulate the system, or calculate it's behavior >> >>>> mathematically, you find a dependency on average temperature with >> >>>> ambient. >> >>> >> >>> I'm not asking you to simulate anything. I just described a system >> >>> simple enough to be simulated in your head and gave you the result. It >> >>> may be somewhat unrealistic given the vagaries of real world situations, >> >>> but it is clear enough to show a set point controller maintains an >> >>> average temperature controlled by the set point when the cooling losses >> >>> are constant, at least to a first order approximation. >> >> >> >> Well, there you go. You're smarter than the resident control expert. >> >> >> >> Have fun! >> > >> > Rick may not want to be "prickly", but he often comes across that way. >> > I'll take him at his word though. No insult intended Rick, but smart >> > people sometimes are less adept at the social graces. >> >> Certainly there is no intent to tick people off. I guess it just comes >> naturally... ?? I consider it to be a shortcoming of the medium. I >> write with a deadpan emotional intent, most of the time, but I guess it >> must be read as though I am trying to offend. >> >> I really don't know what Tim is ticked off about. I give a *very* >> simple example that can be considered entirely in your mind and describe >> the results. Tim seems to think it requires simulation and gets mad >> about it when I point out how simple it is. Or maybe I'm not >> understanding what he is upset about. Don't know. >> >> >> > Besides driving the error signal to zero, doesn't a PI controller also >> > have a faster response, compared to just P? Instead of a flat gain, >> > you get more gain at lower frequencies. (That might not be right.. >> > I'm far from a control expert :^) >> >> Ok, but your model assumes there is some variability to the control I >> think. If the control consists of deciding on each cycle of the PID >> loop whether to turn the heater on or off, how does a PID controller >> improve response? If the desire is to turn the heater on at a smaller >> deviation from the set point, the hysteresis can be set closer to the >> set point, no? To be honest, if you don't care how often the heat is >> turned on, why would you even need hysteresis? Just turn on the heat >> when the temperature is below the set point and off again when the set >> point is reached. Then the only issue is the overshoot from the thermal >> mass of the heating element. An anticipator can help with that. >> >> The other point was that running the PID loop faster than the >> temperature is updated seems pointless. The person who has designed >> this approach creates a process for each part of the algorithm, one for >> measuring the temperature, one for running the PID and others. I'm not >> clear at all why he thinks the PID is usefully run faster than the >> temperature is updated. I can't get anything out of him other than >> because "it's fun". I'm just trying to understand how a PID controller >> can work better than the set point controller when there is no >> proportional control over the heat, just on and off. >> >> The only thing I can think is that the PID, when properly designed, will >> inherently consider the thermal mass of the heating element while with >> the set point controller it has to be accounted for by an anticipator. >> Even so, I don't see the two as much similar, is that wrong? >> >> BTW, who is "the resident control expert"? >> > > http://www.amazon.com/Applied-Control-Embedded-Systems-Technology/dp/0750678399
Ha!
On 11/23/2015 06:02 PM, Cydrome Leader wrote:
> Lasse Langwadt Christensen <langwadt@fonz.dk> wrote: >> Den mandag den 23. november 2015 kl. 23.08.39 UTC+1 skrev rickman: >>> On 11/23/2015 4:11 PM, George Herold wrote: >>>> On Monday, November 23, 2015 at 3:07:59 PM UTC-5, Tim Wescott wrote: >>>>> On Mon, 23 Nov 2015 14:48:16 -0500, rickman wrote: >>>>> >>>>>> On 11/23/2015 2:17 PM, Tim Wescott wrote: >>>>>>> On Mon, 23 Nov 2015 13:43:30 -0500, rickman wrote: >>>>>>> >>>>>>>> On 11/23/2015 1:07 PM, Tim Wescott wrote: >>>>>>>>> On Sun, 22 Nov 2015 14:33:55 -0500, rickman wrote: >>>>>>>>> >>>>>>>>>> If a heater is controlled by turning it on and off, does a PID >>>>>>>>>> algorithm help in more closely controlling the temperature? >>>>>>>>>> >>>>>>>>>> Will running the PID loop faster than the temperature measurement >>>>>>>>>> improve anything? >>>>>>>>>> >>>>>>>>>> How would a PID control be an improvement over a simple temperature >>>>>>>>>> comparison with or without an anticipator? >>>>>>>>> >>>>>>>>> On a totally different line of thought than my previous response: >>>>>>>>> >>>>>>>>> A traditional thermostat/anticipator acts, more or less, like a >>>>>>>>> proportional-derivative controller with a relay output ("relay" is >>>>>>>>> just control systems jargon for an on-off switch). There's usually >>>>>>>>> hysteresis in the switch, but that's not uncommon with relay-output >>>>>>>>> controllers, and it's the anticipator that -- more or less -- >>>>>>>>> provides the derivative action. >>>>>>>>> >>>>>>>>> (Note the "more or less" -- "sorta-kinda" might be better. At any >>>>>>>>> rate, don't get wrapped around the axle if it's not exactly the same >>>>>>>>> -- >>>>>>>>> because it isn't.) >>>>>>>>> >>>>>>>>> Such a system will still show some sensitivity of the long-term >>>>>>>>> average controlled temperature to ambient conditions -- your plant >>>>>>>>> (or house, whatever) will be a bit colder on average when ambient is >>>>>>>>> colder, and warmer on average when ambient is warmer. >>>>>>>>> >>>>>>>>> Putting a bit of integrator action into a controller like that will, >>>>>>>>> perforce, guarantee that the average temperature of the plant is as >>>>>>>>> close to correct as can be achieved with available sensors. It won't >>>>>>>>> prevent the heat from cycling up and down, however -- that's a >>>>>>>>> consequence of turning the heat on and off close to, or slower than, >>>>>>>>> the thermal time constant of the plant. >>>>>>>>> >>>>>>>>> Whether the benefit from integral action in the controller is worth >>>>>>>>> the effort in such a circumstance is going to depend on the >>>>>>>>> individual cases. I suspect that in general it won't, but I'm sure >>>>>>>>> there are edge cases where it'll be all that's needed. >>>>>>>> >>>>>>>> It is not clear to me that your assumptions are correct. For example, >>>>>>>> ignoring the issue of the anticipator, the idea that without an >>>>>>>> integral term in the control loop, the average temperature will be >>>>>>>> sensitive to the ambient isn't clear to me. Consider the controlled >>>>>>>> temperature as a function of time in two cases. In one case the heat >>>>>>>> leaking from the chamber is 1/10 the rate at which the heating element >>>>>>>> adds heat and in the other case heat leaks at 1/2 the rate of the >>>>>>>> heater. The control loop is a simple temperature set point with a >>>>>>>> fixed amount of plus and minus hysteresis. In the 1/10 rate case the >>>>>>>> heat will be on 1/10 of the time. The graph will be a saw tooth with >>>>>>>> the warming slope being 1/9th the width of the cooling slope. The >>>>>>>> average temperature will be the set point. The 1/2 cooling rate will >>>>>>>> give a sawtooth graph with equal heating and cooling periods... and >>>>>>>> again the average temperature will be the set point. >>>>>>>> >>>>>>>> What periods of heating and cooling would you expect a PID controller >>>>>>>> could provide if it is not using PWM modulation of the heating, but >>>>>>>> rather the PID loop directly turns the heat on or off? >>>>>>>> >>>>>>>> If heating a house, the furnace should not be cycled too often, so >>>>>>>> there is no opportunity to modulate the heat cycle over short periods. >>>>>>>> However, the system is question is an electric oven so such modulation >>>>>>>> would be possible, but only by adding another layer of complexity to >>>>>>>> the code which is not what is being discussed. >>>>>>> >>>>>>> I'm not going to spend my free time simulating your system for you. >>>>>>> That's what you're paid to do. So why don't you spend your free -- or >>>>>>> paid -- time simulating your system for you? >>>>>>> >>>>>>> I've done this stuff before, it's too long for me to remember the >>>>>>> detailed answer, but I do remember that when you actually take the >>>>>>> trouble to simulate the system, or calculate it's behavior >>>>>>> mathematically, you find a dependency on average temperature with >>>>>>> ambient. >>>>>> >>>>>> I'm not asking you to simulate anything. I just described a system >>>>>> simple enough to be simulated in your head and gave you the result. It >>>>>> may be somewhat unrealistic given the vagaries of real world situations, >>>>>> but it is clear enough to show a set point controller maintains an >>>>>> average temperature controlled by the set point when the cooling losses >>>>>> are constant, at least to a first order approximation. >>>>> >>>>> Well, there you go. You're smarter than the resident control expert. >>>>> >>>>> Have fun! >>>> >>>> Rick may not want to be "prickly", but he often comes across that way. >>>> I'll take him at his word though. No insult intended Rick, but smart >>>> people sometimes are less adept at the social graces. >>> >>> Certainly there is no intent to tick people off. I guess it just comes >>> naturally... ?? I consider it to be a shortcoming of the medium. I >>> write with a deadpan emotional intent, most of the time, but I guess it >>> must be read as though I am trying to offend. >>> >>> I really don't know what Tim is ticked off about. I give a *very* >>> simple example that can be considered entirely in your mind and describe >>> the results. Tim seems to think it requires simulation and gets mad >>> about it when I point out how simple it is. Or maybe I'm not >>> understanding what he is upset about. Don't know. >>> >>> >>>> Besides driving the error signal to zero, doesn't a PI controller also >>>> have a faster response, compared to just P? Instead of a flat gain, >>>> you get more gain at lower frequencies. (That might not be right.. >>>> I'm far from a control expert :^) >>> >>> Ok, but your model assumes there is some variability to the control I >>> think. If the control consists of deciding on each cycle of the PID >>> loop whether to turn the heater on or off, how does a PID controller >>> improve response? If the desire is to turn the heater on at a smaller >>> deviation from the set point, the hysteresis can be set closer to the >>> set point, no? To be honest, if you don't care how often the heat is >>> turned on, why would you even need hysteresis? Just turn on the heat >>> when the temperature is below the set point and off again when the set >>> point is reached. Then the only issue is the overshoot from the thermal >>> mass of the heating element. An anticipator can help with that. >>> >>> The other point was that running the PID loop faster than the >>> temperature is updated seems pointless. The person who has designed >>> this approach creates a process for each part of the algorithm, one for >>> measuring the temperature, one for running the PID and others. I'm not >>> clear at all why he thinks the PID is usefully run faster than the >>> temperature is updated. I can't get anything out of him other than >>> because "it's fun". I'm just trying to understand how a PID controller >>> can work better than the set point controller when there is no >>> proportional control over the heat, just on and off. >>> >>> The only thing I can think is that the PID, when properly designed, will >>> inherently consider the thermal mass of the heating element while with >>> the set point controller it has to be accounted for by an anticipator. >>> Even so, I don't see the two as much similar, is that wrong? >>> >>> BTW, who is "the resident control expert"? >>> >> >> http://www.amazon.com/Applied-Control-Embedded-Systems-Technology/dp/0750678399 > > Ha! >
I have a copy. It's a pretty good book, though I'm really not a control guy myself, so it may be better than that. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net
On Mon, 23 Nov 2015 13:11:02 -0800, George Herold wrote:

> On Monday, November 23, 2015 at 3:07:59 PM UTC-5, Tim Wescott wrote: >> On Mon, 23 Nov 2015 14:48:16 -0500, rickman wrote: >> >> > On 11/23/2015 2:17 PM, Tim Wescott wrote: >> >> On Mon, 23 Nov 2015 13:43:30 -0500, rickman wrote: >> >> >> >>> On 11/23/2015 1:07 PM, Tim Wescott wrote: >> >>>> On Sun, 22 Nov 2015 14:33:55 -0500, rickman wrote: >> >>>> >> >>>>> If a heater is controlled by turning it on and off, does a PID >> >>>>> algorithm help in more closely controlling the temperature? >> >>>>> >> >>>>> Will running the PID loop faster than the temperature measurement >> >>>>> improve anything? >> >>>>> >> >>>>> How would a PID control be an improvement over a simple >> >>>>> temperature comparison with or without an anticipator? >> >>>> >> >>>> On a totally different line of thought than my previous response: >> >>>> >> >>>> A traditional thermostat/anticipator acts, more or less, like a >> >>>> proportional-derivative controller with a relay output ("relay" is >> >>>> just control systems jargon for an on-off switch). There's >> >>>> usually hysteresis in the switch, but that's not uncommon with >> >>>> relay-output controllers, and it's the anticipator that -- more or >> >>>> less -- provides the derivative action. >> >>>> >> >>>> (Note the "more or less" -- "sorta-kinda" might be better. At any >> >>>> rate, don't get wrapped around the axle if it's not exactly the >> >>>> same -- >> >>>> because it isn't.) >> >>>> >> >>>> Such a system will still show some sensitivity of the long-term >> >>>> average controlled temperature to ambient conditions -- your plant >> >>>> (or house, whatever) will be a bit colder on average when ambient >> >>>> is colder, and warmer on average when ambient is warmer. >> >>>> >> >>>> Putting a bit of integrator action into a controller like that >> >>>> will, perforce, guarantee that the average temperature of the >> >>>> plant is as close to correct as can be achieved with available >> >>>> sensors. It won't prevent the heat from cycling up and down, >> >>>> however -- that's a consequence of turning the heat on and off >> >>>> close to, or slower than, the thermal time constant of the plant. >> >>>> >> >>>> Whether the benefit from integral action in the controller is >> >>>> worth the effort in such a circumstance is going to depend on the >> >>>> individual cases. I suspect that in general it won't, but I'm >> >>>> sure there are edge cases where it'll be all that's needed. >> >>> >> >>> It is not clear to me that your assumptions are correct. For >> >>> example, >> >>> ignoring the issue of the anticipator, the idea that without an >> >>> integral term in the control loop, the average temperature will be >> >>> sensitive to the ambient isn't clear to me. Consider the >> >>> controlled temperature as a function of time in two cases. In one >> >>> case the heat leaking from the chamber is 1/10 the rate at which >> >>> the heating element adds heat and in the other case heat leaks at >> >>> 1/2 the rate of the heater. The control loop is a simple >> >>> temperature set point with a fixed amount of plus and minus >> >>> hysteresis. In the 1/10 rate case the heat will be on 1/10 of the >> >>> time. The graph will be a saw tooth with the warming slope being >> >>> 1/9th the width of the cooling slope. The average temperature will >> >>> be the set point. The 1/2 cooling rate will give a sawtooth graph >> >>> with equal heating and cooling periods... and again the average >> >>> temperature will be the set point. >> >>> >> >>> What periods of heating and cooling would you expect a PID >> >>> controller could provide if it is not using PWM modulation of the >> >>> heating, but rather the PID loop directly turns the heat on or off? >> >>> >> >>> If heating a house, the furnace should not be cycled too often, so >> >>> there is no opportunity to modulate the heat cycle over short >> >>> periods. >> >>> However, the system is question is an electric oven so such >> >>> modulation would be possible, but only by adding another layer of >> >>> complexity to the code which is not what is being discussed. >> >> >> >> I'm not going to spend my free time simulating your system for you. >> >> That's what you're paid to do. So why don't you spend your free -- >> >> or paid -- time simulating your system for you? >> >> >> >> I've done this stuff before, it's too long for me to remember the >> >> detailed answer, but I do remember that when you actually take the >> >> trouble to simulate the system, or calculate it's behavior >> >> mathematically, you find a dependency on average temperature with >> >> ambient. >> > >> > I'm not asking you to simulate anything. I just described a system >> > simple enough to be simulated in your head and gave you the result. >> > It may be somewhat unrealistic given the vagaries of real world >> > situations, >> > but it is clear enough to show a set point controller maintains an >> > average temperature controlled by the set point when the cooling >> > losses are constant, at least to a first order approximation. >> >> Well, there you go. You're smarter than the resident control expert. >> >> Have fun! > > Rick may not want to be "prickly", but he often comes across that way. > I'll take him at his word though. No insult intended Rick, but smart > people sometimes are less adept at the social graces. > > Besides driving the error signal to zero, doesn't a PI controller also > have a faster response, compared to just P? Instead of a flat gain, you > get more gain at lower frequencies. (That might not be right.. I'm far > from a control expert :^)
Only for certain plants, but yes, often a PI controller can drive things close to target faster than just a proportional can. And when it happens, it's because of more gain at lower frequencies. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Mon, 23 Nov 2015 18:09:44 -0500, Phil Hobbs wrote:

> On 11/23/2015 06:02 PM, Cydrome Leader wrote: >> Lasse Langwadt Christensen <langwadt@fonz.dk> wrote: >>> Den mandag den 23. november 2015 kl. 23.08.39 UTC+1 skrev rickman: >>>> On 11/23/2015 4:11 PM, George Herold wrote: >>>>> On Monday, November 23, 2015 at 3:07:59 PM UTC-5, Tim Wescott wrote: >>>>>> On Mon, 23 Nov 2015 14:48:16 -0500, rickman wrote: >>>>>> >>>>>>> On 11/23/2015 2:17 PM, Tim Wescott wrote: >>>>>>>> On Mon, 23 Nov 2015 13:43:30 -0500, rickman wrote: >>>>>>>> >>>>>>>>> On 11/23/2015 1:07 PM, Tim Wescott wrote: >>>>>>>>>> On Sun, 22 Nov 2015 14:33:55 -0500, rickman wrote: >>>>>>>>>> >>>>>>>>>>> If a heater is controlled by turning it on and off, does a PID >>>>>>>>>>> algorithm help in more closely controlling the temperature? >>>>>>>>>>> >>>>>>>>>>> Will running the PID loop faster than the temperature >>>>>>>>>>> measurement improve anything? >>>>>>>>>>> >>>>>>>>>>> How would a PID control be an improvement over a simple >>>>>>>>>>> temperature comparison with or without an anticipator? >>>>>>>>>> >>>>>>>>>> On a totally different line of thought than my previous >>>>>>>>>> response: >>>>>>>>>> >>>>>>>>>> A traditional thermostat/anticipator acts, more or less, like a >>>>>>>>>> proportional-derivative controller with a relay output ("relay" >>>>>>>>>> is just control systems jargon for an on-off switch). There's >>>>>>>>>> usually hysteresis in the switch, but that's not uncommon with >>>>>>>>>> relay-output controllers, and it's the anticipator that -- more >>>>>>>>>> or less -- provides the derivative action. >>>>>>>>>> >>>>>>>>>> (Note the "more or less" -- "sorta-kinda" might be better. At >>>>>>>>>> any rate, don't get wrapped around the axle if it's not exactly >>>>>>>>>> the same -- >>>>>>>>>> because it isn't.) >>>>>>>>>> >>>>>>>>>> Such a system will still show some sensitivity of the long-term >>>>>>>>>> average controlled temperature to ambient conditions -- your >>>>>>>>>> plant (or house, whatever) will be a bit colder on average when >>>>>>>>>> ambient is colder, and warmer on average when ambient is >>>>>>>>>> warmer. >>>>>>>>>> >>>>>>>>>> Putting a bit of integrator action into a controller like that >>>>>>>>>> will, perforce, guarantee that the average temperature of the >>>>>>>>>> plant is as close to correct as can be achieved with available >>>>>>>>>> sensors. It won't prevent the heat from cycling up and down, >>>>>>>>>> however -- that's a consequence of turning the heat on and off >>>>>>>>>> close to, or slower than, the thermal time constant of the >>>>>>>>>> plant. >>>>>>>>>> >>>>>>>>>> Whether the benefit from integral action in the controller is >>>>>>>>>> worth the effort in such a circumstance is going to depend on >>>>>>>>>> the individual cases. I suspect that in general it won't, but >>>>>>>>>> I'm sure there are edge cases where it'll be all that's needed. >>>>>>>>> >>>>>>>>> It is not clear to me that your assumptions are correct. For >>>>>>>>> example, >>>>>>>>> ignoring the issue of the anticipator, the idea that without an >>>>>>>>> integral term in the control loop, the average temperature will >>>>>>>>> be sensitive to the ambient isn't clear to me. Consider the >>>>>>>>> controlled temperature as a function of time in two cases. In >>>>>>>>> one case the heat leaking from the chamber is 1/10 the rate at >>>>>>>>> which the heating element adds heat and in the other case heat >>>>>>>>> leaks at 1/2 the rate of the heater. The control loop is a >>>>>>>>> simple temperature set point with a fixed amount of plus and >>>>>>>>> minus hysteresis. In the 1/10 rate case the heat will be on >>>>>>>>> 1/10 of the time. The graph will be a saw tooth with the >>>>>>>>> warming slope being 1/9th the width of the cooling slope. The >>>>>>>>> average temperature will be the set point. The 1/2 cooling rate >>>>>>>>> will give a sawtooth graph with equal heating and cooling >>>>>>>>> periods... and again the average temperature will be the set >>>>>>>>> point. >>>>>>>>> >>>>>>>>> What periods of heating and cooling would you expect a PID >>>>>>>>> controller could provide if it is not using PWM modulation of >>>>>>>>> the heating, but rather the PID loop directly turns the heat on >>>>>>>>> or off? >>>>>>>>> >>>>>>>>> If heating a house, the furnace should not be cycled too often, >>>>>>>>> so there is no opportunity to modulate the heat cycle over short >>>>>>>>> periods. >>>>>>>>> However, the system is question is an electric oven so such >>>>>>>>> modulation would be possible, but only by adding another layer >>>>>>>>> of complexity to the code which is not what is being discussed. >>>>>>>> >>>>>>>> I'm not going to spend my free time simulating your system for >>>>>>>> you. That's what you're paid to do. So why don't you spend your >>>>>>>> free -- or paid -- time simulating your system for you? >>>>>>>> >>>>>>>> I've done this stuff before, it's too long for me to remember the >>>>>>>> detailed answer, but I do remember that when you actually take >>>>>>>> the trouble to simulate the system, or calculate it's behavior >>>>>>>> mathematically, you find a dependency on average temperature with >>>>>>>> ambient. >>>>>>> >>>>>>> I'm not asking you to simulate anything. I just described a >>>>>>> system simple enough to be simulated in your head and gave you the >>>>>>> result. It may be somewhat unrealistic given the vagaries of real >>>>>>> world situations, >>>>>>> but it is clear enough to show a set point controller maintains an >>>>>>> average temperature controlled by the set point when the cooling >>>>>>> losses are constant, at least to a first order approximation. >>>>>> >>>>>> Well, there you go. You're smarter than the resident control >>>>>> expert. >>>>>> >>>>>> Have fun! >>>>> >>>>> Rick may not want to be "prickly", but he often comes across that >>>>> way. >>>>> I'll take him at his word though. No insult intended Rick, but >>>>> smart people sometimes are less adept at the social graces. >>>> >>>> Certainly there is no intent to tick people off. I guess it just >>>> comes naturally... ?? I consider it to be a shortcoming of the >>>> medium. I write with a deadpan emotional intent, most of the time, >>>> but I guess it must be read as though I am trying to offend. >>>> >>>> I really don't know what Tim is ticked off about. I give a *very* >>>> simple example that can be considered entirely in your mind and >>>> describe the results. Tim seems to think it requires simulation and >>>> gets mad about it when I point out how simple it is. Or maybe I'm >>>> not understanding what he is upset about. Don't know. >>>> >>>> >>>>> Besides driving the error signal to zero, doesn't a PI controller >>>>> also have a faster response, compared to just P? Instead of a flat >>>>> gain, you get more gain at lower frequencies. (That might not be >>>>> right.. I'm far from a control expert :^) >>>> >>>> Ok, but your model assumes there is some variability to the control I >>>> think. If the control consists of deciding on each cycle of the PID >>>> loop whether to turn the heater on or off, how does a PID controller >>>> improve response? If the desire is to turn the heater on at a >>>> smaller deviation from the set point, the hysteresis can be set >>>> closer to the set point, no? To be honest, if you don't care how >>>> often the heat is turned on, why would you even need hysteresis? >>>> Just turn on the heat when the temperature is below the set point and >>>> off again when the set point is reached. Then the only issue is the >>>> overshoot from the thermal mass of the heating element. An >>>> anticipator can help with that. >>>> >>>> The other point was that running the PID loop faster than the >>>> temperature is updated seems pointless. The person who has designed >>>> this approach creates a process for each part of the algorithm, one >>>> for measuring the temperature, one for running the PID and others. >>>> I'm not clear at all why he thinks the PID is usefully run faster >>>> than the temperature is updated. I can't get anything out of him >>>> other than because "it's fun". I'm just trying to understand how a >>>> PID controller can work better than the set point controller when >>>> there is no proportional control over the heat, just on and off. >>>> >>>> The only thing I can think is that the PID, when properly designed, >>>> will inherently consider the thermal mass of the heating element >>>> while with the set point controller it has to be accounted for by an >>>> anticipator. Even so, I don't see the two as much similar, is that >>>> wrong? >>>> >>>> BTW, who is "the resident control expert"? >>>> >>>> >>> http://www.amazon.com/Applied-Control-Embedded-Systems-Technology/
dp/0750678399
>> >> Ha! >> >> > > I have a copy. It's a pretty good book, though I'm really not a control > guy myself, so it may be better than that.
Pretty good for people who aren't control experts is what I was aiming at (hence the "applied"). I wouldn't recommend it to a control expert unless they wanted a book to hand out to people, or possibly if it's someone used to doing things in analog and they wanted more familiarity with doing things in digital-land. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
In article <n302kj$u4t$1@dont-email.me>, gnuarm@gmail.com says...
> Besides driving the error signal to zero, doesn't a PI controller also > > have a faster response, compared to just P? Instead of a flat gain, > > you get more gain at lower frequencies. (That might not be right.. > > I'm far from a control expert :^) > > Ok, but your model assumes there is some variability to the control I > think. If the control consists of deciding on each cycle of the PID > loop whether to turn the heater on or off, how does a PID controller > improve response? If the desire is to turn the heater on at a smaller > deviation from the set point, the hysteresis can be set closer to the > set point, no? To be honest, if you don't care how often the heat is > turned on, why would you even need hysteresis? Just turn on the heat > when the temperature is below the set point and off again when the set > point is reached. Then the only issue is the overshoot from the thermal > mass of the heating element. An anticipator can help with that. > > The other point was that running the PID loop faster than the > temperature is updated seems pointless. The person who has designed > this approach creates a process for each part of the algorithm, one for > measuring the temperature, one for running the PID and others. I'm not > clear at all why he thinks the PID is usefully run faster than the > temperature is updated. I can't get anything out of him other than > because "it's fun". I'm just trying to understand how a PID controller > can work better than the set point controller when there is no > proportional control over the heat, just on and off. > > The only thing I can think is that the PID, when properly designed, will > inherently consider the thermal mass of the heating element while with > the set point controller it has to be accounted for by an anticipator. > Even so, I don't see the two as much similar, is that wrong? > > BTW, who is "the resident control expert"? >
Look I work with temp controllers alot and I can most likely fill in some of your gaps for you. First of all, lets get to the issues at hand you seem to be stuck on. COntrollers for one have a tuning mode, you set the temp and initiate it. It'll cycle for a while and there are some parameters it'll set. P = Gain/BW depending on the maker of the controller. I = Integrated readings of the PV (process value) D = rate of change which can be used to dampen the PID output. +/- Btw, some D's only work once it starts to get near setpoint, others will work across the whole stretch. Also on top of all this.... You have soak time that can be programmed for many controllers in various ways. Output power: This helps in the case of large mass. Output duration can be set for a max/min effect, reguardless if it reaches desired set point or not. In water cooling systems, you can adjust the output power so to not over cool per cycle. All this does is turn on the cooling for short pulses when needed. Heating is also done the same way. For systems that have large mass it can over shoot and take too long to correct. The output of the controller simply pulses a short ON pulse and the duration between is done via the PID terms. In otherwords, if you remove the PID out of the picture and use only power output settings, you can simply set the max ON time for heat or cooling. Some systems use a Duty cycle parameter instead of a MAx on time. Others use a Max On/MaxOff same as duty cycle. If the controller has a 0..10/4 to 20mA output, it does not pulse, it simple does not go to full output at all when adjusting power bands. On top of all this, Many controllers have a percentage of direct and PID control, meaning the PID only effects the output a certain percentage over the direct output. A non PID controller is basically something that just has a Power band set and when it reaches setpoint it just turns off. When the temp drops a little, it turns on, when it gets a little too hot, it turns on the cooling, using the cooling's power band settings and there is a dead band setting. I work with various controllers, many of them PLC's that have built in PID loops and found that most of the time they work fine however, there are times where I've had to intercept on the PID output to add a little control of my own. Things like a power band for example. I have also found in some cases, there was just no way to to use a basic PID due to changing events out side the norm. have a good day Jamie
On Mon, 23 Nov 2015 17:08:32 -0500, rickman wrote:

> On 11/23/2015 4:11 PM, George Herold wrote: >> On Monday, November 23, 2015 at 3:07:59 PM UTC-5, Tim Wescott wrote: >>> On Mon, 23 Nov 2015 14:48:16 -0500, rickman wrote: >>> >>>> On 11/23/2015 2:17 PM, Tim Wescott wrote: >>>>> On Mon, 23 Nov 2015 13:43:30 -0500, rickman wrote: >>>>> >>>>>> On 11/23/2015 1:07 PM, Tim Wescott wrote: >>>>>>> On Sun, 22 Nov 2015 14:33:55 -0500, rickman wrote: >>>>>>> >>>>>>>> If a heater is controlled by turning it on and off, does a PID >>>>>>>> algorithm help in more closely controlling the temperature? >>>>>>>> >>>>>>>> Will running the PID loop faster than the temperature measurement >>>>>>>> improve anything? >>>>>>>> >>>>>>>> How would a PID control be an improvement over a simple >>>>>>>> temperature comparison with or without an anticipator? >>>>>>> >>>>>>> On a totally different line of thought than my previous response: >>>>>>> >>>>>>> A traditional thermostat/anticipator acts, more or less, like a >>>>>>> proportional-derivative controller with a relay output ("relay" is >>>>>>> just control systems jargon for an on-off switch). There's >>>>>>> usually hysteresis in the switch, but that's not uncommon with >>>>>>> relay-output controllers, and it's the anticipator that -- more or >>>>>>> less -- provides the derivative action. >>>>>>> >>>>>>> (Note the "more or less" -- "sorta-kinda" might be better. At any >>>>>>> rate, don't get wrapped around the axle if it's not exactly the >>>>>>> same -- >>>>>>> because it isn't.) >>>>>>> >>>>>>> Such a system will still show some sensitivity of the long-term >>>>>>> average controlled temperature to ambient conditions -- your plant >>>>>>> (or house, whatever) will be a bit colder on average when ambient >>>>>>> is colder, and warmer on average when ambient is warmer. >>>>>>> >>>>>>> Putting a bit of integrator action into a controller like that >>>>>>> will, perforce, guarantee that the average temperature of the >>>>>>> plant is as close to correct as can be achieved with available >>>>>>> sensors. It won't prevent the heat from cycling up and down, >>>>>>> however -- that's a consequence of turning the heat on and off >>>>>>> close to, or slower than, the thermal time constant of the plant. >>>>>>> >>>>>>> Whether the benefit from integral action in the controller is >>>>>>> worth the effort in such a circumstance is going to depend on the >>>>>>> individual cases. I suspect that in general it won't, but I'm >>>>>>> sure there are edge cases where it'll be all that's needed. >>>>>> >>>>>> It is not clear to me that your assumptions are correct. For >>>>>> example, >>>>>> ignoring the issue of the anticipator, the idea that without an >>>>>> integral term in the control loop, the average temperature will be >>>>>> sensitive to the ambient isn't clear to me. Consider the >>>>>> controlled temperature as a function of time in two cases. In one >>>>>> case the heat leaking from the chamber is 1/10 the rate at which >>>>>> the heating element adds heat and in the other case heat leaks at >>>>>> 1/2 the rate of the heater. The control loop is a simple >>>>>> temperature set point with a fixed amount of plus and minus >>>>>> hysteresis. In the 1/10 rate case the heat will be on 1/10 of the >>>>>> time. The graph will be a saw tooth with the warming slope being >>>>>> 1/9th the width of the cooling slope. The average temperature will >>>>>> be the set point. The 1/2 cooling rate will give a sawtooth graph >>>>>> with equal heating and cooling periods... and again the average >>>>>> temperature will be the set point. >>>>>> >>>>>> What periods of heating and cooling would you expect a PID >>>>>> controller could provide if it is not using PWM modulation of the >>>>>> heating, but rather the PID loop directly turns the heat on or off? >>>>>> >>>>>> If heating a house, the furnace should not be cycled too often, so >>>>>> there is no opportunity to modulate the heat cycle over short >>>>>> periods. >>>>>> However, the system is question is an electric oven so such >>>>>> modulation would be possible, but only by adding another layer of >>>>>> complexity to the code which is not what is being discussed. >>>>> >>>>> I'm not going to spend my free time simulating your system for you. >>>>> That's what you're paid to do. So why don't you spend your free -- >>>>> or paid -- time simulating your system for you? >>>>> >>>>> I've done this stuff before, it's too long for me to remember the >>>>> detailed answer, but I do remember that when you actually take the >>>>> trouble to simulate the system, or calculate it's behavior >>>>> mathematically, you find a dependency on average temperature with >>>>> ambient. >>>> >>>> I'm not asking you to simulate anything. I just described a system >>>> simple enough to be simulated in your head and gave you the result. >>>> It may be somewhat unrealistic given the vagaries of real world >>>> situations, >>>> but it is clear enough to show a set point controller maintains an >>>> average temperature controlled by the set point when the cooling >>>> losses are constant, at least to a first order approximation. >>> >>> Well, there you go. You're smarter than the resident control expert. >>> >>> Have fun! >> >> Rick may not want to be "prickly", but he often comes across that way. >> I'll take him at his word though. No insult intended Rick, but smart >> people sometimes are less adept at the social graces. > > Certainly there is no intent to tick people off. I guess it just comes > naturally... ?? I consider it to be a shortcoming of the medium. I > write with a deadpan emotional intent, most of the time, but I guess it > must be read as though I am trying to offend. > > I really don't know what Tim is ticked off about. I give a *very* > simple example that can be considered entirely in your mind and describe > the results. Tim seems to think it requires simulation and gets mad > about it when I point out how simple it is. Or maybe I'm not > understanding what he is upset about. Don't know. > > >> Besides driving the error signal to zero, doesn't a PI controller also >> have a faster response, compared to just P? Instead of a flat gain, >> you get more gain at lower frequencies. (That might not be right.. I'm >> far from a control expert :^) > > Ok, but your model assumes there is some variability to the control I > think. If the control consists of deciding on each cycle of the PID > loop whether to turn the heater on or off, how does a PID controller > improve response?
That's been answered! Just read!
> If the desire is to turn the heater on at a smaller > deviation from the set point, the hysteresis can be set closer to the > set point, no? To be honest, if you don't care how often the heat is > turned on, why would you even need hysteresis? Just turn on the heat > when the temperature is below the set point and off again when the set > point is reached. Then the only issue is the overshoot from the thermal > mass of the heating element. An anticipator can help with that.
If you're going to refuse to use well-known useful techniques like PWM-ing an ON/OFF output, or using a sigma-delta modulator, then yes, an old traditional bang-bang controller with an anticipator may work best. But why refuse to use well-known useful techniques?
> The other point was that running the PID loop faster than the > temperature is updated seems pointless.
If it's properly tuned it may lead to better precision by turning the heater on or off part-way between temperature measurements. That doesn't mean that it's a good decision, that's just a (very slight) advantage that it may have.
> The person who has designed > this approach creates a process for each part of the algorithm, one for > measuring the temperature, one for running the PID and others. I'm not > clear at all why he thinks the PID is usefully run faster than the > temperature is updated. I can't get anything out of him other than > because "it's fun".
OK. So your real concern is that you've got some out of control designer, presumably a software guy, who's so severely unprofessional that he's letting himself be motivated by what's "fun" instead of what's best for the project. Meaning that he could do something just as "fun" with bang-bang control, to an equal level of dismay on your part. So the basic problem you're trying to address is only incidental to the PID controller. (BTW: "because it's fun" is very occasionally an allowable excuse for doing something in my book, but generally only if there's plenty of slack in that part of the project, the guy's attention isn't needed elsewhere, AND if the guy has a track record of giving up on the "fun" stuff if it isn't panning out. If someone is sticking to something substandard "because it's fun" at risk to the project, then they need to be encouraged, possibly with a pink slip, to go find a more "fun" place to work.)
> I'm just trying to understand how a PID controller > can work better than the set point controller when there is no > proportional control over the heat, just on and off.
Well, I already told you that, several times. Possibly because I took your questions at face value.
> The only thing I can think is that the PID, when properly designed, will > inherently consider the thermal mass of the heating element while with > the set point controller it has to be accounted for by an anticipator. > Even so, I don't see the two as much similar, is that wrong?
They're not all that similar, and there's no reason that a bang-bang controller might not be inherently better in certain circumstances -- but whether a PID is better than bang-bang or visa-versa depends on the plant and what you're trying to do with it. There's no one right answer. The above assumes that each controller is designed by someone who cares. Certainly, a bang-bang controller designed by someone focused on getting decent performance has a very good chance of outperforming anything designed by a guy who doesn't give a shit about doing a good job if there's "fun" to be had. Certainly, if a bang-bang controller is so far better than adequate that no one could want anything better, and if that bang-bang controller isn't adorned with an anticipator that's more ornate than the PID controller that might be used instead, then it's probably the way to go -- no matter how "cool" the PID controller may be. There are cases, in fact, where bang-bang control may well be superior. If you get a PID controller all tuned up to within a gnat's eyelash of perfect for an empty oven, it may have a horrid, even an unstable, response to an oven with a big thermal mass in it (even if -- or possibly especially if -- it has nice PWM'd output). Ditto if you tune it up for the big thermal mass and then try to run it with an empty oven. It's been known since the 1950's that bang-bang control can be a much better alternative to either robustly tuned linear control or to on-line adaptive control -- in fact, the signal motivation for adaptive control theory (aside from the pretty math) since the 1960's was that bang-bang control works scares the bejabbers out of a human pilot, however well it works in an unmanned missile. This leaves the control system designer contemplating robust or adaptive control of some sort.
> BTW, who is "the resident control expert"?
Has this question been answered to your satisfaction? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Mon, 23 Nov 2015 18:47:23 -0500, M Philbrook wrote:

> In article <n302kj$u4t$1@dont-email.me>, gnuarm@gmail.com says... >> Besides driving the error signal to zero, doesn't a PI controller also >> > have a faster response, compared to just P? Instead of a flat gain, >> > you get more gain at lower frequencies. (That might not be right.. >> > I'm far from a control expert :^) >> >> Ok, but your model assumes there is some variability to the control I >> think. If the control consists of deciding on each cycle of the PID >> loop whether to turn the heater on or off, how does a PID controller >> improve response? If the desire is to turn the heater on at a smaller >> deviation from the set point, the hysteresis can be set closer to the >> set point, no? To be honest, if you don't care how often the heat is >> turned on, why would you even need hysteresis? Just turn on the heat >> when the temperature is below the set point and off again when the set >> point is reached. Then the only issue is the overshoot from the >> thermal mass of the heating element. An anticipator can help with >> that. >> >> The other point was that running the PID loop faster than the >> temperature is updated seems pointless. The person who has designed >> this approach creates a process for each part of the algorithm, one for >> measuring the temperature, one for running the PID and others. I'm not >> clear at all why he thinks the PID is usefully run faster than the >> temperature is updated. I can't get anything out of him other than >> because "it's fun". I'm just trying to understand how a PID controller >> can work better than the set point controller when there is no >> proportional control over the heat, just on and off. >> >> The only thing I can think is that the PID, when properly designed, >> will inherently consider the thermal mass of the heating element while >> with the set point controller it has to be accounted for by an >> anticipator. Even so, I don't see the two as much similar, is that >> wrong? >> >> BTW, who is "the resident control expert"? >> >> > Look I work with temp controllers alot and I can most likely fill > in some of your gaps for you. > > First of all, lets get to the issues at hand you seem to be stuck > on. > > COntrollers for one have a tuning mode, you set the temp and initiate > it. It'll cycle for a while and there are some parameters it'll set. > > P = Gain/BW depending on the maker of the controller. > > I = Integrated readings of the PV (process value) > > D = rate of change which can be used to dampen the PID output. +/- > Btw, some D's only work once it starts to get near setpoint, others > will work across the whole stretch. > > Also on top of all this.... > > You have soak time that can be programmed for many controllers in > various ways. > > Output power: > > This helps in the case of large mass. Output duration can be set > for a max/min effect, reguardless if it reaches desired set point or > not. > > In water cooling systems, you can adjust the output power so to not > over cool per cycle. All this does is turn on the cooling for short > pulses when needed. > > Heating is also done the same way. For systems that have large mass it > can over shoot and take too long to correct. The output of the > controller simply pulses a short ON pulse and the duration between is > done via the PID terms. > > In otherwords, if you remove the PID out of the picture and use only > power output settings, you can simply set the max ON time for heat or > cooling. > > Some systems use a Duty cycle parameter instead of a MAx on time. > Others use a Max On/MaxOff same as duty cycle. > > If the controller has a 0..10/4 to 20mA output, it does not pulse, it > simple does not go to full output at all when adjusting power bands. > > On top of all this, Many controllers have a percentage of direct and > PID control, meaning the PID only effects the output a certain > percentage over the direct output. > > A non PID controller is basically something that just has a Power band > set and when it reaches setpoint it just turns off. When the temp drops > a little, it turns on, when it gets a little too hot, it turns on the > cooling, using the cooling's power band settings and there is a dead > band setting. > > I work with various controllers, many of them PLC's that have built in > PID loops and found that most of the time they work fine however, there > are times where I've had to intercept on the PID output to add a little > control of my own. Things like a power band for example. > > I have also found in some cases, there was just no way to to use a > basic PID due to changing events out side the norm.
All valid observations if he's using a prepackaged temperature controller. But from the sounds of it they're building a temperature controller into some embedded software. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Monday, November 23, 2015 at 5:08:39 PM UTC-5, rickman wrote:
> On 11/23/2015 4:11 PM, George Herold wrote:
<big snip>
> >> Well, there you go. You're smarter than the resident control expert. > >> > >> Have fun! > > > > Rick may not want to be "prickly", but he often comes across that way. > > I'll take him at his word though. No insult intended Rick, but smart > > people sometimes are less adept at the social graces. > > Certainly there is no intent to tick people off. I guess it just comes > naturally... ?? I consider it to be a shortcoming of the medium. I > write with a deadpan emotional intent, most of the time, but I guess it > must be read as though I am trying to offend. > > I really don't know what Tim is ticked off about. I give a *very* > simple example that can be considered entirely in your mind and describe > the results. Tim seems to think it requires simulation and gets mad > about it when I point out how simple it is. Or maybe I'm not > understanding what he is upset about. Don't know.
> > > > Besides driving the error signal to zero, doesn't a PI controller also > > have a faster response, compared to just P? Instead of a flat gain, > > you get more gain at lower frequencies. (That might not be right.. > > I'm far from a control expert :^) > > Ok, but your model assumes there is some variability to the control I > think. If the control consists of deciding on each cycle of the PID > loop whether to turn the heater on or off, how does a PID controller > improve response? If the desire is to turn the heater on at a smaller > deviation from the set point, the hysteresis can be set closer to the > set point, no? To be honest, if you don't care how often the heat is > turned on, why would you even need hysteresis? Just turn on the heat > when the temperature is below the set point and off again when the set > point is reached. Then the only issue is the overshoot from the thermal > mass of the heating element. An anticipator can help with that. > > The other point was that running the PID loop faster than the > temperature is updated seems pointless. The person who has designed > this approach creates a process for each part of the algorithm, one for > measuring the temperature, one for running the PID and others. I'm not > clear at all why he thinks the PID is usefully run faster than the > temperature is updated. I can't get anything out of him other than > because "it's fun". I'm just trying to understand how a PID controller > can work better than the set point controller when there is no > proportional control over the heat, just on and off. > > The only thing I can think is that the PID, when properly designed, will > inherently consider the thermal mass of the heating element while with > the set point controller it has to be accounted for by an anticipator. > Even so, I don't see the two as much similar, is that wrong? > > BTW, who is "the resident control expert"? > > -- > > Rick
Rick, I stopped reading, I don't really understand alot of whatever you are trying to say. You can simulate control loops in spice, or build 'em and measure.. then post circuits. George H.
On Monday, November 23, 2015 at 5:22:17 PM UTC-5, Lasse Langwadt Christensen wrote:
> Den mandag den 23. november 2015 kl. 23.08.39 UTC+1 skrev rickman: > > On 11/23/2015 4:11 PM, George Herold wrote: > > > On Monday, November 23, 2015 at 3:07:59 PM UTC-5, Tim Wescott wrote: > > >> On Mon, 23 Nov 2015 14:48:16 -0500, rickman wrote: > > >> > > >>> On 11/23/2015 2:17 PM, Tim Wescott wrote: > > >>>> On Mon, 23 Nov 2015 13:43:30 -0500, rickman wrote: > > >>>> > > >>>>> On 11/23/2015 1:07 PM, Tim Wescott wrote: > > >>>>>> On Sun, 22 Nov 2015 14:33:55 -0500, rickman wrote: > > >>>>>> > > >>>>>>> If a heater is controlled by turning it on and off, does a PID > > >>>>>>> algorithm help in more closely controlling the temperature? > > >>>>>>> > > >>>>>>> Will running the PID loop faster than the temperature measurement > > >>>>>>> improve anything? > > >>>>>>> > > >>>>>>> How would a PID control be an improvement over a simple temperature > > >>>>>>> comparison with or without an anticipator? > > >>>>>> > > >>>>>> On a totally different line of thought than my previous response: > > >>>>>> > > >>>>>> A traditional thermostat/anticipator acts, more or less, like a > > >>>>>> proportional-derivative controller with a relay output ("relay" is > > >>>>>> just control systems jargon for an on-off switch). There's usually > > >>>>>> hysteresis in the switch, but that's not uncommon with relay-output > > >>>>>> controllers, and it's the anticipator that -- more or less -- > > >>>>>> provides the derivative action. > > >>>>>> > > >>>>>> (Note the "more or less" -- "sorta-kinda" might be better. At any > > >>>>>> rate, don't get wrapped around the axle if it's not exactly the same > > >>>>>> -- > > >>>>>> because it isn't.) > > >>>>>> > > >>>>>> Such a system will still show some sensitivity of the long-term > > >>>>>> average controlled temperature to ambient conditions -- your plant > > >>>>>> (or house, whatever) will be a bit colder on average when ambient is > > >>>>>> colder, and warmer on average when ambient is warmer. > > >>>>>> > > >>>>>> Putting a bit of integrator action into a controller like that will, > > >>>>>> perforce, guarantee that the average temperature of the plant is as > > >>>>>> close to correct as can be achieved with available sensors. It won't > > >>>>>> prevent the heat from cycling up and down, however -- that's a > > >>>>>> consequence of turning the heat on and off close to, or slower than, > > >>>>>> the thermal time constant of the plant. > > >>>>>> > > >>>>>> Whether the benefit from integral action in the controller is worth > > >>>>>> the effort in such a circumstance is going to depend on the > > >>>>>> individual cases. I suspect that in general it won't, but I'm sure > > >>>>>> there are edge cases where it'll be all that's needed. > > >>>>> > > >>>>> It is not clear to me that your assumptions are correct. For example, > > >>>>> ignoring the issue of the anticipator, the idea that without an > > >>>>> integral term in the control loop, the average temperature will be > > >>>>> sensitive to the ambient isn't clear to me. Consider the controlled > > >>>>> temperature as a function of time in two cases. In one case the heat > > >>>>> leaking from the chamber is 1/10 the rate at which the heating element > > >>>>> adds heat and in the other case heat leaks at 1/2 the rate of the > > >>>>> heater. The control loop is a simple temperature set point with a > > >>>>> fixed amount of plus and minus hysteresis. In the 1/10 rate case the > > >>>>> heat will be on 1/10 of the time. The graph will be a saw tooth with > > >>>>> the warming slope being 1/9th the width of the cooling slope. The > > >>>>> average temperature will be the set point. The 1/2 cooling rate will > > >>>>> give a sawtooth graph with equal heating and cooling periods... and > > >>>>> again the average temperature will be the set point. > > >>>>> > > >>>>> What periods of heating and cooling would you expect a PID controller > > >>>>> could provide if it is not using PWM modulation of the heating, but > > >>>>> rather the PID loop directly turns the heat on or off? > > >>>>> > > >>>>> If heating a house, the furnace should not be cycled too often, so > > >>>>> there is no opportunity to modulate the heat cycle over short periods. > > >>>>> However, the system is question is an electric oven so such modulation > > >>>>> would be possible, but only by adding another layer of complexity to > > >>>>> the code which is not what is being discussed. > > >>>> > > >>>> I'm not going to spend my free time simulating your system for you. > > >>>> That's what you're paid to do. So why don't you spend your free -- or > > >>>> paid -- time simulating your system for you? > > >>>> > > >>>> I've done this stuff before, it's too long for me to remember the > > >>>> detailed answer, but I do remember that when you actually take the > > >>>> trouble to simulate the system, or calculate it's behavior > > >>>> mathematically, you find a dependency on average temperature with > > >>>> ambient. > > >>> > > >>> I'm not asking you to simulate anything. I just described a system > > >>> simple enough to be simulated in your head and gave you the result. It > > >>> may be somewhat unrealistic given the vagaries of real world situations, > > >>> but it is clear enough to show a set point controller maintains an > > >>> average temperature controlled by the set point when the cooling losses > > >>> are constant, at least to a first order approximation. > > >> > > >> Well, there you go. You're smarter than the resident control expert. > > >> > > >> Have fun! > > > > > > Rick may not want to be "prickly", but he often comes across that way. > > > I'll take him at his word though. No insult intended Rick, but smart > > > people sometimes are less adept at the social graces. > > > > Certainly there is no intent to tick people off. I guess it just comes > > naturally... ?? I consider it to be a shortcoming of the medium. I > > write with a deadpan emotional intent, most of the time, but I guess it > > must be read as though I am trying to offend. > > > > I really don't know what Tim is ticked off about. I give a *very* > > simple example that can be considered entirely in your mind and describe > > the results. Tim seems to think it requires simulation and gets mad > > about it when I point out how simple it is. Or maybe I'm not > > understanding what he is upset about. Don't know. > > > > > > > Besides driving the error signal to zero, doesn't a PI controller also > > > have a faster response, compared to just P? Instead of a flat gain, > > > you get more gain at lower frequencies. (That might not be right.. > > > I'm far from a control expert :^) > > > > Ok, but your model assumes there is some variability to the control I > > think. If the control consists of deciding on each cycle of the PID > > loop whether to turn the heater on or off, how does a PID controller > > improve response? If the desire is to turn the heater on at a smaller > > deviation from the set point, the hysteresis can be set closer to the > > set point, no? To be honest, if you don't care how often the heat is > > turned on, why would you even need hysteresis? Just turn on the heat > > when the temperature is below the set point and off again when the set > > point is reached. Then the only issue is the overshoot from the thermal > > mass of the heating element. An anticipator can help with that. > > > > The other point was that running the PID loop faster than the > > temperature is updated seems pointless. The person who has designed > > this approach creates a process for each part of the algorithm, one for > > measuring the temperature, one for running the PID and others. I'm not > > clear at all why he thinks the PID is usefully run faster than the > > temperature is updated. I can't get anything out of him other than > > because "it's fun". I'm just trying to understand how a PID controller > > can work better than the set point controller when there is no > > proportional control over the heat, just on and off. > > > > The only thing I can think is that the PID, when properly designed, will > > inherently consider the thermal mass of the heating element while with > > the set point controller it has to be accounted for by an anticipator. > > Even so, I don't see the two as much similar, is that wrong? > > > > BTW, who is "the resident control expert"? > > > > http://www.amazon.com/Applied-Control-Embedded-Systems-Technology/dp/0750678399 > > > -Lasse
There is that... George H.