86
This document is downloaded from CityU Institutional Repository, Run Run Shaw Library, City University of Hong Kong. Title Quadrotor helicopter 3 Author(s) Yu, Wing Lung (余泳龍) Citation Yu, W. L. (2013). Quadrotor helicopter 3 (Outstanding Academic Papers by Students (OAPS)). Retrieved from City University of Hong Kong, CityU Institutional Repository. Issue Date 2013 URL http://hdl.handle.net/2031/7066 Rights This work is protected by copyright. Reproduction or distribution of the work in any format is prohibited without written permission of the copyright owner. Access is unrestricted.

This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

This document is downloaded from CityU Institutional Repository,

Run Run Shaw Library, City University of Hong Kong.

Title Quadrotor helicopter 3

Author(s) Yu, Wing Lung (余泳龍)

Citation Yu, W. L. (2013). Quadrotor helicopter 3 (Outstanding Academic Papers by Students (OAPS)). Retrieved from City University of Hong Kong, CityU Institutional Repository.

Issue Date 2013

URL http://hdl.handle.net/2031/7066

Rights This work is protected by copyright. Reproduction or distribution of the work in any format is prohibited without written permission of the copyright owner. Access is unrestricted.

Page 2: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page I

Department of Electronic Engineering

FINAL YEAR PROJECT REPORT

BEngCE-2012/13- WHL-15-BECEBIM

Quadrotor Helicopter 3

Student Name: Yu Wing Lung Student ID: Supervisor: Dr. LAU, Ricky W H Assessor: Dr. CHAN, Rosa H M

Bachelor of Engineering (Honours) in Computer Engineering

Page 3: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page II

Student Final Year Project Declaration

I have read the student handbook and I understand the meaning of academic dishonesty, in particular plagiarism and collusion. I declare that the work submitted for the final year project does not involve academic dishonesty. I give permission for my final year project work to be electronically scanned and if found to involve academic dishonesty, I am aware of the consequences as stated in the Student Handbook. Project Title : Quadrotor Helicopter 3

Student Name : Yu Wing Lung

Student ID:

Signature

Date : 22nd April 2013

Page 4: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page III

No part of this report may be reproduced, stored in a retrieval system, or transcribed in any form or by any means – electronic, mechanical, photocopying, recording or otherwise – without the prior written permission of City University of Hong Kong.

Page 5: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page IV

Content

Student Final Year Project Declaration .............................................................................. ii

Content .............................................................................................................................. iv

List of figures ................................................................................................................... vii

List of table ....................................................................................................................... ix

Project Abstract .................................................................................................................. 1

1.1 Introduction .................................................................................................................. 2

1.2 Project system Description .......................................................................................... 3

2 Background Study ........................................................................................................... 5

2.1 Design features of Quadrotor Structure ............................................................... 5

2.2Brushless motor .................................................................................................... 7

2.3 Brushless Motor driver ........................................................................................ 9

2.4 Propeller ............................................................................................................. 10

2.5 Flight control ...................................................................................................... 11

2.6 Sensors ............................................................................................................... 12

2.7 Proportional-Integral-Derivative (PID) ............................................................. 13

2.8 Stm32f407VGT6................................................................................................ 16

2.9 Keil ..................................................................................................................... 18

2.10 Printed circuit board (PCB) ............................................................................. 19

2.11 Tiny210 coreboard ........................................................................................... 20

2.12 Android ............................................................................................................ 21

2.13 Eclipse .............................................................................................................. 22

Page 6: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page V

2.14 Android Software Development Kit ................................................................ 22

2.15 Android Native Development Kit .................................................................... 23

3 Implementation ............................................................................................................. 24

3.1 The Quadrotor Hardware system (Mechanical Part) ......................................... 25

3.1.1 Quadrotor Frame ..................................................................................... 26

3.1.2 Quadrotor Brushless Motor..................................................................... 32

3.1.3 Propeller .................................................................................................. 34

3.1.4 Brushless Motor Driver........................................................................... 35

3.1.5 Bettery ..................................................................................................... 36

3.2 Quadrotor Control board .................................................................................... 37

3.2.1 The tasks of control board ....................................................................... 37

3.2.2 Peripherals of Tiny210 coreboard ........................................................... 40

3.2.3 Peripherals of STM32F407VGT6 microcontroller ................................. 41

3.2.4 Power System.......................................................................................... 45

3.2.5 Layout of control board .......................................................................... 47

3.3 Implement whole Quadrotor system .................................................................. 52

3.4 Flight Control ..................................................................................................... 56

4 Result ............................................................................................................................ 58

4.1 Specification of Quadrotor ................................................................................. 59

4.2 Flight control ...................................................................................................... 60

5 Discussion ..................................................................................................................... 61

5.1 Quadrotor frame ................................................................................................. 61

5.2 Brushless Motor ................................................................................................. 62

Page 7: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page VI

5.3 Brushless Motor Driver...................................................................................... 63

5.4 Propeller ............................................................................................................. 64

5.5 Power system ..................................................................................................... 66

5.6 Flight Control ..................................................................................................... 67

5.7 Designing the schematic and routing the PCB layout ....................................... 68

6 Conclusion and Further Development .......................................................................... 70

7 Appendix ....................................................................................................................... 71

8 References ..................................................................................................................... 76

Page 8: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page VII

List of figures

Figure 1 Quadrotor system Description ..................................................................... 3

Figure 2 The motor and Frame structure of Quadrotor .............................................. 6

Figure 3 The coils and magnets of Brushless motor .................................................. 7

Figure 4 the structure of Brushless Motor ................................................................. 8

Figure 5 Brushless motor driver (ESC) ..................................................................... 9

Figure 6 Positive and Negative Propeller ................................................................ 10

Figure 7 Flight control of Quadrotor ....................................................................... 11

Figure 8 PID system................................................................................................. 13

Figure 9 change Kpvi ................................................................................................ 14

Figure 10 change Kivi ............................................................................................... 15

Figure 11 change Kdvi .............................................................................................. 15

Figure 12 STM32F407VGT6. ................................................................................. 16

Figure 13 STM32F407 Structure ............................................................................. 17

Figure 14 Logos of Keil ........................................................................................... 18

Figure 15 Eagle Logo............................................................................................... 19

Figure 16 ERC function ........................................................................................... 19

Figure 17 Eagle design rule ..................................................................................... 20

Figure 18 Tiny210 coreboard ................................................................................... 20

Figure 19 Specification of Quadrotor Frame ........................................................... 26

