1. Trang chủ
  2. » Giáo Dục - Đào Tạo

design and control a hexacopter using fuzzy pid controller for an indoor ultra wide band localization system

135 0 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Design and Control a Hexacopter using Fuzzy PID Controller for an Indoor Ultra Wide-band Localization System
Tác giả Le Hoang Minh, Hoang Thanh Tung
Người hướng dẫn Dr. Tran Duc Thien
Trường học Ho Chi Minh City University of Technology and Education
Chuyên ngành Automation and Control Engineering
Thể loại Graduation Project
Năm xuất bản 2023
Thành phố Ho Chi Minh City
Định dạng
Số trang 135
Dung lượng 10,91 MB

Cấu trúc

  • CHAPTER 1. OVERVIEW (23)
    • 1.1. Problem statement (23)
      • 1.1.1. Drone research in other countries (23)
      • 1.1.2. Drone domestic research (24)
    • 1.2. Objectives and purposes (25)
      • 1.2.1. Objectives and goals (25)
      • 1.2.2. Purposes (25)
    • 1.3. Research content (26)
    • 1.4. Limitation (26)
    • 1.5. Methodology (26)
  • CHAPTER 2. LITERATURE VIEW (27)
    • 2.1. Hexacopter overview (27)
      • 2.1.1. Definition (27)
      • 2.1.1. History (27)
    • 2.2. Multicopter performance analysis (29)
      • 2.2.1. Potential and Applications (30)
      • 2.2.2. Hexacopter fundamentals (33)
    • 2.3. Hexacopter Kinematic (34)
      • 2.3.1. Coordinate system (34)
      • 2.3.2. Kinematic analysis (35)
      • 2.3.3. Positioning and Angular Kinematic (37)
    • 2.4. Hexacopter Dynamic (38)
      • 2.4.1. Aerodynamic effect (38)
      • 2.4.2. Equation of motion on the Body frame {B} (39)
      • 2.3.4 Dynamic equation on the Earth frame {E} (45)
    • 2.5. Translational and Rotational motion (46)
    • 2.6. Measurement and Navigation modules of the drone (49)
      • 2.6.1. IMU sensor (49)
      • 2.6.2. Accelerometer (50)
      • 2.6.3. Gyroscope (52)
    • 2.7. Euler Angles (53)
    • 2.8. Ultra Wide-band system (56)
      • 2.8.1. Navigation (56)
      • 2.8.2. Ultra Wide-band technology (58)
    • 2.9. Kalman Filter (68)
      • 2.9.1. Kalman Filter prediction step (69)
      • 2.9.2. Kalman Filter estimate step (69)
    • 2.10. Fuzzy PID Controller (70)
      • 2.10.1. PID Controller (70)
      • 2.10.2. Fuzzy Controller (71)
      • 2.10.3. Fuzzy – PID Controller (71)
    • 2.11. ESP32 Platform (72)
  • CHAPTER 3. MODEL DESIGN AND CONSTRUCT (74)
    • 3.1. System overview (74)
    • 3.2. Hexacopter model design (75)
      • 3.2.1. Expectation (75)
      • 3.2.2 Mass and Thrust estimation (75)
      • 3.2.3 Propeller selection (75)
      • 3.2.4 Motor and ESC selection (76)
      • 3.2.5 Battery selection and flight time (78)
    • 3.3. Balance testing kit design (79)
    • 3.4. Hexacopter frame design (80)
      • 3.4.1. Hexagon body frame (80)
      • 3.4.2. Devices Selection (84)
    • 3.5. Wiring diagram (85)
      • 3.5.1. Hexacopter wiring diagram (85)
      • 3.5.2. ESP32 – DWM1000 Wiring diagram (86)
  • CHAPTER 4. CONTROLLER DESIGN AND SIMULATION (87)
    • 4.1. Hexacopter controller overview (87)
    • 4.2. Controller design (88)
      • 4.2.1. PID Controller design (88)
      • 4.2.2 Fuzzy PID Controller design (91)
    • 4.3. Controller Simulation (93)
  • CHAPTER 5. ULTRA WIDE-BAND SYSTEM DESIGN (98)
    • 5.1. Ultra-Wide-band system overview (98)
  • CHAPTER 6. EXPERIMENTING AND RESULTS (102)
    • 6.1. Hexacopter controller experimenting (102)
      • 6.1.1. PID Controller experimenting (102)
      • 6.1.2. Fuzzy PID Controller experimenting (105)
      • 6.1.3. PID and Fuzzy PID response comparison (108)
    • 6.2. Ultra-Wide-band localization experimenting (110)
      • 6.2.1. Flowchart (110)
      • 6.2.2. System verification (111)
      • 6.2.3. Localization experimenting (113)
    • 6.3. Hexacopter Flight testing (119)
      • 6.3.1. Hexacopter overall process (119)
      • 6.3.2. Start Up Process (120)
      • 6.3.3. Command Process (123)
    • 6.4. Localization experimenting during flight (124)
      • 6.4.1. Take-off (124)
      • 6.4.2. Landing (125)
      • 6.4.3. Flight testing with localization (126)
      • 6.4.4. Manual flight testing with localization (128)
  • CHAPTER 7. CONCLUSION (130)
    • 7.1. Conclusion (130)
    • 7.2. Development path (131)

Nội dung

Tran Duc Thien Students: Le Hoang Minh 19151063 Hoang Thanh Tung 17151036 HO CHI MINH CITY – 12/2023DESIGN AND CONTROL A HEXACOPTER USING FUZZY PID CONTROLLER FOR AN INDOOR ULTRA WIDE-

OVERVIEW

Problem statement

1.1.1 Drone research in other countries

The drone, also formally referred to as an Unmanned Aerial Vehicle (UAV), Unmanned Aerial System, or Remotely Piloted Aircraft (RPA) is capable of flying autonomously or being guided remotely without human intervention An UAV is essentially an aircraft that operates without an onboard pilot, functioning as a fluing robot that can be controlled remotely or fly autonomously through software -managed flight plans embedded in its system [1] Drones fine extensive use in military surveillance and have practical applications in commercial sectors such as advertising for capturing scenery Notably, Amazon Prime a leading e-commerce company has introduced drones into the industry services

Over the past decade, drones have attained significant success in research and development across various industrial sectors, generating high expectations for their continued utilization [2] Drones have emerged as a primary focus in the field of robotics, leading to a substantial increase in the number of research studies Due to beneficials and potential that drone can bring, they have become a great compelling topic for numerous researchers aiming to generate innovative ideas and applications Controllers and computer vision are mainly focused continuously for experimenting and developing new features on drone Therefore, effective drone control is the cornerstone for any drone application in which these unmanned aerial vehicles are employed

A lot of international scientific papers has already applied various of control methods on drone, such as PID controller in [3], the most popular and easy to approach Drone dynamic analysis mainly on mathematically linearization method using LQR Controller [8] and MPC Controller [7], Optimal PID controller [4], Fuzzy Controller [5] and Fuzzy PID controller [6] are also used for stabilizing and optimizing drone balance

Beside controllers, navigation methodology is also applied for navigating and tracking on unmanned aerial vehicle The most popular and commonly used technology nowadays is GPS – Global Positioning System, a revolutionary technology that has become an integral part of modern navigation, tracking and location-based services Key components of the GPS system include a constellation of satellites orbiting the Earth, ground control stations, and GPS receivers This technology is widely to be appeared on road vehicles, ships and aircraft and it has significantly improved the efficiency and safety in transportation GPS are specialized tools for navigation and tracking in outdoor environments, which provides accurate location information and often come with additional features tailored outdoor activities

Technological advancements have been instrumental in propelling the drone industry through the years Improvements in battery life, miniaturization of sensors, enhanced GPS accuracy for indoor navigation and the development of obstacle avoidance systems have expanded the capabilities of drones Moreover, the integration of Artificial Intelligence (AI) and machine learning enables drones to autonomously

2 navigate, analyze data, and make real-time decisions These cutting-edge technologies not only elevate the potential of drones but also herald a paradigm shift , unlocking new in various industries and paved the way for the Fourth Industrial Revolution

In recent years, Vietnam has emerged as a dynamic player in the global drone industry, capitalizing on technological advancements and a burgeoning market for unmanned aerial vehicles (UAVs) The country's unique geographical diversity, coupled with its increasing emphasis on innovation, has led to the rapid growth of the drone industry This essay explores the development, applications, challenges, and future prospects of the drone industry in Vietnam

Vietnam's drone industry has experienced remarkable growth, owing to a combination of factors such as increased access to technology, supportive government initiatives, and a vibrant entrepreneurial ecosystem The industry's journey began with hobbyists and enthusiasts, but it has quickly evolved into a sector with immense economic potential Local startups, research institutions, and established companies are all contributing to the development of drone technology

The applications of drones in Vietnam are diverse and have a significant impact across various sectors In agriculture, drones are utilized to monitor crops, optimize irrigation, and apply fertilizers precisely This enhances productivity and reduces the environmental impact of farming practices In addition, drones are employed in environmental monitoring, aiding in forest conservation and wildlife protection efforts Furthermore, drones are increasingly used in infrastructure inspection, disaster management, urban planning, and more

Some of the Certain domestic research into drones remain confined to the utilization of models While these models may either be commercially available or self - designed, there is a lack of detailed design procedures provided Additionally, typical controllers like PID are commonly employed in Quadcopter models The emphasis of research predominantly centers around practical applications such as the attachment of devices, including cameras for monitoring purposes or for lifting heavy loads

Besides, drone domestic research has become one of the most favorable topics in most of universities in Vietnam Not only college students, even doctors and professors are delving deeper into this field University of Technology and Education, one of the representative universities leading in technology, has made some considerable research on drones over the past few years: In 2019, Mr Le Manh Cuong of University of Technology and Education, or in short UTE, had published an international paper on IEEE “Using Quadcopter for detecting and tracking on human” instructed by Associate Professor Ph.D Le My Ha [9] Mr Truong Le Anh Tien of UTE, had published

“Quadcopter for Human-Tracking” instructed by Dr Tran Duc Thien, using YOLO on opened source model-based Tello Drone only to detect human In 2023, Mr Phan Thanh Truyen of UTE had published “Designing Model Predictive Controller for Quadcopter”

3 instructed by Dr Tran Duc Thien [7], a non-linear controller for optimizing balancing capability on drone with heavy computation instead of PID controller, etc

Based on the information and analysis of domestic drone research in Vietnam, it appears that drones are primarily confined to simulation for the development and implementation of algorithms aimed at achieving more stable control Drones utilized for outdoor activities typically incorporate GPS technology to ascertain their position during surveillance and scenery capturing applications However, the precision of GPS is somewhat limited when detecting the drone's coordinates on a large-scale map To address this issue, various methods and technologies are currently under development in the field of drone research

In response to this situation, our team has identified a new technology of focus aimed at optimizing drone positioning, specifically by enhancing accuracy and obtaining more precise position data for indoor environments where GPS signals are inaccessible

We propose the utilization of Ultra Wide-band, an indoor navigation module that emits radio waves, developed by the Decawave company This technology is expected to see widespread application in the near future, especially in the field of robotics where positioning accuracy is critical

Objectives and purposes

- Constructing and apply Ultra Wide-band system for drone indoor localization

- Hexacopter has the ability to balance without being exerted by external noises during flying process

- Data retrieved from localization process have to be clear and avoid disturbance in order to know the most accurate position and altitude of the drone from an arbitrary distance

Designing Fuzzy PID Controller to compute optimal PID parameters corresponding to different propeller speeds, ensuring stability in drone balancing

Implementing Ultra Wide-band (UWB) system for localizing the drone position on the UWB anchors and an UWB tag which is placed in different indoor location and on the drone, respectively In addition, Kalman Filter algorithm is also applied for better accuracy and reliability of UWB measurement

Research content

Chapter 1 describes the recommendation, research objectives and range of research with also purpose of launching this project Moving to the next section, chapter 2 delves into the literature view of the Hexacopter, the controller applied on the drone and all of the knowledge utilized in this project Chapter 3 is about how the drone is constructed and how the its model parts is designed on SOLIDWORKS The Fuzzy PID controller section is designed for the Hexacopter in chapter 4 and chapter 5 is where we will present about how mathematic calculations are performed on UWB system and the way it is applied in practical Chapter 6 will mainly focused on real experimenting, also showing results that we have obtained through trials Chapter 7 is the final chapter which is the conclusion and the development path for this project.

Limitation

- Drone flight wont last very long due to battery consuming with six rotors

- Bad weather, like wind or rain, can stop drones from flying safely or collecting data and also need to stay in range within a certain distance or else lose contact

