My Final Project : FABFLY

Description:

FABFLY is a RC aircraft , that have several inputs and outputs , and the new function that I tried to put is that while flying if I didn’t move the stick in the transmitter , it will try to balance it self , and the accelerometer will help me with that , so the aircraft build from balsa wood and attached with some 3D printed parts and covered with a material called monokote , which will help in reducing the weight of the aircraft .

this is a video of one of the first aircraft I built and flow.

Bill of material :

in this project all what I did buy is the Balsa wood and the monokote which cost me around 55 $ ,so all the other materials I found it available in the lab , this is what encourage me to make this project ,however the materials that I used in my project are the following :

1- Balsa wood. (10 peces. 300x1000 mm )

2- monokote.

3- servos. (three , for the control surface )

4- Brushless motor. (one to get thrust )

5- accelerometer. (one )

6- receiver and transmitter. (one each )

7- small rods. (20 cm )

8- Lipo Battery. (one battery)

9- PCB.( the main controller )

10-ESC.

Fabrication Method that I used:

1- 2D & 3D Designing.

2- Laser Cutting.

3- 3D Printing.

4- PCB making.

5- Programming.

How Did I control the Aircraft :

so in the aircraft there are some movable parts that will control the movement of it , on my aircraft I have , two ailerons , elevator , and motor , you can find more about the movement surface on this page, however I used 3 Servos on my project and one motor with ESC as an output from my PCB , and my inputs are , the accelerometer , transmitter and receiver , so the servos were controlling the ailerons and the elevator , to move them up and down , and of course we control the brushless motor with ESC to varies the speed .

How did I make the Aircraft:

Laser Cutting:

so my first step was to design and laser cut my wing and body , however I faced some problems with finding a balsa wood in the first stage , but I managed to get it , how ever after I finish designing , I started to test the wood while cutting , trying to find the kerf so my wing will be a press fit design , after a long time of testing because the balsa wood is soft and easy to break , I found the best kerf that I can use , to assemble the wing without breaking the wood , the kerf was 0.3 .

3D printing:

I will talk about the main parts that I used 3D printed parts on , which are the attachment between the wing and the body , and the linkage of the elevator .

Assembly :

So after I design , laser catted and 3D printed my project , I started To assemble it and Cover the aircraft with monokote , so I started with the wings which was consist of RIPS and RODS , and I put a small amount of water on the grove so it will be more flexible and prevent it from breaking .
in picture below you will find that I used a 3 mm Rod , as hinges to attach the aileron to the wing and allowed to move easily .
However for the elevator , I chose to 3D printing the rod that will be connecting the elevator and the body as shown in the pictures .

So all what I experience and learnt in week6, helped me a lot to achieve this.

PCB Making:

So I design my PCB according to what I need ,using Atmega 328p and , 2 inputs (accelerometer & Receiver), and 4 outputs ( 3 servos and motor ) ,
I used Eagle, to design my schematics and board , I did smillar to what I did in week11,& week12. to fabricate my board .
and I used some Jumpers wire , as an extension from the board to the servos , to connected easily .

In addition , I used a step down , to regulate the voltage that will enter the PCB , from the Lipo Battery , to make sure that my BCP will not damage , because the voltage from the battery is 11 V , and the BCP only need 5 V .

Programming:

the most interesting part in my project is the Programming , which I learnt a lot on this stage , and it was fun , so to program my board , I used attmega 328p , which will help in reading PWM signals from the receiver , and it has the servo library as well , However I used my testing in week11& week12, to make sure my BCP is working , and then I started to write my code step by step , First by reading the serial from the transmitter to know the input range that I will use to map my servos and motor , then I read the accelerometer inputs and calibrated as well , actually , I would thank Daniel , and Hashim ,the mentors in FAB LAB UAE , it was a great chance to get some of their experience .
so this is my code :

#define REC1 8
#define REC2 7
#define REC3 6

#include <Servo.h>
#include <MPU6050_tockn.h>
#include <Wire.h>
MPU6050 mpu6050(Wire);
int xangel,yangel;
Servo ESC;
int aliron,alironR, alironL,elevator,motor;

Servo servoelevator;
Servo servoalironR;  
Servo servoalironL;

void setup() {
  // put your setup code here, to run once:
  ESC.attach(3,1000,2000);
  pinMode(REC1,INPUT);
   pinMode(REC2,INPUT);
    pinMode(REC3,INPUT);
  Serial.begin(9600);
   servoelevator.attach(A2);
   servoalironR.attach(A1);  
 servoalironL.attach(A0);

 aliron=0;
elevator=0;
motor=0;
alironR=0;
alironL=0;

servoelevator.write(90);
servoalironR.write(90);
servoalironL.write(90);

Wire.begin();
  mpu6050.begin();
mpu6050.setGyroOffsets(-6.31, 0.8, 0.39);
}

void loop() {



 aliron=pulseIn(REC1,HIGH);
   elevator=pulseIn(REC2,HIGH);
    motor=pulseIn(REC3,HIGH);

mpu6050.update();

if(aliron>1550 or aliron < 1450){

alironL=map(aliron,1500,2000,45,135);
alironR=map(aliron,2000,1500,45,135);  


servoalironR.write(alironR);
servoalironL.write(alironL);

Serial.println("manualx");


}else {

 xangel= mpu6050.getAngleX();

 alironL=map(xangel,-15,15,45,135);
alironR=map(xangel,15,-15,45,135);  


servoalironR.write(alironR);
servoalironL.write(alironL);
Serial.println("autox");

  }


if(elevator>1550 or elevator < 1450){
  elevator=map(elevator,1902,1087,45,135);
  servoelevator.write(elevator);
  }else{

   yangel= mpu6050.getAngleY();
   elevator=map(yangel,-15,15,45,135);
  servoelevator.write(elevator);
  Serial.println("autoy");
   }


   motor = map(motor, 1047, 1875, 0, 180);
    ESC.write(motor);





Serial.print("REC1: ");
Serial.print(aliron);
Serial.print(" REC2: ");
Serial.println(elevator);
//Serial.print(" REC3: ");
//Serial.println(motor);


  Serial.print("angleX : ");
  Serial.print(mpu6050.getAngleX());
  Serial.print("\tangleY : ");
  Serial.print(mpu6050.getAngleY());


delay(20);
}.  

that I used to program my project , and you will find some videos when I am testing my programming below :

Reading the inputs :

Testing the Servo program :

Testing accelerometer Program :

Testing the motor :

it was my last stage of programming .

Presentation Video :

you can see at the end of the video , that the aircraft did not fly unfortunately , I believe that I need to use a bigger motor , because the motor was small for this aircraft size .

Finally:

you can see at the end of the video , that the aircraft did not fly unfortunately , I believe that I need to use a bigger motor , because the motor was small for this aircraft size . You will find a lot of people build there own aircrafts , and there are some websites will help you if you want to try and you will find some ready designs as well in this Page.

Files :

You will find also all my files in this ZIP FOLDER, and you find the presentation video and picture in this page .

Creative Commons License
FABFLY done by Abdulla Alhamad is licensed under a Creative Commons Attribution 4.0 International License.