Figure 20 aluminum tube ......................................................................................... 27

Figure 21 First prototype frame ............................................................................... 27

Page 9: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page VIII

Figure 22 aluminum U shape tube ........................................................................... 28

Figure 23 aluminum U shape Frame ........................................................................ 28

Figure 24 Deformed aluminum U shape Frame ...................................................... 29

Figure 25 Carbon Fiber tube .................................................................................... 29

Figure 26 Comparison with two type Carbon Fiber tube ........................................ 30

Figure 27 round inside Carbon Fiber Frame ............................................................ 30

Figure 28 junction of Carbon Fiber Frame .............................................................. 31

Figure 29 1400KV SunnySky brushless motor ....................................................... 33

Figure 30 four different size propellers.................................................................... 34

Figure 31 Brushless Motor Driver ........................................................................... 35

Figure 32 Lithium polymer battery .......................................................................... 36

Figure 33 Tasks of controllers .................................................................................. 38

Figure 34 Schematic of Two controllers .................................................................. 39

Figure 35 UART ports ............................................................................................. 39

Figure 36 The schematic of Tiny210 peripherals .................................................... 40

Figure 37 The schematic of peripherals of STM32F407VGT6 microcontroller ..... 42

Figure 38 The schematic of basic hardware needs of microcontroller .................... 44

Figure 39 Flash loader ............................................................................................. 44

Figure 40 J-Link ....................................................................................................... 45

Figure 41 power system ........................................................................................... 46

Figure 42 The schematic of Power circuit ............................................................... 47

Figure 43 The comparison of two version control board ......................................... 48

Figure 44 Layout of control board ........................................................................... 49

Page 10: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page IX

Figure 45 The real control board.............................................................................. 50

Figure 46 Description of control board .................................................................... 51

Figure 47 soldering of sensors module .................................................................... 52

Figure 48 structure of Quadrotor ............................................................................. 53

Figure 49 The real structure outcome ...................................................................... 53

Figure 50 connection circuit with battery ................................................................ 54

Figure 51 Quadrotor stand ....................................................................................... 55

Figure 52 Quadrotor ................................................................................................. 55

Figure 53 Bluetooth ................................................................................................. 56

Figure 54 X,Y and Z axis tuning system ................................................................. 57

Figure 55 Quadrotor ................................................................................................. 58

Figure 56 The video of balancing of Quadrotor ...................................................... 60

Figure 57 testing the propeller ................................................................................. 65

List of table

Table 1 requirement of Quadrotor Hardware ........................................................... 25

Table 2 the rating of 1400KV motor ........................................................................ 33

Table 3 Specification of Control Board ................................................................... 37

Table 4 specification of Quadrotor .......................................................................... 59

Page 11: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 1 of 76

Project Abstract

In this final year project, we aim to build an Android based Quadrotor Helicopter.

Quadrotor Helicopter has invented for many years. The function is widely used in

research and entertainment. In our project, these functions are also implemented like video

streaming. The Quadrotor Helicopter can be dividing into two parts. One is hardware and

another one is software.

In hardware part, a Quadrotor Helicopter frame is designed. Also, the frame is contained

four motor, four motor drivers and a control board which contains different functions like a

WIFI antenna and a camera.

In software part, Android OS is embedded into the system. The jobs of OS is to

communicate with another Android device through WIFI signal. The user can make a

command through this device to the Quadrotor. Also, the Quadrotor system also contains

another Microcontroller Unit which mainly receiving the sensors signals and controling the

motor movement.

Although there are many Quadrotor product sold in many model shop, we tried our best to

build all parts in Quadrotor by ourselves. My main works in this project are to develop the

hardware related to whole system of Quadrotor and a Printed Circuit Board (PCB) for

controlling. Also, I need to implement the Quadrotor by using Proportional Integral Derivative

(PID) to control the Quadrotor.

Flying is our dream.

Page 12: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 2 of 76

1.1 Introduction

Quadrotor, which is a four motors helicopter, can be used in many different area of our

life. There are many people around the world building the Quadrotor for their own interest.

Also, there are many lecture teaching about how the Quadrotor fly and the flight control

method. Quadrotor can be also embedded with a camera to explore in the danger space or for

security purpose.

In this project, a Quadrotor needed to be built which means that the whole Quadrotor

system needed to design from mechanical part and the electronic part. Also, the soul of the

Quadrotor, which is the control system, will also be designed. Different form the traditional

Quadrotor, this Quadrotor is designed not to use with the radio frequency controller in the

controlling part. But, for a user friendly system, user can use their own Android device to

connect with the Quadrotor and have a video streaming feedback.

So, the goals of this Quadrotor are listed below:

On Quadrotor Fly Autonomous Video (or data) feedback

On User Control

by Android device by computer

connect with Quadrotor Internet Network (WIFI) Bluetooth

Page 13: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 3 of 76

1.2 Project system Description

Figure 1 Quadrotor system Description

Android system

Microcontroller

Page 14: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 4 of 76

As shown in Figure 1, there are two system designed in the Quadrotor system which are

the Android system and microcontroller. For the Android system, the Samsung S5PV210 is

the main controller of Android system and it is built on a coreboard called Tiny210. The

Tiny210 coreboard will then control the camera and WIFI. The user Android device can

connect with the Tiny210 coreboard through WIFI signal.

On the other main part, it is a microcontroller STM32F407 which is developed by

STMicroelectronics. This microcontroller will control the motor motion, receive the sensor

signal and also communicate with user computer.

Besides, the Quadrotor Flight control is also needed to implement after this whole

system is built.

Page 15: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 5 of 76

2 Background Study

In this part, the background study will be mentioned which is very useful for understand

the Quadrotor system built in the chapter 3. The flow of this chapter is to mention the

hardware part first and then the software part.

2.1 Design features of Quadrotor Structure

The Quadrotor must consist of four motor and placed in perpendicular form on a

Quadrotor frame as Figure 2. The distance (d) of placing the motor must be equal with each

other so the Quadrotor can be easier to control. In order to provide a big lift force, the brushless

motor is always implemented in Quadrotor as it can spin faster than brushed motor when

compared with using power (this will discuss in after this sub-chapter).

Page 16: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 6 of 76

Figure 2 The motor and Frame structure of Quadrotor

To drive the brushless motor, a three phase signal will be input to the motor. So, a driver is

needed to output this signal to the motor. Then, four brushless motor drivers are added to the

Quadrotor structure.

Page 17: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 7 of 76

2.2Brushless motor

The Brushless motor is often made by coils and permanent magnet as Figure 3.

