MPU-6050 (I2C) Library

juanpintom
Tue Jun 23, 2015 11:04 pm
Hi all, Im trying to get it working an MPU6050 on Maple Mini, I started with this library:
https://github.com/jrowberg/i2cdevlib/t … no/MPU6050

On Arduino the INT pin is connected on D2 (interrupt #0), but I don’t know what pin is on Maple Mini I tried with pin 2 and pin 0.
I readed this reference: http://leaflabs.com/docs/external-inter … light=exti thats why I tried with pin 0.

I worked with no problems using DMP6 example on Arduino.

On MapleMini the i2c device is detected but gives an error on DMP start (code 1) from this line on setup()
https://github.com/jrowberg/i2cdevlib/b … 6.ino#L228

I dont know if this can be related with this issue:
https://github.com/rogerclarkmelbourne/ … 2/issues/5

I tried with RAW example and get strange values, I need to get a G force acceleration.

I’ll do more tests tomorrow, anyone have this sensor working?

Really thanks.

Regards.


RogerClark
Fri Jul 03, 2015 1:58 am
I looked at the MPU9150 some time ago, but I recall there being issues even on AVR.

I was using the RTImuLib, but it seemed to use a special version of i2cdev, and when I used the normal version of I2Cdev RTImuLib would not work :-(

If you are planning on using the MPU for anything useful, I’d advise that you look at using the RTImuLib as it handles all the complex maths that are needed to make use of the MPU’s (there is lots of complicated maths)

https://github.com/RTIMULib/RTIMULib-Arduino

However I think Richard has given up all support for it on Arduino’s and even stopped supporting Teensy and now just uses RPI.

Incidentially, using an MPU was why I initially looked at using the STM32, as I found that the AVR Arduino was too slow and the single precision maths (even if you use the double data type), was not accurate to make the MPU’s usable.

However I have ended up spending all my time supporting different aspects of the STM32 and hosting the repo etc


juanpintom
Mon Jul 13, 2015 6:29 pm
Sorry for the late response! :( I forget to enable notifications :S

Im still working on it, my idea is to make a G sensor with the MPU6050.

Ill take a look to RTIMULib-Arduino

Really thanks for your work!, and thank you for share!


bdbell
Thu Jul 16, 2015 1:42 pm
I have a MPU9150 working with maple mini – both of the attached sketches work for me. The DMP6 sketch is configured for the Teapot demo, which worked well – actually left it running on my desk all afternoon and it worked great.

The MPU6150 should work as well for both sketches, although you may have to modify the MPU9150_RAW file to get it to work for MPU6150.

I initially had a problem getting it to work because the programming adapter setup I was using to test the MPU9150 did not have AD0 tied low so the i2c address was 0x69 instead of 0x68 the sketches are set to. I have INT connected to pin 0 and the LED is flashing.


juanpintom
Thu Jul 16, 2015 2:05 pm
You’re awesome! Ty so much! I’ll try this night and let you know !

Regards!


juanpintom
Thu Jul 16, 2015 11:25 pm
With the DMP6 example I get the same (code 1) error :( I tested RAW example and works well, but I don’t know how I can get G force from this values.
I’ll do more test tomorrow.

Ty Again :P

Regards


RogerClark
Thu Jul 16, 2015 11:31 pm
Guys,

Unless you just need very basic data from these devices, you will almost certainly need to use RTIMU.

Well, unless you have a degree in mathematics that is.

I have looked into this field and it was well beyond any maths that I did at school up to Year 12, and we didn’t cover the maths of this sort of stuff on my degree course.

So.. Unless you are familiar with coding Kalman filters and working with quaterions, I think you are going to be doomed to failure trying to code this yourselves.


bdbell
Fri Jul 17, 2015 3:47 am
juanpintom wrote:With the DMP6 example I get the same (code 1) error :( I tested RAW example and works well, but I don’t know how I can get G force from this values.

RogerClark
Fri Jul 17, 2015 5:11 am
@bdbell

I recall having some initial issues because the RTImuLib used some strange version non-standard version of i2dev, but perhaps its fixed now.

I did some work on AVR using the lib about 9 months ago, but found that the normal floating point precision on the AVR was too low and using double on STM32 would be better,

Also the more samples per second you can get from the IMU device the greater the accuracy when integrating acceleration into velocity etc.
Hence the STM32 would be better for this than AVR, but I suspect you’d need to change some settings in RTImu to tell the IMU device to sample faster

I’d really like to get back to looking at this, as I have some IMU9150s and also bought some 9250’s which are suppose to be more precise, but they are still in their anti static packets ;-(


bdbell
Fri Jul 17, 2015 10:19 am
@RogerClark

There was a copy of i2cdev in the libraries folder included with the RTIMULib-Arduino download but I did not use it – just used the same one I always use.

There are settings in “RTIMUSettings.cpp” for MPU9150GyroAccelSampleRate and MPU9150CompassSampleRate – the defaults were 50/25. I tested with my Arduino based IMU’s (running 2.7v @ 8MHz) – max sample rate I can get is ~64. With Maple mini I can get ~330 :D – will need to do more playing around with it to see what works best, but definitely looking good!

Please let me know if you have a chance to look at it and figure out the USBSerial error I am getting from the RTArduLinkIMU sketch.


RogerClark
Fri Jul 17, 2015 10:33 am
Re; ‘HardwareSerial*’ in assignment
hardPort = &Serial;

Thats because USBSerial is not an instance of HardwareSerial

You’ll need to change RTIMULib, try changing the defintion of RTARDULINKHAL_PORT to USBSerial instead of HardwareSerial

Actually, both HardwareSerial and USBSerial are both inherited from the Stream class, so you could try changing the library file to specify the port as Stream rather than HardwareSerial, and it may work for both. Or possibly as an instance of Print

Actually, I’d need to download and look at the code, but basically find the code that is hard coded to use HardwareSerial and change it ;-)


bdbell
Fri Jul 17, 2015 11:08 am
RogerClark wrote:You’ll need to change RTIMULib, try changing the defintion of RTARDULINKHAL_PORT to USBSerial instead of HardwareSerial

aster
Mon May 01, 2017 1:40 pm
hello! so is this library working with stm32f103c8? could someone send me a working copy?

Fingolin
Wed May 17, 2017 1:34 pm
Is this topic still active?
I am currentyl working on a prjoject with an quadrocopter, where I want to develop the flight controller etc all by myself.
Since the greater speed of and stm32 I switched to this board, however I am a bloody beginner.
But I made a MPU6050 library, that works for the arduino, which I am currently porting to the stm32103c8t.
The library is not yet working the same way as on the arduino, but I am looking foorward to share my results and get further inputs/tips/help whatever, since I am a beginner with stm32!

aster
Fri May 19, 2017 1:37 pm
Fingolin wrote:Is this topic still active?
I am currentyl working on a prjoject with an quadrocopter, where I want to develop the flight controller etc all by myself.
Since the greater speed of and stm32 I switched to this board, however I am a bloody beginner.
But I made a MPU6050 library, that works for the arduino, which I am currently porting to the stm32103c8t.
The library is not yet working the same way as on the arduino, but I am looking foorward to share my results and get further inputs/tips/help whatever, since I am a beginner with stm32!

garindo
Sun May 21, 2017 2:03 pm
Fingolin wrote:Is this topic still active?
I am currentyl working on a prjoject with an quadrocopter, where I want to develop the flight controller etc all by myself.
Since the greater speed of and stm32 I switched to this board, however I am a bloody beginner.
But I made a MPU6050 library, that works for the arduino, which I am currently porting to the stm32103c8t.
The library is not yet working the same way as on the arduino, but I am looking foorward to share my results and get further inputs/tips/help whatever, since I am a beginner with stm32!

garindo
Sun May 21, 2017 2:45 pm
STM32F103RET6
Image

STM32F103C8T6
Image


Fingolin
Sun May 21, 2017 2:47 pm
Hi Garindo,
I am working on a similar matter and would be very happy to share!
Currently I have auto-leveling working with arduino but I have trouble moving to the stm32 board.
If u want I can email you my code? (or post it here of course)

ag123
Sun May 21, 2017 3:04 pm
i’m not familar with drones, in terms of drones it seem there are lots of stm32f405 boards based drones
http://www.stm32duino.com/viewtopic.php?f=39&t=1977
http://www.ebay.com/sch/i.html?_odkw=dr … 4&_sacat=0
they seem to be the CC3D or betaflight variety
http://www.dronetrest.com/t/cc3d-flight … -guide/830
https://github.com/betaflight/betaflight
those drone specific boards often have the mems accelerometer / gyroscope on board, the pins also seemed to be geared towards drone/motor control purposes
those stm32f405 drone boards probably won’t make good generic dev boards as too few of the gpio pins are broken out but may likely be good drone boards
i think stm32f405 generally has a (whopping) 1M on chip flash

bdbell
Mon May 22, 2017 3:43 pm
I have been a busy with other projects, but finally got a chance to look at this tonight. I am attaching both the original DMP6/Teapot sketch and the latest working RTIMULib and libraries for them. I am using these with a small BT 4.0 motion controller I designed using STM32, MPU9150/9250, and MS5611 altimeter/pressure sensor (the attached sketches output to data to USB, although I have them working using Serial2 to BT). I have been using MPU9250 lately, but have also tested both these in the past with MPU9150 – I don’t have MPU6050 to test but should be fine as they are both written for it also.

It’s been a while since I modified the RTIMULib to work with STM32, so I can’t remember exactly what I did, but if you compare the files in the libraries folder with the originals you can see there are small changes to 2 files in each library.

Please note that these are currently configured for MPU9250 on i2c address of 0x69 so you will need to change them to match your configuration.

Hope this helps!


garindo
Mon May 22, 2017 11:44 pm
Hi, fingolin, for me there is no problem in sharing, I will clean my code and upload it, in arduino autolevel it works for me.

garindo
Mon May 22, 2017 11:47 pm
Bdvell, Very thanks.

Fingolin
Tue May 23, 2017 6:34 am
Now comes my code:
this is my GyroClass.h:
#include <math.h>
class Gyro{
private:
float AccelMultipl=2*9.81; //
float AngleMultipl=250;
float correction[3]={0.9890, 0.9920,0.9844}; //correction factor for Acceleration
float bias[3]={-0.3713,-0.0095,0.6367}; //Offset factor für Acceleration
float Offset[3]={ 0.86433,0.99755,-0.07829}; //Offsett faktor der Drehwinkelgeber (-Mittelwert des Stillstands) //Offset for Angular Rate ~Mean if the Gyro is not Moving (minimizes drift)

public:
//Werte mit _accel wurden aus beschleunigungen berechnet (wird zur Sensorfusion genutzt)
//Raw Angular-Rates: (just scaled)
float Roll_rate=0;
float Gier_rate=0;
float Nick_rate=0;

float Gier_angle=0;
//Angles from acceleration:
float Roll_accel=0;
float Nick_accel=0;
//Angles after Sensor funsion:
float Roll_filtered=0;
float Nick_filtered=0;
float Gier_filtered=0; //"FILTERED" for a real filtering we actually need something like a compass which is not implemented!

//Acceleration (Raw and Integrated) (Werte sind bis für Sensorfusion eig Nutzlos, insbesondere die Integrierten, diese sollten (hier fehlt Gravity-Offset) den Geschwindigkeiten entsprechen.
float x_accel=0;
float Ix_accel=0;

float y_accel=0;
float Iy_accel=0;

float z_accel=0;
float Iz_accel=0;

float temperature;
// LastSampleTime is used for integrating correctly
float LastSampleTime=0;

int Adress=0x68;

void init(int Adress)
{
/*
* Init Function, sets Adress Wakes up the MPU and sets the LowPassFilter -> LowPass is set pretty High if the chip is dampened maybe set it lower
*/
this->Adress=Adress;
Wire.begin();
Wire.beginTransmission(Adress);
Wire.write(0x6B); // PWR_MGMT_1 register
Wire.write(0); // set to zero (wakes up the MPU-6050)
Wire.endTransmission();

Wire.beginTransmission(Adress);
Wire.write(0x1A); // CONFIG register
byte val=B00000110; //
Wire.write(val); // Set the LowPassFilter
Wire.endTransmission();

}
void setConfig(int mode)
{
//Set the mode / range (not yet tested!)
byte bMode;
switch (mode){
case 0:
bMode=B00000000;
this->AccelMultipl=2*9.81;
this->AngleMultipl=250;
break;
case 1:
bMode=B00001000;
this->AccelMultipl=4*9.81;
this->AngleMultipl=500;
break;
case 2:
bMode=B00011000;
this->AccelMultipl=8*9.81;
this->AngleMultipl=1000;
break;
case 3:
bMode=B00011000;
this->AccelMultipl=16*9.81;
this->AngleMultipl=2000;
break;
default:
bMode=B00000000;
this->AccelMultipl=2*9.81;
this->AngleMultipl=250;
break;
}
//Serial.println(bMode);
Wire.beginTransmission(this->Adress);
Wire.write(0x1B); // starting with register 0x1B ()
Wire.write(bMode); //1->+-500°/s
Wire.endTransmission();
Wire.write(0x1C); // starting with register 0x1C ()
Wire.write(bMode); //1->+-4g°/s
Wire.endTransmission();
}

void getConfigs() //Not Tested!
{
Wire.beginTransmission(this->Adress);
Wire.write(0x1B); // starting with register 0x1B (GYRI CIBFUG)
Wire.endTransmission();
Wire.beginTransmission(this->Adress);
Wire.requestFrom(this->Adress,2); // request a total of 2 registers
short conf=Wire.read()<<8|Wire.read();
// Serial.println(conf,BIN);
}

void grabData()//grabs Data from Gyro and processes it (filteres it)
{
// First Get Times for the integrating stuff that happenes later
float T_now=micros()*0.000001; //Jetzt Zeit in s
float dT=T_now-(this->LastSampleTime); //Time that has run by (integration span)
this->LastSampleTime=T_now;

//Reading & Saving Raw-Values:
Wire.beginTransmission(this->Adress);
Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H)
Wire.endTransmission();
Wire.requestFrom(this->Adress,14); // request a total of 14 registers
this->x_accel=Wire.read()<<8|Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)
this->y_accel=Wire.read()<<8|Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
this->z_accel=Wire.read()<<8|Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
this->temperature=Wire.read()<<8|Wire.read(); // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)

this->Roll_rate=Wire.read()<<8|Wire.read(); // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
this->Nick_rate=Wire.read()<<8|Wire.read(); // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
this->Gier_rate=Wire.read()<<8|Wire.read(); // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)}

//Preprocessing:
//1. Scaling works by an affin function x_scaled=a * x_raw +b
this->x_accel=(float)this->x_accel*this->AccelMultipl/32767*this->correction[0] + this->bias[0];
this->y_accel=(float)this->y_accel*this->AccelMultipl/32767*this->correction[1] + this->bias[1];
this->z_accel=(float)this->z_accel*this->AccelMultipl/32767*this->correction[2] + this->bias[2];
//2. Integrate acceleration (useless so far) //maybe used later by integrating it (twice) to determine position (should be pretty uncertain)
this->Ix_accel+= this->x_accel*dT;
this->Iy_accel+= this->y_accel*dT;
this->Iz_accel+= this->z_accel*dT;
//3. Temperature
this->temperature=(float) this->temperature/340.00+36.53;
//4.Scale Angular Rates: (Angular Rates are just adjusted by an Offset, which is determined by the mean and minimizes drift)
this->Roll_rate=(float)this->Roll_rate*this->AngleMultipl/32767+Offset[0];
this->Nick_rate=(float)this->Nick_rate*this->AngleMultipl/32767+Offset[1];
this->Gier_rate=(float)this->Gier_rate*this->AngleMultipl/32767+Offset[2];

//Roll und Nicktwerte aus Beschleunigungen:
this->Roll_accel=RAD_TO_DEG*(atan2(-this->y_accel,-this->z_accel)); //NICK
this->Nick_accel=RAD_TO_DEG*(atan2(this->x_accel,sqrt(this->z_accel*this->z_accel+this->y_accel*this->y_accel)));//ROLL

//Sensor fusion is here
//Sensor fusion uses just a complementary filter, however works pretty solid (maybe use a kalman filter later)

this->Roll_filtered=0.994 *(this->Roll_filtered+this->Roll_rate*dT) + 0.006*this->Roll_accel ;
this->Nick_filtered=0.994 *(this->Nick_filtered+this->Nick_rate*dT) + 0.006*this->Nick_accel ;

//this->Roll_filtered -=Nick_filtered*sin(this->Gier_rate);
//this->Nick_filtered +=Roll_filtered*sin(this->Gier_rate);

this->Gier_angle+=Gier_rate*dT;
//Gier_filtered is not filtered since for that a compass would be needed!
this->Gier_filtered=0.98*this->Gier_angle;
}

void dispData(){
//Winkelbeschleunigungen:
//Serial.print(" aX: "); Serial.print(this->x_accel); Serial.print(" aY: "); Serial.print(this->y_accel); Serial.print(" aZ: "); Serial.print(this->z_accel);

//Nick& Roll aus Acceleration:
//Serial.print(" Nick_acc; ");Serial.print(this->Nick_accel);
//Serial.print(" Roll_acc: ");Serial.print(this->Roll_accel);
//NICK&ROLL-ANGLE-Rates
// Serial.print(" Roll_rate: ");Serial.print(this->Roll_rate);
//Serial.print(" Gier_filtered: ");Serial.print(this->Gier_rate);
//NICK&ROLL ANGLES
Serial.print(" Roll_filtered: ");Serial.print(this->Roll_filtered);
Serial.print(" Nick_filtered: ");Serial.print(this->Nick_filtered);
Serial.print(" GierAngle: "); Serial.print(this->Gier_filtered);

//TEMPERATUR:
// Serial.print(" Tmp: "); Serial.print(this->temperature); //
//NULL-Linie zur Orientierung:
//Serial.print(" Null: "); Serial.print(0);
//Serial.print(" GasMax: "); Serial.print(60);
//Serial.print(" -GasMax: "); Serial.print(-60);
}

};


Fingolin
Wed May 24, 2017 10:04 am
Does anyone know how I change the i2c pins? So that I can plug the IMU on other pins?

garindo
Wed May 31, 2017 6:29 pm
Hi fingolin,in file wire.cpp, change line:

SCL, SDA
TwoWire Wire(PB6, PB7, SOFT_STANDARD);

one think, the problem in stm32 with mpu6050 can be the reading speed i2c, 2000 microseconds in the reading routine of mpu6050 against the 600 approx with TwoWire Wire(PB6, PB7, SOFT_FAST);

// #define NO_GLOBAL_INSTANTIATION
#include<Wire.h>
TwoWire Wire2(PB6, PB7, SOFT_FAST);

const int MPU_addr=0x68; // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
void setup(){
/// SCL,SDA

Wire2.begin();

Wire2.beginTransmission(MPU_addr);
Wire2.write(0x6B); // PWR_MGMT_1 register
Wire2.write(0); // set to zero (wakes up the MPU-6050)
Wire2.endTransmission();
}
void loop(){

//// read data

}


garindo
Sat Jun 03, 2017 4:44 pm
Hello…after many hours, autolevel in stm32 work right.

https://www.youtube.com/watch?v=JKp9divSNO8


RogerClark
Sat Jun 03, 2017 10:39 pm
excellent work.

BTW you can embed vidoes, using the Youtube button with just the video ID code


Fingolin
Sun Jun 04, 2017 11:45 am
Hi Gardino,
thanks for the tipp!
Nice work I like it and you are using the same frame as I do :)
By the way, what are you using as a remote?

garindo
Sun Jun 04, 2017 6:33 pm
Very thanks Rogerclark, for the next video.
Fingolin, the system TxRx radio is radiolink at10 or at9 and you ?

Fingolin
Mon Jun 05, 2017 10:55 am
I dont have a remote yet :D that is why I am asking..

Squonk42
Mon Jun 05, 2017 11:50 am
I wrote a blog entry on the Sensor Fusion subject a few months ago, if this can be useful to someone:
http://www.wifi4things.com/motion-sensor-fusion/

RogerClark
Mon Jun 05, 2017 10:19 pm
Squonk42 wrote:I wrote a blog entry on the Sensor Fusion subject a few months ago, if this can be useful to someone:
http://www.wifi4things.com/motion-sensor-fusion/

Squonk42
Tue Jun 06, 2017 5:20 am
RogerClark wrote:I used the RTIMU lib a few years ago with the MPU9150, but it did not include filtering, ( I am not sure if it got updated to include filtering, but I think the library has been abandoned now by its author).

RogerClark
Tue Jun 06, 2017 7:53 am
OK.

I don’t think I will go back to the same project, but its good to know there is an updated version of the library


ahull
Wed Aug 16, 2017 9:14 pm
I’m not sure if anybody on the forum is the Joop Brokking who produced this video, but I’ll leave this here just for completeness.


rsc
Mon Sep 18, 2017 12:56 am
the code in that video not work (for my) :| :| :|

aster
Fri Oct 06, 2017 4:55 pm
Squonk42 wrote: Tue Jun 06, 2017 5:20 am

aster
Mon Oct 09, 2017 11:33 am
i found this library: https://github.com/sparkfun/SparkFun_MP … no_Library
and i am using cheap sensors from aliexpress like this:
Image

right now i am testing it only with i2c (spi later) and i found an error:
the WHO_AM_I_MPU9250 register could be both 0x71 and 0x73 (mine is 0x73 may it means that my sensors is a fake one? boh)

same problem with the magnetometer:
WHO_AM_I_AK8963 register should be 0x48 but it looks like that my imu doesn’t have this registers!

anyway i forced the imu to run a test with the library and i get:
AK8963 mag biases (mG)
-56.29
193.08
339.12
AK8963 mag scale (mG)
1.17
0.77
1.17

example basinc data output without moving the imu
X-acceleration: -43.70 mg Y-acceleration: 0.31 mg Z-acceleration: 999.94 mg
X-gyro rate: 0.046 degrees/sec Y-gyro rate: 0.031 degrees/sec Z-gyro rate: 0.000 degrees/sec
X-mag field: 1.82 mG Y-mag field: 0.00 mG Z-mag field: 49.20 mG
Temperature is 26.3 degrees C
X-acceleration: -46.94 mg Y-acceleration: 1.22 mg Z-acceleration: 1001.34 mg
X-gyro rate: 0.015 degrees/sec Y-gyro rate: 0.168 degrees/sec Z-gyro rate: 0.008 degrees/sec
X-mag field: 5.45 mG Y-mag field: -7.29 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -45.04 mg Y-acceleration: 0.31 mg Z-acceleration: 999.02 mg
X-gyro rate: -0.114 degrees/sec Y-gyro rate: 0.130 degrees/sec Z-gyro rate: -0.107 degrees/sec
X-mag field: 3.63 mG Y-mag field: -9.11 mG Z-mag field: 33.38 mG
Temperature is 26.3 degrees C
X-acceleration: -44.49 mg Y-acceleration: 1.22 mg Z-acceleration: 1004.39 mg
X-gyro rate: -0.053 degrees/sec Y-gyro rate: 0.206 degrees/sec Z-gyro rate: -0.008 degrees/sec
X-mag field: 5.45 mG Y-mag field: -3.64 mG Z-mag field: 45.68 mG
Temperature is 26.3 degrees C
X-acceleration: -44.37 mg Y-acceleration: 0.37 mg Z-acceleration: 999.27 mg
X-gyro rate: -0.008 degrees/sec Y-gyro rate: 0.038 degrees/sec Z-gyro rate: 0.069 degrees/sec
X-mag field: 5.45 mG Y-mag field: -10.93 mG Z-mag field: 17.57 mG
Temperature is 26.3 degrees C
X-acceleration: -45.53 mg Y-acceleration: 1.22 mg Z-acceleration: 1001.40 mg
X-gyro rate: -0.008 degrees/sec Y-gyro rate: 0.092 degrees/sec Z-gyro rate: -0.008 degrees/sec
X-mag field: 7.26 mG Y-mag field: -5.46 mG Z-mag field: 36.90 mG
Temperature is 26.3 degrees C
X-acceleration: -45.17 mg Y-acceleration: 0.92 mg Z-acceleration: 998.23 mg
X-gyro rate: -0.053 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: 0.053 degrees/sec
X-mag field: 9.08 mG Y-mag field: 10.93 mG Z-mag field: 17.57 mG
Temperature is 26.3 degrees C
X-acceleration: -48.77 mg Y-acceleration: -1.95 mg Z-acceleration: 999.02 mg
X-gyro rate: -0.061 degrees/sec Y-gyro rate: 0.069 degrees/sec Z-gyro rate: 1.144 degrees/sec
X-mag field: -12.71 mG Y-mag field: -14.57 mG Z-mag field: 38.66 mG
Temperature is 26.3 degrees C
X-acceleration: -46.02 mg Y-acceleration: 0.61 mg Z-acceleration: 1004.82 mg
X-gyro rate: 0.038 degrees/sec Y-gyro rate: 0.183 degrees/sec Z-gyro rate: -0.046 degrees/sec
X-mag field: 21.79 mG Y-mag field: -9.11 mG Z-mag field: 36.90 mG
Temperature is 26.3 degrees C
X-acceleration: -44.86 mg Y-acceleration: 0.18 mg Z-acceleration: 1000.06 mg
X-gyro rate: -0.046 degrees/sec Y-gyro rate: 0.130 degrees/sec Z-gyro rate: 0.099 degrees/sec
X-mag field: 5.45 mG Y-mag field: -10.93 mG Z-mag field: 45.68 mG
Temperature is 26.3 degrees C
X-acceleration: -48.22 mg Y-acceleration: 2.50 mg Z-acceleration: 1003.78 mg
X-gyro rate: -0.099 degrees/sec Y-gyro rate: 0.069 degrees/sec Z-gyro rate: -0.076 degrees/sec
X-mag field: 3.63 mG Y-mag field: -1.82 mG Z-mag field: 29.87 mG
Temperature is 26.3 degrees C
X-acceleration: -46.94 mg Y-acceleration: 0.43 mg Z-acceleration: 1002.20 mg
X-gyro rate: -0.023 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: 0.206 degrees/sec
X-mag field: -3.63 mG Y-mag field: -12.75 mG Z-mag field: 47.44 mG
Temperature is 26.3 degrees C
X-acceleration: -48.71 mg Y-acceleration: 1.34 mg Z-acceleration: 1000.18 mg
X-gyro rate: -0.038 degrees/sec Y-gyro rate: 0.046 degrees/sec Z-gyro rate: -0.046 degrees/sec
X-mag field: 3.63 mG Y-mag field: -1.82 mG Z-mag field: 36.90 mG
Temperature is 26.3 degrees C
X-acceleration: -44.98 mg Y-acceleration: 0.85 mg Z-acceleration: 1002.38 mg
X-gyro rate: -0.061 degrees/sec Y-gyro rate: 0.168 degrees/sec Z-gyro rate: 0.130 degrees/sec
X-mag field: 1.82 mG Y-mag field: 3.64 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -45.65 mg Y-acceleration: -0.31 mg Z-acceleration: 1001.71 mg
X-gyro rate: -0.046 degrees/sec Y-gyro rate: 0.145 degrees/sec Z-gyro rate: -0.084 degrees/sec
X-mag field: -1.82 mG Y-mag field: -18.22 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -47.61 mg Y-acceleration: 2.56 mg Z-acceleration: 1001.16 mg
X-gyro rate: -0.061 degrees/sec Y-gyro rate: 0.145 degrees/sec Z-gyro rate: -0.046 degrees/sec
X-mag field: 7.26 mG Y-mag field: -1.82 mG Z-mag field: 33.38 mG
Temperature is 26.3 degrees C
X-acceleration: -45.53 mg Y-acceleration: 2.26 mg Z-acceleration: 997.31 mg
X-gyro rate: 0.000 degrees/sec Y-gyro rate: 0.160 degrees/sec Z-gyro rate: 0.069 degrees/sec
X-mag field: 5.45 mG Y-mag field: -10.93 mG Z-mag field: 42.17 mG
Temperature is 26.3 degrees C
X-acceleration: -46.75 mg Y-acceleration: 1.40 mg Z-acceleration: 1001.16 mg
X-gyro rate: -0.053 degrees/sec Y-gyro rate: 0.221 degrees/sec Z-gyro rate: -0.069 degrees/sec
X-mag field: 9.08 mG Y-mag field: 7.29 mG Z-mag field: 28.11 mG
Temperature is 26.3 degrees C
X-acceleration: -44.98 mg Y-acceleration: -1.04 mg Z-acceleration: 997.38 mg
X-gyro rate: -0.084 degrees/sec Y-gyro rate: 0.130 degrees/sec Z-gyro rate: -0.053 degrees/sec
X-mag field: 25.42 mG Y-mag field: 9.11 mG Z-mag field: 26.36 mG
Temperature is 26.3 degrees C
X-acceleration: -46.08 mg Y-acceleration: 1.10 mg Z-acceleration: 1002.50 mg
X-gyro rate: -0.107 degrees/sec Y-gyro rate: 0.069 degrees/sec Z-gyro rate: 0.053 degrees/sec
X-mag field: 12.71 mG Y-mag field: -18.22 mG Z-mag field: 31.63 mG
Temperature is 26.3 degrees C
X-acceleration: -46.75 mg Y-acceleration: 0.92 mg Z-acceleration: 1003.66 mg
X-gyro rate: -0.107 degrees/sec Y-gyro rate: 0.069 degrees/sec Z-gyro rate: -0.038 degrees/sec
X-mag field: 10.89 mG Y-mag field: 1.82 mG Z-mag field: 40.41 mG
Temperature is 26.3 degrees C
X-acceleration: -45.47 mg Y-acceleration: 1.46 mg Z-acceleration: 1000.98 mg
X-gyro rate: 0.053 degrees/sec Y-gyro rate: 0.183 degrees/sec Z-gyro rate: -0.038 degrees/sec
X-mag field: 1.82 mG Y-mag field: -7.29 mG Z-mag field: 28.11 mG
Temperature is 26.3 degrees C
X-acceleration: -48.95 mg Y-acceleration: 4.33 mg Z-acceleration: 1000.67 mg
X-gyro rate: -0.053 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: -0.038 degrees/sec
X-mag field: 23.60 mG Y-mag field: -10.93 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -46.51 mg Y-acceleration: 0.79 mg Z-acceleration: 997.25 mg
X-gyro rate: -0.076 degrees/sec Y-gyro rate: 0.069 degrees/sec Z-gyro rate: -0.015 degrees/sec
X-mag field: -7.26 mG Y-mag field: -5.46 mG Z-mag field: 57.98 mG
Temperature is 26.3 degrees C
X-acceleration: -47.91 mg Y-acceleration: 0.12 mg Z-acceleration: 1000.18 mg
X-gyro rate: 0.008 degrees/sec Y-gyro rate: 0.099 degrees/sec Z-gyro rate: -0.092 degrees/sec
X-mag field: 1.82 mG Y-mag field: -21.86 mG Z-mag field: 49.20 mG
Temperature is 26.3 degrees C
X-acceleration: -46.81 mg Y-acceleration: 1.46 mg Z-acceleration: 996.95 mg
X-gyro rate: -0.031 degrees/sec Y-gyro rate: 0.107 degrees/sec Z-gyro rate: 0.046 degrees/sec
X-mag field: 1.82 mG Y-mag field: 10.93 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -47.55 mg Y-acceleration: 0.43 mg Z-acceleration: 999.94 mg
X-gyro rate: -0.130 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: -0.008 degrees/sec
X-mag field: 0.00 mG Y-mag field: -20.04 mG Z-mag field: 40.41 mG
Temperature is 26.3 degrees C
X-acceleration: -49.56 mg Y-acceleration: 0.12 mg Z-acceleration: 1002.26 mg
X-gyro rate: -0.069 degrees/sec Y-gyro rate: 0.114 degrees/sec Z-gyro rate: 0.008 degrees/sec
X-mag field: -5.45 mG Y-mag field: -7.29 mG Z-mag field: 42.17 mG
Temperature is 26.3 degrees C
X-acceleration: -44.92 mg Y-acceleration: 1.77 mg Z-acceleration: 1003.11 mg
X-gyro rate: 0.015 degrees/sec Y-gyro rate: 0.107 degrees/sec Z-gyro rate: 0.015 degrees/sec
X-mag field: 7.26 mG Y-mag field: -9.11 mG Z-mag field: 36.90 mG
Temperature is 26.3 degrees C
X-acceleration: -50.72 mg Y-acceleration: 0.92 mg Z-acceleration: 1000.92 mg
X-gyro rate: -0.023 degrees/sec Y-gyro rate: 0.099 degrees/sec Z-gyro rate: 0.816 degrees/sec
X-mag field: 29.05 mG Y-mag field: -20.04 mG Z-mag field: 40.41 mG
Temperature is 26.3 degrees C
X-acceleration: -48.77 mg Y-acceleration: 0.12 mg Z-acceleration: 999.63 mg
X-gyro rate: 0.038 degrees/sec Y-gyro rate: 0.160 degrees/sec Z-gyro rate: -0.191 degrees/sec
X-mag field: 19.97 mG Y-mag field: -10.93 mG Z-mag field: 21.09 mG
Temperature is 26.3 degrees C
X-acceleration: -47.30 mg Y-acceleration: 2.38 mg Z-acceleration: 1003.48 mg
X-gyro rate: 0.000 degrees/sec Y-gyro rate: 0.092 degrees/sec Z-gyro rate: -0.122 degrees/sec
X-mag field: 19.97 mG Y-mag field: -18.22 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -46.94 mg Y-acceleration: 2.01 mg Z-acceleration: 1003.11 mg
X-gyro rate: -0.053 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: -0.061 degrees/sec
X-mag field: 7.26 mG Y-mag field: -16.39 mG Z-mag field: 36.90 mG
Temperature is 26.3 degrees C
X-acceleration: -47.00 mg Y-acceleration: 0.98 mg Z-acceleration: 1000.12 mg
X-gyro rate: -0.015 degrees/sec Y-gyro rate: 0.084 degrees/sec Z-gyro rate: -0.084 degrees/sec
X-mag field: 10.89 mG Y-mag field: -5.46 mG Z-mag field: 33.38 mG
Temperature is 26.3 degrees C
X-acceleration: -43.21 mg Y-acceleration: 1.22 mg Z-acceleration: 1000.67 mg
X-gyro rate: -0.038 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: 0.061 degrees/sec
X-mag field: 18.16 mG Y-mag field: -12.75 mG Z-mag field: 36.90 mG
Temperature is 26.3 degrees C
X-acceleration: -45.59 mg Y-acceleration: 0.24 mg Z-acceleration: 998.23 mg
X-gyro rate: -0.031 degrees/sec Y-gyro rate: 0.114 degrees/sec Z-gyro rate: -0.046 degrees/sec
X-mag field: -9.08 mG Y-mag field: -18.22 mG Z-mag field: 38.66 mG
Temperature is 26.3 degrees C
X-acceleration: -49.01 mg Y-acceleration: 2.38 mg Z-acceleration: 1000.92 mg
X-gyro rate: -0.061 degrees/sec Y-gyro rate: 0.099 degrees/sec Z-gyro rate: -0.046 degrees/sec
X-mag field: -5.45 mG Y-mag field: -18.22 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -46.94 mg Y-acceleration: 0.06 mg Z-acceleration: 1003.17 mg
X-gyro rate: -0.023 degrees/sec Y-gyro rate: 0.137 degrees/sec Z-gyro rate: 0.046 degrees/sec
X-mag field: -7.26 mG Y-mag field: -12.75 mG Z-mag field: 57.98 mG
Temperature is 26.3 degrees C
X-acceleration: -47.97 mg Y-acceleration: 0.31 mg Z-acceleration: 997.19 mg
X-gyro rate: -0.046 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: -0.168 degrees/sec
X-mag field: 3.63 mG Y-mag field: -16.39 mG Z-mag field: 43.93 mG
Temperature is 26.3 degrees C
X-acceleration: -46.20 mg Y-acceleration: 2.69 mg Z-acceleration: 1001.83 mg
X-gyro rate: -0.114 degrees/sec Y-gyro rate: 0.191 degrees/sec Z-gyro rate: -0.053 degrees/sec
X-mag field: 0.00 mG Y-mag field: -1.82 mG Z-mag field: 43.93 mG
Temperature is 26.3 degrees C
X-acceleration: -50.29 mg Y-acceleration: 1.53 mg Z-acceleration: 1002.93 mg
X-gyro rate: -0.038 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: 0.038 degrees/sec
X-mag field: -3.63 mG Y-mag field: -5.46 mG Z-mag field: 40.41 mG
Temperature is 26.3 degrees C
X-acceleration: -45.72 mg Y-acceleration: -0.18 mg Z-acceleration: 1002.01 mg
X-gyro rate: -0.069 degrees/sec Y-gyro rate: 0.076 degrees/sec Z-gyro rate: 0.015 degrees/sec
X-mag field: 1.82 mG Y-mag field: -21.86 mG Z-mag field: 24.60 mG
Temperature is 26.3 degrees C
X-acceleration: -47.79 mg Y-acceleration: 0.55 mg Z-acceleration: 999.88 mg
X-gyro rate: -0.130 degrees/sec Y-gyro rate: 0.183 degrees/sec Z-gyro rate: -0.015 degrees/sec
X-mag field: 0.00 mG Y-mag field: 1.82 mG Z-mag field: 15.81 mG
Temperature is 26.3 degrees C
X-acceleration: -47.06 mg Y-acceleration: 3.23 mg Z-acceleration: 1003.54 mg
X-gyro rate: -0.046 degrees/sec Y-gyro rate: 0.008 degrees/sec Z-gyro rate: -0.092 degrees/sec
X-mag field: 27.24 mG Y-mag field: -7.29 mG Z-mag field: 28.11 mG
Temperature is 26.3 degrees C
X-acceleration: -48.22 mg Y-acceleration: 0.18 mg Z-acceleration: 1000.00 mg
X-gyro rate: -0.084 degrees/sec Y-gyro rate: 0.130 degrees/sec Z-gyro rate: -0.069 degrees/sec
X-mag field: 3.63 mG Y-mag field: 1.82 mG Z-mag field: 29.87 mG
Temperature is 26.3 degrees C
X-acceleration: -46.20 mg Y-acceleration: 1.95 mg Z-acceleration: 998.84 mg
X-gyro rate: 0.015 degrees/sec Y-gyro rate: 0.092 degrees/sec Z-gyro rate: -0.053 degrees/sec
X-mag field: 3.63 mG Y-mag field: 5.46 mG Z-mag field: 29.87 mG
Temperature is 26.3 degrees C
X-acceleration: -46.57 mg Y-acceleration: 1.65 mg Z-acceleration: 998.47 mg
X-gyro rate: 0.015 degrees/sec Y-gyro rate: 0.214 degrees/sec Z-gyro rate: -0.046 degrees/sec
X-mag field: 1.82 mG Y-mag field: 0.00 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -48.71 mg Y-acceleration: -0.43 mg Z-acceleration: 998.29 mg
X-gyro rate: -0.092 degrees/sec Y-gyro rate: 0.046 degrees/sec Z-gyro rate: -0.099 degrees/sec
X-mag field: 5.45 mG Y-mag field: -10.93 mG Z-mag field: 52.71 mG
Temperature is 26.3 degrees C
X-acceleration: -46.14 mg Y-acceleration: 2.08 mg Z-acceleration: 997.25 mg
X-gyro rate: -0.069 degrees/sec Y-gyro rate: 0.015 degrees/sec Z-gyro rate: -0.084 degrees/sec
X-mag field: -7.26 mG Y-mag field: -5.46 mG Z-mag field: 47.44 mG
Temperature is 26.3 degrees C
X-acceleration: -46.26 mg Y-acceleration: 1.95 mg Z-acceleration: 1003.97 mg
X-gyro rate: -0.015 degrees/sec Y-gyro rate: 0.114 degrees/sec Z-gyro rate: -0.008 degrees/sec
X-mag field: -25.42 mG Y-mag field: -20.04 mG Z-mag field: 40.41 mG
Temperature is 26.3 degrees C
X-acceleration: -46.69 mg Y-acceleration: 2.38 mg Z-acceleration: 1000.18 mg
X-gyro rate: -0.092 degrees/sec Y-gyro rate: 0.107 degrees/sec Z-gyro rate: -0.107 degrees/sec
X-mag field: 7.26 mG Y-mag field: -23.68 mG Z-mag field: 40.41 mG
Temperature is 26.3 degrees C
X-acceleration: -45.96 mg Y-acceleration: -0.98 mg Z-acceleration: 1000.43 mg
X-gyro rate: -0.092 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: -0.031 degrees/sec
X-mag field: -9.08 mG Y-mag field: -14.57 mG Z-mag field: 42.17 mG
Temperature is 26.3 degrees C
X-acceleration: -46.08 mg Y-acceleration: 0.18 mg Z-acceleration: 999.27 mg
X-gyro rate: 0.023 degrees/sec Y-gyro rate: 0.221 degrees/sec Z-gyro rate: -0.008 degrees/sec
X-mag field: 9.08 mG Y-mag field: -7.29 mG Z-mag field: 24.60 mG
Temperature is 26.3 degrees C
X-acceleration: -46.94 mg Y-acceleration: 2.01 mg Z-acceleration: 999.88 mg
X-gyro rate: -0.023 degrees/sec Y-gyro rate: 0.092 degrees/sec Z-gyro rate: -0.053 degrees/sec
X-mag field: 19.97 mG Y-mag field: 7.29 mG Z-mag field: 28.11 mG
Temperature is 26.3 degrees C
X-acceleration: -44.25 mg Y-acceleration: 1.71 mg Z-acceleration: 1000.61 mg
X-gyro rate: -0.061 degrees/sec Y-gyro rate: 0.046 degrees/sec Z-gyro rate: -0.084 degrees/sec
X-mag field: 21.79 mG Y-mag field: -12.75 mG Z-mag field: 29.87 mG
Temperature is 26.3 degrees C
X-acceleration: -47.06 mg Y-acceleration: 1.16 mg Z-acceleration: 1001.77 mg
X-gyro rate: 0.015 degrees/sec Y-gyro rate: 0.092 degrees/sec Z-gyro rate: 0.000 degrees/sec
X-mag field: 25.42 mG Y-mag field: 1.82 mG Z-mag field: 12.30 mG
Temperature is 26.3 degrees C
X-acceleration: -44.19 mg Y-acceleration: 0.92 mg Z-acceleration: 1001.89 mg
X-gyro rate: 0.046 degrees/sec Y-gyro rate: 0.191 degrees/sec Z-gyro rate: 0.008 degrees/sec
X-mag field: -1.82 mG Y-mag field: 0.00 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -46.08 mg Y-acceleration: 0.67 mg Z-acceleration: 999.39 mg
X-gyro rate: -0.015 degrees/sec Y-gyro rate: 0.046 degrees/sec Z-gyro rate: -0.008 degrees/sec
X-mag field: 1.82 mG Y-mag field: 0.00 mG Z-mag field: 38.66 mG
Temperature is 26.3 degrees C
X-acceleration: -46.88 mg Y-acceleration: 1.65 mg Z-acceleration: 1001.22 mg
X-gyro rate: 0.069 degrees/sec Y-gyro rate: 0.137 degrees/sec Z-gyro rate: -0.069 degrees/sec
X-mag field: 3.63 mG Y-mag field: 1.82 mG Z-mag field: 33.38 mG
Temperature is 26.3 degrees C
X-acceleration: -46.63 mg Y-acceleration: 3.36 mg Z-acceleration: 1000.43 mg
X-gyro rate: 0.000 degrees/sec Y-gyro rate: 0.122 degrees/sec Z-gyro rate: 0.023 degrees/sec
X-mag field: 3.63 mG Y-mag field: -16.39 mG Z-mag field: 50.96 mG
Temperature is 26.3 degrees C
X-acceleration: -48.71 mg Y-acceleration: 2.38 mg Z-acceleration: 997.86 mg
X-gyro rate: -0.023 degrees/sec Y-gyro rate: 0.168 degrees/sec Z-gyro rate: -0.137 degrees/sec
X-mag field: -3.63 mG Y-mag field: -20.04 mG Z-mag field: 47.44 mG
Temperature is 26.3 degrees C
X-acceleration: -43.09 mg Y-acceleration: 2.14 mg Z-acceleration: 1002.87 mg
X-gyro rate: -0.076 degrees/sec Y-gyro rate: 0.191 degrees/sec Z-gyro rate: -0.069 degrees/sec
X-mag field: -3.63 mG Y-mag field: -23.68 mG Z-mag field: 40.41 mG
Temperature is 26.3 degrees C
X-acceleration: -46.08 mg Y-acceleration: 1.77 mg Z-acceleration: 999.02 mg
X-gyro rate: -0.008 degrees/sec Y-gyro rate: 0.153 degrees/sec Z-gyro rate: 0.832 degrees/sec
X-mag field: 3.63 mG Y-mag field: -12.75 mG Z-mag field: 33.38 mG
Temperature is 26.3 degrees C
X-acceleration: -49.56 mg Y-acceleration: 1.89 mg Z-acceleration: 1002.08 mg
X-gyro rate: -0.046 degrees/sec Y-gyro rate: 0.099 degrees/sec Z-gyro rate: 0.015 degrees/sec
X-mag field: 1.82 mG Y-mag field: -7.29 mG Z-mag field: 31.63 mG
Temperature is 26.3 degrees C
X-acceleration: -46.51 mg Y-acceleration: 2.32 mg Z-acceleration: 998.17 mg
X-gyro rate: -0.076 degrees/sec Y-gyro rate: 0.191 degrees/sec Z-gyro rate: -0.114 degrees/sec
X-mag field: 27.24 mG Y-mag field: 0.00 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -46.57 mg Y-acceleration: 2.99 mg Z-acceleration: 1003.42 mg
X-gyro rate: -0.153 degrees/sec Y-gyro rate: 0.206 degrees/sec Z-gyro rate: -0.046 degrees/sec
X-mag field: 16.34 mG Y-mag field: -7.29 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -44.31 mg Y-acceleration: 2.44 mg Z-acceleration: 999.39 mg
X-gyro rate: 0.000 degrees/sec Y-gyro rate: 0.137 degrees/sec Z-gyro rate: -0.015 degrees/sec
X-mag field: 18.16 mG Y-mag field: 9.11 mG Z-mag field: 12.30 mG
Temperature is 26.3 degrees C
X-acceleration: -43.76 mg Y-acceleration: 1.34 mg Z-acceleration: 1000.31 mg
X-gyro rate: -0.031 degrees/sec Y-gyro rate: 0.183 degrees/sec Z-gyro rate: -0.008 degrees/sec
X-mag field: 10.89 mG Y-mag field: -1.82 mG Z-mag field: 15.81 mG
Temperature is 26.3 degrees C
X-acceleration: -47.97 mg Y-acceleration: 1.59 mg Z-acceleration: 999.82 mg
X-gyro rate: 0.053 degrees/sec Y-gyro rate: 0.099 degrees/sec Z-gyro rate: -0.038 degrees/sec
X-mag field: 1.82 mG Y-mag field: -10.93 mG Z-mag field: 31.63 mG
Temperature is 26.3 degrees C
X-acceleration: -46.69 mg Y-acceleration: 1.53 mg Z-acceleration: 996.34 mg
X-gyro rate: -0.084 degrees/sec Y-gyro rate: 0.244 degrees/sec Z-gyro rate: 0.000 degrees/sec
X-mag field: -14.53 mG Y-mag field: -20.04 mG Z-mag field: 43.93 mG
Temperature is 26.3 degrees C
X-acceleration: -47.79 mg Y-acceleration: 1.83 mg Z-acceleration: 1000.67 mg
X-gyro rate: -0.114 degrees/sec Y-gyro rate: 0.099 degrees/sec Z-gyro rate: -0.038 degrees/sec
X-mag field: -5.45 mG Y-mag field: -29.14 mG Z-mag field: 49.20 mG
Temperature is 26.3 degrees C
X-acceleration: -48.65 mg Y-acceleration: -0.24 mg Z-acceleration: 1002.08 mg
X-gyro rate: -0.015 degrees/sec Y-gyro rate: 0.168 degrees/sec Z-gyro rate: -0.038 degrees/sec
X-mag field: -7.26 mG Y-mag field: -9.11 mG Z-mag field: 43.93 mG
Temperature is 26.3 degrees C
X-acceleration: -47.79 mg Y-acceleration: 1.34 mg Z-acceleration: 1001.04 mg
X-gyro rate: -0.008 degrees/sec Y-gyro rate: 0.252 degrees/sec Z-gyro rate: -0.061 degrees/sec
X-mag field: -3.63 mG Y-mag field: -12.75 mG Z-mag field: 33.38 mG
Temperature is 26.3 degrees C
X-acceleration: -46.08 mg Y-acceleration: -1.83 mg Z-acceleration: 998.96 mg
X-gyro rate: 0.008 degrees/sec Y-gyro rate: 0.084 degrees/sec Z-gyro rate: -0.053 degrees/sec
X-mag field: -7.26 mG Y-mag field: -16.39 mG Z-mag field: 47.44 mG
Temperature is 26.3 degrees C
X-acceleration: -44.80 mg Y-acceleration: 1.34 mg Z-acceleration: 998.35 mg
X-gyro rate: -0.061 degrees/sec Y-gyro rate: 0.107 degrees/sec Z-gyro rate: -0.015 degrees/sec
X-mag field: -1.82 mG Y-mag field: -18.22 mG Z-mag field: 24.60 mG
Temperature is 26.3 degrees C
X-acceleration: -48.95 mg Y-acceleration: 2.32 mg Z-acceleration: 998.72 mg
X-gyro rate: -0.092 degrees/sec Y-gyro rate: 0.046 degrees/sec Z-gyro rate: -0.061 degrees/sec
X-mag field: 10.89 mG Y-mag field: -1.82 mG Z-mag field: 15.81 mG
Temperature is 26.3 degrees C
X-acceleration: -47.12 mg Y-acceleration: 1.46 mg Z-acceleration: 999.51 mg
X-gyro rate: -0.038 degrees/sec Y-gyro rate: 0.214 degrees/sec Z-gyro rate: -0.099 degrees/sec
X-mag field: -1.82 mG Y-mag field: -18.22 mG Z-mag field: 35.14 mG
Temperature is 26.3 degrees C
X-acceleration: -45.23 mg Y-acceleration: 1.77 mg Z-acceleration: 1002.93 mg
X-gyro rate: -0.092 degrees/sec Y-gyro rate: 0.069 degrees/sec Z-gyro rate: -0.015 degrees/sec
X-mag field: 7.26 mG Y-mag field: -1.82 mG Z-mag field: 40.41 mG
Temperature is 26.3 degrees C
X-acceleration: -46.88 mg Y-acceleration: 1.10 mg Z-acceleration: 999.39 mg
X-gyro rate: -0.023 degrees/sec Y-gyro rate: 0.015 degrees/sec Z-gyro rate: 0.031 degrees/sec
X-mag field: 9.08 mG Y-mag field: -3.64 mG Z-mag field: 21.09 mG
Temperature is 26.3 degrees C
X-acceleration: -46.26 mg Y-acceleration: -0.18 mg Z-acceleration: 996.58 mg
X-gyro rate: -0.061 degrees/sec Y-gyro rate: 0.191 degrees/sec Z-gyro rate: -0.069 degrees/sec
X-mag field: 0.00 mG Y-mag field: -16.39 mG Z-mag field: 50.96 mG
Temperature is 26.3 degrees C
X-acceleration: -45.23 mg Y-acceleration: 1.77 mg Z-acceleration: 1002.75 mg
X-gyro rate: -0.069 degrees/sec Y-gyro rate: 0.214 degrees/sec Z-gyro rate: -0.069 degrees/sec
X-mag field: -3.63 mG Y-mag field: 5.46 mG Z-mag field: 54.47 mG
Temperature is 26.3 degrees C
X-acceleration: -45.53 mg Y-acceleration: 0.24 mg Z-acceleration: 998.60 mg
X-gyro rate: -0.092 degrees/sec Y-gyro rate: 0.092 degrees/sec Z-gyro rate: 0.031 degrees/sec
X-mag field: -9.08 mG Y-mag field: -18.22 mG Z-mag field: 49.20 mG
Temperature is 26.3 degrees C
X-acceleration: -46.51 mg Y-acceleration: 0.49 mg Z-acceleration: 1000.79 mg
X-gyro rate: -0.122 degrees/sec Y-gyro rate: 0.137 degrees/sec Z-gyro rate: -0.099 degrees/sec
X-mag field: -3.63 mG Y-mag field: -16.39 mG Z-mag field: 57.98 mG
Temperature is 26.3 degrees C
X-acceleration: -47.67 mg Y-acceleration: 2.14 mg Z-acceleration: 1002.08 mg
X-gyro rate: -0.099 degrees/sec Y-gyro rate: 0.046 degrees/sec Z-gyro rate: 0.031 degrees/sec
X-mag field: 0.00 mG Y-mag field: -20.04 mG Z-mag field: 43.93 mG
Temperature is 26.3 degrees C
X-acceleration: -46.81 mg Y-acceleration: 0.73 mg Z-acceleration: 1000.37 mg
X-gyro rate: 0.000 degrees/sec Y-gyro rate: 0.168 degrees/sec Z-gyro rate: 0.000 degrees/sec
X-mag field: 14.53 mG Y-mag field: -20.04 mG Z-mag field: 36.90 mG
Temperature is 26.3 degrees C
X-acceleration: -47.73 mg Y-acceleration: 1.22 mg Z-acceleration: 1003.36 mg
X-gyro rate: 0.008 degrees/sec Y-gyro rate: 0.031 degrees/sec Z-gyro rate: -0.069 degrees/sec
X-mag field: 7.26 mG Y-mag field: -5.46 mG Z-mag field: 36.90 mG
Temperature is 26.3 degrees C


aster
Mon Oct 09, 2017 12:37 pm
about the SPI: before moving to stm i am testing it with an arduino uno
connections:
mpu9250 – arduino
vcc-5v
gnd-gnd
scl- 13
ad0-12
sda-11
ncs-10

i am not convincet by this code:
uint8_t MPU9250::readBytesSPI(uint8_t registerAddress, uint8_t count,
uint8_t * dest)
{
SPI.beginTransaction(SPISettings(SPI_DATA_RATE, MSBFIRST, SPI_MODE));
select();

SPI.transfer(registerAddress | READ_FLAG);

uint8_t i;

for (i = 0; i < count; i++)
{
dest[i] = SPI.transfer(0x00);
#ifdef SERIAL_DEBUG
Serial.print("readBytesSPI::Read byte: 0x");
Serial.println(dest[i], HEX);
#endif
}

SPI.endTransaction();
deselect();

delayMicroseconds(50);

return i; // Return number of bytes written}


stevestrong
Mon Oct 09, 2017 1:27 pm
[aster – Mon Oct 09, 2017 12:37 pm] –
why it begin and end the spi comunication for every few bytes? or is it normal? :?:

Well, define “normal” first… ;)
One can do it if the SPI port is shared with other peripherals. Otherwise is not needed, is enough to do it once in setup() or begin().


aster
Mon Oct 09, 2017 1:51 pm
I meant to use it with only a device, so i could remove all these start/stop!

anyway i spent the last 3 hours trying the spi interface but it is still not working
the problem is in the comunication with the magnetometer AK8963. the library is good when using the i2c but the spi part is bad written
if someone fix it please write here!


stevestrong
Mon Oct 09, 2017 2:04 pm
I cannot see any example code you did try when using SPI. Please post here.
Otherwise we cannot know what and why is not working.

aster
Mon Oct 09, 2017 2:18 pm
i used the example inside the library: https://github.com/sparkfun/SparkFun_MP … RS_SPI.ino (change who i am from 0x71 to 0x73)
and it didn’t work
so i started to modify it cutting all the not necessary pieces but i wasn’t able to have it working anyway
/* MPU9250 Basic Example Code
by: Kris Winer
date: April 1, 2014
license: Beerware - Use this code however you'd like. If you
find it useful you can buy me a beer some time.
Modified by Brent Wilkins January 9, 2016

Demonstrate basic MPU-9250 functionality including parameterizing the register
addresses, initializing the sensor, getting properly scaled accelerometer,
gyroscope, and magnetometer data out. Added display functions to allow display
to on breadboard monitor. Addition of 9 DoF sensor fusion using open source
Madgwick and Mahony filter algorithms. Sketch runs on the 3.3 V 8 MHz Pro Mini.

*/

#include "quaternionFilters.h"
#include "MPU9250.h"
#include "Streaming.h"

#define AHRS true // Set to false for basic data read
#define SERIAL_DEBUG false // Set to true to get Serial output for debugging

MPU9250 myIMU = MPU9250(10); // Using digital pin to for chip select in demo

void setup() {

Serial.begin(115200);
myIMU.begin();

Serial << "is in i2c mode? " << myIMU.isInI2cMode() << newl;

Serial.println("Testing MPU9250::readBytesSPI...");
byte c = 0;
myIMU.readBytes(MPU9250_ADDRESS, WHO_AM_I_MPU9250, 1, &c);
Serial.println(c, HEX); //should be 0x73

if (c == 0x73) {
Serial.println(F("MPU9250 is online..."));

// Start by performing self test and reporting values
myIMU.MPU9250SelfTest(myIMU.selfTest);
Serial.print(F("x-axis self test: acceleration trim within : "));
Serial.print(myIMU.selfTest[0], 1); Serial.println("% of factory value");
Serial.print(F("y-axis self test: acceleration trim within : "));
Serial.print(myIMU.selfTest[1], 1); Serial.println("% of factory value");
Serial.print(F("z-axis self test: acceleration trim within : "));
Serial.print(myIMU.selfTest[2], 1); Serial.println("% of factory value");
Serial.print(F("x-axis self test: gyration trim within : "));
Serial.print(myIMU.selfTest[3], 1); Serial.println("% of factory value");
Serial.print(F("y-axis self test: gyration trim within : "));
Serial.print(myIMU.selfTest[4], 1); Serial.println("% of factory value");
Serial.print(F("z-axis self test: gyration trim within : "));
Serial.print(myIMU.selfTest[5], 1); Serial.println("% of factory value");

// Calibrate gyro and accelerometers, load biases in bias registers
myIMU.calibrateMPU9250(myIMU.gyroBias, myIMU.accelBias);

myIMU.initMPU9250();
// Initialize device for active mode read of acclerometer, gyroscope, and
// temperature
Serial.println("MPU9250 initialized for active data mode....");

//now lets work with the magnetometer
myIMU.ak8963WhoAmI_SPI();
// Set slave address of AK8963 and set AK8963 for read
//myIMU.writeByteSPI(I2C_SLV0_ADDR, AK8963_ADDRESS);
// Set address to start read from
//myIMU.writeByteSPI(I2C_SLV0_REG, WHO_AM_I_AK8963);

byte fd = 0;
myIMU.readBytes(AK8963_ADDRESS, WHO_AM_I_AK8963, 1, &fd);
Serial.println(fd, HEX);

// Read the WHO_AM_I register of the magnetometer, this is a good test of
// communication
byte d = myIMU.readByte(AK8963_ADDRESS, WHO_AM_I_AK8963);
Serial.print("AK8963 ");
Serial.print("I AM 0x");
Serial.print(d, HEX);
Serial.print(" I should be 0x");
Serial.println(0x48, HEX);
/*

if (d != 0x48)
{
// Communication failed, stop here
Serial.println(F("Communication failed, abort!"));
Serial.flush();
abort();
}

// Get magnetometer calibration from AK8963 ROM
myIMU.initAK8963(myIMU.factoryMagCalibration);
// Initialize device for active mode read of magnetometer
Serial.println("AK8963 initialized for active data mode....");

#ifdef SERIAL_DEBUG
// Serial.println("Calibration values: ");
Serial.print("X-Axis factory sensitivity adjustment value ");
Serial.println(myIMU.factoryMagCalibration[0], 2);
Serial.print("Y-Axis factory sensitivity adjustment value ");
Serial.println(myIMU.factoryMagCalibration[1], 2);
Serial.print("Z-Axis factory sensitivity adjustment value ");
Serial.println(myIMU.factoryMagCalibration[2], 2);
#endif // SERIAL_DEBUG

// Get sensor resolutions, only need to do this once
myIMU.getAres();
myIMU.getGres();
myIMU.getMres();

// The next call delays for 4 seconds, and then records about 15 seconds of
// data to calculate bias and scale.
myIMU.magCalMPU9250(myIMU.magBias, myIMU.magScale);
Serial.println("AK8963 mag biases (mG)");
Serial.println(myIMU.magBias[0]);
Serial.println(myIMU.magBias[1]);
Serial.println(myIMU.magBias[2]);

Serial.println("AK8963 mag scale (mG)");
Serial.println(myIMU.magScale[0]);
Serial.println(myIMU.magScale[1]);
Serial.println(myIMU.magScale[2]);
delay(2000); // Add delay to see results before serial spew of data

#ifdef SERIAL_DEBUG
Serial.println("Magnetometer:");
Serial.print("X-Axis sensitivity adjustment value ");
Serial.println(myIMU.factoryMagCalibration[0], 2);
Serial.print("Y-Axis sensitivity adjustment value ");
Serial.println(myIMU.factoryMagCalibration[1], 2);
Serial.print("Z-Axis sensitivity adjustment value ");
Serial.println(myIMU.factoryMagCalibration[2], 2);
#endif // SERIAL_DEBUG

} // if (c == 0x71)
else
{
Serial.print("Could not connect to MPU9250: 0x");
Serial.println(c, HEX);

// Communication failed, stop here
Serial.println(F("Communication failed, abort!"));
Serial.flush();
abort();
}
*/
}
}

void loop()
{ /*
// TODO: Fix these comments not interrupt pin used
// If intPin goes high, all data registers have new data
// On interrupt, check if data ready interrupt
if (myIMU.readByte(MPU9250_ADDRESS, INT_STATUS) & 0x01)
{
myIMU.readAccelData(myIMU.accelCount); // Read the x/y/z adc values

// Now we'll calculate the accleration value into actual g's
// This depends on scale being set
myIMU.ax = (float)myIMU.accelCount[0] * myIMU.aRes; // - myIMU.accelBias[0];
myIMU.ay = (float)myIMU.accelCount[1] * myIMU.aRes; // - myIMU.accelBias[1];
myIMU.az = (float)myIMU.accelCount[2] * myIMU.aRes; // - myIMU.accelBias[2];

myIMU.readGyroData(myIMU.gyroCount); // Read the x/y/z adc values

// Calculate the gyro value into actual degrees per second
// This depends on scale being set
myIMU.gx = (float)myIMU.gyroCount[0] * myIMU.gRes;
myIMU.gy = (float)myIMU.gyroCount[1] * myIMU.gRes;
myIMU.gz = (float)myIMU.gyroCount[2] * myIMU.gRes;

myIMU.readMagData(myIMU.magCount); // Read the x/y/z adc values

// Calculate the magnetometer values in milliGauss
// Include factory calibration per data sheet and user environmental
// corrections
// Get actual magnetometer value, this depends on scale being set
myIMU.mx = (float)myIMU.magCount[0] * myIMU.mRes
myIMU.factoryMagCalibration[0] - myIMU.magBias[0];
myIMU.my = (float)myIMU.magCount[1] * myIMU.mRes
myIMU.factoryMagCalibration[1] - myIMU.magBias[1];
myIMU.mz = (float)myIMU.magCount[2] * myIMU.mRes
myIMU.factoryMagCalibration[2] - myIMU.magBias[2];
} // if (readByte(MPU9250_ADDRESS, INT_STATUS) & 0x01)

// Must be called before updating quaternions!
myIMU.updateTime();

// Sensors x (y)-axis of the accelerometer is aligned with the y (x)-axis of
// the magnetometer; the magnetometer z-axis (+ down) is opposite to z-axis
// (+ up) of accelerometer and gyro! We have to make some allowance for this
// orientationmismatch in feeding the output to the quaternion filter. For the
// MPU-9250, we have chosen a magnetic rotation that keeps the sensor forward
// along the x-axis just like in the LSM9DS0 sensor. This rotation can be
// modified to allow any convenient orientation convention. This is ok by
// aircraft orientation standards! Pass gyro rate as rad/s
MahonyQuaternionUpdate(myIMU.ax, myIMU.ay, myIMU.az, myIMU.gx * DEG_TO_RAD,
myIMU.gy * DEG_TO_RAD, myIMU.gz * DEG_TO_RAD, myIMU.my,
myIMU.mx, myIMU.mz, myIMU.deltat);

if (!AHRS)
{
myIMU.delt_t = millis() - myIMU.count;
if (myIMU.delt_t > 500)
{
#ifdef SERIAL_DEBUG
// Print acceleration values in milligs!
Serial.print("X-acceleration: "); Serial.print(1000 * myIMU.ax);
Serial.print(" mg ");
Serial.print("Y-acceleration: "); Serial.print(1000 * myIMU.ay);
Serial.print(" mg ");
Serial.print("Z-acceleration: "); Serial.print(1000 * myIMU.az);
Serial.println(" mg ");

// Print gyro values in degree/sec
Serial.print("X-gyro rate: "); Serial.print(myIMU.gx, 3);
Serial.print(" degrees/sec ");
Serial.print("Y-gyro rate: "); Serial.print(myIMU.gy, 3);
Serial.print(" degrees/sec ");
Serial.print("Z-gyro rate: "); Serial.print(myIMU.gz, 3);
Serial.println(" degrees/sec");

// Print mag values in degree/sec
Serial.print("X-mag field: "); Serial.print(myIMU.mx);
Serial.print(" mG ");
Serial.print("Y-mag field: "); Serial.print(myIMU.my);
Serial.print(" mG ");
Serial.print("Z-mag field: "); Serial.print(myIMU.mz);
Serial.println(" mG");

myIMU.tempCount = myIMU.readTempData(); // Read the adc values
// Temperature in degrees Centigrade
myIMU.temperature = ((float) myIMU.tempCount) / 333.87 + 21.0;
// Print temperature in degrees Centigrade
Serial.print("Temperature is "); Serial.print(myIMU.temperature, 1);
Serial.println(" degrees C");
#endif // SERIAL_DEBUG

myIMU.count = millis();
} // if (myIMU.delt_t > 500)
} // if (!AHRS)
else
{
// Serial print and/or display at 0.5 s rate independent of data rates
myIMU.delt_t = millis() - myIMU.count;

// update LCD once per half-second independent of read rate
if (myIMU.delt_t > 500)
{
#ifdef SERIAL_DEBUG
Serial.print("ax = "); Serial.print((int)1000 * myIMU.ax);
Serial.print(" ay = "); Serial.print((int)1000 * myIMU.ay);
Serial.print(" az = "); Serial.print((int)1000 * myIMU.az);
Serial.println(" mg");

Serial.print("gx = "); Serial.print(myIMU.gx, 2);
Serial.print(" gy = "); Serial.print(myIMU.gy, 2);
Serial.print(" gz = "); Serial.print(myIMU.gz, 2);
Serial.println(" deg/s");

Serial.print("mx = "); Serial.print((int)myIMU.mx);
Serial.print(" my = "); Serial.print((int)myIMU.my);
Serial.print(" mz = "); Serial.print((int)myIMU.mz);
Serial.println(" mG");

Serial.print("q0 = "); Serial.print(*getQ());
Serial.print(" qx = "); Serial.print(*(getQ() + 1));
Serial.print(" qy = "); Serial.print(*(getQ() + 2));
Serial.print(" qz = "); Serial.println(*(getQ() + 3));
#endif // SERIAL_DEBUG

// Define output variables from updated quaternion---these are Tait-Bryan
// angles, commonly used in aircraft orientation. In this coordinate system,
// the positive z-axis is down toward Earth. Yaw is the angle between Sensor
// x-axis and Earth magnetic North (or true North if corrected for local
// declination, looking down on the sensor positive yaw is counterclockwise.
// Pitch is angle between sensor x-axis and Earth ground plane, toward the
// Earth is positive, up toward the sky is negative. Roll is angle between
// sensor y-axis and Earth ground plane, y-axis up is positive roll. These
// arise from the definition of the homogeneous rotation matrix constructed
// from quaternions. Tait-Bryan angles as well as Euler angles are
// non-commutative; that is, the get the correct orientation the rotations
// must be applied in the correct order which for this configuration is yaw,
// pitch, and then roll.
// For more see
// http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
// which has additional links.
myIMU.yaw = atan2(2.0f * (*(getQ() + 1) * *(getQ() + 2) + *getQ()
* *(getQ() + 3)), *getQ() * *getQ() + * (getQ() + 1)
* *(getQ() + 1) - * (getQ() + 2) * *(getQ() + 2) - * (getQ() + 3)
* *(getQ() + 3));
myIMU.pitch = -asin(2.0f * (*(getQ() + 1) * *(getQ() + 3) - *getQ()
* *(getQ() + 2)));
myIMU.roll = atan2(2.0f * (*getQ() * *(getQ() + 1) + * (getQ() + 2)
* *(getQ() + 3)), *getQ() * *getQ() - * (getQ() + 1)
* *(getQ() + 1) - * (getQ() + 2) * *(getQ() + 2) + * (getQ() + 3)
* *(getQ() + 3));
myIMU.pitch *= RAD_TO_DEG;
myIMU.yaw *= RAD_TO_DEG;

// Declination of SparkFun Electronics (40°05'26.6"N 105°11'05.9"W) is
// 8° 30' E ± 0° 21' (or 8.5°) on 2016-07-19
// - http://www.ngdc.noaa.gov/geomag-web/#declination
myIMU.yaw -= 8.5;
myIMU.roll *= RAD_TO_DEG;

#ifdef SERIAL_DEBUG
Serial.print("Yaw, Pitch, Roll: ");
Serial.print(myIMU.yaw, 2);
Serial.print(", ");
Serial.print(myIMU.pitch, 2);
Serial.print(", ");
Serial.println(myIMU.roll, 2);

Serial.print("rate = ");
Serial.print((float)myIMU.sumCount / myIMU.sum, 2);
Serial.println(" Hz");
#endif // SERIAL_DEBUG

// With these settings the filter is updating at a ~145 Hz rate using the
// Madgwick scheme and >200 Hz using the Mahony scheme even though the
// display refreshes at only 2 Hz. The filter update rate is determined
// mostly by the mathematical steps in the respective algorithms, the
// processor speed (8 MHz for the 3.3V Pro Mini), and the magnetometer ODR:
// an ODR of 10 Hz for the magnetometer produce the above rates, maximum
// magnetometer ODR of 100 Hz produces filter update rates of 36 - 145 and
// ~38 Hz for the Madgwick and Mahony schemes, respectively. This is
// presumably because the magnetometer read takes longer than the gyro or
// accelerometer reads. This filter update rate should be fast enough to
// maintain accurate platform orientation for stabilization control of a
// fast-moving robot or quadcopter. Compare to the update rate of 200 Hz
// produced by the on-board Digital Motion Processor of Invensense's MPU6050
// 6 DoF and MPU9150 9DoF sensors. The 3.3 V 8 MHz Pro Mini is doing pretty
// well!

myIMU.count = millis();
myIMU.sumCount = 0;
myIMU.sum = 0;
} // if (myIMU.delt_t > 500)
} // if (AHRS)
*/
}


stevestrong
Mon Oct 09, 2017 3:45 pm
I still cannot see where do you use the SPI port.
And what exactly is not working? Have you connected the MPU chip to SPI port pins?

aster
Mon Oct 09, 2017 5:07 pm
i use spi every time i call “readBytes”
anyway the problem is with the library itself not with the spi communication

Leave a Reply

Your email address will not be published. Required fields are marked *