FB_FirstOrderDigitalFilter

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Defined to filter an Analog signal.

Inputs

Input

Data Type

Range

Unit

Default

Description

EN

BOOL

No range

N/A

No default

Enables execution.

Used in the FFLDClosed "Free Form Ladder Diagram" editor only.

AnalogInput

INT

No range

N/A

No default

Analog Input from transducer.

FilterGain

REAL

1 - 0.05

N/A

No default

Filter gain.

Outputs

Output

Data Type

Range

Unit

Description

OK

BOOL

0, 1

N/A

Execution successful.

FilterOutput

REAL

0, 1

N/A

Filtered analog input value.

Remarks

In any control system with an analog feedback signal present, there is the risk of unwanted noise and jitter that can compromise the signal integrity yielding a less the desirable system.

This image shows the function or function block I/O.

Figure 6-107: CBS First Order Digital Filter

Usage

When using this UDFB, the Enable (EN) input should always be energized to provide the desired filtering.

Filter Input Delay

Filter Delay Tn

In this table:

  • The numbers of filter delays for a steady state analog input at a given gain are listed.
  • The range of the filter gain is between 1.00 and 0.05.
  • For a filter gain of 0.8 there is a delay of 15 time constants with a time constant defined as the rate the UDFB is scanned or executed in the application.
    • Example: If the UDFB was executed every millisecond a gain of 0.8 would provide a filter delay of 15ms.
    • Conversely a gain of 1.00 provides zero filtering and the output signal follows the input signal, and a gain of 0.05 provides the most filtering for 463 ms.

Example: Filter Input Lag - Random Input

A real world analog input is most always a varying feedback signal.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

//Filter analog input signal with a gain of 0.8 to remove noise
FilteredOutput:= Inst_FB_FirstOrderDigitalFilter( AnalogInput1Value, 0.8 );