Exploring Position Calculation Using Accelerometer Sensor Data

blog-image

How have things been going since we last spoke? We hope great!

Today, with the help of our hardware engineer, Eduardo Casanova, we’ll discuss the technicalities behind achieving position information using accelerometer sensor data, such as: data acquisition, filtering, integration methods, and verification.

In our setup, the accelerometer data is sourced from an Inertial Measurement Unit (IMU) integrated within the Arduino Nano module. The IMU serves as the primary sensor for capturing acceleration measurements along a designated axis.

The choice of the Arduino Nano has proven to be adequate, from the compactability to the simple interface with the IMU. This offers a straightforward yet effective approach to data acquisition. Furthermore we are looking into using a “time of flight” sensor to infer distances directly.

IMU

When it comes to processing the data we must take into consideration not only the integration to acquire position from acceleration but also filtering the it.

The filtering was done with a simple low pass FIR filter, funny enough we learned about this in the Electronic Systems course we just took, anyways this was done in the following way.

  • Using an online calculator (https://fiiir.com) we specify the sampling rate (104Hz), the cuttof frequency and the window type to get the filter coefficients
  • With these coefficients we can implement the filter by applying the window over the array of sampled data
FIR

To calculate the integrals for the position we used the trapezoidal integration method as it follows:

Equation

We picked this method because it tends to be more accurate than the normal Riemann integration

To finish we ran the following 2 experiences:

1- Moving the arduino up and down sequentially in the air.

2- Lifting the arduino aproximately 45cm from the ground, and setting it back down.

Here are the results:

Data

There is a considerable amount of error in these results for instance, the position will infinitly grow if the final velocity is not equal to zero, although we belive this can be largely atoned if the module only moves in one axis, as the tests were conducted by hand. Also, on the second experiment when the arduino is set back on the ground the position doesn’t return to its origin. Other than that even with the error it is obvious the fluctuation of position in the graphs as expected. We will continue to experiment with filtering techniques and look into other sensors/sensor combinations.

That’s everything for now, we will give updates in a future blog post just like this one.

See you next time!

-The SGECK team.