Autonomous Unmanned Aerial Vehicle Project/Software/Cores

Cores

 

Requirement

An onboard controller for an aircraft is a real time control system, which needs to regularly obtain data from various sensors, running at different frequencies, to effectively compute and respond to various scenarios to ensure both aircraft and environment security. The system has to be capable of honoring hard deadlines, which becomes increasingly important in hovering aircrafts. Since the system has to be capable of both lower-level peripheral functions such as UART, I2C, digital pin operations, PWM, and higher level tasks such as floating points, vectors etc, as such MCUs such as ARM Cortex M0-4 easily lend themselves for the requirements.

Architecture

The code system implemented on the devices was designed as a low level cyclic execution operating system with few rules in mind: The operating system was developed on top of Arduino functions so as to minimize the work needed to be done on the hardware peripherals. Various self-contained modules were developed on top of arduino platform with cross-platforming in mind, which made it extremely easy to compile and run selected modules on any MCUs compatible with Arduino IDE. Following is a top-level view of the developed processes and libraries.
Top level view of OS components, with arrows pointing to code structure evoked by another.
Following is a run down of the most important components shown in the diagram above:

Implementation

The OS core system developed was run as a distributed network system with four MCUs performing various tasks simultaneously. Each MCU was labeled as a core from A-D and were interconnected using the UART. Logging to a computer was done either through a USB cable, XBee through UART, or SD card through SPI. Following table summarizes the functionality and actions of each core.


Core Name Function Description
Core A PID controller for hovering/flight 100 Hz
  X-Bee communication Tx metadata at 10Hz, immediate Rx response
  SD Card Logging 20 Hz, binary data
  Gearbox Servo Unit Quadrature/limit switch reading, servo signal generation
  Brushless DC Motors ESC signal generation
  Peripheral core communication Data Rx from core B, C, D
Core B Sensor Reading Accelerometer, Magnetometer, Gyroscope at 100 Hz
  Attitude Computation 100 Hz
  Core communication Data Tx to core A, 100 Hz
Core C GPS Setup and Reading, 10 Hz
  Core Communication Data Tx to core A, 10 Hz
Core D Sensor Reading Pressure 100 Hz, Temperature 10 Hz
  Altitude calculation 100 Hz
  Core Communication Data Tx to core A, 100 Hz

Following is a visual representation of data flow through the distributed network system.

Equation Lift
Above: Arrows pointing to data flow between different hardware/software modules.