I've put my drone back together with working GPS and compass attached. After calibrating the compass in it's new place the readings are pretty solid. I'm hoping to be able to correct navdata output for yaw with it pretty soon :-)
Pictures:
AwesomeDrone
Sonntag, 16. Januar 2011
Montag, 10. Januar 2011
I2C Tools for the AR.Drone
As I've mentioned before, I've done some investigation concerning the i2c bus on the ar.drone. I just wanted to share the i2c tools used to probe the bus and a couple of results with you real quick. A link to the tools compiled for the drone can be found at the end of this post. Probing the two i2c busses yields the following results:
i2c 0, address 5d is the bottom camera
i2c 0, address 50 is the 24C32WI eeprom
The rest is unknown to me so far. I've not tried to dump the eeprom for fear of accidentally overwriting it, I will probably pull up it's read only pin and give it a shot at some point though. :-)
Files:
i2ctools (arm binaries)
- # i2cdetect -y 0
- 0 1 2 3 4 5 6 7 8 9 a b c d e f
- 00: -- -- -- -- -- -- -- -- -- -- -- -- --
- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 40: -- -- -- -- -- -- -- -- -- 49 -- -- -- -- -- --
- 50: 50 -- -- -- -- -- -- -- -- -- -- -- -- 5d -- --
- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 70: -- -- -- -- -- -- -- --
- # i2cdetect -y 1
- 0 1 2 3 4 5 6 7 8 9 a b c d e f
- 00: -- -- -- -- -- -- -- -- -- -- -- -- --
- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 20: -- 21 -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 70: -- -- -- -- -- -- -- --
i2c 0, address 5d is the bottom camera
i2c 0, address 50 is the 24C32WI eeprom
The rest is unknown to me so far. I've not tried to dump the eeprom for fear of accidentally overwriting it, I will probably pull up it's read only pin and give it a shot at some point though. :-)
Files:
i2ctools (arm binaries)
Attaching an I2C compass to the AR.Drone
I've recently attached a magnetic compass to the drone using the i2c bus. Let me start by saying that a good compass is not exactly cheap, I paid about 25€ for it and I've seen it being sold for over 100€ so it's an expensive toy. Also, from what I've gathered, it's really hard to find a good position for it on the drone seeing as all the motors have a strong magnetic field. Right now, my drone isn't exactly flyable but I will share my experience with the additional sensor nonetheless, even though I have not found an ideal spot to place it at yet.
The compass chip I've attached is an HMC6352 (datasheet, link to breakout board supplier) by Honeywell mounted on a breakout board (very necessary if you are not a soldering pro). I've attached VCC and ground to the two pins carrying those current marked 10 and 11 in my previous post about the mainboard layout. The two i2c wires were attached to what I labeled C and D in said post. To be exact, I chose to attach the sensor to the i2c bus solder joints in the middle of the board, not next to the i2c eeprom; it was really easy to solder the cables on, no protective varnish of any kind. My warranty is probably void now, though. If you don't want to risk voiding your warranty I suggest glueing something onto those pins also I can not imagine that being a really solid connection. In a worst case scenario it's probably easiest if you swap the mainboard out for a replacement part and send the device in for warranty after that ;-)
The sensor is not attached to the same bus the firmware is using for the ground camera, an eeprom and another device I have yet to identify. I have not done excessive testing put I am able to poll the sensor while the firmware is operating so that seems to be a good sign. I slapped together a very small test program to retrieve the current heading from the sensor:
Files:
compass.c
compass (arm binary)
The compass chip I've attached is an HMC6352 (datasheet, link to breakout board supplier) by Honeywell mounted on a breakout board (very necessary if you are not a soldering pro). I've attached VCC and ground to the two pins carrying those current marked 10 and 11 in my previous post about the mainboard layout. The two i2c wires were attached to what I labeled C and D in said post. To be exact, I chose to attach the sensor to the i2c bus solder joints in the middle of the board, not next to the i2c eeprom; it was really easy to solder the cables on, no protective varnish of any kind. My warranty is probably void now, though. If you don't want to risk voiding your warranty I suggest glueing something onto those pins also I can not imagine that being a really solid connection. In a worst case scenario it's probably easiest if you swap the mainboard out for a replacement part and send the device in for warranty after that ;-)
The sensor is not attached to the same bus the firmware is using for the ground camera, an eeprom and another device I have yet to identify. I have not done excessive testing put I am able to poll the sensor while the firmware is operating so that seems to be a good sign. I slapped together a very small test program to retrieve the current heading from the sensor:
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <errno.h>
- #include <fcntl.h>
- #include <sys/time.h>
- #include "i2c-dev.h"
- #define ADDRESS 0x21
- int fd;
- int main(int argc, char *argv[]) {
- fd = open( "/dev/i2c-0", O_RDWR );
- if( ioctl( fd, I2C_SLAVE, ADDRESS ) < 0 )
- {
- fprintf( stderr, "Failed to set slave address: %m\n" );
- return 2;
- }
- if( i2c_smbus_write_byte( fd, 'A' ) < 0 )
- fprintf( stderr, "Failed to write 'A' to I2C device: %m\n" );
- usleep(10);
- unsigned result = i2c_smbus_read_word_data(fd, 0);
- unsigned upper = result >> 8 & 0x00FF;
- unsigned lower = result & 0x00FF;
- return 0;
- }
Files:
compass.c
compass (arm binary)
Donnerstag, 6. Januar 2011
AR.Drone mainboard overview
Top view (side with ground camera)
1: Camera, I2C bus 0 address 5d
2: I2C connectors for I2C Bus 0 arrive here
3: DRAM cache
4: Connector to navigation board, at least one serial port
5: USB driver SMSC USB3317 (datasheet)
6: Connector to front camera, probably not an I2C device
7: External connection port with TTYS0 serial port and USB port (see link)
8: ROCm Atheros AR6102G-BM2D wireless
9: Power supply for the engines
10: Ground
11: VCC +5V
Bottom view
A: Power supply for the engines
B: Connector to the engine-boards
C: I2C Bus (data)
D: I2C Bus (clock)
E: 5V
F: Ground
G: I2C EEPROM CSI 24C32WI, i2c bus0, address 50 (datasheet)
Abonnieren
Posts (Atom)