kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.04k stars 471 forks source link

MPU9250 will be placed vertically #247

Open Jan-Jelle opened 6 years ago

Jan-Jelle commented 6 years ago

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

kriswiner commented 6 years ago

You will need to change the NED or NEU feed to the Madgwick filter accordingly, and calibrate in the vertical position but this is all straightforward.

On Sat, Mar 17, 2018 at 12:53 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkOD0UWE--rWJs1JtuK3vJqLzXKGks5tfMEAgaJpZM4Sutei .

Jan-Jelle commented 6 years ago

Hi Kris,

Thanks for the reply. I need to change the pitch in both 90 degrees down and rotate it 90 degrees. I thought the key was in the registers 19 to 24 which are gyro offsets, but these i don't have to change then?

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: Kris Winer notifications@github.com Datum: 17-03-18 17:05 (GMT+01:00) Aan: kriswiner/MPU9250 MPU9250@noreply.github.com Cc: Jan-Jelle jan-jelle@hotmail.com, Author author@noreply.github.com Onderwerp: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

You will need to change the NED or NEU feed to the Madgwick filter accordingly, and calibrate in the vertical position but this is all straightforward.

On Sat, Mar 17, 2018 at 12:53 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkOD0UWE--rWJs1JtuK3vJqLzXKGks5tfMEAgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/kriswiner/MPU9250/issues/247#issuecomment-373931405, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjlUp1oWOHtQd987ZnI7ck8J22ntLJUKks5tfTQ6gaJpZM4Sutei.

kriswiner commented 6 years ago

Gyro offset have to be measured.

On Sat, Mar 17, 2018 at 11:01 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

Thanks for the reply. I need to change the pitch in both 90 degrees down and rotate it 90 degrees. I thought the key was in the registers 19 to 24 which are gyro offsets, but these i don't have to change then?

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: Kris Winer notifications@github.com Datum: 17-03-18 17:05 (GMT+01:00) Aan: kriswiner/MPU9250 MPU9250@noreply.github.com Cc: Jan-Jelle jan-jelle@hotmail.com, Author author@noreply.github.com Onderwerp: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

You will need to change the NED or NEU feed to the Madgwick filter accordingly, and calibrate in the vertical position but this is all straightforward.

On Sat, Mar 17, 2018 at 12:53 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkOD0UWE-- rWJs1JtuK3vJqLzXKGks5tfMEAgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373931405, or mute the thread< https://github.com/notifications/unsubscribe-auth/ AjlUp1oWOHtQd987ZnI7ck8J22ntLJUKks5tfTQ6gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373940267, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qox8SYyD280P1ClY2yqhixjVgoJwks5tfU-AgaJpZM4Sutei .

Jan-Jelle commented 6 years ago

Could you help me out with this in the call for the quaternions function? I am not an experienced programmer, maybe you can point me in the right direction. What do I need to change in this part?

MahonyQuaternionUpdate(ax, ay, az, gxPI/180.0f, gyPI/180.0f, gz*PI/180.0f, my, mx, mz);

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 7:05:44 PM To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

Gyro offset have to be measured.

On Sat, Mar 17, 2018 at 11:01 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

Thanks for the reply. I need to change the pitch in both 90 degrees down and rotate it 90 degrees. I thought the key was in the registers 19 to 24 which are gyro offsets, but these i don't have to change then?

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: Kris Winer notifications@github.com Datum: 17-03-18 17:05 (GMT+01:00) Aan: kriswiner/MPU9250 MPU9250@noreply.github.com Cc: Jan-Jelle jan-jelle@hotmail.com, Author author@noreply.github.com Onderwerp: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

You will need to change the NED or NEU feed to the Madgwick filter accordingly, and calibrate in the vertical position but this is all straightforward.

On Sat, Mar 17, 2018 at 12:53 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkOD0UWE-- rWJs1JtuK3vJqLzXKGks5tfMEAgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373931405, or mute the thread< https://github.com/notifications/unsubscribe-auth/ AjlUp1oWOHtQd987ZnI7ck8J22ntLJUKks5tfTQ6gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373940267, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qox8SYyD280P1ClY2yqhixjVgoJwks5tfU-AgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/kriswiner/MPU9250/issues/247#issuecomment-373940586, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjlUp0O8D_SYVeOb7f4LfNDT5EUCu0Ofks5tfVB4gaJpZM4Sutei.

kriswiner commented 6 years ago

These functions expect the sensor data in come conventionl form, like NED or ENU, so it has to be consistent for your application. If mounted vertically, then Down will likely be the x- or y- axis instead of the z-axis, etc.