- Temperature will directly affect the Ultra-Wideband transmission signal, causing delay and wrong localization computing

- Limited space forces the drone to operate inside of the area due to the requirement of geometry calculation method The position of the drone will be falsely computed if it is dragged out of the area by external noises or impact

- The drone operation is only focusing on balancing and verify the localization data retrieved during flight

- The drone position is not considerable in this project for autonomous flight as its performance is not very accurate, which we will investigate deeper in the near future

- The hardware used for this project such as sensors or microcontrollers is not fully complete and, comparing to the drone open-source technology, it still faraway in order to achieve it best flight performance

- GPS system is not used in this project and the drone position is totally computed and relies on the data retrieved from the Ultra – Wideband system, so it does not meet some features that GPS system provided (position holding, hovering, ).

Methodology

Data research: Google, Google Scholar,…

Experiment: Designing controller algorithms, implementing and retrieving results it on the real model

Evaluation: Verifying the precision of localization results and gives out evaluation

LITERATURE VIEW

Hexacopter overview

A Hexacopter is a type of drone distinguished by its hexagonal multicopter design, equipped with six propellers attached to six rotors symmetrically arranged around the central body This unique configuration sets Hexacopters apart from the more common quadcopters, providing them with distinct advantages Operationally, Hexacopters generate lift force and movement by manipulating the rotation angles of their six rotors, allowing them to take off, fly, and land Functionally categorized as Unmanned Aerial Vehicles (UAVs), Hexacopters are capable of flying without a pilot and primarily rely on control signals transmitted from a ground station for various purposes Moreover, Hexacopters can also function autonomously, operating with only a personal computer and a pre-programmed autonomous system that automatically executes signals without direct control This capability is commonly referred to as an autonomous drone

The Hexacopter stands as the forefront of modern multicopter technology and continues to find widespread application in contemporary times In tracing its historical roots, the quadcopter, a predecessor multicopter that predates the Hexacopter, has undergone significant development over time, paving the way for the emergence of the Hexacopter

The first ever Quadcopter was firstly seen on this world driven back to the 1900s Precisely in the year of 1920, when Etienne Omnichen invented the Omnichen No.2, a large-sized quadcopter, had the first successfully flight taken place in 1921

Figure 2-2: First ever quadcopter in 1920 by Etienne Omnichen

Through times, drone technology continued to advance, finding notable application during global conflicts, particularly in the world wars These unmanned aerial vehicles played a crucial role in military operations during that time, primarily utilized for transporting support packages and explosive materials In the early stages of World War II, in 1939, the United States introduced the "Radioplane OQ -2," marking the first application of drone in military The vehicle was designed by Reginald Denny and crafted by Norma Jean Doherty, before she became better known as Mailyn Monore, who worked at California plant assembling OQ-2’s during the war This remote- controlled aircraft had an impressive size, measuring 8 feet, 8 inches in length, with a wingspan of 12 feet, 3 inches, and a weight of 105 pounds

Figure 2-3: “Radioplane OQ-2” drone model during World War 2

Given the significant contributions that drones had demonstrated during the two world wars, researchers and scientists, half a century later, dedicated their efforts to downsize these unmanned vehicles into miniature drones for commercial applications This had given resulted in the introduction of increasingly miniature drones, with low-cost efficiency, simplified designs, stability, and user-friendly controls Quadcopters emerged as one of the earliest and widely adopted models among the public and even gained prominence in technology universities

Figure 2-4: College students studying about drone

Drone or Unmanned Aerial Vehicle has become a favored subject among college students and professors delving into the intricacies of the aircraft industry up till these days

A various of drone size keep evolving through the times, from Quadcopters increases to Hexacopter, Octacopter, This evolution reflects the ongoing quest to harness drone technology for both military and civilian purposes, with a particular focus on enhancing accessibility and applicability.

Multicopter performance analysis

Figure 2-5: Most popular modern multicopters

Base on the differences from structured design and control operations Therefore, we need to make comparisons between them

Table 2-1: Table of Multicopter features comparison

No Features Tricopter Quadcopter Hexacopter Octocopter

2 Stabilization Adjustable Good Good Very good

3 Thrust Low Average High Very high

4 Weights Light Average Heavy Very heavy

5 Air resistance Low Average High Very high

6 Complexity Very low Low Average High

7 Size Small Average Average Big

8 Energy consumption Low Average Average High

9 Cost Low Average Average High

From the comparison table, it can be seen that the Hexacopter has an advantage in average size and design, the amount of propellers outcome a better result in stabilizing

8 during flight, make it more easy to control Base on the complexity range of topic, this model is suitable for college students to choose, analyze and use the Hexacopter model

Since the inception of the concept of developing Unmanned Aerial Vehicles (UAVs), which does not involve the need for a human pilot and are designed to undertake tasks beyond human capabilities, scientists have diligently dived and investigate in order to enhance this technology Drones have already exerted a substantial impact on our modes of operation, changing how we work, solving problems and finding solutions

Due to the small design, high adaptability, and affordable productions, UAVs have become useful in various fields The drone is embedded with electronic devices or even weapon for serving in the military, geodetic surveys, rescue operations, etc Recently, drone has becoming more popular during the used in researching and widely applied in surfaces observing, gathering weather data or exploring the environment Additionally, drone is also being applied for delivery, agriculture, aerial photography, as well as national security a) Potential development of Unmanned Aerial Vehicle

Because of the superior features of UAVs compared to traditional aerial vehicles, many technologically advanced countries have invested significant resources in the continuous research and enhancement of UAV technology This commitment has been evident from the early stages of UAV development In the year 2019 which is recently, marked by a global Corona virus – COVID 19 epidemic and the conflict between Russia and Ukraine, further emphasized the importance of drones, leading to increased attention and investment in their creation and application The drone industry's financial outlook has been quantified by Statista, projecting a revenue of up to $4 billion by 2023 This figure is expected to grow substantially, possibly reaching $4.7 billion by 2028 [28] These estimations underscore the rising economic significance and continued expansion of the drone industry

Figure 2-6: UAVs industry global revenue statistics

9 b) Object identification and tracking application

Due to their adaptable nature and the incorporation of robust tracking and surveillance technologies, UAVs are strategically employed in military applications, including integration with tanks, surveillance aircraft, military bases, and other defense systems These unmanned vehicles are designed to offer enhanced vision capabilities, surveillance functionalities, and precise attack capabilities, making them valuable assets in military operations

Figure 2-7: Military drone c) Photography – Object following

Among the prevalent applications of UAVs in contemporary times is the use of Flycams These drones are equipped with high-resolution cameras and stable mounts, such as the Gimple, specifically designed for capturing video footage and still photographs For instance, let’s take the example on the DJI Mavic 3, where advanced technology like Active Track is employed This feature enables users to designate a bounding box around the subject they wish to track, prompting the Flycam to autonomously follow the selected object Moreover, the Follow-me feature utilizes GPS technology, allowing the drone to track and follow an individual when they are the sole focus within the camera frame

10 d) Rescue operations, agriculture, delivery, surveillance

Leveraging the capabilities of the Global Positioning System (GPS), drones can be programmed to autonomously navigate and adhere to a predetermined flight path over a considerable distance This functionality proves highly advantageous for various applications, such as agricultural activities like spraying and seeding, where drones can systematically cover large areas Rescuing and Delivery are also the core of drone applications, by providing supplies in the fastest way and environmentally friendly Additionally, in sectors like surveying, site inspections, infrastructure assessments during construction, reconnaissance missions, and even delivery services, the use of GPS-enabled programming enhances precision and efficiency in executing predefined routes

Figure 2-10: Agriculture drone for watering farms

Hexacopter has the shape of an hexagon, which is characterized by a central body or frame with six arms radiating outward Each arm extends from the center and supports a rotor, and the arrangement of these arms creates a symmetrical hexagonal pattern The hexagonal shape is formed by the even spacing of the arms and rotors around the central axis of the copter

Figure 2-12: Hexacopter frame shape b) Stabilization fundamental

The Hexacopter with the hexagon shaped includes each of the three motors rotating in the reverse direction Motors 1-3-5 rotate CW (Clockwise) while motors 2-4-6 CCW (Counter – Clock Wise) During rotation, thrust force which is the total force to lift the Hexacopter and the Moments are also be generated

The total thrust F i is the total thrust of i th rotors The total momentsM i is generated which against the rotation of the six rotors (i =1, 2, 3, 4, 5, 6) When the rotation speed of the six rotors are equal, also fast enough to create much higher force than the total mass of the rigid body, the Hexacopter will now be able to thrust for taking off and balancing in the air.

Hexacopter Kinematic

In order to analyze the properties and the behavior the Hexacopter, with also experimenting with other control methods and predict its efficiency before launching real model in practice, we need to model the real drone into a mathematic system

Hexacopter is an 6DOF (6 degree of freedom) system, with 12 state variables to be described Therefore, we need two coordinate system to illustrate the motion of the drone in space

Figure 2-14: North – East – Down coordinate system setup on the Hexacopter

This body frame is used to analyze the motion of the Hexacopter during moving in 3D space, the drone aerodynamic will also be determined The coordinate system of the body frame is set up to be attached to the center of the drone, which can also be called the center of mass By determining the linear velocity vector V and the angular velocity of the drone The  vector consists of two components:

Where u w v, , [m s/ ]is the linear velocityp q r, , [rad s/ ]is the angular velocity in the direction of , ,x y z b b b on the body frame{ }B

The earth frame is also called Inertial Earth Frame – NED (North East Down) with the x E - north direction, y E -east and z E pointing downward This is the coordinate system used to determine the linear position vector and the angular position  which consists of three Euler angles  , , pitch, roll, yaw respectively

Where, x y z , , [ ]m is the linear position and   , , [rad]is the angular position in the direction of x E , y E , z E in the Earth frame{ }E

Figure 2-15: Performing coordinate in the Earth frame {E} and the body frame {B}

The linear position of the Hexacopter is the coordinate of the positioning vector of the Earth frame projected from O E to the point on the drone body O B Meanwhile, the angles obtained from the drone provides the direction of the coordinate from the body frame to the Earth frame by using Euler vector angles coordinate The method is described by three times in a row performing rotation around the x y, and z axis mapping from the Earth frame to the body frame{ }E →{ }B

The Euler angle method can be performed in rotation matrix R T as:

As rotation matrix R T is given, its components are:

R x is the rotation of pitch angle  around the xaxis:

R y is the rotation of roll angle around theyaxis:

R z is the rotation of yaw angle around the z axis:

By presenting all three rotations in x y, and zdirections, the rotational matrix from the Earth frame to the body frame { }E →{ }B can be obtained as:

Set  =[x y z] T is the linear velocity of the rigid body in the Earth frame coordinate{ }E From the rotational matrix R B E , the relationship between the vector  and vector V in the body frame coordinate{ }B is:

The angular kinematic vector in the body frame coordinate { }B is the total angular velocity created by roll – pitch – yaw motion from the Earth frame{ }E to the body frame{ }B

Set =      T is the angular velocities roll – pitch – yaw From (2.11), we can describe the relationship between the angular velocityand angular velocity  through rotational matrix:

Where, the rotational matrices are:

Where, T x =tan( )x and the T T is the identity matrix when  (2k−1) / 2, ( k )

Therefore, from (2.10) and (2.12), we can determine equation of motion for linear velocity and angular velocity of the object in the Earth frame{ }E is:

Hexacopter Dynamic

The aerodynamic of the Hexacopter describes the external affections on the propellers during rotating in the air

Figure 2-17: Aerodynamic effect on a propeller

During rotation, the propeller creates a rotational momentum, or can be called angular momentum, which provides an energy into the air and then receive back the incoming force, the formula is given by:

Where, T MT [ N ]is the thrust force,  a [Kg m/ 3 ]is the air density, A p [m 2 ]is the area of the propeller and v i [ m / ] s is the propeller air flow velocity

With the Hexacopter, we need to calculate the conversion of angular velocity v i

[ m / ] s into the quantity that can be controlled, specifically the angular velocity for each of the motors The thrust force T MT i ( ) [ N ]and the angular momentum Q MT i ( ) [ N m ]of the i th motor is converted into:

Where, C T and C Q are the thrust and torque coefficients respectively,  i

[ rad / ]( s i = 1, 2, 3, 4, 5, 6)are the i th rotors velocity, r m p [ ]is the radius of the propeller, I M is the inertial momentum

