Reply by May 21, 20172017-05-21
On Sunday, May 14, 2017 at 8:10:36 AM UTC+12, Kevin Neilson wrote:
> > It seems like folks generally (and perhaps this is totally wrong) design > > PID controllers by basically selecting what they think are "good" > > constants for the proportional, integral, and derivative terms. That is, > > they just sorta play with their systems and tweak the terms until it > > seems to work smoothly. > > This has pretty much been the design technique since the dawn of time. I finally got tired of it at one job when I was building another digital PLL and I decided to make the universal PID code in Verilog so I wouldn't have to do it ever again; I could reuse the same code and just set a bunch of parameters, including all the loop gains/constants. (Most of my loops have been PI, so the D part doesn't come into play.) I wouldn't have to tweak anymore, which was good especially in this case because the loop settling time was measured in seconds and it too forever to sim. > > It worked pretty well, but, of course, I left the job soon thereafter and didn't get to reuse the code. That's the disincentive to investing too much in reusability. > > It's another example of the massive duplication of effort in the industry. Most things you want to do have been done, but it's all hidden away. How many times RS232 UARTs have been written in history? Most of them bad, with domain-crossing problems, and hardcoded to one baud rate.
PID is pretty lame for many applications but works more or less. You can do far better with a proper Bode Plot and designing it that way with lag-lead and PI combinations. For example multiple integrators and phase-leads can be used and the result is far better. With two integrators the gain is far higher and tracking is better. Some form of measure of bandwidth is needed as well which PID doesn't really have. However, for some applications I admit it's good enough and you don't have complicated maths models
Reply by Tim Wescott May 16, 20172017-05-16
On Mon, 15 May 2017 20:03:30 -0500, Les Cargill wrote:

