In my Previous post…, I have shared my Initial Android application that supports Realtime graphs of Accelerometer data..
In this post I am sharing Full Proof Impact detection and remote update algorithm..
Here is detailed algorithm..
Step 1 - Sample rate for Raw accelerometer data reading is currently 1000 Samples/second and it can be increased as per requirement up to Maximum ADXL375 Update rate (3200 Samples/second) as per device datasheet.
Step 2 - Raw Samples of XYZ axis are directly stored in SD card for detailed future analysis..
Step 3 - Raw samples of XYZ axis are passed through Three separate Low pass Filtering FIFO for each axis, Which simply calculates running average of FIFO content..
Cutoff frequency can be adjusted simply by varying length of this FIFO (Increase FIFO Length decrease cut off frequency and viceversa..) Currently FIFO length is 5 and can be changed as per need..
Actually Low pass filtering is Identical as Integration so Impact energy is roughly represented by this ..
Step 4 - Low pass filtered output contains positive as well as negative results based upon impact direction...so it is converted in to absolute value for just consider impact energy, not direction of impact.
Step 5 - Maximum Absolute Value form LPF output of X, Y,Z is calculated, then this Value of Impact energy is send to MAX_FIFO which simply Holds incoming maximum absolute value from LPF_FIFO... Purpose of This MAX_FIFO is interesting...
Lets...Take example... Suppose Sample rate for Accelerometer reading is 1KSPS..So LPF output rate is also 1KSPS...when the impact occurs with large energy, only few samples of LPF FIFO contains this information (based on duration of Impact).. My ultimate application will work for entire team so say 11 players are being monitored using single application running on Cell Phone/PC and I am using UDP protocol for remote communication between Sensor and Application..Now if all 11 players sends packet with 1KSPS rate there may be possibility of packet-loss due to data collision even though using random timing in each sensor for remote update.. If key packet which contains information of Impact is lost then there is no way I can say my system is reliable and real time. So here MAX_FIFO plays major role..
As MAX_FIFO finds Maximum of Absolute values of impact energy... If size of MAX_FIFO is 100 then any maximum value stays in Output of MAX_FIFO for 100 sample interval..also if other impact with more energy is occur then output of MAX_FIFO updated directly and it is remain for another 100 samples interval..
so if some packet lost then upcoming packets gives impact information..
if sensor sends packet to remote application after each 10 sample interval (Tap interval) then with MAX_FIFO of length of 100 element gives guarantee that actual impact reflected in next 10 packets.. So I can reduce remote update rate to reduce battery usage because during wireless transmission with CC3200 power consumption is maximum..(max 278mA as per CC3200 DataSheet)
here MAX_FIFO serves two purpose..
1st : Reliability, because it holds maximum value for several sample interval (based on MAX_FIFO Length)
2nd: Low remote update rate (ultimately low battery usage)
The algorithm is fully configurable, desired functionality can be achieved by changing sample rate ,length of two FIFO and Tap interval ..
I will share this algorithm in action in my next post..
Your suggestions and comments are invited..