Notifications
Clear all

The Mysterious MPU 6050 Breakout Board ???

61 Posts
10 Users
8 Likes
460.6 K Views
Recycled Roadkill
(@recycled-roadkill)
Trusted Member
Joined: 4 years ago
Posts: 78
Topic starter  

Mysterious to me anyhow. For those that don't know, this is the goodie that has the triple axis Accelerometer,  Gyro and Bidet that is supposed to keep a two wheel balancing robot vertical. My problem, neither of the three two wheel balancing robots I have will do that. I have a total of eight of the MPU 6050's and just swapping them out appears to do nothing.

But wait, AHAH!  It seems these puppies need to be calibrated. That should be easy, um, shouldn't it?

Well, 5 zillion youtubes and tutorials on the internet have not yielded any success for me, so far. Okay, I'm not your brightest guy when it comes to electronic stuff, but I do try and if I apply myself looooong enough I often come out on top solving the problem. Not this time though. Nope. No way.

Worst yet, I may be totally off the track of my analysis of the problem with these robots, about a year in the making now.

I've tried youtubes that you program an arduino with the GY 521 (same thing, additional number) and once you've determined the offset and maybe done some (what seems to be to be high level math) calculations, you plug these offset numbers into the sketch that controls your robot.

I'm lost. Is there anyone out there that knows or has the level of understanding required to learn how these things are calibrated with the bonus of when I get stuck at some point, I'll have someone to ask so I can push on to the next problem?

For the record the Bots I'm trying to get to work right is 1 ea JJ Robots and 2 ea Elegoo Tumbller Robots.

And oh, I was kidding about the bidet function butt who knows.......  Maybe someday?

This topic was modified 4 years ago 2 times by Recycled Roadkill

This message was approved by Recycled.Roadkill. May it find you in good health and humor.


   
Quote
Robo Pi
(@robo-pi)
Noble Member
Joined: 4 years ago
Posts: 1909
 
Posted by: @recycled-roadkill

For the record the Bots I'm trying to get to work right is 1 ea JJ Robots and 2 ea Elegoo Tumbller Robots.

Don't the manufacturers of these robots provide instructions and code to make them work?  I'm afraid I can't help you, but I'd be quite upset if I bought self-balancing robot kits from a company and they don't do what they are supposed to do.   Did you get the B-Robot Evo kit?   It claims to be "plug-and-play".

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Recycled Roadkill
(@recycled-roadkill)
Trusted Member
Joined: 4 years ago
Posts: 78
Topic starter  

@robo-pi

Well, that would have been the smarter way to go but I didn't. I printed the parts myself. bought the Leonardo board from them which they say was pre programmed. I also bought their high dollar shield that runs the steppers and connects to the WiFi. Honestly, I really don't remember what it doesn't do anymore but it sure didn't work like the one in the youtube vid.

I worked with the elegoo rep thru email trying to sort out the  problem but after replacing everything short of the drive motors nothing came out of it. One thing we did was swap two wires to get one motor running opposite from the way it was so the it did go forward or backward but never attempted to balance. With that fail, I talked 'em into sending me another one free which they did. When it arrived I used the newly supplied parts hoping it would work but it didn't any better than the last.

BTW, first one would only go in circles. Both wheels running clockwise or counter clockwise. With new stuff I can get it to go in one direction but it never balances and it doesn't respond as you'd expect with their bluetooth app.

I'm really not in any big hurry, but it sure would be nice to see one of mine operate like their video out of the box.

Earlier I had bought the Elegoo Smart Robot Car V2.0. Simple as it was it wouldn't run correctly either. I finally figured out that they used the wrong pin assignments for driving the wheels. I traced the supplied shield to the arduino pins to find that out. Later they corrected that themselves and even later they came up with some really complicated code that didn't at all resemble the earlier code but did work correctly. Elegoo can be soooo sloppy. Funny part was, they kept telling me that their code was fine and it was my fault it wasn't working properly.