> Tim Wescott wrote: >> On Mon, 15 May 2017 00:22:07 -0400, rickman wrote: >> >>> On 5/14/2017 8:06 PM, Tim Wescott wrote: >>>> On Sat, 13 May 2017 15:47:29 -0400, rickman wrote: >>>> >>>>> On 5/13/2017 12:53 PM, Randy Yates wrote: >>>>>> Tim Wescott <tim@seemywebsite.really> writes: >>>>>> >>>>>>> On Fri, 12 May 2017 11:17:05 -0400, Randy Yates wrote: >>>>>>> >>>>>>>> I know next-to-nothing about this topic, but the following >>>>>>>> question has popped into my mind several times. >>>>>>>> >>>>>>>> It seems like folks generally (and perhaps this is totally wrong) >>>>>>>> design PID controllers by basically selecting what they think are >>>>>>>> "good" constants for the proportional, integral, and derivative >>>>>>>> terms. That is, they just sorta play with their systems and tweak >>>>>>>> the terms until it seems to work smoothly. >>>>>>>> >>>>>>>> However, how do you know that a particular configuration is >>>>>>>> stable? >>>>>>> >>>>>>> If you are tuning informally, then the informal way of making sure >>>>>>> the system is stable is to make sure that it is neither singing >>>>>>> nor dancing. Telling the difference between an autonomous >>>>>>> oscillation and some external signal being amplified is a matter >>>>>>> of experience. >>>>>>> >>>>>>> If you're doing formal loop tuning (which is _not_ a matter of >>>>>>> randomly choosing values, but rather measuring or deriving a plant >>>>>>> model from first principles, and then doing real live math on the >>>>>>> model), then there are a number of ways which are appropriate to >>>>>>> the methods you're using. >>>>>>> >>>>>>> If you're going by swept-sine measurement of the plant response, >>>>>>> then Bode and/or Nyquist charts. >>>>>>> >>>>>>> If you're going by a Laplace-domain model (i.e., transfer >>>>>>> functions), then you work out the transfer function of the overall >>>>>>> system and decide if its stable (or you decide on the pole >>>>>>> locations of the finished system and get your PID gains from >>>>>>> that). >>>>>>> >>>>>>> If you're going by a linear state-space model, then you check the >>>>>>> eigenvalues of the model of the overall system, or you do your >>>>>>> design by pole placement. >>>>>>> >>>>>>> If you're using a nonlinear plant model, then you use an >>>>>>> appropriate nonlinear method (I don't know what's popular -- I >>>>>>> rarely have to do this, and it seems that each problem has its own >>>>>>> correct method). >>>>>> >>>>>> Hey Tim, >>>>>> >>>>>> Thank you for such a comprehensive response. >>>>>> >>>>>> I was probably not clear in my question. I wasn't asking how to >>>>>> formally determine stability - that I have had a small amount of >>>>>> experience in, and certainly have studied some methods in the >>>>>> control system classes I've had (although I've forgotten much of >>>>>> it). >>>>>> >>>>>> I guess what I'm asking (which may have been a bit of a dumb >>>>>> question) is, is there some inherent property of PID controllers >>>>>> that makes them unconditionally stable, or at least stable in a >>>>>> wide variety of situations? I.e., is it unneceessary for folks who >>>>>> just sort of "tweak" such systems to be concerned about their >>>>>> stability? >>>>>> >>>>>> I'm pretty sure the answer to that last question is: no. >>>>> >>>>> I think the real problem is that while you can design a controller >>>>> that can be stable, that stability depends on the device being >>>>> controlled as it is the loop characteristics that determine >>>>> stability. >>>>> >>>>> So clearly there is no way to assure stability in a control loop >>>>> without knowing about the device being controlled. I suppose a very >>>>> sophisticated controller could perform actions to measure parameters >>>>> and then configure itself. But then you wouldn't be tweaking that >>>>> would you? >>>> >>>> Self-tweaking controllers was tried -- the field is called "Adaptive >>>> Control" and it turns out that except in narrow circumstances you >>>> work just as hard for not much better performance than you would if >>>> you just made the plant more predictable. >>> >>> Do you always have plants you can alter? >> >> No, but often the most cost-effective way to achieve a certain control- >> systems goal is to tweak the plant. The ultimate performance of any >> control system is limited by the plant; when you hit that limit the >> only way forward is by tweaking the plant. >> >> > I'd exclude - possibly - adaptive feedforward for some cases, mainly for > slow-moving plant.
Actually, me too. Especially if there are lots of repetitive, identical movements and the "adaptation" is just feedback that's sampled on each movement. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com I'm looking for work -- see my website!
Reply by Les Cargill May 15, 20172017-05-15
Tim Wescott wrote:
> On Mon, 15 May 2017 00:22:07 -0400, rickman wrote: > >> On 5/14/2017 8:06 PM, Tim Wescott wrote: >>> On Sat, 13 May 2017 15:47:29 -0400, rickman wrote: >>> >>>> On 5/13/2017 12:53 PM, Randy Yates wrote: >>>>> Tim Wescott <tim@seemywebsite.really> writes: >>>>> >>>>>> On Fri, 12 May 2017 11:17:05 -0400, Randy Yates wrote: >>>>>> >>>>>>> I know next-to-nothing about this topic, but the >>>>>>> following question has popped into my mind several >>>>>>> times. >>>>>>> >>>>>>> It seems like folks generally (and perhaps this is >>>>>>> totally wrong) design PID controllers by basically >>>>>>> selecting what they think are "good" constants for the >>>>>>> proportional, integral, and derivative terms. That is, >>>>>>> they just sorta play with their systems and tweak the >>>>>>> terms until it seems to work smoothly. >>>>>>> >>>>>>> However, how do you know that a particular configuration >>>>>>> is stable? >>>>>> >>>>>> If you are tuning informally, then the informal way of >>>>>> making sure the system is stable is to make sure that it is >>>>>> neither singing nor dancing. Telling the difference between >>>>>> an autonomous oscillation and some external signal being >>>>>> amplified is a matter of experience. >>>>>> >>>>>> If you're doing formal loop tuning (which is _not_ a matter >>>>>> of randomly choosing values, but rather measuring or >>>>>> deriving a plant model from first principles, and then >>>>>> doing real live math on the model), then there are a number >>>>>> of ways which are appropriate to the methods you're using. >>>>>> >>>>>> If you're going by swept-sine measurement of the plant >>>>>> response, then Bode and/or Nyquist charts. >>>>>> >>>>>> If you're going by a Laplace-domain model (i.e., transfer >>>>>> functions), then you work out the transfer function of the >>>>>> overall system and decide if its stable (or you decide on >>>>>> the pole locations of the finished system and get your PID >>>>>> gains from that). >>>>>> >>>>>> If you're going by a linear state-space model, then you >>>>>> check the eigenvalues of the model of the overall system, >>>>>> or you do your design by pole placement. >>>>>> >>>>>> If you're using a nonlinear plant model, then you use an >>>>>> appropriate nonlinear method (I don't know what's popular >>>>>> -- I rarely have to do this, and it seems that each problem >>>>>> has its own correct method). >>>>> >>>>> Hey Tim, >>>>> >>>>> Thank you for such a comprehensive response. >>>>> >>>>> I was probably not clear in my question. I wasn't asking how >>>>> to formally determine stability - that I have had a small >>>>> amount of experience in, and certainly have studied some >>>>> methods in the control system classes I've had (although I've >>>>> forgotten much of it). >>>>> >>>>> I guess what I'm asking (which may have been a bit of a dumb >>>>> question) is, is there some inherent property of PID >>>>> controllers that makes them unconditionally stable, or at >>>>> least stable in a wide variety of situations? I.e., is it >>>>> unneceessary for folks who just sort of "tweak" such systems >>>>> to be concerned about their stability? >>>>> >>>>> I'm pretty sure the answer to that last question is: no. >>>> >>>> I think the real problem is that while you can design a >>>> controller that can be stable, that stability depends on the >>>> device being controlled as it is the loop characteristics that >>>> determine stability. >>>> >>>> So clearly there is no way to assure stability in a control >>>> loop without knowing about the device being controlled. I >>>> suppose a very sophisticated controller could perform actions >>>> to measure parameters and then configure itself. But then you >>>> wouldn't be tweaking that would you? >>> >>> Self-tweaking controllers was tried -- the field is called >>> "Adaptive Control" and it turns out that except in narrow >>> circumstances you work just as hard for not much better >>> performance than you would if you just made the plant more >>> predictable. >> >> Do you always have plants you can alter? > > No, but often the most cost-effective way to achieve a certain > control- systems goal is to tweak the plant. The ultimate > performance of any control system is limited by the plant; when you > hit that limit the only way forward is by tweaking the plant. >
I'd exclude - possibly - adaptive feedforward for some cases, mainly for slow-moving plant. The better your initial reaction to a step is, the better off you'll be. -- Les Cargill
Reply by Tim Wescott May 15, 20172017-05-15
On Mon, 15 May 2017 01:18:05 -0400, rickman wrote:

> On 5/15/2017 1:03 AM, Tim Wescott wrote: >> On Mon, 15 May 2017 00:22:07 -0400, rickman wrote: >> >>> On 5/14/2017 8:06 PM, Tim Wescott wrote: >>>> On Sat, 13 May 2017 15:47:29 -0400, rickman wrote: >>>> >>>>> On 5/13/2017 12:53 PM, Randy Yates wrote: >>>>>> Tim Wescott <tim@seemywebsite.really> writes: >>>>>> >>>>>>> On Fri, 12 May 2017 11:17:05 -0400, Randy Yates wrote: >>>>>>> >>>>>>>> I know next-to-nothing about this topic, but the following >>>>>>>> question has popped into my mind several times. >>>>>>>> >>>>>>>> It seems like folks generally (and perhaps this is totally wrong) >>>>>>>> design PID controllers by basically selecting what they think are >>>>>>>> "good" constants for the proportional, integral, and derivative >>>>>>>> terms. That is, >>>>>>>> they just sorta play with their systems and tweak the terms until >>>>>>>> it seems to work smoothly. >>>>>>>> >>>>>>>> However, how do you know that a particular configuration is >>>>>>>> stable? >>>>>>> >>>>>>> If you are tuning informally, then the informal way of making sure >>>>>>> the system is stable is to make sure that it is neither singing >>>>>>> nor dancing. Telling the difference between an autonomous >>>>>>> oscillation and some external signal being amplified is a matter >>>>>>> of experience. >>>>>>> >>>>>>> If you're doing formal loop tuning (which is _not_ a matter of >>>>>>> randomly choosing values, but rather measuring or deriving a plant >>>>>>> model from first principles, and then doing real live math on the >>>>>>> model), then there are a number of ways which are appropriate to >>>>>>> the methods you're using. >>>>>>> >>>>>>> If you're going by swept-sine measurement of the plant response, >>>>>>> then Bode and/or Nyquist charts. >>>>>>> >>>>>>> If you're going by a Laplace-domain model (i.e., transfer >>>>>>> functions), then you work out the transfer function of the overall >>>>>>> system and decide if its stable (or you decide on the pole >>>>>>> locations of the finished system and get your PID gains from >>>>>>> that). >>>>>>> >>>>>>> If you're going by a linear state-space model, then you check the >>>>>>> eigenvalues of the model of the overall system, or you do your >>>>>>> design by pole placement. >>>>>>> >>>>>>> If you're using a nonlinear plant model, then you use an >>>>>>> appropriate nonlinear method (I don't know what's popular -- I >>>>>>> rarely have to do this, and it seems that each problem has its own >>>>>>> correct method). >>>>>> >>>>>> Hey Tim, >>>>>> >>>>>> Thank you for such a comprehensive response. >>>>>> >>>>>> I was probably not clear in my question. I wasn't asking how to >>>>>> formally determine stability - that I have had a small amount of >>>>>> experience in, and certainly have studied some methods in the >>>>>> control system classes I've had (although I've forgotten much of >>>>>> it). >>>>>> >>>>>> I guess what I'm asking (which may have been a bit of a dumb >>>>>> question) is, is there some inherent property of PID controllers >>>>>> that makes them unconditionally stable, or at least stable in a >>>>>> wide variety of situations? I.e., is it unneceessary for folks who >>>>>> just sort of "tweak" >>>>>> such systems to be concerned about their stability? >>>>>> >>>>>> I'm pretty sure the answer to that last question is: no. >>>>> >>>>> I think the real problem is that while you can design a controller >>>>> that can be stable, that stability depends on the device being >>>>> controlled as it is the loop characteristics that determine >>>>> stability. >>>>> >>>>> So clearly there is no way to assure stability in a control loop >>>>> without knowing about the device being controlled. I suppose a very >>>>> sophisticated controller could perform actions to measure parameters >>>>> and then configure itself. But then you wouldn't be tweaking that >>>>> would you? >>>> >>>> Self-tweaking controllers was tried -- the field is called "Adaptive >>>> Control" and it turns out that except in narrow circumstances you >>>> work just as hard for not much better performance than you would if >>>> you just made the plant more predictable. >>> >>> Do you always have plants you can alter? >> >> No, but often the most cost-effective way to achieve a certain control- >> systems goal is to tweak the plant. The ultimate performance of any >> control system is limited by the plant; when you hit that limit the >> only way forward is by tweaking the plant. > > Ok, but likewise once you have tweaked the plant as much as you can, the > only way forward is to improve your controller.
Yes. But with caveats. The error that I've seen in practice comes from putting too much reliance on being able to further tweak a controller -- you have to know how far you can push things, and when to stop. And you can always push the tuning farther for one instance of a device than you can for a whole production run, because you end up tuning to a particular device's peculiarities -- and the next one has different peculiarities. Ditto that one device at one temperature and at one point in it's lifetime -- environmental changes and aging can affect the plant in ways that render a formerly-acceptable tuning invalid. -- www.wescottdesign.com
Reply by rickman May 15, 20172017-05-15
On 5/15/2017 1:03 AM, Tim Wescott wrote:
> On Mon, 15 May 2017 00:22:07 -0400, rickman wrote: > >> On 5/14/2017 8:06 PM, Tim Wescott wrote: >>> On Sat, 13 May 2017 15:47:29 -0400, rickman wrote: >>> >>>> On 5/13/2017 12:53 PM, Randy Yates wrote: >>>>> Tim Wescott <tim@seemywebsite.really> writes: >>>>> >>>>>> On Fri, 12 May 2017 11:17:05 -0400, Randy Yates wrote: >>>>>> >>>>>>> I know next-to-nothing about this topic, but the following question >>>>>>> has popped into my mind several times. >>>>>>> >>>>>>> It seems like folks generally (and perhaps this is totally wrong) >>>>>>> design PID controllers by basically selecting what they think are >>>>>>> "good" constants for the proportional, integral, and derivative >>>>>>> terms. That is, >>>>>>> they just sorta play with their systems and tweak the terms until >>>>>>> it seems to work smoothly. >>>>>>> >>>>>>> However, how do you know that a particular configuration is stable? >>>>>> >>>>>> If you are tuning informally, then the informal way of making sure >>>>>> the system is stable is to make sure that it is neither singing nor >>>>>> dancing. Telling the difference between an autonomous oscillation >>>>>> and some external signal being amplified is a matter of experience. >>>>>> >>>>>> If you're doing formal loop tuning (which is _not_ a matter of >>>>>> randomly choosing values, but rather measuring or deriving a plant >>>>>> model from first principles, and then doing real live math on the >>>>>> model), then there are a number of ways which are appropriate to the >>>>>> methods you're using. >>>>>> >>>>>> If you're going by swept-sine measurement of the plant response, >>>>>> then Bode and/or Nyquist charts. >>>>>> >>>>>> If you're going by a Laplace-domain model (i.e., transfer >>>>>> functions), then you work out the transfer function of the overall >>>>>> system and decide if its stable (or you decide on the pole locations >>>>>> of the finished system and get your PID gains from that). >>>>>> >>>>>> If you're going by a linear state-space model, then you check the >>>>>> eigenvalues of the model of the overall system, or you do your >>>>>> design by pole placement. >>>>>> >>>>>> If you're using a nonlinear plant model, then you use an appropriate >>>>>> nonlinear method (I don't know what's popular -- I rarely have to do >>>>>> this, and it seems that each problem has its own correct method). >>>>> >>>>> Hey Tim, >>>>> >>>>> Thank you for such a comprehensive response. >>>>> >>>>> I was probably not clear in my question. I wasn't asking how to >>>>> formally determine stability - that I have had a small amount of >>>>> experience in, and certainly have studied some methods in the control >>>>> system classes I've had (although I've forgotten much of it). >>>>> >>>>> I guess what I'm asking (which may have been a bit of a dumb >>>>> question) is, is there some inherent property of PID controllers that >>>>> makes them unconditionally stable, or at least stable in a wide >>>>> variety of situations? I.e., is it unneceessary for folks who just >>>>> sort of "tweak" >>>>> such systems to be concerned about their stability? >>>>> >>>>> I'm pretty sure the answer to that last question is: no. >>>> >>>> I think the real problem is that while you can design a controller >>>> that can be stable, that stability depends on the device being >>>> controlled as it is the loop characteristics that determine stability. >>>> >>>> So clearly there is no way to assure stability in a control loop >>>> without knowing about the device being controlled. I suppose a very >>>> sophisticated controller could perform actions to measure parameters >>>> and then configure itself. But then you wouldn't be tweaking that >>>> would you? >>> >>> Self-tweaking controllers was tried -- the field is called "Adaptive >>> Control" and it turns out that except in narrow circumstances you work >>> just as hard for not much better performance than you would if you just >>> made the plant more predictable. >> >> Do you always have plants you can alter? > > No, but often the most cost-effective way to achieve a certain control- > systems goal is to tweak the plant. The ultimate performance of any > control system is limited by the plant; when you hit that limit the only > way forward is by tweaking the plant.
Ok, but likewise once you have tweaked the plant as much as you can, the only way forward is to improve your controller. -- Rick C
Reply by Tim Wescott May 15, 20172017-05-15
On Mon, 15 May 2017 00:22:07 -0400, rickman wrote:

> On 5/14/2017 8:06 PM, Tim Wescott wrote: >> On Sat, 13 May 2017 15:47:29 -0400, rickman wrote: >> >>> On 5/13/2017 12:53 PM, Randy Yates wrote: >>>> Tim Wescott <tim@seemywebsite.really> writes: >>>> >>>>> On Fri, 12 May 2017 11:17:05 -0400, Randy Yates wrote: >>>>> >>>>>> I know next-to-nothing about this topic, but the following question >>>>>> has popped into my mind several times. >>>>>> >>>>>> It seems like folks generally (and perhaps this is totally wrong) >>>>>> design PID controllers by basically selecting what they think are >>>>>> "good" constants for the proportional, integral, and derivative >>>>>> terms. That is, >>>>>> they just sorta play with their systems and tweak the terms until >>>>>> it seems to work smoothly. >>>>>> >>>>>> However, how do you know that a particular configuration is stable? >>>>> >>>>> If you are tuning informally, then the informal way of making sure >>>>> the system is stable is to make sure that it is neither singing nor >>>>> dancing. Telling the difference between an autonomous oscillation >>>>> and some external signal being amplified is a matter of experience. >>>>> >>>>> If you're doing formal loop tuning (which is _not_ a matter of >>>>> randomly choosing values, but rather measuring or deriving a plant >>>>> model from first principles, and then doing real live math on the >>>>> model), then there are a number of ways which are appropriate to the >>>>> methods you're using. >>>>> >>>>> If you're going by swept-sine measurement of the plant response, >>>>> then Bode and/or Nyquist charts. >>>>> >>>>> If you're going by a Laplace-domain model (i.e., transfer >>>>> functions), then you work out the transfer function of the overall >>>>> system and decide if its stable (or you decide on the pole locations >>>>> of the finished system and get your PID gains from that). >>>>> >>>>> If you're going by a linear state-space model, then you check the >>>>> eigenvalues of the model of the overall system, or you do your >>>>> design by pole placement. >>>>> >>>>> If you're using a nonlinear plant model, then you use an appropriate >>>>> nonlinear method (I don't know what's popular -- I rarely have to do >>>>> this, and it seems that each problem has its own correct method). >>>> >>>> Hey Tim, >>>> >>>> Thank you for such a comprehensive response. >>>> >>>> I was probably not clear in my question. I wasn't asking how to >>>> formally determine stability - that I have had a small amount of >>>> experience in, and certainly have studied some methods in the control >>>> system classes I've had (although I've forgotten much of it). >>>> >>>> I guess what I'm asking (which may have been a bit of a dumb >>>> question) is, is there some inherent property of PID controllers that >>>> makes them unconditionally stable, or at least stable in a wide >>>> variety of situations? I.e., is it unneceessary for folks who just >>>> sort of "tweak" >>>> such systems to be concerned about their stability? >>>> >>>> I'm pretty sure the answer to that last question is: no. >>> >>> I think the real problem is that while you can design a controller >>> that can be stable, that stability depends on the device being >>> controlled as it is the loop characteristics that determine stability. >>> >>> So clearly there is no way to assure stability in a control loop >>> without knowing about the device being controlled. I suppose a very >>> sophisticated controller could perform actions to measure parameters >>> and then configure itself. But then you wouldn't be tweaking that >>> would you? >> >> Self-tweaking controllers was tried -- the field is called "Adaptive >> Control" and it turns out that except in narrow circumstances you work >> just as hard for not much better performance than you would if you just >> made the plant more predictable. > > Do you always have plants you can alter?
No, but often the most cost-effective way to achieve a certain control- systems goal is to tweak the plant. The ultimate performance of any control system is limited by the plant; when you hit that limit the only way forward is by tweaking the plant. -- www.wescottdesign.com
Reply by rickman May 15, 20172017-05-15
On 5/14/2017 8:06 PM, Tim Wescott wrote:
> On Sat, 13 May 2017 15:47:29 -0400, rickman wrote: > >> On 5/13/2017 12:53 PM, Randy Yates wrote: >>> Tim Wescott <tim@seemywebsite.really> writes: >>> >>>> On Fri, 12 May 2017 11:17:05 -0400, Randy Yates wrote: >>>> >>>>> I know next-to-nothing about this topic, but the following question >>>>> has popped into my mind several times. >>>>> >>>>> It seems like folks generally (and perhaps this is totally wrong) >>>>> design PID controllers by basically selecting what they think are >>>>> "good" constants for the proportional, integral, and derivative >>>>> terms. That is, >>>>> they just sorta play with their systems and tweak the terms until it >>>>> seems to work smoothly. >>>>> >>>>> However, how do you know that a particular configuration is stable? >>>> >>>> If you are tuning informally, then the informal way of making sure the >>>> system is stable is to make sure that it is neither singing nor >>>> dancing. Telling the difference between an autonomous oscillation and >>>> some external signal being amplified is a matter of experience. >>>> >>>> If you're doing formal loop tuning (which is _not_ a matter of >>>> randomly choosing values, but rather measuring or deriving a plant >>>> model from first principles, and then doing real live math on the >>>> model), then there are a number of ways which are appropriate to the >>>> methods you're using. >>>> >>>> If you're going by swept-sine measurement of the plant response, then >>>> Bode and/or Nyquist charts. >>>> >>>> If you're going by a Laplace-domain model (i.e., transfer functions), >>>> then you work out the transfer function of the overall system and >>>> decide if its stable (or you decide on the pole locations of the >>>> finished system and get your PID gains from that). >>>> >>>> If you're going by a linear state-space model, then you check the >>>> eigenvalues of the model of the overall system, or you do your design >>>> by pole placement. >>>> >>>> If you're using a nonlinear plant model, then you use an appropriate >>>> nonlinear method (I don't know what's popular -- I rarely have to do >>>> this, and it seems that each problem has its own correct method). >>> >>> Hey Tim, >>> >>> Thank you for such a comprehensive response. >>> >>> I was probably not clear in my question. I wasn't asking how to >>> formally determine stability - that I have had a small amount of >>> experience in, and certainly have studied some methods in the control >>> system classes I've had (although I've forgotten much of it). >>> >>> I guess what I'm asking (which may have been a bit of a dumb question) >>> is, is there some inherent property of PID controllers that makes them >>> unconditionally stable, or at least stable in a wide variety of >>> situations? I.e., is it unneceessary for folks who just sort of "tweak" >>> such systems to be concerned about their stability? >>> >>> I'm pretty sure the answer to that last question is: no. >> >> I think the real problem is that while you can design a controller that >> can be stable, that stability depends on the device being controlled as >> it is the loop characteristics that determine stability. >> >> So clearly there is no way to assure stability in a control loop without >> knowing about the device being controlled. I suppose a very >> sophisticated controller could perform actions to measure parameters and >> then configure itself. But then you wouldn't be tweaking that would >> you? > > Self-tweaking controllers was tried -- the field is called "Adaptive > Control" and it turns out that except in narrow circumstances you work > just as hard for not much better performance than you would if you just > made the plant more predictable.
Do you always have plants you can alter? -- Rick C
Reply by Tim Wescott May 14, 20172017-05-14
On Sat, 13 May 2017 15:47:29 -0400, rickman wrote:

> On 5/13/2017 12:53 PM, Randy Yates wrote: >> Tim Wescott <tim@seemywebsite.really> writes: >> >>> On Fri, 12 May 2017 11:17:05 -0400, Randy Yates wrote: >>> >>>> I know next-to-nothing about this topic, but the following question >>>> has popped into my mind several times. >>>> >>>> It seems like folks generally (and perhaps this is totally wrong) >>>> design PID controllers by basically selecting what they think are >>>> "good" constants for the proportional, integral, and derivative >>>> terms. That is, >>>> they just sorta play with their systems and tweak the terms until it >>>> seems to work smoothly. >>>> >>>> However, how do you know that a particular configuration is stable? >>> >>> If you are tuning informally, then the informal way of making sure the >>> system is stable is to make sure that it is neither singing nor >>> dancing. Telling the difference between an autonomous oscillation and >>> some external signal being amplified is a matter of experience. >>> >>> If you're doing formal loop tuning (which is _not_ a matter of >>> randomly choosing values, but rather measuring or deriving a plant >>> model from first principles, and then doing real live math on the >>> model), then there are a number of ways which are appropriate to the >>> methods you're using. >>> >>> If you're going by swept-sine measurement of the plant response, then >>> Bode and/or Nyquist charts. >>> >>> If you're going by a Laplace-domain model (i.e., transfer functions), >>> then you work out the transfer function of the overall system and >>> decide if its stable (or you decide on the pole locations of the >>> finished system and get your PID gains from that). >>> >>> If you're going by a linear state-space model, then you check the >>> eigenvalues of the model of the overall system, or you do your design >>> by pole placement. >>> >>> If you're using a nonlinear plant model, then you use an appropriate >>> nonlinear method (I don't know what's popular -- I rarely have to do >>> this, and it seems that each problem has its own correct method). >> >> Hey Tim, >> >> Thank you for such a comprehensive response. >> >> I was probably not clear in my question. I wasn't asking how to >> formally determine stability - that I have had a small amount of >> experience in, and certainly have studied some methods in the control >> system classes I've had (although I've forgotten much of it). >> >> I guess what I'm asking (which may have been a bit of a dumb question) >> is, is there some inherent property of PID controllers that makes them >> unconditionally stable, or at least stable in a wide variety of >> situations? I.e., is it unneceessary for folks who just sort of "tweak" >> such systems to be concerned about their stability? >> >> I'm pretty sure the answer to that last question is: no. > > I think the real problem is that while you can design a controller that > can be stable, that stability depends on the device being controlled as > it is the loop characteristics that determine stability. > > So clearly there is no way to assure stability in a control loop without > knowing about the device being controlled. I suppose a very > sophisticated controller could perform actions to measure parameters and > then configure itself. But then you wouldn't be tweaking that would > you?
Self-tweaking controllers was tried -- the field is called "Adaptive Control" and it turns out that except in narrow circumstances you work just as hard for not much better performance than you would if you just made the plant more predictable. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com I'm looking for work -- see my website!
Reply by Kevin Neilson May 13, 20172017-05-13
> It worked pretty well, but, of course, I left the job soon thereafter and didn't get to reuse the code. That's the disincentive to investing too much in reusability. >
I wish I still had that code. I think it allowed you to put in that loop constant (Xi?) that determines the damping factor. You also had to specify the clock frequency as a parameter and that normalized everything so you could specify the other constants in seconds or whatever. I don't recall much now. It's one of those things that, every time you start a new project, you look at the textbook in despair, and assume that it will just take less time to tweak it than to go through all the math again, which usually ends up not being the case.
Reply by Kevin Neilson May 13, 20172017-05-13
> It seems like folks generally (and perhaps this is totally wrong) design > PID controllers by basically selecting what they think are "good" > constants for the proportional, integral, and derivative terms. That is, > they just sorta play with their systems and tweak the terms until it > seems to work smoothly.
This has pretty much been the design technique since the dawn of time. I f= inally got tired of it at one job when I was building another digital PLL a= nd I decided to make the universal PID code in Verilog so I wouldn't have t= o do it ever again; I could reuse the same code and just set a bunch of par= ameters, including all the loop gains/constants. (Most of my loops have be= en PI, so the D part doesn't come into play.) I wouldn't have to tweak any= more, which was good especially in this case because the loop settling time= was measured in seconds and it too forever to sim. It worked pretty well, but, of course, I left the job soon thereafter and d= idn't get to reuse the code. That's the disincentive to investing too much= in reusability. It's another example of the massive duplication of effort in the industry. = Most things you want to do have been done, but it's all hidden away. How = many times RS232 UARTs have been written in history? Most of them bad, wit= h domain-crossing problems, and hardcoded to one baud rate.