On 12 Nov 2003 16:56:03 -0800, firstname.lastname@example.org (Shane Hingst)
The easiest way to filter the Derivative term is to control the
sampling rate. All discrete implementations of the Derivative term
are intrinsically filtered by the sample rate. Changes that occur in
less time than the sample rate are simply not detected. If you want
to maintain a high sample rate for the Proportional term, then go
ahead, but artificially lower the sample rate for the Derivative term
by using every n-th sample to calculate the Derivative term. This is
approximately the same thing as starting with a fast-sampled
Derivative term and applying a first-order filter.
(Reply through newsgroups, not by direct e-mail, as automatic reply address is
Subsampling the signal does reduce gain, but it will also alias noise
components into your derivative, so unless you do some anti-aliasing before
you subsample then the only noise reduction that you get is from dividing by
a greater sampling interval. You can do better by implementing a derivative
that acts like a cascade of a simple derivative with a 1st-order low-pass
xdot = (input - state) * (1 - pole) / sampling interval
state = state + (xnow - state) * (1 - pole)
The "pole" in the equations above is the location of the z-domain pole for
the filter. For filtering frequencies less than about 1/10th your sampling
rate you can use
pole = 1 - 2 * pi * filterF * sample time
In practice you'll have to tune the pole location just as you would any
other element of the controller. You'll want to increase the filtering (by
setting pole closer to 1) for noisier input data, and decrease it (by
setting pole closer to 0) for faster operation. Generally as you increase
the derivative gain you'll be increasing the frequency at which the
derivative signal needs to be effective and you'll have to increase the
frequency by decreasing the pole value.
I agree. The "textbook solution" for the derivative part is
U_d(s) = T_d s / (1 + T_f s) E(s)
where U = U_p + U_i + U_d. "Normally", T_f = alpha*T_d where alpha could
be e.g. 10 (5-10 my textbook says).
I guess this is more or less what you suggest.
Yes, I'm pretty much giving the discrete-time filter that matches the
continuous-time filter that your textbook is defining. The rule for T_f is
a bit obscure your definition, I don't see it connected to any physical
meaning. What you really want is to place the time constant of your
differentiator filter (T_f) to be well below the design settling time of
Of course the meaning of "well below" depends strongly on the system you're
I don't think the (1-pole) term should be in the xdot calculation
rate(n) = exp(-sPole*T)*
zPole = exp(-sPole*T)
The filter pole should be about 10 to16 times faster ( corner frequency
should be16 times higher or time constant should be 16 times shorter). The
rate can be then mulitplied by the derivative gain.
My equations (once you correct for the fact that "xnow" and "input" are the
same thing) match your equations except that your equations add one
time-sample delay and require that you remember both the previous input
value _and_ the state of the filter -- do the z transform of each, work out
the math, and you'll see. So if you use my form for it then you do need the
Derivative control best helps processes that have substantial inertia and
are relatively insusceptible to change.
If the process to which you want to add derivative control is so unstable
that the measured variable changes rapidly, it's probably a poor candidate
for derivative control in the first place. There may be other control
techniques that, if used, would improve controllability. Perhaps just
tweaking the proportional and integral responses would do the job.
Shane Hingst < email@example.com> wrote in message...
: I want to place a first order filter on the Derivative term of my PID
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.