This message was approved by Recycled.Roadkill. May it find you in good health and humor.


   
ReplyQuote
Recycled Roadkill
(@recycled-roadkill)
Trusted Member
Joined: 4 years ago
Posts: 78
Topic starter  

@robo-pi

About Tumbllers code. They have it on their website and it's been updated once. I'm hoping they'll figure out something or maybe I'll educate myself to where I can fix it myself. Like calibrating the MPU6050 the ppl claim must be calibrated.

This message was approved by Recycled.Roadkill. May it find you in good health and humor.


   
ReplyQuote
Robo Pi
(@robo-pi)
Noble Member
Joined: 4 years ago
Posts: 1909
 

Well, I certainly wish you the best of luck.  I can't help you as I have no experience with the MPU 6050 board or self-balancing robots.   I'd love to give one a try, but unfortunately there's a limit to how many projects I can get into.  I'm still trying to get my normally-wheeled robots up and running. ? 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Spyder
(@spyder)
Noble Member
Joined: 4 years ago
Posts: 927
 

It appears to be a "defense of the human race" mechanism which seems to be applied to any piece of really cool technology which could ultimately be used to eradicate the human race that created it in the first place

IE: you can get all the parts, connect them correctly, and apply the appropriate amount of power to the proper bits, but, they refuse to provide the final programming with which to make it anything other than a fully functional high tech paper weight with some highly satisfying flashy lights that ultimately don't actually perform any reasonable function other than to impress my friends by proving that ultimately, I am in absolutely no danger of creating Skynet or ending the human race, and the closest I'm ever going to get to Terminator is the VHS tape I bought back in 1983

A fate with which I am becoming painfully familiar BTW.

In my own case, it's becoming evident that the only way this thing is ever going to move at all is if I get behind and push it. That's why I'm following @Bill along so carefully and trying to use the same (or, mostly the same anyway) parts. Without the programming, it's going to end up being nothing more than a fancy looking toolbox


   
ReplyQuote
DroneBot Workshop
(@dronebot-workshop)
Noble Member Admin
Joined: 4 years ago
Posts: 1174
 
Posted by: @spyder

Without the programming, it's going to end up being nothing more than a fancy looking toolbox

It will certainly be the most unique toolbox in your neighborhood!

?

Seriously, calibrating an IMU is no easy task, as I'm sure you are finding out.  The mathematics behind it are insane, at least to me - keep in mind it's been over 40 years since I was in school!

I found a few resources, not sure if they are any help:

It is a GREAT question, and I'm glad you brought it up. I've been asked at least 100 times to do a balancing robot project so I'll need to figure this one out as well.

Bill

 

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
Robo Pi
(@robo-pi)
Noble Member
Joined: 4 years ago
Posts: 1909
 

This man promises that by the end of this video you'll understand Quaternions.    Although it's not know how well he keeps his promises. ? 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Mandy
(@amanda)
Estimable Member
Joined: 4 years ago
Posts: 82
 

Hi,

I'm using the 6050.

I thought you would only need one axis for a self balancing robot, am I right?

If that is the case then you just need to deduct the error to get zero on that one axis, you should then be able to pass that corrected data to the motor control.

Am I over simplifying things?

This post was modified 4 years ago by Mandy

The 600 series had rubber skin. We spotted them easy, but these are new. They look human... sweat, bad breath, everything. Very hard to spot.


   
ReplyQuote
Recycled Roadkill
(@recycled-roadkill)
Trusted Member
Joined: 4 years ago
Posts: 78
Topic starter  

@amanda

One axis makes sense except when these things are standing on just one wheel, using the other for KICKING MY BUTT!!!

Yes, there's kids all over youtube with clicky this then clicky that and then all you need is to use this algebraic code that will also give you the meaning of life when you're finished. Oh yes! It's 42.

I'll get it, come hell or high water, but in the meantime I'll accept any help offered.  🙂

This message was approved by Recycled.Roadkill. May it find you in good health and humor.


   
Squish reacted
ReplyQuote
Mandy
(@amanda)
Estimable Member
Joined: 4 years ago
Posts: 82
 

Can you read the 6050 registers with wire?

If you can there two ways to do this (and you may use them together) :

  1. Register 0x43 and 0x44 give the X gyro rotation so if you set the X axis parallel to the wheels you should have a starting point.
  2. Use the accelerometer readings but its a bit more complex and I'm not sure that a single unit would be accurate enough.

 

Does the motor controller accept positive and negative values for drive direction?

If it does you can send (the rotation value * scale factor) to the motor drivers and it should stand up (or try to).

Does that help?

This post was modified 4 years ago 2 times by Mandy

The 600 series had rubber skin. We spotted them easy, but these are new. They look human... sweat, bad breath, everything. Very hard to spot.


   
ReplyQuote
Recycled Roadkill
(@recycled-roadkill)
Trusted Member
Joined: 4 years ago
Posts: 78
Topic starter  
Posted by: @amanda

Does that help?

Probably would someone but I'm not anywhere near your level yet. Here's something I did play with a couple of day ago. MPU6050_DMP6. I loaded it into Tumbllers arduino with MPU6050 attached and watched the serial display um, display stuff. I just looked over some of the code and realized there is the word  quaternion there plus the serial.print values as follows.

#ifdef OUTPUT_READABLE_QUATERNION
// display quaternion values in easy matrix form: w x y z
mpu.dmpGetQuaternion(&q, fifoBuffer);
Serial.print("quat\t");
Serial.print(q.w);
Serial.print("\t");
Serial.print(q.x);
Serial.print("\t");
Serial.print(q.y);
Serial.print("\t");
Serial.println(q.z);
#endif

MPU6050_DMP6 was hanging out in one of my arduino libraries I think.

I'll try running it again later and see if it makes any more sense the next time around.

Mandy, you're way, way above my level and you're speaking mostly greek to me. I very much appreciate your trying tho.

I'll pursue this further tomorrow.

This message was approved by Recycled.Roadkill. May it find you in good health and humor.


   
ReplyQuote
Mandy
(@amanda)
Estimable Member
Joined: 4 years ago
Posts: 82
 
Posted by: @recycled-roadkill
 
Mandy, you're way, way above my level and you're speaking mostly greek to me. I very much appreciate your trying tho.
Don't worry, I can walk you through this.  I getting an idea what level you're at, if you don't understand a bit just ask.
 
I'm off for some sleep.  ? 
 

The 600 series had rubber skin. We spotted them easy, but these are new. They look human... sweat, bad breath, everything. Very hard to spot.


   
ReplyQuote
Recycled Roadkill
(@recycled-roadkill)
Trusted Member
Joined: 4 years ago
Posts: 78
Topic starter  

Loaded MPU6050_DMP6 into nano. Peripherals boards connected

Turned Battery power to unit and get the following on the serial display.

Initializing I2C devices...
Testing device connections...
MPU6050 connection successful

Send any character to begin DMP programming and demo:
Initializing DMP...
Enabling DMP...
Enabling interrupt detection (Arduino external interrupt 0)...
DMP ready! Waiting for first interrupt...

 

Waiting for what interrupt? Any clue?

Very interesting instructions commented in the sketch. Uncomment (many choices) for many functions, lol, all in greek.

The adventure continues.

Just saw your reply Mandy. Sleep well and thank you.

This post was modified 4 years ago by Recycled Roadkill

This message was approved by Recycled.Roadkill. May it find you in good health and humor.


   
ReplyQuote
Duce robot
(@duce-robot)
Prominent Member
Joined: 4 years ago
Posts: 681
 

I'm wondering if I need this board ? I have it but how can I incorporate it into my project which is only getting more complicated the closer I get to completion lol its been 3 years since start can this be used for a large robot?


   
ReplyQuote
Page 1 / 5