Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

25/11/2019 Using MPU 9250 IMU in vertical orientation

User Name Password Log in Help Register


Remember Me?

What's New? Forum

New Posts FAQ Calendar Community Forum Actions Quick Links Advanced Search

Forum Main Category Technical Support & Questions


Using MPU 9250 IMU in vertical orientation

Forum Rule: Always post complete source code & details to reproduce any
issue!

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages, select the forum that
you want to visit from the selection below.

Results 1 to 3 of 3

Thread: Using MPU 9250 IMU in vertical orientation

Thread Tools Search Thread Display

02-14-2018, 05:26 AM #1

ITS_vk
Using MPU 9250 IMU in vertical orientation
Junior Member
Join Date: Jan 2018 Hi everyone !
Posts: 8 iam trying to use MPU 9250 IMU in vertical position i.e in
90 degree position with respect to ground for my project.
In this position the y-axis of accelerometer and gyroscope
is perpendicular to the ground. Currently iam getting
incorrect reading from the IMU. it is working fine when i
keep it flat on the ground. iam using Kris winer's code
available on github. i tried the following to change the
default axes orientation but it did not work.

Code:
MahonyQuaternionUpdate(ax, -az, ay, gx*PI/180.0f,

kris has used the following order of parameters to pass to


filter.

Code:
MahonyQuaternionUpdate(ax, ay, az, gx*PI/180.0f,

Here is the full code


Code:
/* MPU9250 Basic Example Code
by: Kris Winer
date: April 1, 2014
license: Beerware - Use this code however you'd
find it useful you can buy me a beer some time.

Hardware setup:
MPU9250 Breakout --------- Teensy 3.6
VDD ---------------------- 3.3V
VDDI --------------------- 3.3V
SDA ----------------------- A4

https://forum.pjrc.com/threads/49749-Using-MPU-9250-IMU-in-vertical-orientation?highlight=magnetometer 1/3
25/11/2019 Using MPU 9250 IMU in vertical orientation
SCL ----------------------- A5
GND ---------------------- GND
Note: The MPU9250 is an I2C sensor and uses the
Because the sensor is not 5V tolerant, we are us
We have disabled the internal pull-ups used by t
We are also using the 400 kHz fast I2C mode by s
*/
//#include "Wire.h"
#include <i2c_t3.h>
// See also MPU-9250 Register Map and Description
// above document; the MPU9250 and MPU9150 are vi
//
//Magnetometer Registers
#define AK8963_ADDRESS 0x0C
#define AK8963_WHO_AM_I 0x00 // should return 0x
#define AK8963_INFO 0x01
#define AK8963 ST1 0x02 // data ready stat

Please help me out with it, thanks;

Reply With Quote

02-14-2018, 08:15 AM #2

WMXZ
Originally Posted by ITS_vk
Senior Member
Hi everyone !
Join Date: Jul 2014
iam trying to use MPU 9250 IMU in vertical position
Posts: 2,373
i.e in 90 degree position with respect to ground for
my project. In this position the y-axis of
accelerometer and gyroscope is perpendicular to the
ground. Currently iam getting incorrect reading from
the IMU. it is working fine when i keep it flat on the
ground. iam using Kris winer's code available on
github. i tried the following to change the default
axes orientation but it did not work.
what means incorrect data?

can you provide some printouts, preferable raw values


1) when you turn the IMU (around vertical axis) while flat
on table
2) when you turn the IMU (around the y axis) while y-axis
is pointing up.

The sensors should be 3d sensors and therefore work in all


orientations.
If the raw data behave good, then the IMU software has
some issues.

Reply With Quote

02-14-2018, 08:49 AM #3

ITS_vk Hi WMXZ,
Thanks for replying quickly !. I will give you the raw values
Junior Member
you asked for very shortly because iam not having the
Join Date: Jan 2018
equipment right now, but in the mean time can you please
Posts: 8
tell me is there anything wrong with the code ?

Reply With Quote

Quick Navigation Technical Support & Questions Top

https://forum.pjrc.com/threads/49749-Using-MPU-9250-IMU-in-vertical-orientation?highlight=magnetometer 2/3
25/11/2019 Using MPU 9250 IMU in vertical orientation

« Previous Thread | Next Thread »

Posting Permissions
You may not post new BB code is On
threads Smilies are On
You may not post replies [IMG] code is On
You may not post [VIDEO] code is
attachments On
You may not edit your HTML code is Off
posts
Forum Rules

-- Default Style PJRC Electronic Projects Archive Top

All times are GMT. The time now is 06:24 AM.

Powered by vBulletin® Version 4.2.2


Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.

https://forum.pjrc.com/threads/49749-Using-MPU-9250-IMU-in-vertical-orientation?highlight=magnetometer 3/3

You might also like