Fork this with Git

xyControl

AVR base Quadrocopter Flight Controller
Project started on November 12, 2012.
Last updated on September 01, 2014.

Recent activity on GitHub:

Logo

Current Progress

Youtube Link

xyControl is a Quadrocopter Flight Controller based on Atmels Atmega2560 microcontroller. It features 512KB SRAM on-board, using the external memory interface of this processor. Also included is a switched power supply as well as a USB connection to communicate with and program the target. All I/O pins, including 3 additional UARTs, SPI, I2C (TWI) and 16 ADC Channels, are accessible via standard 2.54mm connectors. The Board can be powered from an external stable 5V supply, USB or 7V or more, via the on-board switched power supply. All voltage sources can be selected via jumpers.

Photo 1 Photo 2 Screenshot

Flight Control Software Flow

Three tasks are controlling the Quadrocopter Orientation in Space.

Supported Hardware

External Memory (xmem.h)

The external memory consists of a 512Kx8 SRAM, bank-switched onto the 16bit avr address space. This gives us 8 memory banks, consisting of 56KB. All memory from 0x0000 to 0x21FF is the AVRs internal memory. The memory banks are switched into 0x2200 to 0xFFFF. This gives us 8 banks with 56KB each, resulting in 448KB external RAM.

The data and bss memory sections, as well as the Stack are located in the internal RAM. The external RAM is used only for dynamically allocated memory.

Orientation Calculation (orientation.h)

Calculates the current angles of the platform, using Gyroscope and Accelerometer Data with a Kalman Filter. It is using this slightly modified Kalman Filter Implementation by Linus Helgesson.

PC and Android Tools

You can find some PC Software in the tools directory. Each one should be accompanied by it's own Readme file.

UART-Flight Status Packet Format

printf("t%.2f %.2f %.2f\n", kp, ki, kd);
printf("u%.2f %.2f\n", pid_output[1], pid_output[0]); // Pitch, Roll
printf("v%i %i %i %i\n", motorSpeed[0], ..., motorSpeed[3]);
printf("w%.2f\n", orientation.pitch);
printf("x%.2f\n", orientation.roll);
printf("y%.2f\n", orientation.yaw);
printf("z%.2f\n", getVoltage());

Software used

License

Peter Fleurys TWI Library (twi.c & twi.h) is released under the GNU GPL license.

Everything else is released under a BSD-Style license. See the accompanying COPYING file.