Filtering Noisy PLC Signals Without Hiding Real Faults
Input filtering can stabilize PLC data, but excessive smoothing delays alarms and masks process changes. Learn how to diagnose noise, select hardware or soft...
Filtering can turn a noisy PLC input into a stable engineering value. It can also delay a genuine alarm or hide a mechanical problem.
The correct approach begins with the source of the disturbance. Software should not become a permanent cover for poor wiring, unsuitable sensors, or incorrect installation.
First determine whether variation comes from the process, the sensor, the wiring, or the input conversion.
Separate process movement from electrical noise
Trend the raw input at the fastest practical update rate. Compare it with a reference instrument and observe the machine state when the variation appears.
Noise synchronized with a drive, contactor, heater, or solenoid suggests electromagnetic coupling. Slow oscillation may instead reflect real process dynamics, poor sensor placement, or control-loop interaction.
Check the transmitter range, supply voltage, grounding method, shield termination, conductor routing, terminal condition, and input-module configuration before adding a filter.
Analog filters trade response for stability
Analog modules may provide integration, notch filtering, or digital smoothing. Rockwell Automation documentation notes that digital filters smooth input noise transients. Its notch-filter guidance also describes a speed-versus-rejection trade-off.
A notch filter attenuates a defined frequency and its harmonics. It can be useful for line-frequency interference, but the selected setting may limit the fastest achievable sample rate.
Module filtering should be selected against both the noise spectrum and the required process response.
Moving averages are understandable but delayed
A moving average replaces the current value with the mean of a fixed sample window. It reduces random variation and is easy to audit.
Its delay grows with the number of samples and the sampling interval. A 20-sample window collected every 100 milliseconds represents two seconds of history.
That may be acceptable for tank temperature. It may be unacceptable for pressure protection, motion control, or fast material detection.
An exponential filter uses the previous filtered value and the newest sample. It needs little memory, but its coefficient must be documented in terms operators understand.
Digital inputs need state qualification
Contact bounce, vibration, reflections, poor target geometry, and induced voltage can produce short transitions. Many PLC families provide configurable digital input filters for this purpose.
A software debounce can require the input to remain on for a minimum time before setting an internal state. A separate off-delay can prevent brief dropouts from clearing that state.
Debounce logic should qualify the signal without suppressing the shortest valid event.
Do not apply a debounce timer blindly to encoder pulses, flow totals, safety inputs, or high-speed counting. These signals may need dedicated hardware and validated timing.
Choose filter time from the application
Define the shortest valid event, the longest acceptable detection delay, and the normal noise duration. The filter must reject the disturbance while preserving the valid event.
For an analog channel, use a step test where safe. Record the raw and filtered signals, then measure rise time, settling time, and peak error.
For a digital channel, test short noise pulses, the minimum valid pulse, sustained on and off states, and recovery after a sensor fault.
Controller and I/O platforms for these applications are available in PLC & PAC Systems. Signal visualization and operator interfaces can be reviewed under HMI & Industrial Computing.
Preserve raw data for troubleshooting
Where memory allows, expose both raw and filtered values. Operators need the stable value, while maintenance teams need evidence of the disturbance.
Add diagnostics for excessive deviation, frozen signals, out-of-range values, and filter saturation. A stable number is not necessarily a healthy measurement.
Store filter constants as controlled configuration values. Record who changed them, why they changed, and which test confirmed the result.
Author opinion: the best filter is the smallest one that rejects a known disturbance. If the time constant cannot be justified against a real event, it is probably hiding uncertainty rather than solving it.