Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPU-6050 No-DMP mode #291

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ The following IMUs and their corresponding `IMU` values are supported by the fir
* MPU-6500 (IMU_MPU6500) & MPU-6050 (IMU_MPU6050)
* Using internal DMP to fuse Gyroscope and Accelerometer. Can drift substantially.
* NOTE: Currently the MPU will auto calibrate when powered on. You *must* place it on the ground and *DO NOT* move it until calibration is complete (for a few seconds). **LED on the ESP will blink 5 times after calibration is over.**
* No-DMP MPU-6500 (IMU_MPU6500_NODMP) & MPU-6050 (IMU_MPU6050_NODMP)
* Works with the same IMU, but doesn't use the DMP. Can still drift substantially (perhaps even more, depends on calibration, needs more testing).
* Enable by changing IMU type (append `_NODMP` at the end)
* For decent results, you **must** perform gyro/accel calibration (ideally at the same temperature the tracker would be operating at)
* Modify calibration config in `defines_mpu6050.h`
* The calibration process itself is basically identical to that of BMI160, so refer to its section for details
* You can also perform temperature calibration for better results in variable temperature (slowly heat up the tracker from below 10 degrees C to above 45, keeping it very still)
* BNO055 (IMU_BNO055)
* Performs much worse than BNO080, despite having the same hardware. Not recommended for use.
* MPU-9250 (IMU_MPU9250)
Expand Down Expand Up @@ -50,8 +57,7 @@ Firmware can work with both ESP8266 and ESP32. Please edit `defines.h` and set y
* LED will turn off when calibration is complete
* You don't have to calibrate next time you power it on, calibration values will be saved for the next use

### BMI160

### BMI160 or MPU6050 in no-DMP mode
If you have any problems with this procedure, connect the device via USB and open the serial console to check for any warnings or errors that may indicate hardware problems.

- **Step 0: Power up with the chip facing down.** Or press the reset/reboot button.
Expand Down
4 changes: 4 additions & 0 deletions src/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#define IMU_BMI160 8
#define IMU_ICM20948 9
#define IMU_ICM42688 10

#define IMU_MPU6500_NODMP 13
#define IMU_MPU6050_NODMP 14

#define IMU_DEV_RESERVED 250 // Reserved, should not be used in any release firmware

#define BOARD_UNKNOWN 0
Expand Down
25 changes: 25 additions & 0 deletions src/defines_mpu6050.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef MPU6050_NODMP_CONFIG_H
#define MPU6050_NODMP_CONFIG_H

// !!! No-DMP MPU6050 Config !!!

// Calibration method choice: Smooth rotation or keeping the tracker still in 6 orientations
// (for details refer to defines_bmi160.h)
#define MPU6050_ACCEL_CALIBRATION_METHOD ACCEL_CALIBRATION_METHOD_6POINT

// Whether to calibrate accelerometer or not
// Setting to false will skip this step during calibration
// (old calibration values will be preserved)
#define MPU6050_CALIBRATE_ACCEL true

// Whether to calibrate gyro or not
// Setting to false will skip this step during calibration
// (old calibration values will be preserved)
#define MPU6050_CALIBRATE_GYRO true

// Whether to use Temperature Calibration
// (disabling doesn't erase old calibration values)
#define MPU6050_USE_TEMPCAL true


#endif
4 changes: 4 additions & 0 deletions src/sensors/SensorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "bno080sensor.h"
#include "mpu9250sensor.h"
#include "mpu6050sensor.h"
#include "mpu6050sensor_nodmp.h"
#include "bmi160sensor.h"
#include "icm20948sensor.h"
#include "icm42688sensor.h"
Expand Down Expand Up @@ -102,6 +103,9 @@ namespace SlimeVR
case IMU_MPU6500: case IMU_MPU6050:
sensor = new MPU6050Sensor(sensorID, imuType, address, rotation, sclPin, sdaPin);
break;
case IMU_MPU6500_NODMP: case IMU_MPU6050_NODMP:
sensor = new MPU6050NoDMPSensor(sensorID, imuType, address, rotation, sclPin, sdaPin);
break;
case IMU_ICM20948:
sensor = new ICM20948Sensor(sensorID, address, rotation, sclPin, sdaPin);
break;
Expand Down
Loading