Figure 3 The coils and magnets of Brushless motori

The mechanism of Brushless motor spinning is that by input three phase shift with

120∘different signal. Then, the magnet of coils will be changed because of the current flow

changed which is shown in Figure 4. So, the permanent magnet will be either repel or attract

with the coils and so the shaft will be spin.

Page 18: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 8 of 76

Figure 4 the structure of Brushless Motorii

There is difference with brushed motor and brushless motor. The brushed motor has a

fixed armature and the brushless motor is to continuous switching the phase to change the coils

magnet to rotate. So, the brushless motor has some advantage over the brushed motoriii, like

more torque per weight (the power per size output), more torque per watt (much efficiency),

more reliability, longer lifetime and reducing the noise produced.

Page 19: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 9 of 76

2.3 Brushless Motor driver

In order to generate the three phase shift with 120∘signal, a Brushless motor driver is

needed for translating a Pulse width Modulation (PWM) signal to that particular signal. So,

the driver always named Electronic Speed Control (ESC) as shown in Figure 5.

Figure 5 Brushless motor driver (ESC)

Nowadays, the role of Brushless Motor driver is not only translating the signal to motor

but also converting the Battery voltage (like 11.1V) to 5V (generally)and 2A maximum

output current. This function in ESC is called Battery Eliminator Circuit (BEC). The purpose

is to provide a stable voltage to its controller and, therefore, the circuit to step down the

voltage is eliminated.

It is important to buy the ESC with BEC as the ESC can provide a stable power to the

control board when the motor is driving in a high speed.

Page 20: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 10 of 76

2.4 Propeller

The Quadrotor propellers always are consisted positive and negative propeller like

Figure 6. It is related with the flight control of Quadrotor (it will discuss in chapter 2.4).

The Propeller used in Quadrotor is very important as it is affecting the flight motion.

There are many difference length and pitch propeller in the world. The length and the angle

of pitch are definitely producing very different power transfer efficiency.

For example, in general, using a longer and high pitch propeller produces a thrust that

consumes less power input than using a short and lower pitch propeller.

Figure 6 Positive and Negative Propelleriv

Page 21: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 11 of 76

2.5 Flight control

As Quadrotor just has four moveable parts which are the four motors, the flight control

of Quadrotor is just related to this four motor spinning speed to control its yaw, pitch, row

and height movement. As shown in Figure 7, there are the top views of eight possible

movement of Quadrotor. If the arrow is thick, it means that the motor is spinning fast to

provide a bigger thrust.

In case (a), the 2 and 4 motor is faster, so the Quadrotor will have a clockwise Yaw

movement which follow the faster motor spin direction. So, in case (b), the anti-clockwise

Yaw movement will be performed as the motor 1 and 3 is faster.

Besides, in case (c), (d), (e) and (f), the Quadrotor will have a roll or pitch movement

along with the fastest motor. So, the Quadrotor would have an angle with horizon.

Last but not least, the case (g) and (h) are the landing and take-off state respectively as

the motors are either spin quickly or slowly.

Figure 7 Flight control of Quadrotorv

(a) (b) (c) (d)

(e) (f) (g) (h)

Page 22: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 12 of 76

2.6 Sensors

There are three types of sensors commonly used in the Quadrotor to detect the flight

motion.

The first one is Gyroscope. Gyroscope is a device measuring the orientation. When there

is a force changing its orientation, the angle changed can be read from this device. So, in

Quadrotor system, Gyroscope is always used in measuring the angle changed with each axis.

Second, Accelerometer is also commonly used in electronic device and Quadrotor.

Because it cannot only measuring the force changed along each axis but also measuring the

flight distance.

Third, Compass also helps to control the Yaw movement of Quadrotor. As Compass is

measuring the magnetic field from the Earth, the relativity orientation of the Earth and the

Quadrotor can be measured. So, the Quadrotor can adjust its flight direction.

Page 23: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 13 of 76

2.7 Proportional-Integral-Derivative (PID)

The proportional-integral-derivative is an algorithm to control output close to the set

point. The PID is feedback loop systems which the error will be also count as an input of next

process calculation as shown as in Figure 8. The r(t) is the new received error and y(t) is the

past error.

Figure 8 PID systemvi

There are some description on how P,I and D affecting the system.

Page 24: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 14 of 76

For P(Proportional), if the constants of Ki and Kd hold, increasing the Kp will lead to

make the system more oscillate and increase the time needed to meet the set point.

Figure 9 change Kpvi

For I(Integral), as the I term is related to past error. If the Ki term is bigger, the error

affect the system will take longer. As shown as in Figure 10, when the Ki increase, the system

changes to much more oscillate than increasing Kp and also take longer time to meet the set

point.

Page 25: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 15 of 76

Figure 10 change Kivi

For D (Derivative), is used for preventing the future errorvi , like minimize the overshoot

of PI. As shown in Figure 11, increasing Kd lead to more stable.

Figure 11 change Kdvi

Page 26: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 16 of 76

2.8 Stm32f407VGT6

In Quadrotor system, an ARM Cortex M4F microcontroller core is used. The

microcontroller is Stm32f407VGT6 as shown in Figure 12.

This microcontroller is supporting floating point calculation and the working frequency

up to 168 MHz. Also, it provides three I2C interfaces, four USARTs and 3SPI interface.

Besides, it provides 17 timers output and 4 timer input. This microcontroller is very suitable

for designing a system for Quadrotor as the floating point calculation function is good for

calculating the sensor’s data transfer to degree.

Figure 12 STM32F407VGT6.

Moveover, the microcontroller has up to one MB Flash (as shown in Figure 13) to store

program or data which is very suitable for storing the sensor data and use it afterward.

Also, the programing method of this microcontroller is either use J-Link programmer,

USB or UART.

Page 27: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 17 of 76

Figure 13 STM32F407 Structure

Page 28: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 18 of 76

2.9 Keil

Keil is a programming software tools for programming the ARM microcontrollers. This

software provide a bunch of library for programmer to program the microcontroller. Also, it

provide a hardware debugging function which can do an online debugging with

microcontroller.

There is the logo of Keil and the version used in this project is µVision4 as shown in

Figure 14.

Figure 14 Logos of Keil

Page 29: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 19 of 76

2.10 Printed circuit board (PCB)

The PCB is needed in developing the system of Quadrotor. Eagle (as shown in Figure 15)

is chosen for drawing the schematic and the layout.

Figure 15 Eagle Logo

This software have rich library and easy for drawing either schematic or layout. Also,

