Go Down

Topic: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ? (Read 891 times) previous topic - next topic

dsyleixa

Hello,
with which MPU6050 libs  for ARM core (M0, M3, M4, if possible with Kalman filter) and without the use of the interrupt pin do you have the best experience?
I am polling just in loops of 50-100ms delays, so  I think I can do without the interrupt pin.
And essentially, just stabilized (filtered) yaw, pitch, and roll values have to be determined and used (the sole acc and gyro values are rather uninteresting instead for my purpose).

dsyleixa


jremington

You need a magnetometer for stable yaw values. The MPU6050 does not have one.

dsyleixa

You need a magnetometer for stable yaw values. The MPU6050 does not have one.
A magnetometer is actually no option because of (randomly!) heavy electromagnetic and ferromagnetic noise.
I also do not nead actual magnetic compass heading, just (relative) yaw angles which can be initialized arbitrarily to 0° or what ever at start, and providing rather stabile yaw by just very small drift.

I know that there are many gyroscopes, even quite simple ones and even for LEGO Mindstorms, no 6D or 9D but just 1D or 2D, and they can read yaw quite reliably.

So how to do it with the MPU6050?

jremington

Quote
they can read yaw quite reliably.
Then they use some other external reference for yaw. A gyro alone cannot determine the yaw angle.

The accelerometer is useless as an external yaw reference.

dsyleixa

Then they use some other external reference for yaw. A gyro alone cannot determine the yaw angle.
no, the ones I mean don't use external references, and of course they can retrieve relative yaw anglex by their gyros, e.g. for LEGO:

https://shop.lego.com/de-DE/EV3-Gyrosensor-45505
https://www.generationrobots.com/en/401183-gyroscopic-sensor-for-lego-mindstorms-nxt.html
http://www.mindsensors.com/44-accelerometer-gyro
https://www.dexterindustries.com/manual/imu-sensor/

all can retrieve the yaw angle (e.g., for navigating a robot car) though.

so if they can , why can't a MPU6050?

jremington

Quote
why can't a MPU6050
Because it is mathematically impossible to use a rate gyro and an accelerometer to determine the absolute yaw angle. There is no yaw origin reference.

This is a very simple concept.

dsyleixa

sorry, you're wrong, all the Lego gyros can calculate yaw angles, just by Gyro values.
Perhaps they are not stabilized against accelerometers, but they still can.

Nonetheless, by evaluating addionally accelerometers one can retrieve at least the horizontal gyro rotation fraction (== yaw)  in case the sensor has been tilt, just like for pitch and roll.
The yaw starting angle can be initiaized at program start by an arbitrary value, like Lego does it, too; the follow-up yaw angles are then relative to this one, as already stated.

So how to retrieve the yaw angle by a MPU6050 by which lib, and even when not Kalman-filtered?
(Anyway, the raw or sole gyro + acc values may be Kalman-filterd though)

jremington

Quote
sorry, you're wrong
Good to know, and I wish you the very best of luck with your project!

dsyleixa

Good to know, and I wish you the very best of luck with your project!
yes, just think about it:
Even simple LEGO (and 3rd party) 1D Gyrors can detect rotation around their vertical (z) axis, which is yaw when held horizontally, e.g. for robot cars driving on the ground. I already have built such tribots to move them straight  or drive curves of certain degrees since lots of years ago.


Youtube Video: https://www.youtube.com/watch?v=CBzUYdzsOQA

Now the MPU6050 has a 3D Gyro, so it must be able to retrieve the rotation round it's horizontal forward (x), it's horizontal sidewards (y), AND around it's vertical (z) axis.



As long as held horizontally and not tilt, the rotation round the vertical (z) axis again is = yaw, just like for the LEGO 1D gyros:
==> Which lib does retrieve that (z-axis) rotation dimension?

and when  tilt forward or sidewards, that can be detected by it's accelerometers to recalculate the yaw part or fraction:
==> which lib also retrieves this recalculated, transformed yaw rotation value?
(notice that e.g. for +80° pitch then mainly the gyro x-axis detects yaw)

So as long as the MPU6050 really is featuring 3D gyros and 3D accelerometers, it should be possible to retrieve pitch,  roll, and yaw as well, not just pitch and roll like e.g. by Lauszus' Kalman lib - : but which one provides that actually?


jremington

Quote
Now the MPU6050 has a 3D Gyro, so it must be able to retrieve the rotation round it's horizontal forward (x)
.
No, because the gyro detects the rate of rotation, not the angle. You can integrate rotation rates to accumulate a relative change in yaw, from some starting yaw value.

You cannot obtain the absolute yaw angle, which is based on knowing where the North pole is.

dsyleixa

About rotation rate (= speed): 
as always, integrating the rotation speed over time, you'll get the angle - nothing new to me actually. It's always done that way, even for the LEGO 1D gyros.
(edit: I see that you edited your post meanwhile)

So if roll and pitch can be calculated out of those gyro values and calculated gyro angles, it should be able to that also for yaw, as already stated.

And you are always confusing (relative) yaw with (absolute) compass heading, although I never asked for absolute compass headings!
As stated and shown, even simple LEGO 1D gyros can retrieve those relative yaw angles!
But @jremington, with confidence: I asked who actually knows such libs, and not who has no idea about it.

So @all:
which libs do that yaw+pitch+roll calculations actually well, according to experience, possibly without using the interrupt pin?

jremington


dsyleixa

See reply #2
OMG, that's rediculous - please stay away and let people answer who understand something of the matter!

@all the rest:
which libs do that yaw+pitch+roll calculations actually well, according to experience, possibly without using the interrupt pin?

tito-t

dsyleixa, I agree with you about what you wrote about 3D gyroscopes and calculating yaw angles as well, and I have to disagree with jremington's statements that it shoudn't be possible. Unfortunately I have no personal experiences with the MPU6050 though.
Having said that, I want to show you a link about a lib which claims to calculate both yaw, pitch, and roll, but as stated, I can't say anything about trustworthiness or interrupts if yes or no:
https://github.com/jarzebski/Arduino-MPU6050/blob/master/MPU6050_gyro_pitch_roll_yaw/MPU6050_gyro_pitch_roll_yaw.ino
I hope that might help you further, or some other people can comment on this perhaps!

Go Up