Overview

Project Peregrine is an autonomous fixed-wing Unmanned Aerial Vehicle (UAV) that employs thrust vector control to achieve exceptional maneuverability within confined airspace, while harnessing the advantages inherent to fixed-wing aircraft. In the realm of modern military surveillance drones, a prevailing distinction exists between two predominant categories. The first category comprises slow, quadcopter-style devices noted for their agility in tight spaces but often characterized by their conspicuous noise output. The second category encompasses large, runway-dependent aircraft that necessitate specialized launching mechanisms and sensitive camera equipment to compensate for their operational distance from the target, essential for maintaining stealth.

To bridge the gap between these two distinct UAV types, Peregrine introduces a three-stage flight strategy. In the first stage, thrust vectoring technology, commonly employed in rocketry for vertical stabilization during takeoff at low speeds, facilitates runway-independent ascent, allowing the UAV to attain velocity and altitude. Stage two initiates once the UAV has achieved the desired altitude within the geographic range of its surveillance objective. During this phase, the UAV executes a controlled nosedive, reaching terminal velocity and closing the gap with the target area. Stage three seamlessly follows stage two, where the UAV disengages its propulsion, achieving complete silence. In this phase, the UAV relies on its wings to glide at low altitude over the target area, leaving no acoustic footprint.

Master Map

Firmware Modules
Software
EDFs
Servos
Motor Controllers
Sensors
Power Sources
Public Methods
Servos
update_edf_power
EDFs

while (True)

xSemaphoreTake(edf_lock)

while (edf_needs_updated())

if (edf1_power != edf1_target_power)

actuator_control_interface_set_tvc_x(double _x)

actuator_control_interface_set_tvc_y(double _y)

actuator_control_interface_calibrate_tvc_x_min(uint8_t _deg)

actuator_control_interface_calibrate_tvc_x_max(uint8_t _deg)

else

edf1_power -= edf1_rate

if(edf1_power > edf1_target_power)

edf1_power = edf1_target_power

if(edf1_power < edf1_target_power)

edf1_power += edf1_rate

if (edf2_power != edf2_target_power)

if (edf3_power != edf3_target_power)

if (edf4_power != edf4_target_power)

Note: this method will simply return if any of the edf power(s) don't equal their target value

This is being abstracted to a method for code readability

if(edf1_power < edf1_target_power)

edf1_power = edf1_target_power

set_pwm

actuator_control_interface_set_aileron_l(double _l)

actuator_control_interface_set_aileron_r(double _r)

actuator_control_interface_calibrate_tvc_y_min(uint8_t _deg)

actuator_control_interface_calibrate_tvc_y_max(uint8_t _deg)

actuator_control_interface_calibrate_aileron_l_min(uint8_t _deg)

actuator_control_interface_calibrate_aileron_l_max(uint8_t _deg)

actuator_control_interface_calibrate_aileron_r_min(uint8_t _deg)

actuator_control_interface_calibrate_aileron_r_max(uint8_t _deg)

actuator_control_interface_soft_set_edf_1(uint8_t power, uint8_t rate)

actuator_control_interface_soft_set_edf_2(uint8_t power, uint8_t rate)

actuator_control_interface_soft_set_edf_3(uint8_t power, uint8_t rate)

actuator_control_interface_soft_set_edf_4(uint8_t power, uint8_t rate)

actuator_control_interface_set_edf_1(uint8_t power)

actuator_control_interface_set_edf_2(uint8_t power)

actuator_control_interface_set_edf_3(uint8_t power)

actuator_control_interface_set_edf_4(uint8_t power)

Functional Requirements

  • Flight Data
    • Flight stage
    • Full system health status
      • Operational
      • Minor error
      • Fatal error
  • Network Status
    • View Network Connection Status
      • Connected
      • Not Connected
    • View time since last network packet was received
      • Example 20ms
  • Peripheral Data
    • Note:
      • Health status will be broken down into:
        • Operational
        • Disconnected
        • Faulty
    • View Accelorometer Data
      • Health status
      • Activation state
      • x,y,z
    • View Gyroscope Data
      • Health status
      • Activation state
      • x,y,z
    • View Barometric Pressure Data
      • Health status
      • Activation state
      • altitude
    • View Magnetometer Data
      • Health status
      • Activation state
      • heading
    • View Ultrasonic Sensor Data
      • Health status
      • Activation state
      • distance in mm
  • Actuator Data
    • View Motor data x4
      • Health status
      • Power percentage
    • View servo data x4
      • Health status
      • Angle
  • System Data
    • System needs to be capable of uniquely identifying connection
    • System needs to be capable of verifying firmware version

