Arduino Forum

Using Arduino => Sensors => Topic started by: dsyleixa on Sep 19, 2018, 07:29 pm

Title: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 19, 2018, 07:29 pm
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).
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 20, 2018, 02:22 pm
no good experiences and advices anyone?
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: jremington on Sep 21, 2018, 05:19 pm
You need a magnetometer for stable yaw values. The MPU6050 does not have one.
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 21, 2018, 07:28 pm
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?
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: jremington on Sep 21, 2018, 07:45 pm
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.
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 21, 2018, 07:49 pm
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?
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: jremington on Sep 21, 2018, 09:17 pm
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.
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 21, 2018, 09:33 pm
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)
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: jremington on Sep 22, 2018, 01:49 am
Quote
sorry, you're wrong
Good to know, and I wish you the very best of luck with your project!
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 22, 2018, 08:26 am
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.
(http://cmra.rec.ri.cmu.edu/products/ev3_intermediate/lesson/media_images/Config_2-3.png)

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.

(https://i.stack.imgur.com/ge9sN.png)

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?

Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: jremington on Sep 22, 2018, 04:37 pm
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.
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 22, 2018, 04:38 pm
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?
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: jremington on Sep 22, 2018, 04:54 pm
See reply #2
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 22, 2018, 05:40 pm
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?
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: tito-t on Sep 23, 2018, 09:49 am
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!
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 23, 2018, 02:22 pm
...
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!

thanks for your hint, I just tried it out.
Unfortunately the example sketch MPU6050_DMP6 does not compile for me, neither for my Due, nor for my M0, and nor for my M4.
(No board manager issues, because different other sketches still compile for these boards very will without issues).

So thanks again, but I'm afraid that some other libs are required instead ... :-/
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: MarkT on Sep 24, 2018, 07:19 pm
Presumably you've seen https://playground.arduino.cc/Main/MPU-6050 (https://playground.arduino.cc/Main/MPU-6050)
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 24, 2018, 07:33 pm
Presumably you've seen https://playground.arduino.cc/Main/MPU-6050 (https://playground.arduino.cc/Main/MPU-6050)
please help me - where is that supposed to calculate yaw, pitch and roll?
All I can see thers are sole gyro and sole accel values, no sensor fusion, no Kalman filtering, and no 3-dim coordinate system transformations from local sensor to global aeronautic orientation.
Notice that e.g. for pitch=0 and roll=0° then the gyro z axis is significant for yaw, whilst for pitch=+80° then mainly the x axis becomes more significant to yaw. Same for e.g. roll=80°, then the y axis becomes most significant to yaw. So the problem about 3D coordinate system transformations is not trivial, and additionally the raw sensor values surely will have to be filtered (some are using extended Kalman filters to accel and gyros against gaussian and non-gaussian noise and high pass filters to eliminate drift).
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: Idahowalker on Sep 24, 2018, 09:21 pm
This might help https://forum.arduino.cc/index.php?topic=501334.0 (https://forum.arduino.cc/index.php?topic=501334.0).

It is possible to determine angle of offset by using acceleration, I have my MPU 6050 sitting on a X/Y table that is kept level by taking acceleration converted angles and turning them into torque values for the X/Y servos.

It is possible to measure the X/Y/Z, MPU6050 Gyro and Accelerometers, drift rate and offsets (the Z axis must be physically aligned to the North Pole during calibration), which I have done on a RPi in Python, and apply those drift rates and offsets to the accelerometers, which, for the Z axis accelerometer gets rid of the earths rotation value. Using the Z axis accelerometer positioned so that the accelerometer is not detecting any acceleration (N-Pole aligned) and the X/Y are allowed, by being on a stable platform, to be gravity aligned, a local coordinate system is realized; +X+Y, -X+Y, -X,-Y, +X-Y, and Yaw can be determined from the acceleration vectors. The Z axis can be torqued so that any felt acceleration is zeroed out, keeping the Z axis pointed to the North Pole. The position on the Earth Geodesic can determined by Trigonometry, using the meridian coordinate system and then converted to Lat and Lon. With Lat and Lon increments you can, also, determine Yaw, negating the need for a Z Axis measurement.

I have posted the Python code I use to develop XY angles from acceleration, here in these forums, in the past. I figured someone has ported the code to CPP by now; *shrug*

I know it is not the instant answer solution to your issue but it is what I got. I, should, in a few months look to make my X/Y platform into a X/Y/Z platform, with Z stabilized to the North Pole but I am working on something else at the moment.

Good luck.
Title: Re: which MPU6050 libs (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 25, 2018, 09:23 am
thank you for your post, as I understand it's theoretically possibe to achieve the functionality I wish to have.
At some point it sounds as if you use different x,y,z, coordinate axis designations than I did, but in principle that makes no difference of course.
(https://i.stack.imgur.com/ge9sN.png)
longitudinal =x
transverse = y
vertical = z

As stated, again: I do not need absolute magnetic compass headings, just relative ones to an arbitrary start value.

So far I am using this lib for pitch and roll:
https://github.com/TKJElectronics/KalmanFilter/tree/master/examples

Unfortunately it does not show yaw yet, and so a different lib is desired for download and install.
 
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage
Post by: dsyleixa on Sep 26, 2018, 11:41 am
that's really weird that no one knows a working yaw+pitch+roll lib for the MPU6050 and an ARM core MCU... :-/
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: Idahowalker on Sep 26, 2018, 02:36 pm
(https://i.stack.imgur.com/ge9sN.png)

As stated, again: I do not need absolute magnetic compass headings, just relative ones to an arbitrary start value.

Unfortunately it does not show yaw yet, and so a different lib is desired for download and install.
 
If you are using a MPU5060 you have the ability to calculate your relative heading.
I am not going to tell you how to do it. Your image you post is the clue.

Look at your image. Your image represents a X, Y, Z 3D coordinate system. Think of a XY graph plot on a piece of paper. Actualy, just do that now, draw a vert and horz line on a sheet of paper with the lines intersecting at a 90 degree angle. Where the lines intersect that is the relative current position. If you plot a dot on the +X+Y of 1 unit up and one unit over. Now plot another point 2 units up and 2 units over, and 3 units up and 3 units over, and 4 units up and 4 units over... You should end up with a line that from +X,+Y is at 45 degrees, which is your relative heading.

The mpu6050 gives you +/- Accelerations. Those accelerations are your direction of travel vectors that can be used to determine relative heading. It's just simple math, You can do it yourself.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 26, 2018, 03:55 pm
sorry, I can't, I need a lib to retrive yaw, pitch, and roll, incl. filtering, I don't understand anything of the raw values and the Kalman and quaternions and Euler angles and sensor fusion and whatever. And BTW, for horizontal positions or 90° rotated, the accelerations are not helpful for yaw at all, just specific and vaying gyro values, and only for in-between  tilt values the vectors have to be somehow composed for sensor fusion - but how or by which transformations is absolutely beyond me.
There are libs which provide pitch and roll, but no yaw unfortunately, and some claim to provide yaw, too, but don't compile at all for my ARM boards. I really cannot understand why a really working lib  doesn't already exist. :-/
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: jremington on Sep 27, 2018, 02:18 am
Quote
I really cannot understand why a really working lib  doesn't already exist
See reply #2: You need a magnetometer for stable yaw values. The MPU6050 does not have one.

The MPU6050 library developers understand this simple point.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 27, 2018, 09:53 am
See reply #2: You need a magnetometer for stable yaw values. The MPU6050 does not have one.

The MPU6050 library developers understand this simple point.
first I just need simply yaw, and that must be possible.
 I told you dozens of times why a magnetometer wouldn't work for my purposes, so don't keep posting over and over the same nonsense!
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Sep 27, 2018, 11:02 am
I also tried
https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino (https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino)

but there I get the errors

Code: [Select]
Bibliothek I2Cdev im Ordner: D:\Arduino\portable\libraries\I2Cdev (legacy) wird verwendet
Bibliothek Wire in Version 1.0 im Ordner: D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\libraries\Wire  wird verwendet
Bibliothek MPU6050 im Ordner: D:\Arduino\portable\libraries\MPU6050 (legacy) wird verwendet
exit status 1
Fehler beim Kompilieren für das Board Adafruit ItsyBitsy M0.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Oct 02, 2018, 01:53 pm
I also tried
https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino (https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino)

but there I get the errors

Code: [Select]
Bibliothek I2Cdev im Ordner: D:\Arduino\portable\libraries\I2Cdev (legacy) wird verwendet
Bibliothek Wire in Version 1.0 im Ordner: D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\libraries\Wire  wird verwendet
Bibliothek MPU6050 im Ordner: D:\Arduino\portable\libraries\MPU6050 (legacy) wird verwendet
exit status 1
Fehler beim Kompilieren für das Board Adafruit ItsyBitsy M0.


same for the M4:
Code: [Select]
exit status 1
Fehler beim Kompilieren für das Board Adafruit Feather M4 Express (SAMD51).



why are there those compile errors for the ARM cores?
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Oct 06, 2018, 07:26 pm
how disappointing that actually no working motion processing libs exist which compile for ARM  cpus, too - and noone actually is able to fix those issues...
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Oct 07, 2018, 10:36 am
now I reinstalled a new MPU6050 lib from https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050
and used this example
https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino

and now there's the error for both the Arduino Due, M0 (Adafruit Itsybitsy M0), and M4 (Adafruit Feather M4):

Code: [Select]
MPU6050_DMP6:279: error: '_BV' was not declared in this scope
    if ((mpuIntStatus & _BV(MPU6050_INTERRUPT_FIFO_OFLOW_BIT)) || fifoCount >= 1024) {
                                                            ^
Bibliothek I2Cdev im Ordner: D:\Arduino\portable\libraries\I2Cdev (legacy) wird verwendet
Bibliothek Wire in Version 1.0 im Ordner: D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\libraries\Wire  wird verwendet
Bibliothek MPU6050 im Ordner: D:\Arduino\portable\libraries\MPU6050 (legacy) wird verwendet
exit status 1
'_BV' was not declared in this scope


what is going on here?

 (edit: for Mega2560 it can be compiled though, so how can that be fixed for ARM cpus?)
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: tito-t on Oct 07, 2018, 02:45 pm
Seems to be similar to last reported issue about https://github.com/jarzebski/Arduino-MPU6050/blob/master/MPU6050_gyro_pitch_roll_yaw/MPU6050_gyro_pitch_roll_yaw.ino which I once suggested.  I also don't really understand that and can't fix that, but to me that looks as if it was a bare-metal AVR register or something like that, no idea why one can't use Arduino API expressions instead for this pupose which then would work for all Arduino boards...?.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Oct 07, 2018, 04:32 pm
I just got the advice that it might be a macro and so to add to the source code

#ifndef _BV
#define _BV(n) (1<<(n))
#endif


But after that, now it still doesn't compile for M0 and/or M4, with new error messages:

source: https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino
Code: [Select]

Arduino: 1.8.5 (Windows 7), Board: "Adafruit Feather M4 Express (SAMD51), Enabled"

D:\arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\arduino\hardware -hardware D:\arduino\portable\packages -tools D:\arduino\tools-builder -tools D:\arduino\hardware\tools\avr -tools D:\arduino\portable\packages -built-in-libraries D:\arduino\libraries -libraries D:\Arduino\portable\libraries -fqbn=adafruit:samd:adafruit_feather_m4:cache=on -ide-version=10805 -build-path C:\Users\LOKALE~1\AppData\Local\Temp\arduino_build_81307 -warnings=all -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.openocd.path=D:\arduino\portable\packages\arduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.CMSIS.path=D:\arduino\portable\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.CMSIS-Atmel.path=D:\arduino\portable\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.bossac.path=D:\arduino\portable\packages\arduino\tools\bossac\1.8.0-48-gb176eee -verbose D:\Akten\Programmierung\arduinoProgs\driver\MPU6050-h-Examples\MPU6050_DMP6_002\MPU6050_DMP6_002.ino
D:\arduino\arduino-builder -compile -logger=machine -hardware D:\arduino\hardware -hardware D:\arduino\portable\packages -tools D:\arduino\tools-builder -tools D:\arduino\hardware\tools\avr -tools D:\arduino\portable\packages -built-in-libraries D:\arduino\libraries -libraries D:\Arduino\portable\libraries -fqbn=adafruit:samd:adafruit_feather_m4:cache=on -ide-version=10805 -build-path C:\Users\LOKALE~1\AppData\Local\Temp\arduino_build_81307 -warnings=all -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.openocd.path=D:\arduino\portable\packages\arduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.CMSIS.path=D:\arduino\portable\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.CMSIS-Atmel.path=D:\arduino\portable\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.bossac.path=D:\arduino\portable\packages\arduino\tools\bossac\1.8.0-48-gb176eee -verbose D:\Akten\Programmierung\arduinoProgs\driver\MPU6050-h-Examples\MPU6050_DMP6_002\MPU6050_DMP6_002.ino
Using board 'adafruit_feather_m4' from platform in folder: D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3
Using core 'arduino' from platform in folder: D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3
WARNUNG: Kategorie '' in der Bibliothek XPT2046 ist ungültig und wird auf 'Uncategorized' festgelegt
Build-Optionen wurden verändert, alles wird neu kompiliert
(...)

Sketch wird kompiliert...
(...)

              from C:\Users\LOKALE~1\AppData\Local\Temp\arduino_build_81307\sketch\MPU6050_DMP6_002.ino.cpp:1:

D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\cores\arduino/HardwareSerial.h:71:18: warning: unused parameter 'baudrate' [-Wunused-parameter]

  virtual void begin(unsigned long baudrate, uint16_t config) {}

               ^

D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\cores\arduino/HardwareSerial.h:71:18: warning: unused parameter 'config' [-Wunused-parameter]

In file included from D:\Akten\Programmierung\arduinoProgs\driver\MPU6050-h-Examples\MPU6050_DMP6_002\MPU6050_DMP6_002.ino:54:0:

D:\Arduino\portable\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:743:9: warning: unused parameter 'dmpData' [-Wunused-parameter]

uint8_t MPU6050::dmpProcessFIFOPacket(const unsigned char *dmpData) {

      ^

Compiling libraries...
(...)
          #warning Using current Arduino IDE with Wire library is functionally limiting.

           ^

D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp:65:14: warning: #warning Arduino IDE v1.0.1+ with I2CDEV_BUILTIN_FASTWIRE implementation is recommended. [-Wcpp]

          #warning Arduino IDE v1.0.1+ with I2CDEV_BUILTIN_FASTWIRE implementation is recommended.

           ^

D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp:66:14: warning: #warning This I2Cdev implementation does not support: [-Wcpp]

          #warning This I2Cdev implementation does not support:

           ^

D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp:67:14: warning: #warning - Timeout detection (some Wire requests block forever) [-Wcpp]

          #warning - Timeout detection (some Wire requests block forever)

           ^

In file included from D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\cores\arduino/Arduino.h:78:0,

              from D:\Arduino\portable\libraries\I2Cdev\I2Cdev.h:77,

              from D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp:46:

D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\cores\arduino/HardwareSerial.h:71:18: warning: unused parameter 'baudrate' [-Wunused-parameter]

  virtual void begin(unsigned long baudrate, uint16_t config) {}

               ^

D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\cores\arduino/HardwareSerial.h:71:18: warning: unused parameter 'config' [-Wunused-parameter]

In file included from D:\Arduino\portable\libraries\I2Cdev\I2Cdev.h:77:0,

              from D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp:46:

D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':

D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp:276:62: error: 'BUFFER_LENGTH' was not declared in this scope

          for (uint8_t k = 0; k < length; k += min(length, BUFFER_LENGTH)) {

                                                           ^

D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\cores\arduino/Arduino.h:100:24: note: in definition of macro 'min'

#define min(a,b) ((a)<(b)?(a):(b))

                     ^

D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)':

D:\Arduino\portable\libraries\I2Cdev\I2Cdev.cpp:414:70: error: 'BUFFER_LENGTH' was not declared in this scope

          for (uint8_t k = 0; k < length * 2; k += min(length * 2, BUFFER_LENGTH)) {

                                                                   ^

D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\cores\arduino/Arduino.h:100:24: note: in definition of macro 'min'

#define min(a,b) ((a)<(b)?(a):(b))

                     ^

Bibliothek I2Cdev im Ordner: D:\Arduino\portable\libraries\I2Cdev (legacy) wird verwendet
Bibliothek Wire in Version 1.0 im Ordner: D:\arduino\portable\packages\adafruit\hardware\samd\1.2.3\libraries\Wire  wird verwendet
Bibliothek MPU6050 im Ordner: D:\Arduino\portable\libraries\MPU6050 (legacy) wird verwendet
exit status 1
Fehler beim Kompilieren für das Board Adafruit Feather M4 Express (SAMD51).
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Oct 16, 2018, 09:59 am
update:
with some lib source fixes now the example from https://github.com/jrowberg/i2cdevlib also compiles for ARM Cortex M0 and M4 cpus,.
By theory, it also provides yaw, pitch, and roll.
Unfortunately the program often hangs up and gets stuck, it also needs an interrupt pin (which is actualy a problem because my Adafruit boards have extremely few free pins), and the calculated yaw value is still sort of unstable.

Does someone know a different lib which provides yaw, pitch, and roll and which is suitable for ARM cores, too?
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Oct 20, 2018, 06:15 pm
update 2:

some issues could be resolved for the DMP6 example (MPU in dmp mode):
- It takes quite long (30 - 40 sec ) until either yaw start value settles.
- After having settled, an actual "stabile yaw start value" varies randomly, completely different to either other one , mostly in a range +30°...-170°
- when once having settled, then the calculations of turning/rotating back and forth always end up at quite stable trustworthy yaw values, relative to the start value.
- for dmp mode an interrupt pin is required
- IMU drift is partially about -1.5° per 5 min, partially much less  (-4° / 30min)
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: bitbank on Dec 16, 2018, 06:15 pm
See reply #2: You need a magnetometer for stable yaw values. The MPU6050 does not have one.

The MPU6050 library developers understand this simple point.
Maybe different wording will help @dsyleixa with his lack of understanding of the situation:
When an IMU is perfectly still, the pitch and roll can be calculated precisely because gravity provides a point of reference for the Z axis. The gyroscope is imperfect and will drift. If you rely 100% on the gyroscope for pitch/roll, it will soon have nonsense values (especially with $0.45 parts like the MPU-6050).
To get an accurate yaw angle, you need a point of reference which is 90 degrees rotated from gravity. The magnetic poles do a good job of this. Without a point of reference, you have NO WAY OF EVER CALCULATING an accurate yaw angle. If you start from a known position and just use Z axis rotation of the gyroscope to calculate the yaw angle, you'll quickly have a value that is wrong.
You keep claiming to know nothing about Kalman filters, raw values, libraries, etc. It would help you to understand if you took the time to learn how an accelerometer + gyroscope work so that you can understand the information provided and its limitations.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Dec 17, 2018, 07:16 pm
Quote
The magnetic poles do a good job of this.
no, as already stated several times, the magnetc poles are not suitable for that purpose, because of many strong external and on-board magnetic sources of interference of unpredictable strengths and directions.
Magnetic headings by magnetometers often fluctuate up to +/- 180° within several seconds in my environments.
But if you read closely, the issue is meanwhile resolved by using the MPU6050 onboard dmp, thank you!
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: jremington on Dec 17, 2018, 10:11 pm
Quote
the issue is meanwhile resolved by using the MPU6050 onboard dmp
Not at all, for those interested in obtaining an absolute orientation.

But you are certainly welcome to continue deluding yourself.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Dec 17, 2018, 10:28 pm
I do not need an absolute orientation, I stated that already probably a hundred times: just stabilized (filtered) yaw, pitch, and roll values. If in doubt, see post #3.
And now please stop trolling and move on.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: jremington on Dec 17, 2018, 10:32 pm
Not trolling, I just want to make sure that others aren't confused by your confusion.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Dec 17, 2018, 10:36 pm
I  NEVER stated that I would need absolute values.
Just relative yaw to an arbitrary initial one.
YOU are the one who repeatedly is trolling, sabotaging and confusing all and everything by your repeated off-topic posts.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: jremington on Dec 17, 2018, 10:57 pm
You can't get long term stable values for yaw, without using some sort of external reference. Perhaps the values you get, that are stable for only a short term, are OK for your purposes.
Title: Re: which MPU6050 libs for ARM core (with Kalman filter?) and without Intr usage ?
Post by: dsyleixa on Dec 18, 2018, 08:04 am
You can't get long term stable values for yaw, without using some sort of external reference. Perhaps the values you get, that are stable for only a short term, are OK for your purposes.
Yes, I know that, I knew that already from the start, and I never doubted that.