During controlling the Hexacopter in the environment with stable small wind, the propellers rotation are considered to be the same, the coefficients C T , C Q , , a , A p and r p are nearly constant, and the impact of the inertial momentum I M on the system is considered to be very small so the thrust force and the momentum of each of the motors are determined by:

Where: F i [ N ]is the thrust force and M i [ N m ]is the thrust momentum created by i th rotor, C T and C Q are thrust and torque coefficients respectively

2.4.2 Equation of motion on the Body frame {B}

The equation of motion is constructed by using Newton – Euler formalism Dynamic of the 6 DOF – Degree of Freedom is described as a rigid body affected by the external forces and torques, which is given by:

Here, m[kg]is the total mass of the drone, J [ N ms 2 ]is the inertial tensor,

V B = u v w m s is the linear velocity in the body frame and V B is the linear acceleration,  B = p q r  T [ rad s / ]is the angular velocity in the body frame and  B is the angular acceleration.F B [ ]N and  B [ ]N m are the force and the torque exerting on the Hexacopter body frame respectively.0 3 3  is a zero matrix of size 3 and I 3 3  is a unit matrix of size three By using the fact that a vector cross product can be expressed as a product of a skew-symmetric matrix and a vector according to:

The approximation of the inertial matrix can be expressed as in:

18 xx xy xz yx yy yz zx zy zz

Here, J xx ,J yy and J zz are the moments of inertia with respect to the principal axes x, y and zrespectively.J xy , J xz and J yz are the products of inertia The symmetry of the matrix (J xy = J yx , J xz = J zx , J yz =J zy ) is arbitrary, and the moments and products of inertia depend only on the orientation of the rigid body

Due to the body of the Hexacopter is aligned with its principal axes, the off- diagonal terms of (J xy ,J xz ,J yz ) becomes zero The moment inertial matrix becomes diagonal and can be simplified as:

Applying the skew-symmetric matrix used for cross product, the equation (2.18) can be expanded into:

B B B yy yy B zz zz mu r q mu mI V mV mv r p mv F mw q p mq

The Hexacopter rigid body has a hexagon-typed frame and all the edges are symmetric Therefore, the moment inertial matrix J xx is equal to the moment inertial matrix

J yy On the other hand, the inertial moment around the zaxis is nearly double than the rest of the other two, which indicates that the speed of angular changing around the x B axis and y B axis is much more easier than the z B axis

From the (2.22) formula, the total force of the propellers creates F z , which is the force in the inverse direction of the gravitational force about the z axis, and the momentum created from the right hand rule is applied for the x, y and z, which is specifically be determined by these formulas:

− = =  =  +  +  +  +  +  (2.23) Where, C t is the thrust coefficients multiply with the total square of i th propellers speed  i 2

The moment about the xaxis is created due to movement of  - roll angle which is illustrated in figure (1-5):

Figure 2-20: Roll angle rotating about the axis

Equation of moment about the xaxis is described as:

From fig 2.10 and fig 2.12, the motors which creates forces in order to perform roll rotation on  angle are 1-2-3 respectively Motors 4-5-6 reduce their speed which generate less force so the drone will lean to one side since the other side is exerted by 1-2-3 thrust force Due to the position of 1-3-4-6 motors are placed where the length of the arm is one half cos(60 )

2 o d d = The torque exerted about thexaxis by the motors in this roll rotation is calculated by:

The moment about the y axis is created due to movement of  - pitch angle which is illustrated in figure 2.13:

Figure 2-21: Pitch angle rotating about the axis

Similar toM x , the equation of moment about the y axis is described as:

The motors which creates forces in order to perform pitch rotation on  angle are

3 and 4 Since the pitch angle does not require the force comes from motors 2 and 5, the body will lean to one side due to the force reduction from motor 1 and 6 The position of the drone from fig (Hexacopter overall model) describes the arm lever which exerted by the torque has the length of 3 sin(60 )

2 o d d = The torque exerted about the y axis by the motors in this pitch rotation is calculated by:

The moment about the zaxis is created due to movement of  - yaw angle which is illustrated in figure 2.14:

Figure 2-22: Yaw angle rotating about the axis

The equation of moment about thezaxis is described as:

From figure 2.14, all the motors are put to work in order to create force to perform yaw rotation on  angle The directions of the motors are different The counter clockwise direction is applied on motor 1-3-5, while clockwise direction is applied on 2-4-6 By increasing the speed of two directions for each of the group of motors, the drone will be able to rotate in the positive and negative direction The torque exerted about thezaxis by the motors in this yaw rotation is calculated by:

M z = d  −  +  −  +  −  (2.29) From the torque analysis of (2.25), (2.27) and (2.29) The thrust vector of the rigid body F B and  B is summarized to be:

Combining the calculation from the set of equation (2.22) and (2.30), the final system equation is simplified as:

1 1 1 m yy zz x xx xx zz xx y yy yy xx yy z zz xx rv qw g

2.3.4 Dynamic equation on the Earth frame {E}

In order to control the Hexacopter in the Earth frame { }E , there are two main dynamic equations that need to be converted, Translational Dynamic and Rotational Dynamic

Set U as the control input signal including the thrust vector on the body frameF B and the torque vector  B as:

Translational and Rotational motion

The Newton Second Law of motion is described as:

Applying total force on the Earth frame coordinate { }E , we have:

From (1.33) and (1.34), the linear acceleration  of the Earth frame { }E is:

In addition, the drone linear acceleration on the body frame { }B during hovering exerted by Coriolis force can also be calculated as:

Considering the vehicle is hovering and balancing in the air, all forces exert on the body is approximately equal  F E  F B , where:

From (2.36) and (2.37), the linear acceleration on the body frame { }B is simplified as:

T B z z m dV V T dt mg F u rv qv gS v pw ru gC S w qu pv gC C U m

From equation (1.18), applying rotational dynamic of a rigid body to find the moment exerted by external forces and rotational momentum of the drone in the Earth frame coordinate{ }E :

Where, is the gyroscopic effect caused by rotation movement of the propeller:

With J i [Kg m 2 ]is the total inertial moment about the propeller axis and  i [rad s/ ]is the total speed of the propellers

The axes in the Earth frame coordinate{ }E and the body frame coordinate { }B are positioned as the same so the angular momentums are approximately to be the same

Combining (1.40) and (1.41) equation, we can finally obtain the angular acceleration on the Earth frame coordinate { }E :

E yy zz i i xx xx zz xx i i yy xx xx yy zz zz

Similarly, we can apply equation (1.39) and (1.40) for the body frame, which is written as:

B yy zz i i xx xx zz xx i i yy xx xx yy zz zz

Finally, the total system dynamic model of the Hexacopter is obtained:

( ) z z z yy zz i i xx xx zz xx i i yy xx xx yy zz zz

Measurement and Navigation modules of the drone

IMU or Inertial Measurement Unit is an electronic device that measures and reports a body’s specific force, angular rate, and sometimes the orientation of the body, using a combination of accelerometers, gyroscopes, and sometimes magnetometers When the magnetometer is included, IMU are referred to as IMMUs IMU are typically used to maneuver modern devices including motorcycles, missiles, aircraft (an altitude and heading reference system), including Unmanned Aerial Vehicle (UAV) [11]

Nevertheless, a fundamental drawback of the IMU is its tendency to accumulate errors over time This issue occurs due to the continuous updating of changes recursively

Even expanded to minute errors, when accumulated, can lead to significant deviations, creating disparities between the calculated values and the actual system measurement values To make sure the precision of the measurement system, a solution involves incorporating anti-reference modules, such as open-source flight circuits These circuits are equipped with gravity-sensitive elements, velocity sensors, electronic compasses, GPS, play a crucial role in providing and correcting IMU values through calibration before each flight in arbitrary positions Additionally, the construction of the drone with protective covers is also implemented to avoid pressure disturbances caused by wind from the rotation of propellers [7]

An accelerometer is a tool that measures proper acceleration Proper acceleration is the acceleration (the rate of change of velocity) of a body in its own instantaneous rest frame; this is different from coordinate acceleration, which is acceleration in a fixed coordinate system For example, an accelerometer at rest on the surface of the Earth will measure an acceleration due to Earth's gravity, straight upwards (by definition) of g ≈ 9.81m s/ 2 By contrast, accelerometers in free fall (falling toward the center of the Earth at a rate of about 9.81 m s/ 2 ) will measure zero [12]

Figure 2-25: Static acceleration and dynamic acceleration on a ball

In figure 2.17, a model with a box in a shape of a cube with a ball inside it If we take this box in a place with no gravitation fields or for that matter with no other fields that might affect the ball's position – the ball will simply float in the middle of the box [13] Imagine the box is in outer-space far-far away from any cosmic bodies, or if such a place is hard to find imagine at least a space craft orbiting around the planet where everything is in weightless state From the picture above, it can be seen that we assign to each axis a pair of walls (we removed the wall Y+ so we can look inside the box) Imagine that each wall is pressure sensitive If we move suddenly the box to the left (we accelerate it with acceleration 1g = 9.8m s/ 2 ), the ball will hit the wall X- We then measure the pressure force that the ball applies to the wall and output a value of -1g on the X axis

Most of the accelerometers used on drone are electrical accelerometers embedded with different technologies such electromagnetic, capacitor and resistor to measure the acceleration For instance, the change of acceleration from the electromagnetic sensor will also change the electrical components using the small object wrapped by a coil This is referred as proof mass [7] When applying motion on proof mass, a current propagates through the wire causing an electromagnetic force from the inverse direction, determining the both direction and its magnitude However, there is always be an off-set on each embedded axes, causing error or value differences between the measurement values and the real values This will lead to an application of suitable filters to get the most accurate values

For Unmanned Aerial Vehicle, the angle rotation obtained from the Accelerometer is described into following coordinate system:

Figure 2-26: Angle rotation coordinate system from Accelerometer

Depending on the x y z , , axes to determine the Roll – Pitch – Yaw rotation angles

In the body frame coordinate { }B x B , y B , z B , the gravitational coefficients are

X = Y = Z = g By conversion into the Earth frame{ }E to obtained A x , A A y , z The matrix used to perform the relationship is expressed as:

 angle and  angle can be obtained as:

With S x =sinx, C x =cosx and A x , A y , A z is calibrated as A x 2 + A y 2 + A z 2 = 1

Gyroscope, also referred as “gyro” is a device used for measuring or maintaining orientation and angular velocity It is a spinning wheel or disc in which the axis of rotation (spin axis) is free to assume any orientation by itself When rotating, the orientation of this axis is unaffected by tilting or rotation of the mounting, according the conservation of angular momentum [14] Gyroscope based on other operating also exist, such as the microchip-packaged MEMS gyroscopes found in electronic devices (sometimes called gyrometers), solid-state ring lasers, fiber optic gyroscopes, and extremely sensitive quantum gyroscope

Figure 2-27: Gyroscope illustration with rotor and spin axes

A normal Mechanical Gyroscope consists of two main components: a rotor and a spin axis A gyroscope operation based on the gyro principle Applying the conservation of angular momentum, when rotating an object with a certain angular velocity, its rotating direction behavior is most likely stable The change of rotating direction is measured and being converted into electrical signal Due to high precision, the gyroscope is widely used in tracking system of military missiles or submarines However, these kinds of systems require complex measurement devices and expensively cost, heavy weights also lead to miscalibration

The Microelectronic Gyroscope, also known as the MEMS (Micro – Electro- Mechanical - Systems) gyroscope, relies on the principles of a mechanical gyroscope but is crafted on a miniature scale within a microchip using semiconductor technology This innovative device incorporates sensors, including electrodes or sensitive structures, to measure angular speed Its operation is rooted in the Coriolis effect and capacitance variation, which occurs when the object is in motion, enabling the calculation of angular speed or the rate of angular change Despite their compactness and seamless integration, MEMS sensors, often utilized in diverse fields such as autonomous vehicles, robots, and notably in drones, are occasionally plagued by challenges like lower accuracy and a phenomenon known as gyro drift To address these issues and enhance performance, employing a filtering mechanism to process the signals proves to be an effective solution

Figure 2-28: Illustration of MEMS vibratory Gyroscope

The values obtained from the Gyroscope are velocity and the direction of motion, rotation angle is not inherently allowed Therefore, it is essential to convert the angular velocity into angular magnitude through the process of integration over time The equation performing the change of angular velocity in Gyro is described as:

The angles which are obtained at current t time step is described as:

Euler Angles

The Euler angle method, invented by the Swiss mathematician, physicist, astronomer, geographer Leonhard Euler [15], serves to describe the orientation of a rigid body with respect to a fixed coordinate system This approach involves analyzing the rotation matrix as the composite outcome of three fundamental rotations By employing a fixed reference frame and executing three distinct rotations, the Euler angle method effectively characterizes any reference system in space These rotations typically involve two rotations around a fixed vertical axis, followed by the third rotation along the other two axes Classic Euler angles usually take the inclination angle in such a way that zero

