Drone: open AR.Drone autopilot

This is one of my personal projects, which aims to implement an opensource autopilot to replace ardrone standart program.elf.

Playlist of the experiments with the opensource autopilot



New opensource firmware and software build from scratch.

Current state

  • End-to-end opensource (Ardrone side and PC side)
  • Working (needs better PID tunning - as show in the video)
  • Reconfigurable PID using PC application
  • Online Self-Tuning PID Controller (unfinished)  
  • Realtime monitor all Ardrone sensors (Accels, Gyros, Sonar, Voltages) and motors (feedback)
  • On-the-fly motor recovery in case of failure
  • Photo: Vertical and horizontal cameras support (V4L2)
  • Video: H264 hardware codec and realtime video still unstable
  • All communication is done using JSON 
  • Remote Debugging using gdbserver (GDB)


OpenUAV realtime: Xbox controller sender and  Ardrone telemetric system


Hardware

  • Xbox 360 Controller
  • Ardrone v1 - main target tested (started in june/2012)
  • Ardrone v2 - work in progress (started in october/2014 with +Alan Carvalho de Assis )

Software

Required tools and frameworks for build:

  • Visual Studio 2013 (PC)
  • SlimDX (PC)
  • Eclipse CDT
  • Sourcery G++ Lite 2009q1-203 (Ardrone v1)
  • Boost C++ 1.55
  • Firmware oficial 1.11.5 (Ardrone v1) - opensource navboard parser is designed for 1.11.5

OpenUAV for AR.Drone - Windows control application
https://github.com/murix/dronespersonalizados/tree/master/workspace-visual-studio/OpenUAV-ardrone

OpenUAV for AR.Drone - Firmware replacement
https://github.com/murix/dronespersonalizados/tree/master/workspace-eclipse-cdt/OpenUAV-ardrone


Software oficial - Ardrone v1

O ardrone v1 foi lançado na CES em janeiro de 2010.
Comprei o ardrone v1 em junho de 2012, em agosto de 2012 teve o último update oficial.
na CES em janeiro de 2012 foi lançado o Ardrone v2.

Versão 1.11.5  -  Aug 20 2012 14:37:42
(descontinuado? com a liberação do Ardrone v2)
http://download.parrot.com/drone_soft_update/ardrone_update.plf


Extrator de PLF
https://code.google.com/p/ardrone-tool/



Gravação de flash do V1 sem Wifi



Pino 2 é VBAT (11,1 ~12V)
Pino 4 é RX 3.3V
Pino 6 é TX 3.3V


v1: Processador, sensores e Linux

AR.Drone 1.0 : Mykonos card,
Processor  ARM926EJ-S rev 5 (v5l)
Wi-Fi: AR6000
RAM: 128MB
FLASH: 128MB

Navboard:
Microchip PIC24HJ16GP304 40MHZ 16-bit microprocessor
Ultrasonic Sonar

Bosh BMA150 Accelerometer
Invensense IDG 500 gyroscope
Epson XV-3500CB gyroscope

Camera horizontal 640x480 (VGA)
Camera vertical 176x144 (QCIF)

Linux: 2.6.27.47-parrot-01227-g93dde09 \#1 preempt Fri Jul 2 15:23:06 CEST 2010 armv5tejl GNU/Linux

v2: Processador, sensores e Linux

AR.Drone 2.0 : Mykonos2 card,
Processor OMAP 3640 1GHz 32 bit ARM Cortex A8 with a video DSP 800MHz TMS320DMC64x
Wi-Fi: AR6000
RAM: 256MB
FLASH: 128MB

Navboard:
Microchip PIC24HJ Microcontroller
Ultrasonic Sonar

Bosch BMA150 Accelerometer
Invensense IMU-3000 Gyro
AKM Semiconductor 3-Axis Compass
BMP180 Barometric Pressure Sensor 

Camera horizontal 1080p
Camera vertical 720p

Telit Wireless Solutions GPS receiver 
4GB of user-accessible NAND flash for storing video and picture captures.

Linux: 2.6.32.9-g0d605ac \#1 preempt Fri Apr 6 12:01:59 CEST 2012 armv7l GNU/Linux


Como abrir o Ardrone v1


Para abrir o Ardrone v1 - é preciso de uma chave Torx T-6
remover os 4 parafusos torx da tampa de plástico

