The quadcopter will need to determine it’s orientation then update the thrust to be delivered by each motor many times a second. So I was interested to see how fast my Nedtduino plus 2 could read data from the MPU 6050 accelerometer & gyroscope. I stumbled across this blog and it appears that they are building a Quadcopter as well(Google translation was hard work to read).
There was also some very useful C# NetMF code which I used as the basis for my performance test harness.
10,000 readings of 16bit values from the Accelerometer (X,Y,Z) Gyroscope (X,Y,Z) and temperature sensor. The initial run didn’t look to positive
21.78, 21.77, 21.77, 21.77, 21.77, 21.77, 21.77,21.77,21.77,21.77 sec Avg 21.77
Which is roughly 460/sec
I then had a look at the I2C interface code and noticed that the bus speed was set to 100KHz so I increased it to 400KHz
10.33, 10.23, 10.23,10.23,10.23,10.23,10.23,10.23,10.72,10.23 Avg 10.29
Which is roughly 970/sec
I then had a look at the I2C interface code and changed the way that the register values were read so the array of registers to read didn’t have to be loaded.
8.55,8.57,8.55,8.57,8.55,8.57,8.57,8.57,8.55,8.57 Avg 8.56
I think 1170/sec should be sufficient, but I’m going to have a look at the Digital Motion Processor (DMP) capabilities of the MPU6050. This will require significant effort as there currently (June 2013) doesn’t appear to be any NetMF support for this approach.
Any luck getting the DMP working on the MPU-6050? I’m looking at converting this C++ library over to C# but’s it’s been challenging https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050/Examples/MPU6050_DMP6
I had started with picking apart the code for my Crazyflie Nano Quadcopter. This seemed like a reasonable place to start as I was thinking about using their PC software for controlling my quad.
I’ll have a look at the C++ code over the next couple of days.
Any way you would be able to share your solution with this breakout board.
I’m having issues with connecting to devices through I2C on the netduino plus 2 and have no Idea what I am doing wrong.
The i2c devices work as they will run on a standard arduino.
Any help would be appriciated.
Hi,
Have a look at the post which shows how I connected up the MPU6050.
The post shows the different wiring required by the Netduino Plus & Netduino Plus 2
The Netduino Plus 2 is like the Arduino Leonardo with different pins for the I2C.
Bryn
The only difference to mine is that I was connected to 3v pin with 10k Pullup resistors between the vcc and the 2 scl and sda lines.
I have not had any luck with communication with any I2C device outside of arduino, when I connect the bus pirate to the circuit it does detect both devices on i2c.
I also noticed that you don’t have any pull up resistors in your circuit, I thought they were needed to bring the voltage on the line to a known state.
Most examples that I have found like the BMP085 example all fail on initial communication with the device.
I have tried with pull up’s and without, triple checked the wiring. confirmed the device was working with an arduino.
Found that the example was for a Netduino Plus not a Plus 2.
Hi,
On holiday, back early next week.
I’ll dig out my MPU 6050 board and get a really cut back demo working.
Then I’ll send you the code to try on your Netduino 2
Bryn
Forgot to mention that I have this exact board along with a BMP085 among other i2c devices.
Any help would be appreciated.
Cool thanks
Hi Al,
Out of home for 5 weeks while earthquake damage fixed.
Below is a photo of my setup using just jumper leads and a breakout board. The source for my VS2k10 project is here and originally came from here
Bryn
Sorry to hear about the damage, I’ve put it down for now due to other priorities.
The wiring diagram I was going off of was from here. http://learn.adafruit.com/bmp085/wiring-the-bmp085. I was using the 5 and 4 for the clock and data lines. They should be the same line’s as the SC and SD pins.
When I get back to it I will try these pins to see if that makes a difference.
Thanks