Download as pdf or txt
Download as pdf or txt
You are on page 1of 119

iii

TABLE OF CONTENTS

ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
ACKNOWLEDGEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . ii
TABLE OF CONTENTS . . . . . . . . . . . . . . . . . . . . . . . . . . iii
LIST OF TABLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
CHAPTER 1 Problem Statement, Objective and Contributions . 1
1.1 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Previous Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Thesis Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
CHAPTER 2 Quadcopter Background Information . . . . . . . . . 6
2.1 Common Quadcopter Motor Types . . . . . . . . . . . . . . . . . . 7
2.2 Quadcopter Configurations and Frame Design . . . . . . . . . . . . 9
2.3 Quadcopter System Architecture . . . . . . . . . . . . . . . . . . . 10
CHAPTER 3 Control Goals and Orientation Establishment . . . 12
3.1 Quadcopter’s Reference Frame . . . . . . . . . . . . . . . . . . . . . 12
3.2 Control Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 Purpose of Mathematical Derivation . . . . . . . . . . . . . . . . . 14
3.4 Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4.1 Forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4.2 Torques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.5 Inertia and Angular Acceleration . . . . . . . . . . . . . . . . . . . 20
CHAPTER 4 Flight Orientation Estimation . . . . . . . . . . . . . 23
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 3 Axis Accelerometer . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2.2 3D MEM Accelerometer . . . . . . . . . . . . . . . . . . . . 24
iv

4.2.3 Accelerometer Orientation Equations . . . . . . . . . . . . . 26


4.2.4 Accelerometer Drawbacks . . . . . . . . . . . . . . . . . . . 26
4.3 3 Axis Gryoscope . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.3.2 MEMS Gyro . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.3.3 MEMS Gyro Drift . . . . . . . . . . . . . . . . . . . . . . . 30
4.4 3 Axis MEMS Magnetometer . . . . . . . . . . . . . . . . . . . . . 30
4.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4.2 Hard-Iron and Soft-Iron Interference . . . . . . . . . . . . . 31
4.4.3 Magnetometer Tilt Compensation . . . . . . . . . . . . . . . 34
4.4.4 Magnetometer Drawbacks . . . . . . . . . . . . . . . . . . . 34
4.5 Sensor Fusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.6 Orientation Estimation Conclusion . . . . . . . . . . . . . . . . . . 40
CHAPTER 5 Control System Implementation . . . . . . . . . . . . 42
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.2 PID Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.3 PID Software Implementation . . . . . . . . . . . . . . . . . . . . . 44
5.4 GUI and PID Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.5 Software Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 48
CHAPTER 6 Radio Frequency System Implementation . . . . . . 50
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.2 Selecting a Frequency Band . . . . . . . . . . . . . . . . . . . . . . 51
6.3 Creating a link budget with Friis transmission . . . . . . . . . . . . 53
6.4 2.4GHz Microstrip and Coplanar Waveguide Transmission Line . . . 54
6.5 RF Baluns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.6 RF Packet Structure and Collision Avoidance . . . . . . . . . . . . 57
6.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
CHAPTER 7 Hardware Implementations . . . . . . . . . . . . . . . 62
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
v

7.2 Flight Controller Hardware . . . . . . . . . . . . . . . . . . . . . . . 63


7.3 Remote Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.4 Electronic Speed Controller Hardware . . . . . . . . . . . . . . . . . 68
7.4.1 Brushless Motor Operation . . . . . . . . . . . . . . . . . . . 70
7.4.2 Introduction to BEMF Zero Cross Driving . . . . . . . . . . 71
7.4.3 Brush-less Motor Driving Hardware . . . . . . . . . . . . . . 71
7.4.4 ESC Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . 75
CHAPTER 8 ICL and Lidar Integration . . . . . . . . . . . . . . . . 76
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.2 Lidar use for positioning . . . . . . . . . . . . . . . . . . . . . . . . 77
8.3 Method of parsing Lidar Data . . . . . . . . . . . . . . . . . . . . . 79
8.4 Iterative Closest Line . . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.5 Lidar Integration with Quadcopter Control System . . . . . . . . . 84
8.6 Control System Testing, Simulation and Conclusion . . . . . . . . . 85
CHAPTER 9 Conclusion and Future Work . . . . . . . . . . . . . . 87
9.1 Flight Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
9.2 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
9.3 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
APPENDIX A Hardware schematics and PCBs . . . . . . . . . . . 95
A.1 Hardware Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . 95
A.2 Flight Controller Schematic . . . . . . . . . . . . . . . . . . . . . . 96
A.3 Flight Controller Schematic . . . . . . . . . . . . . . . . . . . . . . 97
A.4 Flight Controller Schematic . . . . . . . . . . . . . . . . . . . . . . 98
A.5 Flight Controller Schematic . . . . . . . . . . . . . . . . . . . . . . 99
A.6 ESC Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
A.7 ESC Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
A.8 ESC Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
A.9 RF Controller Schematic . . . . . . . . . . . . . . . . . . . . . . . . 103
A.10 RF Controller Schematic . . . . . . . . . . . . . . . . . . . . . . . . 104
vi

A.11 RF Controller Schematic . . . . . . . . . . . . . . . . . . . . . . . . 105


A.12 ESC Dev Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
A.13 ESC Dev Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
APPENDIX B Transmission Line Calculations . . . . . . . . . . . . 108
B.1 Microstrip Line Zo Calculation . . . . . . . . . . . . . . . . . . . . . 108
B.2 Coplanar Waveguide Zo Calculation . . . . . . . . . . . . . . . . . . 109
vii

LIST OF TABLES

6.1 Title 47 part 15.245 ISM Bands. . . . . . . . . . . . . . . . . . . . . . . 52


8.1 Specifications of the two lidars from Fig.8.2. . . . . . . . . . . . . . . . 78
viii

LIST OF FIGURES

2.1 Examples of quadcopter implementations [1],[2],[3],[4]. . . . . . . . . . 6

2.2 Examples of sensored(a) and sensor-less(b) brush-less permanent mag-


net motors [5],[6]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.3 Example of ESC [7]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.4 (a): X, (b): H, (c): + configuration quadcopters. In this figure, arrows


represent propeller direction, wires represent rigid frame, and the center
represents the quadframe body. . . . . . . . . . . . . . . . . . . . . . . 9

2.5 Marq Drone electrical architecture. . . . . . . . . . . . . . . . . . . . . 10

3.1 Quadcopter reference frame. . . . . . . . . . . . . . . . . . . . . . . . 12

3.2 Mechanical dimensions of quadcopter. l represents the length of the


quadcopter and h represents the height. . . . . . . . . . . . . . . . . . 15

3.3 Quadcopter free body diagram. . . . . . . . . . . . . . . . . . . . . . . 16

3.4 Grams thrust (Ti ) per duty cycle input. Duty cycle input represents
power percentage of a 3 cell lipo battery. . . . . . . . . . . . . . . . . . 17

4.1 2D macro scale spring accelerometer. . . . . . . . . . . . . . . . . . . . 24

4.2 Accelerometer MEMs image [8]. . . . . . . . . . . . . . . . . . . . . . . 25

4.3 Accelerometer noise before and during motor operation. . . . . . . . . . 27

4.4 Classical gyroscope or gyrostat. . . . . . . . . . . . . . . . . . . . . . . 29

4.5 MEMS 3 Axis Gyroscope [9]. . . . . . . . . . . . . . . . . . . . . . . . 29

4.6 MEMS 3 Axis Magnetometer [10]. . . . . . . . . . . . . . . . . . . . . 31

4.7 Milli-Gauss (mG) output of an uncalibrated magnetometer when ro-


tated in 3 dimensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

4.8 Output of a calibrated and normalized magnetometer when rotated in


3 dimensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

4.9 Plot demonstrating successful tilt compensation of magnetometer read-


ings. Here θ and φ are actuated without significant change in ψC . . . . 35

4.10 Demonstration of magnetic intensity (M ), magnetic inclination (δ), and


magnetic declination (σ). . . . . . . . . . . . . . . . . . . . . . . . . . . 36
ix

4.11 Global variation in: (a) magnetic intensity, (b) magnetic declination,
(c) magnetic inclination [11]. . . . . . . . . . . . . . . . . . . . . . . . 36

4.12 Complementary filter acting on raw accelerometer and gyro inputs. . . 37

4.13 Complementary filter with magnetometer integration. . . . . . . . . . . 38

4.14 Code snippet of 9DOF fusion filter. . . . . . . . . . . . . . . . . . . . . 39

4.15 Complementary filter validation test measuring and computing roll. . . 40

4.16 Complementary filter validation test measuring and computing pitch. . 40

4.17 Complementary filter validation test measuring and computing yaw. . . 41

5.1 Diagram of quadcopter plant and control system. . . . . . . . . . . . . 43

5.2 Expanded view of quadcopter’s control system. . . . . . . . . . . . . . 44

5.3 Code snippet of PID controller. . . . . . . . . . . . . . . . . . . . . . . 45

5.4 Code snippet for calculating PID results. . . . . . . . . . . . . . . . . . 45

5.5 Code snippet of pitch, roll, and yaw thrust calculations. . . . . . . . . . 46

5.6 Code snippet of open loop throttle control. . . . . . . . . . . . . . . . . 47

5.7 Code snippet of control loop. . . . . . . . . . . . . . . . . . . . . . . . 47

5.8 Quadcopter javascript GUI. . . . . . . . . . . . . . . . . . . . . . . . . 48

5.9 High level quadcopter software flow chart. . . . . . . . . . . . . . . . . 49

6.1 RF Marq Drone hardware: (a) Flight controller, (b) Radio controller . 50

6.2 Block diagram of Marquette Drone RF system . . . . . . . . . . . . . . 51

6.3 PCB transmission lines: (a) Microstrip line, (b) Coplanar waveguide. . 55

6.4 Plot of how r changes with respect to frequency [12]. . . . . . . . . . . 55

6.5 PI tuning network example located on the RF controller. . . . . . . . . 56

6.6 RF Baluns: (a) Integrated Balun [13], (b) Discrete Balun [14]. . . . . 58

6.7 RF packet implementation. . . . . . . . . . . . . . . . . . . . . . . . . 58

6.8 RF packet implementation observed on an oscilloscope by probing the


balun voltage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

7.1 Block diagram of flight controller . . . . . . . . . . . . . . . . . . . . . 64


x

7.2 Image of Marq Drone flight controller. . . . . . . . . . . . . . . . . . . 65

7.3 Block Diagram of flight controller. . . . . . . . . . . . . . . . . . . . . . 66

7.4 Image of Marq Drone remote. . . . . . . . . . . . . . . . . . . . . . . . 66

7.5 LiPo under voltage, over current, over charge, reverse bias, and backfeed
protection circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

7.6 Block Diagram of Marq ESC. . . . . . . . . . . . . . . . . . . . . . . . 69

7.7 Picture of ESCs: (a) Marq ESC, (b) Marq ESC Dev board. . . . . . . 69

7.8 Diagram of brushless motor and 6 driving switches. . . . . . . . . . . . 72

7.9 6 step trapezoidal commutation sequence. . . . . . . . . . . . . . . . . 72

7.10 Software block diagram of zero cross brushless motor driving. . . . . . 73

7.11 Brushless motor phase voltage (yellow) and zero cross detection com-
parator (green). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

8.1 Lidar plot of room . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

8.2 (a) Hokuyo UTM-30LX lidar used in [15] . (b) Neato XV-11 lidar device
used in this project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

8.3 Lidar moved to the left by ≈ 600mm . . . . . . . . . . . . . . . . . . . 79

8.4 ICP Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

8.5 ICP iteration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

8.6 Pseudocode of the ICL algorithm . . . . . . . . . . . . . . . . . . . . . 83

8.7 ICP and ICL integration results acting on dataset in Fig. 8.3. . . . . . 84

8.8 Quadcopter control diagram with lidar and sonar inputs added. . . . . 85

8.9 (a) Quadcopter simulation with external disturbance. (b) Plot of posi-
tional drift elimination. . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

9.1 Roll performance in hover test of quadcopter . . . . . . . . . . . . . . . 87

9.2 Pitch, roll, and yaw performance during hover test of quadcopter. . . . 88
xi

Acronym Definition

BEMF: Back Electro-Motive Force.

CPWG: CoPlanar WaveGuide.

EMF: Electro-motive Force.

FPU: Floating Point Unit.

ESC: Electronic Speed Controller.

FET: Field Effect Transistor.

FSK: Frequency Shift Keying.

ICP: Iterative Closest Point.

ICL: Iterative Closest Line.

IMU: Inertial Measurement Unit.

ISM: Industrial Scientific Medical.

I/O: Input / Output.

LiDAR: Light Detection And Range.

LiPo: Lithium-ion Polymer.

MCU: Micro-Controller Unit.

MEMS: MicroElectroMechanical System.

PID: Proportional Integral Derivative.

PPM: Pulse Position Modulation.

QFN: Quad Flat No-leads.

RF: Radio Frequency.


xii

SPI: Serial Peripheral Interface.

UART: Universal Asynchronous Receive Transmit.

UHF: Ultra High Frequency.

USB: Universal Serial Bus.

Math/symbol Definition

θ Pitch

φ Roll

ψ Yaw

x̂ Estimate of x

x̄ Unit vector of x direction

· Scalar product

× Cross product

U P P ERCASE Matrix

A−1 Inverse of matrix A

|x| Absolute value of x

atan2() Four quadrant arc tangent function

atan() Traditional two quadrant arc tangent function


1

CHAPTER 1

Problem Statement, Objective and Contributions

1.1 Problem statement

This thesis proposes quadcopter control theory, inertial measurement unit

(IMU) orientation fusion, and provides a comprehensive software/hardware

platform. To establish a reference frame, this thesis specifies a mathematical

coordinate system and then uses this system to determine control goals. The

remainder of the thesis focuses on how to meet the proposed control goals. An

overview of existing IMU sensors is presented as well as their trade-offs with

respect to quadcopter flight. An algorithm is then proposed to overcome existing

sensor limitations by fusing IMU data to obtain orientation. Once known

orientation is established, this thesis then focuses on specifying multi-rotor

kinematics, software, and hardware involved in flight control. Finally, this thesis

explores means of autonomous control with a lidar sensor.

The primary problem this thesis attempts to solve is in reducing

barriers to entry for advance control techniques. When building a multi-rotor

vehicle (drone), designers are faced with the choice of paying for a custom

designed aerial vehicle, building their own vehicle from scratch, or sacrificing

controllability for a inexpensive off-the-shelf system. While numerous inexpensive

off-the-shelf multi-rotor platforms are available, they often consist of proprietary

modules even when advertised as open-source. Common examples of these


2

black-box modules are sensor-less brushless motor controllers, flight controllers,

and radios. These modules are often proprietary and have limited hardware

specifications [16],[17]. Consequently for a researcher, the control and the

modifiability of these modules is limited.

1.2 Objectives

A main objective of this work is to provide researchers with a functional,

fully specified, and stabilized quadcopter. This system will be specified from

scratch hardware and software with the intent of eliminating as many black box

components as possible. In addition, this flight system will have an emphasis on

theoretical control as well as IMU data collection making it a prime candidate for

future research.

1.3 Previous Work

Admittedly, much work has been done in the area of advance control of

multi-rotor systems and these works are too numerous for a comprehensive

listing. Consequently, key examples will be provided that were used as a

reference for the development of this thesis. For example, Robert Mahony

presents a comprehensive method for modeling, orientation, and control of a

quadcopter with state space methods [18]. Another example of advance control is

where researchers at University of Zurich implemented a quadcopter with a

model predictive control were able to perform extreme acrobatic maneuvers

[19],[20]. Numerous other control techniques have been applied to quadcopters as


3

well such as PID, LQR, LQR-PID, and H∞ [21], [22].

With regards to open source multi-rotor systems, Open Pilot and Clean Flight

are perhaps two of the most popular open software flight controller systems

[16],[17]. These frameworks support a broad range of multi-rotor vehicles from

tri-copters to octo-copters. With regards to open source software and hardware

systems, the Pixhawk and Sparky systems feature an open source flight

controllers [23],[24]. While these systems feature some open hardware and

software, they integrate with systems that are proprietary.

In regards to indoor autonomous control, this is an active area of research for all

types of remote vehicles. Mapping of unknown environments has been conducted

with mutli-rotor vehicles utilizing lidar and employing the iterative closest point

(ICP) algorithm [15],[25],[26]. However, in these cases the multi-rotor vehicle was

operated by a human. A team at MIT achieved autonomous indoor control of an

aerial vehicle by combining lidar data and IMU data with an extended Kalman

filter as well as a Gaussian particle filter [27]. However, in this case the

environment had been pre-mapped and pre-determined trajectories were used.

Comprehensive simultaneous mapping and control is still an ongoing area of

research.

1.4 Contributions

This thesis developd a functional quadcopter system with a higher level of

integration than most other open source options. In addition, this thesis develops

a computationally efficient lidar parsing algorithm. The key contributions of this


4

flight system are as follows:

• Provides open source software / hardware files for a functional stabilized

auto-leveling flight controller

• Provides open source software / hardware files for a remote control system

• Offers practical design insights for other researchers attempting to

construct their own aerial vehicles

• Proposes a computationally efficient implementation of ICL for lidar data

translation

1.5 Thesis Organization

Chapter 2 presents fundamental background information and terminology

associated with multi-rotor systems that will be used throughout this thesis.

Chapter 3 overviews the the mathematical reference frame for the multi-rotor

system and specifies control objectives. Chapter 4 describes sensors used for

quadcopter orientation estimation as well as a fusion algorithm to combine

various sensors. Chapter 5 proposes a control system to achieve auto-leveling

flight. This chapter also overviews the software architecture used in order to

execute the desired control system. Chapter 6 overviews the quadcopter’s radio

system and introduces applicable theory required for its design and construction.

Chapter 7 describes other hardware components of the quadcopter such as the

flight controller and electronic speed controllers. Chapter 8 overviews lidar

integration with a quadcopters control system. This chapter also specifies an


5

algorithm for parsing lidar data under significant processing and memory

constraints. Finally, Chapter 9 overviews the findings of this thesis, presents

flight data, and discusses future work.


6

CHAPTER 2

Quadcopter Background Information

In order to provide context for future chapters, this chapter introduces the

basic inputs and outputs common to a quadcopter system. As the name

quadcopter implies, a quadcopter is a multi-rotor aircraft with four propellers.

Beyond the similarity of four propellers, there is significant design diversity. This

design diversity includes but is not limited to motor type and frame design.

Examples of various quad-copter implementations are shown in Fig. 2.1.

(a) (b)

(c) (d)
Figure 2.1: Examples of quadcopter implementations [1],[2],[3],[4].

The quadcopters in Fig. 2.1 are referenced throughout this chapter as

demonstrations of different types of design. A defining aspect of these

quadcopters is the motor type that they utilize. Consequently, the next section

will overview the common types of quadcopter motors.


7

2.1 Common Quadcopter Motor Types

Low-cost commercial quadcopters generally use electric DC motors such as

brushed and brushless permanent magnet motors. In contrast to gas motors,

there exist small electric motors that are light-weight, low-cost, and of simple

construction. These features make small electric motors ideal for low-cost

commercial quadcopters. Among these electric motors, two common types of DC

electric motors exist which are brushed and brushless motors. As the name

implies, brushed DC motors are mechanically commutated with a brush, are

powered by DC, and are explained in detail in [28]. The control simplification

and cost of brushed DC motors makes them a popular choice for micro-size

quadcopters such as the Turnigy Micro-X shown in Fig. 2.1(d). However, the

brush which mechanically commutates the motor results in friction losses as well

as limited motor life span. Consequently, larger quadcopters often use brushless

permanent magnet DC motors which are electronically commutated. Brushless

motors are also split into two common types which are sensored and sensor-less

motors. Examples of these two motor types are illustrated in Fig. 2.2.

(a) (b)

Figure 2.2: Examples of sensored(a) and sensor-less(b) brush-less permanent


magnet motors [5],[6].
8

In order to electronically commutate a permanent magnet motor, the rotor’s

position must be known. This can be achieved by using Hall effect sensors or by

using sensor-less driving techniques. Sensored motor operation simplifies driving

complexity but results in heavier and more exspensive motor as seen in Fig. 2.2.

Instead of using sensors, sensor-less techniques such as back electro-motive force

(BEMF) zero-cross detection and field oriented control can be implemented

[29],[30]. Sensor-less driving will be discussed in more detail in Chapter 7.

Sensor-less operation is desired since sensor-less motors have reduced weight,

cost, and complexity. As a result of this, sensor-less brushless motors are

common in quadcopters. However, in order to drive these motors, a DC to AC 3

phase sensor-less motor driver is needed. In terms of popular multi-rotor

vernacular, these are commonly referred to as electronic speed controllers (ESC).

Figure 2.3: Example of ESC [7].

These ESCs represent an integral part of the quadcopter system architecture

since their output controls the orientation of the quadcopter by varying the speed

of the propellers. These devices will be discussed in greater detail in Chapter 7.


9

2.2 Quadcopter Configurations and Frame Design

Quadcopters have various configurations though the most common types are the

X configuration, the H configuration, and the + configuration. These various

configurations are illustrated in Fig. 2.4.

(a) (b) (c)

Figure 2.4: (a): X, (b): H, (c): + configuration quadcopters. In this figure,


arrows represent propeller direction, wires represent rigid frame, and the center
represents the quadframe body.

Each type of configuration offers advantages and disadvantages. The X

configuration is the most commonly utilized motor configuration since it is simple

to construct, ideal for a forward facing camera, and is symmetrical. Quadcopters

in Fig. 2.1(a,b,c) are using this type of configuration. A disadvantage of this

configuration is an increase in control complexity. In contrast to the X

configuration, the + configuration is the simplest to mathematically model and

control. However, this configuration is least ideal for a forward facing camera.

Consequently, very few commercial drones are sold in this configuration and they

generally only appear in research or DIY projects. Finally, the H configuration is

sometimes built for mechanical convenience as seen in Fig. 2.1(d). In contrast,

the DJI Inspire in Fig. 2.1(c) was designed as a H configuration quadcopter to


10

achieve improved camera perspective [31]. While this configuration can be ideal

for forward facing cameras, it is also not symmetrical about its center. This lack

of symmetry should be taken into account and will be discussed later in this

thesis. These three configurations including minor deviations represent the

majority of quadcopter configurations in common use today.

2.3 Quadcopter System Architecture

A final step in presenting necessary background information for this quadcopter

thesis is to briefly overview the electrical architecture. A block diagram of the

architecture unique to the quadcopter designed in this thesis is shown in Fig. 2.5.

Motor 2 Motor3

3 Phase AC

ESC2 ESC1

Remote

Flight Controller
PPM UART Lidar

Battery 2.4GHz
IMU SPI MCU SPI Radio Radio
3C LIPO 2FSK

PPM
FRONT

USB USB 2.0 PPM Sonar

ESC3 ESC4

Motor 1 Motor 4

Figure 2.5: Marq Drone electrical architecture.


11

The underlying system for the quadcopter in this thesis is named the ”Marq

Drone” system. This system consists of a flight controller, a radio, and ESCs.

Core components of the flight controller include a micro-controller unit(MCU), a

radio, and an inertial measurement unit (IMU). The flight controller

communicates with the ESCs through pulse position modulation (PPM). More

information about PPM can be found here [32]. In addition to communicating

with ESCs, the flight controller communicates with a lidar sensor through a

universal asynchronous receive and transmit (UART) interface. To communicate

with devices external to the quadcopter, a USB interface can be used for data

acquisition or programming. Another communication method is through a

wireless 2.4GHz frequency shift keyed(FSK) interface for receiving flight

commands and transceiving flight data.

Now that all the components involved have been introduced, the I/O of the

system can be identified. For the flight controller itself, feedback inputs are from

the IMU, sonar, and lidar sensors. The outputs of the system are the four

individual PPM signals that are sent to the ESCs. Now that the I/O of the

system has been briefly introduced, a control scheme will be derived that uses

these I/O to achieve stable flight.


12

CHAPTER 3

Control Goals and Orientation Establishment

In this chapter, a reference coordinate system for the quadcopter will be

presented in addition to control goals. Like other multi-rotor vehicles, the

primary control objective is to keep the quadcopter’s orientation controlled and

its altitude above ground non zero. With this in mind, a commonly used reference

coordinate system will be presented to explicitly define this control objective.