Agora chegou na placa da CPU que está encima da placa navboard.
E preciso tirar mais 4 parafusos torx.
Depois soltar o cablo flat da camera frontal.
Depois desencaixar a cpu board da nav board.
E retirar a navboard, depois de removida a navboard que estava por baixo.
Remover os cabos de dados e de força dos motores.
Descobri de removidas as duas placas vai ficar só a carcaça com as conexões dos motores,
e o flat da camera frontal.
>>>
Na Navboard ( MYKONOS_NAV_04) dá para ver os seguintes componentes:
Microchip PIC24HJ16GP304 40MHZ 16-bit microprocessor
MEMS gyroscope, the Invensense IDG 500
 Epson XV-3500CB gyroscope
Bosh BMA150

Na CPU board (MYKONOS_MB_11) :
Parrot 6 ARM926EJ-S 468 MHz processor
ROCm Atheros AR6102G-BM2D b/g Wi-Fi
Micron OGA17 D9HSJ (128 mbytes RAM)
Camera horizontal 640x480 (VGA)
Camera vertical 176x144 (QCIF)
>>>
Na Navboard ( MYKONOS_NAV_04) dá para ver os seguintes componentes:
2 sonares gigantes

Na CPU board  (MYKONOS_MB_11) :
Micron 29F1G08AAC  (128 mbytes FLASH)





Referências
http://blog.perquin.com/blog/ardrone-motor-controller/
http://embedded-software.blogspot.com.br/


SDK
https://projects.ardrone.org/projects/show/ardrone-api

Ardrone v1 teardown
http://www.kapejod.org/en/category/ardrone/



Pinout dos motores
http://fenrir.naruoka.org/archives/000805.html
http://www.ardrone-flyers.com/forum/viewtopic.php?f=13&t=1025&start=15

Pin 1 Battery 11.4V
Pin 2 VCC 5V (ATMega8a VCC Pin4+5)
Pin 3 TX+RX (ATmega8a Pin30+31)
Pin 4 IRQ to main board (ATmega8a PC3 Pin26)
Pin 5 GND

Pin 1 Red
Pin 2 White
Pin 3 Motor1=Yellow,M2=Orange,M3=Blue,M4=Green
Pin 4 Motor1=Purple,M2=Gray,M3=Brown,M4=Pink
Pin 5 Black
Quando ocorre um problema nos motores o pino 106 é setado para 1.
Para resetar o status de problema é preciso setar o pino 107 e resetar o pino 107.

Cameras
http://blog.perquin.com/blog/ar-drone-video/

Bottom Camera Initialization

i2cset -y 0 0x49 0x0a 0x85     - sets Vdd4 to 3.0V
gpio 59 -d ho 1                - set CE enabled

Front Camera Initialization

gpio 101 -d ho 0      - set PWDN_H 1=power down,0=active
gpio 109 -d ho 1      - set CE_H 1=enabled,0=not enabled
GPIO
I/O Description
 29 O ??? disable NAND flash write protection on P6 dev 1=disable write prot (FC6050 Parrot platform) fc6050.c
 34 O ??? disable NAND flash write protection on P6 dev 1=disable write prot
 43 O ??? Reset_Wlan 1=reset
 59 O Camera1 (Facing Down) CE 1=enabled,0=not enabled
 63 O Red LED 0=off,1=on
 64 O Green LED 0=off,1=on
 68 O Motor1 /Select 0=selected,1=deselected
 69 O Motor2 /Select 0=selected,1=deselected
 70 O Motor3 /Select 0=selected,1=deselected
 71 O Motor4 /Select 0=selected,1=deselected
 89 ? ??? CAM0_VSYNC
101 O Camera0 (Horizontal) PWDN_H 1=power down,0=active
106 I Motor Cutout
107 O Motor Enable 1=Enable
108 I Reset Button 0=unpressed,1=pressed
109 O Camera0 (Horizontal) CE_H 1=enabled,0=not enabled
127 O USB Connector Pin1 - Vusb
130 O Navboard Connector Pin2 - PGED2
131 O Navboard Connector Pin4 - PGEC2
132 O Navboard Connector Pin6 - /MCLR
158 I Pair Button 0=unpressed,1=pressed

Extension Port Pinout

Pin1 Vusb +5V (USB red)
Pin2 Vbat +11.7
Pin3 USB D- (USB white)
Pin4 RX (Serial data input to Drone)
Pin5 USB D+ (USB green)
Pin6 TX (Serial data output from Drone)
Pin7 GRD (USB black)
Pin8 No Pin
I2C

/dev/i2c-0
0×49 Atmel AT73C246 Power Management and Analog Companions (PMAAC)
0×50 24C32WI eeprom
0x5d Bottom camera

/dev/i2c-1
 0×21 Horizontal Camera – OmniVision ov7725