Page 1 of 2
MPU6050
Posted: Fri May 01, 2020 8:51 pm
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
Re: MPU6050
Posted: Mon May 04, 2020 10:28 am
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.
Re: MPU6050
Posted: Mon May 04, 2020 6:32 pm
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

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

)
Br Jorgen
Re: MPU6050
Posted: Wed May 06, 2020 3:00 pm
by Benj
Hi Jorgen,
Thanks but I think I have one here. I'll see if I can dig it out.
Re: MPU6050
Posted: Thu May 07, 2020 6:10 am
by jgu1
Hi Ben!
Thank you.

Otherwise, let me know and I sent one for you.
Br Jorgen
Re: MPU6050
Posted: Sun May 10, 2020 8:27 pm
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
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
Br Jorgen
Re: MPU6050
Posted: Mon May 11, 2020 12:37 pm
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.
Re: MPU6050
Posted: Mon May 11, 2020 1:30 pm
by jgu1
Sss
Re: MPU6050
Posted: Mon May 11, 2020 1:32 pm
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
Br jorgen
Re: MPU6050
Posted: Mon May 11, 2020 2:15 pm
by Benj
Ok thanks Jorgen,
if ok, and if you don` want to keep it after testing, throw it away
I could never do that

I'll add it to my collection of random hardware

Re: MPU6050
Posted: Tue May 12, 2020 3:44 pm
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
Please let me hear when you receive it.
Br jorgen
Re: MPU6050
Posted: Tue May 19, 2020 1:01 pm
by jgu1
Hi Ben!
I just inquired in the shipping department. They had overlooked my package so it's first shipped today
Hopefully you have it in few days.
Br Jorgen
Re: MPU6050
Posted: Mon May 25, 2020 8:39 pm
by jgu1
Hello Ben!
Have you not received the parcel from yet, please.
Br
Jorgen
Re: MPU6050
Posted: Wed Jun 03, 2020 1:09 pm
by jgu1
Hi again Ben!
Are you on holyday

or have you still not received the MPU6050 from me, please
Br Jorgen
Re: MPU6050
Posted: Wed Jun 03, 2020 2:45 pm
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
Re: MPU6050
Posted: Thu Jun 04, 2020 5:51 am
by jgu1
Hi Leigh!
Thank you for reply. Well ok. Of course if he is busy I May have patience, I wait
Send a regard.
Br Jorgen
Re: MPU6050
Posted: Thu Jun 04, 2020 9:48 am
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.
Re: MPU6050
Posted: Thu Jun 04, 2020 1:00 pm
by jgu1
Hi Ben!
Congratulations to the little guy.
No sorry at all
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
Br Jorgen
Re: MPU6050
Posted: Mon Jun 15, 2020 12:02 pm
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.
Have a go and see what ranges you are getting so I know what sort of readings we are dealing with.
Re: MPU6050
Posted: Tue Jun 16, 2020 2:49 pm
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
Thank`s, you hear from me.
By the way, how do we give thump up in the new system?
Br jorgen
Re: MPU6050
Posted: Fri Jun 19, 2020 3:24 pm
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
Re: MPU6050
Posted: Fri Jun 19, 2020 3:35 pm
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
Re: MPU6050
Posted: Fri Jun 19, 2020 3:50 pm
by jgu1
Hi George!
Thank you. Do you mean in devicemanager or where please?. I cant see it anywhere
Br jorgen
Re: MPU6050
Posted: Fri Jun 19, 2020 4:03 pm
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
Re: MPU6050
Posted: Fri Jun 19, 2020 4:58 pm
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
Br Jorgen