kriswiner/MPU9250

Yaw values are not precise

taiebzbaiba opened this issue · 9 comments

Hi kris , I can't get precise yaw values on my mpu-9250 , I'm using Madgwick filter for sensor fusion , I tried changing sample rates parameters yet yaw values seem to drift for low sample rates values and for high sample rate I lose so much precision .

I tend to calibrate my sensors by measuring biases everytime I connect the device and as for how I test it is I put my sensor on a certain position for a while , measure offsets so it becomes my zero , do random movements and rotations and then put the sensor back into that zero position .

And how do you calibrate the mag?

On Thu, Jun 29, 2023 at 9:20 AM Taieb Zbaiba @.> wrote: I tend to calibrate my sensors by measuring biases everytime I connect the device and as for how I test it is I put my sensor on a certain position for a while , measure offsets so it becomes my zero , do random movements and rotations and then put the sensor back into that zero position . — Reply to this email directly, view it on GitHub <#489 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKV66QFTT6C4Y4OVQ2TXNWTL3ANCNFSM6AAAAAAZYEON2Q . You are receiving this because you commented.Message ID: @.>

I collect mag data for about 15 seconds , I rotate my sensor in every axis , I measure average mag biases and scale values in each axe based on collected data then store them for the main program

The next thing to check is what orientation convention are you using? NED or ENU? Are you passing the scaled sensor data to the Madgwick algorithm in the proper order for one of these? On Thu, Jun 29, 2023 at 9:49 AM Tlera Corporation @.> wrote:

And how do you calibrate the mag? On Thu, Jun 29, 2023 at 9:20 AM Taieb Zbaiba @.
> wrote: > I tend to calibrate my sensors by measuring biases everytime I connect > the device and as for how I test it is I put my sensor on a certain > position for a while , measure offsets so it becomes my zero , do random > movements and rotations and then put the sensor back into that zero > position . > > — > Reply to this email directly, view it on GitHub > <#489 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/ABTDLKV66QFTT6C4Y4OVQ2TXNWTL3ANCNFSM6AAAAAAZYEON2Q > . > You are receiving this because you commented.Message ID: > @.***> >

I guess you're referring to this issue #368 , I am passing these as parameters for my madgwick algorithm , I tried removing the (-) from mz out of curiosity and it gives way worse values. madgwick(ax, ay, az, gx, gy, gz, mx, my, -mz, q);

I tried ENU and NED , ENU seems to be more working for me , NED more drifty and I lose the origine (the zero value orientation)
the problem for me is that for small angles it works decently , for big angles like 90 i get 130 , (always for yaw values)
Although I modified all sample rates , low pass filters according to your suggestion . As far the processor I'm working with ESP32-C3 32-bit RISC-V @160MHz.