DSPRelated.com
Forums

PID controller with second derivative?

Started by Scott L March 15, 2007
Is there any reason to include higher-order derivatives in PID-like
control systems? As an exercise for myself, I worked out a recurrence
relation for O[n] with terms that include the second derivative
information of the error signal. Is there any point in doing this?

Also, it seems to me that the discrete recurrence relation for a PID
process is just an IIR filter over the error signal. Could this IIR be
approximated by FIR and implemented by convolution?

I'm ignorant when it comes to control theory.

Scott

Scott L wrote:
> Is there any reason to include higher-order derivatives in PID-like > control systems? As an exercise for myself, I worked out a recurrence > relation for O[n] with terms that include the second derivative > information of the error signal. Is there any point in doing this?
Yes. It helps to stabilize higher-order systems.
> Also, it seems to me that the discrete recurrence relation for a PID > process is just an IIR filter over the error signal. Could this IIR be > approximated by FIR and implemented by convolution?
When differentiation can be accomplished by a sensor -- an accelerometer in a velocity servo, for example -- it usually yields better results than differentiating the main error signal electronically. Where in your FIR would you inject the present state of the system? Keeping the delay around a closed loop as small as possible is vital for keeping the loop stable. At least 5X oversampling is a good initial design criterion. Prompt filters -- those whose impulse responses become large early on -- are preferable. The time lag imposed by an anti-alias filter usually upsets stability more than removing aliases improves it.
> I'm ignorant when it comes to control theory.
It doesn't always gibe with practice anyway. :-) Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
On Mar 15, 1:32 pm, Jerry Avins <j...@ieee.org> wrote:
> > Is there any reason to include higher-order derivatives in PID-like > > control systems? > Yes. It helps to stabilize higher-order systems.
Do you know of an example of a real-world system that would benefit from it? I'm investigating PID control in the context of controlling the temperature in a mash tun (a stage in the process of brewing beer).
> When differentiation can be accomplished by a sensor -- an accelerometer > in a velocity servo, for example -- it usually yields better results > than differentiating the main error signal electronically. Where in your > FIR would you inject the present state of the system?
I thought the underlying signal was just the error (or rather, negative error). Doesn't that encode the present state of the system? I asked only out of curiosity -- it doesn't seem like a reasonable way to go about it in reality. Thanks, Scott
Scott L wrote:
> On Mar 15, 1:32 pm, Jerry Avins <j...@ieee.org> wrote: >>> Is there any reason to include higher-order derivatives in PID-like >>> control systems? >> Yes. It helps to stabilize higher-order systems. > > Do you know of an example of a real-world system that would benefit > from it? I'm investigating PID control in the context of controlling > the temperature in a mash tun (a stage in the process of brewing > beer). > >> When differentiation can be accomplished by a sensor -- an accelerometer >> in a velocity servo, for example -- it usually yields better results >> than differentiating the main error signal electronically. Where in your >> FIR would you inject the present state of the system? > > I thought the underlying signal was just the error (or rather, > negative error). Doesn't that encode the present state of the system?
Probably, (too much vodka sauce to be sure) but that goes in at the beginning with maximum delay. Not a happy setup.
> I asked only out of curiosity -- it doesn't seem like a reasonable way > to go about it in reality.
Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
On Mar 16, 9:59 am, "Scott L" <scott-s...@neuralnw.com> wrote:
> Is there any reason to include higher-order derivatives in PID-like > control systems? As an exercise for myself, I worked out a recurrence > relation for O[n] with terms that include the second derivative > information of the error signal. Is there any point in doing this? > > Also, it seems to me that the discrete recurrence relation for a PID > process is just an IIR filter over the error signal. Could this IIR be > approximated by FIR and implemented by convolution? > > I'm ignorant when it comes to control theory. > > Scott
You never use pure differentiation - I assume you mean band-limited differentiation or a phase advance? Yes - you can use more than one. If you need say 60 degrees phase advance you can use two 30 degrees - won't go into the reasons here - no time or space. Can and should use more than one integrator too if at all possible. F>

Scott L wrote:

>>>Is there any reason to include higher-order derivatives in PID-like >>>control systems? >> >>Yes. It helps to stabilize higher-order systems. > > Do you know of an example of a real-world system that would benefit > from it?
A loop which includes high order LPF or has more then one mode of the oscillation can benefit from the higher derivative control. I have an example in my practice, however it is too specific. I'm investigating PID control in the context of controlling
> the temperature in a mash tun (a stage in the process of brewing > beer).
The temperature control is a very traditional application for the classic PID. Do you think the higher derivatives will make the beer better? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Scott L wrote:

> Is there any reason to include higher-order derivatives in PID-like > control systems? As an exercise for myself, I worked out a recurrence > relation for O[n] with terms that include the second derivative > information of the error signal. Is there any point in doing this?
For some applications it makes sense. You'd need to control your sensor noise very carefully, however, and be judicious about bandlimiting your differentiators.
> > Also, it seems to me that the discrete recurrence relation for a PID > process is just an IIR filter over the error signal.
That is correct. When you take integrator windup and other side issues into account the code may not look much like an IIR filter, but within its linear region of operation it is, indeed, an IIR filter.
> Could this IIR be > approximated by FIR and implemented by convolution? >
Well... In theory you could approximate the linear operation of the PID controller with a FIR filter. But you wouldn't be taking nonlinear operation into account, and the integral action means that the PID controller has an infinitely long, constant-value tail which means you'd need a very long FIR to adequately emulate the controller. Consider buying my book. It's a bit too prosaic to answer these questions, but it does have lots of information on control theory and implementing control loops with software. http://www.wescottdesign.com/actfes/actfes.html -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
On Mar 15, 3:22 pm, "Scott L" <scott-s...@neuralnw.com> wrote:
> On Mar 15, 1:32 pm, Jerry Avins <j...@ieee.org> wrote: > > > > Is there any reason to include higher-order derivatives in PID-like > > > control systems? > > Yes. It helps to stabilize higher-order systems. > > Do you know of an example of a real-world system that would benefit > from it?
Yes, hydraulic motion control. We implement higher order derivatives on our motion controllers for this purpose and it makes a big difference.
> I'm investigating PID control in the context of controlling > the temperature in a mash tun (a stage in the process of brewing > beer).
The second derivative is probably not needed for temperature control applications but if you have a plant with three poles then you should consider using a second derivative. Heed Tim's advice about the derivative 'noise'. Actually the quantizing error alone can be a big problem but then I am closing the loop faster than you are. You should have all the resolution you can get if you plan to use the second derivative. You can't use an accelerometer or other hardware so you should look into a higher order Butterworth filter or observer. The observer can be used to estimate the second derivative without the lag of a Butterworth filter. Peter Nachtwey
On Mar 16, 6:45 am, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> The temperature control is a very traditional application for the > classic PID. Do you think the higher derivatives will make the beer better?
I have a bad practice of mixing questions so that I look like I'm trying to do something stupid :-) I wasn't suggesting some overly complicated method for simple temperature control, just wanted to know if higher derivatives are used in ANY application. Scott
On Mar 16, 7:57 am, "Peter Nachtwey" <p...@deltacompsys.com> wrote:
> You can't use an > accelerometer or other hardware so you should look into a higher order > Butterworth filter or observer. The observer can be used to estimate > the second derivative without the lag of a Butterworth filter.
In my math doodlings, I wrote the second derivative as: (e[n] + e[n-2] - 2*e[n-1]) / dt^2 I.e., the typical finite difference approximation (obviously not centered). Are you saying that's too naive in the presence of noise? Thanks, Scott