On Sat, Mar 17, 2018 at 1:43 PM, Jan-Jelle notifications@github.com wrote:

Could you help me out with this in the call for the quaternions function? I am not an experienced programmer, maybe you can point me in the right direction. What do I need to change in this part?

MahonyQuaternionUpdate(ax, ay, az, gxPI/180.0f, gyPI/180.0f, gz*PI/180.0f, my, mx, mz);

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 7:05:44 PM To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

Gyro offset have to be measured.

On Sat, Mar 17, 2018 at 11:01 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

Thanks for the reply. I need to change the pitch in both 90 degrees down and rotate it 90 degrees. I thought the key was in the registers 19 to 24 which are gyro offsets, but these i don't have to change then?

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: Kris Winer notifications@github.com Datum: 17-03-18 17:05 (GMT+01:00) Aan: kriswiner/MPU9250 MPU9250@noreply.github.com Cc: Jan-Jelle jan-jelle@hotmail.com, Author <author@noreply.github.com

Onderwerp: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

You will need to change the NED or NEU feed to the Madgwick filter accordingly, and calibrate in the vertical position but this is all straightforward.

On Sat, Mar 17, 2018 at 12:53 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkOD0UWE-- rWJs1JtuK3vJqLzXKGks5tfMEAgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373931405, or mute the thread< https://github.com/notifications/unsubscribe-auth/ AjlUp1oWOHtQd987ZnI7ck8J22ntLJUKks5tfTQ6gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373940267 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qox8SYyD280P1ClY2yqhixjVgoJwks5tfU-AgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373940586, or mute the thread< https://github.com/notifications/unsubscribe-auth/AjlUp0O8D_ SYVeOb7f4LfNDT5EUCu0Ofks5tfVB4gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373951200, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qo1r7cOBW49xMK4b46qYE14hHdj6ks5tfXWKgaJpZM4Sutei .

Jan-Jelle commented 6 years ago

So just swapping location correspondingly in the mahoney function call’s arguments? And does this only count for the gyro values, or all values?

I’m only reading pitch and roll with this sensor.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 9:45:44 PM To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

These functions expect the sensor data in come conventionl form, like NED or ENU, so it has to be consistent for your application. If mounted vertically, then Down will likely be the x- or y- axis instead of the z-axis, etc.

On Sat, Mar 17, 2018 at 1:43 PM, Jan-Jelle notifications@github.com wrote:

Could you help me out with this in the call for the quaternions function? I am not an experienced programmer, maybe you can point me in the right direction. What do I need to change in this part?

MahonyQuaternionUpdate(ax, ay, az, gxPI/180.0f, gyPI/180.0f, gz*PI/180.0f, my, mx, mz);

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 7:05:44 PM To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

Gyro offset have to be measured.

On Sat, Mar 17, 2018 at 11:01 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

Thanks for the reply. I need to change the pitch in both 90 degrees down and rotate it 90 degrees. I thought the key was in the registers 19 to 24 which are gyro offsets, but these i don't have to change then?

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: Kris Winer notifications@github.com Datum: 17-03-18 17:05 (GMT+01:00) Aan: kriswiner/MPU9250 MPU9250@noreply.github.com Cc: Jan-Jelle jan-jelle@hotmail.com, Author <author@noreply.github.com

Onderwerp: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

You will need to change the NED or NEU feed to the Madgwick filter accordingly, and calibrate in the vertical position but this is all straightforward.

On Sat, Mar 17, 2018 at 12:53 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkOD0UWE-- rWJs1JtuK3vJqLzXKGks5tfMEAgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373931405, or mute the thread< https://github.com/notifications/unsubscribe-auth/ AjlUp1oWOHtQd987ZnI7ck8J22ntLJUKks5tfTQ6gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373940267 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qox8SYyD280P1ClY2yqhixjVgoJwks5tfU-AgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373940586, or mute the thread< https://github.com/notifications/unsubscribe-auth/AjlUp0O8D_ SYVeOb7f4LfNDT5EUCu0Ofks5tfVB4gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373951200, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qo1r7cOBW49xMK4b46qYE14hHdj6ks5tfXWKgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/kriswiner/MPU9250/issues/247#issuecomment-373951305, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjlUp3T6BWsqxxZDzz8mY19niTBAEnSaks5tfXX4gaJpZM4Sutei.

kriswiner commented 6 years ago

Consisten NED or ENU for all sensors.

On Sat, Mar 17, 2018 at 2:04 PM, Jan-Jelle notifications@github.com wrote:

So just swapping location correspondingly in the mahoney function call’s arguments? And does this only count for the gyro values, or all values?

I’m only reading pitch and roll with this sensor.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 9:45:44 PM

