Open phase1 opened 10 years ago
Whilst holding the device on the same plane at all times?
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:58 PM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
The mag response surface is 3D. Move it any way you want as long as you sample all of the quasi-spherical shape of the 3D response surface for the best accuracy.
OK, dumb version:
Imaging the response surface is a flabby beachball and your mag is inside of it. Your job is to move it limited at the origin such that the imaginary vector perpendicular (up or down vector) to the top of the mag sensor sweeps out as much of the inside surface of the beach ball as you can in the time alloted for the calibration. Move the mag such that the imaginary vector sweeps all around, in all possible directions, don't leave anything out.
On Sat, Jan 14, 2017 at 7:47 PM, tim77777 notifications@github.com wrote:
Yes I read it, and I have read it many times before also. But I don’t get the figure 8. Do you move it in a figure 8 in all directions?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:45 PM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
I see you did not read the material at the link.
You have to sample the entire 3D response surface in order to properly recenter it on the origin and respherize it.
On Sat, Jan 14, 2017 at 7:41 PM, tim77777 notifications@github.com wrote:
Ok, well thanks for all that. Bit beyond me I’m afraid.
But I do understand what you mean by “if you calibrate the magnetometer only in a plane it is not surprising to me that when you move out of the plane you get nonsense.”
But I cannot get it to work any other way than by spinning in a circle to calibrate it. How exactly is the figure eight supposed to go? I mean which direction or directions?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:29 PM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
The axes are not aligned for the MPU9250. Use a NED scheme.
On Sat, Jan 14, 2017 at 7:20 PM, tim77777 notifications@github.com wrote:
Hi,
Would you be able to help me out with the formula for magnetic e-compass tilt compensation. Assuming that the magnetometer and accelerometer’s axes are aligned ( as with the LSM303D device), the formula is -
Compensated_x = mx cos(pitch) + mz sin(pitch);
Compensated_y = mx sin(roll) sin(pitch) + my cos(roll) - mz sin(roll) * cos(pitch);
However, being that the axes of the magnetometer in the MPU9250 are not aligned with the accelerometer, how would the formula change.
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:03 PM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
I don't understand what you are doing here, but if you calibrate the magnetometer only in a plane it is not surprising to me that when you move out of the plane you get nonsense. There is nothing wrong with the datasheet.
I am using either Madgwick or Mahony open-source sensor fusion which with proper calibration can provide absolute 3D orientation estimation using MPU950 data with pitch and roll accurate to a degree or so and heading accurate to 4 degrees or so.
If what you are attempting can do the same or better it might be worth figuring out where it is going wrong. If not, I would switch to something that makes more sense.
I have no idea what you mean by tilt compensation. It looks like you are just depending on the accelerometer for pitch and roll. Why, I cannot understand.
On Sat, Jan 14, 2017 at 6:07 PM, tim77777 notifications@github.com wrote:
Hi,
For the magnetometer I was using mx = (float)magne_xmRes magCalibration[0]
- magBias[0]; I rotate the device in a circle. Figure 8 does not work, so I rotate it on a spinning seat. I can then read 0 – 360 degrees in a circle. I am including hard iron offsets, but not soft iron offsets. I am not factoring in magnetic declination because exact north is not relevant to this application, rather I simply need 0 – 360 degrees around a circle. To save time I am now using pre-calculated offsets. E.g. mx = (float)magne_x 1.28785 1.218 - 238;
For the pitch and roll angles I am not using quaternions or using a filter combining the gyro and accelerometer, but rather I am just using the raw accelerometer values
pitch = atan(-accele_x / sqrt(accele_y accele_y + accele_z accele_z));
roll = atan(accele_y / sqrt(accele_x accele_x + accele_z accele_z));
I am not doing any calibration for the accelerometer, but the readings are close to 0 – 2048 from flat to a right angle.
and that’s about it. The pitch and roll are in radians and seem to be about correct reading from 0 – 1.57 when the device is raised from flat to a right angle.
I am having to negate the X axis acceleration which seems wrong compared to the datasheet, but produces the correct positive values when rotating anti-clockwise around the accelerometer axes.
Why that is, is a mystery to me. I mean my read acceleration values are the opposite polarity when compared to the data sheet. Should be positive when rotating anti-clockwise, but my program shows it as negative. I wonder if the data sheet is wrong?
Anyway so the bottom line is that my compensated heading is way off and the values change significantly when tilted.
Have you implemented magnetic tilt compensation for the MPU9250?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 3:43 AM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
How do you calibrate your sensors?
On Sat, Jan 14, 2017 at 3:16 AM, tim77777 notifications@github.com wrote:
Hi,
I am using a MPU9250 with a microchip controller and although I have most things working I have been unable to get magnetic e-compass tilt compensation to work. I have been looking at various code examples. However, I cannot find any code specifically for the MPU9250 that implements tilt compensation. And with the magnetometer and accelerometer of the 9250 having their X & Y axes exchanged, and the Z axis having its polarity exchanged, any code out there, such as for the HMC5883L, does not exactly match. Although I should be able to change the code to suit the axes and polarity, I have been unable to make it work.
Most examples use something like the following code for tilt compensation
Compensated_x = mxcos(pitch) + mysin(roll)sin(pitch) + mzcos(roll)*sin(pitch);
Compensated_ y = mycos(roll) - mzsin(roll);
compensated_heading = atan2( (double) Compensated_x, (double) Compensated_y ) * 57.2958;
if(compensated_heading < 0) { compensated_heading += 360;}
if(compensated_heading > 360){ compensated_heading -= 360;}
I thought I could simply swap the mx & my about, and negate mz, but it does not seem to be that simple.
I have derived mx, my & mz from your code
mx = (float)magne_xmResmagCalibration[0] - magBias[0];
my = (float)magne_ymResmagCalibration[1] - magBias[1];
mz = (float)magne_zmResmagCalibration[2] - magBias[2];
and when the device is lying flat the heading is correct. But when tilted it is way off. I have tried every which way of changing this code around to try and match the axes and polarity of the magnetometer versus the accelerometer, but without success. I am beginning to think that perhaps my pitch and roll are incorrect, or something else. And so I am wondering if the MPU9250 code of yours for the Arduino implements e-compass tilt compensation, so that I can compare code. I can’t see that it does, but I am wondering.
Regards
Tim
I have been looking at your code
From: Kris Winer [mailto:notifications@github.com] Sent: Saturday, January 14, 2017 10:54 AM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
What's that?
On Fri, Jan 13, 2017 at 3:46 PM, tim77777 < notifications@github.com> wrote:
hi, do you have magnetic tilt compensation in your code?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272578372 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qlRAD2qGj8AvNp2W0o2uDmfW3UsWks5rSAzbgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272579341> , or mute the thread https://github.com/notifications/unsubscribe- auth/AXcUIVF-wBJhssLWhyLxbvNBE8H6iiJGks5rSA6GgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272617759 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qoKFXNBYrZRJT79DZxUafkr7LNYZks5rSK5_gaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272635726> , or mute the thread https://github.com/notifications/unsubscribe- auth/ AXcUIeN8tvlgqqKJ3IQRi1cH1Wkn6cfdks5rSPsBgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272668107 , or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qnEfP- K2dwFy8iCs23cI1H-HvtPMks5rSX9LgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272670111> , or mute the thread https://github.com/notifications/unsubscribe- auth/AXcUIYs_lqAUefBXJx-FXmFEUmqkxT8Fks5rSYxkgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272670709 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qi92tasrcHBYZvowbTp63hbOvNv0ks5rSZB0gaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272670993> , or mute the thread https://github.com/notifications/unsubscribe-auth/ AXcUIaKNj5idek2pCRIPt0TtwLt6qV8Uks5rSZJ-gaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671412, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qhoKDPhWyFXdkLMy4jH92s-0B7Glks5rSZWEgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671510> , or mute the thread https://github.com/notifications/unsubscribe- auth/AXcUIXaKoSGY2AHZIjd--9dtM51inxgoks5rSZZEgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671585, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qh0DCBv1HzKTjuO82EQcg-hSd5h8ks5rSZbAgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671973 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXcUIdaOu7SjVSaZibOFVk2zpr8Why-nks5rSZk-gaJpZM4CEl0o .Description: Image removed by sender.
No, all possible 3D orientations
On Sat, Jan 14, 2017 at 9:02 PM, tim77777 notifications@github.com wrote:
Whilst holding the device on the same plane at all times?
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:58 PM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
The mag response surface is 3D. Move it any way you want as long as you sample all of the quasi-spherical shape of the 3D response surface for the best accuracy.
OK, dumb version:
Imaging the response surface is a flabby beachball and your mag is inside of it. Your job is to move it limited at the origin such that the imaginary vector perpendicular (up or down vector) to the top of the mag sensor sweeps out as much of the inside surface of the beach ball as you can in the time alloted for the calibration. Move the mag such that the imaginary vector sweeps all around, in all possible directions, don't leave anything out.
On Sat, Jan 14, 2017 at 7:47 PM, tim77777 notifications@github.com wrote:
Yes I read it, and I have read it many times before also. But I don’t get the figure 8. Do you move it in a figure 8 in all directions?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:45 PM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
I see you did not read the material at the link.
You have to sample the entire 3D response surface in order to properly recenter it on the origin and respherize it.
On Sat, Jan 14, 2017 at 7:41 PM, tim77777 notifications@github.com wrote:
Ok, well thanks for all that. Bit beyond me I’m afraid.
But I do understand what you mean by “if you calibrate the magnetometer only in a plane it is not surprising to me that when you move out of the plane you get nonsense.”
But I cannot get it to work any other way than by spinning in a circle to calibrate it. How exactly is the figure eight supposed to go? I mean which direction or directions?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:29 PM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
The axes are not aligned for the MPU9250. Use a NED scheme.
On Sat, Jan 14, 2017 at 7:20 PM, tim77777 notifications@github.com wrote:
Hi,
Would you be able to help me out with the formula for magnetic e-compass tilt compensation. Assuming that the magnetometer and accelerometer’s axes are aligned ( as with the LSM303D device), the formula is -
Compensated_x = mx cos(pitch) + mz sin(pitch);
Compensated_y = mx sin(roll) sin(pitch) + my cos(roll) - mz sin(roll) * cos(pitch);
However, being that the axes of the magnetometer in the MPU9250 are not aligned with the accelerometer, how would the formula change.
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:03 PM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
I don't understand what you are doing here, but if you calibrate the magnetometer only in a plane it is not surprising to me that when you move out of the plane you get nonsense. There is nothing wrong with the datasheet.
I am using either Madgwick or Mahony open-source sensor fusion which with proper calibration can provide absolute 3D orientation estimation using MPU950 data with pitch and roll accurate to a degree or so and heading accurate to 4 degrees or so.
If what you are attempting can do the same or better it might be worth figuring out where it is going wrong. If not, I would switch to something that makes more sense.
I have no idea what you mean by tilt compensation. It looks like you are just depending on the accelerometer for pitch and roll. Why, I cannot understand.
On Sat, Jan 14, 2017 at 6:07 PM, tim77777 notifications@github.com wrote:
Hi,
For the magnetometer I was using mx = (float)magne_xmRes magCalibration[0]
- magBias[0]; I rotate the device in a circle. Figure 8 does not work, so I rotate it on a spinning seat. I can then read 0 – 360 degrees in a circle. I am including hard iron offsets, but not soft iron offsets. I am not factoring in magnetic declination because exact north is not relevant to this application, rather I simply need 0 – 360 degrees around a circle. To save time I am now using pre-calculated offsets. E.g. mx = (float)magne_x 1.28785 1.218 - 238;
For the pitch and roll angles I am not using quaternions or using a filter combining the gyro and accelerometer, but rather I am just using the raw accelerometer values
pitch = atan(-accele_x / sqrt(accele_y accele_y + accele_z accele_z));
roll = atan(accele_y / sqrt(accele_x accele_x + accele_z accele_z));
I am not doing any calibration for the accelerometer, but the readings are close to 0 – 2048 from flat to a right angle.
and that’s about it. The pitch and roll are in radians and seem to be about correct reading from 0 – 1.57 when the device is raised from flat to a right angle.
I am having to negate the X axis acceleration which seems wrong compared to the datasheet, but produces the correct positive values when rotating anti-clockwise around the accelerometer axes.
Why that is, is a mystery to me. I mean my read acceleration values are the opposite polarity when compared to the data sheet. Should be positive when rotating anti-clockwise, but my program shows it as negative. I wonder if the data sheet is wrong?
Anyway so the bottom line is that my compensated heading is way off and the values change significantly when tilted.
Have you implemented magnetic tilt compensation for the MPU9250?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 3:43 AM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
How do you calibrate your sensors?
On Sat, Jan 14, 2017 at 3:16 AM, tim77777 < notifications@github.com> wrote:
Hi,
I am using a MPU9250 with a microchip controller and although I have most things working I have been unable to get magnetic e-compass tilt compensation to work. I have been looking at various code examples. However, I cannot find any code specifically for the MPU9250 that implements tilt compensation. And with the magnetometer and accelerometer of the 9250 having their X & Y axes exchanged, and the Z axis having its polarity exchanged, any code out there, such as for the HMC5883L, does not exactly match. Although I should be able to change the code to suit the axes and polarity, I have been unable to make it work.
Most examples use something like the following code for tilt compensation
Compensated_x = mxcos(pitch) + mysin(roll)sin(pitch) + mzcos(roll)*sin(pitch);
Compensated_ y = mycos(roll) - mzsin(roll);
compensated_heading = atan2( (double) Compensated_x, (double) Compensated_y ) * 57.2958;
if(compensated_heading < 0) { compensated_heading += 360;}
if(compensated_heading > 360){ compensated_heading -= 360;}
I thought I could simply swap the mx & my about, and negate mz, but it does not seem to be that simple.
I have derived mx, my & mz from your code
mx = (float)magne_xmResmagCalibration[0] - magBias[0];
my = (float)magne_ymResmagCalibration[1] - magBias[1];
mz = (float)magne_zmResmagCalibration[2] - magBias[2];
and when the device is lying flat the heading is correct. But when tilted it is way off. I have tried every which way of changing this code around to try and match the axes and polarity of the magnetometer versus the accelerometer, but without success. I am beginning to think that perhaps my pitch and roll are incorrect, or something else. And so I am wondering if the MPU9250 code of yours for the Arduino implements e-compass tilt compensation, so that I can compare code. I can’t see that it does, but I am wondering.
Regards
Tim
I have been looking at your code
From: Kris Winer [mailto:notifications@github.com] Sent: Saturday, January 14, 2017 10:54 AM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
What's that?
On Fri, Jan 13, 2017 at 3:46 PM, tim77777 < notifications@github.com> wrote:
hi, do you have magnetic tilt compensation in your code?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272578372 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qlRAD2qGj8AvNp2W0o2uDmfW3UsWks5rSAzbgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272579341> , or mute the thread https://github.com/ notifications/unsubscribe- auth/AXcUIVF-wBJhssLWhyLxbvNBE8H6iiJGks5rSA6GgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272617759 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qoKFXNBYrZRJT79DZxUafkr7LNYZks5rSK5_gaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272635726> , or mute the thread https://github.com/notifications/unsubscribe- auth/ AXcUIeN8tvlgqqKJ3IQRi1cH1Wkn6cfdks5rSPsBgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272668107 , or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qnEfP- K2dwFy8iCs23cI1H-HvtPMks5rSX9LgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272670111> , or mute the thread https://github.com/notifications/unsubscribe- auth/AXcUIYs_lqAUefBXJx-FXmFEUmqkxT8Fks5rSYxkgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272670709 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qi92tasrcHBYZvowbTp63hbOvNv0ks5rSZB0gaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272670993> , or mute the thread https://github.com/notifications/unsubscribe-auth/ AXcUIaKNj5idek2pCRIPt0TtwLt6qV8Uks5rSZJ-gaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671412 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qhoKDPhWyFXdkLMy4jH92s-0B7Glks5rSZWEgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671510> , or mute the thread https://github.com/notifications/unsubscribe- auth/AXcUIXaKoSGY2AHZIjd--9dtM51inxgoks5rSZZEgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671585, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qh0DCBv1HzKTjuO82EQcg-hSd5h8ks5rSZbAgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671973> , or mute the thread https://github.com/notifications/unsubscribe-auth/ AXcUIdaOu7SjVSaZibOFVk2zpr8Why-nks5rSZk-gaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272674073, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkiCsX9Z5lkrAtJAZCzSYwhBAbnGks5rSahwgaJpZM4CEl0o .
I see. Thanks Maybe then my tilt compensation might work. All three orientations around all portions of a spherical shape sounds like it might take 20 – 30 seconds. Is that correct? If so, no worries, I’ll give it a go.
What does an i-phone have in it that enables a relatively quick and simple rotation pattern for e-compass calibration. I mean it doesn’t seem like a complete sphere needs to be covered and it only takes a few seconds?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 4:35 PM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
No, all possible 3D orientations
On Sat, Jan 14, 2017 at 9:02 PM, tim77777 notifications@github.com wrote:
Whilst holding the device on the same plane at all times?
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:58 PM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
The mag response surface is 3D. Move it any way you want as long as you sample all of the quasi-spherical shape of the 3D response surface for the best accuracy.
OK, dumb version:
Imaging the response surface is a flabby beachball and your mag is inside of it. Your job is to move it limited at the origin such that the imaginary vector perpendicular (up or down vector) to the top of the mag sensor sweeps out as much of the inside surface of the beach ball as you can in the time alloted for the calibration. Move the mag such that the imaginary vector sweeps all around, in all possible directions, don't leave anything out.
On Sat, Jan 14, 2017 at 7:47 PM, tim77777 notifications@github.com wrote:
Yes I read it, and I have read it many times before also. But I don’t get the figure 8. Do you move it in a figure 8 in all directions?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:45 PM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
I see you did not read the material at the link.
You have to sample the entire 3D response surface in order to properly recenter it on the origin and respherize it.
On Sat, Jan 14, 2017 at 7:41 PM, tim77777 notifications@github.com wrote:
Ok, well thanks for all that. Bit beyond me I’m afraid.
But I do understand what you mean by “if you calibrate the magnetometer only in a plane it is not surprising to me that when you move out of the plane you get nonsense.”
But I cannot get it to work any other way than by spinning in a circle to calibrate it. How exactly is the figure eight supposed to go? I mean which direction or directions?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:29 PM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
The axes are not aligned for the MPU9250. Use a NED scheme.
On Sat, Jan 14, 2017 at 7:20 PM, tim77777 notifications@github.com wrote:
Hi,
Would you be able to help me out with the formula for magnetic e-compass tilt compensation. Assuming that the magnetometer and accelerometer’s axes are aligned ( as with the LSM303D device), the formula is -
Compensated_x = mx cos(pitch) + mz sin(pitch);
Compensated_y = mx sin(roll) sin(pitch) + my cos(roll) - mz sin(roll) * cos(pitch);
However, being that the axes of the magnetometer in the MPU9250 are not aligned with the accelerometer, how would the formula change.
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 2:03 PM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
I don't understand what you are doing here, but if you calibrate the magnetometer only in a plane it is not surprising to me that when you move out of the plane you get nonsense. There is nothing wrong with the datasheet.
I am using either Madgwick or Mahony open-source sensor fusion which with proper calibration can provide absolute 3D orientation estimation using MPU950 data with pitch and roll accurate to a degree or so and heading accurate to 4 degrees or so.
If what you are attempting can do the same or better it might be worth figuring out where it is going wrong. If not, I would switch to something that makes more sense.
I have no idea what you mean by tilt compensation. It looks like you are just depending on the accelerometer for pitch and roll. Why, I cannot understand.
On Sat, Jan 14, 2017 at 6:07 PM, tim77777 notifications@github.com wrote:
Hi,
For the magnetometer I was using mx = (float)magne_xmRes magCalibration[0]
- magBias[0]; I rotate the device in a circle. Figure 8 does not work, so I rotate it on a spinning seat. I can then read 0 – 360 degrees in a circle. I am including hard iron offsets, but not soft iron offsets. I am not factoring in magnetic declination because exact north is not relevant to this application, rather I simply need 0 – 360 degrees around a circle. To save time I am now using pre-calculated offsets. E.g. mx = (float)magne_x 1.28785 1.218 - 238;
For the pitch and roll angles I am not using quaternions or using a filter combining the gyro and accelerometer, but rather I am just using the raw accelerometer values
pitch = atan(-accele_x / sqrt(accele_y accele_y + accele_z accele_z));
roll = atan(accele_y / sqrt(accele_x accele_x + accele_z accele_z));
I am not doing any calibration for the accelerometer, but the readings are close to 0 – 2048 from flat to a right angle.
and that’s about it. The pitch and roll are in radians and seem to be about correct reading from 0 – 1.57 when the device is raised from flat to a right angle.
I am having to negate the X axis acceleration which seems wrong compared to the datasheet, but produces the correct positive values when rotating anti-clockwise around the accelerometer axes.
Why that is, is a mystery to me. I mean my read acceleration values are the opposite polarity when compared to the data sheet. Should be positive when rotating anti-clockwise, but my program shows it as negative. I wonder if the data sheet is wrong?
Anyway so the bottom line is that my compensated heading is way off and the values change significantly when tilted.
Have you implemented magnetic tilt compensation for the MPU9250?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 3:43 AM
To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
How do you calibrate your sensors?
On Sat, Jan 14, 2017 at 3:16 AM, tim77777 < notifications@github.com> wrote:
Hi,
I am using a MPU9250 with a microchip controller and although I have most things working I have been unable to get magnetic e-compass tilt compensation to work. I have been looking at various code examples. However, I cannot find any code specifically for the MPU9250 that implements tilt compensation. And with the magnetometer and accelerometer of the 9250 having their X & Y axes exchanged, and the Z axis having its polarity exchanged, any code out there, such as for the HMC5883L, does not exactly match. Although I should be able to change the code to suit the axes and polarity, I have been unable to make it work.
Most examples use something like the following code for tilt compensation
Compensated_x = mxcos(pitch) + mysin(roll)sin(pitch) + mzcos(roll)*sin(pitch);
Compensated_ y = mycos(roll) - mzsin(roll);
compensated_heading = atan2( (double) Compensated_x, (double) Compensated_y ) * 57.2958;
if(compensated_heading < 0) { compensated_heading += 360;}
if(compensated_heading > 360){ compensated_heading -= 360;}
I thought I could simply swap the mx & my about, and negate mz, but it does not seem to be that simple.
I have derived mx, my & mz from your code
mx = (float)magne_xmResmagCalibration[0] - magBias[0];
my = (float)magne_ymResmagCalibration[1] - magBias[1];
mz = (float)magne_zmResmagCalibration[2] - magBias[2];
and when the device is lying flat the heading is correct. But when tilted it is way off. I have tried every which way of changing this code around to try and match the axes and polarity of the magnetometer versus the accelerometer, but without success. I am beginning to think that perhaps my pitch and roll are incorrect, or something else. And so I am wondering if the MPU9250 code of yours for the Arduino implements e-compass tilt compensation, so that I can compare code. I can’t see that it does, but I am wondering.
Regards
Tim
I have been looking at your code
From: Kris Winer [mailto:notifications@github.com] Sent: Saturday, January 14, 2017 10:54 AM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
What's that?
On Fri, Jan 13, 2017 at 3:46 PM, tim77777 < notifications@github.com> wrote:
hi, do you have magnetic tilt compensation in your code?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272578372 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qlRAD2qGj8AvNp2W0o2uDmfW3UsWks5rSAzbgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272579341> , or mute the thread https://github.com/ notifications/unsubscribe- auth/AXcUIVF-wBJhssLWhyLxbvNBE8H6iiJGks5rSA6GgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272617759 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qoKFXNBYrZRJT79DZxUafkr7LNYZks5rSK5_gaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272635726> , or mute the thread https://github.com/notifications/unsubscribe- auth/ AXcUIeN8tvlgqqKJ3IQRi1cH1Wkn6cfdks5rSPsBgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272668107 , or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qnEfP- K2dwFy8iCs23cI1H-HvtPMks5rSX9LgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272670111> , or mute the thread https://github.com/notifications/unsubscribe- auth/AXcUIYs_lqAUefBXJx-FXmFEUmqkxT8Fks5rSYxkgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2# issuecomment-272670709 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qi92tasrcHBYZvowbTp63hbOvNv0ks5rSZB0gaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272670993> , or mute the thread https://github.com/notifications/unsubscribe-auth/ AXcUIaKNj5idek2pCRIPt0TtwLt6qV8Uks5rSZJ-gaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671412 , or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qhoKDPhWyFXdkLMy4jH92s-0B7Glks5rSZWEgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671510> , or mute the thread https://github.com/notifications/unsubscribe- auth/AXcUIXaKoSGY2AHZIjd--9dtM51inxgoks5rSZZEgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671585, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGY1qh0DCBv1HzKTjuO82EQcg-hSd5h8ks5rSZbAgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272671973> , or mute the thread https://github.com/notifications/unsubscribe-auth/ AXcUIdaOu7SjVSaZibOFVk2zpr8Why-nks5rSZk-gaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272674073, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkiCsX9Z5lkrAtJAZCzSYwhBAbnGks5rSahwgaJpZM4CEl0o .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272675050 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXcUIaIqHwX1fa4C5GTHZvZ91B-T8v84ks5rSa_tgaJpZM4CEl0o .Description: Image removed by sender.
Depends on the kind of accuracy you are looking for. But 20 - 30 seconds would seems about right to me. Of course, unless the temperature or environment changes a lot, you only need to do this once, or at least infrequently.
Hi, so now I am taking 256 samples in a spherical fashion but I am getting what seems like largely varying figures each time I do it.
x, y, z
497, 609, 456
563, 603, 661
403, 907, 272
503, 641, 418
624, 686, 351
415, 800, 376
420, 609, 456
What do you think about that?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 6:45 PM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
Depends on the kind of accuracy you are looking for. But 20 - 30 seconds would seems about right to me. Of course, unless the temperature or environment changes a lot, you only need to do this once, or at least infrequently.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272679608 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXcUIZIt-xFHV8VcZWxmaBUBbGd-HVzlks5rSc6MgaJpZM4CEl0o .Description: Image removed by sender.
Best way to check mag calibration is to plot Mx vs Mz, then Mx vs My, then My vs Mz from data collected while moving the mag all around like in calibration. Do you get a cloud of points arranged in a circulat shape centered on the origin? If yes, your mag is well calibrated. If not, you have more work to do.
On Sun, Jan 15, 2017 at 3:00 AM, tim77777 notifications@github.com wrote:
Hi, so now I am taking 256 samples in a spherical fashion but I am getting what seems like largely varying figures each time I do it.
x, y, z
497, 609, 456
563, 603, 661
403, 907, 272
503, 641, 418
624, 686, 351
415, 800, 376
420, 609, 456
What do you think about that?
Regards
Tim
From: Kris Winer [mailto:notifications@github.com] Sent: Sunday, January 15, 2017 6:45 PM To: kriswiner/MPU-9250 Cc: tim77777; Comment Subject: Re: [kriswiner/MPU-9250] Doesn't seem to be working (#2)
Depends on the kind of accuracy you are looking for. But 20 - 30 seconds would seems about right to me. Of course, unless the temperature or environment changes a lot, you only need to do this once, or at least infrequently.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272679608> , or mute the thread https://github.com/notifications/unsubscribe- auth/AXcUIZIt-xFHV8VcZWxmaBUBbGd-HVzlks5rSc6MgaJpZM4CEl0o .Description: Image removed by sender.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272687902, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qt-AX9FEcDCd7bPuGMf9oT8h0-oYks5rSfxLgaJpZM4CEl0o .
Hi All, I started some evaluation/implementation I didn't finish some time ago of an elipsoid fit algo for calibration of the magnetometer. Does anyone has successfully implemented it on a MCU? I am asking this because it takes quite some ressources going through the fitting algo (matrixes computation with eigen vectors research,etc.). Ideally it would allow a straight forward approach by turning the sensor in all direction till enough samples are taken to establish the ellipsoid to ideal sphere response (more details on the net....). Thanks.
There is an example for Paul's prop shield on the Teensy forum, ask there.
On Sun, Jan 15, 2017 at 3:06 PM, floflofloflo notifications@github.com wrote:
Hi All, I started some evaluation/implementation I didn't finish some time ago of an elipsoid fit algo for calibration of the magnetometer. Does anyone has successfully implemented it on a MCU? I am asking this because it takes quite some ressources going through the fitting algo (matrixes computation with eigen vectors research,etc.). Ideally it would allow a straight forward approach by turning the sensor in all direction till enough samples are taken to establish the ellipsoid to ideal sphere response (more details on the net....). Thanks.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-272745448, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qh_qfsiKQODrn_0_LoTikcYZvTdKks5rSqZYgaJpZM4CEl0o .
Thanks Kris I will check
Hi Kris
I really like the work you are doing! Your docs are beautifully written.
I have a similar problem as the original poster at the top of this page. The quaternion I get from the madgwick algo's MadgwickAHRSupdate function behaves perfectly along the roll and pitch axis, but doesn't work well at all for yaw. Strangely it seems to always converge to a fixed yaw angle. No matter what yaw position you turn the PCB to, it will always converge back to the same fix yaw. The speed of the convergence can be made faster by using large values of beta and slower with low beta values.
I have calibrated the mag data using your averaging method. I also tried to use the soft iron calibration per your docs. With no luck.
I have also calibrated the gyros, with stationary values. Gyros are scaled correctly.
I am generating the gyro, accel and mag samples at 300Hz sample rate, which is what I configured the madgwick filter to use.
The mag values appear okay. When I try to visualise the mag vector in the world coordinates, it seems to point to a more/less fixed location, regardless of the orientation of the sensor. Which is what you would expect, as you move the sensor around the location of magnetic north doesn't change. It wobbles a bit with the sensor movement but that's fine. This suggests to me the mag data is good.
Similarly visualising the accel vector in the world coordinates is most of the time pointing downwards. This is less precise than the mag vector, I guess due to acceleration caused by moving the sensor along the other axis.
Everything seems to be fine and yet my issue, I think I must be missing something obvious. Any ideas please?
When using the MadgwickAHRSupdateIMU function, i.e. the one that doesn't take mag values, the convergence to a fixed yaw goes away as expected. But obviously the quaternion's precision along yaw axis isn't great.
I am using mpu9250. I just added some more info on a related thread at: https://github.com/kriswiner/MPU-9250/issues/25
thanks
Michael
"I am generating the gyro, accel and mag samples at 300Hz sample rate, which is what I configured the madgwick filter to use."
This is a problem. You will never get convergence of these kinds of steepest-descent algorithms unless the fusion rate is 4-5x the gyro sample rate. You will likely have to move to an ARM CORTEX M4F processor to get adequate fusion results, assuming your calibration and sensor are up to the task.
On Wed, May 3, 2017 at 5:33 AM, mpava notifications@github.com wrote:
Hi Kris
I really like the work you are doing! Your docs are beautifully written.
I have a similar problem as the original poster at the top of this page. The quaternion I get from the madgwick ago's MadgwickAHRSupdate function behaves perfectly along the roll and pitch axis, but doesn't work well at all for yaw. Strangely it seems to always converge to a fixed yaw angle. No matter what yaw position you turn the PCB to, it will always converge back to the same fix yaw. The speed of the convergence can be made faster by using large values of beta and slower with low beta values.
I have calibrated the mag data using your averaging method. I also tried to use the soft iron calibration per your docs. With no luck.
I have also calibrated the gyros, with stationary values. Gyros are scaled correctly.
I am generating the gyro, accel and mag samples at 300Hz sample rate, which is what I configured the madgwick filter to use.
The mag values appear okay. When I try to visualise the mag vector in the world coordinates, it seems to point to a more/less fixed location, regardless of the orientation of the sensor. Which is what you would expect, as you move the sensor around the location of magnetic north doesn't change. It wobbles a bit with the sensor movement but that's fine. This suggests to me the mag data is good.
Similarly visualising the accel vector in the world coordinates is most of the time pointing downwards. This is less precise than the mag vector, I guess due to acceleration caused by moving the sensor along the other axis.
Everything seems to be fine and yet my issue, I think I must be missing something obvious. Any ideas please?
When using the MadgwickAHRSupdate function, i.e. the one that doesn't take mag values, the convergence to a fixed yaw goes away as expected. But obviously the quaternion's precision along yaw axis isn't great.
I am using mpu9250.
thanks
Michael
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-298897447, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qp7q87iIMsp6KStY0E33o3wmEiHIks5r2HQAgaJpZM4CEl0o .
Hi Kris,
Thanks for your quick response! As a quick test I called the madgwick function 4 times for each sample with exactly the same inputs. Then I quadrupled the sample frequency variable in the madgwick code. No luck. The issue doesn't go away. I guess that's what I have to do to have the algo working at a higher frequency than the sample freq. I also tried increasing the frequency 6 fold with no difference.
I will do some more thinking and testing and try your other suggestions you mentioned on ticket no 25.
Thanks again
Michael
OK, I am not sure what you are doing exactly, but I just verified using this sketch:
https://github.com/kriswiner/Butterfly/blob/master/MPU9250_MS5637_BasicAHRS2_Butterfly.ino
and my MPU9250 breakout board:
https://www.tindie.com/products/onehorse/mpu9250-teensy-3x-add-on-shields/?pt=full_prod_search
that after just running through the short calibration in the sketch (motionless and flat for gyro and accel, figure eight for mag) that I get stable yaw that returns to the same value no matter the motion when the device returns to the same position, the yaw is independent of pitch and roll up to +/- 85 degrees or so and otherwise the orientation behaves as I would expect. I ran it at 5 Madgwick fusion iterations per data read and 10 fusion iterations, the latter at 1600 Hz which should be more than enough for convergence. Everything behaves as I would expect, no surprises. On turning the breadboard 90 degrees I get 90 +/- 10 degree changes in heading. This is a known problem due to soft iron corrections needed in the magnetic response surface and the fact that my laptop is nearby, etc. With a more complete mag calibration even these deviations would go away.
So I cannot understand why you cannot reproduce these results with your set up. What's the difference?
Hi Kris, Hope you are well! Its been a while since we last spoke. We have made much progress and customers are using our device with good results! We have run into one issue with step counts on the MPU9250 that I was hoping you may have some insights on. In general we are getting very inaccurate step counts and we think it maybe because we put the MP aggressively into low power mode. I was under the impression that the accelerometer would still count steps even in low power mode but it seems that i snot the case. We are only get step counts when the DMP is running and chip does not seem to track steps by itself while only accel is up and rest of chip in low power mode.
Do you have any thoughts or insights on how best we should approach the issue of accurate step counts and still have some ability to put the chip into low power mode?
Thank you for your help!
Satish
Satish Movva Founder & CEO CarePredict, Inc. 324 S. University Drive, Plantation, FL 33324 E: smovva@carepredict.com P: +1 (800) 608-7188 x500 L: www.linkedin.com/in/satishmovva/ www: www.carepredict.com
On Sat, May 6, 2017 at 12:33 PM, Kris Winer notifications@github.com wrote:
OK, I am not sure what you are doing exactly, but I just verified using this sketch:
https://github.com/kriswiner/Butterfly/blob/master/MPU9250_ MS5637_BasicAHRS2_Butterfly.ino
and my MPU9250 breakout board:
https://www.tindie.com/products/onehorse/mpu9250- teensy-3x-add-on-shields/?pt=full_prod_search
that after just running through the short calibration in the sketch (motionlass and flat for gyro and accel, figure eight for mag) that I get stable yaw that returns to the same value no matter the motion when the device returns to the same position, the yaw is independent of pitch and roll up to +/- 85 degrees or so and otherwise the orientation behaves as I would expect. I ran it at 5 Madgwick fusion iterations per data read and 10 fusion iterations, the latter at 1600 Hz which should be more than enough for convergence. Everything behaves as I would expect, no surprises. On turning the breaboard 90 degrees I get 90 +/0 10 degree changes in heading. This is a known problem due to soft iron corrections in the magnetic response surface and the fact that my laptop is nearby, etc. With a more complete mag calibration even these deviations would go away.
So I cannot understand why you cannot reproduce these results with your set up. What's the difference?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-299651109, or mute the thread https://github.com/notifications/unsubscribe-auth/AGrVCoQ2XBGUaLquh_p-ENejB9Gp6Hgyks5r3KDbgaJpZM4CEl0o .
My understanding is that step counting relies on a step counting algorithm int he DMP. If you want to do step counting outsideof the DMP, you have to set an appropriate accleration threshold and write somw code to tally when the accel detects excursions above this threshold and increment a counter. In other words, you have to create a step counting algorithm with accel in the low power mode when not using the DMP.
On Mon, Jun 5, 2017 at 8:24 AM, satishmovva notifications@github.com wrote:
Hi Kris, Hope you are well! Its been a while since we last spoke. We have made much progress and customers are using our device with good results! We have run into one issue with step counts on the MPU9250 that I was hoping you may have some insights on. In general we are getting very inaccurate step counts and we think it maybe because we put the MP aggressively into low power mode. I was under the impression that the accelerometer would still count steps even in low power mode but it seems that i snot the case. We are only get step counts when the DMP is running and chip does not seem to track steps by itself while only accel is up and rest of chip in low power mode.
Do you have any thoughts or insights on how best we should approach the issue of accurate step counts and still have some ability to put the chip into low power mode?
Thank you for your help!
Satish
Satish Movva Founder & CEO CarePredict, Inc. 324 S. University Drive, Plantation, FL 33324 E: smovva@carepredict.com P: +1 (800) 608-7188 x500 <(800)%20608-7188> L: www.linkedin.com/in/satishmovva/ www: www.carepredict.com
On Sat, May 6, 2017 at 12:33 PM, Kris Winer notifications@github.com wrote:
OK, I am not sure what you are doing exactly, but I just verified using this sketch:
https://github.com/kriswiner/Butterfly/blob/master/MPU9250_ MS5637_BasicAHRS2_Butterfly.ino
and my MPU9250 breakout board:
https://www.tindie.com/products/onehorse/mpu9250- teensy-3x-add-on-shields/?pt=full_prod_search
that after just running through the short calibration in the sketch (motionlass and flat for gyro and accel, figure eight for mag) that I get stable yaw that returns to the same value no matter the motion when the device returns to the same position, the yaw is independent of pitch and roll up to +/- 85 degrees or so and otherwise the orientation behaves as I would expect. I ran it at 5 Madgwick fusion iterations per data read and 10 fusion iterations, the latter at 1600 Hz which should be more than enough for convergence. Everything behaves as I would expect, no surprises. On turning the breaboard 90 degrees I get 90 +/0 10 degree changes in heading. This is a known problem due to soft iron corrections in the magnetic response surface and the fact that my laptop is nearby, etc. With a more complete mag calibration even these deviations would go away.
So I cannot understand why you cannot reproduce these results with your set up. What's the difference?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/2#issuecomment-299651109, or mute the thread https://github.com/notifications/unsubscribe-auth/AGrVCoQ2XBGUaLquh_p- ENejB9Gp6Hgyks5r3KDbgaJpZM4CEl0o .
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/2#issuecomment-306217272, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qhTqdZEhVB8bO3aPf-k5QpSwIqwtks5sBB22gaJpZM4CEl0o .
Dear Kriswiner,
I have a question about suitability of the MPU9250 for a particular task may I contact you please?
My email is peter.whitby@outlook.com
Thanks in advance,
Pete
did anyone do the project on an nRF5 chip ?
https://github.com/kriswiner/nRF52832DevBoard/blob/master/MPU9250_BMP280_BasicAHRS_nRF52.ino
On Tue, Oct 9, 2018 at 7:27 AM yk9 notifications@github.com wrote:
did anyone do the project on an nRF5 chip ?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/2#issuecomment-428213745, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1quwjQ4Dmu5ZOdp2PfrFgeVJXoPQ6ks5ujLJGgaJpZM4CEl0o .
only with Arduino?
Much easier with Arduino that the Nordic SDK. I've also used mbed.
On Wed, Oct 10, 2018 at 7:32 AM yk9 notifications@github.com wrote:
only with Arduino?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/2#issuecomment-428595475, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qvPrQm47DhcEkcZQCymb25OAAXWkks5ujgTogaJpZM4CEl0o .
Hello Kris,
I have downloaded the source to the 9250 AHRS, but the system dones't seem to be functioning well at all.
The problems i'm experiencing are that the sensor fusion will settle on a value yaw value and whenever the IMU is rotated on the yaw axis, the yaw ill move slightly, and then return to the settled value it initialized to. The roll and the pitch axis are fine and working.
I'm not sure what I should be doing to help correct the problem.
Thanks