32 degrees represent the vertical orientation Alternative forms were later introduced by Peter Guthrie Tait and George H Bryan [16] intended for use in aeronautics and engineering in which zero degrees represent the horizontal position

Figure 2-29: Classical Euler angle illustration

As described in Figure 2.21, the coordinate system { , , }x y z is constantly displayed with blue The coordinate system { , , }X Y Z is displayed with red The N line which performing the intersection between coordinate ( , , )O x y and ( , , )O X Y is displayed with green is the angle between the x axis and line N,  is the angle between z axis and

Z axis,  is the angle between line N and X axis Where and  has the value range between 0 to 2  radian and  has a value range between 0 to  radian

Considering describing the coordinate system with unit vectors ( , , )X Y Z , launching projected of Z vector as below:

From 2.22, it can be seen that: cos( ) =Z 3 (2.49)

Z 2is the double parameter of Z vector:

Similar to Y 3 , by projecting on the Z axis and the connected line N

  are described as angles between the planes:

Finally, using inverse cos sinfunction:

Ultra Wide-band system

Navigation refers to the process of planning, monitoring, and controlling the movement of a vehicle, craft, vessel, or an individual from one place to another The goal of navigation is to determine and maintain the desired course, position, and direction, typically with respect to a known or assumed location, such as destination or a set of way points

Figure 2-32: Navigation system on an Oil tanker on the sea

Navigation primarily handles with a feasible path from one location to another, encompassing the broader process of sending signal to a robot or a vehicle and guide it through the environment The components of navigation consist of localization, mapping and path planning while localization focuses on determining a robot or a vehicle’s position in the specific environment Mapping is the more advanced method by using algorithms or real measurements obtained from the environment to create, update recursively a representation of the map Path planning is a much more complex term of navigation which base on mathematic such geometry algebra and calculus to determine a safe and efficient path from the current location to the goal

Figure 2-33: GPS Navigation system on mobile robot

One of the most popular and recognizable navigation system nowadays is GPS, also known as Global Positioning System, a satellite – based radio navigation system owned by the United States government and operated by United States Space Force [17] It is one of the global navigation satellites systems (GNSS) that provide geolocation and time information to a GPS receiver anywhere or near the Earth where there is an unobstructed line of sight to four or more GPS satellites [18]

By receiving signals from at least three satellites, the GPS receiver can perform triangulation This involves establishing intersecting spheres around each satellite, where the spheres' intersections represent potential locations for the receiver The fou rth satellite is crucial for refining this position in three-dimensional space and determining the receiver's altitude, creating a more accurate and comprehensive fix The entire process relies on the speed of light for precise timing measurements As the signals travel at the speed of light, the GPS receiver can convert the time delay of each signal into an accurate distance measurement This collected distance data is then used to compute the precise location of the GPS receiver through intricate mathematical calculations

Figure 2-35: Location determination using Triangulation method

GPS does not require the user to transmit any data, and operates independently of any telephonic or Internet reception, though these technologies can enhance the usefulness of the GPS positioning information It provides critical positioning capabilities to military, civil, and commercial users around the world Although the United States government created, controls and maintains the GPS system, it is freely accessible to anyone with a GPS receiver [19], which is nowadays mass of GPS receivers are integrated on smartphone devices

Ultra-wideband is a high data rate, low power short-range wireless technology that utilizes a broad range of frequencies to transmit data over short distances with high precision Unlike traditional wireless communication with high-speed alternative to existing wireless technologies such as IEEE 802.11 LAN, HomeRF, HiperLANs,…This technology has generated a lot of interest in the research community and the industry since it is capable of spreading its signal across a vast range of frequencies and even reaches up to Gigahertz Despite being relatively recent in the realm of wireless communications, UWB has swiftly become a preferred choice as a study field of indoor navigation

Figure 2-36: Ultra Wide-band technology

Ultra Wide-band is a technology for transmitting binary data across a wide bandwidth (>500 Mhz) This allows for the transmission of a large amount of signal energy without interfering with conventional narrowband and carrier wave transmission in the same frequency band Regulatory limits in many countries allow for this efficient use of radio bandwidth, and enable high-data-rate personal area network (PAN) wireless connectivity, longer-range-low-data-rate applications, and the transparent co-existence of radar and imaging systems with existing communication systems [20]

Figure 2-37: UWB application on drone

Due to very low power and high bandwidth, Ultra Wide-band (UWB) is ideal for delivering a lot of data from a transmitter to other devices By sending pulses in patterns, UWB encodes information [21] Which often takes between 32 and 128 pulses to encode a single bit of data, but given how fast the bits arrive, that enables data rates of 7 to 27 megabits per second Therefore, UWB can handle more bandwidth-intensive applications like streaming video, than either 802.11 or Bluetooth because it sends data at much faster rates UWB technology has a data rate of roughly 100Mps, with speeds up to 500 Mbps, this compares with a maximum speeds 11Mbps for 802.11b (often referred as Wi-Fi), which is the technology used in most wireless LANs, and 54Mbps for 802.11a, which is Wi-Fi at 5Mhz Bluetooth has a data rate of 1 Mbps

Figure 2-38: Ultra Wide-band Power Spectral Density comparison

Comparing with other wireless communication, Wi-Fi and Bluetooth operate within narrower frequency bands When navigation or positioning involves, enabling precise location in diverse scenarios is crucial While Wi-Fi provides medium-range coverage suitable for indoor and limited out door environments, Bluetooth can only be designed for

38 short range wireless applications with very low power Both of these signals are unstable whether their applications are indoor or outdoor In contrast, UWB operates in short range but at very high frequency, allows it enough to penetrate through obstacles and even with NLOS (Non light of sight) effect, its precision still up to centimeters if the calibration was precisely well done Similar to UWB, GPS system also communicate to an integrated GPS receiver using radio signal transmitting from the satellites To measure a moving GPS receiver tag from a hundred thousand of meters from space, errors and noises occur are unavoidable no matter how many noise filters are implemented to give out the most accurate position Therefore, GPS can only be used for outdoor and can not be determined for indoor position or referred as GPS denied environments

Figure 2-39: Comparison of UWB to other wireless communication signals

In essence, over the past two decades, UWB has found applications in various fields, showcasing its versatility and adaptability Initially employed in areas such as sensing, military communication, and localization, UWB has demonstrated its prowess in delivering high-speed data transmission while consuming minimal power The unique characteristic of UWB comes from its ability to utilize a broad spectrum of frequencies, enabling the transmission of data over short distances at an exceptionally high rate This attribute makes UWB particularly suitable for scenarios demanding high data throughput within constrained ranges, such as in sensor networks, navigation, military operations, and precise localization systems a) Real-time location

Real-Time Location system or in short as RTLS refer to technologies that are used to automatically identify and track the location of objects or people in real-time within a building or other contained area Wireless RTLS tags are attached to objects or worn by people, and in most RTLSs, fixed reference points receive wireless signals from tags to determine their location [22] Examples of real-time locating systems include tracking automobiles through an assembly line locating pallets of merchandise in a warehouse, or finding medical equipment in a hospital [23] In the term of Ultra Wide-band, due to its operation at very high range of frequency, this technology is used for tracking moving objects such as humans, vehicles and robots And because the precision of this embedded RTLS technology up to centimeters, UWB has become a common tracking system for indoor environments

Figure 2-40: Drone tracking using an Ultra Wide-band anchor in warehouse b) UWB Calibration

Calibration is a process used to ensure the accuracy and reliability of measurements or instrument readings by comparing them to a known standard The goal of calibration for Ultra Wide-band is to minimize or eliminate any discrepancies between the range measurements from anchor to anchor and from anchors to the tag in vice versa and the actual values of quantity being measured

Assuming that an Ultra Wide-band (UWB) that has a range r has been obtained, which can be modeled as a simple linear function of the true distance d More precisely, if we take into account the zero-mean random error  , then the following linear equation of calibration can be described as: r ad b = + +  (2.54)

The calibration problem is to estimate d from the range r The most classical approach is adopted for the calibration, which firstly regresses the instrumental response r on the manipulated variable d and then solves for d Specifically, given n samples

Kalman Filter

Kalman Filter is a mathematical algorithm that uses a series of measurements observed over time, containing statistical noise and other inaccuracies, and produces estimates of unknown variables that tend to be more precise than those based on a single measurement alone The filter is named after Rudolf E Kálmán, the primary developer of its theory, the Kalman Filter has become a fundamental tool in the field of control systems and time series analysis [26]

Figure 2-46: True position applied Kalman Filtering

The Kalman Filter is an iterative process that estimates the state of a dynamic system from a series of incomplete and noisy measurements It is recursive, meaning that it can run in real-time using only the current input measurements and the previously calculated state and its uncertainty matrix; no additional past information is required

The general formula of Kalman Filter prediction step is given by: ˆ 1 k k k k k

Where X ˆ k is the state vector at time step k , X k − 1 is the state estimate vector at the previous time step k − 1.A k is the state transition matrix, describes how matrix evolves from the previous time step to another without any control or noise.B k is the matrix that describes how the control input U k changes from the previous state to the current state  is the process noise

The general measurement model or referred as observation model of the Kalman Filter is given by: k k k k z =H X +v (2.71)

Where z k is the actual measurement of state vector X k at time step k H k is the noiseless connection between the state vector and the measurement vector, which is assumed stationary overtime v k is the error obtained during measurement

The State model Covariance matrix, which describe how strong the relationship between the input variables is given by:

P k is the predicted covariance, A k − 1 is the previous transition matrix of the previous time step k − 1, A k T − 1 is the transpose matrix of A k − 1 which ensure to keep covariance matrix in symmetric form, this is crucial for maintaining the positive-definite property Q k − 1 is the process noise

The estimation step or usually referred as correction and update step, is used to compute recursively the new data given by the previous data To update and correct, the Kalman Gain need to be obtained as follow:

48 whereK k is the Kalman gain, P k * is the predicted covariance matrix, H k T is the transpose of the Jacobian matrix

Next is the correction step which will update the new state:

The new stateX k is updated by using the predicted state X k * , and the Kalman Gain multiply with(z k −H X k ˆ k * ), which is the subtraction between the linearization value and the measured value from measurement model

The new covariance matrix also need to be updated, which is given by:

Where I is an identity matrix, and P k * is the predicted covariance matrix.

Fuzzy PID Controller

PID controller, which stands for Proportional-Integral-Derivative controller, is a type of feedback control system widely used in industrial automation and process control It is designed to regulate a system's output by continuously adjusting the input based on the error between the desired setpoint and the actual output

The proportionate step, alternatively called the gain, modifies the output value in correlation with the current error Refinement of this proportional response is achieved by multiplying the error with a constant, known as the proportionality coefficient K P

The integration step, also referred to as reset, is directly related to both the amplitude of the error and the duration for which the error persists Accumulating the total error over time (error integration) provides a previously calibrated compensation accumulation This accumulated error is subsequently multiplied by the integration gain and added to the controller output signal The magnitude of the integration stage is dictated by the integral gain K i

The differential step represents the rate of change of the systematic error, determined by calculating the slope of the error concerning time (i.e., the first derivative with respect to time) This speed is then multiplied by the proportional gain K P The magnitude of the differential step is constrained by the differential gain K D

A fuzzy controller is a type of control system that uses fuzzy logic to emulate human decision-making processes Unlike traditional control systems that rely on precise mathematical models, fuzzy controllers handle imprecise and uncertain information by employing linguistic variables and fuzzy sets Fuzzy logic allows for a more flexible and natural representation of knowledge and reasoning

Fuzzy controller uses fuzzy sets to represent membership functions that describe the degree of membership of an element in a set Linguistic variables, such as "low,"

"medium," and "high," are defined to describe input and output variables in a way that is understandable and relatable to human language Fuzzy controllers operate based on a set of fuzzy rules that express relationships between input and output linguistic variables These rules are typically in the form of "if-then" statements, where the "if" part involves fuzzy conditions and the "then" part specifies fuzzy actions

The final step in a fuzzy controller is defuzzification, where the fuzzy output is converted into a crisp, non-fuzzy value that can be applied to the controlled system Various methods, such as centroid defuzzification, are used for this purpose

A Fuzzy – PID Controller is a controller that combined the principles of both Fuzzy logic and PID (Proportional – Integral – Derivative) controller This combination integrates the adaptability of fuzzy logic with the structured control mechanism of PID controller to improve the performance of the control system for various applications

Fuzzy – PID Controller is commonly employed to handle complex and non-linear system, which Proportional – Integral – Derivative gains are fine-tuned using Fuzzy Logic principle to achieve an optimal result The fuzzy PID controller is also able to tolerate many poor selections or inadequate implementations of the controller gains which would make most conventional controllers unstable [27] Since nonlinear effects will be encountered in many complex systems, such as robotic manipulators, the ability of the fuzzy PID, etc.

ESP32 Platform

The ESP32, developed by Espressif Systems, represents a family of chip microcontrollers known for their versatility in embedded systems These microcontrollers stand out due to their notable features, including robust wireless connectivity, high-speed processing capabilities, low power consumption, expansive memory, and integrated security

ESP32 has strong wireless connectivity, allowing seamless communication via protocols such as Wi-Fi and Bluetooth This feature makes it suitable for a wide range of applications, from Internet of Things (IoT) devices to wireless sensor networks Beyond its connectivity prowess, the ESP32 excels in high-speed processing, efficiently handling complex tasks This capability is particularly valuable in applications that require rapid data processing and execution ESP32 is also distinguished by its low

51 power consumption, a critical feature for devices relies on batteries This characteristic extends the life of devices and facilitates their use in scenarios with limited power resources Moreover, the ESP32 provides extensive memory, this attribute proves advantageous for applications involving large datasets or complex algorithms

In summary, the ESP32's combination of wireless connectivity, high-speed processing, low power consumption, extensive memory, and integrated security positions it as a versatile and powerful solution for a broad spectrum of embedded systems and IoT applications Its adaptability renders it a preferred choice among developers and engineers seeking efficient and reliable microcontroller solutions

MODEL DESIGN AND CONSTRUCT

System overview

The system includes two components:

Our team using a PC to receive and collect data sending from the Hexacopter through Wi-Fi signal and Radio signal The ESP32 – Wrover DevKit from ground station transmitting Wi-Fi signal to receive the data sending from the Hexacopter model’s ESP32 Two Ultra-Wide-band modules DWM1000 communicate with each other through Radio signal measure the distance The collected data is then gathered by the ESP32 connected to the PC system

The ESP32 onboard the Hexacopter is responsible for gathering data from various sensors, including the IMU – MPU6050 This IMU is equipped with a compass sensor for direction detection, an accelerometer for monitoring the drone's altitude, and a barometer for altitude measurement Communication between the Hexacopter and the ground control station facilitates the transmission of this collected data Furthermore, the Electronic Speed Controller (ESC) receives signals from the ESP32 to regulate the speed of the brushless rotors This communication ensures precise control over the rotational speed of the rotors, a critical aspect for managing the flight dynamics and stability of the Hexacopter

Six rotors are main components for drone flight operation The change of its help the Hexacopter move and change its altitude whenever it is needed

In summary, the system comprises two primary components: the Ground Control Station and a Hexacopter model The ESP32 and DWM1000 serve as the main communication devices responsible for data collection, while Electronic Speed Controllers (ESCs) and brushless rotors govern flight operations The integration of these components forms a cohesive and comprehensive drone system.

Hexacopter model design

The Hexacopter design expectation is described in the following table:

Table 3-1: Design expectation for the Hexacopter

2 Total mass From 1.5kg to 2.0kg

With the recommendation that the Hexacopter has the mass around 1.5kg to be able to fly The table below describes the mass of each component on the Hexacopter:

Table 3-2:Mass estimation for the Hexacopter

In order to have precise selection of propellers we researched on Internet and found an in-dept, trust-worthy and popular website calculator The website provided static thrust calculator This helped us understand how much force, efficient the propeller is when using correct parameters

The Hexacopter is using 9 inch, 2 blades of the total of 6 propellers With the number of 6, the Hexacopter with the takeoff weight roughly 2kg, we have the Thrust/prop:

Figure 3-3: Thrust vs Rotation per minute – RPM

From Figure 3.3, the minimum for the drone to hover or to take off is 0.3kgs or 6600rpm which quite easy to get with high KV motor This part also associates with selection of motors After reading recommendation from the producer, we decided 9inch and 4’ pitch would be appropriate in this project

The selection of ESCs is determined how good compatibility with the motors, which is described in the following figure:

The power of the motor is calculated as:

Substituting with 30A load condition and 10A no-load condition, K v =1.4 We have the power of motor: P = 9.5511 kW The max thrust is 2.75kg under normal condition is already way above the minimum the weight to hover Which is 1.8kg

After researching, experts claimed the higher KV motor is more suitable for race drone to maneuver, quick turn and low KV motor is efficiency and stability which is main aim of the project The lowest KV motors that we can have in current market with suitable price is 1400KV

Esc selection is based the current that is needed under load condition The below is for 980KV but you can show what assume the current needed for 1400KV The drone only needs > 400gf per motor for it to hover Hence, we assume under-load the esc must capable of drawing more than 10A

At the end, we chose the cheapest Esc on the market since we don’t need more And this Esc also provide BEC or simple a voltage source that is deducted from lose power of Esc from exceeded heat The BEC could provide the power for our main MCU circuit

Figure 3-6: KeyiuaV Esc 30A ESC - Electronic Controller

3.2.5 Battery selection and flight time

With the discharge rate of 50C the maximum current that motor can draw is 5( ) 50A  C%0A The main reason you would pick this battery over smaller ones is the 5000mAh it means the battery can output 5000mA in one hour before it depletes Which the second highest mAh you can find in the market for 3S (3 cells) Lipo battery

Our second options is a smaller battery that is much more cost efficient and lighter than the GNB 5000mAh The GNB in theory can provide 2-3 more minutes of time-flight but in exchange it costs the stability of the drone Since it’s hard to properly place the battery at center of weight of the drone Hence, at the end in practice we chose to use this battery

The flight time calculation is done below:

In order for the drone to hover and take off motor needs to draw at least 6A So 6 motors need 6  = 6 36 A The battery provides 60 5  = 300 A m / Hence the flight time is:

The battery flight time meets the requirement in the design section.

Balance testing kit design

The balance testing kit is used for tuning PID parameters in order to achieve the most optimal PID for Hexacopter balancing:

Figure 3-9: Balance testing kit overview

Figure 3-10: Balance testing kit - Front side

Figure 3-11: Balance testing kit - left side

Hexacopter frame design

The model of Hexacopter is based on DJI - F550 is designed in SOLIDWORKS:

Figure 3-12: Hexacopter 3D Model; a) Overall view; b) Front view; c) Top view; d) Bottom view

The Hexacopter body frame is crafted from two primary plates intricately linked by the six arms, forming a structure that also delineates an open space within for accommodating microcontroller applications This design is meticulously fashioned to achieve a harmonious blend of solidity, simplicity, balance, and cleanliness

Figure 3-13: Hexacopter body frame size Table 3-3:Hexacopter body frame parameters

Figure 3-14: Hexacopter body plates – a) Top plate; b) Bottom plate

Arm, Propellers and Landing gear

The components that determine the dynamic and aerodynamic of the Hexacopter is the length of the Arm and the shape of the propeller The arm is based on DJI F550 arm model, with the size of 270mm

Figure 3-15: Hexacopter arm - a) White arm; b) Red arm

The propellers have the length of 9 inch, the mass of two blades are equal for stable during thrust exerted by aerodynamic effect, suitable for 1400KV brushless motors

The landing gear helps the Hexacopter stand and landing Its design is solid and stable due to the four rods are tightly connected and exerted with same force whenever operating landing impact

The final model of the Hexacopter is as below:

- Communications: UART, SPI, I2C, GPIO pins, USB to UART

- Wi-Fi: @2.4GHz to 150Mbit/s

- Quiescent current: smaller than 2mA

Wiring diagram

The system is designed with a battery as the primary power source, supplying voltage to six Electronic Speed Controllers (ESCs) via a Power Divider PCB These ESCs, responsible for motor speed control, are also linked to an ESP32 This connection enables the ESP32 to transmit signals to the ESCs, influencing the speed of attached brushless motors When speed adjustments are made on the ESP32, the signal undergoes conversion into pulses These pulses are then directed to the brushless motors for testing purposes Additionally, the Battery Eliminator Circuit (BEC) serves to return regulated voltage back to the ESP32, ensuring stable and reliable power for the system The overall configuration is intended for rotor and flight testing, potentially in the context of drone or aerial vehicle applications

IRQ SCK MISO MOSI CSN EXT WAKE

Figure 3-21: ESP32 - DWM1000 Wiring diagram

The following diagram illustrates the port connection from the ESP32 to the UWB module DWM1000 The module is supplied by 3.3V stable pulse, while the other ports are connected in order to provide communication between the ESP32 Data are retrieved and transmitted through these ports, such as distance measurement or time of arrival measurement

CONTROLLER DESIGN AND SIMULATION

Hexacopter controller overview

The controller structure for the Hexacopter model is described as below:

Figure 4-1: General Controller of the Hexacopter Table 4-1: Symbols of general controller structure in Hexacopter

   Setpoint of Roll, Pitch, Yaw

  , , Process value of Roll, Pitch, Yaw

1, 2, 3 d d d Distances from anchors to tag

PWMs PWMs of voltage output

The setpoint X Y Z are set by the user so the Trajectory controller can send out the setpoint of Roll, Pitch and Yaw From Drone the sensor IMU feedbacks process values of three Euler angles to calculate the error

The main function of Stable Controller is stabilizing the drone or make the Euler angles errors small as much as possible By generating control output using to the Hexacopter

The UWB (ultrawide-band) is a separated block from the Hexacopter It has its own MCU and is used for measuring the distances from each anchor (immobile target) to the tag (mobile target)

The localization is a block where the process values of X, Y, Z are measured using distance algorithm Then the process values are feedbacked to Trajectory Controller

The Hexacopter receives control output form Stable Controller and apply PWMs technique to the ESCs

Controller design

The PID controller is well-known for its effectiveness and non-complicated implementation The controller is widely used in industry (up to 90% of practical application) With the simple algorithm, precise control we chose and implement this controller in our project

Figure 4-2: PID Controller diagram in system

The diagram PID in discrete form can be demonstrated using Forward-Euler method as below:

Figure 4-3: Block diagram of a discrete PID system

The mathematic algorithm is given as below:

The discrete PID Controller is constructed base on Backward Euler method and Trapezoidal method, which is given by:

Transforming into discrete domain and z domain:

The same goes with the error, and we have the D term:

Trapezoidal transformation of integral term:

Then we have integral term in z domain:

Substituting (4.5), (4.7 ) and (4.9) into (4.4) we have the general form of discrete PID:

Applying basic algebra, we have:

Set up variables:  = 2 TK P + T K 2 I + 2 K D ,  = T K 2 I − 2 TK P − 4 K D ,  =2K D

In conclusion, we have the general form of PID discrete:

In practical applications, the primary objective of employing PID control lies in the meticulous tuning of PID parameters The widely adopted and highly efficient approach involves manual tuning, drawing inspiration from the Zigler method Through careful selection of optimal parameters, the system achieves stability and minimizes errors to the greatest extent possible

The Altitude controller of the Hexacopter helps maintain and stabilize the Hexacopter’s Roll – Pitch – Yaw angles

Where, the angles error between the set point and the feedback from state calculation unit are: d feedback d feedback d feedback e e e

Figure 4-4: Block diagram of Fuzzy-Stabilization PID controller

The Fuzzy Controller takes the height of the Hexacopter as its input, which is characterized by five distinct membership functions These membership functions have been visually represented using the Fuzzy Logic Controller toolbox in MATLAB, providing a clear and convenient means of illustration

Figure 4-5: Input member ship function

The configuration of the membership functions is derived from our practical experience with the overall speed of the Hexacopter Notably, the drone exhibits ample force to reach itself at approximately 30 cm In scenarios such as landing, the membership functions V_Low or V_Average are specifically chosen The active operational range of the Hexacopter spans from 30 cm to 35 cm

Output membership functions are constant or simpleton function:

Kp_1 Kp_2 Kp_3 Kp_4 Kp_5

Using Sugeno defuzzification, the output membership functions have to be a singleton or a constant With 8 different height values as input, we also have 8 memberships, each for 3 outputs

Based on the equation and substituting all output of membership functions we have:

_ _ medium s high high medium s high high low s medium

Kp Kp Kp Kp Kp y     

The formula goes the same with the Ki, and Kd parameters

Controller Simulation

Appling the equations from section we set up Simulink blocks

Figure 4-7: Trajectory controller block diagram

