Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #29703

Re: PID controller: dummy questions

Subject Re: PID controller: dummy questions
Newsgroups comp.arch.embedded
References <rd2odq$oiv$1@dont-email.me> <rd4dct$9dc$1@dont-email.me> <DnpJG.46868$5_4.33259@fx40.iad> <559b8f50-7e32-4e92-8d2d-7cad53f19095o@googlegroups.com>
From Richard Damon <Richard@Damon-Family.org>
Message-ID <R5yJG.196$cc1.128@fx29.iad> (permalink)
Organization Forte - www.forteinc.com
Date 2020-06-26 22:24 -0400

Show all headers | View raw


On 6/26/20 3:00 PM, Rick C wrote:
> On Friday, June 26, 2020 at 12:29:27 PM UTC-4, Richard Damon wrote:
>> On 6/26/20 4:59 AM, pozz wrote:
>>> Il 25/06/2020 19:55, pozz ha scritto:
>>>> I'm trying to implement a PID controller in C for an embbeded system.
>>>> This is the first time. I think I haven't fully understand the theory.
>>>
>>> I read all your answers, but I didn't get the point.
>>>
>>> I'm thinking of a system where a process variable (PV, such as a liquid
>>> flow) must match a desired set point (SP, such as 1 lt/min). The
>>> controller can change a control variable (CV, such as a voltage applied
>>> to an electronic valve).
>>>
>>> If we need 1 lt/min we start opening the valve increasing the voltage
>>> control. When we see 1 lt/min on a flowmeter, we stop increasing the
>>> voltage that stay indefinitely at, for example, 1.0V.
>>> At the steady state, when the error is zero, the control voltage *is
>>> not* zero, but 1.0V.
>>>
>>> The proportional term (P) of a PID controller can't mimic this "manual
>>> control", because when the error is zero (we found the right voltage on
>>> the valve), the P term drops to zero and the valve would close.
>>>
>>> When I use my brain, I will do:
>>>
>>> - the error is high, rotate the knob fast
>>> - the error is low (we are approaching the desidered value), rotate the
>>> knob slowly
>>> - the error is zero, ok stop rotating the knob
>>>
>>> The P term of a PID controller works in a different way:
>>>
>>> - the error is high, high voltage control, open the valve high
>>> - the error decreases, low voltage control, the valve starts closing
>>> - the error is zero, close the valve completely (P=0)
>>>
>>>
>>> Maybe my brain works as an integrative-only controller?
>>
>> It makes a big difference in what you think of as the 'Plant' and the
>> 'Control Variable'. If your input is 'The speed I am turning the knob',
>> then your control law is a Proportional control system. If you input is
>> 'How much the valve is open', then you control law in an Integral
>> control system. Note, the difference is because position is the integral
>> of Velocity.
>>
>> One important aspect of a system is how many poles (or zeros) it has at
>> zero (or near zero). These will vastly affect what type of control loop
>> you want to put around the system.
> 
> The realities of thermal control are complex with the heating device introducing an element of integrated response in addition to the thing being heated.  Formal analysis is often impossible.  So the resulting design  process is to twiddle the PID coefficients until you get a feel for the optimum settings.  
> 
> Alternatively the "plant" response can be measured by applying inputs and analyzing the outputs.  Complex to do in practice for many systems. 
> 

Defining the plant doesn't necessarily mean fully knowing its dynamics,
but more importantly, what the controls actually mean. Am I controlling
how fast I am turning the valve know, or am I controlling the valve
position. The shift from position to speed effectively added an
integrator into the system.

Yes, thermal systems tend to be fairly heavily low pass filter systems,
and you often don't have a detailed provided response (and it might
easily change over time and ambilant conditions). What isn't hard to get
is an idea of your zero frequency pole/zero situation. Imagine a
constant, small signal excitiation to the system. The system is likely
to do one of three things (assuming a system that is at least somewhat
linear):

1) It can go unstable and run off to infinity. This is indicative that
you have a pole at zero (or very near it) and means you may not need an
integrator in your controller.

2) It can go to some finite, non-zero state. This indicated neither a
pole or zero near zero. A proportional controller will have a finite
error result, so you may want an integral term in the system.

3) It can go to a zero output response. This indicates that you have a
zero in the plant at DC (basically something is AC Coupled). Such
systems can't maintain a DC output condition (at least not with that input).

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

PID controller: dummy questions pozz <pozzugno@gmail.com> - 2020-06-25 19:55 +0200
  Re: PID controller: dummy questions Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2020-06-25 21:14 +0200
  Re: PID controller: dummy questions DJ Delorie <dj@delorie.com> - 2020-06-25 15:29 -0400
    Re: PID controller: dummy questions David Brown <david.brown@hesbynett.no> - 2020-06-26 08:43 +0200
  Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-25 22:21 -0400
  Re: PID controller: dummy questions pozz <pozzugno@gmail.com> - 2020-06-26 10:59 +0200
    Re: PID controller: dummy questions David Brown <david.brown@hesbynett.no> - 2020-06-26 11:07 +0200
    Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-26 09:10 -0700
    Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-26 12:29 -0400
      Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-26 12:00 -0700
        Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-26 22:24 -0400
          Re: PID controller: dummy questions Paul Rubin <no.email@nospam.invalid> - 2020-06-26 21:41 -0700
            Re: PID controller: dummy questions DJ Delorie <dj@delorie.com> - 2020-06-27 01:15 -0400
              Re: PID controller: dummy questions Paul Rubin <no.email@nospam.invalid> - 2020-06-26 23:12 -0700
                Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-27 00:07 -0700
                Re: PID controller: dummy questions pozz <pozzugno@gmail.com> - 2020-06-27 16:53 +0200
                Re: PID controller: dummy questions David Brown <david.brown@hesbynett.no> - 2020-06-27 17:31 +0200
                Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-27 10:09 -0700
                Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-27 15:44 -0700
                Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-27 12:34 -0400
                Re: PID controller: dummy questions DJ Delorie <dj@delorie.com> - 2020-06-27 11:51 -0400
            Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-26 23:06 -0700
              Re: PID controller: dummy questions Paul Rubin <no.email@nospam.invalid> - 2020-06-26 23:18 -0700
                Re: PID controller: dummy questions Rick C <gnuarm.deletethisbit@gmail.com> - 2020-06-27 00:23 -0700
            Re: PID controller: dummy questions Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2020-06-27 10:28 +0300
            Re: PID controller: dummy questions Richard Damon <Richard@Damon-Family.org> - 2020-06-27 18:13 -0400
    Re: PID controller: dummy questions Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2020-06-26 22:30 +0200
      Re: PID controller: dummy questions Phil Martel <pomartel@comcast.net> - 2020-06-28 13:10 -0400

csiph-web