kriswiner / MPU6050

Basic MPU6050 Arduino sketch of sensor function
715 stars 190 forks source link

Direction for the compass inside Ublox M8N Gps. #58

Open saumik02 opened 3 months ago

saumik02 commented 3 months ago

which direction should i mount the GPS . What is the relation to the axis of mpu6050?

saumik02 commented 3 months ago

The GPS has a inbuilt HMC5883l compass in it 20210610_185012-min

saumik02 commented 3 months ago

image

kriswiner commented 3 months ago

No idea about the M8N, best ask UBLOX

On Wed, Jun 19, 2024 at 1:10 PM saumik02 @.***> wrote:

image.png (view on web) https://github.com/kriswiner/MPU6050/assets/169164356/181e1045-c04c-4f33-8a26-bdae6fa321fe

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU6050/issues/58#issuecomment-2179399004, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKTYJURN3DHGTRSECCTZIHQSLAVCNFSM6AAAAABJST5DCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZZGM4TSMBQGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

saumik02 commented 3 months ago

I have solved that issue. But I am getting the Euler angle. Is it right? Then what are the formulae for converting it to a direction vector? By the way, I am making a filter using UKF using your quaternion.

saumik02 commented 3 months ago

I am using the NED frame as a reference. I am giving you some ss of my results. Please, guide me to the right path. From left yaw>pitch>roll. When the X-axis is pointing north. Screenshot (28)

when the X-axis is pointing West. Screenshot (29)

when the X-axis is pointing South. Screenshot (30)

when the X-axis pointing east. Screenshot (31)

kriswiner commented 3 months ago

This is not looking correct to me. If the sensor is laying flat on a table, the pitch and roll shouldn't change as you rotate the sensor but the yaw or heading should change by ~90 degrees when the sensor is rotated by 90 degrees, etc.

My guess is that the sensors (accel, gyro, and mag) are not properly calibrated.

On Tue, Jun 25, 2024 at 10:50 PM saumik02 @.***> wrote:

I am using the NED frame as a reference. I am giving you some ss of my results. Please, guide me to the right path. From left yaw>roll>pitch. When the X-axis is pointing north. image.png (view on web) https://github.com/kriswiner/MPU6050/assets/169164356/5c58c400-dbcc-4862-89c5-949dc2bc766c

when the X-axis is pointing West. Screenshot.29.png (view on web) https://github.com/kriswiner/MPU6050/assets/169164356/a58f611d-6f1b-481a-8360-d0d2a5eb42b0

when the X-axis is pointing South. Screenshot.30.png (view on web) https://github.com/kriswiner/MPU6050/assets/169164356/1f2f39c8-e59b-48b6-bc55-31ffb7a66813

when the X-axis pointing east. Screenshot.31.png (view on web) https://github.com/kriswiner/MPU6050/assets/169164356/99f04f4f-0c08-4b07-a9ca-e99f21348b4d

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU6050/issues/58#issuecomment-2190762920, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKWG5AWN7742IRG4UIDZJJJDTAVCNFSM6AAAAABJST5DCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJQG43DEOJSGA . You are receiving this because you commented.Message ID: @.***>

saumik02 commented 3 months ago

Can I have a picture of your setup for this filter? It may be helpful for me to understand my sensor orientation is right or wrong.

kriswiner commented 3 months ago

I haven't used the MPU6050 for more than five years and I am not using the MAX M8N so I am not able to help you with a picture of my "setup".

I would recommend you check the basic sensor output data.

At rest and flat on a table, the accel should output 0, 0, 1000 milligs, the gyro should output 0, 0, 0 millidps, and the mag should output whatever is expected for your location (for me in California I expect 0.2, 0.1, and 0.4 Gauss), where the total magnetic field should be ~0.5 Gauss. You can look up what to expect for the local magnetic field using the government geological website or some such. Errors on these should be ~1% or less

Anyway, until you can get these basic sensor results, the fusion filter and Euler angles are irrelevant.

On Wed, Jun 26, 2024 at 9:53 AM saumik02 @.***> wrote:

Can I have a picture of your setup for this filter? It may be helpful for me to understand my sensor orientation is right or wrong.

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU6050/issues/58#issuecomment-2192198662, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKWRQMQ6ONVRCCQRCWLZJLWYPAVCNFSM6AAAAABJST5DCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGE4TQNRWGI . You are receiving this because you commented.Message ID: @.***>