3.1 Quadcopter’s Reference Frame

Yaw ψ
y

Roll ϕ Pitch θ

x
Front

Figure 3.1: Quadcopter reference frame.

Fig. 3.1 demonstrates a reference frame for quadcopters. The reference frame

uses Cartesian x,y,z system of coordinates for position and uses Euler angles

pitch (θ), roll (φ), and yaw (ψ) to denote orientation. The origin the axes

represents the center of the quadcopter as well as the center of mass.


13

3.2 Control Objective

A primary control objective for the quadcopter is to be able to control

orientation. With this in mind, the first set of control goals can be summarized

in equation 3.1 where θc , φc , φc represent a user commanded rotation, where

θ̇, φ̇, ψ̇ represent the rotational velocities of the quadcopter, and where Tc

represents the user commanded throttle.

θ̇ = 0 φ̇ = 0 ψ̇ = 0
(3.1)
θ → θc φ → φc ψ → ψc , T → Tc

These control parameters, θc , φc , ψc , Tc , allow a user to maneuver the quadcopter

to anywhere in three dimensional space. Consequently, many commercial systems

give users these four degrees of freedom to operate a quadcopter. However, the

user must also act as a control system in order to regulate the quadcopter’s

height to keep it above the ground. To achieve this, the user must observe the

quadcopter’s height and constantly adjust the throttle, Tc , such that the height

with respect to ground, z, is roughly constant. Also, if a user desires a

quadcopter to stay at a fixed position in space, they must also observe the x, y

position of the quadcotper and adjust θ, φ accordingly.

While these parameters allow a user to control a quadcopter, these four degrees

of freedom are not enough for stable autonomous flight. Without a user to

observe and control the quadcopters x, y, z position with respect to the room,

stable flight is not possible. Therefore as a secondary control objective, equation

3.2 demonstrates the control needed for autonomous flight where xc , yc , zc


14

represents a user desired position.

ẋ = 0, ẏ = 0, ż = 0
(3.2)
x → xc y → yc z → zc

To meet the autonomous control objectives in equation 3.2 , additional sensors

are needed such as lidar, GPS, and sonar. These methods will be introduced

later in this thesis.

3.3 Purpose of Mathematical Derivation

A mathematical derivation of a multi-rotor frame provides a basis for update

laws and helps a designer gain intuition regarding the system. In simple cases,

these update laws can be derived from visual inspection of the airframe.

However, this method becomes less effective as motor count is increased, as

asymmetries are introduced to the air frame, and as motor angles are changed.

Consequently, the incentive of the following sections is to translate input of

motor speed to angular velocities (θ̇, φ̇, ψ̇) such that the control system can drive

pitch (θ), roll (φ), and yaw (ψ) to their desired values.

3.4 Mathematical Model

Now that control goals have been defined for user-assisted quadcopter flight, a

model of the quadcopter must be derived to meet the proposed goals. For this

thesis, a modified X configuration quadcopter design was selected. This was

chosen for mechanical convenience and mounting simplicity. A diagram shown in


15

fig. 3.2 dimensions this modified X configuration quadcopter.

l = 168.7mm

h = 184.5mm 250mm

Figure 3.2: Mechanical dimensions of quadcopter. l represents the length of the


quadcopter and h represents the height.

These dimensions are relevant to the physics based model derivation. Note that

this quadcopter is not symmetrical about its center. Fig. 3.3 demonstrates a

more detailed free body diagram of forces and torques acting upon the

quadcopter.

In absence of system input, the dominant force acting on the quadcopter is

mass·gravity (−m · g). To counteract this force, thrust vectors ([T0 , T1 , T2 , T3 ])

are generated by the propellers. Note, the aerodynamic effects that are not

shown in Fig. 3.3 since these forces are assumed to be negligible. Wind and drag

are examples of aerodynamic effects that have been set to zero in order to

simplify modeling of the system.


16

z
T3
Yaw ψ
y
T2 T0
Roll ϕ Pitch θ

T1 -mg
x
Front

Figure 3.3: Quadcopter free body diagram.

3.4.1 Forces

Propellers produce a force perpendicular to their plane of rotation. It follows

that this force is related proportionally to the propeller’s angular velocity. It can

be shown that a propeller’s thrust can be approximated by equation 3.3 where Ti

is a force vector for motor index i, where k is a scaling constant, and where ω is

the angular velocity of the propeller [33].

Ti = k · ω 2 (3.3)

The sum of thrust force vectors, T , is shown in equation 3.4 where x̄, ȳ, z̄ are

Cartesian unit vectors.


17

 
x̄
3
X    
 
T = Ti = k · 0 0 ω 2 · 
ȳ 
 (3.4)
i=0  
 

Note that all these forces are in the z direction. The implication of this is that

the quadcopter cannot transverse a room’s x, y plane without some rotation.

This has aerial footage implications which is why some multi-rotor platforms use

angled motors as seen here [34]. Another important note is that while a ESC is

aware of motor speed, ESCs do not commonly send this information back to a

controller. ESCs are simply circuits to which a PPM signal is sent to. Without

taking external measurements, it is not possible to accurately correlate a PPM

signal to propeller’s velocity or thrust. To approximate the PPM signal to thrust

relationship, the Marq Drone was put upside down on a weight scale and then

varying PPM signals were sent to the motors. The results of this testing are

shown in Fig. 3.4.

Thrust Linearization:

600
Grams Thrust (Ti)

500
400
300
200
100
0
0 0.2 0.4 0.6 0.8 1
Input Duty Cycle

Figure 3.4: Grams thrust (Ti ) per duty cycle input. Duty cycle input represents
power percentage of a 3 cell lipo battery.
18

As observed in Fig. 3.4, there was a roughly linear relationship between input

duty cycle and thrust. Consequently, linear regression was used to approximate

the thrust for a given motor in terms of the PPM duty cycle as shown in

equation 3.5.

T̂i = 652.82 · P P Mi − 47.68. (3.5)

Naturally, this equation is only applicable to this specific combination of

propellers and motors used in the Marq Drone. This experiment would need to

be performed again should the motors or propellers change.

Now that an estimate Ti has been formulated, it is possible to calculate the

required thrust to keep the quadcopter in the air.

3
X
T̂i · z̄ = m · g
i=0

z̄ = cos(θ) · cos(φ) (3.6)

m·g
T̂i =
4 · cos(θ) · cos(φ)

Assuming T̂i is set equal to the result calculated in equation 3.6, the quadcopter

should roughly maintain its height regardless of minor rotations in θ, φ. However,

it is important to note that thrust vectors Ti occur at some ri distance away from

the center of mass which results in torques acting on the frame.


19

3.4.2 Torques

From physics, we know that torque, τ , is equal to the cross product of distance

and force. For control purposes, it is useful to calculate the torque for each of the

quadcopters rotation axes as seen in equation 3.7. In equation 3.7, height (h)

and length (l) are defined from Fig. 3.2.

τ =r×F

τφ = rȳ × T = (l/2) · (T0 + T3 − T1 − T2 )


(3.7)
τθ = rx̄ × T = (h/2) · (T0 + T1 − T2 − T3 )

τψ = a · (T0 + T2 − T1 − T3 ).

These equations are similar to what shown in [33] and adapted for an

asymmetrical X configuration quadcopter. As observed in equation 3.7, the pitch

and roll torques (τθ , τφ ) are defined with respect to the quadcopter’s frame

geometry. Had the quadcopter frame been symmetrical, l, h would have been

equal which would have resulted in a simpler equation. Without taking this

asymmetry into account at the control system level, the quadcopter’s pitch and

roll would react differently. In contrast to τθ , τφ , it is harder to define the torque

about the yaw axis (τψ ) geometrically. This torque is slightly less intuitive

because it arises from having spinning masses attached to the frame. Without

taking this into account, the quadcopter would continuously spin about the yaw

axis. However, this problem is not unique to just quadcopters. A helicopter, for

example, uses a tail rotor in order to counteract the yaw torque introduced by

the primary blade. Similarly, in order to counteract this torque on the

quadcopter frame, two propellers are selected to spin clock wise and two
20

propellers are selected to spin counterclockwise. These alternating motor

directions are illustrated in Fig. 3.3. While geometry and force vectors have

allowed for derivations of torque, these cannot be converted to angular rates

without observing inertia.

3.5 Inertia and Angular Acceleration

Classical physics defines a relationship between torque and angular acceleration

as shown in equation 3.8 where ω is angular velocity, where α, ω̇ represent

angular acceleration, and where Ixyz represents the inertia matrix.


   
IXX IXY IXZ  ω̇x 
   
   
τ = Ixyz · α = Ixyz · ω̇ = 
 IY X IY Y  · ω̇y 
IY Z    (3.8)
   
   
IZX IZY IZZ ω̇z

The angular accelerations can be solved for by equating equation 3.8 to equation

3.7. Approximations can be used to simplify the inverting and calculation of the

inertia tensor matrix. Note, if rotations are defined about an object’s center of

mass and the mass is symmetrically distributed, the inertia matrix is diagonal

[35]. Furthermore, values of Ixx , Iyy , Izz can be approximated by simplifying a 3D

body into basic shapes such as rectangles. For a 3D rectangle, the inertia about

1
an axis can be calculated as Ixx = 12
· m · ((ylength )2 + (zlength )2 ). Similar

equations would apply for Iyy , Izz . Using this approximation, equation 3.9 was

calculated for the quadcopter frame and is expressed in grams meter squared.
21

 
0.0907 0 0 
 
 
Ixyz = 0 0.5005 0  · g · m2 (3.9)
 
 
 
0 0 0.5422

This is an approximation since in reality, the mass will not be perfectly

symmetrically distributed. Consequently, using this approximation and taking

the inverse of the tensor matrix, the results are shown in equation 3.10 where k

represents a given discrete time sample.

   
 φ̈(k)   (l/2) · (T0 (k) + T1 (k) − T2 (k) − T3 (k)) 
   
−1
   
 θ̈(k)  = Ixyz · (h/2) · (T (k) + T (k) − T (k) − T (k)) (3.10)
   0 3 1 2 
   
   
ψ̈(k) a · (T0 (k) + T2 (k) − T1 (k) − T3 (k))

This equation can be used in the formation of a state space system. The state

space system is approximated using a discrete derivative. Also, equation 3.6 can

be divided by mass to produce an approximation of z. Consequently, a discrete

state space representation of the four desired degrees of freedom is shown in

equation 3.11 where ∆T represents the time of a fixed sampling period.


22

     
 φ̇(k + 1)  1 0 0 0  φ̇(k) 
     
     
 θ̇(k + 1)  0 1 0 0  θ̇(k) 
     
 = · +
     
ψ̇(k + 1) 0 0 1 0 ψ̇(k)
 
   
     
     
ż(k + 1) 0 0 0 1 ż(k)
    (3.11)
l l l l
 2·IXX 2·IXX
− 2·IXX − 2·IXX  T0 (k)
   
   
 h −h −h h  T (k)
 2·IY Y 2·IY Y 2·IY Y 2·IY Y   1 
 ·  · ∆T
   
 a −a a −a  T (k)
 IZZ IZZ IZZ IZZ   2 
   
   
g g g g
4·cos(θ)·cos(φ) 4·cos(θ)·cos(φ) 4·cos(θ)·cos(φ) 4·cos(θ)·cos(φ)
T3 (k)

These equations will form the basis of the control system update laws. However,

in order to apply them, the orientation of the quadcopter must be known.


23

CHAPTER 4

Flight Orientation Estimation

4.1 Introduction

In order to meet the control goals defined by equation 3.1, estimation of

the quadcopter’s orientation is required. With modern advancements in

electronics, determining orientation can be done inexpensively, efficiently, and

quickly with micro electrical mechanical system (MEMS) based sensors.

Unfortunately, currently, there is no single affordable MEMS sensor that directly

measures θ, φ, ψ. Consequently, the combination of multiple MEMS sensors is

required in order to accurately estimate orientation. This chapter overviews the

operation of relevant MEMS sensors as well as their strengths and weaknesses

with respect to multi-rotor aircraft. This chapter then establishes the minimum

number of MEMS sensors needed to achieve the desired goals.

4.2 3 Axis Accelerometer

4.2.1 Introduction

3 axis accelerometers are devices that are designed to measure Cartesian x̄, ȳ, z̄

accelerations. It follows that the output of the device is an acceleration vector

denoted as A = [Ax , Ay , Az ]. Fig. 4.1 is a macro scale illustration of how

accelerometers measure acceleration.


24

z1

m
x1
z2

Figure 4.1: 2D macro scale spring accelerometer.

In Fig. 4.1 a mass is suspended by springs. Acceleration acting on the mass is

determined by spring deflection. Due to gravity, an accelerometer will state that

an object at rest is experiencing an acceleration approximately 9.8m/s2 . This

acceleration is represented in Fig. 4.1 with the to equation 4.1 can be derived

for Ax and Ay . Also, note that in Fig. 4.1, the x dimension springs are also

experiencing deflection due to gravity. However, the magnitude of deflection for

the x dimension springs are of equal magnitude. When using equation 4.1 for the

x direction, the net acceleration would be 0.

4.2.2 3D MEM Accelerometer

deflection of the z springs. This gravity reference is crucial for steady state

orientation estimation. Using these principles, an equation is formulated to

calculate the acceleration per axis as shown in equation 4.1 specifically for the z

axis.

F = m · A, F =k·z
(4.1)
k · (z1 − z2 )
Az =
2·m
Given one is using a 3D accelerometer, similar equations
25

Figure 4.2: Accelerometer MEMs image [8].

In order to achieve low form factor, low power consumption, and low cost,

modern accelerometers are designed using MEMS based technology. While they

operate under the same principles illustrated in Fig. 4.1, there is little visual

similarity since the springs are often of micron size etched in a silicon based

process. Fig. 4.2 is a picture of the internals of a modern MEMs accelerometer.

These structures take a variety of shapes although they generally consist of

spring loaded masses in combination with parallel plates. When the device is

accelerating, this applies force to the internal springs of the MEMS structure.

This force results in the distance between capacitive plates changing. The MEMS

device measures the capacitance of the plates which is converted to a deflection

distance. Using the deflection distance of the plates, the device can then

calculate acceleration by taking into account the spring system’s mass and a

spring coefficient [36]. The accelerometer can then transmit this acceleration

value through a serial bus or an analog signal.


26

4.2.3 Accelerometer Orientation Equations

To make use of accelerometer readings with respect to orientation, a conversion

from Cartesian acceleration to Euler angles is required. It can be shown that

equation 4.2 and equation 4.3 convert from Cartesian acceleration to Euler

angles θ and φ [37].

 
Ax 180
θ = atan p 2 · (4.2)
2
Ay + Az π

 
Ay 180
φ = atan2 · (4.3)
Az π

Note that in the case of φ in equation 4.3, the atan2 function is used which is a

four quadrant version of the traditional arc tangent function. Also note that there

is no equation for the yaw (ψ) orientation angle. This is because a ψ orientation

will not register as any measurable change in the Cartesian acceleration vector.

This is a fundamental physical limitation of the 3 axis accelerometer.

4.2.4 Accelerometer Drawbacks

1. Incomplete Orientation Assessment

While vectors contain magnitude and directional information, they do not

intrinsically have a rotational component. It follows that the yaw(ψ) of a given

object cannot be determined with a 3 axis accelerometer. Consequently, the sole

use of an accelerometer is not enough for the control goals 3.1 to be achieved.
27

Without yaw feedback, any unbalanced ψ torques about the quad-copter would

result in the aircraft spinning in air. Naturally, this would make navigation

difficult and it follows that the accelerometer is not generally used as a

stand-alone orientation sensor for multi-rotor aircraft.

2. Sensitive to High Frequency Vibrations

Another noteworthy issue with accelerometers is that they are sensitive to high

frequency vibrations. While this is not an issue for some applications,

quadcopters often experience a high level of vibration due to their motors

spinning at high speeds. The effect that this can have is illustrated in Fig. 4.3.

1.5
G Force (G)

0.5

-0.5

-1
1
11
21
31
41
51
61
71
81
91
101
111
121
131
141
151
161
171
181
191
201
211
221
231
241
251
261
271
281

Samples
Ax Ay Az

Figure 4.3: Accelerometer noise before and during motor operation.

As seen in Fig. 4.3, when at rest, there is negligible noise on the accelerometer

readings. However, when the quadcopter’s motors are turned on, a significant

amount of high frequency noise is registered on the sensor. While low pass

filtering would remove this noise, the delay of such a filter can lead to flight

instability.
28

3. External Acceleration Produces Unknown Orientation

Accelerometers measure a gravity reference when an object at rest. However, the

accuracy of this reference can be lost if the quadcopter is accelerating. For

example, if the quadcopter in Fig. 3.3 is moving upwards at a rate twice that of

gravity, the accelerometer would yield Az = −1g, Ax = 0g, Ay = 0g. Using this

data, equation 4.3 would state that the quadcopter is upside-down.

Consequently, equation 4.3 is only valid and useful for orientation when the

quadcopter is not accelerating.

4.3 3 Axis Gryoscope

4.3.1 Introduction

In contrast to the accelerometers, gyroscopes measure rotation. For decades,

gyroscopes have been used as an integral part in naval and aerospace

navigational systems. The first gyroscopes were generally spinning masses held in

a gimbal frame. These frames allowed the mass to spin freely and maintain its

axis of rotation regardless of the orientation of the external frame. Due to

conservation of angular momentum, the spinning mass would resist any changes

to its rotation. This structure is visualized in Fig. 4.4 .

To electronically measure changes in rotation using a classical gyroscope,

electrical potentiometers are connected to the gimbal frames. While these devices

are capable of a large degree of accuracy, they are large, heavy, and expensive.
29

Figure 4.4: Classical gyroscope or gyrostat.

4.3.2 MEMS Gyro

A MEMS version of the gyroscope is illustrated in Fig. 4.5. Due to the silicon

design process, they are small, low power, and cost effective.

Figure 4.5: MEMS 3 Axis Gyroscope [9].

Unlike the macro version shown in Fig. 4.4, MEMS gyroscopes do not contain a

spinning disk. Owing to the fact that it is difficult to achieve a large angular

momentum in a microscopic space, MEMS gyroscopes operate on a different

physical principle. This physics principle is called the “coriolis effect” [38].

Consequently, these types of gyros are called “Coriolis vibratory gyroscopes”. As


30

the name suggests, these contain vibrating structures. By measuring forces

exerted on these vibrating structures, velocity of rotation can be determined [39].

It is important to note that MEMS gyroscopes measure angular velocity in

contrast to macro-scale gyroscopes that measure orientation angles directly. To

estimate orientation angles, it follows that the MEMS gyroscope readings must

be integrated as shown in equation 4.4.

Z t Z t Z t
θ= θ̇ · dt φ= φ̇ · dt ψ= ψ̇ · dt (4.4)
0 0 0

4.3.3 MEMS Gyro Drift

As a result of integrating the readings MEMS gyroscope over time, steady state

orientation error accumulates. This accumulated error is commonly called gyro

drift. As a result, a MEMS gyroscope must continuously be re-calibrated or must

be high pass filtered. Consequently, MEMS gyroscopes are often used in

combination with other sensors.

4.4 3 Axis MEMS Magnetometer

4.4.1 Introduction

Magnetometers are devices that measure magnetic field. The most common and

oldest form of a magnetometer is a compass. Compasses, which point in the

direction of earth’s magnetic north, have been used in navigation for hundreds of
31

years. For modern low power electronics, a MEMS solution also exists. An

example of a MEMS magnetometer is shown in Fig. 4.6.

Figure 4.6: MEMS 3 Axis Magnetometer [10].

Common MEMS magnetometers function by making use of the Lorentz force in

order to measure magnetic field [10]. This force is then converted to a electronic

signal similarly to how an accelerometer measures acceleration. This force creates

deflection on a spring system which is sensed by parallel capacitive plates.

Primarily, these sensors are used to measure the earth’s magnetic field which

gives orientation insight. When these devices are used in conjunction with an

accelerometer, steady state estimation accuracy of θ, φ, ψ can be achieved. While

these devices can provide useful insight into orientation, they also have their own

drawbacks.

4.4.2 Hard-Iron and Soft-Iron Interference

A magnetometer’s proximity to both ferrous and non ferrous metal is a large

source of error. These errors are called hard-iron and soft-iron interference for
32

ferrous and non ferrous materials respectively [40]. Electronic assemblies

intrinsically contain both types of material and consequently are susceptible to

both as soon as a magnetometer is bonded to a PCB. Unfortunately, since the

earth’s magnetic field is weak, these errors can dominate the output readings of a

magnetometer.

1000
Y/X
Z/Y
500 X/Z
mG

-500

-1000
-1500 -1000 -500 0 500 1000 1500
mG
Figure 4.7: Milli-Gauss (mG) output of an uncalibrated magnetometer when ro-
tated in 3 dimensions.

Consequently, for magnetometer readings to be valid, a calibration must be done

after a magnetometer has been bonded to the PCB. The uncalibrated

magnetometer readings observed on the quadcopter is shown in Fig. 4.7. For

practical purposes, a simple offset and scaling calibration can be performed. A

method of performing this scaling is shown in equation 4.8 where Mx , My , Mz

represents the milli-Gauss values on their respective axises.


33

Mx − min(Mx )
M̂x = 2 · −1
max(Mx ) − min(Mx )
My − min(My )
M̂y = 2 · −1 (4.5)
max(My ) − min(My )
Mz − min(Mz )
M̂z = 2 · −1
max(Mz ) − min(Mz )

Note that this calibration procedure should only be performed during a window

of time in which the quadcopter is being rotated about all its axes. If a windowed

calibration is not performed, eventually the min and max values will be

corrupted by external fields and will permanently skew the values of Mx , My , Mz .

This calibration procedure was performed on the quadcopter’s IMU and the

results can be seen in Fig. 4.8.

1
Y/X
Z/Y
X/Z
0.5
Normalized

-0.5

-1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Normalized
Figure 4.8: Output of a calibrated and normalized magnetometer when rotated in
3 dimensions.

As seen in Fig. 4.8, the magnetometer data is normalized and no longer has

significant scaling or offset variation between the axes. While the result of this

normalization is unit-less, this is of no consequence since future calculations are

done using ratios. For example, assuming the quadcopter is level (θ = 0, φ = 0),
34

yaw (ψ) can be calculated with the basic equation shown in equation 4.6.

M̂y
ψ = atan2( ) (4.6)
M̂x

Note this equation is no longer valid if the magnetometer is not level since it

ignores the Mz . Consequently, if a magnetometer is titled, additional calculations

are required.

4.4.3 Magnetometer Tilt Compensation

Magnetometer accuracy can be improved by performing tilt compensation based

on observed θ, φ. The end goal of tilt compensation is to make equation 4.6 valid

by de-rotating the axes by θ, φ. Using rotation matrices along with equation 4.6,

equation 4.7 is derived [41].

 
− M̂z · sin(φ) − M̂y · cos(φ)
ψ̂C = tan 1 (4.7)
M̂x · cos(θ) + M̂y · sin(θ)sin(φ) + M̂z · sin(θ)cos(φ)

For this equation to work properly, it is imperative that all IMU outputs match

the axis as shown in Fig. 3.1. This equation was validated with IMU data and a

comparison between compensated and uncompensated yaw is shown in Fig. 4.9.

4.4.4 Magnetometer Drawbacks

Susceptible to external fields

As mentioned previously, the earth’s magnetic field is extremely weak.

Consequently, external ferrous material can significantly skew orientation

readings if in close proximity to the sensor. A method that was implemented to


35

Tilt Compensation of Magnetometer Readings


100

50

0
Degrees
-50

3
-100
?
A Compensated
-150
A Uncompensated

-200
0 200 400 600 800 1000 1200 1400 1600
Samples

Figure 4.9: Plot demonstrating successful tilt compensation of magnetometer read-


ings. Here θ and φ are actuated without significant change in ψC .

combat this is to ignore the magnetometer data if the data observed is

significantly beyond the normalization in Fig. 4.8.

Global Location Dependent

Earth’s magnetic field direction and strength vary across the surface of the earth.

The earth’s magnetic field vector points towards magnetic north as opposed to

the true geographical north. The angular difference between these two locations

is defined as magnetic declination. In addition, the earth’s magnetic field has a

varying vertical component. The angular difference between the surface of the

