Changing the Accelerometer Digital Filters: BEEKs CM v2

Overview

This tutorial shows you how to change the digital filters for the production of vibration data ("high-speed edge features") on the BEEKs CM v2 beacon.  By default, once every two minutes the beacon will collect one second of vibration data (at 25.6 kHz) on each axis, and calculate peak-to-peak and RMS on both the acceleration and velocity signals.  The acceleration and velocity signals both use separate digital infinite impulse response (IIR) filters to set the bandwidth of the vibration signals before calculating peak-to-peak and RMS values.

NOTE: the IIR filter settings in the default beacon template (“Default Beacon Template - Condition Monitoring AI“) have been designed for the highest beacon performance in a variety of applications of rotating equipment monitoring. Changing the filter settings should only be performed by users who have advanced understanding of signal processing and vibration spectrum analysis, and have a specific application that requires it.

Theory of Operation

The BEEKs CM v2 beacon firmware uses a cascaded-filter approach to implementing the digital filters. This diagram shows the data flow of filtering and generating data points.

Each relevant configuration setting referenced in the diagram is explained in the “Overview of BEEKs CM v2 Configuration Settings” section of the Intro. to Custom Templates tutorial. 

Each IIR filter is a 2-pole filter defined with five coefficients: B0, B1, B2, A0, A1. The filter is applied using the following recursive equation:

y[i] = A0*y[i-1] + A1*y[i-2] + B0*x[i] + B1*x[i-1] + B2*x[i-2]

where x is the input, y is the output from the filter, i is the data point index, and A0, A1, etc. are the coefficients in the Bluzone console.

Getting Started

Start by creating a custom template according to the Intro. to Custom Templates tutorial.  Also take note of the steps given for saving a template, tracking the version, and sending the template to beacons, as these will be needed later after you finish the edits shown in this tutorial.

After you have created a custom template, you can edit the IIR filters by going to the “Filtering Settings” section and selecting the box next to “Edit KMX Accelerometer Filtering”.

Under each filter, select the “Edit Filter 1” box to expose the coefficients. If there are existing coefficients, you can click the “Clear Filters” button to delete them.

You will see options for each axis (X, Y, Z) for the Pre Filter channel (applied to both the Acceleration and Velocity channels as shown in the diagram), and the independent Acceleration and Velocity channels. Each axis must be specified separately even if the same filter is used for each.

Additional points to take note of:

  • Under each filter channel, only “Filter 1” will be applied, so leave “Filter 2”, etc. blank

  • The filter coefficients in the Velocity channel as defined in the default settings (beacon template “Default Beacon Template - Condition Monitoring AI“) are used to perform the integration to generate the velocity signal, so it should be understood that if you wish to change the bandwidth of the velocity channel, you must still define a digital filter that has an integrator function to properly generate a velocity signal.

Example: Generating Filter Coefficients with Python

There are many third-party tools available for generating filter coefficients. Each tool has its own set of libraries and equations that may generate and implement filter coefficients in a manner differently than the recursive equation used in the BEEKs CM v2 beacon, so care should be taken to modify the values accordingly. As an example, we will look at implementing coefficients using the signal.lfilter() function of the Scipy package in Python. According to the documentation, this function applies the filter coefficients generated from the signal.iirfilter() function using the direct II transposed structure. The coefficients must therefore be modified accordingly to be used in the Bluzone template configuration settings. The following is an example of generating IIR filter coefficients for a bandpass filter that can be entered into the Bluzone template:

from scipy.signal import iirfilter fs = 25600 #accelerometer sampling rate f_low = 1000 #lower cutoff for bandpass filter f_high = 2000 #upper cutoff for bandpass filter #generate coefficients for IIR Butterworth filter b, a = iirfilter(1, [2*f_low/fs, 2*f_high/fs], btype='band', analog=False, ftype='butter') #generate Bluzone template coefficients from signal.iirfilter() coefficients A0 = -1*a[1] A1 = -1*a[2] B0 = b[0] B1 = b[1] B2 = b[2]