Lag vs MA filter

Most systems to be controlled have unwanted noise superimposed on the “real” measurement value, especially in the process industries. As a result, measurement (or PV) filtering is an important part of control scheme design. In the process industries it is common to use either a Moving-Average or MA filter or a first-order “Lag” filter within the control loop when the noise level is too high. But which one is the most effective at reducing noise without reducing loop performance?

The problem

Any noise reduction filter within a loop will add more difficult dynamics to the loop characteristics and therefore impact the “best tuned” performance. So the objective of choosing a PV filter is to optimise the trade-off between noise reduction and feedback control performance. Of course, the purpose of noise reduction could also be improve loop performance, but could also be aimed at other improvements such as reducing actuator (e.g. valve) travel.

We’ve talked about noise characteristics elsewhere, so we won’t repeat that here, except to say that different noise characteristics require different filtering characteristics. So there is a place for many different filter types.

In the process industries, most control scheme implementation platforms, including Distributed Control Systems (DCS), have both Moving-Average (MA) and first-order lag filters conveniently available. So for cases where a filter is required, the choice is generally between these two types.

Typical application

Let’s look at the typical situation of a PID controller with a noisy PV requiring a PV filter.

The noise that we want to remove will be the high frequencies with the assumption that all the low frequencies are genuine process variations and should be left untouched. We will assume that we are reducing the noise so that we don’t force a control valve to go through thousands of unnecessary cycles and a large, total travel distance each hour of operation.

We do want good regulatory performance in this loop so we’ll use the full performance of a PID controller rather than falling back to a PI controller (a common design reaction to high PV noise).

Which filter?

Which filter will allow us to get the best trade-off of reduced noise but good loop performance?

The simple answer is nearly always the first-order lag filter.

Simulation

But let’s check this with a realistic comparison of two loops, with different filters, simulated in parallel:

  • PID controller
  • FOPDT process response
  • Realistic auto-correlated noise on the PV (exactly the same noise sequence for all loops)
  • One of either a first-order lag filter (5 second period) or a Moving Average filter (10 second period).

The resulting trend graph below shows two phases to the simulation; the first phase includes no feedback control so that the uncontrolled PV noise characteristics are shown. The period of each of the two filters has been tuned by hand to have approximately the same filtering effectiveness on the noise. At 150 minutes into the simulation, the noise is removed so that the controller setpoint (SP) step test (at 200 minutes) results can be more clearly seen for the two loop dynamics. For each of the filters the respective loop’s PID controller has been tuned to be as fast as possible but restricted to have the same response shape (decay ratio), so that they can be fairly compared.

(Note that Internet Explorer may not display this image correctly.)

Clearly the blue trace of the lag filtered loop is much faster to settle than the MA filter, even though these two filters have approximately the same filtering effectiveness. So the lag filter is much more suited to reducing noise level while still maintaining the best closed-loop performance.

Why?

To further characterise the MA filter performance penalty, a third loop is simulated (red trace) with a combined first-order lag and deadtime “filter” which has been hand adjusted to match the response and tuning characteristics of the MA-filtered loop. You can see that the red trace closely matches the MA loop’s green trace response, except immediately after the setpoint step where the difference is more noticeable. The resulting equivalence is that the 10 second moving average filter is equivalent (in terms of penalty on loop performance) to a 3.3 second first-order lag cascaded with a 2.3 second deadtime. The deadtime is the most significant penalty element and it is this equivalent deadtime from the MA filter that causes the loop performance penalty.

This illustration obviously only addresses one FOPDT process response case and similarly only one type of auto-correlated noise on the loop PV. In some unusual cases, the noise characteristics will require much more sophisticated filters than just first-order lag or MA filter types, and so the conclusions here won’t be relevant. Nevertheless, for the contest between these two filters, generally the first-order lag filter will result in the best compromise between effective noise reduction and least penalty on loop performance.

Comments

comments powered by Disqus