LSM6DS3 Breakout Hookup Guide

Pages
Contributors: MTaylor
Favorited Favorite 1

Theory and Example Data

From the nature of the examples, the LSM6DS3 can be used very simply (detect 'down', for example) to something much more complicated, like discerning arbitrary motion through space. We hope that after playing around with the examples, you'll take the library apart and do something truely amazing with it. This section gives you more information about what's going inside.

The Data

Sure, it's easy to read single points of data but if you really want good motion detection, you'll have to pull time-synchronized data and do math at it. The first step is to see what that data would look like, and practice algoritihms to see if your math is any good before you try to debug things in arduino.

Lets take a look at some actual data. Ideally we would use a robot to perfectly articulation the IMU through some test motion, but instead we used an engineer's arm. For the following tests, the IMU was held stationary, then moved down about 1 foot in about a half-second, then held stationary again. What follows is a select set of graphs.

alt text

alt text

alt text

alt text

These graphs show the same motion with several different settings. Notice that the raw data that is collected at these low-frequency sampling rates consists of steps. The higher the datarate, the finer the steps. Also notice that during what was felt as a smooth downward motion, sometimes non-monotonic slopes are seen, that is, the change in amplitude between steps doesn't always have the same sign.

Also shown in the graphs is a second trace -- but don't get too excited. This trace is a software filter created by implementing a rolling average of the last 20 samples. This was done with a teensy 3.1, and wasn't attempted with 328 based microcontroller.

Once the data is collected and filtered, then more advanced threshold and slope detectors can be implemented to get custom motion responses. This is similar to what the 'embedded functions' of the LSM6DS3 are actually doing to provide easy-to-use interrupt output.