Discrete-time or continuous-time low-pass filter

**Library:**Simscape / Electrical / Control / General Control

The Low-Pass Filter (Discrete or Continuous) block implements a
low-pass filter in conformance with IEEE 421.5-2016^{[1]}. In
the standard, the filter is referred to as a Simple Time Constant.

You can switch between continuous and discrete implementations of the integrator using
the **Sample time** parameter.

To configure the filter for continuous time, set the **Sample
time** property to `0`

. This representation is
equivalent to the continuous transfer function:

$$G(s)=\frac{K}{Ts+1},$$

where:

*K*is the filter gain.*T*is the filter time constant.

From the preceeding transfer function, the filter defining equations are:

$$\{\begin{array}{c}\dot{x}(t)=\frac{1}{T}\left(Ku(t)-x(t)\right)\\ y(t)=x(t)\end{array}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}y(0)=x(0)=K{u}_{0},$$

where:

*u*is filter input.*x*is filter state.*y*is filter output.*t*is simulation time.*u*is the initial input to the block._{0}

To configure the filter for discrete time, set the **Sample
time** property to a positive, nonzero value, or to
`-1`

to inherit the sample time from an upstream block. The
discrete representation is equivalent to the transfer function:

$$G(z)=K\frac{({T}_{s}/T){z}^{-1}}{1+({T}_{s}/T-1){z}^{-1}},$$

where:

*K*is the filter gain.*T*is the filter time constant.*T*is the filter sample time._{s}

From the discrete transfer function, the filter equations are defined using the forward Euler method:

$$\{\begin{array}{c}x(n+1)=\left(1-\frac{{T}_{s}}{T}\right)x(n)+K\left(\frac{{T}_{s}}{T}\right)u(n)\\ y(n)=x(n)\end{array}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}y(0)=x(0)=K{u}_{0},$$

where:

*u*is the filter input.*x*is the filter state.*y*is the filter output.*n*is the simulation time step.*u*is the initial input to the block._{0}

To specify the initial conditions of this block, set
**Initialization** to:

`Inherited from block input`

— The block sets the state and output initial conditions to the initial input.`Specify as parameter`

— The block sets the state initial condition to the value of**Initial state**.

Set the **Upper saturation limit** and **Lower saturation
limit** parameters to use the anti-windup saturation method.

The anti-windup method limits the integrator state between the lower saturation
limit *A* and upper saturation limit *B*:

$$A<=x<=B\text{\hspace{0.17em}}.$$

Because the state is limited, the output can respond immediately to a reversal of the input sign when the integral is saturated. This block diagram depicts the implementation of the anti-windup saturation method in the filter.

This block does not provide a windup saturation method. To use the windup
saturation method, set the **Upper saturation limit** parameter to
`inf`

, the **Lower saturation limit**
parameter to `-inf`

, and attach a saturation block
to the output.

Set the time constant to a value smaller than or equal to the sample time to ignore the dynamics of the filter. When bypassed, the block feeds the gain-scaled input directly to the output:

$$T\le {T}_{s}\to y=Ku$$

In the continuous case, the sample time and time constant must both be zero.

[1] *IEEE Recommended
Practice for Excitation System Models for Power System Stability
Studies.* IEEE Std 421.5-2016. Piscataway, NJ: IEEE-SA,
2016.