earth and the earth’s magnetic field is defined as magnetic inclination. This is

illustrated in Fig. 4.10 where σ is magnetic declination and where δ is magnetic

inclination.

Geographical variations in magnetic intensity, inclination, and declination are

shown in Fig. 4.11.


36

Up

MIntensity
−δ
σ
T rueN orth
M agneticN orth

East

Figure 4.10: Demonstration of magnetic intensity (M ), magnetic inclination (δ),


and magnetic declination (σ).

(a) (b)

(c)

Figure 4.11: Global variation in: (a) magnetic intensity, (b) magnetic declination,
(c) magnetic inclination [11].

These variations have implications for quadcopter flight. Variations in field

strength would affect the results of the calibration procedure in equation 4.8.

Consequently, the quadcopter should be re-calibrated per continent of operation.

Variations in magnetic declination do not actively affect user operated flight.


37

However, absolute heading error can have implications in autonomous flight.

However, if the quadcopter’s location is known, the map in Fig. 4.11(b) can be

used for correction. Finally, magnetic inclination can be accounted for likewise

using the map in Fig. 4.11(c). Another method of compensating for magnetic

inclination is to use the equation in equation 4.7 which effectively ignores the z

component of the magnetic field.

4.5 Sensor Fusion

4.5.1 Introduction

The process of combining data from multiple sensors and coming up with a

collective estimate is commonly called sensor fusion. For orientation, there are

multiple different sensor fusion algorithms such as gradient descent and Kalman

filtering [42]. However, due to the high frequency vibrations, large system

accelerations, low computational power available, and fast control loop update

requirements, not all algorithms are ideal for quadcopter flight use. With this in

mind, a simple complementary filter was selected. This work was inspired by [43]

and is shown in Fig. 4.12 where subscript k represents the sample number.

Ax,y,z Lpf Acc Check Trig θA,ϕA,ψA 0.01

θG,ϕG,ψG ΔT θG,ϕG,ψG 0.99 θk,ϕk,ψk

θk-1,ϕk-1,ψk-1

Figure 4.12: Complementary filter acting on raw accelerometer and gyro inputs.

A block diagram representation of a basic complementary filter is shown in Fig.


38

4.12 where Ax,y,z is the raw accelerometer data and Gθ̇,φ̇,ψ̇ is the raw gyroscope

data. This filter addresses weaknesses such as what was discussed in 4.2.4 and

4.3.3. While gyroscopes have good dynamic response and noise immunity, they

have long term drift. In contrast, accelerometers have poor dynamic response but

are not susceptible to drift in the same manner. Consequently, a high pass filter

is used on the gyroscope data and a low pass filter is used on the accelerometer

data. However, before the data is combined, it is important to verify validity of

the accelerometer data as mentioned in 4.2.4. Also, before combining the

gyroscope and accelerometer data, the accelerometer’s data must be converted to

orientation angles using equation 4.2.

However, a weakness of this filter is that it does not incorporate a magnetometer

and would consequently have steady state ψ error. To counteract this, a

magnetometer can be added using equation 4.8. This data can be fused with the

gyroscope reading of ψ in the same complementary fashion as to how the

accelerometer and gyro data were fused. A block diagram form of this filter is

shown in Fig. 4.13 where Mx,y,z represents the magnetometer readings scaled by

equation 4.8.

Ax,y,z Lpf Acc Check Trig θA,ϕA,ψA 0.01

θG,ϕG,ψG ΔT θG,ϕG,ψG 0.99 θk,ϕk

θk-1,ϕk-1,ψk-1

Mx,y,z Lpf Mag Check Trig ψM 0.01 ψk


ψG

Figure 4.13: Complementary filter with magnetometer integration.


39

This diagram can be easily implemented in C code. Due to the filtering and

trigonometry operations, it is highly recommended that this filter be used on a

micro-controller with a hardware floating point unit. Pseudo C code of the

proposed filter is shown in Fig. 4.14.

