Changing the Accelerometer Sampling Interval: BEEKs CM v2

Overview

This tutorial shows you how to change the sampling interval 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.  This tutorial will show you how to change the sampling interval from two minutes to a time increment of your choice.

This tutorial does not contain an in-depth discussion on the operation of the beacon firmware, therefore some of the steps may not fully explain the "why" behind them.  However, if you follow the steps in this tutorial, you should be able to update the sampling interval to achieve the desired outcome.

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.

In your custom template, go to the section titled Motion Condition Monitoring and check the box next to "Edit KMX Edge Feature Generation":


A new section of settings will appear.  You will need to scroll down to the section titled Low Speed Config.  It should be understood that the beacon will continuously go back and forth between low-speed mode (12.5 Hz sampling rate) and high-speed mode (25.6 kHz sampling rate), so by editing the the Low Speed Config settings you are changing the duration of time that the beacon stays in low-speed mode, therefore affecting the time interval at which high-speed data is collected. 

In this tutorial, we will keep the high-speed config at its default settings (1 second of data at 25.6 kHz) because it generally will not need to be changed.  As you can see in the image of the default settings below, the Minimum and Maximum duration are both set to 119.  This means that the beacon will stay in low-speed mode for 119 seconds, collect one second of high-speed data, then calculate metrics and advertise them, thereby resulting in a 2-minute (120 second) interval.  The Minimum and Maximum duration should therefore be set to a value (in seconds) that is 1-second lower than the desired interval.

Number of Samples refers to the number of data points used to calculate metrics in low-speed mode.  This value should therefore be approximately equal to or significantly lower than the specified duration, assuming a 12.5 Hz sampling rate.  For example, if a 20 second sampling interval is desired, Minimum and Maximum duration would both be set to 19 (20 seconds - 1 second) and Number of Samples would be set to 238 (19 seconds x 12.5 samples per second = 237.5 samples, rounded up to 238).  If the desired interval is such that the duration is 30 seconds or higher, then the Number of Samples does not need to be changed and can be left at 375.

Drop Samples is a feature primarily used in high speed mode to improve filtered values, but for the purposes here, it should be understood that this value simply needs to be lower than the Number of Samples.


Some examples of settings generated using the methods described above are shown in the table:

Desired Sampling IntervalMinimum DurationMaximum durationNumber of SamplesDrop Samples
10 seconds991131
30 seconds2929363200
10 minutes599599375200
1 hour35993599375200


Once the changes have been made, you can save your template and send it to beacons according to the Intro. to Custom Templates tutorial.