there are some useful functions for checking the schematic and layout of PCB. For example,

there is an Electrical Rule Checking function as shown in Figure 16. This function will notice

user there are some problem with the layout. Usually, this problem is breaking the preset

design rule as shown in Figure 17.

Figure 16 ERC function

Page 30: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 20 of 76

Figure 17 Eagle design rule

2.11 Tiny210 coreboard

As the Quadrotor needs to embed an android system to have a communication with

internet, a Tiny210 coreboard is chosen to embed with the Quadrotor system.

A S5PV210 ARM Cortex A8 core is used in this Tiny210 coreboard. Also, there are 512

DDR2 RAM and 1GB NAND Flash in the coreboard

Figure 18 Tiny210 coreboard

Page 31: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 21 of 76

2.12 Android

Android is an open source operation system which is based on java language. Android is

now widely used in many smart phones. Android OS is developed on a Linux Kernel. The most

advantage of using android is Multi-platform support which means the application can be used

in a wide variety of hardware. The reason of why android application can have ability to use in

different device is the Linux Kernel. As the Linux provided many hardware drivers to

programmer, so that programmer can no need to care about the hardware setting and how it

work. Programmer can just use the Linux library to control the hardware on the higher level.

The following figure shows the structure of Android and the relationship with Linux

Kernel.

Page 32: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 22 of 76

2.13 Eclipse

Eclipse is a tool which can install Android Software Development Kit (Android SDK) and

Android Native Development Kit (Android NDK). Then, the Android application can be built

through Eclipse program environment.

2.14 Android Software Development Kit

The Android Software Development Kit (SDK) is a set of verity device development

library. SDK can help programmer to develop Android application in different android version.

Also, it provides different android version emulator which can simulate the application run on

different android version. Besides, it provides a linkage with hardware through USB driver.

The command “adb devices” can be used to check the collection with hardware devices

after install USB driver.

Page 33: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 23 of 76

2.15 Android Native Development Kit

The Android Native Development Kit (Android NDK) give Eclipse a capability to

develop a C or C++ program link with android program. NDK give a convenient environment

to programmer to control hardware driver in Linux Kernel.

Page 34: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 24 of 76

3 Implementation

In this chapter, the personal works of this project will be shown.

Work allocation

Page 35: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 25 of 76

The main jobs of this project are mainly focus on the hardware and tuning the PID of the

Quadrotor.

3.1 The Quadrotor Hardware system (Mechanical Part)

The Hardware systems consist of few main parts.

Before talking about how to build the Quadrotor Hardware system, some requirements

are needed to define first so as to build a suitable Quadrotor as shown in Table 1.

Table 1 requirement of Quadrotor Hardware

Criteria Value

Width < 50cm and >30cm

Length < 50cm and >30cm

Height < 20cm

Weight < 1.5kg

Page 36: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 26 of 76

3.1.1 Quadrotor Frame

The Quadrotor frame is needed to provide a platform to install the motors, drivers and

the Stm32 board. The frame must be firm, large enough and not easy to deform.

The size specification of Quadrotor frame is shown in Figure 19. All prototypes are

following this specification. As the longest selected propeller is 9 inch (22.86cm), so 28cm

between the nearest is suitable.

The frame has been built several prototypes. Finally, the Carbon Fiber material is chosen

for the Quadrotor frame instead of aluminum.

45.4cm

Brushless Motor mounting hole

Frame

22.2cm

20cm

17.5cm

1cm

Figure 19 Specification of Quadrotor Frame

Page 37: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 27 of 76

At first, an aluminum tube (as shown in Figure 20) used as the frame as Figure 21. In

Figure 21, there are two aluminum pads to hold these two tube, so the weight of this frame is

about 300g which is very heavy to the Quadrotor.

Figure 20 aluminum tube

Figure 21 First prototype frame

Page 38: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 28 of 76

Second, an aluminum U shape tube (as shown in Figure 22) is applied to the frame.

Figure 22 aluminum U shape tube

As the U shape tube is easy to deform, as shown in Figure 23. Part of frame is deformed

because of the motor excessive response as shown in Figure 24. The weight of this Frame is

about 71g.

Figure 23 aluminum U shape Frame

Page 39: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 29 of 76

Figure 24 Deformed aluminum U shape Frame

Finally, a Carbon Fiber tube is used. There are two types Carbon Fiber tube as Figure 25.

The difference is the round inside and square inside. The square inside tube is lighter than

the round inside one, but the round inside tube is stronger than the square inside tube.

Figure 25 Carbon Fiber tube

Page 40: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 30 of 76

In Figure 26, there are two Carbon Fiber tube with a hole drilled. But, the square inside

tube is broken as it cannot afford the force of drilling. However, the round inside tube stays

the same.

Figure 26 Comparison with two type Carbon Fiber tube

Therefore, a frame using the round inside Carbon Fiber tube is built as Figure 27. The

weight is about 88g.

Figure 27 round inside Carbon Fiber Frame

Page 41: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 31 of 76

The junction of this frame is different from the previous prototype as shown in Figure 28.

The reason of changing the mounting method is that this method requires less metal used and

the junction is even stronger than the previous prototype. To do this, four angle bar and high

density epoxy are used. The high density epoxy used for filling the gap between the angle bar

and the Carbon Fiber Frame, so the frame can be more firm and solid.

Figure 28 junction of Carbon Fiber Frame

Page 42: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 32 of 76

3.1.2 Quadrotor Brushless Motor

The Motor used in Quadrotor must be Brushless as it can not only provide more stable

and efficient power transfer, but also fast speed spinning.

First of all, there are many model motor around the world. The factor of choosing the

right model motor is based on the unit ‘KV’ and which speed the designer wanted to have.

‘KV’ means the Revolutions per minute (RPM) per Voltage (V) which means how fast

the shaft of motor rotate without any load in 1V. For example, a motor is rated 1000KV

which means if the motor run under 11.1V and without any load, the motor will perform

1000 KV x 11.1V = 11100RPM. Therefore, higher KV means the speed of motor shaft

rotation higher. However, higher KV motor does not mean that is good for every model. As

higher KV motor cannot use with a long propeller because the propeller will be destroyed by

the high speed. On the other hand, lower KV can provide a bigger thrust with a long propeller

which is more suitable.

In this Quadrotor project, four 1400KV brushless motor is used. The reason of choosing

1400KV is based on the Table 2. As the motor can produce around 650 - 1000g maximum

force, this suit the requirement needed. The size of propeller used to provide the thrust is 8 to