Transferred Data

This contains information pertaining to what data is actually transmitted and received to and from the UAV over the wireless connection.


Estimated Total Unique Messages: 46

Received Data (from the UAV)

logging

  • debug
  • info
  • error
  • fatal

peripheral

managed by AACS > Sensor Control Interface

  • accelorometer:
    • x
    • y
    • z
    • status : operational, faulty, disconnected
    • activation state: activated, deactivated
  • gyroscope:
    • x
    • y
    • z
    • status : operational, faulty, disconnected
    • activation state: activated, deactivated
  • altimeter
    • altitude
    • status : operational, faulty, disconnected
    • activation state: activated, deactivated
  • magnetometer
    • heading
    • status : operational, faulty, disconnected
    • activation state: activated, deactivated
  • ultrasonic
    • distance
    • status : operational, faulty, disconnected
    • activation state: activated, deactivated

actuator

managed by AACS > Actuator Control Interface

  • motor 1
    • status : operational, faulty, disconnected
    • power percent
  • motor 2
    • status : operational, faulty, disconnected
    • power percent
  • motor 3
    • status : operational, faulty, disconnected
    • power percent
  • motor 4
    • status : operational, faulty, disconnected
    • power percent
  • servo 1
    • status : operational, faulty, disconnected
    • angle
  • servo 2
    • status : operational, faulty, disconnected
    • angle
  • servo 3
    • status : operational, faulty, disconnected
    • angle
  • servo 4
    • status : operational, faulty, disconnected
    • angle

flight data

managed by AACS > Master Control Interface

  • flight stage
  • overall system health
  • ready to enter launch stage
  • ready to enter target acquisition stage
  • ready to enter stealth surveillance stage
  • ready to enter vehicle extraction stage
  • ready to enter landing stage

Transmitted Data (to the UAV)

UI Design

Circular transclusion detected: projects/project-peregrine/index

System Architecture

Circular transclusion detected: projects/project-peregrine/index

MPU6050

Aileron R

TVC X

TVC Y

Aileron L

BMP280

HMC5883L

SSD1306

EEPROM

Advanced Avionics Control System

Processor : RP2040 (Raspberry Pi Pico W)
OS : FreeRTOS


Sensor Control Interface

Circular transclusion detected: projects/project-peregrine/index

Variables

There are going to be a set of static variables that contain all of the sensor data. These variables are going to be protected using mutexes since they will be continuously updated via the internal sensor reading task and continuously read through the various “public” methods.

I need to do some research on what formats would be good for using the numbers in (i.e. should accelerator data be a double between 1 and -1 or is it better represented as an unsigned or signed int?)

C2 Communication

Documentation for what all the C2 server needs can be found here


UML

classDiagram
	class sensor_control_interface{
		- double accelorometer_x;
		- double accelorometer_y;
		- double accelorometer_z;
		- double gyroscope_x;
		- double gyroscop_y;
		- double gyroscop_z;
		- double altitude;
		- double heading;
		- double us_distance;

		- SemaphoreHandle_t mpu_mutex;
		- SemaphoreHandle_t bmp_mutex;
		- SemaphoreHandle_t qmc_mutex;
		- SemaphoreHandle_t hcsr_mutex;

		- int sensor_error_count;
		+ sensor_control_interface_init(UBaseType_t sensor_task_priority): int
		+ sensor_control_interface_get_accelorometer_x(): double
		+ sensor_control_interface_get_accelorometer_y(): double
		+ sensor_control_interface_get_accelorometer_z(): double
		+ sensor_control_interface_set_accelorometer_x(double _x): void
		+ sensor_control_interface_set_accelorometer_y(double _x): void
		+ sensor_control_interface_set_accelorometer_z(double _z): void
		+ sensor_control_interface_accelerometer_activate(): int
		+ sensor_control_interface_accelerometer_deactivate(): int
		+ sensor_control_interface_get_gyroscope_x(): double
		+ sensor_control_interface_get_gyroscope_y(): double
		+ sensor_control_interface_get_gyroscope_z(): double
		+ sensor_control_interface_set_gyroscope_x(double _x): void
		+ sensor_control_interface_set_gyroscope_y(double _x): void
		+ sensor_control_interface_set_gyroscope_z(double _z): void
		+ sensor_control_interface_gyroscope_activate(): int
		+ sensor_control_interface_gyroscope_deactivate(): int
		+ sensor_control_interface_get_altimeter_altitude(): double
		+ sensor_control_interface_set_altimeter_altitude(double _altitude): int
		+ sensor_control_interface_altimeter_activate(): int
		+ sensor_control_interface_altimeter_deactivate(): int
		+ sensor_control_interface_get_compass_heading(): double
		+ sensor_control_interface_set_compass_heading(double _heading): int
		+ sensor_control_interface_compass_activate(): int
		+ sensor_control_interface_compass_deactivate(): int
		+ sensor_control_interface_get_ultrasonic_distance(): double
		+ sensor_control_interface_set_ultrasonic_distance(double _distance): int
		+ sensor_control_interface_ultrasonic_activate(): int
		+ sensor_control_interface_ultrasonic_deactivate(): int
		+ sensor_control_interface_reset_mpu_6050(): int
		+ sensor_control_interface_reset_bmp_280(): int
		+ sensor_control_interface_reset_qmc _5883l(): int
		+ sensor_control_interface_reset_hc_sr04(): int
		+ sensor_control_interface_task(): int
	}

