|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Using MPU6050 through I2C bus
Quote:
Thanks for the tips, at this point I'm mostly looking for gathering a pool of resources to see what else people have done before us and where the best place to start is. |
|
#2
|
|||
|
|||
|
Re: Using MPU6050 through I2C bus
If your goal is just to measure turning in autonomous, I have tried the gyro on page 12 of the KOP in it works remarkably well. It is also really easy to code because it just uses the Java WPI Gyro class: http://www.usfirst.org/sites/default...ckToteRevB.pdf
If you want to use the MPU6050, I would think it would be best to buy a breakout board designed just for that purpose with good documentation, like Sparkfun's: https://www.sparkfun.com/products/11028 (or some cheaper ones from Amazon: http://www.amazon.com/s/ref=nb_sb_no...Ck%3Agy%20521). I just bought one of these for a personal quadcopter project using an Arduino, for which I am fairly confident it will work. I've never used I2c, but I would watch out because the I2C port on the digital sidecar is 5v and the mpu 6050 runs at 3.3 v (I couldn't tell if that Hobbyking chip converts the i2c to 5v) |
|
#3
|
||||
|
||||
|
Re: Using MPU6050 through I2C bus
This board has the same MPU as the sparkfun board, but takes an input voltage of 5V and drops it to 3.3V for the MPU, so we don't have to worry about the voltage. This is why we chose this board over the sparkfun one (also it's cheaper).
We did not have any luck using the KOP gyro. Whether it is a bad piece of equipment or we were not using properly I am not sure, but we fail time and time again to achieve desirable results with the KOP gyro. Too much drift. |
|
#4
|
|||
|
|||
|
Re: Using MPU6050 through I2C bus
The MPU-6050 can be used 2 ways. The raw gyro and accel values can be read from the chip over I2C. The MPU-6050 has a computing engine on the chip. It can give a quaternion output of the fused accel an gyro. The computing engine mused be started up by loading many registers and memory locations. Allot of code. We have used an Arduino Uno to talk to the chip. Look at The Sparkfun break out board to get links to both forms of code. The Mpu-6050 so far seams to be a very stable gyro. There is also the Mpu- 9050 that includes a magnetometer and can give 9 DOF fused quaternion. How ever the mag part is not done on the chip. That has to be done by code on a processor. Many different algorithms to do this. Question? what is the best way to put a 6 byte packet into the C-rio from an Arduino?
|
|
#5
|
||||
|
||||
|
Re: Using MPU6050 through I2C bus
The raw gyro values is the functionality we are looking for. Found this:
https://github.com/jrowberg/i2cdevli...PU6050_raw.ino To what extent would this code be sort of "plug and play"? It looks like working with registries may still need to be done. |
|
#6
|
||||
|
||||
|
Re: Using MPU6050 through I2C bus
Quote:
They already have a library for talking to gyros and accelerometers, with code that looks to be for initializing the MPU. I would spend some time understanding this project and stealing what you can. It likely has 80% of the code you need to get the job done. Quote:
Last edited by otherguy : 26-06-2013 at 10:23. Reason: typo |
|
#7
|
||||
|
||||
|
Re: Using MPU6050 through I2C bus
Quote:
It seems like the barrier to getting the MPU6050 to behave as a sensor like we want is the device driver software to allow us to even grab values from gyro. We have found some scattered resources throughout the web that have bits and pieces of what we will need, but we will need to figure out what is necessary and what is missing along with how to put it all together. To be clear the criteria we used when ordering the gyro: -Cheap (less than $50 a pop; this one is $27) -Digital output gyro -Common FRC power supply voltage (in this case 5V) -Way to directly interface with FRC control system (in this case I2C through the DSC) -At least 500 dps (This one is configurable to 250, 500, 1000 or 2000 dps...another one of those register things we need to configure) On top of that this particular MPU had some positive reviews for its motion sensing and there were some projects that had been done out there. I also have heard that some FRC teams have used the exact board that we purchased, I was hoping to maybe hear from some of them here. |
|
#8
|
||||
|
||||
|
Re: Using MPU6050 through I2C bus
I'm not a programmer but as someone who is familiar with multiwii I would probably avoid it and talk directly to the MPU 6050. There are boards like this that can handle a 5v input. I would probably start by looking at the ADXL_345 i2c class and modify that to read the MPU 6050. There communication protocol is similar.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|