Comments (8)
The glitches appear on different sensors at random intervals. I had tried filtering algorithms on the data but the glitches are large magnitude.
from invensense-imu.
The green spikes are the plot of the boolean imu.new_mag_data(), which looks correct - and is not the issue I'm describing.
The issue in the plotter output above is on the imu.mag_y_ut() output.
from invensense-imu.
Here is one more snapshot - I commented out the New Mag signal.
You can see a glitch on MagX followed later by a glitch on MagY.
from invensense-imu.
Sorry, same plot as before.
Here is the other plot:
from invensense-imu.
Can you post the full code that you are running and confirm that you are running the newest version of this library (i.e. v5.6.0)? We burst read the IMU, but we have had issues in the past with the ESP32 not working with the I2C repeated start. I don't have an ESP32 board to test, but will try to see if I can replicate the issues on the Teensy boards that I have. Is there any potential to try reading the sensor with SPI? That might help us determine if it's an issue with the I2C communication or something else.
from invensense-imu.
I'm running your MPU9250 i2c.ino example with only the print statements modified to add sensor labels and use sensor offsets to separate the traces for Arduino Serial Plotter:
`/*
Brian R Taylor
[email protected]
Copyright (c) 2021 Bolder Flight Systems Inc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
#include "mpu9250.h"
/* Mpu9250 object */
bfs::Mpu9250 imu;
void setup() {
/* Serial to display data /
Serial.begin(115200);
while (!Serial) {}
/ Start the I2C bus /
Wire.begin();
Wire.setClock(400000);
/ I2C bus, 0x68 address /
imu.Config(&Wire, bfs::Mpu9250::I2C_ADDR_PRIM);
/ Initialize and configure IMU /
if (!imu.Begin()) {
Serial.println("Error initializing communication with IMU");
while (1) {}
}
/ Set the sample rate divider */
if (!imu.ConfigSrd(19)) {
Serial.println("Error configured SRD");
while (1) {}
}
}
void loop() {
/* Check if data read */
if (imu.Read()) {
Serial.print("Max:250,");
Serial.print("NewIMU:");
Serial.print(imu.new_imu_data()*150);
Serial.print(",");
/*
Serial.print("NewMAG:");
Serial.print(imu.new_mag_data()*100);
Serial.print(",");
*/
Serial.print("AccX:");
Serial.print(imu.accel_x_mps2());
Serial.print(",");
Serial.print("AccY:");
Serial.print(imu.accel_y_mps2()+40);
Serial.print(",");
Serial.print("AccZ:");
Serial.print(imu.accel_z_mps2()-40);
Serial.print(",");
Serial.print("GyrX:");
Serial.print(imu.gyro_x_radps()-20);
Serial.print(",");
Serial.print("GyrY:");
Serial.print(imu.gyro_y_radps()-40);
Serial.print(",");
Serial.print("GyrZ:");
Serial.print(imu.gyro_z_radps()-60);
Serial.print(",");
Serial.print("MagX:");
Serial.print(imu.mag_x_ut());
Serial.print(",");
Serial.print("MagY:");
Serial.print(imu.mag_y_ut()-20);
Serial.print(",");
Serial.print("MagZ:");
Serial.print(imu.mag_z_ut()-40);
Serial.println("Min:-250");
//Serial.print(imu.die_temp_c());
//Serial.print("\n");
}
}
`
I will look into connecting to the MPU9250 with SPI instead of i2c and retrying with the SPI example.
from invensense-imu.
I confirm I'm running Blolder Flight Systems MPU9250 v 5.6.0 Arduino library.
from invensense-imu.
I rewired my board to use ESP32 VSPI with the MPU-9250 board instead of i2c.
I ran your SPI example and didn't see any glitches (left running for 45 minutes. Here is the serial plot:
I also tried the fifo_SPI example and it looks like LOTS of spikes:
from invensense-imu.
Related Issues (20)
- Does setSrd() only work with interrupt? HOT 3
- No such file or directory #include <cstddef> + a few more imports HOT 1
- Latest version of the library is not available in PlatformIO library registry. HOT 1
- Unable to reach magnetometer module in mpu9250 while using Teensy4.0 HOT 1
- SPI communication with teensy 4.1 is not working HOT 18
- cstddef: No such file or directory HOT 1
- cstddef & cstdint? HOT 1
- Set SPI clock speed HOT 1
- Why inverted axis for gyro and accelerometer HOT 5
- Esp32, Arduino how do I know the correct angle of the device? HOT 1
- Incompatible with AVR architecture ? HOT 3
- Compiling IDE 2.0 and arduino nano 33 iot HOT 2
- how can i get the cstddef HOT 2
- calibration HOT 1
- status -5 HOT 4
- Can't initialize I2C/SPI bus HOT 12
- X and Y axis accelerometer readings are swapped. HOT 1
- assert failed: i2c_ll_set_bus_timing i2c_ll.h:109 (scl_high > 13) HOT 5
- Please fix 1.0.2 release HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invensense-imu.