Figure 4-8: Control input into RPM and Hexacopter model

The position PID controller take input setpoint x, y and their process values After calculating it outputs the desired angle

The response indicates system has approximately no settling error and overshot The rise time is roughly 17 second which is totally acceptable with no overshot Moreover, with different step setpoint the system instantly reacts and settle

The overall response of Y position is worse compared to X position The rise time is much higher at 38 second When we changed the setpoint the rise time and settling time even got even worse The main major strong attributes of both response is the settling error is extremely low

The response of Z position had really high overshot (100%) and fluctuated a lot around setpoint But in return, it also met the settling time much quicker than other responses

Additional to the response of the position, the error also need to be consider, here are the plot of error for each positions

The response X error show literally 0 error and the system keep at settling state after reach settling value

The response Y error show literally 0 error and the system keep at settling state after reach settling value

Also with the altitude response:

Figure 4-14: Roll angle - Theta response

In order to meet the X position setpoint, the roll setpoints are little bit extreme Certain period of time when the drone can’t keep up the setpoint (the 0.4 -> -0.4) But the rest of response time seem acceptable to the requirements It still could maintain roughly 2% overshot

Figure 4-15: Pitch angle - Phi response

In order to meet the Y position setpoint, the pitch setpoints are little bit extreme Certain period of time when the drone can’t keep up the setpoint (the 0.4 -> -0.4) But the rest of response time seem acceptable to the requirements The overshot is slightly worse than Roll roughly 10%

Figure 4-16: Yaw angle - Psi response

The yaw angle is the easiest in three Euler angles to tune in real life and in theory with least rise time ~7 seconds, practically no settling error and not overshot make this response the most ideal among others

ULTRA WIDE-BAND SYSTEM DESIGN

Ultra-Wide-band system overview

This chapter dealing with the design and real-world testing of an Ultra Wide-band system The experimentation is tested on two dimension systems, 2D system and 3D system The 2D system is employed with 2 anchors and one tag, primarily using the Cosin and Pythagorean theorem The 3D system is similar to the 2D system but added with a bit more complexity, which the calculation involves both Geometry and Algebra method In the 3D system setup, 3 anchors are configured and being formed into a perpendicular triangle, while the tag traverses in the coordinate system The demonstration on the two systems is represented below

5.2 2D Ultra-Wide-band localization system

The 2D Ultra-Wide-band system is described as: a) b)

Figure 5-1: Ultra-Wide-band 2D System design – a) Geometry system; b) Real world testing system

The figure a) describes the 2D system in geometry sketch Since the system is 2D, the tag which is denoted asHcan only traversing in the OA plane without the height Before experimenting on the real drone, we need to verify the position obtained from the tag Considering OO H 1 and AO H 2 , we have OH and AH can be calculated using Pythagorean theorem as:

After obtaining the value of OH and AH , applying the Cosin theorem on OAH yields:

OH OA AH arc OH OA

Then, the position in of the tag H, which is specifically P x and P y can be obtained as follow: sin( ) cos( ) x x y y

The 3D Ultra Wide-band system is described as a) b)

Figure 5-2: Ultra Wide-band 3D System design – a) Geometry system; b) Real world testing system

Away from the 2D system, the 3D system is designed with another anchor which forms the system as a perpendicular triangle The figure (5.3) a) can be simplified as:

The moving tag H is projected to the surface, which results in the point Q x y z( , , )

P x is the position of the projected tag in the x direction, P y is the position of the projected tag in the ydirection d 1 h ,d 2 h and d 3h are the distances measured from the three anchors to the tag, respectively

Considering the triangles O QP 1 y and O HQ 1 , which can be seen that the d 1h distance is calculated using Pythagorean theorem:

Applying the same Pythagorean theorem on the O QP 2 y and O HQ 2 , yields:

The (1)(2)(3) expressions can be combined into a system of equations, which is given by:

By arranging sides of the first equation, we have:

Substituting (5) back to (3), we have:

O O QP O O QP h d d h QP O O QP h d d h QP O O O O QP QP h d d O O O O QP d d O O d

After obtaining P x and P y It can be seen that O Q 1 is formed by Pythagorean theorem Considering the O HQ 1 triangle, the height HQ is finally be achieved as:

The final set of equation for the 3D localization can be summarized as:

EXPERIMENTING AND RESULTS

Hexacopter controller experimenting

This section describes how PID controller and Fuzzy PID controller is implemented on the Hexacopter for stable balancing The figure (6.1) describes the Hexacopter being attached to the balance testing kit, which we used for tuning most optimal PID gains to achieve equilibrium status on the Hexacopter

Figure 6-1: Hexacopter testing on the balancing kit

To achieve control and stability in a Hexacopter system, it is essential to employ a controller The PID controller emerges as the prevalent choice for maintaining equilibrium in systems like drones However, for complicated model such as a Hexacopter, the process of attaining optimal parameters for balance is time-consuming yet highly effective The following figure illustrates a drone undergoing tuning on a balance testing kit

Step 1: Retrieving data through the variable address using pointer

Step 2: Calculating the setpoint error

Step 3: Calculating P gain using Error x Kp

Step 4: If the millisecond function is over 10ms, calculate the K gain base on previous Kd x error

Step 5: Calculate the I gain by using Ki x output

Step 6: Calculate the output using the sum of P gain + I gain + D gain

Through tuning the Proportional – Integral – Derivative gains, we have achieved some specific results during testing on the PID controller

Figure 6-3: PID Controller - Roll angle response

Figure 6-4: PID Controller - Pitch angle response

Figure 6-5: PID Controller - Yaw angle response

Due to the performance from balancing the Hexacopter using PID controller, it can be seen that the data collected from the real model is most likely stable Since we made a setpoint equals to 5 degrees in order to evaluate the PID controllers, some specific standard recommendations still have not met For instance, in the figure (6.2), the Roll angle is somewhat reached over 10 degrees, which is more than 100% overshoot and the improvement is limited to 80% overshoot, 20 percent lower than the first performance The Pitch angle demonstrates greater stability than the Roll angle, exhibiting less overshoot and sustained proximity to the setpoint over time Yaw angle tuning proves comparatively more straightforward In general, the three angles being controlled by th e PID controller enable the Hexacopter to maintain balance in a specific direction

During our experimentation, a substantial amount of time was dedicated to fine- tuning the PID parameters for optimal performance However, we observed a slight variance when deploying the drone for testing in real-world conditions More specifically, our observation led us to assert that the height of the Hexacopter during takeoff experiments depending on the most optimal PID gains In other words, the Hexacopter's ability to achieve and maintain equilibrium in the air is influenced by the Aerodynamic force Different rotor speeds corresponding to different PID optimal gains, particularly during critical phases such as takeoff, hovering, and landing These actions require the use of the most suitable PID gains to meet the performance requirements Consequently, we have decided to evaluate the drone using a new controller that employs a fuzzy logic system to optimize PID gains—the Fuzzy PID Controller

Step 1: Check if throttle is changed

Step 2: New throttle value new is assigned as input for Fuzzy function

Step 3: Nuy measurement or degree membership of input value

Step 4: Output of Fuzzy is measured from Sugeno Average Weight of Sum method Step 5: P gain, I gain and K gain are outputs of Fuzzy and set as new PID parameters

By applying the Sugeno method as outlined in formula (4.17) in chapter four, we can compute PID gains within the fuzzy range based on the optimal PID gains obtained through tuning for the PID controller This approach enables us to enhance the stability of

85 the Hexacopter in both balance testing and flight testing Below are some of the experimental results we have obtained while testing the Hexacopter with the Fuzzy-PID controller during the balancing phase

Figure 6-7: Fuzzy PID controller - Roll angle

Figure 6-8: Fuzzy PID controller - Pitch angle

Figure 6-9: Fuzzy PID controller - Yaw angle

The data plots retrieved from the Hexacopter performance on balancing using Fuzzy PID controller yields improved result Where there is a reduced overshoot on the Roll angle and more stable during rotation when changing the setpoint from 5 degree to -5 degree Additionally, testing on the Pitch angle to rotate from 10 to -10 without resetting it to zero produced a favorable angle response However, the yaw angle from Fuzzy PID does not show much difference comparing to the response from PID controller

6.1.3 PID and Fuzzy PID response comparison

Since the balance testing on the test bench does show specific results, we want to examine the two controllers to see how different they would change if they’re ready for flight test Therefore, we set up the hovering test to observe their differences Here are the results that what we have obtained during experimenting a) b)

Figure 6-10: Roll response comparison - Hovering test a) b)

Figure 6-11: Pitch response comparison - Hovering test

Figure 6-12: Yaw response comparison – Hovering test a) b)

Figure 6-13: Altitude response comparison – Hovering test

The above results are obtained during the hovering test experiment, where we decided to set the Hexacopter flight up from the ground The height can be adjusted from

30 cm to 60 cm It can be clearly seen from the graph that response from each of the angles comparing PID and Fuzzy PID are mostly related, both controllers are stable during flight through observation process Beside roll angle and pitch angle from the two controllers, yaw is also does not considerable much since the Hexacopter behavior of rotating around the yaw angle is fine-tuning The problem which is the main cause involves in this comparison test is the altitude From what we have experimenting so far, when controlling the Hexacopter with the PID controller and raise the altitude above 60cm, the Hexacopter

88 began to shake, with a lot of overshoot and fast response in order to set it back to the equilibrium state as fast as possible, causing the system to be unstable In the fig (6-13 (a)), the Hexacopter with PID controller is not stable when we increase the height over 60 cm

We have analyzed the problem and Aerodynamics is the external uncertainty The Hexacopter from different heights generates different aerodynamics as well as most optimal PID parameters at that state If the Hexacopter keep being unstable, errors will be accumulated and the Hexacopter is no longer reach it balance unless we decrease the height to where it is already fine-tuned Therefore, using Fuzzy PID controller does improve the stable state of the Hexacopter within the altitude section.

Ultra-Wide-band localization experimenting

Step 1: UWB start up, check SPI connection is ready

Step 2: User set Antenna Delay to have better accurate measurement

Step 3: In loop function UWB is checked if is it ready for transmitting message

Step 4: If it’s ready UWB anchor will transmit a message to a tag and start time counter Step 5: UWB tag receives the message and transmit message back to anchor

Step 6: UWB anchor receives the message again and calculate the total Time of Flight

Step 7: The distances are measured

Step 8: Px and Py are measured from 3D localization

To prove that the position obtained from the 2D system is correct, we have employed the system in the real world by setting up the position and measure the distances from each UWB from the anchors to the tag

Figure 6-15: 2D UWB system set up in real world

The system is positioned on the floor where each of the square has the length of

30cm The real length of O O 1 2 , from anchor 1 and anchor 2 is 9 squares, which equals to the length of 270cmin the y axis direction The x axis has the length of 4 squares, which equals to 120cm From this, it can also be seen that the true distance of P x and P y are 60cm and 90cm,respectively

The height of the two anchors attached the two tripods O 1 and O 2 are set to be

100cm The height of the tag attached with tripod H is set to be 80cm.By ignoring the heights of the tripods which we used to set up two anchors and one tag in the (5.2) figure The system is brought from figure (5.1 (a)), the subtraction height applied on OO 1 and AO 2 are now 20cm

Using the geometry in the (5.1 (a)) figure, we can express the parameters as:

OO = cm, AO 2 cm, O O 1 2 =OA'0cm The measured distances from the tag to each anchors are d 1 h cm,d 2 h 0cm, respectively Applying the Cosin theorem from (eq), we have:

Then the position P x and P y is obtained:

Comparing with the true distance P x `cm,P y cm The error between the calculated P x and P y based on the Cosin theorem are 8.7563[cm] and 12.9314[cm], respectively

The 3D system computation is similar according to the 2D system, but involves with the height The given image describing the 3D system is as follow:

Applying the final equation which have been obtained from chapter 5, we have:

The following parameters substituted for the set of equations are:

O O = cm, O D 1 cm, O E 2 cm, O C 3 cm, O O 2 3 '0cm The measured distances from the tag to each anchor are d 1 h cm, d 2 h 3cm,d 3 h 0cm respectively The result for the localization for the following 3D system is: P x 758, 56.8566

P y = , HQ0.758(the height is already added with the length of the anchor) Comparing to the real distance QP x cm,QP y `cm, HQ0cm The error between the measured values and true values are: 4.578, 6.8566 and 10.758 respectively

This section is the results of localization computation retrieving from the real data measurements Therefore, we have set up some points on the ground from the reality and retrieved the data through moving a mobile tag traversing inside the indoor space that we have set up as follow:

Figure 6-17: Real world localization system set up

The real world data parameters are: anchor’s length: OO 1 0 cm, this also applied for anchor 2 and anchor 3 The distances measured from the each anchor from 1 to

3 to the tag are d 1h , d 2h and d 3h respectively By obtaining the given following data, the

P x ,P y and the height of the tag which is considered as HQ in chapter 5, equation number (), can finally be obtained The diagram demonstration of the real system is described as below:

Figure 6-18: 3D localization system simplified diagram

To verify the localization while the tag is moving inside, we have setup points in order to measure how close and precise the UWB operating as a tag transmit and receive during movement in the provided space The given set up coordinates on the system are illustrated as follow:

Figure 6-19: Points coordinate on the system

The points which given for the localization set up are: A(1.2, 0.9); B(2.7, 0.9); C(2.7, 4.2); D(1.2, 4.2), the unit is meter and a rectangle is formed from these points Additionally, the distances measured from the tag to each of the anchors are also be obtained as d 1 h , d 2 h and d 3h in order to calculate the position of the mobile tag with the coordinate of (P P x , y ).The experiment data on rectangle path planning is retrieved and being demonstrated in the following graphs a) b) c) d)

Figure 6-20: a) d distance measured from Anchor 1; b) 1h d distance measured from 2h Anchor 2; c) d distance measured from Anchor 3; d) Rectangle path planning 3h

Due to the change of temperature of the indoor environment, the signals received from the UWB is affected by the noise Since the change of the temperature directly causes the misreading of transmission of signal, leading to slow receive and delay, noise and NLOS effect occurrence is unavoidable Additionally, the magnetic permeability effect due to the heaviness of metals and magnetic field environment does also cause significant impact on the radio frequency signal since it is very sensitive to electronic devices or metal

94 machines The plots of the mobile tag moving in the rectangle and the triangle path affected by the noise are given by these figures: a) b) c) d)

Figure 6-21: a) d distance measured from Anchor 1; b) 1h d distance measured from 2h Anchor 2; c) d distance measured from Anchor 3; d) Rectangle path planning (noise) 3h

The path formed from the given tag indicates the true direction when moving the tag in a rectangle path within the 3D system Since the experiment happens in the indoor environment, non line of sight (NLOS) effect is usually the main factor that affects the system performance The misreading of data that being sent from the tag to the anchors is delayed, also with the change of temperature, the signal transmission speed is also considerably influenced It can be seen from the Fig (6-17 (d)) that the path is not follow as near as the given path as in Fig (6-16 (d)) Although the Kalman Filter is applied for filtering the true distances as well as the position of the tag, external noises still can only be reduced very little Therefore, the result is temporarily satisfied the given requirement

Similarly, to the path planning for the Rectangle, we have tried on different movement path for the tag to verify as well as retrieving more data for the system evaluation Therefore, we decided to form a path that takes half of the rectangle, a triangle is formed with three points in the half left of the rectangle A (1.2, 0.9); B (2.7, 0.9); D (1.2, 4.2) Through experimenting, the demonstration of the tag moving in the triangle direction through the points A(1.2, 0.9); B(2.7, 0.9); D(1.2, 4.2) with the distances d 1 h , d 2 h and d 3h from the tag to each of the anchor in order to calculate the position of the mobile tag (P P x , y ) is measured by: a) b) c) d)

Figure 6-22: a) d distance measured from Anchor 1; b) 1h d distance measured from 2h Anchor 2; c) d distance measured from Anchor 3; d) Triangle path planning 3h

The path planning localization of the Triangle is directly affected by external noise and NLOS conditions The retrieved data from this process is shown as:

Figure 6-23: a) d distance measured from Anchor 1; b) 1h d distance measured from 2h Anchor 2; c) d distance measured from Anchor 3; d) Triangle path planning (noise) 3h

Comparing to the Rectangle path, the path formed by the tag in the triangle shaped also yields temporarily result Considering the travel path is shorter than the rectangle, the distance signals received from the transmission between the mobile tag and the anchors is much smoother The output result of (6-18 (d)) at C point has stepped out of the limited set up plane, causing the position of the tag to be wrong computed Meanwhile, in the result (6-19 (d)), despite the noise, the position of the tag still moving inside the limited plane and still hold the correct computation of the tag position

Hexacopter Flight testing

This section is the representation of the combination of Hexacopter flight testing with the localization obtained during flight From that, we would be able to locate the Hexacopter movement for indoor localization, also obtained the IMU signal indicating how good balancing that the Hexacopter operates while flying in the air Additionally, real time tracking is also applied for the system for checking the change processed distances measured from the tag to each of the anchors, which is crucial since the position of the mobile tag is dependent on the computation where distances is applied

Step 1: MCU start up and run all initiation programs

Step 2: Task Schedulers are initiated

Step 3: Task 1 and Task 2 run parallel

This process starts up all of the components that are available for operating on the Hexacopter Sensors that are connected to the ESP are IMU for measuring the Roll – Pitch – Yaw angle, and an Ultrasonic sensor for collecting the height data through transmitting it signals to the ground and get the feedback After the startup process, Task 1 and Task 2 block are quickly put to operation

Step 1: Initiate all sensors and their connections

Step 2: Enable ESPNOW for remote connection

Step 4: Suspend all tasks for further commands

Collect data Roll, Pitch, Yaw

Output frequency to Motors Return

Step 1: Check if DMP is ready or not

Step 2: Collect data Roll, Pitch and Yaw

Step 3: Collect Ultrasonic sensor time

Step 4: Measure Altitude from total time

Step 7: Check if command is PID enable

Step 8: Run PID stabilization and PID position

Step 9: Output frequency to motors

Step 1: Check if the MAC address received is current

Step 2: Distances values from UWB is copied into memory of ESP32

Step 3: All necessary data transfer from MCU on drone to ESP32 GUI

Step 4: If the Roll or Pitch is more than 30 degrees

Step 5: Motor stops and PID disabled

The two tasks run in parallel The first task is mainly focused on enabling all the available sensors on the Hexacopter (Accelerometer, Gyrometer, Ultrasonic sensor), also checking the transmission between the mobile tag attached to the Hexacopter for retrieving the distances data from the tag to the three anchors The PID stabilization and position process is also checked before flight ensuring the drone will be able to achieve balance after taking off The second task processes inside the MCU during the transmission of data through ESP32 on the tag, to the ESP32 at the Ground station computer This process makes sure the observation of the flight is stable, the Hexacopter be able to balance itself and also return the precise data of its position through the computation of localization process, if any accidents happen through flight, we would be able to react as soon as possible to fix, analyze and improve its performance in the next flights

This process section is the command that we have set up for the Hexacopter through shortcut keys for full model control through the computer in the Ground Control Station The commands consist of Sensor Collection, Data Wi-Fi transfer, ESCs Calibration and motors warm up, Starting PID computing process with motors enable as well as stop In addition, altitude setpoint is added and PID parameters can be changed wirelessly in order to improve the flight performance The whole process is programmed so the drone would be able to react autonomously whenever it received a command

Sensor Collection, Data Wifi transfer Enable

Esc Calibration and motors warm up

Motors start and PID enable

Change throttle frequency and Fuzzy Output

Localization experimenting during flight

This section represents flight of the Hexacopter flying inside the indoor location, while operating localization process in real time The data then is retrieved and plot again in MATLAB for better visualization

The following graphs demonstrates the Take-off section: a) b) c) d)

Figure 6-30: a) Take off – Roll angle; b) Take off – Pitch angle; c) Take off – Yaw angle; d) Take off – Altitude

In Figure (6-26), the Hexacopter begins its take-off operation at the low ground The graphs indicates that three seconds before take-off, all the sensors and motors are run checked first before increasing the motor speed for the flight operation The Fuzzy PID controller is now begin to compute its parameters the Roll – Pitch – Yaw angles received from the IMU and then begin to calculate the most optimal PID for stable take off It can be seen that the change of angle signal begins to react with a lot of overshoots, causing the drone to balance itself as fast as possible right after it left the ground

The following graphs demonstrates the Landing section: a) b) c) d)

Figure 6-31: a) Landing – Roll angle; b) Landing – Pitch angle; c) Landing – Yaw angle; d) Landing – Altitude

In Figure (6-27), after achieving balance flight in the air, the drone will now need a safely landing by decreasing the motor speed slowly Right after the microcontroller attached on the Hexacopter receives a command signal from the Ground Station, the Fuzzy PID controller will now begin to compute the most optimal PID gains for slower rotating speed for all the motors in order to achieve the balance during landing The drone wont operates its landing at full body, some of the position on the drone would touch the ground first, which lead to the sudden overshoot of the angles data returned from the IMU sensor After landing, the motors are stopped and put the Hexacopter in the initial state form, ready to receive another command for another flight test In Overall, the whole process is temporarily stable

This section represents Altitude response and Localization results a) Altitude response a) b) c) d)

Figure 6-32: a) Roll angle response; b) Pitch angle response; c) Yaw angle response; d)

The whole flight process consists of both take off and landing section In the Figure (6-28), it can be seen that the Roll – Pitch – Yaw are actively changes continuously in order to achieve the most balance state for the Hexacopter due to the computation of the Fuzzy PID controller The Hexacopter was able to hold itself balance in the air for over fifty seconds before receive a landing command from the Ground station From the observation in the real-world experiment, the Hexacopter state are mostly stable but the data retrieved from the experiment shows that the system is mostly affected by external noises, causing the angle data from IMU sensors is somewhat not accurate even though some filters such Kalman Filter and DMP filter, are applied for filtering the most precise value

This section represents localization result after the flight test a) c) d) b)

Figure 6-33: a) d distance measured from Anchor 1; b) 1h d distance measured from 2h Anchor 2; c) d distance measured from Anchor 3; d) Drone flying path 3h

In Fig (6-29), the experiment with the combination of Hexacopter balancing and real time tracking localization system Through real life observation, it is clear that the moving path of the Hexacopter forming during flight shows that the Localization system works properly The system was able to retrieved the data with reliable path plotting result, less affection of external noises and precise mobile tag – anchor distances measurement

6.4.4 Manual flight testing with localization a) Altitude response

This section represents the altitude response result after the manual flight test a) c) d) b)

Figure 6-34: a) Roll angle response; b) Pitch angle response; c) Yaw angle response; d)

In Fig (6 - 30), we use a handheld controller to fully control the Hexacopter By adjusting the joysticks, we would be able to balance the drone by make it moving forward, backward and forming the rectangle shaped based on the coordinates that we have setup in the localization test Which can clearly be seen in the figure is that, the response is somewhat unstable, since we have to change the setpoint of the Hexacopter continuously in order for it to get back to its balance state Comparing to the autonomous flight section, the manual flight result graph seems to be unstable than the autonomous flight, but we would be able to change the position of drone as we want it to be, since the previous really does not

Figure 6-35: a) d distance measured from Anchor 1; b) 1h d distance measured from 2h Anchor 2; c) d distance measured from Anchor 3; d) Drone flying path 3h

It can be seen from the Fig (6-31) is that the localization process that we want the Hexacopter to form the rectangle path indicates the data retrieving process works properly However, there are still some uncertainties that affects directly to the system causing unnecessary noise illustrated on the graph The data is already observed with real time tracking and the rectangle path we want to form from localization process is totally reliable, less affection of external noises and precise mobile tag – anchor distances measurement

CONCLUSION

Conclusion

After launching the project “Hexacopter control for indoor localization using Ultra Wide- band system”, our team was able to achieve the following results:

- Design the Hexacopter model on SOLIDWORKS

- Construct the real model of a Hexacopter

- Design and Implementation of Ultra Wide-band module

- Design and simulate stable PID controller for the Hexacopter model by obtaining the most optimal PID parameters

- Improve the Hexacopter performance by designing a Fuzzy PID Controller based on the obtained PID parameters

- Compute and verify the Ultra Wide-band localization system

- Design and construct the real Ultra Wide-band localization system

- Experimenting on localization system, retrieving the real data

- Testing the balance of the Hexacopter during flight

- Combining the balance of the Hexacopter during flight with the localization system, experimenting in real time tracking, retrieving the flight data obtained from the localization system

Disadvantages that exist during the process of this project:

- Limited flying space, due to the size of the Hexacopter, it was very difficult to find a proper place for launching flight test

- Due to running with six motors, the Hexacopter is very battery consuming

- Weather factor directly affect the process Rainy and windy days delay the data retrieving process

- The Ultra-Wideband sends Radio Frequency signals The permeability effect causes the signal to be very sensitive with heavy metal and electronics environment, occurring delays and directly affect the drone performance