To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

These functions expect the sensor data in come conventionl form, like NED or ENU, so it has to be consistent for your application. If mounted vertically, then Down will likely be the x- or y- axis instead of the z-axis, etc.

On Sat, Mar 17, 2018 at 1:43 PM, Jan-Jelle notifications@github.com wrote:

Could you help me out with this in the call for the quaternions function? I am not an experienced programmer, maybe you can point me in the right direction. What do I need to change in this part?

MahonyQuaternionUpdate(ax, ay, az, gxPI/180.0f, gyPI/180.0f, gz*PI/180.0f, my, mx, mz);

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 7:05:44 PM To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

Gyro offset have to be measured.

On Sat, Mar 17, 2018 at 11:01 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

Thanks for the reply. I need to change the pitch in both 90 degrees down and rotate it 90 degrees. I thought the key was in the registers 19 to 24 which are gyro offsets, but these i don't have to change then?

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: Kris Winer notifications@github.com Datum: 17-03-18 17:05 (GMT+01:00) Aan: kriswiner/MPU9250 MPU9250@noreply.github.com Cc: Jan-Jelle jan-jelle@hotmail.com, Author < author@noreply.github.com

Onderwerp: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

You will need to change the NED or NEU feed to the Madgwick filter accordingly, and calibrate in the vertical position but this is all straightforward.

On Sat, Mar 17, 2018 at 12:53 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkOD0UWE-- rWJs1JtuK3vJqLzXKGks5tfMEAgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373931405, or mute the thread< https://github.com/notifications/unsubscribe-auth/ AjlUp1oWOHtQd987ZnI7ck8J22ntLJUKks5tfTQ6gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU9250/issues/247# issuecomment-373940267 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qox8SYyD280P1ClY2yqhixjVgoJwks5tfU-AgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373940586, or mute the thread< https://github.com/notifications/unsubscribe-auth/AjlUp0O8D_ SYVeOb7f4LfNDT5EUCu0Ofks5tfVB4gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373951200 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qo1r7cOBW49xMK4b46qYE14hHdj6ks5tfXWKgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373951305, or mute the thread< https://github.com/notifications/unsubscribe-auth/ AjlUp3T6BWsqxxZDzz8mY19niTBAEnSaks5tfXX4gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373952516, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qvcQuSVSwLMhpb421bOQkm-XLHNwks5tfXpmgaJpZM4Sutei .

Jan-Jelle commented 6 years ago

Thanks a bunch 😊 had to try a few posibilities but I got it all working smoothly. Much appreciated!

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 10:08:56 PM To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

Consisten NED or ENU for all sensors.

On Sat, Mar 17, 2018 at 2:04 PM, Jan-Jelle notifications@github.com wrote:

So just swapping location correspondingly in the mahoney function call’s arguments? And does this only count for the gyro values, or all values?

I’m only reading pitch and roll with this sensor.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 9:45:44 PM

To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

These functions expect the sensor data in come conventionl form, like NED or ENU, so it has to be consistent for your application. If mounted vertically, then Down will likely be the x- or y- axis instead of the z-axis, etc.

On Sat, Mar 17, 2018 at 1:43 PM, Jan-Jelle notifications@github.com wrote:

Could you help me out with this in the call for the quaternions function? I am not an experienced programmer, maybe you can point me in the right direction. What do I need to change in this part?

MahonyQuaternionUpdate(ax, ay, az, gxPI/180.0f, gyPI/180.0f, gz*PI/180.0f, my, mx, mz);

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Kris Winer notifications@github.com Sent: Saturday, March 17, 2018 7:05:44 PM To: kriswiner/MPU9250 Cc: Jan-Jelle; Author Subject: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

Gyro offset have to be measured.

On Sat, Mar 17, 2018 at 11:01 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

Thanks for the reply. I need to change the pitch in both 90 degrees down and rotate it 90 degrees. I thought the key was in the registers 19 to 24 which are gyro offsets, but these i don't have to change then?

Verzonden vanaf mijn Samsung Galaxy-smartphone.

-------- Oorspronkelijk bericht -------- Van: Kris Winer notifications@github.com Datum: 17-03-18 17:05 (GMT+01:00) Aan: kriswiner/MPU9250 MPU9250@noreply.github.com Cc: Jan-Jelle jan-jelle@hotmail.com, Author < author@noreply.github.com

