MPU6050

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

MPU6050

Post by jgu1 »

Hi!

I have made a project with the Gyro sensor MPU6050. The X,Y,Z axis is only given some random number I try to get an average readout by sampling 10 times and divide by 10, but the number is stil some random. Please help, am I doing something wrong, please.
Work nice in simulation.

Br Jorgen
Attachments
Mpu6050Test Uno.fcfx
(16.33 KiB) Downloaded 184 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: MPU6050

Post by Benj »

Hi Jorgen,

You have the gyro set to the most sensitive setting maybe turning this down in the component properties would provide better results.

When you say random numbers are you moving the sensor or is the sensor stationary and what sort of range are the numbers varying by?

There will likely be noise on the sensor so the numbers will jump around a bit even when stationary and gyros tend to drift over time so this may not be helping either.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Ben!

Thank´s for fast reply. I already try to adjust the sensitive Doesn´t work. I try to search on the web and I see that it need to be calibrated before use.

I made a test where I try to calibrate ( only X) but still very unstable, maybe I not do it correct.

I also test some projejct with Arduino IDE and then it is very stable :D Look in serial monitor. I add a copy of the schetch in comment, not able att. the ino.

Do you have MPU6050 in your workshop? otherwise I will send you one for test, and you keep it (and maybe a little example in FC :lol: )

Br Jorgen
Attachments
Mpu6050Test UnoCalibrate.fcfx
(18.56 KiB) Downloaded 194 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: MPU6050

Post by Benj »

Hi Jorgen,

Thanks but I think I have one here. I'll see if I can dig it out.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Ben!

Thank you. :D Otherwise, let me know and I sent one for you.

Br Jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Ben!

I have done a little more research. In FC for me it look like, for me the Gyro akt like a mix of accelerometer and Gyro and as mentioned very flickering :wink:
I found this link here and testet the program with same hardware setup, and it work very nice and stable. How they have programmed and done in program, I am not able to see. maybe it could help.

https://dronebotworkshop.com/mpu-6050-l ... _Libraries

It work fine, but not created in FC as I prefer :wink:

Br Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: MPU6050

Post by Benj »

Hi Jorgen,

I've had a dig in the office and also at home and not been able to put my hands on one yet, I'll check out the component code against some known working code and make sure there's not a problem lurking.

What value do you get returned from the initialise function. If all is well it should return 0 and we write value 0x41 to register 107 to "Switch to use X Gyro with PLL".

If the init function returns 255 then something is off and the register write is not called.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Sss
Last edited by jgu1 on Mon May 11, 2020 1:33 pm, edited 1 time in total.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Ben.

have a look this evening. But anyway, a MPU6050 is on a way to you to morrow, if ok, and if you don` want to keep it after testing, throw it away :lol: :lol:

Br jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: MPU6050

Post by Benj »

Ok thanks Jorgen,
if ok, and if you don` want to keep it after testing, throw it away :lol:
I could never do that :D I'll add it to my collection of random hardware :lol:

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Ben!

I have sent MPU6050 to you today. I have sent it as a package so we are able to track and trace.
Don't laugh at the size of this one. large envelope for the small PCB :lol:

Please let me hear when you receive it.

Br jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Ben!

I just inquired in the shipping department. They had overlooked my package so it's first shipped today :x

Hopefully you have it in few days.

Br Jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hello Ben!

Have you not received the parcel from yet, please.

Br

Jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi again Ben!

Are you on holyday :lol: or have you still not received the MPU6050 from me, please :wink:

Br Jorgen

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MPU6050

Post by LeighM »

Hi Jorgen,
I can confirm it just arrived in the office, and is currently on Ben's desk.
But as we are currently each only occasionally in the office it could be a while before Ben collects and can look at it.
Thanks!
Leigh

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Leigh!

Thank you for reply. Well ok. Of course if he is busy I May have patience, I wait :D

Send a regard.

Br Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: MPU6050

Post by Benj »

Hi Jorgen,

Sorry I have had a weeks holiday for my little man's birthday and it arrived during that time. I'm back in the office today or tomorrow so will pick it up and see what I can make of it.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Ben!

Congratulations to the little guy.

No sorry at all :wink:

Ben no hurry at all. I have time to wait. only when you can. I only want to be sure you get the parcel, and you have :D :D :D

Br Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: MPU6050

Post by Benj »

Hi Jorgen,

Right I've plugged in the MPU6050 and it seems to be working ok for me.

I couldn't get my Arduino board working, I think I may have killed it previously so I'll try and pick one up next time I'm in the office again.

However using a dsPIC I was able to get it working and the readings seem fairly stable using your program with a few tweaks to show min and max readings.

The Ranges I am getting with the module running for a few minutes are approx.

X = -71 to -58
Y = 15 to 30
Z = -40 to -26

I've being very careful not to move the module, I even turned off my music while taking the readings just in case this introduced vibration.
Mpu6050Test ECIO.fcfx
(20.33 KiB) Downloaded 144 times
Have a go and see what ranges you are getting so I know what sort of readings we are dealing with.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Wow Ben. First see your reply now. Unfortunaly I am not able to test now, first in the weekend.
First I test with an EICO, then I Will try to change your program to Mega and see what happend.

For your always kindness, I am willing to send you a Mega2560 :D :D

Thank`s, you hear from me.

By the way, how do we give thump up in the new system?

Br jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi Ben!

Ready for testing your program. But suddently I am not able to program the Eico?

First I try directly from Fc8, you know compiling and press te reset.
After that I try direct from Mloader. Mloader can see the device, but when I press send it can´t see the USB? And I can´t se the USB in devicemanager.

I try to install the USB driver again for Eico, but still no luck :(

Br Jorgen
Attachments
EicoUsb.PNG
EicoUsb.PNG (238.07 KiB) Viewed 9297 times
Eico40.PNG
Eico40.PNG (127.09 KiB) Viewed 9297 times

TaliG
Posts: 52
Joined: Fri Apr 07, 2017 1:55 am
Location: Greece
Has thanked: 16 times
Been thanked: 14 times
Contact:

Re: MPU6050

Post by TaliG »

Hi Jorgen,

Go into windows settings, then devices, find your device and uninstall it.
Unplug your device and replug it.
Let windows reinstall the drivers.
Now check if you can use your device within FC8.

I had problems programming my EB091 last night and as I was about to post into the bugs section, I did the above and my board worked again.
:)


George

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Hi George!

Thank you. Do you mean in devicemanager or where please?. I cant see it anywhere

Br jorgen

TaliG
Posts: 52
Joined: Fri Apr 07, 2017 1:55 am
Location: Greece
Has thanked: 16 times
Been thanked: 14 times
Contact:

Re: MPU6050

Post by TaliG »

yes in your windows device manager.

when you connect your module to your pc, can you hear the usb connected windows sound?

have FC8 and mloader closed before you do that.

If your module connects to your pc you should be able to find it in the windows device manager and when you do, right click and uninstall device.
then unplug from pc and reconnect, let windows install the driver again.

but if your module does not connect to windows as a usb device then Ben could help (corrupted bootloader maybe?)

George

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: MPU6050

Post by jgu1 »

Thank´s George. But from the start I wrote I cannot see the USB in the devicemanager, so it´s not easy to uninstall it :lol:

Br Jorgen

Post Reply