- Temperature and humidity are main factors in the signal delay The transmit speed changes whenever the environment temperature changes as well as the humidity Leading to misread of data and noise during experimenting

- Since there are no GPS used in this project, the Hexacopter positioning totally relies on the data read from the Ultra Wide-band localization system, this leads to whenever noise affects the data retrieving process, causing the drone to be unstable

- Since our team developed our own flight controller without using any open-source flight controller, facing noises and balance PID tuning process is critical

- The barometer only works well at high ground since there’s very less pressure near the ground, the tuning is difficult and takes a lot of time Instead, we use the

Ultrasonic sensor with easier tuning but it only works well when the Hexacopter flying at low ground, make it not practical.

Development path

To improve and resolve the problem that our team has faced during launching this project, we decided to use more advanced improvement and replacement with more high- quality sensors as well as microcontrollers For indoor positioning, despite Ultra Wide- band is not complete and currently in developed but still, its potential for localizing and tracking an indoor moving object truly defines the strength of this technology

The next improvement for the project is to perfectly balance the drone and apply motion planning on it The drone has to be stable during flight so we can develop it further with more applications Additionally, improvement by replacing other optimal controller for helping the drone achieve its most balance state Applications such as ROS, SLAM, image processing and even Artificial Intelligence are considerable to be implemented on drone in the near future for commercialization and industrialization

[1] P Garo, "1 Unmanned Aerial Vehicle: An Introduction - IBSN: 978-1-68392-709-

9 Library of Congress Control Number: 2021940431"

[2] S Suzuki, "2 Recent researches on innovative drone technologies in robotic field - Published online: 08 Sep 2018"

[3] Viswanadhapalli Praveen* and Anju S Pillai , "3 Modeling and Simulation of Quadcopter using PID Controller - International Science Press 2016, pp 7151-

[4] Jaehyun Yoon and Jaehyeok Doh , "4 Optimal PID control for hovering stabilization of quadcopter using long short term memory - NRF-

[5] Diego Domingos, Guilherme Camargo and Fernando Gomide , "5 Autonomous Fuzzy Control and Navigation of Quadcopters -IFAC-PapersOnLine 49-5 (2016) 073–078"

[6] Mohammed Rabah, Ali Rohan, Yun-Jong Han and Sung-Ho Kim - , "6 Design of Fuzzy PID Controller for Quadcopter Trajectory – Tracking - International Journal of Fuzzy Logic and Intelligent Systems 2018; 18(3): 204-213"

[7] P T Truyen, "7 Design of Model Predictive Controller for a Quadcopter System – University of Technology and Education," 7 2023

[8] Faraz Ahmad, Pushpendra Kumar, Anamika Bhandari and Pravin P Patil, "8

Simulation of the Quadcopter Dynamics with LQR based control-DOI:10.1016 mat.pr: 2020.04.282"

[9] Le Manh Cuong and Le My Ha , "9 Human Detection and Tracking for

Autonomous Human – Following Quadcopter - in 2019 International Conference on System Science and Engineering (ICSSE), 2019: IEEE, pp 6-11"

[10] Mario Polijak , "10 The History of Drones (Timeline from 1907 to 2023)," 5

[11] Wikipedia - The free encyclopedia, "11 Inertial Measurement Unit"

[12] Wikipedia – The free encyclopedia , "12 Accelerometer"

[13] Starlino, "13 A guide to using IMU (Accelerometer and Gyroscope Devices) in Embedded Applications," 29 December 2009

[14] Wikipedia – The free encyclopedia , "14 Gyroscope"

[15] Wikipedia – The free encyclopedia, "15 Leonhard Euler"

[16] Wikipedia – The free encyclopedia, "15 Leonhard Euler"

[17] Wikipedia – The free encyclopedia , "United States Department of Defense

(September 2008) "Global Positioning System Standard Positioning Service

Performance Standard - 4th Edition"," 27 April 2017 Retrieved April 21, 2017

[18] National Coordination Office for Space-Based Posit, " "What is GPS?".," Archived from the original on May 6, 2021 Retrieved May 5, 2021 (February 22, 2021)

[19] "20 What is Ultra Wide-band? Here’s everything you need to know," [Online] Available: bleesk.com/uwb.html

[20] ISO Retrieved 2016-04-28., "21 "International Organization for Standardization"," [Online]

[21] Wikipedia, "19 Ultra Wide-band Characteristic"

[22] T E Margaret Rouse, "23 Non-line Of Sight –3rd," p Techopedia.com , 3rd July

[23] machine-learning-glossary-and-terms, "25 Kalman Filter," p deepai.org

[24] James Carjaval, Guanrong Chen and Haluk Ogmen, "26 Fuzzy PID Controller: Design, performance evaluation, and stability analysis – DOI:10.1016/ S0020-

[25] Statista, "27 Drones Worldwide," Most recent update: Dec 2023

[26] Thien Minh Nguyen, Abdul Hanif Zaini, Kexin Guo and Lihua Xie, "An Ultra- Wideband-based Multi-UAV Localization - IMAV2016-9," p http://www.imavs.org/pdf/imav.2016.9

[27] Chin-Der Wann, Yi-Jing Yeh and Chih-Sheng Hsueh, "Hybrid TDOA/AOA Indoor Positioning and Tracking - Department of Electrical Engineering"

[28] Li Zhang, Hao Zhang, Xue-rong Cui and T Aaron Gulliver, "Ultra Wideband

Indoor Positioning Using Kalman Filters - Advanced Materials Research Vols 433-

440 (2012) pp 4207-4213," pp doi:10.4028/www.scientific.net/AMR.433-

[29] Wang Guosheng, Qin Shuqi, Lv Qiang, Wei Heng, Lin Huican and Liang Bing,

"UWB and IMU System Fusion for Indoor Navigation - Proceedings of the 37th Chinese Control Conference," July 25-27, 2018 Wuhan, China

[30] Kexin Guo, Abduk Hanif Zaini, Zhirong Qiu and Wei Meng, "Ultra-Wideband- Based Localization for Quadcopter Navigation - DOI:

10.1142/S2301385016400033," p https://www.researchgate.net/publication/295099834

[31] Kexin Guo, Zhirong Qiu, Cunxiao Miao, Abdul Hanif Zaini, Chun-Lin Chen, Wei Meng and Lihua Xie, "Ultra-Wideband-Based Localization for Quadcopter

Navigation- Unmanned Systems, Vol 4, No 1 (2016) 23–34"

[32] Fuhu Che, Qasim Zeeshan Ahmed , Pavlos I Lazaridis, Pradorn Sureephong and Temitope Alade, "Indoor Positioning System (IPS) Using Ultra-Wide Bandwidth -

T Indoor Positioning System (IPS) Sensors 2023, 23, 5710," p https://doi.org/10.3390/s23125710

[33] HYUNG JUNE KIM, YIFAN XIE, HEEKWON YANG, CHANKIL LEE and TAEK LYUL SONG, "An Efficient Indoor Target Tracking Algorithm Using

TDOA Measurements With Applications - Digital Object Identifier

10.1109/ACCESS.2019.2927005," April 13, 2019, accepted July 1, 2019, date of publication July 5, 2019, date of current version July 25, 2019

[34] Md Iqbal Hossain, Talat Karim Minhas and Thomas Lindh, "Masters Thesis - Distance Measurement Using Ultra Wide-band"

[35] Wikipedia, "22 Real-time locating system".

Ngày đăng: 01/10/2024, 10:31

Nguồn tham khảo

Tài liệu tham khảo Loại Chi tiết
[7] P. T. Truyen, "7. Design of Model Predictive Controller for a Quadcopter System – University of Technology and Education," 7 2023 Sách, tạp chí
Tiêu đề: 7. Design of Model Predictive Controller for a Quadcopter System – University of Technology and Education
[10] Mario Polijak , "10. The History of Drones (Timeline from 1907 to 2023)," 5 February 2019 Sách, tạp chí
Tiêu đề: 10. The History of Drones (Timeline from 1907 to 2023)
[13] Starlino, "13. A guide to using IMU (Accelerometer and Gyroscope Devices) in Embedded Applications," 29 December 2009 Sách, tạp chí
Tiêu đề: 13. A guide to using IMU (Accelerometer and Gyroscope Devices) in Embedded Applications
[17] Wikipedia – The free encyclopedia , "United States Department of Defense (September 2008). "Global Positioning System Standard Positioning Service Performance Standard - 4th Edition"," 27 April 2017. Retrieved April 21, 2017 Sách, tạp chí
Tiêu đề: United States Department of Defense (September 2008)
[19] "20. What is Ultra Wide-band? Here’s everything you need to know," [Online]. Available: bleesk.com/uwb.html Sách, tạp chí
Tiêu đề: 20. What is Ultra Wide-band? Here’s everything you need to know
[20] ISO Retrieved 2016-04-28., "21. "International Organization for Standardization"," [Online] Sách, tạp chí
Tiêu đề: 21
[22] T. E. Margaret Rouse, "23. Non-line Of Sight –3rd," p. Techopedia.com , 3rd July 2015 Sách, tạp chí
Tiêu đề: 23. Non-line Of Sight –3rd
[23] machine-learning-glossary-and-terms, "25. Kalman Filter," p. deepai.org Sách, tạp chí
Tiêu đề: 25. Kalman Filter
[25] Statista, "27. Drones Worldwide," Most recent update: Dec 2023 Sách, tạp chí
Tiêu đề: 27. Drones Worldwide
[26] Thien Minh Nguyen, Abdul Hanif Zaini, Kexin Guo and Lihua Xie, "An Ultra- Wideband-based Multi-UAV Localization - IMAV2016-9," p.http://www.imavs.org/pdf/imav.2016.9 Sách, tạp chí
Tiêu đề: An Ultra-Wideband-based Multi-UAV Localization - IMAV2016-9
[28] Li Zhang, Hao Zhang, Xue-rong Cui and T. Aaron Gulliver, "Ultra Wideband Indoor Positioning Using Kalman Filters - Advanced Materials Research Vols. 433- 440 (2012) pp 4207-4213," pp. doi:10.4028/www.scientific.net/AMR.433-440.4207 Sách, tạp chí
Tiêu đề: Ultra Wideband Indoor Positioning Using Kalman Filters - Advanced Materials Research Vols. 433-440 (2012) pp 4207-4213
[32] Fuhu Che, Qasim Zeeshan Ahmed , Pavlos I. Lazaridis, Pradorn Sureephong and Temitope Alade, "Indoor Positioning System (IPS) Using Ultra-Wide Bandwidth - T. Indoor Positioning System (IPS) Sensors 2023, 23, 5710," p.https://doi.org/10.3390/s23125710 Sách, tạp chí
Tiêu đề: Indoor Positioning System (IPS) Using Ultra-Wide Bandwidth - T. Indoor Positioning System (IPS) Sensors 2023, 23, 5710
[1] P. Garo, "1. Unmanned Aerial Vehicle: An Introduction - IBSN: 978-1-68392-709- 9 Library of Congress Control Number: 2021940431&#34 Khác
[2] S. Suzuki, "2. Recent researches on innovative drone technologies in robotic field - Published online: 08 Sep 2018&#34 Khác
[3] Viswanadhapalli Praveen* and Anju S. Pillai , "3. Modeling and Simulation of Quadcopter using PID Controller - International Science Press 2016, pp. 7151- 7158&#34 Khác
[4] Jaehyun Yoon and Jaehyeok Doh , "4. Optimal PID control for hovering stabilization of quadcopter using long short term memory - NRF-2021R1I1A3044394&#34 Khác
[5] Diego Domingos, Guilherme Camargo and Fernando Gomide , "5. Autonomous Fuzzy Control and Navigation of Quadcopters -IFAC-PapersOnLine 49-5 (2016) 073–078&#34 Khác
[6] Mohammed Rabah, Ali Rohan, Yun-Jong Han and Sung-Ho Kim - , "6. Design of Fuzzy PID Controller for Quadcopter Trajectory – Tracking - International Journal of Fuzzy Logic and Intelligent Systems 2018; 18(3): 204-213&#34 Khác
[8] Faraz Ahmad, Pushpendra Kumar, Anamika Bhandari and Pravin P. Patil, "8. Simulation of the Quadcopter Dynamics with LQR based control-DOI:10.1016 mat.pr: 2020.04.282&#34 Khác
[9] Le Manh Cuong and Le My Ha , "9. Human Detection and Tracking for Autonomous Human – Following Quadcopter - in 2019 International Conference on System Science and Engineering (ICSSE), 2019: IEEE, pp. 6-11&#34 Khác

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w