Ahmed Loay's profile

Project SPITFIRE

- What you see here is simplified by "My Life Project"
-To reach that level where i am now sharing this video to you all, i had to work for almost 7 years on every part of me, including my personality.
- All what i learned throughout these years in Electronics, PCBs Designing, Programming, Illustration, and 3D Modeling was for that single reason: "Building an Airplane".
- Not everything worked smoothly as some of you expected, i had many and many hard times figuring out what was wrong in what I'm doing, i had countless failures, fixing one creates another, and i got stuck in this loop for 5 years. But finally, after many years and so much hard work, i had the chance to see my airplane coming to life; suddenly, everything worked!
- The airplane you see in this video is a fourth version and the most high-tech among its three older sisters.
Project Guide:
1- The Story
2- Design
3- Reinforcements
4- Electronics & Hardware
5- Software
6- Version Differences
7- Integrated Projects
8- Gallery


1- THE STORY
- It all started when i was a little child who had an unexplainable love for any object capable of flying; I thought back then that flying is the freedom itself; i thought of it as a super power that a human would never naturally have. I started building a ton of paper airplanes; i even tried hooking up a motor to it but surely nothing flew, obviously because i was using a motor that weighed a ton itself and the tiny paper airplane never had a chance.
- Through my school preparatory years i was trying to build an airplane, and when i say i tried i mean i literally got wood and started to fabricate it; notice that i was just a little 10 years old kid tinkering with chainsaws and such stuff.
- Getting older throughout the years approximately at the age of 12 i built my first ever real plane-Looking airplane with a real aero foil and i thought to myself "i'm gonna get this thing to fly".
- Having the chance of entering my national STEM schools gave me a higher chance of success so i continued creating the project.
- Despite entering STEM Schools, i wasn't able to get my hands on a commercial remote control and receiver for the airplane; so i had to overcome this problem somehow, and the only way to do it was by learning Programming, Electronics and 3D Modelling so that i can design my own system.


Spitfire V1
2- Design
-Since i managed to learn vector designing and illustration i based the next versions of the airplane on the mighty Spitfire airplane.
- The airplane design is executed using a laser cutter on a 5mm maker foam board.
- To glue the airplane together i used a simple glue gun.
-The Spitfire is a British single-seat fighter aircraft that was used by the Royal Air Force and other Allied countries before, during, and after World War II.

3-  Build Reinforcements
- This type of foam i was using was strong but not enough so i designed wooden reinforcements for it to increase the plane's durability.
4- Electronics & Hardware
- Coming to one of the hardest and time-consuming parts of the project which is the 
electronics, The brain of the on-board system is a typical Atmega328p communicating with a transmitter using another Atmega328p through the wideband NRF24l01 Radio module giving us a controllable range of 1.5 to 2 kilometers

The airplane has an Accelerometer for monitoring the plane acceleration about the XYZ axes, and a Gyroscope for keeping the plane gyroscopically stable in the air against air bumps.
- In addition to all of these sensors, the plane has an onboard telemetry transmitter that communicates with another telemetry on the ground station, it’s used to send all the data from the plane (Speed, Position, Battery Voltage, Consumed Current, gyroscope angles) to the ground station to be visualized on a laptop screen.

Spitfire V2
The connection of all the sensors mentioned above with the main system takes a very preciesly designed PCB that could reliably manage the whole flight system.
For more information about the PCB check: Airplane Controller V3 [SMT Version]
5- Software
- As i mentioned before, the airplane controller is mainly based on the Atmega328p microcontroller which is, as some of you might know, the heart of the Arduino development board that can be programmed by a the computer software Arduino IDE.
- the code is the most time consuming part of this project; it is what took me these many years to work it out. i was a boy that had no knowledge whatsoever in coding.

- In the next part I'll try as i can to explain the code without getting too complicated

- First of all i included the libraries i'm gonna use as following
#include <SPI.h>          // used to handle Serial Peripheral Interface between the radio module and controller
#include <nRF24L01.h>   // required by the NRF24l01 radio module  
#include <Wire.h>   //This library allows the communication with I2C devices as the Oled screen.
#include <Adafruit_GFX.h>      // required by the OLED screen.
#include <Adafruit_SSD1306.h>   // required by the OLED screen.
#include <EEPROM.h>   // required by to save the data to the EEPROM of the Atmega328p