Public Methods

General

sensor_control_interface_init

Accelerometer

Getters:
sensor_control_interface_get_accelerometer_x
sensor_control_interface_get_accelerometer_y
sensor_control_interface_get_accelerometer_z
Setters:
sensor_control_interface_set_accelerometer_x
sensor_control_interface_set_accelerometer_y
sensor_control_interface_set_accelerometer_z
Activators:
sensor_control_interface_accelerometer_activate
sensor_control_interface_accelerometer_deactivate

Gyroscope

Getters:
sensor_control_interface_get_gyroscope_x
sensor_control_interface_get_gyroscope_y
sensor_control_interface_get_gyroscope_z
Setters:
sensor_control_interface_set_gyroscope_x
sensor_control_interface_set_gyroscope_y
sensor_control_interface_set_gyroscope_z
Activators:
sensor_control_interface_gyroscope_activate
sensor_control_interface_gyroscope_deactivate

Altimeter

Getters:
sensor_control_interface_get_altimeter_altitude
Setters:
sensor_control_interface_set_altimeter_altitude
Activators:
sensor_control_interface_altimeter_activate
sensor_control_interface_altimeter_deactivate

Compass

Getters:
sensor_control_interface_get_compass_heading
Setters:
sensor_control_interface_set_compass_heading
Activators:
sensor_control_interface_compass_activate
sensor_control_interface_compass_deactivate

Ultrasonic

Getters:
sensor_control_interface_get_ultrasonic_distance
Setters:
sensor_control_interface_set_ultrasonic_distance
Activators:
sensor_control_interface_ultrasonic_activate
sensor_control_interface_ultrasonic_deactivate

Internal Methods

Threading

sensor_control_interface_task

Error Handling

sensor_control_interface_reset_mpu_6050
sensor_control_interface_reset_bmp_280
sensor_control_interface_reset_qmc _5883l
sensor_control_interface_reset_hc_sr04

Actuator Control Interface

Circular transclusion detected: projects/project-peregrine/index

Diagrams

int calculatePowerChange(int currentPower, int targetPower, int rateOfChange) {
    // Ensure rateOfChange is within the valid range (1-100)
    rateOfChange = max(1, min(100, rateOfChange));
 
    // Calculate the remaining difference between currentPower and targetPower
    int remainingDifference = targetPower - currentPower;
 
    // Calculate the adder/subtractor for the given rate of change
    int change = (remainingDifference * rateOfChange) / 100;
 
    // Ensure a minimum change to prevent very slow transitions
    change = max(change, MIN_CHANGE);  // Adjust MIN_CHANGE as needed
 
    return change;
}
 

C2 Communication

Documentation for what all the C2 server needs can be found here

Master Control Interface

The master_control_interface is responsible for high level control over the UAV.

C2 Communication

Documentation for what all the C2 server needs can be found here

EDF 1

EDF 2

EDF 3

ARM-M0+

EDF 4

37v

7.4v

3.3v linear regulator

ESC

ESC

ESC

ESC

Wireless ConnectionI2CI2CI2C
Link to original

Mechanical Design

Hardware
re-inserting images here soon

Electrical Design

Flux.ai was used to generate the PCB (Printed Circuit Board) design as it allowed for a easy cloud-based solution for electrical design.

Electrical Components

  • Raspberry Pi Pico W
    • ARM M0+ Dual Core Microcontroller
  • MPU6050
    • 6-axis Accelerometer / Gyroscope
  • BMP280
    • Barometric Pressure Sensor
  • HMC5883L
    • 3-axis Magnetometer
  • SSD1306
    • OLED Display
  • various power regulation components

Software

AACS
C2 Server

System Architecture Overview

This shows how the low-level flight system is connected to the web application that can be used to control the aircraft.

Transclude of software-architecture.canvas