EmbeddedRelated.com
Forums
The 2026 Embedded Online Conference

PID Without a PhD, Finally

Started by Tim Wescott April 14, 2016
On Tue, 26 Apr 2016 21:45:06 -0500, Les Cargill
<lcargill99@comcast.com> wrote:

>John Larkin wrote: >> On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie <dj@delorie.com> wrote: >> >>> >>> You leave out math but include C code, I think that's defeating the >>> purpose. If you can't explain it in non-technical words or a simple >>> picture... well, try harder :-) >>> >>> You spend only one page on tuning, and give no examples of "If you see >>> this, try this" which is much more useful to the practical user. >> >> >> Engineers tend to do >> >> Actuator = error * (Kp + Ki + Kd) >> > >Uhhhhh... no. > >Actuator = (error * Kp) > + ( filter1(sum(error)) * Ki ) > + ( filter2(delta(error,lastError)) * Kd) > >> whereas old-time analog controllers did >> >> Actuator = Kp * (1 + Ki + Kd) >> >> with the idea being that it's easier to tune on-site. >> >> > >Because trimpots are awesome.
Oh, you know what I mean. Old-time analog PID controllers often used a different sigal flow path than sum-of-terms. -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
John Larkin wrote:
> On Tue, 26 Apr 2016 21:45:06 -0500, Les Cargill > <lcargill99@comcast.com> wrote: > >> John Larkin wrote: >>> On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie <dj@delorie.com> wrote: >>> >>>> >>>> You leave out math but include C code, I think that's defeating the >>>> purpose. If you can't explain it in non-technical words or a simple >>>> picture... well, try harder :-) >>>> >>>> You spend only one page on tuning, and give no examples of "If you see >>>> this, try this" which is much more useful to the practical user. >>> >>> >>> Engineers tend to do >>> >>> Actuator = error * (Kp + Ki + Kd) >>> >> >> Uhhhhh... no. >> >> Actuator = (error * Kp) >> + ( filter1(sum(error)) * Ki ) >> + ( filter2(delta(error,lastError)) * Kd) >> >>> whereas old-time analog controllers did >>> >>> Actuator = Kp * (1 + Ki + Kd) >>> >>> with the idea being that it's easier to tune on-site. >>> >>> >> >> Because trimpots are awesome. > > Oh, you know what I mean. Old-time analog PID controllers often used a > different sigal flow path than sum-of-terms. > >
Oh, I'm sure. I haven't done anything directly with analog PID other than read about them. -- Les Cargill
In article <nfuiil$cc0$2@dont-email.me>, lcargill99@comcast.com says...
> > John Larkin wrote: > > On Tue, 26 Apr 2016 21:45:06 -0500, Les Cargill > > <lcargill99@comcast.com> wrote: > > > >> John Larkin wrote: > >>> On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie <dj@delorie.com> wrote: > >>> > >>>> > >>>> You leave out math but include C code, I think that's defeating the > >>>> purpose. If you can't explain it in non-technical words or a simple > >>>> picture... well, try harder :-) > >>>> > >>>> You spend only one page on tuning, and give no examples of "If you see > >>>> this, try this" which is much more useful to the practical user. > >>> > >>> > >>> Engineers tend to do > >>> > >>> Actuator = error * (Kp + Ki + Kd) > >>> > >> > >> Uhhhhh... no. > >> > >> Actuator = (error * Kp) > >> + ( filter1(sum(error)) * Ki ) > >> + ( filter2(delta(error,lastError)) * Kd) > >> > >>> whereas old-time analog controllers did > >>> > >>> Actuator = Kp * (1 + Ki + Kd) > >>> > >>> with the idea being that it's easier to tune on-site. > >>> > >>> > >> > >> Because trimpots are awesome. > > > > Oh, you know what I mean. Old-time analog PID controllers often used a > > different sigal flow path than sum-of-terms. > > > > > > Oh, I'm sure. I haven't done anything directly with analog > PID other than read about them.
http://www.contrexinc.com/PDF/Reflex/tm_12m03_104.pdf That is a perfect Analog PID circuit,.. Scroll down to see print. LAG = (I) With enhanced control. LEAD= (D) " " " Via the BREAK levels. GAIN= (P) Dancer POS is the Set Point (SP) While the input to the buffer is the Process Value (PV) Jamie
On Thu, 28 Apr 2016 22:02:08 -0500, Les Cargill
<lcargill99@comcast.com> wrote:

>John Larkin wrote: >> On Tue, 26 Apr 2016 21:45:06 -0500, Les Cargill >> <lcargill99@comcast.com> wrote: >> >>> John Larkin wrote: >>>> On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie <dj@delorie.com> wrote: >>>> >>>>> >>>>> You leave out math but include C code, I think that's defeating the >>>>> purpose. If you can't explain it in non-technical words or a simple >>>>> picture... well, try harder :-) >>>>> >>>>> You spend only one page on tuning, and give no examples of "If you see >>>>> this, try this" which is much more useful to the practical user. >>>> >>>> >>>> Engineers tend to do >>>> >>>> Actuator = error * (Kp + Ki + Kd) >>>> >>> >>> Uhhhhh... no. >>> >>> Actuator = (error * Kp) >>> + ( filter1(sum(error)) * Ki ) >>> + ( filter2(delta(error,lastError)) * Kd) >>> >>>> whereas old-time analog controllers did >>>> >>>> Actuator = Kp * (1 + Ki + Kd) >>>> >>>> with the idea being that it's easier to tune on-site. >>>> >>>> >>> >>> Because trimpots are awesome. >> >> Oh, you know what I mean. Old-time analog PID controllers often used a >> different sigal flow path than sum-of-terms. >> >> > >Oh, I'm sure. I haven't done anything directly with analog >PID other than read about them.
We do it all the time on boards: voltage regulator loops, power amps, that sort of thing. -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
On Mon, 02 May 2016 10:50:32 -0700, John Larkin wrote:

> On Thu, 28 Apr 2016 22:02:08 -0500, Les Cargill <lcargill99@comcast.com> > wrote: > >>John Larkin wrote: >>> On Tue, 26 Apr 2016 21:45:06 -0500, Les Cargill >>> <lcargill99@comcast.com> wrote: >>> >>>> John Larkin wrote: >>>>> On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie <dj@delorie.com> >>>>> wrote: >>>>> >>>>> >>>>>> You leave out math but include C code, I think that's defeating the >>>>>> purpose. If you can't explain it in non-technical words or a >>>>>> simple picture... well, try harder :-) >>>>>> >>>>>> You spend only one page on tuning, and give no examples of "If you >>>>>> see this, try this" which is much more useful to the practical >>>>>> user. >>>>> >>>>> >>>>> Engineers tend to do >>>>> >>>>> Actuator = error * (Kp + Ki + Kd) >>>>> >>>>> >>>> Uhhhhh... no. >>>> >>>> Actuator = (error * Kp) >>>> + ( filter1(sum(error)) * Ki ) >>>> + ( filter2(delta(error,lastError)) * Kd) >>>> >>>>> whereas old-time analog controllers did >>>>> >>>>> Actuator = Kp * (1 + Ki + Kd) >>>>> >>>>> with the idea being that it's easier to tune on-site. >>>>> >>>>> >>>>> >>>> Because trimpots are awesome. >>> >>> Oh, you know what I mean. Old-time analog PID controllers often used a >>> different sigal flow path than sum-of-terms. >>> >>> >>> >>Oh, I'm sure. I haven't done anything directly with analog PID other >>than read about them. > > We do it all the time on boards: voltage regulator loops, power amps, > that sort of thing.
I have to admit that I do more "seat of the pants" loop tuning in that sort of circumstance than I should. Sometimes more math and less knob-twiddling is a good thing (sometimes not). -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
John Larkin wrote:
> On Thu, 28 Apr 2016 22:02:08 -0500, Les Cargill > <lcargill99@comcast.com> wrote: > >> John Larkin wrote: >>> On Tue, 26 Apr 2016 21:45:06 -0500, Les Cargill >>> <lcargill99@comcast.com> wrote: >>> >>>> John Larkin wrote: >>>>> On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie <dj@delorie.com> wrote: >>>>> >>>>>> >>>>>> You leave out math but include C code, I think that's defeating the >>>>>> purpose. If you can't explain it in non-technical words or a simple >>>>>> picture... well, try harder :-) >>>>>> >>>>>> You spend only one page on tuning, and give no examples of "If you see >>>>>> this, try this" which is much more useful to the practical user. >>>>> >>>>> >>>>> Engineers tend to do >>>>> >>>>> Actuator = error * (Kp + Ki + Kd) >>>>> >>>> >>>> Uhhhhh... no. >>>> >>>> Actuator = (error * Kp) >>>> + ( filter1(sum(error)) * Ki ) >>>> + ( filter2(delta(error,lastError)) * Kd) >>>> >>>>> whereas old-time analog controllers did >>>>> >>>>> Actuator = Kp * (1 + Ki + Kd) >>>>> >>>>> with the idea being that it's easier to tune on-site. >>>>> >>>>> >>>> >>>> Because trimpots are awesome. >>> >>> Oh, you know what I mean. Old-time analog PID controllers often used a >>> different sigal flow path than sum-of-terms. >>> >>> >> >> Oh, I'm sure. I haven't done anything directly with analog >> PID other than read about them. > > We do it all the time on boards: voltage regulator loops, power amps, > that sort of thing. > >
Unlike PIDs, most of those should have a pretty simple method for figuring out it's at balance. I dunno, I've made some things self-calibrating in software lately. I like that better. -- Les Cargill
On Mon, 2 May 2016 19:07:06 -0500, Les Cargill
<lcargill99@comcast.com> wrote:

>John Larkin wrote: >> On Thu, 28 Apr 2016 22:02:08 -0500, Les Cargill >> <lcargill99@comcast.com> wrote: >> >>> John Larkin wrote: >>>> On Tue, 26 Apr 2016 21:45:06 -0500, Les Cargill >>>> <lcargill99@comcast.com> wrote: >>>> >>>>> John Larkin wrote: >>>>>> On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie <dj@delorie.com> wrote: >>>>>> >>>>>>> >>>>>>> You leave out math but include C code, I think that's defeating the >>>>>>> purpose. If you can't explain it in non-technical words or a simple >>>>>>> picture... well, try harder :-) >>>>>>> >>>>>>> You spend only one page on tuning, and give no examples of "If you see >>>>>>> this, try this" which is much more useful to the practical user. >>>>>> >>>>>> >>>>>> Engineers tend to do >>>>>> >>>>>> Actuator = error * (Kp + Ki + Kd) >>>>>> >>>>> >>>>> Uhhhhh... no. >>>>> >>>>> Actuator = (error * Kp) >>>>> + ( filter1(sum(error)) * Ki ) >>>>> + ( filter2(delta(error,lastError)) * Kd) >>>>> >>>>>> whereas old-time analog controllers did >>>>>> >>>>>> Actuator = Kp * (1 + Ki + Kd) >>>>>> >>>>>> with the idea being that it's easier to tune on-site. >>>>>> >>>>>> >>>>> >>>>> Because trimpots are awesome. >>>> >>>> Oh, you know what I mean. Old-time analog PID controllers often used a >>>> different sigal flow path than sum-of-terms. >>>> >>>> >>> >>> Oh, I'm sure. I haven't done anything directly with analog >>> PID other than read about them. >> >> We do it all the time on boards: voltage regulator loops, power amps, >> that sort of thing. >> >> > >Unlike PIDs, most of those should have a pretty simple method for >figuring out it's at balance.
Things like output impedance, loop stability, line and load transient regulation sometimes matter.
> >I dunno, I've made some things self-calibrating in software lately. >I like that better.
Sure, but it's not generally practical to make a voltage regulator using an ADC and a DAC and a lot of code. Analog PID is still useful. We sometimes do temperature controllers as analog PID loops, too. For things like crystal ovens. -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
On Mon, 02 May 2016 13:14:43 -0500, Tim Wescott
<seemywebsite@myfooter.really> wrote:

>On Mon, 02 May 2016 10:50:32 -0700, John Larkin wrote: > >> On Thu, 28 Apr 2016 22:02:08 -0500, Les Cargill <lcargill99@comcast.com> >> wrote: >> >>>John Larkin wrote: >>>> On Tue, 26 Apr 2016 21:45:06 -0500, Les Cargill >>>> <lcargill99@comcast.com> wrote: >>>> >>>>> John Larkin wrote: >>>>>> On Thu, 14 Apr 2016 19:09:26 -0400, DJ Delorie <dj@delorie.com> >>>>>> wrote: >>>>>> >>>>>> >>>>>>> You leave out math but include C code, I think that's defeating the >>>>>>> purpose. If you can't explain it in non-technical words or a >>>>>>> simple picture... well, try harder :-) >>>>>>> >>>>>>> You spend only one page on tuning, and give no examples of "If you >>>>>>> see this, try this" which is much more useful to the practical >>>>>>> user. >>>>>> >>>>>> >>>>>> Engineers tend to do >>>>>> >>>>>> Actuator = error * (Kp + Ki + Kd) >>>>>> >>>>>> >>>>> Uhhhhh... no. >>>>> >>>>> Actuator = (error * Kp) >>>>> + ( filter1(sum(error)) * Ki ) >>>>> + ( filter2(delta(error,lastError)) * Kd) >>>>> >>>>>> whereas old-time analog controllers did >>>>>> >>>>>> Actuator = Kp * (1 + Ki + Kd) >>>>>> >>>>>> with the idea being that it's easier to tune on-site. >>>>>> >>>>>> >>>>>> >>>>> Because trimpots are awesome. >>>> >>>> Oh, you know what I mean. Old-time analog PID controllers often used a >>>> different sigal flow path than sum-of-terms. >>>> >>>> >>>> >>>Oh, I'm sure. I haven't done anything directly with analog PID other >>>than read about them. >> >> We do it all the time on boards: voltage regulator loops, power amps, >> that sort of thing. > >I have to admit that I do more "seat of the pants" loop tuning in that >sort of circumstance than I should.
Nothing wrong with that. We're not at a blackboard trying to impress a classroom full of EE students, we're trying to design something that works.
> >Sometimes more math and less knob-twiddling is a good thing (sometimes >not).
Tuning by simulation is quick. Use a little theory to get the starting point. Any serious loop is nonlinear enough that it should be simulated anyhow. Sometimes the only practical way to design a temperature control loop is by breadboarding it; the thermal structure can be too fuzzy to even simulate. -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
John Larkin <jjlarkin@highlandtechnology.com> writes:
> Sure, but it's not generally practical to make a voltage regulator > using an ADC and a DAC and a lot of code. Analog PID is still useful.
Voltage regulators typically aren't really PID though, I thought. More like P without the I or D.
> We sometimes do temperature controllers as analog PID loops, too. For > things like crystal ovens.
That seems like a more interesting application.
John Larkin <jjlarkin@highlandtechnology.com> writes:
> Sometimes the only practical way to design a temperature control loop > is by breadboarding it; the thermal structure can be too fuzzy to even > simulate.
I wonder how close you can come by sticking temperature sensors all over the place during development. Then apply heat in a single place and see how the temperature map evolves over time; then move the heat source to another place and repeat, etc. The idea is to get enough info to let you simulate the system accurately using basic thermo equations.
The 2026 Embedded Online Conference