9 inch which is suitable for the Quadrotor. Also, the efficient (Force / Watt) of this motor is

also acceptable.

Page 43: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 33 of 76

Table 2 the rating of 1400KV motorvii

So, the four 1400KV produced by SunnySky brushless motor (as shown in Figure 29) is

bought and the weight of four motor is 280g (70gx4).

Figure 29 1400KV SunnySky brushless motor

Page 44: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 34 of 76

3.1.3 Propeller

As the motor is chosen, the selection of propeller is based on the rating of the motor as

Table 2. Four different size propellers are bought for testing which is better. As shown in

Figure 30, the ‘A’, ‘B’, ‘C’ and ‘D’ are 6inch, 7inch, 8inch and 9inch respectively. Also, the

pitch angle of all this propellers is 45 degree which is under testing propeller rating as Table

2.

The weight is less than 10g (total of four propeller).

The final choice of propeller is discussed in discussion chapter.

Figure 30 four different size propellers

Page 45: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 35 of 76

3.1.4 Brushless Motor Driver

The motor driver is an interface of microcontroller to control the brushless motor. There

are many different standard of brushless motor driver, like 20A, 30A, 40A or even 100A.

This rating means the maximum current provided to the motor. Also, as said in background

study, it is important to ESC with BEC which the driver can provide a 5V with 2A power for

controller working.

Therefore, after concerning the price and the rating of drivers, the ZTW 40A with BEC

is bought. The reason is based on the rating of motor as Table 2. As this driver can maximum

provide 40A (or 32 A in 80%), it can totally fulfill the current needs of motor.

To control the Brushless motor through the driver, the controller must send Pulse-width

modulation (PWM) signal to the driver and limit the signal width form 1000ms (for starting

and no spinning of motor) to 2000ms (for full speed of motor).

The Drivers’ weight is 280g in total (70gx4).

Figure 31 Brushless Motor Driver

Page 46: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 36 of 76

3.1.5 Bettery

As the brushless motor driver is needed to input 3 cells 11.1V Lithium polymer (Li-Po)

battery, as shown in Figure 32, 1500mah and 2200mah are used in Quadrotor. The weight of

2200mah and 1500 battery are 378g (189g x2) and 284g (142g x2) respectively.

Figure 32 Lithium polymer battery

Page 47: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 37 of 76

3.2 Quadrotor Control board

As the Quadrotor needs to control its flight motion itself, a control board needed to

create. In this part, the board’s elements will be mentioned and the entire schematic is also

attached in Appendix.

Some specification is needed to define for easy designing the control board as Table 3.

Table 3 Specification of Control Board

Criteria Value

Controller Microcontroller and Android OS

Power input 5V

Sensor Gyroscope, Accelerometer, Compass

Signal of Controlling Brushless Motor 4 PWM signal

Peripherals LED, LCD monitor, WIFI and Camera

3.2.1 The tasks of control board

As mentioned in the project system description, there are two controllers in the board.

The tasks needed to complete is by using this two controllers.

One controller is the Tiny210 coreboard as Figure 18. The Tiny210 is embedded an

Android OS and its main task in the Quadrotor system is to receive the WIFI command,

which sent from an android device, and transmit commands to the microcontroller in the

board. Also, it needs to transmit a real time camera signal to the Android device.

Another controller is STM32F407VGT6 microcontroller which is shown as Figure 12. The

main tasks of this microcontroller are to receive the sensor signal and calculate the motor

output PWM value using PID algorithm.

Page 48: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 38 of 76

As shown in Figure 33, these two controllers are using UART to do communication. The

Hardware needed for support their normal operations are also shown in the Figure 33. So, the

task of the control board is to provide a platform for these peripherals.

As the Figure 32 shown, the hardware needs of the Cortex-A8 controller, which is the

Tiny210 coreboard, is needed a WIFI module, Camera module, SD card Port and the

connection Port with a LCD monitor. Also, for Cortex-M4, which is the STM32F407VGT6

microcontroller, is the output port for the PWM signal to motor driver, connection with the

sensor module and some other peripheral such as LED light, Buzz and a 8 x 2 LCD monitor.

Figure 33 Tasks of controllers

So, some pins of controllers are reserved for these operations to perform these functions.

As shown in Figure 34, the left hand side of the figure is related to Tiny210 coreboard and

another side is related to the microcontroller.

At the middle bottom of Figure 34 (also shown in Figure 35), there are some UART

ports reserved from two controllers to establish the communication. Normally, the TINYRX2

connects with STMRX4 and the TINYTX2 connects with STMTX4 by soldering some tin to

connect these four pads. The reason of doing this way instead of hard wire them together is

the UART can communicate with computer individually.

Page 49: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 39 of 76

Figure 34 Schematic of Two controllers

Figure 35 UART ports

Page 50: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 40 of 76

3.2.2 Peripherals of Tiny210 coreboard

As mentioned in Figure 33, there are some peripherals to support the normal operation

of Tiny210 coreboard which are the WIFI, camera and LCD monitor.

The schematic of these peripherals is shown inFigure 36. The booting selection, real

time clock and button part are also implemented in this schematic. For the booting selection

part, there is a switch for booting memory form SD card (for reloading the android system) or

from its memory (for normal operation). Also, there are many pull high resistors in Button

and real time clock part for deactivate the functions.

Figure 36 The schematic of Tiny210 peripherals

Page 51: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 41 of 76

3.2.3 Peripherals of STM32F407VGT6 microcontroller

The peripherals of microcontroller can be separate in several parts. As shown in Figure

37, there are LCD monitor (for connect with 8 x 2 LCD monitor), four LEDs, circuit for

output PWM signal and circuit for communication with sensors.

In the LCD monitor part, there is a 10kΩ variable resistor for adjust the background

light. Also, the special point of the LCD monitor is that it can accept 3V logic high signal but

its input power must be 5V.

In four LEDs circuit, the resistors used for limiting the current is 470 which limit the

current not greater than 3.3V/470Ω = 7.02mA and this current is enough to driving the

LEDs to light.

Also, there is a Buzzer place near the LEDs. It can be either a sourced buzzer or a no

source buzzer to fit in this part. As the signal connected with the buzzer can output a PWM

signal or a programmable logic signal. A PWM signal can be used with a no source buzzer to

create different tone. The programmable logic signal can be used with the sourced buzzer.

When there is a logic high signal output to the buzzer, the buzzer will provide a tone instantly

which is easier for implementation.

In the Output PWM signal circuit part, as the signal voltage output from the

