Jump to content

[PLC Sample Code] - Lowpass filter function block


Recommended Posts

Posted

Lowpass filter function block


Lowpass filter for Omron PLCs.

Only tested on CJ-series CPU. Use at own risk!

Many thanks to Peter Nachtwey @ PLCS.net for providing the mathematical formula.

Unfiltered = raw unfiltered value in INT.

TC = Time constant tau, given in seconds.

Filtered = Filtered value in INT.

FilteredReal = Filtered value in REAL.

- The FB can be duplicated.

- The FB can only be used in program parts that are scanned every CPU cycle, as it relies on the "P_Scan_Time_Value" variable.

According to the working principles of a lowpass filter, it will take the filtered value tau amount of seconds to reach 63% of the unfiltered value.

The value will reach within 1% of the unfiltered value in approx 5x tau.


 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...