Onderwerp: Re: [kriswiner/MPU9250] MPU9250 will be placed vertically (#247)

You will need to change the NED or NEU feed to the Madgwick filter accordingly, and calibrate in the vertical position but this is all straightforward.

On Sat, Mar 17, 2018 at 12:53 AM, Jan-Jelle notifications@github.com wrote:

Hi Kris,

I was wondering if you could tell me how to set the offsets if i tilt the sensor 90 degrees down. I will mount the thing vertical in an enclosed box which will go subsea. this position needs to be "horizontal". is this even possible? i can set my offsets at the surface as well but since Eulers angles start acting funny at those angles my measurement are off.

Much appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkOD0UWE-- rWJs1JtuK3vJqLzXKGks5tfMEAgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373931405, or mute the thread< https://github.com/notifications/unsubscribe-auth/ AjlUp1oWOHtQd987ZnI7ck8J22ntLJUKks5tfTQ6gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU9250/issues/247# issuecomment-373940267 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qox8SYyD280P1ClY2yqhixjVgoJwks5tfU-AgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373940586, or mute the thread< https://github.com/notifications/unsubscribe-auth/AjlUp0O8D_ SYVeOb7f4LfNDT5EUCu0Ofks5tfVB4gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373951200 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qo1r7cOBW49xMK4b46qYE14hHdj6ks5tfXWKgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ kriswiner/MPU9250/issues/247#issuecomment-373951305, or mute the thread< https://github.com/notifications/unsubscribe-auth/ AjlUp3T6BWsqxxZDzz8mY19niTBAEnSaks5tfXX4gaJpZM4Sutei>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-373952516, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qvcQuSVSwLMhpb421bOQkm-XLHNwks5tfXpmgaJpZM4Sutei .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/kriswiner/MPU9250/issues/247#issuecomment-373952760, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjlUp4Qg0JpQilC4Z2VIqT7vCdgN7igjks5tfXtogaJpZM4Sutei.

DatNotData commented 4 years ago

@Jan-Jelle Have you managed to get a successful "rearrangement" of the x, y, z when you input it into the MahonyQuaternionUpdate function? I've tried a couple of "combinations" and haven't been successful yet.

I've also tried to play with the part where the gravity is removed from the accelerometer bias calculation to be on the right axis.

kriswiner commented 4 years ago

Try NED convention, this should work for all fusion algorithms...

On Wed, Aug 12, 2020 at 8:11 PM Dat Ha notifications@github.com wrote:

@Jan-Jelle https://github.com/Jan-Jelle Have you managed to get a successful "rearrangement" of the x, y, z when you input it into the MahonyQuaternionUpdate function? I've tried a couple of "combinations" and haven't been successful yet.

I've also tried to play with the part where the gravity is removed from the accelerometer bias calculation to be on the right axis.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-673223445, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKWWMFFGHAUDL52EJPDSANKV3ANCNFSM4EV226RA .

DatNotData commented 4 years ago

I tried, but the gravity component is removed from the z-axis only. Do I need to change that to the Y-axis (my new vertical axis). Are there also other things like that that needs to be changed also?

kriswiner commented 4 years ago

I don't understand your comment.

The Madgwick or Mahoney fusion algorithms expect data in the form of NED, aN, aE, aD, gN, gE, gD, mN, mE, mD. select which accel axis you want to point North and then everything else should be determined. For the MPU9250, accel and gyro axes are the same, but not the same as mag axes...

On Sun, Aug 16, 2020 at 5:23 PM Dat Ha notifications@github.com wrote:

I tried, but the gravity component is removed from the z-axis only. Do I need to change that to the Y-axis (my new vertical axis). Are there also other things like that that needs to be changed also?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-674599141, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKSHIFN54HQSW7DNX43SBBZ6ZANCNFSM4EV226RA .

DatNotData commented 4 years ago

I understand that I need to input data in the form of NED, but would I need to change lines such as this one also:

if(accel_bias[2] > 0L) {accel_bias[2] -= (int32_t) accelsensitivity;}  // Remove gravity from the z-axis accelerometer bias calculation
else {accel_bias[2] += (int32_t) accelsensitivity;}

The question therefore is, since gravity is acting on another axis of the IMU, do I need to modify any other lines?

kriswiner commented 4 years ago

No. Not for the fusion algorithm.

But yes, if you are going to do the accel calibration with the board other than flat on the table.

On Sun, Aug 16, 2020 at 5:40 PM Dat Ha notifications@github.com wrote:

I understand that I need to input data in the form of NED, but would I need to change lines such as this one also:

if(accel_bias[2] > 0L) {accel_bias[2] -= (int32_t) accelsensitivity;} // Remove gravity from the z-axis accelerometer bias calculation else {accel_bias[2] += (int32_t) accelsensitivity;}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/247#issuecomment-674601969, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKUOOGS2WMTSLYKJOADSBB36XANCNFSM4EV226RA .