microcontroller is between 0V to 3V but the logic level of motor driver is between 0V to 5V.

So, the PWM signals from the microcontroller are needed to convert to higher voltage. There

are four pairs transistor with 100Ω resistor and 500Ω resistor used to implement this

conversion. By this conversion, there is a inverted signal different between the 5VPWM

signal and PWM signal from the microcontroller.

Page 52: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 42 of 76

In the sensors part, microcontroller is used an I2C signal to communicate with a three

sensors which is Gyroscope, accelerometer and compass. As these three is built on a sensor

module, an eight pin female header is used to connect with the module. Also, there is a spare

I2C port for debugging.

Figure 37 The schematic of peripherals of STM32F407VGT6 microcontroller

Page 53: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 43 of 76

Besides, there is also some hardware needs for STM32F407VGT6 microcontroller to

provide a normal operation, as shown in Figure 38. There are several parts must be included

in the design so as to use the microcontroller.

The reset circuit must be implemented because this is important for debugging on

programming. The programmers can reset the microcontroller whenever they want.

The clock circuit is also important as this is providing an external clock signal which is

faster than the internal clock. So, the microcontroller can work quicker. Also, by

programming the setting of the microcontroller, the microcontroller can work up to 168 MHz

which is more suitable for doing the calculation of sensors data.

The Programming and the boot selection circuit is also providing a channel for

programmers to program it. There are two ways to program the microcontroller. First, in the

boot selection circuit, the Boot 0 pin can either pull high by a 10kΩ resistor or pull low by a

510Ω resistor and Boot 1 is always pulled low. The reason to do design this circuit is that

when Boot 0 is pulled high, it means the microcontroller will enter a programming mode

which is a default function of this microcontroller from the factory. Then, the UART

programming function will start automatically. A Flash loader software (as shown in Figure

39) can be used to send a HEX file to the microcontroller. Second, when the Boot0 pulled low,

the J-Link programmer can be used to program the microcontroller. By linking the SWDIO

and SWCLK to the J-Link (as shown in Figure 40) with suitable downloading setting in the

programming software (Keil), the microcontroller can be directly programed by the

programming software. Also, the J-Link can also provide an online debugging function with

Keil which is very useful.

Page 54: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 44 of 76

Figure 38 The schematic of basic hardware needs of microcontroller

Figure 39 Flash loader

Page 55: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 45 of 76

Figure 40 J-Link

3.2.4 Power System

As there are different voltages level needed to fulfill in the whole Quadrotor system,

some voltage step down technique are required.

As shown in the Figure 41, the power source of Quadrotor is from 11.1V Lithium

polymer battery (Li-Po battery). To provide a 5V power source, A 11.1 V to 5 V voltage step

down circuit is needed. However, the control board is no needed to implement this circuit

because the brushless motor driver has a Battery Eliminated Circuit (BEC) for doing 11.1 V

to 5 V voltage step down and maximum 2A current output. So, four motor drivers can

provide a 5V and maximum 8A current output.

Therefore, the whole power system is based on this 5V and 8A maximum power output.

As the Tiny210 coreboard is embedded a step down circuit inside the coreboard, the voltage

input of Tiny210 is 5V and used maximum 1A (measuring when using with LCD monitor,

Camera and WIFI simultaneously).

On the other hand, as the working voltage of microcontroller is 3.3V. So, a 5V to 3.3V

Page 56: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 46 of 76

voltage step down circuit is needed to implement. An AMS1086 voltage regulator IC is used

to step down the 5V to 3.3V and provided a 1.5A maximum current output. So, the

microcontroller and other peripherals can work with 3.3V.

The whole control board (without LCD monitor of Tiny210) is used about 1A.

Figure 41 power system

As shown in the Figure 42, there is a VDD5VIN sign at the left of figure. This is 5V

power from four motor drivers. This 5V power will then pass through an ON/OFF switch and

be used as an input of the 5V to 3.3V voltage regulator IC AMD1086 to provide a 3.3V and

1.5 maximum output current. Also, there is a stocky diode added in the output of this

regulator so as to prevent the wrong direction of input voltage. Besides, two LEDs are added

to indicate the power is on or not and some capacitors are added to store some power to

reduce the noise of power input.

Page 57: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 47 of 76

Figure 42 The schematic of Power circuit

3.2.5 Layout of control board

After finishing the schematic of control board, the layout is needed to design. Before

talking the layout of the final version control board, there are actually two versions of this

control board and the second version is the final version of the Quadrotor system.

There is some advancement of second version when comparing with the first version.

First, the size is smaller. As shown in the Figure 43, the right one is the first version and the

left is the second version. The size is changed from 10.8cm x 10.9cm (117.72cm2) to 8cm x

8.5cm (68cm2). 42% size decrease is achieved. Second, there are some unused circuits

Page 58: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 48 of 76

eliminated. Those circuits like buttons and USB programming, is deleted as those function

can be replaced by another device, like LCD touch monitor and UART programming. The

power system is also improved. In the first version, there is a switching power regulator

(LM2576) to step down the 5V to 3.3V but this circuit size is the triple size of second version

power circuit, which is just using a linear power regulator IC (AMS1086).

Figure 43 The comparison of two version control board

So, the layout of second version of control board is shown in Figure 44. The design

principle of this board is to try to reduce the overall size of the board. Thy Tiny210 coreboard

is plugged into the three ‘n’ shape female headers at the middle of the board. The

microcontroller and most of relating circuit are also moved under the Tiny210 coreboard.

Page 59: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 49 of 76

Figure 44 Layout of control board

Page 60: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 50 of 76

The layout of Figure 44 was sent to a PCB factory to do fabrication and the real outcome

is shown in Figure 45 after doing the soldering.

Figure 45 The real control board

Page 61: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 51 of 76

There are the parts descriptions of control board as shown in Figure 46. It is important to

mention that the Sensors module must be placed as the middle as possible because it can

receive a better motion date of Quadrotor without a large offset. Also, as the sensors module

is placed under the Tiny210 coreboard, the sensors module is soldered directly on the control

board and using Hot-melt adhesive to fix the module as shown in Figure 47.

Figure 46 Description of control board

Page 62: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 52 of 76

Figure 47 soldering of sensors module

3.3 Implement whole Quadrotor system

As the frame, motors, motor driver and the control board are ready for implement. Then,

the installation of different part is needed to complete.

The structure of Quadrotor is simple. As shown in Figure 48, two pairs of motor and

motor driver are placed perpendicularly and the control board is placed at the middle of the

Quadrotor. So, the outcome is shown as Figure 49.