- Define the type of data i'm sending to the reciever
struct MyData {     
  byte throttle;
  byte yaw;
  byte pitch;
  byte roll;
  byte AUX1;
  byte AUX2;
  byte AUX3;
  byte AUX4;
};

- linking data types to the transmitter joy sticks and button inputs
data.throttle  = constrain(throttle_to_send,0,255);
data.yaw       = constrain(yaw_to_send,0,255);
data.pitch      = constrain(pitch_to_send,0,255);
data.roll         = constrain(roll_to_send,0,255);
data.AUX1     = digitalRead(toggle_1);
data.AUX2     = digitalRead(toggle_2);
data.AUX3     = digitalRead(toggle_3);
data.AUX4     = digitalRead(toggle_4);

- Here we write a function to set the NRF24l01 module as a Transmitter
radio.begin();
radio.setAutoAck(false);
radio.setPALevel(RF24_PA_HIGH);
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipeOut);
radio.stopListening();

- Write the data to the transmition pipe
radio.write(&data, sizeof(MyData));   

//////////////////////////////////////////Reciever////////////////////////////////////////////

- First we write a function to set the NRF24l01 module as a receiver
radio.begin();
radio.setDataRate(RF24_250KBPS); 
radio.setAutoAck(false);
radio.openReadingPipe(1,pipeIn);
radio.startListening();

- Then we map the received values to (1000 to 2000 Millis) to send those values to the other Atmega328p that processes the data
ppm[0] = map(data.throttle, 0, 255, 1000, 2000);
ppm[1] = map(data.yaw,      0, 255, 1000, 2000);
ppm[2] = map(data.pitch,    0, 255, 1000, 2000);
ppm[3] = map(data.roll,     0, 255, 1000, 2000); 
ppm[4] = map(data.AUX1,     0, 1, 1000, 2000); 
ppm[5] = map(data.AUX2,     0, 1, 1000, 2000);

- Next we setup the Pulse-position modulation communication protocol to send those data to the second controller to process it
void setupPPM() {
  pinMode(sigPin, OUTPUT);
  digitalWrite(sigPin, 0); 
  cli();
  TCCR1A = 0;
  TCCR1B = 0;
  OCR1A = 100;
  TCCR1B |= (1 << WGM12);
  TCCR1B |= (1 << CS11);
  TIMSK1 |= (1 << OCIE1A);
  sei();
}

- Signal lost? then reset the data and the plane fall down safely rather than continue flying
unsigned long now = millis();
  if ( now - lastRecvTime > 1000 ) {
    resetData();
  }
  setPPMValuesFromData();


NOTE: The code is so much bigger but getting a little bit further things will get so much complicated to explain so i only included the easy to explain and, relatively speaking, the basic part of the code


6- Version Differences
- It had no electronics, motors or any moving parts
- Built only for testing

Version 2 [Built 2019]
- It had electronics, Arduino Control Board,
A Brushless Motor, and Servos
- It had a working self stabilization system
- It had clumsy wiring, many build errors,
bugs

- The first airplane to be cut on a CNC Laser Cutter
-The first version to utilize build reinforcements mentioned before
-The first version that had a landing gear
- It had the first working wireless transmition system
- started designing a fully autonomous system
- It had a working self stabilization system
- Eleminated the clumsy wiring by designing a PCB, which got rid of some system bugs
- It was so heavy (700 grams without the battery)


Version 4 [Built 2021]
- Autonomous system in progress
- It had a much professional self stabilization system
- Designed a much high tech PCB, which eliminated many hidden system bugs and enabled me to easily program it
- Solved the weight problem by adding less paint that was a result of the airplane light camouflage

7- Integrated Projects
8- Gallery
Version 4 Gallery: SPITFIRE V4
Version 3 Gallery: SPITFIRE V3
Version 2 Gallery: SPITFIRE V2
Version 1 Gallery: SPITFIRE V1
3D Blender Model: Spitfire Mk. XVIII
Project SPITFIRE
Published:

Owner

Project Made For

Project SPITFIRE

Published: