digitaldanny/AudioEffectsGlove

Sensor Fusion Algorithm Implementation

Closed this issue · 4 comments

Is your feature request related to a problem? Please describe.
Having trouble getting the DMP working on the MPU6050. I can use an external sensor fusion library to get accurate euler angles from the raw accelerometer and gyroscope readings.

Describe the solution you'd like

  • Convert raw accelerometer and gyroscope data into hand orientation values on 2 axes.
    • The algorithm will use gyroscope and accelerometer values. There will be drift on the third axis, but I do not plan on using this axis for the final demo.
    • Capture the gyro error offset while sitting still. These values will need to be subtracted from all gyro readings.
  • Create a millis() implementation to capture the time difference between sensor data captures.
  • How much can I compress these values before transferring over Bluetooth?

Additional context

  • #47 - MPU6050 I2c Drivers
  • The issue linked above also has references to an all-inclusive sensor fusion library. Might be able to quickly make use of this to get orientation values.

Copying over the sensor fusion repo link - here.

Created a quick Arduino sketch that reads raw sensor data from the MPU6050. Using the Arduino Serial Plotter, I was able to see the data changing live as I moved the sensor. Moving or rotating the breakout board along one axis at a time allowed me to verify that valid data was being read from the sensor for both accelerometer and gyroscope sensors.

Gyroscope Plot - Rotating 1 axis at a time
image

Accelerometer Plot - Moving 1 axis at a time
image

Merged in the Arduino sensor fusion checkout. Still need to create some abstraction from the library to be used in the main glove application. Will create this API once I finish the MPU6050 drivers issue in #67 .

Pitch and roll data plot is in #68 .