Page 63: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 53 of 76

Figure 48 structure of Quadrotor

Figure 49 The real structure outcome

Page 64: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 54 of 76

After placing the motor, motor driver and the control board, the battery and the power

cable needed to connect with the motor driver as mentioned before (as Figure 41).

As shown in the Figure 50, there are two ‘T’ power plugs, which are circled with two red

ellipses, to connect with the battery. For the safety reason, there is a master ON/OFF switch

of the Quadrotor, which is circled with an orange ellipse.

Figure 50 connection circuit with battery

Page 65: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 55 of 76

Also, by reducing the wind shear and increasing the safety, four Aluminum stand is added at the bottom of the motors as shown at Figure 51.

Figure 51 Quadrotor stand

So, the Quadrotor is built as shown as Figure 52.

Figure 52 Quadrotor

Page 66: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 56 of 76

3.4 Flight Control As the main program of STM32F407VGT6 microcontroller is written by the group mate. The main focus point of this Flight Control is how to help the group mate to tune the PID control faster by using the help of Bluetooth. By using a Bluetooth module as Figure 53, the UART communication between the Quadrotor and computer can be established.

Figure 53 Bluetooth

As there is UART Programing Port at the button of Figure 46, it can be replaced with a

Bluetooth to achieve a wire-less connection with computer.

In the computer side, the Higher-terminal software is used to be the interface with User.

As shown in Figure 54, there are X,Y and Z tuning with ‘P’, ‘I’ and ‘D’. Some variable can

be changed individually by this system such as the aim degree and off set of motor. Also,

some variable can be shown which is used for calculation in PID such as the angle error, the

integrated error and the output PWM signal to the motor.

Page 67: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 57 of 76

Figure 54 X,Y and Z axis tuning system

Page 68: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 58 of 76

4 Result

As shown in Figure 55, a Quadrotor is successfully built and under tuning the PID stage.

But it is ready to flight.

Figure 55 Quadrotor

Page 69: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 59 of 76

4.1 Specification of Quadrotor

The overall specification of this Quadrotor is listed in Table 4.

Table 4 specification of Quadrotor

Battery used 11.1 V Li-Po Battery

Width 46cm

Length 46cm

Height 17cm

Weight About 1 KG (depended on the Battery used)

Propeller used 9 inch

The specifications are suited the list of Table 1which is the requirement of the Quadrotor

design.Table 1 requirement of Quadrotor Hardware

Page 70: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 60 of 76

4.2 Flight control

The PID of Flight control is under tuning but there is some result captured by this link

http://db.tt/zn6Uusof. In this link, there is a video which is the Quadrotor trying to do

balancing itself.

Figure 56 The video of balancing of Quadrotor

Page 71: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 61 of 76

5 Discussion

In this Discussion chapter, there are four things of the Quadrotor being discussed.

5.1 Quadrotor frame

In this project, there are many design area on the Quadrotor frame. Why the Quadrotor is

built in such size but not as small as a palm or big as 1m x 1m size? It is because many

different Quadrotor appearing in the world are also about 50 cm x 50 cm. So, the components

related to this size are easier to buy and have cheaper prices. Also, if a big Quadrotor is built,

the weight of Quadrotor will also increase. Then, the motor and propeller will be also bigger

to provide a big thrust to lift the Quadrotor. What’s more, a big Quadrotor will lead to need a

big testing or flight area and people may be scare by its size. On the other hand, if the

Quadrotor is made small as a palm, there are not many function can be embedded as the

limitation of the size.

Also, there are three frame designed in this project. Although the first version is the

heaviest, it can provide a strongest platform for mounting the motors. As the design theory of

first version frame is using the Aluminum square tube and clipped by two Aluminum pad, the

frame is hardly to destroy and deform. Besides, in the final version, as the Carbon Fiber Tube

is used, the tube may be also broken if there is a critical hit to the tube. So, drilling the

Carbon Fiber Tube must be been careful and avoided the drilling force suddenly changing.

Page 72: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 62 of 76

5.2 Brushless Motor

There are brushless motor used in this project. The reason of using brushless motor

instead of brushed motor is that the brushless motor is more stable, higher efficiency power

transfer and also higher spin rate.

As mention in the implement chapter, how to choose a suitable brushless motor is based

on a unit ‘KV’. This unit ‘KV’ means RPM per V. At the pervious chapter, there is a

comparison on the low ‘KV’ motor and the high ’KV’ motor. It can also be further explain in

here.

If there is 9000 KV motor and work under 10V, the motor will spin 90000RPM under no

any load on the shaft. Then, if there is a small propeller installed into the motor, what will

happen? Assume that the propeller will not be destroyed by that speed. It will lead to the

current increase as the motor try to spin as fast as the speed without any load on it. So, if the

length of propeller further increased, the current may increase more slightly and the propeller

may be destroyed by the fast speed.

In this project, as the long (1m) propeller will not be considered to use but it is also

needed a thrust to lift the Quadrotor. 1400KV motor is the choose to provide the force as it is

not a high KV motor but also providing a lifting force with shorter propeller.

Page 73: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 63 of 76

5.3 Brushless Motor Driver

The Brushless motor driver is used for by receiving the PWM signal from control to

drive the motor and providing a 5V and maximum 2A power supply to the control board.

There are many different brushless motor drivers in the world. How to choose a suitable

driver for brushless motor is the key point. As the driver would very hot if a wrong driver is

used to driver a wrong motor. For example, if a motor needed almost 10A for doing lifting

motion for Quadrotor, it is not reasonable that choose a 10A brushless motor driver to drive

this motor. It is because the rating of the driver is maximum current output and, at that

maximum point, the driver will become very hot and may be destroyed when continuous

increasing the speed of motor. So, choosing the driver is needed to follow the specification of

the motor.

As show in Table 2, there is the rating of the chosen motor for this project. The testing is

based on using ‘80xx’ and ‘90xx’ propeller which is 8inch and 9 inch length propeller and the

‘xx’ is refer to the pitch of the propeller. The table shows that when using a 9 inch propeller

and maximum using 23A current and producing 1200G force. So, from this rating, a 40A

brushless motor driver is chosen as it is almost the double of the maximum current used in 9

inch propeller.

Page 74: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 64 of 76

5.4 Propeller

As mentioned in Figure 30, there are four size of propeller bought for this project. The

final choice of Quadrotor is the 6 inch(blue one) and the 9inch (black and longest one). The 9

inch propeller is the first choice using in the Quadrotor as it can provide enough thrust to lift