1 #i n c l u d e <math . h>
2 #d e f i n e DeltaT 0 . 0 0 2 // F i l t e r i s run e v e r y 2ms .
3 v o i d IMU Comp Filter ( ) {
4 f l o a t Accel Mag , P i t c h A c c e l , R o l l A c c e l ,Num, Den , Yaw Mag ; // temp
vars
5
6 Ax = Ax + 0 . 1 ∗ ( Ax Raw − Ax) ; // A c c e l e r a t i o n Low Pass F i l t e r
7 Ay = Ay + 0 . 1 ∗ ( Ay Raw − Ay) ;
8 Az = Az + 0 . 1 ∗ ( Az Raw − Az ) ;
9
10 P i t c h+= Gx ∗ DeltaT ; // Apply Gyro I n t e g r a l
11 R o l l+= Gy ∗ DeltaT ;
12 Yaw+= Gz ∗ DeltaT ;
13
14 Accel Mag = f a b s f (Ax) + f a b s f (Ay) + f a b s f ( Az ) ; // Should be n e a r
1g
15 i f ( f a b s f ( Accel Mag −1) <0.2) // I f not e x p e r i e n c i n g e x t e r n a l
acceleration
16 {
17 P i t c h A c c e l = ( 1 8 0 / PI ) ∗ atan (−Ay , Az ) ; // Apply T r i g
18 R o l l A c c e l = ( 1 8 0 / PI ) ∗ atan2 (Ax , s q r t (Ay∗Ay + Az∗Az ) ) ;
19
20 P i t c h = 0 . 9 9 ∗ P i t c h + 0 . 0 1 ∗ P i t c h A c c e l ; // Combine Gyro & A c c e l
Data
21 R o l l = 0 . 9 9 ∗ P i t c h + 0 . 0 1 ∗ R o l l A c c e l ; // Fuse gyro and
accelerometer
22 } // End o f t y p i c a l complementary f i l t e r
23
24 Mx = Mx + 0 . 1 ∗ ( Mx Raw − Mx) ; // Magnetometer Low Pass F i l t e r
25 My = My + 0 . 1 ∗ ( My Raw − My) ;
26 Mz = Mz + 0 . 1 ∗ ( Mz Raw − Mz) ;
27
28 Mag Mag = f a b s f (Mx) + f a b s f (My) + f a b s f (Mz) ; // Should be n e a r 1
29 i f ( f a b s f ( ( Mag Mag−1) <0.2) // I f not e x p e r i e n c i n g e x t e r n a l f i e l d s
30 {
31 Num = Mz∗ s i n ( R o l l ) − My∗ c o s ( R o l l ) ;
32 Den = Mx∗ c o s ( Theta )+My∗ s i n ( P i t c h ) ∗ s i n ( R o l l )+Bz∗ s i n ( P i t c h ) ∗ c o s (
Roll ) ;
33 Yaw Mag = ( 1 8 0 / PI ) ∗ atan2 (num , den ) ; // Apply T r i g
34 Yaw = 0 . 9 9 ∗Yaw + 0 . 1 ∗ Yaw Mag ; // Fuse gyro and magnetometer
35 }
36 }

Figure 4.14: Code snippet of 9DOF fusion filter.


40

4.6 Orientation Estimation Conclusion

The proposed IMU fusion filter is a computationally efficient and simple filter

that provides complete orientation assessment of a quadcopter. The filter was

validated using real world test data by placing the drone on a measured rotary

bed. Data was then simultaneously collected from the IMU as well as from

potentiometers attached to the bed itself. The results of the testing are shown in

Fig. 4.15, Fig. 4.16 and Fig. 4.17.

Fusion Filter Validation(? )


30

20

10
Degrees

-10
?Measured
-20 ?Filter
Error
-30
0 1 2 3 4 5 6 7 8 9
Seconds

Figure 4.15: Complementary filter validation test measuring and computing roll.

Fusion Filter Validation(3)


30

20

10
Degrees

-10
3 Measured
-20 3 Filter
Error
-30
0 1 2 3 4 5 6 7 8
Seconds

Figure 4.16: Complementary filter validation test measuring and computing pitch.

As observed in validation plots, the steady state error is negligible and the
41

Fusion Filter Validation(A )


40

20

Degrees
0

-20 A Measured
A Filter
Error
-40
0 2 4 6 8 10
Seconds

Figure 4.17: Complementary filter validation test measuring and computing yaw.

transient error is minimal. A weakness of this filter is that it relies on filter

coefficients that must be tunned on a case by case basis. Another weakness of

this filter is that it is using Euler angles (θ, φ, ψ). Euler rotation angles become

undefined in edge cases such as θ = 90. Consequently, this filter implementation

is not designed for acrobatic maneuvers. A strength of this filter is that is it is

easy to understand and implement. In addition, with added data checks for valid

accelerometer and magnetometer information, this filter is ideal for use on

multi-rotor aerial vehicles.


42

CHAPTER 5

Control System Implementation

5.1 Introduction

This chapter will overview the control system used to achieve stable flight and

meet the control objectives listed in 3.1. This control system was needed in order

to handle real world disturbances and to account for unknown offsets. In order to

drive the quadcopter’s orientation (θ, φ, ψ) to desired values, a series of

proportional integral derivative (PID) controllers were implemented.

5.2 PID Basics

A PID controller is a control loop that updates based upon the error observed

between a desired output and the measured output. This control loop’s response

is characterized by coefficients Kp , Ki , Kd and is shown in equation 5.1 where e

represents error and u(t) represents the PID output [44].

Z t
de(t)
u(t) = Kp · e(t) + Ki · e(τ )dτ + Kd (5.1)
0 dt

The magnitude of coefficients Kp , Ki , Kd determines how responsive the

controller is to proportional, integral, and derivative errors respectively. Control

loops such as PID act on systems to stabilize them if needed. In addition, a PID
43

loop can improve the transient response of a system. Systems themselves in

controls context are often referred to as a “plant”. In the case of this thesis, the

plant is the quadcopter system. This plant along with control is visualized in Fig.

5.1, where u(t) is the input to the plant, where r(t) is the desired set point of the

plant, and where e(t) is the error between the output of the plant and the desired

set point.

r(t)
+
- PID
e(t) u(t)
Control System

θ,ϕ,ψ IMU ESCs


Qudacopter Plant

Figure 5.1: Diagram of quadcopter plant and control system.

The input to the plant, u(t), represents the speed commanded to each of the

quadcopter’s motors. For simplicity, u(t) will be redefined to vector T where

T = [T0 , T1 , T2 , T3 ]. T0 , T1 , T2 , T3 represent the four individual motor thrust

vectors. r(t), the desired quadcopter outputs, is the user commanded orientation

angles θc , φc , ψc as well as throttle Tc . Recall that these outputs were previously

defined in equation 3.1. Note that this system is linearized at a current point in

time and consequently assumes that superposition is upheld. It follows that the

input to the system, u(t), is calculated as a summation of the individual control

components. This control concept is shown in Fig. 5.2 and the calculations for
44

each block are demonstrated in section 5.3.

θc
θIMU PID

ϕc PID
T
ϕIMU T
ψr
PID T ∑ ESCs
ψIMU
ϕIMU T
Gravity
Throttlec
θIMU Compensation

Figure 5.2: Expanded view of quadcopter’s control system.

With the input and output relationship established, the following section

overviews the PID code developed for the system as well as how T is updated

such that the control goals are achieved.

5.3 PID Software Implementation

The first step in implementing the control shown Fig. 5.2 was to write a simple

PID controller in software as shown in Fig. 5.4.

This code provides a PID output per a given input, target, and PID parameter

structure. This PID block can then be used to act on pitch, roll, and yaw.

With these control outputs, we can now finally use the model developed in

equation 3.11 which relates how θ, ψ, φ relate to motor speeds T . This model

determines how to update motor speeds T respectively. To illustrate this, Fig.

5.5 shows how equation 3.11 was applied in code to update T based on a given

control error. Note, apart from simulation, a motivation for this derivation is
45

1 #d e f i n e I THR 200 // Max t h r e s h o l d v a l u e f o r i n t e g r a l


2 #d e f i n e DeltaT 0 . 0 1 // F i l t e r i s run e v e r y 10ms .
3 f l o a t PID Output ( f l o a t Input , f l o a t Target , PID STRUCT ∗ PID ) {
4 f l o a t E r r o r = Target−Input ; // C a l c u a l t e S e t p o i n t E r r o r
5 f l o a t P = ( PID−>KP) ∗ E r r o r ; // P r o p o r t i o n a l
6 f l o a t I = ( PID−>KI ) ∗ E r r o r ∗ DeltaT + PID−>I n t e g r a l E r r o r ; //
Integral
7 f l o a t D = ( PID−>KD) ∗ ( Error− PID−>P r e v E r r o r ) ∗ DeltaT ; //
Derivative
8 PID−>P r e v E r r o r = E r r o r ; // For next d e r i v a t i v e term
9 PID−>I n t e g r a l E r r o r += ( PID−>KI ) ∗ E r r o r ∗ DeltaT ; // For next I
term
10 i f ( f a b s f ( I ) > I THR ) { // I n t e g r a l windup p r e v e n t i o n
11 PID−>I n t e g r a l E r r o r = ( PID−>I n t e g r a l E r r o r >0) ? I THR : −I THR
;
12 I = ( PID−>P r e v E r r o r >0) ? I THR : −I THR ; // L im it I t o +−
I THR
13 }
14 r e t u r n (P+I+D) ; // Return PID r e s u l t
15 }

Figure 5.3: Code snippet of PID controller.

1 void Get Control Errors ( ) {


2 c n t r l R o l l = PID Output ( IMU Roll , Remote Roll , &Roll PID ) ;
3 c n t r l P i t c h = PID Output ( IMU Pitch , Remote Pitch , &Pitch PID ) ;
4 cntrlYaw = PID Output (IMU Yaw , Remote Yaw , &Yaw PID ) ;
5 }

Figure 5.4: Code snippet for calculating PID results.

such that pitch and roll perform similarly. Consequently, constants A, B are

formed for pitch and roll respectively. For normalization, pitch and roll were

divided by A such that their response would be roughly equal. Yaw rate is due to

different inertia physics and thus was not scaled by A.

The final control variable is height(z) which is controlled by the user.

Consequently, as far as the controller is concerned, this is open loop control.

However, to simplify user control, aspects of equation 3.11 can still be taken into

account. Specifically when the quadcopter has a non-zero roll or pitch, more

collective thrust is needed in order to ensure the quadcopter maintains its height.

The code designed to achieve this throttle control is demonstrated in Fig. 5.6.
46

1 #d e f i n e A (H ∗ DeltaT / ( 2 ∗IXX) ) // Constant a c t i n g on p i t c h


2 #d e f i n e B (L ∗ DeltaT / ( 2 ∗IYY) ) // Constant a c t i n g on r o l l
3 void Apply Pitch ( ) {
4 T [ 0 ] += ( 1 /A) ∗ c n t r l P i t c h ;
5 T [ 1 ] += ( 1 /A) ∗ c n t r l P i t c h ;
6 T [ 2 ] −= ( 1 /A) ∗ c n t r l P i t c h ;
7 T [ 3 ] −= ( 1 /A) ∗ c n t r l P i t c h ;
8 }
9
10 void Apply Roll ( ) {
11 T [ 0 ] += ( 1 /B) ∗ c n t r l R o l l ;
12 T [ 1 ] −= ( 1 /B) ∗ c n t r l R o l l ;
13 T [ 2 ] −= ( 1 /B) ∗ c n t r l R o l l ;
14 T [ 3 ] += ( 1 /B) ∗ c n t r l R o l l ;
15 }
16
17 v o i d Apply Yaw ( ) {
18 T [ 0 ] +=cntrlYaw ;
19 T [ 1 ] −=cntrlYaw ;
20 T [ 2 ] +=cntrlYaw ;
21 T [ 3 ] −=cntrlYaw ;
22 }

Figure 5.5: Code snippet of pitch, roll, and yaw thrust calculations.

With the implementation of the PID system and update laws, these segments of

code can be combined to formulate the overall control system. Note that to

achieve a stable quadcopter, it is recommended to update motor speeds at least

at a rate of 100 Hz. This control loop code is illustrated in Fig. 5.7.

5.4 GUI and PID Tuning

Optimal selection of PID coefficients is a common problem when designing a PID

control system. Given one has an accurate physical model, the optimal PID

coefficients can be selected based upon desired overshoot and speed for example.

However, without a physical model, values can be tunned on the fly. Initially,

quadcopter parameters to achieve flight were tunned on the fly. A javascript GUI

was written to help for debug purposes. This GUI had the capacity to tune the

PID parameters of the quadcopter on the fly. A snapshot of this GUI is shown in
47

1 #i n c l u d e <math . h>
2
3 v o i d Apply Gravity Compensation ( ) { // a d d i t i o n a l t h r u s t i f t i t l i n g
4 f l o a t MG Factor = (MASS ∗ GRAVITY / 4 ) ∗ c o s ( IMU Pitch ) ∗ c o s (
IMU Roll ) ;
5 T [ 0 ] +=MG Factor ;
6 T [ 1 ] +=MG Factor ;
7 T [ 2 ] +=MG Factor ;
8 T [ 3 ] +=MG Factor ;
9 }
10
11 v o i d A p p l y T h r o t t l e ( ) { // Take j o y s t i c k v a l u e o f t h r o t t l e and
apply i t t o a l l motors
12 T [ 0 ] +=R e m o t e T h r o t t l e ;
13 T [ 1 ] +=R e m o t e T h r o t t l e ;
14 T [ 2 ] +=R e m o t e T h r o t t l e ;
15 T [ 3 ] +=R e m o t e T h r o t t l e ;
16 }
17
18 #d e f i n e MOTOR SPEED MAX 1 0 0 0 . 0 // Max s p e e d n o r m a l i z e d t o 1 0 0 0 .
19 #d e f i n e MOTOR SPEED MIN 1 0 0 . 0
20
21 v o i d A p p l y T h r o t t l e L i m i t s ( ) { // Ensure motor v a l u e s a r e not
beyond t h e i r min/max v a l u e s
22 uint16 t i = 0;
23 f o r ( i =0; i <4; i ++)
24 {
25 i f (T [ i ] >(MOTOR SPEED MAX) )
26 T [ i ] = MOTOR SPEED MAX;
27 e l s e i f (T [ i ] <(MOTOR SPEED MIN) )
28 T [ i ] = MOTOR SPEED MIN;
29 }
30 }

Figure 5.6: Code snippet of open loop throttle control.

1
2 v o i d Run Control Loop ( )
3 {
4 Get Control Errors () ;
5 Apply Throttle () ;
6 Apply Gravity Compensation ( ) ;
7 Apply Pitch ( ) ;
8 Apply Roll ( ) ;
9 Apply Yaw ( ) ;
10 Apply Throttle Limits () ;
11 }

Figure 5.7: Code snippet of control loop.

Fig. 5.8.

This GUI was useful for collecting and saving live flight data, testing motor
48

Figure 5.8: Quadcopter javascript GUI.

orientation, and adjusting PID values. Being able to update and visualize data

on the fly greatly simplified PID tuning and general development.

5.5 Software Architecture

The control loop in Fig. 5.7 along with the IMU code in Fig. 4.14 account for

the majority of flight critical code running on the quadcopter. An overall

software architecture is shown in Fig. 5.9.

To keep control timing and IMU collection constant, the software was

implemented in three separate threads. These threads primarily managed IMU

filter updates, control system updates, and radio link updates. For this

quadcopter software implementation, IMU data is received on a consistent


49

No No No
Radio Data Timer ISR IMU Data
Ready? Expired? Ready?
(Loop) (200Hz) (ISR)

Yes Yes Yes

Get Radio Data Run Control Get IMU Data


Loop
Run Non
Critical Super
Update Control Loop Update Motor Fuse IMU Data
Variables Speeds

Send Telemetry
Data

Figure 5.9: High level quadcopter software flow chart.

interrupt basis. Gyro and accelerometer readings are updated and filtered at 500

Hz. The magnetometer is updated at 100 Hz which is the maximum for the

selected device. These updates are performed based on an interrupt to give the

IMU filter constant timing characteristics. Likewise, the control system is also

triggered through interrupts. The control system executes every 200 Hz and uses

the most up to date data from both the controller and the IMU filter to perform

its calculations. Less timing critical tasks are then executed in a super loop such

as checking for new radio data, transmitting telemetry data, handling USB

commands, and other non flight related features. Full source code is provided at

[45].
50

CHAPTER 6

Radio Frequency System Implementation

6.1 Introduction

This chapter overviews the radio frequency (RF) system used with the Marq

Drone and explains concepts regarding its design. Radio frequency design at

ultra high frequency (UHF) is challenging which is why a chapter is devoted to

it. This chapter will overview a minimal amount of information required to

design a legal and efficient RF link. The RF hardware designed for the Marq

Drone is shown in Fig. 6.1.

(a) (b)

Figure 6.1: RF Marq Drone hardware: (a) Flight controller, (b) Radio controller

The Marq Drone utilizes a flight controller with an integrated radio as well as a

remote controller with an integrated radio. The primary motivation behind this

was to eliminate use of the PPM protocol as well as have the capacity to collect

data in real time. This hardware was designed to help understand the nature of
51

the underlying system as well to be able to implement a more flexible

architecture as shown previously in Fig. 2.5. The schematics of these pieces are

included in Appendix A. The CC2500 transceiver was selected for this RF system

and its selection is explained in latter sections. A RF block diagram of this

system is presented in Fig. 6.2.

RF Remote
Monopole
2.4GHz 2.4GHz CPWG Matching
MCU SPI Radio Balun Antenna
100Ω 50Ω 50Ω Π network
¼λ

2.4GHz 2FSK

Flight Controller
Monopole
2.4GHz 2.4GHz CPWG
MCU SPI Radio Balun Antenna
100Ω 50Ω 50Ω
¼λ

Figure 6.2: Block diagram of Marquette Drone RF system

These RF blocks will be overviewed in the following sections. Before overviewing

these blocks, basic design considerations are addressed such as frequency of

operation and range calculations.

6.2 Selecting a Frequency Band

Frequency of operation is the principal attribute of any RF system. The

frequency determines the size of the radio system, the required power of the RF

system, and the legality of a system. Firstly, one must select a radio frequency

that is legal to operate in their region. For many countries, there exists

Industrial, Scientific, and Medical (ISM) bands of operation where RF


52

transmission does not require a license. For the United States, ISM operation is

covered in FCC Title 47 Part 15 [46] and is shown in Table 6.1.

Fundamental fre- Field strength Field strength of


quency (MHz): of fundamental harmonics (mV/m)
(mV/m)
902-928 500 1.6
2435-2465 500 1.6
5785-5815 500 1.6
10500-10550 2500 25.0
24075-24175 2500 25.0

Table 6.1: Title 47 part 15.245 ISM Bands.

The 2.4 GHz band is widely accepted in most countries and has become popular

for consumer electronics. Consequently, many affordable RF devices now exist for

this band of operation. An advantage of this band is the size of its quarter

wavelength. The calculations for the 2.4 GHz quarter wavelength are shown in

equation B.2 where λ is wavelength, where c is the speed of light, and where fo is

the frequency of operation.

λ c
=
4 4 · fo
(6.1)
2.99 · 108 m/s
≈ 3.12cm ≈ 1.23inches
4 · 2.4GHz

Having a quarter wavelength of roughly 1.23 inches allows for the antenna to be

easily mounted to both the drone and the remote controller. While smaller

antennas could be used for lower frequency bands, these antennas would be

fundamentally limited in their efficiency.


53

6.3 Creating a link budget with Friis transmission

Another crucial aspect of an RF system is designing for a desired transmission

range. Traditionally this is done by creating a link budget. To create a link

budget, the power output of the transmitter must be known, the antenna gain of

both the transmitter and receiver must be known, and the receiver sensitivity

must be known. With these inputs and assuming Friis transmission, the Friis

transmission equation can be used to calculate range [47]. For the Marq Drone

system, quarter wavelength monopoles were used for the transmitter and receiver

that have an ideal antenna gain of 5.19 dBi. In regards to the transiever, the

CC2500 was selected which has a max transmission power of 1dBm and a

receiver sensitivity of -83 dBm at 500kBaud. The standard representation of the

Friis transmission equation as shown in equation 6.2 where Prx is the receiver

sensitivity in watts, where Ptx is the transmitter power in watts, where r is the

distance in meters, and where Gtx , Grx are the isotropic gains of the transmitter

and receiver antennas.

 2
c
Prx = Ptx · Gtx · Grx (6.2)
4π · r · fo

Next, this equation is solved for range in terms of units that are commonly

specified such as decibel milli-watts (dBm) and decibel isotropic (dBi).

c
Ptx,dbm − Prx,dbm + Gtx,dbi + Grx,dbi + 20log10 ( 4·π·f ) − 10
 
o
r = 10E ≈ 82m
20
(6.3)
54

Note this is a highly optimistic estimate of the expected range since it assumes

perfect antenna gains and no additional losses. However, this number is a ball

park range and one cannot expect more than this value. Often it is assumed that

the observed value will be 10 times less than an ideal measurement which would

leave the range to be slightly under 100 feet which is acceptable for indoor flight.

6.4 2.4GHz Microstrip and Coplanar Waveguide Transmission Line

Transmission lines are required for high frequency signals where parasitic

inductance and capacitance begin to affect the characteristics of the signal

transmitted. 2.4 GHz is a high enough frequency where these parasitic effects

will have adverse influence over signals transmitted. For optimum power

transmission, the source impedance must match the load impedance and the

transmission line impedance. In general, both sources and antennas are matched

to 50 Ω impedance. This leaves the transmission line impedance which must be

designed to 50 Ω. Consequently, a transmission line is needed on the PCB

between the source and the antenna. There are two common transmission lines

that can be easily created on a PCB and they are shown in Fig. 6.3.

Calculations for these transmission lines are lengthy and are included in

Appendix B. Note that it is imperative that the correct r be used for both

equations and that this parameter changes with frequency. Fig. 6.4 is a

demonstration of how frequency affects the dielectric constant of a PCB

substrate. For most materials, the dielectric constant trends downwards as the

frequency increases.
55

εr h

(a)

b
a

εr h

(b)

Figure 6.3: PCB transmission lines: (a) Microstrip line, (b) Coplanar waveguide.

Figure 6.4: Plot of how r changes with respect to frequency [12].

Failing to take the material’s frequency characteristics into account can result in

lossy transmission lines. While the transmission line equations in Appendix B are

frequency independent, the material characteristics cause a real world frequency

dependency.

With regards to transmission line selection, coplanar wage guides are often

preferred since they result in smaller transmission lines. In addition, coplanar


56

waveguides are more ideal for adding shunt tunning elements. Parallel and series

element tuning networks can be used to match a load impedance (antenna) to

the transmission and the source impedance. Tunning strategies are beyond the

scope of this thesis but are overviewed at the following reference [48]. An

example matching network is shown in Fig. 6.5.

Figure 6.5: PI tuning network example located on the RF controller.

In this network, shunt and series elements can be changed to capacitors or

inductors as needed. This network should be located close to the load that is

intended to be matched. Vias were added around the network to reduce ground

loop impedance. Without vias, small value capacitors can act as inductors.

These vias are left un-tented to allow for connection of RF pigtails. RF pigtails

are used to validate the impedance of the network with a vector network

analyzer. Note, if RF performance is satisfactory, the network can be left

unpopulated except for a zero ohm resistor on the series element.


57

6.5 RF Baluns

RF sources and loads often exist in differential and single ended forms. The

CC2500 transceiver has a differential RF output which was intended for

differential loads such as loop antennas or dipole antennas. However, differential

antennas are a mechanical inconvenience so it is often desired to use single ended

loads such as a monopole antenna or a helical antenna. Consequently, baluns are

used to convert from differential signals to a single ended signals and vice versa.

PCB mounted baluns can be made of passive discrete electrical components such

as inductors and capacitors [14]. However, the validation and the tunning of

these baluns is difficult without access to a high frequency oscilloscope. An

alternative is to use an integrated balun that requires minimal additional discrete

components. Examples of both an integrated balun and discrete balun are

illustrated in Fig. 6.6.

For this thesis, an integrated balun was used to save space and reduce design

complexity [13].

6.6 RF Packet Structure and Collision Avoidance

Once the hardware design of the system was completed, a method of sending RF

packets was designed. This method is only an example and is by no means

optimal. RF packet structures vary for application as to whether throughput or

range is prioritized. The RF packet structure used in this thesis is shown in Fig.

6.7.
58

(a)

(b)

Figure 6.6: RF Baluns: (a) Integrated Balun [13], (b) Discrete Balun [14].

Data Check
RF Preamble Sync
Sync Index Data sum
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Figure 6.7: RF packet implementation.

This packet contains four major components which are a preamble, sync, data,

and checksum. The preamble size can vary and is used to give the receiver an

opportunity to lock onto the signal being transmitted. Longer preambles increase

the probability of the packet being received. Sync bytes inform the receiver when

the preamble has ended. The data segment of the packet in this case consists of
59

two sync bytes, an index byte, and four bytes of data. Finally a checksum is

appended to the packet to help verify the validity of the data received. Note the

preambles are not checksummed since it takes time for the receiver to lock onto

the signal and initial corruption is expected. RF packets are discarded should the

data checksum fail. Packeting of data as opposed to a continuous stream helps

save power as well as gives the opportunity for bidirectional communication

between transceivers. However, a disadvantage of packeting data is overhead. In

this case, 15 bytes of data are used to convey 5 bytes of information. This limits

the effective baud rate at which information is transfered. Another bandwidth

limitation is the speed that bytes are encoded on top of the 2.4 GHz carrier

frequency. For this implementation, two frequency shift keying (2-FSK)

modulation was used. Bytes were encoded at 250K baud rate which meant that

at best, information would be conveyed at 250K speed in addition to packet

overhead. A lower baud would increase probability of reception meanwhile a

higher baud would allow for faster transmission. 250K was selected as a

compromise between these two goals. Then, to achieve bi-directional

communication, a ping system was used in which the remote would periodically

send out control packets and the flight controller would send back telemetry

information when it received a packet. Naturally, the period of this exchange

must be longer than the time required to transmit 2 packets. A packet exchange

is shown in Fig. 6.8 by probing the voltage at the balun.

The balun has an integrated bandpass filter which simplifies observation of

transmitted and received packets. While the presence of packets can be observed

by a RMS magnitude, the individual byte information is not possible to obtain


60

Figure 6.8: RF packet implementation observed on an oscilloscope by probing the


balun voltage.

without a GHz class oscilloscope. Having the remote transmit periodically and

the flight controller echoing back helps prevent any chance of packet collision. An

initial design where both the controller and flight controller periodically

transmitted independently resulted in phases of signal loss. During the phases of

signal loss, both the remote and controller were periodically transmitting at the

same time and periodic collisions would occur.

6.7 Conclusion

Designing a custom RF system allows for great flexibility and efficient data

acquisition but comes at the cost of design complexity. For a custom RF system,

first a frequency band is selected based on the antenna size desired and legal

bands of operation. After a frequency has been selected, antenna types and a

transceiver are selected given the mechanical and power constraints of the
61

system. RF transmission lines and baluns are required in order to get a signal

from point A to B without significant loss. Finally, a scheme must be formulated

for the transmission of bidirectional packets. In the end, an efficient,

customizable, and bidirectional link was established between the quadcopter and

the remote. This is advantageous over the majority of off-the-shelf systems since

data is not encoded into PPM signals, the data is bidirectional, and the source

files are available for future expansion.


62

CHAPTER 7

Hardware Implementations

7.1 Introduction

This chapter overviews the electronic hardware design of the quadcopter.

Electronic hardware components of this system include the radio system, flight

controller, and motor controllers. A picture of the quadcopter is shown in Fig.

7.1.

These pieces of hardware were designed to help understand the nature of the
63

underlying system as well to be able to implement a more flexible architecture as

shown previous in Fig. 2.5. Hardware involved in this project was designed in

Altium and schematics/PCBs can be viewed fully in Appendix A. The following

sections overview the hardware design for the quadcopter.

7.2 Flight Controller Hardware

The flight controller consists of a MCU, a IMU, a radiocore, and external IO.

The flight controller is responsible for stabilizing the quadcopter and executing

user control. To simplify the software, a microprocessor was needed with

sufficient computational power for numerous floating point instructions. The

Cortex M4 MK22FN512 by Freescale was chosen for its FPU, large flash space,

large RAM space, USB interface, low per unit cost, and hardware simplicity.

With regards to the IMU, the MPU-9250 by Invensense was selected since it is a

compact integrated solution with a 3 axis accelerometer, gyro, and

magnetometer. Another advantage of the MPU-9250 is that it had already been

flight tested in another multi-rotor platform [24]. For the radiocore, the CC2500

by Texas instruments was selected due to its low cost and high reconfigurability.

For motor control, four hardware PWM pins were exposed on external headers

for PPM communication with ESCs. Finally, serial IO and analog IO were

exposed on an additional external header for additional expansion. This

architecture is illustrated in block diagram form in Fig. 7.1.

The board itself was assembled using solder paste and a toaster reflow oven. The

primary hardware challenges involved in flight controller operation was the


64

Marq Drone Flight Controller

Power LDO PPM


USB
Connector 3V3 Headers
PWM

3V3
3V3

IMU MCU Radio


SPI SPI Antenna
MPU9250 MK22FN512 CC2500

UART/AIO
ISP
PWM
Program Aux PPM
Header IO Headers

Integrated
Legend: Connector Passive
Circuit

Figure 7.1: Block diagram of flight controller

development of the radio core. The micro-controller as well as the IMU are much

lower frequency devices which accordingly required less attention to detail. Clean

power sourcing, decoupling, electrostatic discharge (ESD) protection, transient

protection and other basic hardware principles were implemented in its design.

The assembled design is shown in Fig. 7.2.

7.3 Remote Controller

The remote controller hardware consists of two joysticks, a micro-controller with

a USB interface, a radiocore, push buttons, and a rechargeable battery. A system

level block diagram for the remote is shown in Fig. 7.3. This diagram illustrates

all the major hardware blocks utilized by the controller. Further information can

derived from the source code as well as the schematic.

For the joysticks, two Frsky Taranis Gimbals were selected. These joysticks were
65

selected since they were primarily designed for remote flight control. To simplify

the mechanical design, these joysticks mount directly to the PCB which avoids

requiring an injection molded or 3D printed enclosure. With regards to the

microcontroller, the Freescale Kinetis Cortex M0+ KL25Z128 microcontroller

was selected due to its low cost, availability, and USB interface. The radiocore is

the same as the flight controller which is the CC2500 and discussed in Chapter 6.

Push buttons were added for flight commands such as emergency cutoff. Finally,

for remote portability, a 1 cell 4.2V LiPo cell battery was used such that the

remote could be operated independently of a computer. This cell would be

recharing any time the USB interface was plugged in. In addition, the battery

system had hardware protection against reverse battery, current back-feeding,

over current, and under-voltage. A picture of the assembled controller is

illustrated in Fig. 7.4.

Figure 7.2: Image of Marq Drone flight controller.


66

Marq Remote Controller


LDO
Radio
3V3 3V3 Antenna
CC2500
MCP1702

3V3
SPI

UV/OC/ MCU
RC/FB Joystick1 AI KL25Z128 AI Joystick2
Fault
Protection
Cortex M0+

DI
5V USB 2.0 ISP

4.2V LiPo Charge Push


Program
Rechargable CC Circuit 5V USB Buttons
Header
CR2 MCP73812 QTY(6)

Integrated
Legend: Connector Passive
Circuit

Figure 7.3: Block Diagram of flight controller.

Figure 7.4: Image of Marq Drone remote.


67

Apart from the RF design, the only other challenging aspect of the remote

controller design was the LiPo battery protection system. Care must be taken

such that Lipo batteries are not overcharged. Overcharging LiPos will break

down their internal chemistry and potentially cause fires. Consequently, the

MCP73812 charge IC was used to regulate the current being used to charge the

LiPo and to cutoff charging at the batteries nominal voltage. Another danger

with LiPo batteries is draining them past their minimum rated voltage.

Overdraining can result in a break down of chemistry which leads to inability to

recharge and sustain charge. Finally, drawing more than the battery’s rated

current can cause the battery to overheat and potentially catch fire and or break

down in chemistry. Note, the energy capacity contained in a small single cell

LiPo battery is very minimal which significantly reduces the potential hazards

the battery can generate. The circuit derived to prevent under voltage, over

current, and reverse battery is shown in Fig. 7.5.

Lithium Charger
Lipo Protection & Power System 5V

5V 5V
U1
4 3 Vreg
VDD VBAT
5 D1
PROG Backup Q1 Q2 Bat45C
PMUX

R1
C2 10K C3 Reverse

1uF 1 2 1uF R2 C4
CE VSS UVLO

2MEG Q3 Q4 10uF
C8 399-3699-6-ND
MCP73812
U3 100nF
CR2 R5
BH-CR2-PC 1MEG S1 System On/Off Switch

SW-SPST

Figure 7.5: LiPo under voltage, over current, over charge, reverse bias, and back-
feed protection circuit.

U1 prevents overcharging of the LiPo. PFET Q1 prevents damage to U1 and

other ICs in the event of reverse bias. Q2 in combination with R2 and R5 creates

an under voltage lockout as well as an over current lockout. When the LiPos

battery voltage is low, the bridge divider on the gate of Q2 forces Q2 into the
68

cutoff region of operation. Similarly, when significant current is drawn, the

internal resistance of the battery combined with the R2 and R5 bridge forces Q2

into cutoff. Back to back PFETs Q3 and Q4 prevent USB power from

back-feeding the battery when plugged in. FETs were used as opposed to diodes

on the batteries current path to eliminate voltage drop out on the 3.3V rail.

7.4 Electronic Speed Controller Hardware

The brushless sensorless motor controllers, or ESCs, are made up primarily of a

microcontroller, gate drivers, and high power FETs. The MCU selected was the

Cortex M0+ KL25Z128 Kinetis by Freescale. This was the same processor used

on the remote and is pin by pin compatible with the micro-controller on the

flight controller. The gate driver selected was the ADP3110 by ON

Semiconductor since it supported dual high side low side NFET driving,

supported 3.3V logic signals, is low cost, and has a easy to solder package. The

primary switching FET selected was the PSMN011 by NXP since it supports a

max drain current of 61A, has an RDSON of 10 mΩ, and since it utilizes a small

QFN package. A block diagram of this system is Fig. 7.6.

This ESC was designed to be compact and have capacity to drive atleast 10A of

current. To achieve this, double sided population was required. Another useful

aspect of this design was the USB interface for data acquisition as well as

programming. This ESC was created first as a larger dev board with more

debugging features such as headers for probing. Once the theory of operation was

confirmed, this board was shrunk to a 0.9” by 1.6” board. Pictures of both of
69

Marq Electronic Speed Controller Comm Phase A HS Gate A


Phase A
Header Gate Driver PSMN011-60
Connector
PPM/I2C ADP3110A LS Gate A

I2C PWM
BEMF_A

LDO MCU Phase B HS Gate B


RV Phase B
5V KL25Z128 PWM Gate Driver PSMN011-60
Protection Connector
MCP1702 Cortex M0+ ADP3110A LS Gate B

VBAT ISP USB 2.0 BEMF_B


PWM
Phase C HS Gate C
Battery Program Phase C
USB Gate Driver PSMN011-60
Connector Header Connector
ADP3110A LS Gate C

BEMF_C

Integrated
Legend: Connector
Circuit

Figure 7.6: Block Diagram of Marq ESC.

these boards are shown in Fig. 7.7

(a) (b)

Figure 7.7: Picture of ESCs: (a) Marq ESC, (b) Marq ESC Dev board.

With regards to method of operation, recall these ESC are effectively sensorless

brushless motor controllers as stated in Section 2.1. This controllers uses is back

EMF zero crossing detection [29]. The following section will briefly describe

brushless motor basics as well as the BEMF zero cross detection driving method
70

used in this controller.

7.4.1 Brushless Motor Operation

Brushless motors are synchronous 3 phase permanent magnet motors. Like a DC

brushed motor, brushless motor consists of a stator which contains coils and a

rotor which contains permanent magnets. If the coils are energized correctly, the

coils create a rotational torque that acts on the magnets on the rotor. Since the

magnets are adhered to rotor, this rotational torque causes the motor shaft to

spin. However, if the coils on the stator are not energized correctly with respect

to the polarity and position of the magnets, rotational torque is not generated.

Consequently, knowledge of the rotors position is required in order to properly

drive a DC motor. For brushed motors, a mechanical device called a brush is

used such that stator coils are always properly energized with respect to the

rotor. However, with a brushless motor, this mechanical linkage from stator to

the rotor is removed in order to reduce friction and extend motor lifetime.

Without the mechanical linkage between the rotor and the stator, external

sensing methods of the rotor are required. Hall effect sensor can be used in order

to detect the rotors position. However, hall effect sensors are expensive and

require additional wires as well as mechanical protection. Another method of

driving brushless motors is with sensor-less techniques such as back electromotive

force (BEMF) zero cross detection.


71

7.4.2 Introduction to BEMF Zero Cross Driving

BEMF zero cross detection driving is a brushless 3 phase motor driving method

that relies on estimating the rotors position by using voltage generated by the

motor’s rotation. Naturally, brushless motors generate voltage when rotating

similar to how a generator produces power. This voltage generated by the

brushless motor is called BEMF. During operation, it is possible to view the

BEMF signal of a DC 3 phase brushless DC motor on a disconnected phase.

Within the BEMF waveform, there is an event called the “zero crossing”. This

event is used to determine the rotor’s position in order to drive the motor

correctly. The following section will introduce basic driving concepts as well as

how to observe and utilize zero crossing events.

7.4.3 Brush-less Motor Driving Hardware

Brushless motors are 3 phase loads. To drive current in any direction through

these three phases, three H-bridge switches are used. Consequently, there is a

total of six switches and only two switches are turned on at a given time. This

leaves one phase disconnected and this phase’s voltage is representational of the

BEMF of the motor. This concept is illustrated in Fig. 7.8 where the phase A

high side switch is on, where the phase C low side switch is on, and where phase

B voltage is the BEMF signature.

These 6 switches must be actuated in a specific sequence in order for the motor

to spin. This sequence is often called the “6 step trapezoidal commutation

sequence”.creates
sequence This sequence is illustrated
a rotational torque on in
theFig. 7.9.
rotor If actuated
of the correctly,
motor. Note thethis
that in
72

VBAT

Brushless Motor
Phase A Phase B
High Side

Phase A

Phase A
Low Side Phase C

Legend: BEMF Drive Drive


(High Z) Low High

Figure 7.8: Diagram of brushless motor and 6 driving switches.

Phases 1 2 3 4 5 6

Phase A
Zero Cross
(voltage)

Phase B
Zero Cross
(voltage)

Phase C
Zero Cross
(voltage)

BEMF Drive Drive


Legend:
(High Z) Low High

Figure 7.9: 6 step trapezoidal commutation sequence.


sequence, one phase is always producing BEMF. The BEMF phase is used in

order to determine the position of the rotor such that power can be applied

productively. The position of the rotor can be determined by detecting zero

crossing events. A zero crossing is where the BEMF crosses over the neutral
73

voltage of the motor. This zero crossing event represents a rotor mid point

between a commutation step. To utilize this zero crossing event, an assumption

can be made that the rotor is not rapidly accelerating within a commutation

step. This assumption is fair for brushless motors on a quadcopter since the

torque load is nearly constant. With this assumption, one can assume that the

time it takes for the mid point to be observed will also be the approximate time

it takes for the rotor to reach the next commutation phase. A basic software

flowchart demonstrating this concept is shown in Fig. 7.10.

Zero
Increment To No crossing event Reset To
occurred?

Yes

Increment
Delay for
Commutation
To Cycles
Drive Step

Figure 7.10: Software block diagram of zero cross brushless motor driving.

While this driving scheme is simple, complexity arises in detecting the zero cross

event. The zero crossing event can be determined by using a hardware

comparator that compares the motor neutral voltage with the BEMF waveform.

However, most brushless motors for multi-rotors do not expose the neutral signal

line of the motor. Consequently, this neutral voltage must be approximated by

summing the three phase voltages. This is further complicated by significant

BEMF noise generated by PWM switching. The diagram shown in Fig. 7.9

illustrates 100% duty cycle which is not a common mode of operation. It follows
74

that to vary the speed of the motor, the duration of on time is reduced with

PWM. These switching signals create voltage transients that couple onto the

BEMF phase. A brushless motor phase voltage is shown in Fig. 7.11 along with

the hardware comparator readings.

Figure 7.11: Brushless motor phase voltage (yellow) and zero cross detection com-
parator (green).

To achieve these results, hardware filtering was implemented on the MCU where

comparator samples were windowed and transitions were generated only after a

certain amount of consecutive agreeing samples were observed. This filtering

along with the software method proposed in Fig. 7.10 allowed for effective

brushless motor operation.


75

7.4.4 ESC Conclusion

Brushless motors are efficient motors that can be driven through various

sensorless techniques such as zero cross detection. Section 7.4.3 overviews both

the hardware and software required to implement BEMF zero-cross driving of

brushless motors. While sensorless driving was achieved, there was not enough

time to incorporate the drivers shown in Fig. 7.7 into the final quadcopter.
76

CHAPTER 8

ICL and Lidar Integration

8.1 Introduction

This chapter overviews a strategy to meet the secondary control objective

proposed in equation 3.2 which is the elimination of positional drift. Positional

drift is one obstacle of many that must be overcome in order to achieve

autonomous indoor flight of quadcopters. Unlike land based robots, there is no

significant static frictional force to keep a quadcopter in place when hovering.

Consequently, there is a variety of factors that can cause positional drift in a

quadcopter. One source of drift results from equation 3.4 being an

approximation. Frame imperfections and air turbulence results in a summed

force vector that isn’t purely vertical. Another source of drift can be from

external forces such as air flow in a room. A final source of drift can occur from

imperfections in the control system or imperfections in the orientation

estimation. As a result of these sources, positional drift is a common problem for

quadcopters. The sensors overviewed in Chapter 4 are incapable of measuring

positional drift directly. Consequently, to directly sense positional drift, more

sensors are needed. For outdoor flight, GPS in combination with IMU and

barometer sensors have been used to reduce positional drift with an extended

Kalman filter [49]. However, GPS is not reliable indoors and barometers do not

provide sub meter accuracy. Consequently, other sensors are used such as optical
77

flow cameras, external cameras, radio beacons, and lidars. This thesis will

explore the use of a lidar sensor.

8.2 Lidar use for positioning

Lidar is a rotating laser range finder that provides 2-dimensional position

information. A laser range finder calculates distance by measuring the time

required for a laser to strike a target and bounce back. This time of flight

measurement can be converted to distance using the speed of light. The lidar’s

distance output is then encoded into polar coordinates (r∠θ). This data can then

be converted to Cartesian coordinates using the equations: x = r · cos(θ),

y = r · sin(θ). An example 2D lidar dataset recorded in a room is shown in Fig.

8.1 where points represent distance from the lidar.

Lidar Room Plot


3000

2000

1000
mm

-1000

-2000

-3000
-5000 -4000 -3000 -2000 -1000 0 1000
mm

0.5 1 1.5 2 2.5 3 3.5 4 4.5 5


Time (seconds)

Figure 8.1: Lidar plot of room


78

In this plot, the change in color represents a change in time. For this dataset, the

lidar was in a stationary position. With regards to the physical hardware, this

dataset was taken with the XV-11 lidar [50]. This lidar was used in order to help

eliminate positional drift cheaply and in a computational efficient manner.

Currently, this lidar is the most affordable lidar on the market which provides

motivation for its use. Commonly, in other research, more expensive lidars such

as the Hokuyo UTM-30XL lidar was used [15],[26]. Pictures of the XV-11 lidar

and the Hokuyo UTM-30XL are shown in Fig. 8.2.

(a) (b)
Figure 8.2: (a) Hokuyo UTM-30LX lidar used in [15] . (b) Neato XV-11 lidar
device used in this project.

While the XV-11 lidar is more affordable, this price reduction comes at the cost

of performance. Table 8.2 overviews the technical performance between the

XV-11 lidar and the UTM-30LX Lidar.

Lidar device: Hokuyo UTM-30LX Neato XV-11


Points per revolution 1,440 360
Revolution speed (ms) 25 250
Max range (m) 30 4
Cost (USD) 4,825 150

Table 8.1: Specifications of the two lidars from Fig.8.2.

While lidar can provide crucial distance information, this data comes at the cost

of significant computational requirements. For example, the UTM-30LX


79

generates 57600 points per second. Once points are obtained, a significant

amount of post processing must occur in order to transform this data into useful

positional information. As a result, systems developed with lidars often consist of

GHz processors with gigabytes of RAM. This chapter will focus on developing an

algorithm to achieve this translational information with significantly less

computation.

8.3 Method of parsing Lidar Data

In order to eliminate the quadcopter’s positional drift (∆x, ∆y), an algorithm is

ˆ ∆y)
required in order to estimate (∆x, ˆ from the lidar datasets. An example

dataset of positional drift is shown in Fig. 8.3 where the lidar was moved left by

roughly 600mm.

Lidar Room Plot


3000

2000

1000
mm

-1000

-2000

-3000
-5000 -4000 -3000 -2000 -1000 0 1000
mm

0.5 1 1.5 2 2.5 3 3.5 4


Time (seconds)

Figure 8.3: Lidar moved to the left by ≈ 600mm


80

To estimate information from this lidar data, various computational geometry

methods are employed such as iterative closest point (ICP), and iterative closest

point line (ICPL) [25][51]. These methods are commonly used for solving point

cloud translation problems. In addition to determining positional translation,

these algorithms can also be employed to detect rotational differences and scaling

differences between data sets. However, in order to limit scope, complexity, and

computation, the lidar will be employed only for translational determination.

The magnetometer for example, can be used to determine rotation. While ICP

can estimate translation, ICP becomes less accurate with less data points and

when datasets that are taken at a further distance away. For example, if ICP is

employed on the dataset in Fig. 8.3, ICP would register positional changes in

both X and Y as shown in Fig. 8.4.

P0,6 P1,6
P1,3

P0,3 ΔY3
Prev,index ΔX3

P0,1 P1,1
Lidar Average Resulting
Vector

Figure 8.4: ICP Iteration


ICP operates with gradient descent and an example iteration is shown in equation

8.1 where x and y are arrays of N lidar points, where σ represents the gradient

descent learning rate, and where ∆x, ∆y represent the resulting lidar translation.
81

i=N
X  i=N
X 
δx = E (xi − xcp ) , δy = E (yi − ycp )
i=0 i=0

∆x = ∆x + δx, ∆y = ∆y + δy (8.1)
i=N
X i=N
X
x= (xi + σ · δx), y= (yi + σ · δy)
i=0 i=0

Note that additional computation is required in order to find (xcp , ycp ) which

represent the coordinates of the closest point from a previous lidar data set to a

present given point (xi , yi ). Convergence requirements and the value of the

learning rate would be determined by a designer on a application basis. However,

due to the geometry nature of ICP acting on lidar data, this algorithm may not

converge to a correct value. In order to achieve accurate indoor drift

measurement over time, a more accurate algorithm is needed.

8.4 Iterative Closest Line

This section overviews a specific implementation of the iterative closest line (ICL)

algorithm proposed for parsing lidar data efficiently and accurately. ICL is based

on a closest point to line metric as opposed to ICP which is based on a closest

point to point metric. In ICL, the point Pcp with coordinates (xcp , ycp ) is replaced

with a point PCL with coordinates (xCL , yCL ). The point PCL is located on line

between the two previous closest points. In addition, PCL is also the closest point

on that line to the point being compared. The concept of PCL points is shown in

Fig. 8.5 where lidar points are denoted in the form of PlidarRevolution,index .

The point (xCL , yCL ) is calculated using equation 8.2 where points
82

(x1 , y1 ), (x2 , y2 ) represent the two closest points from a prior lidar revolution with

respect to a new lidar point (x3 , y3 ). Note that in equation 8.2, a, b, c represent

parameters of the general line equation which is expressed as a · x + b · y + c = 0.

Lines were formulated in this manner as opposed to slope intercept form in order

to mitigate potential devisions by 0.

a = y2 − y1 , b = x1 − x2 , c = −by1 − ax1
b(bx3 − ay3 ) − ac
xCL = (8.2)
a2 + b 2
a(−bx3 + ax3 ) − bc
yCL =
a2 + b 2

With the calculation procedure of (xCL , yCL ) complete, the next step in ICL

algorithm is to formulate and minimize a cost function J. The ICL cost function

J shown in equation 8.3 where i represents the index of N lidar points.

N
X
J= (xi − xCL )2 + (yi − yCL )2 (8.3)
i=1

P0,6 P1,6
P1,3
PCL

PCL P1,2

PCL P1,1
Lidar Average Resulting
Vector

Figure 8.5: ICP iteration.


83

This cost function can be minimized iteratively through gradient descent. To use

gradient descent, the partial derivatives must be calculated as shown in equation

8.4.

N N
X ∂Jk,i X
δxk = = (xk,i − xCL )
i=1
∂x i=1
N N
(8.4)
X ∂Jk,i X
δyk = = (yk,i − yCL )
i=1
∂y i=1

Now that the necessary mathematical concepts have been overviewed, a basic

pseudocode example for ICL is shown in Fig. 8.6.

1 i n t N = 3 6 0 ; // 360 p o i n t s p e r r e v o l u t i o n
2 f l o a t α = 0 . 5 // L e a r n i n g Rate
3 i n t i t e r a t i o n C o u n t = 10 // Fixed number o f i t e r a t i o n s
4 f l o a t δx , δy , ∆x , ∆y , xCL , yCL =0; // i n t e r m e d i a t e v a r i a b l e s
5 f l o a t x [ ] = {x1 , . . . xn } ; // Array o f r e c e n t X l i d a r p o i n t s
6 f l o a t y [ ] = {y1 , . . yn } ; // Array o f r e c e n t Y l i d a r p o i n t s
7 f l o a t x P r e v i o u s [ ] = {x1 , . . . xn } ; // Array o f p r e v i o u s X l i d a r
points
8 f l o a t y P r e v i o u s [ ] = {y1 , . . yn } ; // Array o f p r e v i o u s Y l i d a r
points
9
10 v o i d ICL ( ) {
11
12 f o r ( j = 0 ; j <i t e r a t i o n C o u n t ; j ++)
13 {
14 f o r ( i = 0 ; i < N; i ++){ // accumulate d e l t a terms .
15 xCL = findCL ( x [ i ] , x P r e v i o u s ) ; // Find c l o s e s t p o i n t l i n e
16 yCL = findCL ( y [ i ] , y P r e v i o u s ) ;
17 δx = δx + ( x [ i ] − xCL ) ;
18 δy = δy + ( y [ i ] − yCL ) ;
19 }
20 f o r ( i = 0 ; i < N; i ++){ // S i m u l t a n e o u s update a l l p o i n t s
21 x [ i ] = x [ i ] − α ∗ δx/N;
22 y [ i ] = y [ i ] − α ∗ δy/N;
23 }
24 ∆x = ∆x + δx/N; // accumulate d i s p l a c e m e n t s
25 ∆y = ∆y + δy/N; // accumulate d i s p l a c e m e n t
26 δx = 0 ; δy = 0 ; // Reset d e l t a v a l u e s f o r next i t e r a t i o n
27 }
28 p r i n t f ( ∆x , ∆y ) // Output r e s u l t s
29
30 }

Figure 8.6: Pseudocode of the ICL algorithm


84

While this code example only covers a single lidar revolution, a more complete

example can be found at [45]. The performance of this algorithm in comparison

to vanilla ICP is shown in Fig. 8.7 acting upon the dataset shown in Fig. 8.3.

ICL Vs ICP Integration Results


"x ICL
600
s"x ICL
Displacement (mm)

"x ICP
s"x ICP
400 x Final
Measured

200

0 5 10 15 20 25 30 35
Lidar Revolutions

Figure 8.7: ICP and ICL integration results acting on dataset in Fig. 8.3.
.

ICL and ICP were performed on every consecutive set of lidar data. ∆x
R
represents the rate of drift while ∆x represents the total accumulated drift. As

seen in Fig. 8.7, ICL error is smaller over time which results in the correct

integration distance over time. In contrast, ICP has non negligible error resulting

in significant accumulated error over time. Consequently, this implementation of

ICL is a preferred candidate for parsing lidar data in real time.

8.5 Lidar Integration with Quadcopter Control System

This section will overview a simple proposed method of integrating lidar

information into the quadcopter’s control system such that positional drift is

reduced. As shown in Sections 8.3 and 8.4, ICP and ICL can act on lidar data to
85

obtain positional drift estimations ∆x, ∆y. An additional PID control loop can

θIMU, ϕIMU, ψIMU

0 θc
PID θr θIMU PID
Δ
T
ICL ϕc PID
Algorithm 0 ϕIMU T
PID ESC IMU
Δ ϕr
ψr T
ψIMU PID Qudacopter Plant
Lidar Data T
zr
zsonar PID
RC Remote
Flight Control Software
θr, ϕr, ψr, zr

Figure 8.8: Quadcopter control diagram with lidar and sonar inputs added.

then be added acting on the quadcopter’s φ, θ orientation angles to drive ∆x, ∆y

to zero respectively. This control scheme is shown in Fig. 8.8 and is an extension

of the original control system shown in Fig. 5.2.

8.6 Control System Testing, Simulation and Conclusion

The control system proposed in Fig. 8.8 was tested only in simulation. Flying a

quadcopter with the XV-11 lidar would be challenging due to its heavy weight in

addition to significant torque oscillations that would be coupled to the

quad-frame. Consequently, this control scheme was tested in Matlab using a

similar mathematical model [33]. In this model, an external disturbance was

added causing drift in both the x and y planes. The control system in Fig. 8.8

then acted upon φ, θ to counteract this drift.


86

Quadcopter Flight Simulation

14

12
Height

10

40
30 0
-5
-10
20 -15
-20
10 -25
-30
-35

(a)

Lidar Control System Results


0.6 6

3
0.4 ? 4
"X
"Y
degrees
mm/s

0.2 2

0
0

-0.2
0 100 200 300 400 500 600 700 800 900 -2
1000
Time (ms)

(b)

Figure 8.9: (a) Quadcopter simulation with external disturbance. (b) Plot of
positional drift elimination.
87

CHAPTER 9

Conclusion and Future Work

9.1 Flight Performance

This section overviews the performance of meeting the control objectives

described in equation 3.1. Using the control system proposed in Chapter 5 and

the hardware shown in Chapter 7, the quadcopter was able to achieve flight with

minimal steady state error. A segment of data taken during a flight hover test is

shown in Fig. 9.1.

Hover Test Roll Performance


4 ?Measured IMU

3 ?Remote Input
Error, Mean: -0.001
2
Degrees

-1

-2

6 6.5 7 7.5 8 8.5 9 9.5 10


Seconds

Figure 9.1: Roll performance in hover test of quadcopter

Note that in this flight test, a human was controlling the quadcopter attempting

to make the qudacopter hover in place. As a result of this, the user commanded

roll, φRemote is not 0. Consequently, the error φRemote − φM easured , can be used as

a performance metric. This data was collected through the RF link and sent to a
88

computer through the USB interface on the remote. For the entire duration of

this test, the error averaged to be 0.001o . However, the standard deviation of the

error is 0.4816 degrees. In other-words, roughly 70% of the time the error is

within 0.5o of the target. This noise error is in part due to the noise of the user

generated control signal and in part due to jitter/noise in the control system.

While pitch and roll have similar performance, yaw had the most control error

over time. This is in part due to the control system gains and it is also in part

due to the quadcopter design not having a control input that acts directly on

yaw. Recall from the physical model that yaw control is achieved by a differential

torque from clockwise and counter clockwise spinning motors. In contrast, pitch

and roll can be controlled directly by the forces exerted by the propellers on the

frame. The control system errors for pitch, roll, and yaw are shown in Fig. 9.2.

Hover Test Control Errors


3 Error, MSE: 0.365
?Error, MSE: 0.420
5 A Error, MSE: 1.682
Degrees

-5

6 6.5 7 7.5 8 8.5 9 9.5 10


Seconds

Figure 9.2: Pitch, roll, and yaw performance during hover test of quadcopter.

Using the dataset in Fig. 9.2, the mean squared error (MSE) was generated for

each control axis. The MSE tracks the controllability of each axis. For reference,

a flight video of the drone can be seen at [52].


89

9.2 Conclusions

The main purpose of this thesis was to develop both the hardware and software

for a quadcopter system. Chapter 3 developed a control update laws as well as

control objectives. Chapter 4 developed a 9 degrees of freedom fusion filter to

provide accurate estimations of orientation. Chapter 5 demonstrated a control

system to achieve stable auto leveling flight using a series of PID controllers.

Chapter 6 overviews the RF hardware involved in creating the transcieving link

between the remote and the quadcopter. Chapter 7 specifies the other hardware

involved in the system such as the flight controller and electronic speed

controllers. Chapter 8 demonstrates theory involved with autonomous flight and

using a lidar to maintain position while indoors. Finally, the conclusion

demonstrated flight results and performance of the overall system.

With regards to contributions, this thesis provides reference source files,

multi-rotor design insights, and a computationally efficient lidar parsing

algorithm. Specifically, this thesis provides open source software / hardware files

for a functional stabilized auto-leveling flight controller. It also provides open

source software / hardware files for a remote controller. It offers design insights

into achieving multi-rotor flight with a 9 degree of freedom orientation fusion

algorithm as well as a PID control system. Finally, this thesis presents a gradient

descent based ICL algorithm that can parse lidar data in real time with limited

computational resources.
90

9.3 Future Work

This section describes potential follow-up work to the current Marq Drone

Design. Currently, the IMU filter operates on Euler angles when ideally it should

be based upon quaternions to avoid singularities. In addition, quaternions also

allow for true linear spherical interpolation where as low pass filtering Euler

angles does not produce a linear response. With regards to the control system,

the first thing that would be improved is the PID control system performance.

The current balancing action is somewhat noisy and the yaw control is lacking.

In addition to PID control, other control techniques could be implemented such

as linear quadratic regulator (LQR) as well as model predictive control (MPC).

Another improvement would be to integrate the designed electronic speed

controllers into quadcopter system. A final improvement would be to mount the

lidar to the quadcopter and implement the ICL algorithm in real time.
91

References

[1] Halftermeyer, “Parrot AR.Drone 2.0 Image”, 2012, [Online]. Available:


https://commons.wikimedia.org/wiki/File:
Parrot_AR.Drone_2.0_take-off,_Nevada.jpg.
[2] DJI, “Phantom Image”, 2016, [Online]. Available:
https://commons.wikimedia.org/wiki/File:
DJI_Phantom_4_in_Flight_March_2016.jpg.
[3] HobbyKing, “DJI Inspire 1”, 2016, [Online]. Available:
http://www.dji.com/product/inspire-1.
[4] C Deets, “Turnigy Micro-X Quadcopter”, 2016, [Online]. Available: http:
//charliedeets.com/turnigy-micro-x-quadcopter-from-hobby-king/.
[5] Hobby King, “Turnigy TrackStar 21.5T Sensored Brushless Motor”, 2016,
[Online]. Available: http://www.hobbyking.com/hobbyking/store/__
71364__Turnigy_TrackStar_21_5T_Sensored_Brushless_Motor_1855KV_
ROAR_approved_AR_Warehouse_.html.
[6] Hobby King, “Turnigy D3530/14 1100KV Brushless Outrunner Motor”, 2016,
[Online]. Available: http://www.hobbyking.com/hobbyking/store/__
18225__turnigy_d3530_14_1100kv_brushless_outrunner_motor.html.
[7] A. Aras, “ESC 35A”, 2012, [Online]. Available: https:
//upload.wikimedia.org/wikipedia/commons/d/d1/ESC_35A.jpg.
[8] D. Warren, “Motion Sensing in the Iphone 4”, 2010, [Online]. Available:
http://www.memsjournal.com/2010/12/
motion-sensing-in-the-iphone-4-mems-accelerometer.html.
[9] Senodia, “What is MEMS?”, 2013, [Online]. Available:
http://senodia.com/technology.aspx?id=275.
[10] R. Dahai, W. Lingqi, Y. Meizhi, C. Mingyang, Y. Zheng, and H. Muzhi,
“Design and analyses of a mems based resonant magnetometer”, Sensors,
vol. 9, no. 9, pp. 6951, 2009.
[11] NOAA, “Maps of Magnetic Elements”, 2016, [Online]. Available:
http://www.ngdc.noaa.gov/geomag/WMM/image.shtml.
[12] N. Ya, “Resin Coated Copper Foils For Building Up PCB”, 2008, [Online].
Available: http://www.npc.com.tw/electronic_materials_div/
images-1/pdf/08---c4-01-2.htm.
[13] Johanson Technology, “2.45 GHz Impedance matched Balun-Filter for Texas
Instruments’ CC2500, CC2510, and CC2511 Chipsets”, 2012, [Online].
Available: http://www.johansontechnology.com/datasheets/baluns/
Balun_Filter_Matched_2450BM15B0003_v4.pdf.
[14] Texas Instruments, “Low-Cost Low-Power 2.4 GHz RF Transceiver”, 2016,
[Online]. Available: http://www.ti.com/lit/ds/symlink/cc2500.pdf.
92

[15] S. Winkvist, “Low computational SLAM for an autonomous indoor aerial


inspection vehicle”, Master’s thesis, University of Warwick, the
Netherlands, 2013.
[16] Clean Flight, “Clean Flight”, 2016, [Online]. Available:
http://cleanflight.com.
[17] Open Pilot, “Open Pilot”, 2016, [Online]. Available:
https://www.openpilot.org.
[18] R. Mahony, V. Kumar, and P. Corke, “Multirotor aerial vehicles: Modeling,
estimation, and control of quadrotor”, IEEE Robotics Automation
Magazine, vol. 19, no. 3, pp. 20–32, Sept 2012.
[19] M. Mueller and D. Raffaello, “A model predictive controller for quadrocopter
state interception”, in Control Conference (ECC), 2013 European. IEEE,
2013, pp. 1383–1389.
[20] S. Lupashin, A. Schoellig, M. Sherback, and R. D’Andrea, “A simple learning
strategy for high-speed quadrocopter multi-flips”, in Robotics and
Automation (ICRA), 2010 IEEE International Conference on, 2010, pp.
1642–1648.
[21] L. Argentim, W. Contrimas, P. Santos, and R. Aguiar, “Lqr and lqr-pid on a
quadcopter platform”, in IEEE Int.Conference on Electronics, Informatics
and Vision, 2013.
[22] G. Raffo, M. Ortega, and F. Rubio, “An integral predictive/nonlinear h infinity
control structure for a quadrotor helicopter”, in Automatica, 2013, pp. 1–7.
[23] Pixhawk, “PIXHAWK is the all-in-one unit, combining FMU and IO into a
single package”, 2016, [Online]. Available: https://pixhawk.org/.
[24] Tau Labs, “Sparky 2”, 2016, [Online]. Available:
https://github.com/TauLabs/TauLabs/wiki/Sparky2.
[25] Z. Zhang, “Iterative point matching for registration of free-form curves and
surfaces”, in Int. Journal of Computer Vision. 1994, pp. 19–25, IEEE.
[26] J. Zhang and S. Singh, “Loam: Lidar odometry and mapping in real-time”, in
Robotics: Science and Systems Conference, July 2014.
[27] A. Bry, A. Bachrach, and N. Roy, “State estimation for aggressive flight in
gps-denied environments using onboard sensing”, in IEEE International
Conference on Robotics and Automation, 2012, pp. 19–25.
[28] C. Hubert, Electric Machines, 2nd edition, 2002.
[29] NXP, “3-Phase BLDC Motor Control with Sensorless Back EMF Zero Crossing
Detection Using 56F80x”, 2016, [Online]. Available:
cache.freescale.com/files/product/doc/AN1914.pdf.
[30] NXP, “Sensorless PMSM Field-Oriented Control”, 2016, [Online]. Available:
http://www.nxp.com/doc/DRM148.
[31] DJI, “Inspire 1”, 2015, [Online]. Available:
93

http://www.dji.com/product/inspire-1.
[32] G Lazaridis, “Pulse Position Modulation and Differential PPM”, 2011,
[Online]. Available:
http://www.pcbheaven.com/wikipages/Pulse_Position_Modulation/.
[33] A. Gibiansky, “Quadcopter Dynamics and Simulation”, 2012, [Online].
Available:
http://andrew.gibiansky.com/blog/physics/quadcopter-dynamics.
[34] CyPhy, “CyPhy LVL 1”, 2015, [Online]. Available:
http://www.cyphyworks.com/robots/lvl1/.
[35] R. Hibbeler, Statics and Dynamics, 12th edition, 2010.
[36] ST Microchip, “Accelerometer and Gyroscopes Sensors: Operation, Sensing,
and Applications”, 2015, [Online]. Available:
https://www.maximintegrated.com/en/app-notes/index.mvp/id/5830.
[37] ST Microchip, “Tilt measurement using a low-g 3-axis accelerometer”, 2013,
[Online]. Available: http://www.st.com/web/en/resource/technical/
document/application_note/CD00268887.pdf.
[38] V. Bahatia, Classical Mechanics: With introduction to Nonlinear Oscillations
and Chaos, Narosa Pub House, 1st edition, 1997.
[39] A. Trusov, “Overview of MEMS Gyroscopes: History, Principles of Operations,
Types of Measurements”, 2011, [Online]. Available:
http://www.alexandertrusov.com/uploads/pdf/
2011-UCI-trusov-whitepaper-gyros.pdf.
[40] Freescale, “Layout Recommendations for PCBs Using a Magnetometer
Sensor”, 2013, [Online]. Available:
cache.freescale.com/files/sensors/doc/app_note/AN4247.pdf.
[41] Freescale Semiconductor, “Tilt Sensing Using a Three-Axis”, 2013, [Online].
Available:
http://www.freescale.com/files/sensors/doc/app_note/AN3461.pdf.
[42] S. Madgwick, “An efficient orientation filter for inertial and inertial/magnetic
sensor arrays”, Tech. Rep., University of Bristol, Department of Mechanical
Engineering, Apr. 2010.
[43] P. Jan, “Reading a IMU Without Kalman: The Complementary Filter”, 2013,
[Online]. Available: http://www.pieter-jan.com/node/11.
[44] N. Nise, Control Systems Engineering, 6th edition, 2011.
[45] N Zimmerman, “Open source hardware/software quadctoper system”, 2016,
[Online]. Available: https://github.com/NateZimmer/MarqDrone.
[46] Federal Communications Commission, “Rules and Regulation for Title 47”,
2016, [Online]. Available:
https://www.fcc.gov/general/rules-regulations-title-47.
[47] C. Balanis, Antenna Theory: Analysis and Design, 4th edition, 2015.
94

[48] Maxim Integrated, “Impedance Matching and the Smith Chart: The
Fundamentals”, 2002, [Online]. Available:
https://www.maximintegrated.com/en/app-notes/index.mvp/id/742.
[49] ArduPilot Team, “Extended Kalman Filter Navigation Overview and Tuning”,
2016, [Online]. Available: http://ardupilot.org/dev/docs/
extended-kalman-filter.html#extended-kalman-filter.
[50] Neato Robotics, “LaserSmart Mapping & Navigation”, 2016, [Online].
Available:
https://neatorobotics.com/lasersmart-mapping-navigation.
[51] A. Censi, “An icp variant using a point-to-line metric”, in 2008 IEEE
International Conference on Robotics and Automation, 2008, pp. 19–25.
[52] N Zimmerman, “Marq Drone Flight Video”, 2016, [Online]. Available:
https://www.youtube.com/watch?v=cArrBF8TGZQ.
[53] S. Madgwick, “Estimation of imu and marg orientation using a gradient
descent algorithm”, in IEEE International Conference on Rehabilitation
Robotics, 2011.
[54] B. Wadell, Transmission Line Design Handbook, 1st edition, 1991.
[55] K. Lauszus, “Flight Controller for Quad Rotor Helicopter in X-configuration”,
Master’s thesis, Technical University of Denmark, the Netherlands, 2015.
[56] M. Thompson, “Lorentz Force MEMS Magnetometer”, 2010, [Online].
Available: http://www-bsac.eecs.berkeley.edu/publications/search/
send_publication_pdf2client.php?pubID=1271176542.
[57] I. Ltkebohle, “BWorld Robot Control Software”, 2008, [Online]. Available:
http://aiweb.techfak.uni-bielefeld.de/content/
bworld-robot-control-software/.
[58] Freescale Semiconductor, “Tilt Sensing Using a Three-Axis”, 2013, [Online].
Available:
http://www.freescale.com/files/sensors/doc/app_note/AN3461.pdf.
95

APPENDIX A

Hardware schematics and PCBs

A.1 Hardware Schematics

The following are electrical schematics used in the creation of the

quadcopter hardware. This hardware was developed in an educational licensed

version of Altium at Marquette University. The PCB for these electronic

assemblies were manufactured through www.oshpark.com. The boards were then

populated and reflowed at the Marquette Embedded Systems Laboratory.


1 2 3 4 5 6 7 8

A A

A.2
Flight Controller Schematic
B
Marq Drone Flight Controller B

2. Power
3. Micro

C C

FC_1 FC_2
Flight_Controller2.SchDoc Flight_Controller3.SchDoc

96
D D

1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8

Power & Connectors & Sensors


A A

3.3V LDO
5V VBAT COD1
D1

A.3
VP1 3.3V
PID101
3 2

GND
PID103 PIV103 Vin Vout PIV102
PID102
PIC2502 COC25
C25 PIC1 02 COC11
C11
BAT54C-7-F 10uF V1
COV1
PIV10 MCP1702T-5002E/CB 10uF

1
PIC2501 0805 PIC1 01 0805

Flight Controller Schematic


16V 16V
GRM21BC81C106KE15L GRM21BC81C106KE15L

C1
COC1
Supplies VBAT 3.3V GND Clip PIC101 PIC102

P7
COP7
P8
COP8 CC2500 2.4 GHz Transciever PIF102 22pF

2
3 PIP703

2 PIP702 PIP801 GND


COU4
U4
PIL401 3
BP_N

DC
PIF103
1 PIP701 PIC2402 C24
COC24 3V3CC L4
COL4 P1
COP1
B 100nF 5016KCT-ND PIR302 COR3
R3 NLGDO0
GDO0 6
PIU406 GDO0(ATEST)
13 NLRF0N
RF_N
RN_N PIU4013NLRF0P
10nH Balun
UP
1 1PIP101
PIF101 B
M20-9960345
PIC2401 0603 MCR03EZPFX1002
NLGDO2
GDO2 3 12 RF_P LQW18AN10NJ00D

GND
GND
0603 PIU403 GDO2 RF_P PIU4012 PIP102 RP-SMA
CL10B104MB8NNNC
4 CONREVSMA002-G

PIR301 10KNLNCS1 PIF104 BP_P

2
NCS1 PIU407
7
CSn
CC2500 PIL402
1 F1
COF1
NLSCLK1
SCLK1 PIU401 SCLK
2.4 GHz
R16
COR16
PIF105 PIF106

5
6
2450BM15B0003E
NLMOSI1
MOSI1 20 17
PIU4020 SI RBIAS PIU4017 PIR1602 PIR1601
3.3V NLMISO1
MISO1 2 MCR01MRTF5602

RGB LED PIU402 SO(GDO1) 0603 3.3V


56K
PID20 L2
COL2
2

8 9 NL3V3CC
3V3CC
COD2
D2
PIU408 XOSC_Q1 AVDD PIU409 PIL202 PIL201
10 11 CIM10U800NC
R21
COR21 PIU4010 XOSC_Q2 AVDD PIU4011
NLR0LED
PIR2102R_LED 14
AVDD
CLV1A-FKB-CJ1M1F1BB7R4S3
PIR2101 PIU4014
CLV1A-FKB MCR03EZPJ271 Y1
COY1 15
0603 AVDD PIU4015
1 3 3V3CC 4
270 PIY101 PIY103 PIU404 DVDD
C26
COC26 PIC2602 PIC2702 C27
COC27 5
DCOUPL
G
B

R22
COR22 NLG0LED
G_LED 18pF 18pF
PIU405
18 21 PIC1202 C12
COC12 PIC1302 C13
COC13 PIC1402 C14
COC14 PIC1502 C15
COC15 PIC10 2 C10
COC10
PIR2201 PIR2202 PIU4018 DGUARD PAD PIU4021
PID203 PID204 PID201 MCR03EZPJ271 0603 PIPIY104
C2601 4 2 PIC2701
PIY102 0603 19
PIU4019 GND GND
16
PIU4016 100nF 100nF 100nF 100nF 100nF
0603
3
4
1

CL05C180JB5NNNC
50V
PIC1702
CL05C180JB5NNNC
50V C17
COC17 PIC1802 C18
COC18 PIC2 02 C22
COC22 PIC1201 0603 PIC1301 0603 PIC1401 0603 PIC1501 0603 PIC10 1 0603
270 100nF 100nF 100nF CC2500RGPR 50V 50V 50V 50V 50V
7M-26.000MEEQ-T CL10B104MB8NNNC CL10B104MB8NNNC CL10B104MB8NNNC CL10B104MB8NNNC CL10B104MB8NNNC
R23
COR23 NLB0LED
B_LED PIC1701 0603 PIC1801 0603 PIC2 01 0603
PIR2301 PIR2302
50V 50V 50V
MCR03EZPJ271
CL10B104MB8NNNC CL10B104MB8NNNC CL10B104MB8NNNC
0603
270

Motor Control NLNCS2


NCS2 Standoffs
C NLSCLK2
SCLK2 C
NLMOSI2
MOSI2 H1
COH1
IMU Sensor
SCL
SCL
PIU204 PIU203 PIU20 PIU201 PIU20 PIU2019 PIH101

R30-3001102
24
23
22
21
20
19
3

R6
COR6 PIR603 P9
COP9 PIR703 H3
COH3
2 2 R7
COR7 PIH301
CIM10U800NC
6 5 U2
COU2
SDA/SDI

nCS
SCL/SCLK

AUX_DA
RESV
PIR602 PIP906 PIP905 PIR702 CIM10U800NC
RESV
100K SDA SDA 100K R30-3001102
PIP904 4 3 PIP903 MPU-9250
NLPWM0CH1
PWM_CH1
PIR601 PIP902 2 1 PIP901 PIR701 NLPWM0CH0
PWM_CH0 H4
COH4
1

1 18 PIH401
PIU201 RESV GND PIU2018
68021-406HLF 2 17 R30-3001102
PIU202 NC NC PIU2017
PIC2102
3 16 C21
COC21 H5
COH5
PIU203 NC NC PIU2016
4 15 100nF PIH501
PIU204 NC NC PIU2015
5 14 3.3V PIC2101 0603 R30-3001102
Motor Control
AD0/SDO

NC NC
REGOUT

PIU205 PIU2014
AUX_CL

6 13 50V
VDDIO

FSYNC

PIU206 NC VDD PIU2013 CL10B104MB8NNNC

PIR2802
INT

R28
COR28
MCR03EZPFX1002
SCL
PIR28010603
NLSCL
SCL
PIU207 PIU208 PIU209 PIU201 PIU201 PIU201
3

10K
7
8
9
10
11
12

R8
COR8 PIR803 P10
COP10 PIR903
2 2PIR902 R9
COR9 3.3V NLMPU0INT
MPU_INT
CIM10U800NC
PIR802 PIP1001 1 2 PIP1002 CIM10U800NC
100K SDA NLSDA
SDA

NLPWM0CH2
PWM_CH2
PIR801 PIP1003
PIP1005
3
5
4
6
PIP1004
PIP1006
PIR901100K
NLPWM0CH3
PWM_CH3 PIC1902 C19
COC19 NLMISO2
MISO2
PIC2302 COC23
C23
PIR16 01
1

10nF R161
COR161
100nF MCR03EZPJ000
68021-406HLF PIC1901 0603 PIC2301 0603 0603
CL10B103KB8SFNC
50V
CL10B104MB8NNNC
PIR16 020

97
D D

1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8

Micro
A COL1 5V A
L1 R1
COR1
USB_Slave PIL102 PIL101
PIC202
PIR101 PIR102
NLUSB0PWR
USB_PWR 12 MHz Crystal
CIM10U800NC C2
COC2
Kinetis SWD
M C R 03EZPFX1003

0603 R2
COR2
100nF
USB Micro PIC201 100K PIR202 PIR201
0603 1M
50V 3.3V Y2
COY2 0603
COJ1
J1 CL10B104MB8NNNC
COP2
P2 NL12MHz0Xin
12MHz_Xin 1
PIY201 3
PIY203
MCR03ERTF1004
NL12MHz0Xout
12MHz_Xout
1 NLSWD0DIO0TGTMCU PIC302 C3
COC3 PIC402 C4
COC4

A.4
SWD_DIO_TGTMCU
VCC PIJ101 MCR03ERTF33R0 PIP201 1 2 PIP202
2 NLUSB0MCU10N
USB_MCU1_N 33R39
COR39 0603 NLUSB0MCU0N
USB_MCU_N NLK22F0SWD0CLK
K22F_SWD_CLK 18pF 18pF
D- PIJ102 PIR3902 PIR3901 PIP203 3 4 PIP204

D+
3
PIJ103
NLUSB0MCU10P
USB_MCU1_P 33R40
COR40
PIR4002 0603 NLUSB0MCU0P
PIR4001 USB_MCU_P PIP205 5 6 PIP206 PIC301 0603 4
PIY204 PIY202 2 PIC401 0603
4 CL05C180JB5NNNC CL05C180JB5NNNC

ID PIJ104 MCR03ERTF33R0
PIP207 7 8 PIP208 50V 50V

5 NLRST0TGTMCU
RST_TGTMCU CX3225GB12000P0HPQCC
GND PIJ105 PIP209 9 10 PIP2010

614105150721 GRPB052VWVN-RC

Flight Controller Schematic


PIJ10Z2 PIJ10Z1

3.3V 3.3V
NLSDA
SDA
PIR2602 PIR502 PIR402
R26
COR26
MCR03EZPFX1002
R5
COR5
M C R 03EZPFX1003
R4
COR4
MCR03EZPFX1002 Freescale KM22 M4 Cortex MCU GPIOS Freescale KM22 M4 Cortex MCU Power
0603
PIR2601 0603
10K PIR501100K PIR401 0603
10K U1A
COU1A
COU1B
COU1C
COU1D
COU1E 3.3V
U1E
NLSDAP 1
SDAP PIU101
PTE0/CLKOUT32K/ADC1_SE4a/SPI1_PCS1/UART1_TX/I2C1_SD A/RTC_CLKOUT 3
NLSCL
SCL 2 PIU103 VDD
PIU102 PTE1/LLWU_P0/ADC1_SE5a/SPI1_SOUT/UART1_RX/I2C1_SCL/ SPI1_SIN 30
5
USB_MCU_P PIU105 PIU1030 VDD
USB0_DP 48
6
USB_MCU_N PIU106 PIU1048 VDD
USB0_DM
B USB_PWR 7 B
PIU107 USBVDD 14
8 PIU1014VREFH
PIU108 NC 13
9 PIU1013VDDA
PIU109 ADC0_DP0/ADC1_DP3 21
10 PIU1021 VBAT
PIU1010 ADC0_DM0/ADC1_DM3
11 PIC602 PIC702 PIC802 PIC902 PIC502 C5
COC5
PIU1011 ADC1_DP0/ADC0_DP3 C6
COC6 C7
COC7 C8
COC8 C9
COC9
12 100nF
PIU1012 ADC1_DM0/ADC0_DM3 100nF 100nF 100nF 100nF
0603
MK22FN128VLH10
PIC601 0603 PIC701 0603 PIC801 0603 PIC901 0603 PIC501PIU104 4
VSS
50V 50V 50V 50V 50V
15
CL10B104MB8NNNC CL10B104MB8NNNC CL10B104MB8NNNC CL10B104MB8NNNC
PIU1015 VREFL
U1B 16
PIU1016 VSSA
17 31
VREF_OUT/CMP1_IN5/CMP0_IN5/ADC1_SE1
PIU1017 PIU1031 VSS
18
PIU1018 DAC0_OUT/CMP1_IN3/ADC0_SE2
47
PIU1047 VSS
19
PIU1019 XTAL32
20 MK22FN128VLH10
PIU1020 XTAL32
K22F_SWD_CLK 22
PIU1022 PTA0/JTAG_TCLK/SWD_CLK/EZP_CLK/UART0_CTS/FTM0_CH5
23
PIU1023 PTA1/JTAG_TDI/EZP_DI/UART0_RX/FTM0_CH6
24
PIU1024 PTA2/JTAG_TDO/TRACE_SWO/EZP_DO/UART0_TX/FTM0_CH7
SWD_DIO_TGTMCU 25
PIU1025 PTA3/JTAG_TMS/SWD_DIO/UART0_RTS/FTM0_CH0
26
PIU1026 PTA4/LLWU_P3/NMI/EZP_CS/FTM0_CH1
NLB0LED
B_LED 27
PIU1027 PTA5/USB_CLKIN/FTM0_CH2/I2S0_TX_BCLK/JTAG_TRST
NLR0LED
R_LED 28
PIU1028 PTA12/FTM1_CH0/I2S0_TXD0/FTM1_QD_PHA
NLG0LED
G_LED 29
PIU1029 PTA13/LLWU_P4/FTM1_CH1/I2S0_TX_FS/FTM1_QD_PHB
32
12MHz_Xin PIU1032
PTA18/EXTAL0/FTM0_FLT2/FTM_CLKIN0
MK22FN128VLH10
U1C
33
12MHz_Xout PIU1033
PTA19/XTAL0/FTM1_FLT0/FTM_CLKIN1/LPTMR0_ALT
34
RST_TGTMCU PIU1034
C RESET C
35
PIU1035 PTB0/LLWU_P5/ADC0_SE8/ADC1_SE8/I2C0_SCL/FTM1_CH0/FT M1_QD_PHA
36
P3
COP3 PIU1036 PTB1/ADC0_SE9/ADC1_SE9/I2C0_SDA/FTM1_CH1/FTM1_QD_PH B
NLA2
A2 37
A2 RX1 PIU1037 PTB2/ADC0_SE12/I2C0_SCL/UART0_RTS/FTM0_FLT3
PIP301 1 2 PIP302 NLA1
A1 38
A1 PIU1038 PTB3/ADC0_SE13/I2C0_SDA/UART0_CTS/FTM0_FLT
PIP303 3 4 PIP304 NLRX1
RX1 39
TX1 PIU1039 PTB16/SPI1_SOUT/UART0_RX/FTM_CLKIN0/FB_AD17/EWM_I
PIP305 5 6 PIP306 NLTX1
TX1 40
3.3V PIU1040 PTB17/SPI1_SIN/UART0_TX/FTM_CLKIN1/FB_AD16/EWM_OU
41
68021-406HLF PIU1041 PTB18/FTM2_CH0/I2S0_TX_BCLK/FB_AD15/FTM2_QD_PHA
42
PIU1042 PTB19/FTM2_CH1/I2S0_TX_FS/FB_OE/FTM2_QD_PH
43
PIU1043 PTC0/ADC0_SE14/SPI0_PCS4/PDB0_EXTRG/USB_SOF_OUT/FB_ AD14
NLPWM0CH0
PWM_CH0 44
PIU1044 PTC1/LLWU_P6/ADC0_SE15/SPI0_PCS3/UART1_RTS/FTM0_CH0 /FB_AD13/I2S0_TXD0/LPUART0_RTS
NLPWM0CH1
PWM_CH1 45
PIU1045 PTC2/ADC0_SE4b/CMP1_IN0/SPI0_PCS2/UART1_CTS/FTM0_CH 1/FB_AD12/I2S0_TX_FS/LPUART0_CTS
NLPWM0CH2
PWM_CH2 46
PIU1046 PTC3/LLWU_P7/CMP1_IN1/SPI0_PCS1/UART1_RX/FTM0_CH2/C LKOUT/I2S0_TX_BCLK/LPUART0_RX
MK22FN128VLH10
U1D
NLPWM0CH3
PWM_CH3 49
PIU1049 PTC4/LLWU_P8/SPI0_PCS0/UART1_TX/FTM0_CH3/FB_AD11/CM P1_OUT/LPUART0_TX
NLSCLK2
SCLK2 50
PIU1050 PTC5/LLWU_P9/SPI0_SCK/LPTMR0_ALT2/I2S0_RXD0/FB_AD10 /CMP0_OUT/FTM0_CH2
NLMOSI2
MOSI2 51
PIU1051 PTC6/LLWU_P10/CMP0_IN0/SPI0_SOUT/PDB0_EXTRG/I2S0_RX _BCLK/FB_AD9/I2S0_MCLK
NLMISO2
MISO2 52
PIU1052 PTC7/CMP0_IN1/SPI0_SIN/USB_SOF_OUT/I2S0_RX_FS/FB_AD 8
NLMPU0INT
MPU_INT 53
PIU1053 PTC8/ADC1_SE4b/CMP0_IN2/FTM3_CH4/I2S0_MCLK/FB_AD
NLNCS2
NCS2 54
PIU1054 PTC9/ADC1_SE5b/CMP0_IN3/FTM3_CH5/I2S0_RX_BCLK/FB_AD 6/FTM2_FLT0
55
PIU1055 PTC10/ADC1_SE6b/I2C1_SCL/FTM3_CH6/I2S0_RX_FS/FB_AD
56
PIU1056 PTC11/LLWU_P11/ADC1_SE7b/I2C1_SDA/FTM3_CH7/FB_R
57
PIU1057 PTD0/LLWU_P12/SPI0_PCS0/UART2_RTS/FTM3_CH0/FB_ALE/F B_CS1/FB_TS/LPUART0_RTS
58
PIU1058 PTD1/ADC0_SE5b/SPI0_SCK/UART2_CTS/FTM3_CH1/FB_CS0/L PUART0_CTS
NLNCS1
NCS1 59
PIU1059 PTD2/LLWU_P13/SPI0_SOUT/UART2_RX/FTM3_CH2/FB_AD4/LP UART0_RX/I2C0_SCL
NLGDO0
GDO0 60

98
PIU1060 PTD3/SPI0_SIN/UART2_TX/FTM3_CH3/FB_AD3/LPUART0_TX/I 2C0_SDA
NLGDO2
GDO2 61
PIU1061 PTD4/LLWU_P14
D NLSCLK1
SCLK1 62 D
PIU1062 PTD5/SPI0_PCS2/UART0_CTS/FTM0_CH5/FB_AD1/EWM_OUT/SP I1_SCK
NLMOSI1
MOSI1 63
PIU1063 PTD6/LLWU_P15/ADC0_SE7b/SPI0_PCS3/UART0_RX/FTM0_CH6 /FB_AD0/FTM0_FLT0/SPI1_SOU
NLMISO1
MISO1 64
PIU1064 PTD7/UART0_TX/FTM0_CH7/FTM0_FLT1/SPI1_SIN

MK22FN128VLH10

1 2 3 4 5 6 7 8
99
A.5 Flight Controller Schematic
1 2 3 4 5 6 7 8

Sensorless Brushless Motor Controller 12 MHz Crystal


COY1
Y1
A A
Sudo Neutral PIC402
1
NLEXTAL0 PIY101
EXTAL+
C4
COC4
3
PIY103
PIC502
NLEXTAL0
EXTAL-
C5
COC5
R46
COR46 100K
PIR4601
NLA0BLMA
PIR4602 A_BLMA 18pF 18pF
PIC401 0603 4
PIY104 PIY1022 PIC501 0603
R47
COR47 100K
PIR4701 PIR4702 B_BLMA
CL05C180JB5NNNC
50V
CL05C180JB5NNNC
50V

Power System NLNeutral


Neutral
R48
COR48 100K
CX3225GB12000P0HPQCC

A.6
PIR4801 PIR4802
C_BLMA

5V Linear 5V USB Micro


USB_Slave
VP1
3 2 COJ5
J5 5V
3.3V
Kinetis SWD

GND
PIV103 Vin Vout PIV102

PIC902 PIC602 VCC


1
PIJ501
P2
COP2
Bulk Capacitence External COM
PIQ2804 D-
2 NLUSB0MCU0N
USB_MCU_N
1 2
NLSWD0DIO0TGTMCU
SWD_DIO_TGTMCU VP1

ESC Schematic
PIJ502 PIP201 PIP202
4

V1
COV1 C9
COC9 C6
COC6 3 P1
COP1

5
GND_EXTPIQ2805 1, 2, 3
PIQ2803
PIQ2802
PIQ2801
1
PIV10 MCP1702T-5002E/CB

PIC901 Cap PIC601


1uF
100nF
D+
ID
GND
PIJ503
4
PIJ504
5
PIJ505
NLUSB0MCU0P
USB_MCU_P

NLGND0EXT
GND_EXT
PIP203
PIP205
PIP207
3
5
7
4
6
8
PIP204
PIP206
PIP208
NLKL250SWD0CLK
KL25_SWD_CLK

NLRST0TGTMCU
RST_TGTMCU
PIC102
PIC101
C1
COC1
Cap
PIC202
PIC201
C2
COC2
Cap
PIC302
PIC301
C3
COC3
Cap
PIC702
PIC701
C7
COC7
Cap
PIC1 02
PIC1 01
C11
COC11
Cap
PIC1202
PIC1201
C12
COC12
Cap
3
2
PIP103
PIP102
NLSCL
SCL
NLSDA
SDA
PIP209 9 10 PIP2010
100nF 100nF 100nF 100nF 100nF 100nF 1 PIP101
Q28
COQ28 614105150721
PSMN011-60MLX PIJ50Z2 PIJ50Z1 Header 5X2 Header 3

1 Phase A VP1
1 Phase B VP1
1 Phase C VP1
EXT LED
NLLED
LED
D1 D3 D4
VP1 COD1
PIQ105 VP1 COD3
PIQ205 VP1 COD4
PIQ305 PID601
5

5
1N4148WFL-G3-08
NLA0Pump
A_Pump 1N4148WFL-G3-08
NLB0Pump
B_Pump 1N4148WFL-G3-08

B PID101 PID102
SOD-123 4 Q1
COQ1 PID301 PID302
SOD-123 4 Q2
COQ2 PID401 PID402
SOD-123 4 Q3
COQ3 D6
COD6 B
PIQ104 PIQ204 PIQ304
PIC1402 PSMN011-60MLX PIC1502 PSMN011-60MLX PIC3202 PSMN011-60MLX LED3
C14
COC14 U3
COU3
NLGate0A0H
Gate_A_H
PIC3 02 PIQ1032 C15
COC15 U4
COU4
NLGate0B0H
Gate_B_H
PIC3402 PIQ2031 C32
COC32 U5
COU5
NLGate0C0H
Gate_C_H
PIC3502 PIQ3021 PID602
1, 2, 3

1, 2, 3

1, 2, 3
100nF PIC1401 4 1 C33
COC33 100nF PIC1501 4 1 C34
COC34 100nF PIC3201 4 1 C35
COC35 PIR4 01
PIU304 Vcc BST PIU301 PIU404 Vcc BST PIU401 PIU504 Vcc BST PIU501
8 100nF PIC3 01 NLOUT1
OUT1 8 100nF PIC3401 NLOUT2
OUT2 8 100nF PIC3501 NLOUT3
OUT3 R44
COR44
DRVH PIU308 DRVH PIU408 DRVH PIU508

SWN
7
PIU307
PIQ405 SWN
7
PIU407
PIQ605 SWN
7
PIU507
PIQ705 33
5

5
A_BLMH 3
PIU303 OD DRVL
5
PIU305 B_BLMH 3
PIU403 OD DRVL
5
PIU405 C_BLMH 3
PIU503 OD DRVL
5
PIU505 PIR4 02
A_BLML 2 6 NLGate0A0L
Gate_A_L 4 Q4
COQ4 B_BLML 2 6 NLGate0B0L
Gate_B_L 4 Q6
COQ6 C_BLML 2 6 NLGate0C0L
Gate_C_L 4 Q7
COQ7
PIU302 IN PGND PIU306 PIQ404
PSMN011-60MLX
PIU402 IN PGND PIU406 PIQ604
PSMN011-60MLX
PIU502 IN PGND PIU506 PIQ704
PSMN011-60MLX
ADP3110A
PIQ40321 ADP3110A
PIQ60321 ADP3110A
PIQ70321
1, 2, 3

1, 2, 3

1, 2, 3
A_BLMA R28
COR28 B_BLMA R37
COR37 C_BLMA R39
COR39
PIR2802 PIR2801 PIR3702 PIR3701 PIR3902 PIR3901
PIC10 2 PIR3 01 20k PIC3802 PIR40 1 20k PIC3902 PIR4101 20k
C10
COC10 R33
COR33 C38
COC38 R40
COR40 C39
COC39 R41
COR41
100pF PIC10 1 10K 100pF PIC3801 10K 100pF PIC3901 10K
PIR3 02 PIR40 2 PIR4102

Kinetis Bank A U2A


COU2A
COU2B
COU2C
COU2D Kinetis Bank B Kinetis Bank C Kinetis Bank D
3.3V NLCMP0OUT
CMP_OUT 1 U2B 3.3V U2C U2D
PIU201 PTE0/CMP_OUT
2 Neutral 17 EXTAL- 33 49
PIC1602 PIU202 PTE1 PTE29/CMP5
PIU2017
PIR4302 PIU2033 PTA19 PIU2049 PTC4/LLWU_P8
C16
COC16 3 A_BLMA 18 RST_TGTMCU 34 50
PIU203 VDD PIU2018 PTE30/CMP4
R43
COR43 PIU2034 PTA20 PIU2050 PTC5/CMP_OUT
100nF 4 19 35 NLC0BLMA
C_BLMA 51
PIU204 VSS PIU2019 PTE31
10k
PIU2035 PTB0/LLWU_P5 PIU2051 PTC6/CMP0
C PIC1601 5
USB_MCU_PPIU205
USB0_DP
SCL 20
PIU2020 PTE24 / I2C0_SCL
36
PIU2036 PTB1
NLB0BLMA
B_BLMA 52
PIU2052 PTC7/CMP1 C
6
USB_MCU_NPIU206
USB0_DM
SDA 21
PIU2021 PTE25 / I2C0_SDA
PIR4301 37
PIU2037 PTB2
TMP4 NLB0BLML
B_BLML 53
PIU2053 PTC8/TMP0_4
3.3V 7
PIU207 VOUT33
22
KL25_SWD_CLK PIU2022
PTA0
PIC2102 38
PIU2038 PTB3
TMP5 NLB0BLMH
B_BLMH 54
PIU2054 PTC9/TMP0_5
5V 8 23 C21
COC21 39 55
PIU208 VREGIN PIU2023 PTA1 PIU2039 PTB16 PIU2055 PTC10
PIC1901 PIC20 1 9
PIU209 PTE20
24
PIU2024 PTA2
PIC2101 100nF 40
PIU2040 PTB17
56
PIU2056 PTC11
C19
COC19 C20
COC20 10 SWD_DIO_TGTMCU 25 41 TMP0 NLC0BLMH
C_BLMH 57
10uF 100nF
PIU2010 PTE21 PIU2025 PTA3 PIU2041 PTB18 PIU2057 PTD0
PIC1902 PIC20 2 11
PIU2011 PTE22
26
PIU2026 PTA4
42
PIU2042 PTB19 TMP1 NLC0BLML
C_BLML 58
PIU2058 PTD1
3.3V 12 27 ADC_SEL14 43 TMP2 NLA0BLML
A_BLML 59
PIU2012 PTE23 PIU2027 PTA5 PIU2043 PTC0 PIU2059 PTD2
13 3.3V 28 ADC_SEL15 44 TMP3 NLA0BLMH
A_BLMH 60
L2
COL2 PIU2013 VDDA PIU2028 PTA12 PIU2044 PTC1/LLWU_P6/RTC_CLKIN PIU2060 PTD3
14 29 ADC_SEL11 45 61
PIL202 PIL201 PIU2014 VREFH PIU2029 PTA13 PIU2045 PTC2 PIU2061 PTD4/LLWU_P14
FB PIC2 02 15
PIU2015 VREFL
PIC2402 30
PIU2030 VDD
NL3H0Extern
3H_Extern PIU2046 46
PTC3/LLWU_P7
62
PIU2062 PTD5
L3
COL3 C22
COC22 16 C24
COC24 31 47 ADC_SEL07 63
1uF
PIU2016 VSSA 100nF
PIU2031 VSS PIU2047 VSS PIU2063 PTD6/LLWU_P15
PIC2 01 PIC2401 EXTAL+ 32
PTA18
3.3V PIC2602 48 LED 64
PIL302
FB
PIL301
MKL25Z64VLH4
PIU2032
COC26 PIU2048 VDD
C26
PIU2064 PTD7
MKL25Z64VLH4 PIC2601 100nF MKL25Z64VLH4 MKL25Z64VLH4

100
D D

Title
Sensorless Brushless Motor Controller
Size Number Revision
A3 Rev 1
Date: 9/7/2015 Sheet of
File: C:\Users\..\ESC3.SchDoc Drawn By: Nathan Zimmerman
1 2 3 4 5 6 7 8
101
A.7 ESC Schematic
102
A.8 ESC Schematic
1 2 3 4 5 6 7 8

Reset Button

Lithium Charger
Lipo Protection & Power System 5V
NLBUTTON06
BUTTON_6 PISW603 3
SW6
COSW6
4
PISW604

A
5V
COU1
U1
5V PID102 PID10 3.3V LDO Reg
1
PISW601 2
PISW602
A
PIU104
4
VDD VBAT PIU103
3
PIQ301 PIQ401 Vreg 1825910-7

PIC201
PROG PIU105 5
PIR101
R1
COR1 PIC301
Backup Q1
COQ1
S
Q2
COQ2
SIQ302
Q3
G

COQ3
PMUX PID103 D1
COD1
Bat45C
3
MCP1702 3.3V Reg

2
3.3V

GND
C2
COC2 10K C3
COC3 PIQ103 PIQ102 PIQ202
PIR202 PIQ203
PIQ302
P PIQ303
PIQ403
P IQ403 PIQ402 PIV103 Vin Vout PIV102
Reverse

PIC202 1uF 1 2 PIR102 PIC302 1uF R2


COR2 PIC401 COC4
C4 PIC601 PIC701 PIC501 COC5
C5

A.9
PIU101 CE VSS PIU102 UVLO COQ4
Q4
PIU302 PIC801
PIQ10 2MEG
PIQ201
G 10uF
PIC402399-3699-6-ND PIC602
C6 COV1
COC6 V1
PIV10 C7
COC7 10uF
1uF PIC50399-3699-6-ND
3.3V

1
MCP73812 C8
COC8 PIR201 1uF PIC702 2
U3
COU3
CR2
PIC802 100nF PIR502
R5
COR5
1MEG COS1
PIU301 BH-CR2-PC
PIR501
S1
PI 301 PI 304 PI 401 PI 40

RF Controller Schematic
PIS101 PIS102

4
SW-SPST
P3
COP3 P4
COP4

VCC

VCC

VCC

VCC
1-1735446-2 1-1735446-2
POT_0 POT_2
2 5 POT_1 2 5 POT_3
PIP302 OUT_1 OUT_2 PIP305 PIP402 OUT_1 OUT_2 PIP405

Reset Button Reset Button Reset Button Reset Button Reset Button

GND

GND

GND

GND
SW5
COSW5 SW3
COSW3 SW4
COSW4 SW1
COSW1 SW2
COSW2
NLBUTTON05
BUTTON_5 PISW503
3 4
PISW504
NLBUTTON03
BUTTON_3 3
PISW303
4
PISW304
NLBUTTON04
BUTTON_4 PISW403
3 4
PISW404
NLBUTTON01
BUTTON_1 PISW103
3 PISW104
4 NLBUTTON02
BUTTON_2 PISW203
3 4
PISW204
PI 30 PI 306 PI 403 PI 406

6
PISW501 1 2
PISW502 1
PISW301 2
PISW302 PISW4011 2
PISW402 PISW1011 PISW102 2 PISW2011 2
PISW202

1825910-7 1825910-7 1825910-7 1825910-7 1825910-7


B Joystick Input B

D3
COD3 D4
COD4
POWER_LED PID301
NLPOWER0LED 1 2
PID302 R6
PIR601
COR6 33
PIR602 STATUS_LEDPID401
NLSTATUS0LED 1 2
PID402 R8
COR8
PIR801 33
PIR802 C1
COC1
PIC101 PIC102
LG R971-KN-1

D5
COD5
GND
LG R971-KN-1

D7
COD7 GND CC2500 2.4 GHz Transciever PIF102 22pF

2
EXTRA_LED
NLEXTRA0LED 1
PID501 2
PID502 R9
COR9
PIR901 33
PIR902
TX_LED
NLTX0LED 1
PID701 2
PID702 R10
COR10
PIR1001 33
PIR1002 3.3VC
U4
COU4 PIL401 3
PIF103 BP_N

DC
LG R971-KN-1
L4
COL4 P1
COP1
PIR302 R14
COR14
LEDS GND 6 13 NLRF0N 10nH 1 1PIP101
LG R971-KN-1
NLGDO0
GDO0 PIU406 GDO0(ATEST)
RF_N Balun NLSMA0IN
SMA_IN
R3
COR3 RN_N PIU4013NLRF0P UP PIF101 PIR1402 PIR1401
GND NLGDO2
GDO2 3 12 RF_P PIC10 2 10K

GND
GND
10K
PIU403 GDO2 RF_P PIU4012 C10
COC10
4
PIF104 BP_P
PIC1602 SMB PIP102

2
PIR301 NLCSN
CSN 7
PIU407 CSn
CC2500 PIL402 PIC10 1 1pF C16
COC16
PIC1601 1pF
USB_Slave L1
COL1 5V NLSCLK
SCLK 1
PIU401 SCLK
2.4 GHz
R16
COR16
PIF105 PIF106 F1
COF1

5
6
NLMOSI
MOSI 20
PIU4020 SI
17 BALUN_2_4_GHZ
PIL102 PIL101 RBIAS PIU4017 PIR1601 PIR1602
FB PIC901 PIC1 01 NLMISO
MISO 2
PIU402 SO(GDO1) 56K
C9
COC9 C11
COC11
USB Mini B
ED2992CT-ND
PIC902 100nF PIC1 02 10uF 3.3V
USB_1
COUSB01 8 9
PIU408 XOSC_Q1 AVDD PIU409
1 10 11
VBUS PIUSB0101 PIU4010 XOSC_Q2 AVDD PIU4011
2 NLU0N
U_N R17
COR17 33 USB_MCU_N 14
DM PIUSB0102 PIR1701 PIR1702 AVDD PIU4014
Shield
Shield
Shield
Shield

3 NLU0P
U_P R4
COR4 33 USB_MCU_P Y1
COY1 3.3V 15
DP PIUSB0103 PIR401 PIR402 AVDD PIU4015

GND
5
PIUSB0105 3.3VC
Kinetis SWD PIPIY101
C2COC26
6C26
02
1 3
PIY103
PIC2COC27
702
C27
4
PIU404
5
DVDD

PIUSB016 PIUSB017 PIUSB018 PIUSB019 PID20 PID201 P2


COP2
PIU405
18
PIU4018
DCOUPL
DGUARD PAD
21
PIU4021
PIC1201 PIC1301 PIC1401 PIC1501
6
7
8
9

D2
COD2 PIP201 1 2 PIP202
NLSWD0DIO0TGTMCU
SWD_DIO_TGTMCU PIC2618pF
01 4
PIY104
2
PIY102
PIC218pF
701 19
PIU4019 GND GND
16
PIU4016
C12
COC12 C13
COC13 C14
COC14 C15
COC15
Bat54A NLKL250SWD0CLK
KL25_SWD_CLK PIC1701 PIC1801 PIC2 01 PIC1202 100nF PIC1302 100nF PIC1402 100nF PIC1502 100nF
C PIP203 3 4 PIP204 C
C17
COC17 C18
COC18 C22
COC22 CC2500_2_4_ghz
PID203 PIP205
PIP207
PIP209
5
7
9
6
8
10
PIP206
PIP208
PIP2010
NLRST0TGTMCU
RST_TGTMCU
26MHz
PIC1702 100nF PIC1802 100nF PIC2 02 100nF

Header 5X2

3.3V
PIL302
L3
COL3
PIL301
Kinetis Bank A U2A
COU2A
COU2B
COU2C
COU2D Kinetis Bank B EXTAL+ R42
COR42
PIR4201
1M
PIR4202
NLEXTAL0
EXTAL- Kinetis Bank C Kinetis Bank D
PIC3 01 10nH PIC3401 3.3VC NLCMP0OUT
CMP_OUT PIU201
1
PTE0/CMP_OUT
U2B Y2
COY2 U2C U2D
C33
COC33 C34
COC34 2 17 1 3 33 49
PIU202 PTE1 PIU2017 PTE29/CMP5 PTA19 PTC4/LLWU_P8
PIC3 02 100nF PIC3402 10uF COC28
C28 PIC2802 3 PIU203 VDD
18
PIU2018 PTE30/CMP4
PPIY201
IC2COC29
902
C29
PIY203
C30 PIC30 2
COC30
PIU2033
34
PIU2034 PTA20
50
PIU2049
BUTTON_1 PIU2050
PTC5/CMP_OUT
100nF 4 19 35 51
BUTTON_2 PIU2051
PIU204 VSS PIU2019 PTE31 PIU2035 PTB0/LLWU_P5 PTC6/CMP0
PIC2801 NLUSB0MCU0P 5
USB_MCU_PPIU205
USB0_DP
20
PIU2020 PTE24
PIC218pF
901 4
PIY204
218pFPIC30 1
PIY202
POWER_LED 36
PIU2036 PTB1
52
BUTTON_3 PIU2052
PTC7/CMP1
3.3VC NLUSB0MCU0N 6
USB_MCU_NPIU206 21 3.3VC STATUS_LED 37 53
BUTTON_4 PIU2053
USB0_DM PIU2021 PTE25 PIU2037 PTB2 PTC8/TMP0_4
3.3VB 7 22
KL25_SWD_CLK PIU2022 12MHz EXTRA_LED 38 54
BUTTON_5 PIU2054
L6
COL6 PIU207 VOUT33 PTA0 PIU2038 PTB3 PTC9/TMP0_5
PIL602 PIL601
5V 8
PIU208 VREGIN
23
PIU2023 PTA1
PIR4302 TX_LED 39
PIU2039 PTB16
55
BUTTON_6 PIU2055
PTC10
10nH PIC1901 PIC20 1 POT_0
ADC_SE0 NLPOT00 9
PIU209 PTE20
24
PIU2024 PTA2
R43
COR43 40
PIU2040 PTB17
56
PIU2056 PTC11
C19
COC19 C20
COC20 POT_1
ADC_SE4 NLPOT01 10 SWD_DIO_TGTMCU 25 10k 41 HAD TO CHANGE CSN 57
10uF 100nF ADC_SE3 NLPOT02
PIU2010 PTE21 PIU2025 PTA3 PIU2041 PTB18 PIU2057 PTD0
PIC1902 PIC20 2 POT_2 11
PIU2011 PTE22
26
PIU2026 PTA4
PIR4301 RST_TGTMCU 42
PIU2042 PTB19 SPI0_SCK SCLK 58
PIU2058 PTD1
3.3VC POT_3
ADC_SE7 NLPOT03 12
PIU2012 PTE23
27
PIU2027 PTA5
PIC2102 ADC_SEL14 43
PIU2043 PTC0
SPI0_MOSI MOSI 59
PIU2059 PTD2
13 3.3VC 28 C21
COC21 ADC_SEL15 44 SPI0_MISO MISO 60
L2
COL2 PIU2013 VDDA PIU2028 PTA12 PIC2101 100nF PIU2044 PTC1/LLWU_P6/RTC_CLKIN PIU2060 PTD3
14 29 ADC_SEL11 45 GDO0 61
PIL202 PIL201 PIU2014 VREFH PIU2029 PTA13 PIU2045 PTC2 PIU2061 PTD4/LLWU_P14
PIC2502 FB PIC3102 PIC2302 15
PIU2015 VREFL
PIC2402 30
PIU2030 VDD
46
PIU2046 PTC3/LLWU_P7
GDO2 62
PIU2062 PTD5

103
C25
COC25 L5
COL5 C31
COC31 C23
COC23 16 C24
COC24 31 PIC3202 47 ADC_SEL07 63
1uF 1nF
PIU2016 VSSA 100nF
PIU2031 VSS C32
PIU2047 VSS PIU2063 PTD6/LLWU_P15
1uF PIC2501 PIC3101 PIC2301 PIC2401 NLEXTAL0
EXTAL+ 32 3.3VC COC32 48 64
PIL502 PIL501 PIU2032 PTA18 100nF
PIU2048 VDD PIU2064 PTD7
D FB MKL25Z64VLH4 PIC3201 D
MKL25Z64VLH4 MKL25Z64VLH4 MKL25Z64VLH4

P6
COP6 P5
COP5 Title
PIP601 1 PIP501 1
PIP602 2 PIP502 2
Size Number Revision
PIP603 3 PIP503 3
1
PIP604 4 PIP504 4 A3
Header 4 Header 4 Date: 10/4/2015 Sheet of
File: C:\Users\..\RF_Controller.SchDoc Drawn By: Kellen Carey
1 2 3 4 5 6 7 8
104
A.10 RF Controller Schematic
PAP500 COP5
COP1
PAP101 COP6 PAP601

A.11
PAP102
COC16 PAC1602 PAC1601
PAR1401
COR14

RF Controller Schematic
PAR1402 COR42

COC10 PAC1002 PAC1001 COC30


PAR4202 PAR4201
COC29
COC1 COF1
COU3 COC12 COC13 PAF101 PAF106
PAF102 PAF105 PAC3001 PAY202 PAY201 PAC2902
COC24
PAC101 COC14 COC15
PAC1202 PAC1302 PAC102
PAF103 PAF104
PAC3002 PAY203 PAY204 PAC2901 PAC2401 PAC2402
COR5 COR2 COC27 COC33
PAC1201 PAC1301 PAC1402 PAC1502 COC34 COY2
PAL401 PAL402

COQ2
PAR501 PAR502 PAR201 PAR202
COQ1 PAR1602
COL4
PAU4015 PAU4014 PAU4013 PAU4012 PAU401
PAC1401 PAC1501 PAC2702 PAC2701 PAC2802
PAC2502
PAC2402
PAC2902
PAC3002
PAC302
PAC202
PAC102
PAC902
PAC802
PAC702
PAC602
PAC1502
PAC1402
PAC1302
PAC1202
PAC1802
PAC1702
PAC2002
PAC2202
PAC3302
PAC3202
PAC1002
PAC3102
PAC2302
PAC2602
PAC2702
PAC2102
PAC1602 COL3 PAC3402 PAR4302 PAU203 PAU2031 PAU203 PAU209 PAU208 PAU207 PAU206 PAU205 PAU204 PAU203 PAU20 PAU201 PAU20 PAU2019 PAU2018 PAU2017 COC23 COC31 COL2 COL5

PAC2301 PAC3101 PAL201 PAL501


PAQ202 PAQ201 PAQ102 PAQ101 PAC802
COR16
PAY103 PAY102 COY1 PAC3301
PAC2201
PAC1701
PAC1501
PAC1401
PAC1301
PAC1201
PAC701
PAC2001
PAC3201
PAC901
PAC201
PAC1001
PAC1601
PAC2101
PAC3001
PAC2901
PAC2801
PAC2701
PAC2601
PAC2501
PAC2401
PAC101
PAC301
PAC801
PAC1801
PAC3101
PAC2301
PAC601 PAL302 PAL301 PAC3401 PAR4301
COC3 PAR1601 PAU4016 PAU4010 PAU2033 PAU2016

COC2
PAC301 PAC302 PAQ203 PAQ103 PAC801 PAU302 PAC2201
PAU4017

PAU4018
PAU4019
PAU4020
PAU4021 PAU409

PAU408
PAU407
PAU406
COU4
PAY104 PAY101 PAU301 COR43 PAC2102
PAU2034
PAU2035
PAU2036
PAU2037
PAU2015
PAU2014
PAU2013
PAU2012
PAC2302 PAC3102 PAL202 PAL502
PAC201 COC21 PAC2502 PAC2501
PAU103 PAU102 PAU101 COC8 COC22 PAC2202 PAU401 PAU402 PAU403 PAU40 PAU405 PAC2101
PAU2038
PAU2039
PAU2040
PAU2011
PAU2010
PAU209
PAC1101 PAC1102
PAC202 PAQ302 PAQ301 PAQ402 PAQ401 COC11 COC25
PAC2601 PAC2602 COC26 PAU2041
PAU2042
PAU2043
PAU208
PAU207
PAU206
PAC2001 PAC2002 COC20
PAC1701 PAC1801 PAU2044 PAU205

PAR102 PAU104 PAU105 PAQ303 COQ4 PAQ403 PAU2045


PAU2046
PAU204
PAU203
PAC1702 PAC1802 PAC3202
COR1 COQ3
COC32
PAU2047 PAU202
PAC2801 PAC1901 PAC1902 COC19
PAC502 PAR101
PAV102 PAV101
COU1
PAC402 PAD102 PAD101
PAC502 PAU30 COC17 COC18 PAC3201
PAU2048 PAU201

COU2 PAC2802
PAC702 PAU2049 PAU205 PAU2051 PAU205 PAU2053 PAU2054 PAU205 PAU2056 PAU2057 PAU2058 PAU2059 PAU206 PAU2061 PAU206 PAU2063 PAU2064 COC28
PAL302 PAR401
PAL202
PAL602
PAR4302
PAR302
PAR4202
PAL502
PAR1602
PAR1002
PAR902
PAR802
PAR602
PAR102
PAR202
PAR1402
PAL102
PAR502
PAL402
PAR1702
PAR402 PAL601
PAL301
PAL101
PAR301
PAR4201
PAL501
PAL201
PAR601
PAR801
PAR901
PAR1001
PAR201
PAR101
PAR501
PAR1601
PAL401
PAR4301
PAR1401
PAR1701
PAC501 PAC701
COC7
PAV103 COV1
PAC602
PAC601 PAC501 PAD103
PAC401
COD1

PAR301 PAR302
COL6

COC4
COC5 COC6
PAP3012 PAP401
PAP301 COR3

PAP3011 PAP302
PAP402
PAP3010 PAP303
PAP403
PAP309 PAP304
PAP404
PAP308 COP3 COP4 PAP405
PAP305
PAP307 PAP406
PAP306
PAP306 PAP407
PAP305 PAP408
PAP304 PAP409
PAP303 COR17 COR4
PAP4010
PAP501 PAP302
PAP301 COC9
PAC901 PAC902
PAR1702 PAR402
PAR1701 PAR401 PAP4011
PAP4012
PAP600
PAD203
COR6 COR8 COR9 COR10 COSW3
PAL101 PAL102 COD2
COSW1 COSW4 COSW6 COSW2 COSW5
COL1 PAD201 PAD202
PAR602 PAR802 PAR902 PAR1002
PASW104
PASW204
PASW304
PASW404
PASW504 PASW102 PASW404
PASW202
PASW302
PASW402
PASW502
PASW602 PASW402 PASW304 PASW302 PASW604 PASW602 PASW204 PASW202 PASW504 PASW502
COUSB01 PAUSB0106 PAUSB01 PAUSB012 PAUSB013 PAUSB014 PAUSB015 PAUSB0109
PAR601 COD3 PAR801 PAR901 PAR1001
COP2

PAS101 PAS102 PAD702 PAD402 PAD502 PAD702


PAD302
PAD402
PAD502 PAUSB010
PAP202 PAP204 PAP206 PAP208 PAP2010
PAP201 PAP203 PAP205 PAP207 PAP209
PAD501 PAD401 PAD501 PAD701
PAD301
PAD401
PAD701
COS1
PASW103
PASW203
PASW303
PASW403
PASW503
PASW603 PASW101 PASW403
PASW201
PASW301
PASW401
PASW501
PASW601 PASW401 COD4 COD7
PASW303 PASW301 PAUSB0107 PAUSB0108 PASW603 PASW601 PASW203 PASW201 PASW503 PASW501
COD5

105
1 2 3 4 5 6 7 8

Sensorless 10A ESC REV2.0 Nathan Zimmerman

Over Current Latch Circuit Trip 12A


VBAT Q1
COQ1
VP1 Doubler Charge Pump
R1
COR1 D3
COD3 D4
COD4 External Motor
PIR101 PIR102
A 0.05 PIPIQ103
R301 PIQ104
PMOS-2 VBAT VPump NLCMP0OUT
CMP_OUTPIP1201
1 2
NL2H0Extern
2H_Extern A
PIR501 PIR602 R3
COR3 R9
COR9 PID302 PID402 PIP1202

COR5
R5 R6
COR6 10K
PIQ10
AOD4189
OC Tripped LED
PID10 Output On PIR902
10K
PIR901 PID303
PID301
PID403
PID401
1L_ExternPIP1203
1H_ExternPIP1205
3
5
4
6
PIP1204
PIP1206
NL3A0Extern
3A_Extern
NL3L0Extern
3L_Extern
10K 10K PIR302 COD1
D1
PIQ20 2A_ExternPIP1207
7 8 PIP1208
NL3H0Extern
3H_Extern
PIR502 PIR601 LED3 PIQ303COQ3 PIC401 PIC501
PIR802 C? Needs to be added
PID102 MC_Pump PIQ301 Q3 Q2
COQ2
Bat54A
C4
COC4
Bat54A
C5
COC5
NL2L0Extern
2L_ExternPIP1209
P12
COP12 9 10 PIP12010

A.12
PIQ201
3

R8
COR8 PIU103 PIU102 VPump PIR1301 PMOS-2 PIC402 10uF PIC502 10uF
100K 3.3V PIR10 1 R13
COR13 PIQ302 PIQ401 PIQ203 IRLML2246
Power Rails
1-

R15
1+

PIR801 4PIU104 8 R10


COR10 10K COR15 VPump VP1 P1 COP1
- + PIU108
PIC2702 PIR1 01 1k PIR1302 PIQ402 PIQ403
PIR1502 PIR1501
Comparitor Q4
COQ4 100 3.3V VBAT PIP101
COC27 PIR1202 COR11
R11 PIR10 2 COL1 1
1OUT

C27 U1B L1 5V
U1A
COU1A
COU1B PIC2701 100nF R12
COR12 47K
2N7002P
2N7002P,215
USB_Slave PIL102 PIL101
PIP102 2
PIP103 3
LM358 100K PIR1 02 6PIU106
2-
FB PIC101 PIC201 PIP104 4
PIU101 PIR1201 7 C1
COC1 C2
COC2

ESC Dev Board


R14
COR14 2OUT PIU107 PIP105 5
1

5PIU105 USB Mini B PIC102 100nF PIC202 10uF


PIR1602 PIR1401 PIR1402 2+ 5V Linear ED2992CT-ND
USB_1 Header 5
D-AMP G1
R16
COR16 10K
PIR1701 Power System 497-1534-1-ND
COUSB01
VBUS
1
PIUSB0101
10K R17
COR17 LM358 MC78M05 5V Reg 2 NLU0N
U_N COR2
R2 33 NLUSB0MCU0N
USB_MCU_N
PIR1601 10K DM PIUSB0102 PIR201 PIR202
Vin VBAT 5V

Shield
Shield
Shield
Shield
Feedback to MCU DNP MC78M05CDTGOS-ND 3 NLU0P
U_P R4
COR4 33 NLUSB0MCU0P
USB_MCU_P
COR18
R18 PIR1702 COR19
R19 COQ5
Q5 DP PIUSB0103 PIR401 PIR402
5 3.3V
ESC_I_FB PIR1802 PIR1801 PIR1901 PIR1902 GND PIUSB0105
Kinetis SWD
10K 10K 2 3
PID20 PID201

GND
PIC40 2 PIC1202 1 PIP301 PIQ504 PIQ503 PIV102 Vin Vout PIV103
PIQ603COQ6 COP2
P2
PIUSB016 PIUSB017 PIUSB018 PIUSB019

6
7
8
9
C40
COC40 OC_RESET PIQ601 Q6 C12
COC12 P3
COP3 PIC702 PMOS-2 PIC802 PIC902 PIC601 C6
COC6 D2
COD2 PIP201
1 2 PIP202
NLSWD0DIO0TGTMCU
SWD_DIO_TGTMCU
PIC40 1 PIR20 1 PIC1201 C7 C8 C9 R7
COR7
100nF Latch Release
PIQ602 100nF COC7
PIQ501 AOD4189 COC8 V1
COV1
PIV10 DPAK
COC9 10uF PIR702 PIR701
Bat54A PIP203 3 4 PIP204
NLKL250SWD0CLK
KL25_SWD_CLK

1
R20
COR20 PIC701 Cap PIC801 Cap PIC901 Cap PIC602
PID203
Verified

1 PIP701 10K PIP205 5 6 PIP206


10K 100nF 100nF 1uF C3
COC3 PIP207 7 8 PIP208
PIR20 2 P7
COP7 PIC301 PIC302 PIP209 9 10 PIP2010
NLRST0TGTMCU
RST_TGTMCU

B 100nF Header 5X2 B

1 Phase A D7
COD7
VP1
1 Phase B D9
COD9
VP1
1 Phase C D8
COD8
VP1
Standoffs VBAT

PID703
PID702

PIQ704 PID903
PID902

PIQ804 PID803
PID802

PIQ904 NLNC10ST
NC1_ST
H1
COH1
PIH101
PID501 COD5
VP1 NLA0Pump
A_Pump VP1 NLB0Pump
B_Pump VP1 D5
PID701 PID901 PID801 stand_off
PIC1402 Bat54A PIR2102
R21
COR21
PIR2101
PIQ701
Q7
COQ7
PIC1502 Bat54A PIR2202
R22
COR22
PIR2201
PIQ801
Q8
COQ8
PIC3202 Bat54A PIR2302
R23
COR23 PIQ901

PIR2301
Q9
COQ9
NLNC20ST
NC2_ST
COH2
H2
PIH201
PID502 LED3

C14
COC14 U3
COU3 0 PIC3 02 PIQ703 NTD5804NT4G C15
COC15 U4
COU4 0 PIC3402 PIQ803 NTD5804NT4G C32
COC32 U5
COU5 0 PIC3502 PIQ903 NTD5804NT4G
stand_off
100nF PIC1401 4
PIU304 Vcc BST
1
PIU301 C33
COC33 100nF PIC1501 4
PIU404 Vcc BST
1
PIU401 C34
COC34 100nF PIC3201 4
PIU504 Vcc BST
1
PIU501 C35
COC35
H3
COH3 PIR4501
DRVH
8
PIU308 100nF PIC3 01 NLOUT1
OUT1 1
PIP901 1 DRVH
8
PIU408 100nF PIC3401 NLOUT2
OUT2 PIP1001 1 DRVH
8
PIU508 100nF PIC3501 NLOUT3
OUT3 PIP1101 1
NLNC30ST
NC3_STPIH301
R45
COR45
PIC1302 PIC3602 PIC3702 1K
A_BLMH_1 3
PIU303 OD
SWN
DRVL
7
PIU307
5
PIU305
R24
COR24
PIQ1304 COQ13
C13
COC13 P9
COP9 NLB0BLMH01
B_BLMH_1 3
PIU403 OD
SWN
DRVL
7
PIU407
5
PIU405
R25
COR25
PIQ10 4 C36
COC36 P10
COP10 NLC0BLMH01
C_BLMH_1 3
PIU503 OD
SWN
DRVL
7
PIU507
5
PIU505
R26
COR26
PIQ1 04 C37
COC37 P11
COP11 stand_off
COH4
H4
PIR4502
A_BLML_1 2 6 Q13 100nF PIC1301 NLB0BLML01
B_BLML_1 2 6 Q10
COQ10 100nF PIC3601 NLC0BLML01
C_BLML_1 2 6 Q11
COQ11 100nF PIC3701 NLNC40ST
NC4_ST
PIU302 IN PGND PIU306 PIR2402 PIR2401
PIQ1301 PIU402 IN PGND PIU406 PIR2502 PIR2501
PIQ1001 PIU502 IN PGND PIU506 PIR2602 PIR2601
PIQ1101 PIH401
0 0 0 stand_off
PIR2901 PIR30 1 ADP3110A
PIQ130 NTD5804NT4G PIR3101 PIR3201 ADP3110A
PIQ10 3 NTD5804NT4G PIR3401 PIR3501 ADP3110A
PIQ1 03 NTD5804NT4G
R29
COR29 R30
COR30 R31
COR31 R32
COR32 R34
COR34 R35
COR35
10K 10K A_BLMA_1 R27 COR27 A_FB R28
COR28 10K 10K NLB0BLMA01
B_BLMA_1 R36 COR36 B_FB R37
COR37 10K 10K NLC0BLMA01
C_BLMA_1 R38
COR38 NLC0FB
C_FB R39
COR39
PIR2702 PIR2701 PIR2802 PIR2801 PIR3602 PIR3601
PIR2902 PIR30 2 1k PIC10 2 PIR3 01 20k PIR3102 PIR3202 1k PIC3802 PIR40 1 PIR370220k PIR3701
PIR3402 PIR3502 PIR3802
1k
PIR3801
PIC3902 PIR4101 PIR3902
20k
PIR3901

C10
COC10 R33
COR33 C38
COC38 R40
COR40 C39
COC39 R41
COR41 P8
COP8
100pF PIC10 1 10K 100pF PIC3801 10K 100pF PIC3901 10K PIP801 GND
PIR3 02 PIR40 2 PIR4102
GND_CLIP
5016KCT-ND
C C

Phase Signal Interconnects


P4
COP4 P13
COP13 P5
COP5 P14
COP14 P6
COP6 P15
COP15 Sudo Neutral Bulk C
Interconnect Probe Points Interconnect Probe Points Interconnect Probe Points R46 100K
COR46
PIR4601
PIR4602
NLA0FB
A_FB VBAT VP1 VP1 VP1
A_BLML PIP401 NLA0BLML01
A_BLML_1 B_BLML PIP501 B_BLML_1 C_BLML PIP601 C_BLML_1PIP1501 C28
COC28 C11 C29
COC11 COC29 C30
COC30
1 2 PIP402 PIP1301 1 1 2 PIP502 PIP1401 1 1 2 PIP602 1

1
A_BLMH PIP403
3 4 PIP404
NLA0BLMH01
A_BLMH_1 PIP1302 2
B_BLMH PIP503
3 4 PIP504
B_BLMH_1
PIP1402 2
C_BLMH PIP603
3 4 PIP604
C_BLMH_1PIP1502 2
R47 100K
COR47
PIR4701
PIR4702
NLB0FB
B_FB PIC2801 PIC1 01 PIC2901 PIC30 1
A_BLMA PIP405 NLA0BLMA01
A_BLMA_1 B_BLMA PIP505 B_BLMA_1 C_BLMA PIP605 C_BLMA_1 NLNeutral
Neutral
5 6 PIP406 PIP1303 3 5 6 PIP506 PIP1403 3 5 6 PIP606 PIP1503 3 COR48 PIC2390uF
802 PIC390uF
1 02 PIC2390uF
902 PIC3390uF
02
R48 100K
PIR4801
PIR4802
C_FB

2
Header 3X2 Header 3 Header 3X2 Header 3 Header 3X2 Header 3

Kinetis Bank A U2A


COU2A
COU2B
COU2C
COU2D Kinetis Bank B Kinetis Bank C Kinetis Bank D
3.3V 1
CMP_OUTPIU201 U2B Y1
COY1 U2C U2D
PTE0/CMP_OUT
2 Neutral 17 NLEXTAL0
EXTAL+ 1 2 NLEXTAL0
EXTAL- 33 NLLED
LED 49
PIU202 PTE1 PIU2017 PTE29/CMP5 PIY101 PIY102 PIU2033 PTA19 PIU2049 PTC4/LLWU_P8
C16
COC16 PIC1602 3 PIU203 VDD
C_BLMA 18 PIU2018 PTE30/CMP4
34
PIU2034 PTA20
50
PIU2050 PTC5/CMP_OUT
100nF 4 19 8MHz 35 51
PIC1601 PIU204
5
USB_MCU_PPIU205
VSS
USB0_DP
PIU2019
20
PIU2020
PTE31
PTE24
R42
PIR4201
27
COR42 PIR4202
3L_Extern
NL1A0Extern
1A_Extern
PIU2035
36
PIU2036
PTB0/LLWU_P5
PTB1
PID601 NLB0BLMA PIU2051
B_BLMA
A_BLMA 52
NLA0BLMA PIU2052 PTC6/CMP0
PTC7/CMP1
6
USB_MCU_NPIU206 21 3.3V PIC1702 PIC1802 NL2A0Extern
2A_Extern 37 D6
COD6 TMP4 NLB0BLMH
B_BLMH 53
USB0_DM PIU2021 PTE25 PIU2037 PTB2 LED3
PIU2053 PTC8/TMP0_4
3.3V
5V
7
PIU207
8
PIU208
VOUT33
VREGIN
22
KL25_SWD_CLK PIU2022
23
PIU2023
PTA0
PTA1
PIR4302
COC17
C17
18pF PIC1701
COC18
C18
18pF PIC1801
3A_Extern
NL1L0Extern
1L_Extern
38
PIU2038
39
PIU2039
PTB3
PTB16
PID602 TMP5 54
NLC0BLMH PIU2054
C_BLMH
55
PIU2055
PTC9/TMP0_5
PTC10
PIC1901 PIC20 1 9 24 R43
COR43 NL1H0Extern
1H_Extern 40 56

106
PIU209 PTE20 PIU2024 PTA2 PIU2040 PTB17 PIU2056 PTC11
C19
COC19 C20
COC20 10
PIU2010 PTE21
SWD_DIO_TGTMCU 25
PIU2025 PTA3
10k 2H_Extern 41
PIU2041 PTB18
PIR4 01 TMP0 NLA0BLML
A_BLML 57
PIU2057 PTD0
D PIC1902 10uF PIC20 2 100nF 11 26 PIR4301 RST_TGTMCU NLMC0Pump
MC_Pump 42 R44
COR44 TMP1 58
NLB0BLML PIU2058
B_BLML D
PIU2011 PTE22 PIU2026 PTA4 PIU2042 PTB19 PTD1
3.3V 12
PIU2012 PTE23
27
PIU2027 PTA5
PIC2102 ADC_SEL14 A_BLMA 43
PIU2043 PTC0
33 TMP2 NLC0BLML
C_BLML 59
PIU2059 PTD2
13 3.3V 28 C21
COC21 ADC_SEL15 B_BLMA 44 PIR4 02 TMP3 A_BLMH 60
NLA0BLMH PIU2060
L2
COL2 PIU2013 VDDA PIU2028 PTA12 PIU2044 PTC1/LLWU_P6/RTC_CLKIN PTD3
PIL202 PIL201
14
PIU2014 VREFH
29
PIU2029 PTA13
PIC2101 100nF ADC_SEL11 NLC0BLMA
C_BLMA 45
PIU2045 PTC2
61
PIU2061 PTD4/LLWU_P14
PIC2502 FB PIC2 02 PIC2302 15
PIU2015 VREFL
PIC2402 30
PIU2030 VDD
3H_Extern 46
PIU2046 PTC3/LLWU_P7
62
PIU2062 PTD5
C25
COC25 L3
COL3 C22
COC22 C23
COC23 16
PIU2016 VSSA
C24
COC24 31
PIU2031 VSS
PIC2602 47
PIU2047 VSS
ADC_SEL07 63
NLESC0I0FB PIU2063
ESC_I_FB
PTD6/LLWU_P15
1uF PIC2501 PIC2 01 1uF PIC2301 1nF PIC2401 100nF EXTAL+ 32 3.3V C26
COC26 48 OC_RESET 64
NLOC0RESET PIU2064
PIL302 PIL301 PIU2032 PTA18 PIU2048 VDD PTD7
FB MKL25Z64VLH4 PIC2601 100nF
MKL25Z64VLH4 MKL25Z64VLH4 MKL25Z64VLH4

1 2 3 4 5 6 7 8
A.13
PAH101 COC30 PAD101 PAD102
PAH301

ESC Dev Board


COC29 COQ7 COD1
COQ1
PAC30 1 PAP801 COP8 PAP209PAP207PAP205PAP203PAP201 COP2
COR20 COQ6 PAP105 PAP104 PAP103 PAP102 PAP101
COP1
COP4 COP13 COR30
PAC2901 COC33
PAQ1303 PAR2402 PAR2401
PAQ1301
PAR1001
PAP2010PAP208PAP206PAP204PAP202 PAR3002 COD7

PAQ704
COH1 PAD702 PAC3302 PAR1002
PAR2001 PAQ601 COR24
PAP401 PAP402 PAP1301 PAD703

PAQ104 PAQ603 COR10


PAR4302 PAR4301 PAC2102 PAC2101 COC21 PAR3001 PAD701 PAC3301 COQ13 COH3
PAR2002 PAQ602
COR43 COR16 COR18 COC27 COC4 PAC401 PAC402 PAQ201 COQ2 COU3
COR12
PAR1201 PAR1602 PAR1601 PAR1802 PAR1801 PAC2701 PAC2702 COR3
PAQ203 PAP403 PAP404 PAP1302 PAU301 PAU308

PAQ1304
COP7 COD4 PAQ202 COP9
PAD401 PAD301
PAR102 PAD403 PAD303 COR9 COR15
PAU302 PAU307

PAP701 COR6 PAR1202 PAU101 PAU108 PAR301


PAD402 PAD302 COD3 PAR901 PAR902 PAR1501 PAR1502 PAP405 PAP406 PAP1303 PAU303 PAU306
PAC1301 PAP901
PAQ101 PAC30 2 PAQ103 PAR602 PAR601 PAU102
PAR501 PAR502 PAU103
COR5 PAR802 PAU104
PAU107 PAR302
PAU106 COR19COC12
PAU105
PAR1902 PAC1202
PAR1901 PAC1201
COC5
PAC501 PAR1301
PAC502 PAR1302
COR13
PAQ301
PAQ303
PAQ401
PAQ403
COR29 PAR2901 PAR2902
PAU304

COR27 PAR2702
COR46 PAR4601
COC14
PAC2902 PAU305

PAR2701 PAC1402 PAC1401 PAR2802 PAR2801


COR28
PAR4602 PAC1001 PAC1002 PAR3301 PAR3302
PAR2102 PAQ701 COQ8
PAQ703COC13
PAC1302

PAR101 PAR801
COU1
PAR1702 PAR1701 PAR1102 PAR1101 PAR1401 PAR1402 PAC4001 COC40
PAQ302 COQ3 PAQ402 COQ4
COP14 COR33 PAR2502 PAR2501
PAR2101
COP5 COC10
P A Q 1 0 3 PAQ10 1
PAQ804
COD6 COR44 PAD902 PAC3402 COR21
COR8 COR25
COR1 COR17 COR11 COR14
PAD601 PAD602 PAR4401 PAR4402 PAR3202 PAD903 COC34
COC16
PAC4002
COU2
PAU2064 PAU2063 PAU206 PAU2061 PAU206 PAU2059 PAU2058 PAU2057 PAU2056 PAU205 PAU2054 PAU2053 PAU205 PAU2051 PAU205 PAU2049 COC26
PAP501 PAP502 PAP1401 COR32 PAR3201 COD9 PAD901 PAC3401 COQ10

PAV104
PAR4501 PAR4502 PAC2001 PAC1602 COU4 COP10
COR45 PAC2601
COC20 PAP503 PAP504 PAP1402 PAP1001
PAQ1004
PAU201 PAU2048

PAC2002 PAC1601 PAU401 PAU408


COD5 PAD502 PAD501 PAU202
PAU203
PAU204
PAU2047
PAU2046
PAU2045
PAC2602
PAU402 PAU407
COQ5 COC9 PAU205 PAU2044

PAC902 PAC901 COR2 COR4


COC19
PAU206
PAU207
PAU208
PAU2043
PAU2042
PAU2041
PAP505 PAP506 PAP1403 PAU403 PAU406
COC28COV1 PAU404 PAU405 COC11

PAC321098 2
PAU209 PAU2040

PAC1901
COC7
PAC701
COC2
PAC201 PAC202
PAR202
PAR201
PAR402
PAR401 PAC1902
COC22COC23
PAC2202 PAC2302
PAU2010
PAU2011
PAU2012
PAU2013
PAU2039
PAU2038
PAU2037
PAU2036
COR31 PAR3102 PAR3101 COC15
COR36 PAR3602 PAR3601 PAC1502 PAC1501 PAR3702 PAR3701COR37 PAR2202
PAQ801 COQ9
PAQ803 COC36
PAC3602
PAV101 PAV103 PAC601
PAU2014 PAU2035

COC1 PAC2201 PAC2301


PAU2015
PAU2016
PAU2034
PAU2033
COP6
COR34 PAR3402 PAR3401 COR47 PAR4701 PAR4702 PAC3801 PAC3802 PAR4001 PAR4002COR40 PAR2602 PAR2601 PAR2201 PAC3601
PAC702 COD2 PAD203
PAQ1 03 PAQ1 01
PAQ904
COR7 COL2 COR35 COC38
PAC101 PAC102 PAL201 PAL202 PAC2502
COP3 COC8
PAR701 PAR702 PAU2017 PAU2018 PAU2019 PAU20 PAU201 PAU20 PAU203 PAU204 PAU205 PAU206 PAU207 PAU208 PAU209 PAU203 PAU2031 PAU203 PAP601 PAP602 PAP1501 PAR3502
PAD803
PAD802
COD8
PAC3502
COC35
COR26
PAC1102 COR22
PAC1101
COP11

PAP301 PAQ503 PAC801


PAC802 PAQ501 PAC602
COC6
PAL101 PAL102
COL1
PAD201 PAD202 PAL301 PAL302 PAC2501
PAC302 PAC301 COC3 COL3 COC25
PAP603 PAP604 PAP1502 COP15
PAR3501 PAD801 PAC3501
COU5
COQ11
PAP1101
PAQ1104
PAU501 PAU508

PAC321098 1 PAUSB0106 PAUSB01 PAUSB01 2PAUSB01 3PAUSB01 4PAUSB01 5 PAUSB0109 COC17 COR42
PAC1701 PAC1702 PAR4201 PAR4202 PAC1802 PAC1801 PAC2402 PAC2401
COC18 COC24

PAP605 PAP606 PAP1503


PAU502 PAU507

PAQ504
PAU503 PAU506
COH2 PAUSB010 PAU504 PAU505 PAR2302
COY1 COC32
PAQ901 PAQ903 COC37

PAH201 PAUSB0107
COUSB01
PAUSB0108 PAY101 PAY102 PAP1209 PAP1207 PAP1205 PAP1203 PAP1201
COP12
PAP12010 PAP1208 PAP1206 PAP1204 PAP1202
COR38 PAR3802
COR48
PAR3801 PAC3202 PAC3201 PAR3902 PAR3901 COR39
PAR4801 PAR4802 PAC3901 PAC3902 PAR4102 PAR4101COR41
COC39
PAR2301
COR23
PAC3702 COH4
PAC3701
PAH401

107
108

APPENDIX B

Transmission Line Calculations

B.1 Microstrip Line Zo Calculation

The following are empirical formulas used to calculate the characteristic

impedance of a microstrip line where w is the width of the track, r is the relative

permittivity, t (not shown) is the copper weight, and h is the height of the

dielectric[54]. Care should be taken that the correct relative permittivity is

selected with respect to the frequency of operation.

εr h

"  2 #
r + 1 r − 1 1 W
ef f = + · q + 0.04 1 −
2 2 12h
1+ W h
" #
t 4e
∆W = · ln 1/π 2
π 2
(t/h) + w/t+1.1
!
1 + 1/ r
∆W 0 = ∆W
2 (B.1)

W 0 = W + ∆W 0

120π
Zo = √ √ · ln 1+
2 · 2 · π · r + 1
 r !
4h 14 + 8/ef f 4h 14 + 8/ef f 2 4h 2 1 + 1/ef f
· · 0+ ( ) · ( 0) + · π2
W0 11 W 11 W 2
109

B.2 Coplanar Waveguide Zo Calculation

The following are empirical formulas used to calculate the characteristic

impedance of a coplanar waveguide where a is the width of the track, b is the

width of the waveguide, and r is the relative permittivity[54]. Other variables

used in this equation are intermediate variables and K is an elliptical integral.

b
a

εr h

a
k=
b
tanh( π·a
4·h
)
kl = π·b
tanh( 4·h )

kl0 = 1 − kl2

k0 = 1 − k2
Z π/2 (B.2)
1
K(k) = p dθ
0 1 − k · (sin(θ))2
2

r ·K(k0 )·K(kl)
1+ K(k)·K(kl0 )
ef f = K(k0 )·K(kl)
1+ K(k)·K(kl0 )
60π 1
Zo = √ · K(k) K(kl)
ef f +
K(k0 ) K(kl0 )

You might also like