the whole Quadrotor up with a lower PWM output signal. The reason, why lower PWM

output signal is better, is that the width of PWM driving signal is between 1ms to 2ms and if

the Quadrotor needed a higher PWM signal to lift itself, the remaining pulse width may not

fulfill the PID control needs and lead to lost control. So, the longer propeller is preferable.

Also, there is a technique behind choosing a good propeller. It is the balancing of the

propeller. If the efficiency of the power transfer from motor spinning to the force of lifting is

wanted to be higher, it is needed to check the balancing of propeller.

How to check the propeller is good or not? The method is simple. It is just using a long

narrow metal to be the shaft of propeller like Figure 57. If the propeller can stay and hold in

any angle, it is a good propeller. Otherwise, if the propeller always key one side down and

another is always at the top, it is an unbalance propeller. An unbalance propeller will lead to

have a vibration when the motor spin very fast.

Page 75: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 65 of 76

Figure 57 testing the propeller

Page 76: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 66 of 76

5.5 Power system

In the implement part, there is mentioned about the Power system of the Quadrotor as

Figure 41. The power system is not design as Figure 41at the beginning of this project. As the

voltage step down function of motor driver is not noticed, the first version is embedded an IC

‘7805’ to step the voltage from 11.1 V to 5V. But the result is not good and the IC is very hot.

So, the switching voltage step used to solve this problem. But, when we start to program the

motor driver and control it with PWM signal, it is found that the first version control board no

needs to link with the battery. So, the voltage step down function of motor driver is noticed.

The role of motor driver is not only the interface of motor and controller but also the

main part of providing a stable and safe energy of whole power system.

As the motor driver can detect the voltage of the battery and will stop its work if the

voltage of battery is too low. Also, it can provide a stable power to the control board and the

motion of motors do not be the burden with the power system.

Page 77: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 67 of 76

5.6 Flight Control

Although the PID algorithm is simple, finding a good value of system is time consuming

as there is not only one PID used in the Quadrotor. For example, only a balance motion of

Quadrotor is related to two PID which is the x axis and y axis PID control. Also, as there are

many variables can be changed in every test so to find a good PID value is not easy, such as

the voltage different (when voltage of battery drop, the speed of motor will decrease.).

At the beginning of tuning the PID process, an offline tuning process is used which

means that the microcontroller will re-program to change the variables of PID. This is also

very time consuming for changing the variables in the C program, building it and programs it

to the microcontroller.

Therefore, a Bluetooth module is used for establish the communication with computer.

By using the UART function, tuning the PID variables can be done in online process. So, the

tuning speed can be gradually increased.

Page 78: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 68 of 76

5.7 Designing the schematic and routing the PCB layout

There is some important point needed to mention from my experience. As the software

used in this design is EAGLE, so the situation discussed is based on this software.

To design a workable PCB is not an easy task. The preparation works must be done

carefully; otherwise, it may result to a disaster happening on the components. One of

important work is to check the logic level of different IC with the MCU. For example, if there

is a 0 V to 3.3 V logic level IC connecting a general signal pin with a 0 to 5V logic level

MCU, the IC may be damaged by a 5V Signal. So, the preparation work is very important. It

is no doubt that reading the data sheet and doing research of the components are the most

important step of whole process of creating a PCB.

After doing the preparation works, drawing the schematic is next step. In this step, there

are many components that can be found in the library of the software, which is the EAGLE.

However, although, in some case, the schematic is same as the data sheet shown, the actual

layout may not be the same as the component size. So, it is also needed to check the layout of

the selected component in the EAGLE.

After finishing the schematic, the last part is to route the layout of PCB. It is also an

important step. Although there is an auto route function in the EAGLE, the circuit may not be

much optimized and so the circuit may be very complex than hand drawing which producing

many noise to the circuit. Also, wiring a circuit needs many experiences because some

characteristic may not be mentioned in datasheet. For example, if there is a high current wire

Page 79: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 69 of 76

to connect with motors, this wire should be very thick to reduce the resistance. Also, if there

is an IC and it will produce heat when operating, a heat sink or a pad of metal with many hole

can help to cool down.

Last but not least, before doing the fabrication of PCB, it is important to check the

limitation of factory if the PCB is planned to do fabrication in factory.

Page 80: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 70 of 76

6 Conclusion and Further Development

To conclude, whole Quadrotor system is built and at the fine tuning stage of the Flight

control. The project objectives are completed. The Tiny210 and microcontroller can work

together to achieve the goals of Quadrotor which is listed in the introduction except the Fly

autonomous.

On Quadrotor Video (or data) feedback

On User Control

by Android device by computer

connect with Quadrotor Internet Network (WIFI) Bluetooth

For further development, the flight control must be completed. Also, there are many

hardware can be embedded to the Quadrotor to fly further.

Adding GPS to the system to report the location Adding 3G network to be control by user

After all, I want to thank the Dr. Ricky Lau who gave me lots of comments in this

project and led me to complete this project. Also, I am very thankful to my two group mate.

We have a very nice long time to work hard in this project. I am very happy with work with

you two.

As I said in the Abstract, ‘Flying is our dream.’ and we will see very soon.

Page 81: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 71 of 76

7 Appendix

Page 82: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 72 of 76

Page 83: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 73 of 76

Page 84: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 74 of 76

Page 85: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 75 of 76

Page 86: This document is downloaded from CityU Institutional ...lbms03.cityu.edu.hk/oaps/ee2013-fyp-ywl950.pdf · Quadrotor Helicopter has invented for many years. The function is widely

Page 76 of 76

8 References

i Robotic, Brushless Motor Internals , Available :

http://www.iheartrobotics.com/2009/06/brushless-motor-internals.html ii Oriental motor, Speed Control Systems (Brushless Motor & AC Motor) Overview

Available : http://www.orientalmotor.com/technology/articles/speed-control-overview.html iii WIKIPEDIA, Brushless DC electric motor,

Available : http://en.wikipedia.org/wiki/Brushless_DC_electric_motor iv Quadrotor.NET, Propeller

Available : http://www.quadrotors.net/anatomy-of-a-quadrotor/ v WIKIPEDIA, Fligh control

Available : http://upload.wikimedia.org/wikipedia/en/6/66/Quadrotor_Motor

_Speed_Control_Scheme.png vi WIKIPEDIA, PID controller

Available : http://en.wikipedia.org/wiki/PID_controller vii Taobao, Brushless motor

Available : http://item.taobao.com/item.htm?spm=a230r.1.14.12.MbeY2j&id=3558490609