• Non ci sono risultati.

Teaching Learning Based Optimization (TLBO) algorithm for trajectory planning of a quadrotor in an urban environment.

N/A
N/A
Protected

Academic year: 2021

Condividi "Teaching Learning Based Optimization (TLBO) algorithm for trajectory planning of a quadrotor in an urban environment."

Copied!
81
0
0

Testo completo

(1)

Department of

CIVIL AND INDUSTRIAL ENGINEERING

MASTER’s DEGREE

In Aerospace Engineering

Teaching Learning Based Optimization

(TLBO) algorithm for trajectory planning of

quadrotor in an urban environment

Author:

Supervisor:

Aleksander Suti

Prof. Eugenio Denti

Co-supervisor:

Prof. Yu Wu

(2)

1

Abstract

Most of the optimization algorithms are characterized by a large number of parameters that must be well tuned to have a good working algorithm. This limitation is avoided in Teaching-Learning-Based Optimization (TLBO) algorithm, where a few numbers of parameter needs to be well settled.

TLBO is a recent developed evolutionary algorithm based on two elementary concepts of education, namely teaching phase and learning phase. At first, learners improve their knowledge through the teaching methodology of teacher and finally learners increase their knowledge by interactions among themselves.

Lately, the TLBO algorithm has been widely used in the scientific fields and compared with the other existing technique it demonstrates its superiority. Despite this, few applications of the method to the trajectory planning problem have been made.

In this work, the effectiveness of the TLBO technique has been analysed as a multi-objective optimization algorithm through two different trajectory planning problems: for a simplified model of a terrestrial vehicle first and for a quadrotor in a delivery task in an urban environment then. Besides, the effect and how the parameters have to be tuned in order to have satisfactory results are highlighted.

In a delivery task, the goal is to send goods to the destination accurately. In this case, the deviation between the destination and the final position of the quadrotor is regarded as a cost function. Optimization can be defined as finding the control input that minimize that cost function.

This study has been started in China as an international stage experience at Chongqing University where with the supervision of Professor Yu Wu, the TLBO algorithm has been developed in the MATLAB environment. The work has been continued and completed then at University of Pisa, Italy. Here, the terrestrial vehicle and the quadrotor dynamic models have been enhanced and combined with the algorithm thanks to the supervision of Professor Eugenio Denti.

As Chongqing is the largest city proper in the world, the traffic jam and the exhausted gas from vehicles bring environmental pollution problems. Hence, this work wants to give a contribution in ground vehicles number reduction by improving the autonomous flight capability.

(3)

2

Index

Figures Index ... 4 Tables Index... 5 Introduction ... 6 1. Optimization ... 10 2. Teaching-Learning-Based Optimization ... 12 2.1. Initialization ... 12 2.2. Teacher Phase ... 13 2.3. Learner phase ... 13

3. Dynamic Model of 1-DOF problem ... 16

3.1. Target ... 17

3.2. Constraints ... 17

3.2.1. Constraint of control variable. ... 17

3.2.2. Forward move ... 17

3.2.3. Comfortable trip ... 18

4. Results ... 19

5. Dynamic Model of the Quadrotor ... 26

5.1. External Forces... 28

5.1.1. AOA and AOS ... 29

5.2. External Moments ... 30

5.3. Control variables ... 30

5.4. Complete set of equations ... 31

6. Trajectory modelling approach ... 34

6.1. Constraints of the trajectory planning problem ... 34

6.1.1. Constraints of control variables ... 34

6.1.2. Goods put on a flat plane ... 35

6.1.3. Collision detection ... 35

(4)

3

7. Experimental studies ... 37

7.1. Results under different environment ... 37

7.2. Multi-phase path ... 41 7.2.1. Cruise path ... 41 7.2.2. Landing path ... 44 7.3. Entire path ... 46 8. Conclusion ... 48 Appendix A ... 50 Appendix B ... 57 Appendix C ... 69 References ... 78

(5)

4

Figures Index

Figure 1. Conceptual model of the trajectory planning problem ... 9

Figure 2. Flowchart of TLBO ... 15

Figure 3. Car model with applied forces ... 16

Figure 4. Block diagram of the dynamic simulation for the vehicle on the road 19 Figure 5. First case results... 21

Figure 6. Second case results ... 22

Figure 7. Third case results ... 23

Figure 8. Case with 𝒎𝒔𝒖𝒃𝒋𝒆𝒄𝒕𝒔 reduced ... 24

Figure 9. Quadrotor in a delivery task ... 26

Figure 10. Earth-fixed reference frame ... 26

Figure 11. Quadrotor scheme and Body-fixed reference frame ... 26

Figure 12. Equation of motion "6DOF"(Euler Angles)" ... 33

Figure 13. Block diagram of the quadrotor Dynamic simulation ... 34

Figure 14. Trajectory of the quadrotor with no buildings obstacles ... 37

Figure 15. Trajectory of the quadrotor with buildings obstacles ... 38

Figure 16. Control variables with and without obstacles ... 39

Figure 17. Euler's angles with and without obstacles ... 39

Figure 18. 𝒙𝑬 − 𝒚𝑬 trajectory without building obstacles and course target ... 40

Figure 19. 𝒙𝑬 − 𝒚𝑬 trajectory with building obstacles and course target ... 41

Figure 20. Cruse-1 trajectory ... 43

Figure 21. 𝒙𝑬 − 𝒚𝑬 Cruise-1 trajectory ... 43

Figure 22. Landing Trajectory ... 45

Figure 23. 𝒙𝑬 − 𝒚𝑬 landing trajectory ... 46

Figure 24. Entire delivery trajectory ... 46

Figure 25. 𝒙𝑬 − 𝒚𝑬 entire delivery trajectory ... 47

Figure 26. Body drag coefficient in 𝒙𝒃 direction vs. AOA ... 57

(6)

5

Tables Index

Table 1. Properties of the vehicle and of the environment ... 19

Table 2. Constraints of 1DOF problem ... 20

Table 3. TLBO parameters for 1DOF problem ... 20

Table 4. TLBO parameters for quadrotor trajectory problem ... 38

Table 5. Constraints in the quadrotor trajectory planning model ... 39

Table 6. Quadrotor trajectory with course target, without buildings obstacles .. 40

Table 7. Quadrotor trajectory with course target, with buildings obstacles ... 41

Table 8. TLBO parameter for quadrotor trajectory- cruise-1 ... 42

Table 9. Cruise-1 ... 42

Table 10. Constraints in the landing phase ... 44

Table 11. TLBO parameters for quadrotor trajectory problem-Landing ... 44

Table 12. Landing phase ... 45

Table 13. Quadrotor properties used in the experiments ... 57

(7)

6

Introduction

The advanced optimization algorithms may be classified into different groups depending on the criterion being considered such as population based, iterative based, stochastic, deterministic, etc. Depending on the nature of phenomenon simulated by the algorithms, the population-based heuristic algorithms have two important groups: Evolutionary Algorithms (EA) and Swarm Intelligence Algorithms (SIA).

Some of the recognized EA are: Genetic Algorithms (GA), Differential Evolution (DE), Evolutionary Strategy (ES), Evolutionary Programming (EP), and Artificial Immune Algorithm (AIA). Among all, GA is a widely used algorithm for various applications. GA works on the principle of the Darwinian theory of the survival of the fittest and the theory of evolution of the living beings [1].

Some of the well-known swarm intelligence based algorithms are: Particle Swarm Optimization (PSO), which works on the principle of foraging behaviour of the swarm of birds [2], Ant Colony Optimization (ACO) which works on the principle of foraging behaviour of the ant for the food [3] and Artificial Bee Colony (ABC) algorithm which works on the principle of foraging behaviour of a honey bee [4]. Besides these evolutionary and swarm intelligence algorithms, there are some other algorithms which work on the principles of different natural phenomena. Some of them are: Harmony Search (HS) algorithm which works on the principle of music improvisation in a music player [5], Gravitational Search Algorithm (GSA) which works on the principle of gravitational force acting between the bodies [6].

All the above-mentioned algorithms are population-based optimization methods and have some limitations in one or the other aspect. The main limitation of all the algorithms is that different parameters (i.e., algorithm-specific parameters) are required for proper working of these algorithms. Proper tuning of these parameters is essential for the searching of the optimum solution by these algorithms. A change in the algorithm-specific parameters changes the effectiveness of the algorithm.

Most commonly used evolutionary optimization algorithm is the Genetic Algorithm (GA). However, GA provides a near optimal solution for a complex problem having large number of variables and constraints. This is mainly due to the difficulty in determining the optimum controlling parameters such as crossover probability, mutation probability, selection operator, etc. The same is the case with PSO which uses inertia weight and social and cognitive parameters.

(8)

7 An optimization algorithm named “Teaching-Learning-Based Optimization (TLBO)” was introduced to obtain global solutions for continuous as well as discrete optimization problems with less computational effort and high consistency.

The TLBO algorithm does not require any algorithm-specific parameters. It is based on the effect of the influence of a teacher on the output of learners in a class. Here, output is considered in terms of results or grades. The teacher is generally considered as a highly learned person who shares his or her knowledge with the learners. The quality of a teacher affects the outcome of learners. It is obvious that a good teacher trains learners such that they can have better results in terms of their marks or grades. Moreover, learners also learn from interaction among themselves which also helps in their results.

After its introduction in 2011, the TLBO algorithm is finding a large number of applications in different fields of science and engineering [7]. The major applications are found in the fields of electrical engineering [8], mechanical design [9], thermal engineering [10], civil engineering [11], computer engineering [12], electronics engineering [13], physics [14], chemistry [15] and economics [16].

As far as we know, TLBO algorithm is rarely applied to the trajectory planning problem for quadrotor [17], which is often a nonlinear optimization problem with multiple constraints, and its validity and efficiency need to be further verified.

In this research the trajectory planning problem is studied for two different cases. First, as an introductory example, a multiobjective optimization problem for a simplified model of a terrestrial vehicle is analysed. In this case the goal is to make the vehicle reach a certain position with null velocity and a constraint on the vehicle acceleration.

Second, due to the few applications in literature of TLBO to a quadrotor trajectory planning problem, the effectiveness of the proposed algorithm has been tested with different environment and constraints in such problem. First the dynamic model of a quadrotor is proposed then the urban environmental model, the constraints of delivery task and the optimization index are established.

As we wanted to investigate widely the method strengths and weaknesses, the quadrotor trajectory, under the delivery task, has been considered as a multi-phase trajectory divided in three mainly phases: take-off-cruise, cruise and landing. Each one of them is characterised by different targets and different constraint.

(9)

8 The work proceeds as follows.

• Section 2

presents the optimization concept and explain how to deal with a single-objective and a multi-single-objective optimization problem.

• Section 3

The principle of TLBO algorithm is explained and its steps are elaborated in a general way.

• Section 4

The TLBO is applied to a simple case, a multi-objective problem is faced for a terrestrial vehicle which dynamics is described with a 1 DOF non-linear model. • In section 5

Are presented and analysed the results with growing constraint strictness. • Section 6

Describes the world frame, body frame and dynamic model of a quadrotor. • In Section 7

The trajectory modelling approach and the description of cost functions and constraints are given.

• In Section 8

Examples of realized trajectories are reported. The conclusion follows.

To summarize the key element of the trajectory problem, a conceptual model is abstracted as shown in Figure 1.

In Figure 1, the elements of an optimal control problem are presented and are described the steps for solving the problem. First should be identified the objects, such as control variables and state variables, and the initial state of the vehicle. Then must be defined the constrains and the cost function. The constraints of trajectory planning problem are related to the vehicle through its dynamic and manoeuvrability and to the problem tasks through obstacles avoidances and goods in good condition. All these elements represent the Trajectory Planning Model which is the TLBO trajectory planning algorithm input.

(10)

9

Trajectory planning problem

Object Inputs Constraints Cost function

Vehicle Task Co n tr o l v ariab les S tate v ariab les In it ial sta te o f th e q u ad ro to r D y n a m ics M an o eu v ra b il ity Ob sta cle av o id an ce M in im u m d ev iatio n G o o d s i n g o o d co n d iti o n

TLBO trajectory planning algorithm

Results of trajectory planning

Figure 1. Conceptual model of the trajectory planning problem

(11)

10

1. Optimization

Optimization can be defined as finding solution of a problem where it is necessary to maximize or minimize a single or a set of objective functions within a domain which contains the acceptable values of variables while some restrictions are to be satisfied. There might be a large number of sets of variables in the domain that maximize or minimize the objective function(s) while satisfying the described restrictions. They are called as the acceptable solutions and the solution which is the best among them is called the optimum solution of the problem. An objective function expresses the main aim of the model which is either to be minimized or maximized.

A set of variables control the value of the objective function and these variables are essential for the optimization problems. We cannot define the objective function and the constraints without the variables. A set of constraints are those which allow the variables to take on certain values but exclude others. The constraints are not essential and their presence depends on the requirements of the optimization problem.

The generalized statement of an optimization problem for maximization can be written as: To find 𝑋 = [ 𝑥1 𝑥2 ⋮ 𝑥𝑛 ] which maximizes 𝐽(𝑋)

Subject to the constraints:

𝑔𝑖(𝑋) ≤ 0, 𝑖 = 1,2, … , 𝑚

Where 𝑋 is an n-dimensional vector called the design vector, 𝐽(𝑋) is called objective function, and 𝑔𝑖(𝑋) are the constrains.

The optimization problem may contain only a single objective function or a number of objective functions. A problem containing only one objective function is called single objective optimization problem. A problem containing more than one objective function is called the multiple or multi-objective optimization problem.

For a multi-objective optimization problem, generally does not exist a single solution that simultaneously optimizes each objective. In that case, the objective functions are said to be conflicting and there exist a large number of Pareto optimal solution. A solution is called non-dominated, Pareto optimal, Pareto

(12)

11 efficient, or noninferior, if none of the objective functions can be improved in value without degrading some of the other objective values. Researchers study multi-objective optimization problem from different viewpoints and, thus, there exist different solution philosophies and goals when setting and solving them. The goal may be to find a representative set of Pareto optimal solutions, and/or quantify the trade-offs in satisfying the different objectives, and/or finding a single solution that satisfies the subjective preferences of a decision-maker.

The preferences of the decision-maker are in the form of weights assigned to the objective functions. Once the weights are decided by the decision-maker, the multiple objective are combined into a scalar objective via the weight vector. However, if the objective functions are simply weighted and added to produce a single fitness, the function with the largest range would dominate the evolution. A poor input value for the objective with the larger range makes the overall value much worse than a poor value for the objective with smaller range. To avoid this, all objective functions are normalized to have same range. For example, if 𝐽1(𝑥) and 𝐽2(𝑥) are the two objective functions to be minimized, then the combined

objective function can be written as,

𝒎𝒊𝒏 𝑱(𝒙) = 𝒎𝒊𝒏 {𝒘𝟏[(𝑱𝟏(𝒙)

𝑱𝟏∗ )] + 𝒘𝟐[( 𝑱𝟐(𝒙)

𝑱𝟐)]} ( 1 )

where, 𝐽(𝑥) is the combined objective function and 𝐽1∗ is the minimum value of the objective function 𝐽1(𝑥) when solved it independently without considering

𝐽2(𝑥). 𝐽2∗ is the minimum value of the objective function 𝐽2(𝑥) when solved it

independently without considering 𝐽1(𝑥). 𝑤1 and 𝑤2 are the weights assigned by the decision-maker to the objective functions 𝐽1(𝑥) and 𝐽2(𝑥).

In general, the combined objective function can include any number of objectives and the summation of all weights is equal to 1.

(13)

12

2. Teaching-Learning-Based Optimization

The TLBO algorithm is a teaching-learning process inspired algorithm proposed by Rao et al [18, 19], and Rao and Savsani [20]based on the effect of influence of a teacher on the output of learners in a class. The algorithm describes two basic modes of the learning: (1) through teacher (known as the teacher phase) and (2) through interaction with the other learners (known as learner phase). In this optimization algorithm, a group of learners is considered as population and different subjects offered to the learners are considered as different design variables of the optimization problem and a learner’s result is analogous to the ‘fitness’ value of the optimization problem. The best solution in the entire population is considered as the teacher. The design variables are actually the parameters involved in the objective function of the given optimization problem and the best solution is the best value of the objective function.

The main working of TLBO is divided into two parts, “Teacher phase” and “Learner phase” but like any other random search algorithm an initialization procedure is required.

2.1. Initialization

Set the initial score of each subject for each individual according to the following formula.

𝑿𝒋,𝒌𝟏 = 𝑿𝒋,𝒌𝟏 𝑴𝑰𝑵+ 𝒓𝒂𝒏𝒅∗(𝑿𝒋,𝒌𝟏 𝑴𝑨𝑿− 𝑿𝒋,𝒌𝟏 𝑴𝑰𝑵) ( 2 )

For 𝑗 = 1,2, … , 𝑚 and 𝑘 = 1,2, … , 𝑛. ′𝑚′ and ′𝑛′ are the number of subjects (i.e., design variables) and the number of learners (i.e., population size) respectively. 𝑋𝑗,𝑘1 𝑀𝐼𝑁 and 𝑋𝑗,𝑘1 𝑀𝐴𝑋 are the lower and the upper bounds of the course ′𝑗′ and 𝑟𝑎𝑛𝑑 is a random number in the interval [0,1]. Then the overall score of each individual is calculated using the cost function, and the individual with the best overall score is defined as a teacher (denoted as 𝑋𝑗,𝑘1 𝑏𝑒𝑠𝑡) and the other are defined as students.

(14)

13

2.2. Teacher Phase

During this phase, the teacher tries to increase the mean result of the class in the subject taught by him depending on his capability. At any iteration 𝑖, assume 𝑀𝑗𝑖 to be the mean result of the learners in a particular subject ′𝑗′.

𝑴

𝒋𝒊

= ∑

𝑿𝒋,𝒌 𝒊

𝒏 𝒏

𝒌=𝟏 ( 3 )

The difference between the existing mean result of each subject and the corresponding result of the teacher for each subject is given by,

∆𝑴𝒆𝒂𝒏𝒋,𝒌𝒊 = 𝒓𝒂𝒏𝒅∗(𝑿𝒋,𝒌𝒊 𝒃𝒆𝒔𝒕− 𝑻𝑭𝑴𝒋𝒊) ( 4 )

Where 𝑇𝐹 is the teaching factor which decides the value of mean to be changed, and 𝑟𝑎𝑛𝑑 is the random number in the range [0,1]. Value of 𝑇𝐹 can be either 1 or 2. The value of 𝑇𝐹 is decided randomly with equal probability as:

𝑻𝑭 = 𝒓𝒐𝒖𝒏𝒅[𝟏 + 𝒓𝒂𝒏𝒅(𝟎, 𝟏)] ( 5 )

Based on the ∆𝑀𝑒𝑎𝑛𝑗,𝑘𝑖 , the existing solution is updated in the teaching phase according to the following expression:

𝑿𝒏𝒆𝒘𝒋,𝒌𝒊 = 𝑿𝒋,𝒌𝒊 + ∆𝑴𝒆𝒂𝒏𝒋,𝒌𝒊 ( 6 )

Where, 𝑋𝑛𝑒𝑤𝑗,𝑘𝑖 is the updated value of 𝑋𝑗,𝑘𝑖 . 𝑋𝑛𝑒𝑤𝑗,𝑘𝑖 is accepted if it gives better function value. All the accepted function values at the end of the teacher phase are maintained and these values become the input to the learner phase. The learner phase depends upon the teacher phase. Note that after the value are updated the result of each subject may go out of the range [𝑋𝑗,𝑘𝑖 𝑀𝐼𝑁, 𝑋𝑗,𝑘𝑖 𝑀𝐴𝑋]. To make the algorithm effective, the result which violate the constraints are set as the closest threshold respectively.

2.3. Learner phase

It is the second part of the algorithm where learners increase their knowledge by interacting among themselves. A learner interacts randomly with other

(15)

14 learners for enhancing his knowledge. A learner learns new things if the other learners has more knowledge than him or her.

For a given learner 𝑋𝑗,𝑘𝑖 another learner 𝑋𝑗,𝑟𝑖 is randomly selected with 𝑟 ≠ 𝑘. New set of improved learners is given according to the following expression:

𝑿𝒏𝒆𝒘𝒋,𝒌𝒊 = { 𝑿𝒋,𝒌 𝒊 + 𝒓𝒂𝒏𝒅 ∗ (𝑿 𝒋,𝒌 𝒊 − 𝑿 𝒋,𝒓 𝒊 ) 𝒊𝒇 𝑱 𝒌 𝒊 < 𝑱 𝒓 𝒊 𝑿𝒋,𝒌𝒊 + 𝒓𝒂𝒏𝒅 ∗ (𝑿𝒋,𝒓𝒊 − 𝑿𝒋,𝒌𝒊 ) 𝒐𝒕𝒉𝒆𝒓𝒘𝒊𝒔𝒆} ( 7 )

(16)

15

Initialize

Set the initial score of each subject for each individual according to the following formula.

𝑋𝑗,𝑘1 = 𝑋𝑗,𝑘1 𝑀𝐼𝑁+ 𝑟𝑎𝑛𝑑 ∗ (𝑋𝑗,𝑘1 𝑀𝐴𝑋− 𝑋𝑗,𝑘1 𝑀𝐼𝑁)

Calculate the mean of each design variable Identify the best solution and the values of variables

Modify the other values of variables based on best solution ∆𝑀𝑒𝑎𝑛𝑗,𝑘𝑖 = 𝑟𝑎𝑛𝑑∗(𝑋𝑗,𝑘𝑖 𝑏𝑒𝑠𝑡− 𝑇𝐹𝑀𝑗𝑖)

𝑋𝑛𝑒𝑤𝑗,𝑘𝑖 = 𝑋𝑗,𝑘𝑖 + ∆𝑀𝑒𝑎𝑛𝑗,𝑘𝑖

𝐽(𝑋𝑗,𝑘𝑖 ) < 𝐽(𝑋𝑗,𝑟𝑖 )

Accept Reject

Replace the previous

For a given learner 𝑋𝑗,𝑘𝑖 another learner 𝑋𝑗,𝑟𝑖 is randomly selected with 𝑟 ≠ 𝑘. 𝐽 (𝑋𝑛𝑒𝑤𝑗,𝑘𝑖 ) < 𝐽(𝑋𝑗,𝑘𝑖 ) 𝑋𝑛𝑒𝑤𝑗,𝑘𝑖 = 𝑋𝑗,𝑘𝑖 + 𝑟𝑎𝑛𝑑 ∗ (𝑋𝑗,𝑘𝑖 − 𝑋𝑗,𝑟𝑖 ) 𝑋𝑛𝑒𝑤𝑗,𝑘𝑖 = 𝑋𝑗,𝑘𝑖 + 𝑟𝑎𝑛𝑑 ∗ (𝑋𝑗,𝑟𝑖 − 𝑋𝑗,𝑘𝑖 ) 𝐽 (𝑋𝑛𝑒𝑤𝑗,𝑘𝑖 ) < 𝐽(𝑋𝑗,𝑘𝑖 ) Accept Reject

Keep the previous Replace the previous

Is the termination criterion satisfied?

Report the solution Yes Yes Yes Yes No No No No Teacher Phase Learner Phase Keep the previous

(17)

16

3. Dynamic Model of 1-DOF problem

Consider the following simplified dynamic model for the vehicle on the road shown in Figure 3:

𝒎𝑽̇ = 𝑭𝒑𝒓𝒐𝒑− 𝑭𝒂𝒆𝒓𝒐− 𝑭𝒇𝒓𝒊𝒄𝒕𝒊𝒐𝒏 ( 8 )

• Control input

𝑭𝒑𝒓𝒐𝒑 = 𝑻 ( 9 )

It could be a thrust force or a braking force. • Aerodynamic force

𝑭𝒂𝒆𝒓𝒐 =𝟏

𝟐𝝆𝑽 𝟐𝑺𝑪

𝑫∙ 𝒔𝒊𝒈𝒏(𝑽) ( 10 )

where 𝜌 is the air density, 𝑆 the reference surface and 𝐶𝐷 is the drag coefficient of the vehicle.

• Friction Force

𝑭𝒇𝒓𝒊𝒄𝒕𝒊𝒐𝒏 = 𝒎𝒈 ∙ 𝝁(𝑽) ( 11 )

where 𝑚𝑔 is the weight force of the vehicle and 𝜇(𝑉) is the rolling friction coefficient.

• Rolling friction coefficient

𝝁(𝑽) = 𝝁𝒕𝒐𝒕∙ [𝟏 − 𝒆𝒙𝒑 (−𝟒. 𝟔𝟎𝟓𝟐 ∗𝒂𝒃𝒔(𝑽)

𝑽𝒇𝒖𝒍𝒍 )] ∙ 𝒔𝒊𝒈𝒏(𝑽)

( 12 )

Where 𝜇𝑡𝑜𝑡 is the total rolling coefficient friction.

When V (the velocity) is about zero the rolling friction coefficient, because of the sign changing, generate problems in the simulation, to avoid that is considered an exponential function for 𝜇(𝑉).

𝐹𝑎𝑒𝑟𝑜 𝐹𝑝𝑟𝑜𝑝

𝑉

𝐹𝑓𝑟𝑖𝑐𝑡𝑖𝑜𝑛

CG 𝑚𝑔

(18)

17 𝑉𝑓𝑢𝑙𝑙, is the velocity that makes the exponential contribute practically vanish, it means that 𝜇(𝑉𝑓𝑢𝑙𝑙) = 0.99𝜇𝑡𝑜𝑡.

3.1. Target

The goal is making the vehicle to reach a destination point with a certain speed. Hence, what we faced is a multi-objective problem where the cost function to be minimised is given as follows:

𝑱𝟏= 𝐚𝐛𝐬(𝒙(𝒕𝒇) − 𝒙𝒅𝒆𝒔𝒊𝒓𝒆𝒅) ( 13 ) 𝑱𝟐= 𝐚𝐛𝐬(𝑽(𝒕𝒇) − 𝑽𝒅𝒆𝒔𝒊𝒓𝒆𝒅 ) ( 14 ) 𝑱 = {𝒘𝟏[(𝑱𝟏 𝑱𝟏∗)] + 𝒘𝟐[( 𝑱𝟐 𝑱𝟐∗)]} ( 15 )

Where 𝐽1, 𝐽2 and 𝐽 are the cost function related to the position target, to the velocity target and the combined cost function respectively. 𝑥(𝑡𝑓) and 𝑉(𝑡𝑓) are the vehicle position and velocity at the final time, 𝑥𝑑𝑒𝑠𝑖𝑟𝑒𝑑 and 𝑉𝑑𝑒𝑠𝑖𝑟𝑒𝑑 are the target position and velocity.

3.2. Constraints

The vehicle must move only in a forward direction, moreover the acceleration do not have to change sign too many times in order to have a comfortable trip. These constraints are described as follows:

3.2.1. Constraint of control variable.

To reach the destination point with a certain speed is necessary that the control variable vary in a certain range.

𝑻𝑴𝒊𝒏≤ 𝑻 ≤ 𝑻𝑴𝒂𝒙 ( 16 )

3.2.2. Forward move

We want to guarantee that the vehicle reaches the destination points just in one direction. This constraint can be expressed as follows:

(19)

18 3.2.3. Comfortable trip

The passengers don’t have to feel more time positive and negative accelerations. This means that the sign of the acceleration doesn’t have to change many times. This constraint can be expressed as follow:

𝒏𝒂𝒄𝒄𝒔𝒊𝒈 ≤ 𝒏𝒅𝒆𝒔𝒊𝒓𝒆𝒅 ( 18 )

Where 𝑛𝑎𝑐𝑐𝑠𝑖𝑔is the number of acceleration sign changing during the mission and 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 represent the desired maximum number of

(20)

19

4. Results

The TLBO algorithm is implemented in MALAB and the dynamic simulation of the vehicle is realized using SIMULINK as is shown in Figure 4.

Vehicle and environment constants:

Table 1. Properties of the vehicle and of the environment

Definition Symbol Value Unit

Mass of the vehicle 𝑚 1000 𝑘𝑔

Reference surface 𝑆 2 𝑚2

Drag coefficient 𝐶𝐷 0.33 /

Air density 𝜌 1.225 𝑘𝑔/𝑚3

Rolling frictional coefficient 𝜇𝑡𝑜𝑡 0.02 /

Full friction velocity 𝑉𝑓𝑢𝑙𝑙 0.01 𝑚/𝑠

Position Velocity

Acceleration Time

Thrust

Figure 4. Block diagram of the dynamic simulation for the vehicle on the road

Aerodynamic_force Friction_force Input for linearization Output for linearization Input

(21)

20 𝑇𝑡𝑟𝑖𝑚 is the thrust needed to bring the vehicle to a trim condition with a velocity of 𝑉𝑡𝑟𝑖𝑚 = 50 𝑘𝑚/ℎ. It can be obtained easily from the dynamic equation by setting 𝑉̇ = 0 and 𝑉 = 𝑉𝑡𝑟𝑖𝑚 .

The arrival time is free and can be limited to a certain range represented by [𝑡𝑀𝑖𝑛, 𝑡𝑀𝑎𝑥].

Table 3. TLBO parameters for 1DOF problem

Symbols Value Unit

𝑛𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 40 / 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠 10 / 𝐽1∗ 0.1 𝑚 𝐽2∗ 0.3 𝑚/𝑠 𝑤1 0.01 / 𝑤2 0.99 /

The algorithm is initialised with 𝑛𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 vectors (number of learners) for each one of the controls input (𝑇 and 𝑡), each one of these vectors is composed by 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠

element that represent the number of design variables. Under the allowed time range, the arrival time also can be seen as a control variable to be optimized.

In order to test the TLBO algorithm power we did differ experiments with 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 changing. A reduction of 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 means an increasing of difficulties in

finding a good solution.

In the following figures are plotted, for each case, the thrust, the acceleration the velocity and the position, all function of time. Furthermore, is reported the convergence of the fitness value with respect to the number of iterations.

Table 2. Constraints of 1DOF problem

Symbols Value Unit

𝑇𝑡𝑟𝑖𝑚 274.18 𝑁 𝑇𝑀𝑖𝑛 = −2 ∙ 𝑇 𝑡𝑟𝑖𝑚 −548.36 𝑁 𝑇𝑀𝑎𝑥= 3 ∙ 𝑇𝑡𝑟𝑖𝑚 822.54 𝑁 𝑡𝑀𝑖𝑛 47 𝑠 𝑡𝑀𝑎𝑥 50 𝑠

(22)

21 • First case 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 = 𝑓𝑟𝑒𝑒

The only constraint applied here is 𝑉 > 0, this means that more solutions are available. The algorithm finds a solution with high precision, numerical targets and results are shown in Figure 5. Despite this the acceleration shape, shown in figure, represent, clearly, a bad trip for the passengers.

First case: 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 = 𝑓𝑟𝑒𝑒

(23)

22 • Second case 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 = 2

As we have introduced a constrain also on the sign change number of the acceleration, the acceleration plot shows a better shape compare to the previous experiment. The acceleration is clearly much comfortable for the passengers. The algorithm finds easily a good solution even if in this case there are many possible solutions that doesn’t verify the constrain and are rejected.

Second case: 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 = 2

(24)

23 • Third case 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 = 1

A more complicated task is given when 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 = 1. Experiments show that good solutions are not available. In most of the case only one of the targets is well respected.

In general, a smaller optimization index is obtained as the number of initial solutions increases. It is obvious because a larger number of initial solutions means a higher probability of getting a better solution. However, it’s also demonstrated that the reduction of cost function value becomes slower when the number of initial solutions increases [21]. Large number of initial solutions will add the computational load, and there is a trade-off between the solution quality and the computational efficiency under different situations.

Third case: 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑= 1

(25)

24 In a real scenario to reach a certain destination with a null velocity the driver should accelerate until a certain point then decelerate and brake. This action in the problem analysed could be translated in a reduction of the control variable number, 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠. Using 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠 = 5 experiments show that the algorithm finds a good solution and with few numbers of iteration. The results are showed in Figure 8.

This result proves that a solution will be reached with satisfying certain constraint if the algorithm inputs reflect the real behaviour that satisfy that constraint.

Furthermore, in a real scenario for a comfortable trip we will expect not only to have just one acceleration sign change during the mission but also to reach the destination point with a null acceleration.

However, as this is an introductory example of the TLBO algorithm application, we are not interested in further improvement of the results.

Case: 𝑛𝑑𝑒𝑠𝑖𝑟𝑒𝑑 = 1; 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠 = 5

(26)

25 In

Appendix A

is reported the main MATLAB code realized to accomplish the previous results.

(27)

26

5. Dynamic Model of the Quadrotor

Coordinate systems used in the derivation of the equations of motion are Earth- fixed reference frame (EFRF), Figure 10, and body-fixed reference frame (BFRF), Figure 11. In the BFRF, 𝑥𝑏 points to the front rotor, 𝑦𝑏 points to the left rotor, and 𝑧𝑏

points to up according to the right-hand rule. On the other hand, in the EFRF, 𝑥𝐸 points to the North, 𝑦𝐸 points to the West, and 𝑧𝐸 points up. The rotation of the Earth is neglected.

Figure 9. Quadrotor in a delivery task

𝑧𝐸 𝑂𝐸 𝑥 𝐸 𝑦𝐸 𝑁𝑜𝑟𝑡ℎ 𝑊𝑒𝑠𝑡 𝑔Ԧ

Figure 10. Earth-fixed reference frame

𝑂𝑏 𝑥𝑏 𝑧𝑏 𝑦𝑏 𝑇1 𝑇2 𝑇3 𝑇4 ℳ1234

Figure 11. Quadrotor scheme and Body-fixed reference frame

(28)

27 It is easy to convert vectors from the BFRF to the EFRF by using the relations below:

𝑴(𝜳) = ( 𝒄(𝜳) −𝒔(𝜳) 𝟎 𝒔(𝜳) 𝒄(𝜳) 𝟎 𝟎 𝟎 𝟏 ) ( 19 ) 𝑴(𝜱) = ( 𝟏 𝟎 𝟎 𝟎 𝒄(𝜱) −𝒔(𝜱) 𝟎 𝒔(𝜱) 𝒄(𝜱) ) ( 20 ) 𝑴(𝜣) = ( 𝒄(𝜣) 𝟎 𝒔(𝜣) 𝟎 𝟏 𝟎 −𝒔(𝜣) 𝟎 𝒄(𝜣) ) ( 21 ) 𝑴𝑩𝑬 = 𝑴(𝜳)𝑴(𝜣)𝑴(𝜱) ( 22 )

Where 𝛹, 𝛩, 𝛷 are respectively the angle of Yaw, Pitch and Roll, known as Euler’s Angles. 𝑀𝐵𝐸 represents the rotational matrix from BFRF to EFRF.

For a rigid body the Dynamics equations are given by the Newton’s Law:

{ 𝒅 𝒅𝒕(𝑸⃗⃗Ԧ) = 𝑭⃗⃗Ԧ 𝒅 𝒅𝒕(𝑲⃗⃗⃗Ԧ) = 𝑴⃗⃗⃗Ԧ ( 23 )

Choosing the CG as pole of the angular momentum balance the Linear Momentum and the Angular Momentum are given respectively by:

𝑸

⃗⃗Ԧ = 𝒎𝑽⃗⃗Ԧ ( 24 )

𝑲

⃗⃗⃗Ԧ = 𝑰𝜴⃗⃗Ԧ ( 25 )

𝑉⃗Ԧ(𝑡) and 𝛺⃗Ԧ(𝑡) are respectively the CG velocity and angular velocity of the body in the inertial frame. 𝐹Ԧ(𝑡) and 𝑀⃗⃗Ԧ(𝑡) are the external force and torque (respect to CG) acting on body. 𝑰(𝑡) is the inertia tensor.

Due to the trajectory planning problem it’s desirable to develop the first equation of (23) with respect to the EFRF and the second one with respect to the BFRF.

Besides, to get the angular momentum balance the use of the body-fixed reference frame is practical because the inertia tensor is time-invariant. Hence, using the Poison relation to express the angular momentum balance to respect the BFRF we have

[𝒅 𝒅𝒕(𝑲⃗⃗⃗Ԧ)]𝐈= [ 𝒅 𝒅𝒕(𝑰𝜴⃗⃗Ԧ)]𝑰 = [ 𝒅 𝒅𝒕(𝑰𝜴⃗⃗Ԧ)]𝑩+ 𝜴⃗⃗Ԧ ∧ (𝑰𝜴⃗⃗Ԧ) ( 26 )

(29)

28 Equations ( 23 )becomes { 𝒎 𝒅 𝒅𝒕(𝑽⃗⃗Ԧ) = 𝑭⃗⃗Ԧ [𝑰𝒅 𝒅𝒕(𝜴⃗⃗Ԧ)]𝑩+ 𝜴⃗⃗Ԧ ∧ (𝑰𝜴⃗⃗Ԧ) = 𝑴⃗⃗⃗Ԧ ( 27 )

The external forces are given by the weight of the quadrotor, the aerodynamics and the propulsion system.

𝑭

⃗⃗Ԧ = 𝑭⃗⃗Ԧ𝒘𝒆𝒊𝒈𝒉𝒕+ 𝑭⃗⃗Ԧ𝒑𝒓𝒐𝒑𝒖𝒍𝒔𝒊𝒐𝒏+ 𝑭⃗⃗Ԧ𝒂𝒆𝒓𝒐𝒅𝒚𝒏𝒂𝒎𝒊𝒄 ( 28 )

The external moments are given by the aerodynamics and the propulsion system.

𝑴

⃗⃗⃗Ԧ = 𝑴⃗⃗⃗Ԧ𝒑𝒓𝒐𝒑𝒖𝒍𝒔𝒊𝒐𝒏+ 𝑴⃗⃗⃗Ԧ𝒂𝒆𝒓𝒐𝒅𝒚𝒏𝒂𝒎𝒊𝒄 ( 29 )

5.1. External Forces

1. According with the Earth fixed reference frame, Figure 4, the force due to the weight is:

𝑭

⃗⃗Ԧ𝒘𝒆𝒊𝒈𝒉𝒕= 𝒎𝒈 [ 𝟎𝟎 −𝟏

] ( 30 )

Where 𝑚 is the quadrotor total mass and 𝑔 is the gravitational acceleration. 2. The propulsion system provides a thrust 𝑇i acting along the z-direction of

the BFRF for each motor i. 𝑭 ⃗⃗Ԧ𝒑𝒓𝒐𝒑𝒖𝒍𝒔𝒊𝒐𝒏= 𝑴𝑩𝑬 𝑭⃗⃗Ԧ 𝒑𝒓𝒐𝒑𝒖𝒍𝒕𝒊𝒐𝒏 𝑩 = 𝑴 𝑩 𝑬[ 𝟎 𝟎 𝑻𝟏+ 𝑻𝟐+ 𝑻𝟑+ 𝑻𝟒 ] ( 31 )

Using Blade Element Theory (BET) and Momentum Theory it can be deduced that the thrust and torque of a propeller are proportional to the square of its angular rate, 𝜔𝑖2 [17].

𝑭 ⃗⃗Ԧ𝒑𝒓𝒐𝒑𝒖𝒍𝒕𝒊𝒐𝒏𝑩 = [ 𝟎 𝟎 𝑻𝟏+ 𝑻𝟐+ 𝑻𝟑+ 𝑻𝟒 ] = [ 𝟎 𝟎 𝒃(𝝎𝟏𝟐+ 𝝎𝟐𝟐+ 𝝎𝟑𝟐+ 𝝎𝟒𝟑) ] ( 32 )

(30)

29 where 𝒃 is a thrust coefficient that depends on rotor geometry and density of air.

3. Aerodynamic body forces arising from the motion of the vehicle are expressed as follows [22]: 𝑭 ⃗⃗Ԧ𝒂𝒆𝒓𝒐𝒅𝒚𝒏𝒂𝒎𝒊𝒄= 𝑴𝑩𝑬 𝑭⃗⃗Ԧ 𝒂𝒆𝒓𝒐𝒅𝒚𝒏𝒂𝒎𝒊𝒄 𝑩 ( 33 ) 𝑭 ⃗⃗Ԧ𝒂𝒆𝒓𝒐𝒅𝒚𝒏𝒂𝒎𝒊𝑩 = [ 𝑭𝒂𝒙 𝑭𝒂𝒚 𝑭𝒂𝒛 ] =𝟏 𝟐𝝆𝑺𝑽 𝟐[ −𝑪𝒙𝐜𝐨𝐬(𝜷) 𝐜𝐨𝐬(𝜶) −𝑪𝒙𝐬𝐢𝐧 (𝜷) 𝑪𝒛𝐜𝐨𝐬(𝜷) 𝐬𝐢𝐧(𝜶) ] ( 34 ) Where:

• 𝜌 is the air density • 𝑆 is reference surface

• 𝐶𝑥 is the drag coefficient along 𝑥𝑏 • 𝐶𝑧 is the drag coefficient along 𝑧𝑏 • 𝛼 is the angle of attack (AOA) • 𝛽 is angle of sideslip (AOS) 5.1.1. AOA and AOS

In order to define the AOA and the AOS in a general way let’s consider the following velocities with their components.

Body velocity 𝑉⃗Ԧ = [ 𝑉𝑥 𝑉𝑦 𝑉𝑧 ] Gust velocity 𝑉⃗⃗⃗Ԧ = [𝑔 𝑉𝑔𝑥 𝑉𝑔𝑦 𝑉𝑔𝑧 ]

Relative velocity between Body and Air 𝑉⃗⃗⃗Ԧ = [𝑎

𝑉𝑎𝑥 𝑉𝑎𝑦 𝑉𝑎𝑧 ] = [ 𝑉𝑥− 𝑉𝑔𝑥 𝑉𝑦− 𝑉𝑔𝑦 𝑉𝑧− 𝑉𝑔𝑧 ]

The projection of 𝑉⃗⃗⃗Ԧ to BFRF are given by the following relations 𝑎

𝑽𝒂𝒙= |𝑽⃗⃗⃗⃗Ԧ| ∙ 𝐜𝐨𝐬(𝜷) 𝐜𝐨𝐬(𝜶)𝒂 ( 35 )

𝑽𝒂𝒚 = |𝑽⃗⃗⃗⃗Ԧ| ∙ 𝐬𝐢𝐧 (𝜷)𝒂 ( 36 )

(31)

30 From ( 35 ), ( 36 ) and ( 37 ) can be written:

𝐭𝐚𝐧(𝜶) = 𝑽𝒂𝒛 𝑽𝒂𝒙 ( 38 ) 𝐭𝐚𝐧(𝜷) = 𝑽𝒂𝒚 √𝑽𝒂𝒙𝟐+𝑽𝒂𝒛𝟐 ( 39) 5.2. External Moments

1. The moment caused by the propulsion system in the BFRF can be expressed as follows: 𝑴 ⃗⃗⃗Ԧ𝒑𝒓𝒐𝒑𝒖𝒍𝒔𝒊𝒐𝒏= [ 𝒍(−𝑻𝟐+ 𝑻𝟒) 𝒍(−𝑻𝟏+ 𝑻𝟑) −𝓜𝟏+ 𝓜𝟐−𝓜𝟑+ 𝓜𝟒 ] ( 40 )

Where ℳi is the torque produced by the i-th rotor.

According with BET and Momentum Theory we can express (40) in the following way [17]: 𝑴 ⃗⃗⃗Ԧ𝒑𝒓𝒐𝒑𝒖𝒍𝒔𝒊𝒐𝒏= [ 𝒃(𝝎𝟏𝟐+ 𝝎𝟐𝟐+ 𝝎𝟑𝟐+ 𝝎𝟒𝟑) 𝒃𝒍(−𝝎𝟐𝟐+ 𝝎𝟒𝟐) 𝒃𝒍(−𝝎𝟏𝟐+ 𝝎𝟑𝟐) 𝒅(−𝝎𝟏𝟐+ 𝝎𝟐𝟐−𝝎𝟑𝟐+ 𝝎𝟒𝟐)] ( 41 )

Where 𝑑 is a torque coefficient depending on rotor geometry and density of air. 𝑙 is the distance between the rotor axis and quadrotor CG.

2. Moments due to aerodynamic forces acting on the body are taken as zero due to assumption that the CG and the origin of body-fixed reference frame are supposed to coincide [22].

𝑴

⃗⃗⃗Ԧ𝒂𝒆𝒓𝒐𝒅𝒚𝒏𝒂𝒎𝒊𝒄 = 𝟎⃗⃗Ԧ ( 42 )

5.3. Control variables

In quadrotor dynamic and control literature it’s used to introduce the following control variables:

(32)

31 [ 𝒖𝟏 𝒖𝟐 𝒖𝟑 𝒖𝟒 ] ≜ [ 𝑻𝟏+ 𝑻𝟐+ 𝑻𝟑+ 𝑻𝟒 𝒍(−𝑻𝟐+ 𝑻𝟒) 𝒍(−𝑻𝟏+ 𝑻𝟑) −𝓜𝟏+ 𝓜𝟐−𝓜𝟑+ 𝓜𝟒 ] ( 43 )

5.4. Complete set of equations

Considering the following expression for the linear and angular velocity derivatives 𝒅 𝒅𝒕𝑽⃗⃗Ԧ = 𝒅 𝒅𝒕[ 𝑽𝒙 𝑽𝒚 𝑽𝒛 ] = [ 𝒂𝒙 𝒂𝒚 𝒂𝒛 ] ( 44 ) 𝒅 𝒅𝒕𝜴⃗⃗Ԧ = 𝒅 𝒅𝒕[ 𝑷 𝑸 𝑹 ] = [ 𝑷̇ 𝑸̇ 𝑹̇ ] ( 45 )

The complete set of equations for the rigid body motion of the quadrotor are summarized below: { 𝒂𝒙 = (𝐬𝐢𝐧(𝜳) 𝐬𝐢𝐧(𝜱) + 𝐜𝐨𝐬(𝜳) 𝐬𝐢𝐧(𝜣) 𝐜𝐨𝐬(𝜱)) ∙ [ 𝒖𝟏 𝒎− 𝟏 𝟐𝝆𝑺𝑽 𝟐 𝑪𝒙 𝒎𝐜𝐨𝐬(𝜷) 𝐜𝐨𝐬(𝜶)] 𝒂𝒚= (− 𝐜𝐨𝐬(𝜳) 𝐬𝐢𝐧(𝜱) + 𝐬𝐢𝐧(𝜳) 𝐬𝐢𝐧(𝜣) 𝐜𝐨𝐬(𝜱)) ∙ [ 𝒖𝟏 𝒎− 𝟏 𝟐𝝆𝑺𝑽 𝟐 𝑪𝒙 𝒎𝐬𝐢𝐧(𝜷)] 𝒂𝒛= 𝒈 + (𝐜𝐨𝐬(𝜣) 𝐜𝐨𝐬(𝜱)) ∙ [𝒖𝟏 𝒎+ 𝟏 𝟐𝝆𝑺𝑽 𝟐 𝑪𝒛 𝒎𝐜𝐨𝐬(𝜷) 𝐬𝐢𝐧(𝜶)] 𝑷̇ = 𝑹𝑸(𝑰𝒛−𝑰𝒚) 𝑰𝒙 + 𝒖𝟐 𝑰𝒙 𝑸̇ = 𝑹𝑷(𝑰𝒙−𝑰𝒛) 𝑰𝒚 + 𝒖𝟑 𝑰𝒛 𝑹̇ = 𝑷𝑸(𝑰𝒚−𝑰𝒙) 𝑰𝒛 + 𝒖𝟒 𝑰𝒛 ( 46 )

In order to be able to solve the dynamic of the body, to this set of six equation and twelve unknown variable we have to add the relations among the Euler’s angles first derivative and the angular speed as follow:

[ 𝜱̇ 𝜣̇ 𝜳̇ ] = ( 𝟏 𝒔𝒊𝒏(𝜱) 𝐭𝐚𝐧(𝜣) 𝒄𝒐𝒔(𝜱) 𝒕𝒂𝒏(𝜣) 𝟎 𝒄𝒐𝒔(𝜱) −𝒔𝒊𝒏(𝜱) 𝟎 𝒔𝒊𝒏(𝜱) 𝐜𝐨𝐬(𝜣) 𝒄𝒐𝒔(𝜱) 𝒄𝒐𝒔(𝜣) ) [ 𝑷 𝑸 𝑹 ] ( 47 )

(33)

32 Moreover, the expressions of the AOA and AOS must be added and with the consideration that in this work the Gust velocity is considered null ( 38 ) and ( 39 ) becomes 𝐭𝐚𝐧(𝜶) = 𝑽𝒛 𝑽𝒙 ( 48 ) 𝐭𝐚𝐧(𝜷) = 𝑽𝒚 √𝑽𝒙𝟐+𝑽𝒛𝟐 ( 49 )

At an early stage, equations (46) has been solved via MATLAB and integrated to the TLBO algorithm.

In order to verify the accuracy of the results obtained it is recommended to solve the same problem in different ways. Hence, for the simulation of the dynamic equation a SIMULINK approach has been adopted.

Comparison shows that SIMULINK approach gives better results with regard to accuracy upgrading and computation time reduction. Due to this the second way has been adopted as shown in the next section.

(34)

33

5.5. Simulink approach

From the Simulink Library Browser in the Aerospace Blockset the equations of motion developed previously are implemented in the block Equation of Motion “6DOF(Euler Angles)“, which is shown in Figure 12

Figure 13 shows the entire block diagram built for the dynamic simulation of the quadrotor motion. The constraints of the trajectory planning problem are implemented in the block Check. Once a constrain is crossed the simulation is stopped and a new simulation starts with another student (another candidate solution).

(35)

34

6. Trajectory modelling approach

In this section with reference to the Figure 1 the constraints regarding the quadrotor and delivery tasks are presented in a mathematical form.

6.1. Constraints of the trajectory planning problem

During the flight in urban environment, the quadrotor must fly within its manoeuvrability. Besides, collisions must be avoided and the shipped goods must be in good condition. These constraints are described as follows:

6.1.1. Constraints of control variables

During the flight, the motion of quadrotor needs to meet the dynamic equation. Besides, the control variable must vary with certain range. These constraints are denoted in the following equations.

Figure 13. Block diagram of the quadrotor Dynamic simulation

Weight in BRF Aerodynamics Forces Aerodynamics Moments Time Roll input Pitch input Yaw input Linear motion input Forces input Moments input Aerodynamics Forces M_inp Weight in HRF -mass*g

(36)

35 𝒖𝟏𝑴𝒊𝒏≤ 𝒖𝟏≤ 𝒖𝟏𝑴𝒂𝒙 ( 50 )

|𝒖𝟐| ≤ 𝒖𝟐𝑴𝒂𝒙 ( 51 )

|𝒖𝟑| ≤ 𝒖𝟑𝑴𝒂𝒙 ( 52 )

|𝒖𝟒| ≤ 𝒖𝟒𝑴𝒂𝒙 ( 53 )

Note that the form of the equation ( 50 ) is different from the other equations because 𝑢2, 𝑢3, 𝑢4 control the rolling, pitching and yawing

motion, respectively, which are symmetric motions about the axis 𝑂𝑏𝑥𝑏, 𝑂𝑏𝑦𝑏 and 𝑂𝑏𝑧𝑏. The range of corresponding control variable is also symmetric about 0. 𝑢1 controls the linear motion of the quadrotor in the

direction of 𝑂𝑏𝑧𝑏and the value must be positive.

6.1.2. Goods put on a flat plane

In the delivery task, the goods are required not to be inclined to some extent for the following two reasons. Inclination may make the goods broken, which has a bad influence on the express service. On the other hand, this may change the mas centre of quadrotor and make the dynamic model of quadrotor inaccurate [23].

This constraint can be expressed as follows.

|𝜣| ≤ 𝜣𝑴𝒂𝒙 ( 54 )

|𝜱| ≤ 𝜱𝑴𝒂𝒙 ( 55 )

6.1.3. Collision detection

The quadrotor must bypass the high and dense buildings in urban environment to ensure a safe flight. Buildings are regarded as cylinders. Assume that cylinders satisfy the following expression

{𝑓𝑖(𝑥, 𝑦) = 𝑅𝑖 ℎ𝑖 = ℎ̅𝑖

(𝑖 = 1,2, … , 𝑛) where 𝑛 is the number of buildings and 𝑅𝑖 and ℎ̅𝑖 are the

(37)

36 The following equation must be met to avoid the obstacles.

{

𝒇𝒊(𝒙𝒒, 𝒚𝒒) > 𝑹𝒊

𝒊𝒇 (𝒛𝒒≤𝒉̅𝒊)

( 56 )

Where (𝑥𝑞, 𝑦𝑞, 𝑧𝑞) is the current position of quadrotor.

6.2. Cost functions

In the delivery task, the goal is to send goods to the destination accurately ad in time. The flight time of quadrotor is free and can be limited to a certain range according to the customer requirement and the arrangement of express company. Under the allowed time range the arrival time of goods can be seen as a control variable to be optimized. In this case, the deviation between de destination and the final position of quadrotor is regarded as the first cost function (𝑱𝟏). The second cost function is the deviation between the destination velocity and the final velocity (𝑱𝟐).

𝑱𝟏= √(𝒙(𝒕𝒇) − 𝒙𝒅𝒆𝒔𝒊𝒓𝒆𝒅) 𝟐 + (𝒚(𝒕𝒇) − 𝒚𝒅𝒆𝒔𝒊𝒓𝒆𝒅) 𝟐 + (𝒛(𝒕𝒇) − 𝒛𝒅𝒆𝒔𝒊𝒓𝒆𝒅) 𝟐 ( 57 ) 𝑱𝟐= 𝒂𝒃𝒔(‖𝑽⃗⃗Ԧ(𝒕𝒇)‖ − 𝑽𝒅𝒆𝒔𝒊𝒓𝒆𝒅) ( 58 )

The combined cost function, 𝐽, is given by ( 15 ). (𝑥(𝑡𝑓), 𝑥(𝑡𝑓), 𝑥(𝑡𝑓)) represent the final position and (𝑥𝑑𝑒𝑠𝑖𝑟𝑒𝑑, 𝑦𝑑𝑒𝑠𝑖𝑟𝑒𝑑, 𝑧𝑑𝑒𝑠𝑖𝑟𝑒𝑑) the destination.

The velocity desired at the end point is 𝑉𝑑𝑒𝑠𝑖𝑟𝑒𝑑 and ‖𝑉⃗Ԧ(𝑡𝑓)‖ is the final velocity.

(38)

37

7. Experimental studies

The proposed TLBO trajectory planning method for quadrotor delivering in urban environment is analysed in different scenarios.

7.1. Results under different environment

To test the validity of the TLBO method solving the trajectory planning problem for quadrotor delivery in urban environment, different scenarios are set. The first scenario is simple: no building are set in urban environment, and the trajectory of quadrotor is presented in Figure 14. In the second scenario, 7 building are set. This makes the urban environment more complicated and adds the difficulty of generating a feasible trajectory. The trajectory in this scenario is shown in Figure 15.

Figure 14. Trajectory of the quadrotor with no buildings obstacles

(39)

38 The results shown in Figure 16 and Figure 17 demonstrate that the trajectories can meet the constraints regarding the attitude angles and control variables listed in Table 5 with respect the TLBO parameters listed in Table 4.

Thus, the safety of goods and the feasibility of inputs are guaranteed.

As we have done for the 1DOF problem initialization, the algorithm has been initialised with 𝑛𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 vectors (number of learners) for each one of control inputs (𝑢1, 𝑢2, 𝑢3, 𝑢4 and 𝑡) , each one of these vectors is composed by 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠 element that represent the number of design variables. Again, the arrival time of goods can be seen as a control variable to be optimized

Figure 15. Trajectory of the quadrotor with buildings obstacles

Table 4. TLBO parameters for quadrotor trajectory problem

Constant Value Unit

𝑛𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 25 / 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠 70 / 𝑤1 0.25 / 𝑤2 0.75 / 𝐽1∗ 0.6 𝑚 𝐽2∗ 0.1 𝑚/𝑠

(40)

39 To further test the effectiveness of the TLBO method we want to minimize not only

Table 5. Constraints in the quadrotor trajectory planning model

Symbols Value Unit

𝒖𝒉𝒐𝒗𝒆𝒓𝒊𝒏𝒈= 𝒎 ∙ 𝒈 4.71 𝑁 𝒖𝟏𝑴𝒊𝒏= 𝟎. 𝟖𝟖 ∙ 𝒖𝒉𝒐𝒗𝒆𝒓𝒊𝒏𝒈 4.14 𝑁 𝒖𝟏𝑴𝒂𝒙= 𝟏. 𝟏𝟓 ∙ 𝒖𝒉𝒐𝒗𝒆𝒓𝒊𝒏𝒈 5.41 𝑁 𝒖𝟐𝑴𝒂𝒙 3 ∙ 10−5 𝑁 ∙ 𝑚 𝒖𝟑𝑴𝒂𝒙 3 ∙ 10−5 𝑁 ∙ 𝑚 𝒖𝟒𝑴𝒂𝒙 6 ∙ 10−5 𝑁 ∙ 𝑚 𝛩𝑀𝑎𝑥 20 𝑑𝑒𝑔 𝛷𝑀𝑎𝑥 20 𝑑𝑒𝑔 𝑡𝑀𝑎𝑥 53 𝑠 𝑡𝑀𝑖𝑛 50 𝑠

Figure 16. Control variables with and without obstacles

No obstacles With obstacles

Figure 17. Euler's angles with and without obstacles

(41)

40 the deviation between the destination and the final position of the quadrotor but we want that the quadrotor reaches the target position with a certain velocity. A target on the velocity could be seen as a course angle target. Hence, to the previous two scenario we add a course angle target. Figure 18 and Figure 19 show the results obtained. In both scenarios is chosen a null course angle target. Considering the definition of course angle [24] and that the 𝑥𝐸 direction matches to the North direction, it means that

𝑉𝑦(𝑡𝑓) = 0.

Figure 18. 𝒙𝑬− 𝒚𝑬 trajectory without

building obstacles and course target Table 6. Quadrotor trajectory with course target, without buildings obstacles

Start Target Results Unit

𝑉𝑦(𝑡𝑓) 0 0 −0.0308 𝑚/𝑠

𝑥 0 100 100.2103 𝑚

𝑦 0 100 99.5462 𝑚

(42)

41

7.2. Multi-phase path

The delivery tasks in an urban environment cover a region much bigger than the one shown in the previous results. To face this problem, we can consider the previous path as take-off cruise path of the entire trajectory. The entire trajectory could be regarded as a multi-phase path composed by:

1) Take-off cruise path 2) Cruise path

3) Landing path

7.2.1. Cruise path

The cruise path could be treated as a multi segment path connected by way-points as well. Without lose in generality we considered just one single segment, cruise-1. cruise-1 has the starting conditions matching with the Take-off cruise path final conditions. The target position

(way-Table 7. Quadrotor trajectory with course target, with buildings obstacles

Start Target Results Unit

𝑉𝑦(𝑡𝑓) 0 0 −0.0219 𝑚/𝑠

𝑥 0 100 99.3525 𝑚

𝑦 0 100 100.1576 𝑚

𝑧 80 90 90.3738 𝑚

Figure 19. 𝒙𝑬− 𝒚𝑬trajectory with building

(43)

42 point) and the target course are free to be chosen. As we have considered a developing of the trajectory along the North direction, the second way-point is (350,20,70) and again the course target considered is 𝑉𝑦(𝑡𝑓) = 0.

The constraints related to the control variables and to the goods put on a flat plane are suitable also for a multi segment cruise path. Hence no changes on these constraints are made.

Due to the 𝐽1∗ and 𝐽2∗ changing, results show that for a better convergence of the algorithm a changing in TLBO weight parameter should be done. In Table 8 are listed these parameters.

Table 8. TLBO parameter for quadrotor trajectory- cruise-1

Constant Value Unit

𝑛𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 25 / 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠 70 / 𝑤1 0.5 / 𝑤2 0.5 / 𝐽1∗ 0.35 𝑚 𝐽20.1 𝑚/𝑠 Table 9. Cruise-1

Start Target Results Unit

𝑉𝑦(𝑡𝑓) −0.0219 0 0.0232 𝑚/𝑠

𝑥 99.3525 350 350.0150 𝑚

𝑦 100.1576 20 20.2644 𝑚

(44)

43 Figure 20 and Figure 21 show the cruise-1 trajectory. Four more buildings are added in order to maintain a reasonable real environment. Results in Table 9 shows that the quadrotor reaches the destination point with high accuracy.

It must be noted that the target point of cruise-1 is located fare compare to the target point of take-off cruise path because the cruise-1 start with

Figure 20. Cruse-1 trajectory

(45)

44 a certain velocity not null, hence it can fly for long distances in the same time range of take-off cruise. Besides, this gives a trajectory much straighter.

7.2.2. Landing path

The target of landing path is to reach the final delivery destination with zero velocity. This is a target most complicate compared to the one with 𝑉𝑦(𝑡𝑓) = 0, in this case all the three components of the velocity mast be zero simultaneously.

‖𝑉⃗Ԧ(𝑡𝑓)‖ = √𝑉𝑥2(𝑡

𝑓) + 𝑉𝑦2(𝑡𝑓) + 𝑉𝑧2(𝑡𝑓) = 0

Experiments shows that the control variable constraints used in the previous phases are too high to find good solutions within a reasonable number of iteration (e.g. calculation time). Hence, a restriction of the control constraints is needed. This change is physically explained, the quadrotor should reduce the power in order to decrease the velocity. The new constraints regarding the control variables are listed in Table 1. The constraints related to the rotational control variables doesn’t need to be changed.

Experiments show that for a better convergence of the algorithm TLBO weight parameter should be tuned as in Table 11.

Table 10. Constraints in the landing phase

Symbols Value Unit

𝒖𝒉𝒐𝒗𝒆𝒓𝒊𝒏𝒈= 𝒎 ∙ 𝒈 4.71 𝑁 𝒖𝟏𝑴𝒊𝒏= 𝟎. 𝟗𝟖 ∙ 𝒖𝒉𝒐𝒗𝒆𝒓𝒊𝒏𝒈 4.6158 𝑁 𝒖𝟏𝑴𝒂𝒙= 𝟏. 𝟎𝟐 ∙ 𝒖𝒉𝒐𝒗𝒆𝒓𝒊𝒏𝒈 4.8042 𝑁

Table 11. TLBO parameters for quadrotor trajectory problem-Landing

Constant Value Unit

𝑛𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 25 / 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠 70 / 𝑤1 0.35 / 𝑤2 0.65 / 𝐽1∗ 0.35 𝑚 𝐽2∗ 0.1 𝑚/𝑠

(46)

45 No obstacles are considered in this phase, it makes the algorithm finding a good solution easily compare to an area with obstacles. The results are shown in Figure 22 and Figure 23. Table 1 shows the accuracy of the results.

Figure 22. Landing Trajectory Table 12. Landing phase

Start Target Results Unit

𝑉𝑥(𝑡𝑓) 7.1209 0 −0.0357 𝑚/𝑠 𝑉𝑦(𝑡𝑓) 0.0232 0 0.0571 𝑚/𝑠 𝑉𝑧(𝑡𝑓) −0.9624 0 0.0319 𝑚/𝑠 𝑥 350.0150 550 549.1952 𝑚 𝑦 20.2644 60 59.6133 𝑚 𝑧 70.0413 50 50.6980 𝑚

(47)

46

7.3. Entire path

All the phases considered previously can be joined to obtain the entire path that is represented in Figure 24 and Figure 25.

Figure 23. 𝒙𝑬− 𝒚𝑬 landing trajectory

(48)

47 In

Appendix A

are reported for each phase of the delivery trajectory the relative optimization parameters and numerical results related to the quadrotor dynamic through tables and plots.

Furthermore, as the algorithm is the same for each phase of the total path because just the input parameters and targets are different, in

Appendix C

is reported the main MTLAB code realized to accomplish only the take-off cruise path.

(49)

48

8. Conclusion

Two different problem have been addressed using the proposed TLBO method in this work. A simple trajectory planning problem for a terrestrial vehicle and trajectory planning problem for a quadrotor in urban environment. Literature investigation shows that the modelling work in trajectory planning through TLBO technique, especially on delivery task in urban environment, is insufficient. Hence, the validity of TLBO algorithm in solving trajectory planning problem with multiple constraints need to be still verified.

The principles of TLBO algorithm are described first, and how TLBO algorithm is integrated into the trajectory planning problem is further explained.

First, the dynamic, the constraints and the goals is presented for a terrestrial vehicle. Results show that in order to get optimal solutions, with satisfied constraints, the TLBO’s parameters have to be well settled. It means the parameters have to be tuned in a way that the number of discarded solutions, due to the constraints, are minimized. Hence, TLBO’s parameters must be as much as possible close to the one that reflect a real situation. It can be concluded that 𝑚𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑠 = 5 and 𝑛𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 = 40 can result in solutions good enough in this problem.

Second, the dynamic of quadrotor, the constraints of quadrotor manoeuvrability, urban environment and delivery task are considered in the trajectory planning model, and the goals are to minimize the deviation between the destination targets and the relative quantities at the quadrotor final position. To test the proposed algorithm three different scenarios are analysed, which represent the main phase of a delivery task: Take-off cruise path, cruise path and landing path.

Results show that, once the TLBO’s parameters are well settled, the algorithm is able to reach the targets with respect to all the constraints. In particular for the first two phases of the trajectory the TLBO’s parameters match; for the landing phase a reduction of the control variable 𝑢1 must be realized. This represent a well settling

procedure of the parameters, indeed in a real landing situation a reduction of the range power is realized.

In the future, there are different constraints and target that could be considered. As no constraint on the control inputs rate are taken into account in this work, the obtained control input can result in an over power consumption considering that the energy requested by the vehicle during the mission is ∝ (𝜔̇𝑖(𝑡), 𝜔𝑖2(𝑡), 𝜔

(50)

49 as reported in [25]. Hence, a third cost function should be added in order to generate trajectories with minimum energy. Besides, also the wind can affect the energy consumption, a much real environment could be realized therefore adding a wind field.

(51)

50

Appendix A

Below is reported the TLBO algorithm realized for the multi-objective optimization problem of the vehicle studied in this work.

% ---% TLBO algorithm

%

% TLBO is applied to a simple case. A multi-objective optimization problem is faced % for a terrestrial vehicle which dynamics is described with a 1 DOF

% non-linear model. %

% A. Suti - 21/10/2019 (Last update)

% ---clear all

tic

% Withdraw data

Veicolo_1_DOF_Simulink_dati

% Simulation initial condition

V0 = 0; % Initial Velocity [m/s]

% Targets

x_target = 250 ; % Final position [m] V_target = 0 ; % Final velocity [m/s]

% TLBO parameters

n_solution = 40 ; % Number of solutions (n_students) n_students = 5 ; % Subjects number (m_subjects) peso1 = 0.01 ; % Weight on position (w_1)

peso2 = 0.99 ; % Weight on velocity (w_2)

delta_posizione_best = 0.1 ; % Best solution on position deviation (J^*_1) delta_V_best = 0.3 ; % Best solution on velocity deviation (J^*_2)

% Control variables ranges

u1_max = 3*T_trim ; % Thrust[N]

u1_min = -2*T_trim ; % Posto a 2 perche a 2.5 perdevo troppe soluzioni a causa di V<0

% Time range

t_min = 47; % Minimum time [s] t_max = 50; % Maximum time [s]

% Acceleration Constrain on sign changing n_attra_max = 1; Initialization u1 = zeros(n_students,n_solution); tf = zeros(1,n_solution) ; u1_new = zeros(n_students,n_solution); tf_new = zeros(1,n_solution) ;

(52)

51

% Optimization index

% Combined optimization index (J) J = zeros(1,n_solution); J_new = zeros(1,n_solution); J_update = zeros(1,n_solution);

% Position deviation optimization index (J1) J1 = zeros(1,n_solution);

J1_new = zeros(1,n_solution); J1_update = zeros(1,n_solution);

% Velocity deviation optimization index (J2) J2 = zeros(1,n_solution);

J2_new = zeros(1,n_solution); J2_update = zeros(1,n_solution);

% Student and subject realization

for j=1:n_solution % Number of solutions (n_students)

tf(j) = t_min+(t_max-t_min)*rand(1,1);

for i = 1:n_students % Subjects number (m_subjects)

u1(i,j) = u1_min + (u1_max-u1_min).*rand(1,1);

end end

% Container for the teacher factor

delta_u1 = zeros(n_students,n_solution); delta_tf = zeros(1,n_solution) ;

%Container for the summation sum1 = zeros(n_students,1); sumtf = 0;

% Students score for each subject

for j=1:n_solution tempo_finale = tf(j);

%time linearly spaced for the simulink input t_out = linspace(0,tempo_finale,n_students);

% Simulink input (control_input_sim=[application_time control_input]) u1_in = [ t_out' u1(:,j) ];

sim('TLBO_Veicolo_1_DOF_Simulink')

%Name change for position and velocity x_out = posizione;

Vk_out = velocita;

% For a simulation with matlab function

% [x_out,y_out,z_out,Vk_out,collision]=Dynamics_simulink(u1(:,j),... %

Riferimenti

Documenti correlati

Stochastic Trajectory Generation Using Particle Swarm Optimization for Quadrotor Unmanned Aerial Vehicles (UAVs).. Babak Salamat * and

The method is based on the dynamic and electro-mechanical modeling of one-degree-of-freedom systems and the derivation of the energy formulation for standard

It was found how solution 5_16 produces the minimum total pressure losses coefficient, hence the best value of the first objective

Mio H, Komatsuki S, Akashi M, Shimosaka A, Shirakawa Y, Hidaka J, Kadowaki M, Yokoyama H, Matsuzaki S, Kunitomo K (2010) Analysis of traveling behavior of nut coke particles

Key–Words: hard optimization problems, optimization algorithms, swarm intelligence, elephant herding optimiza- tion, EHO..

Based on this expression and the form of the governing diffusion equation, a corresponding expression for the diffusion coefficient is derived, that contains the same parameters

memorie italiane scritte nell’immediato dopoguerra da tre donne ebree sopravvissute al campo di sterminio di Auschwitz: Luciana Nissim Momigliano, Liana Millu, Edith

With respect to CNC machines, where accelerations in the end-effector space are linearly correlated with those in the joint space, robots with non-spherical wrist, characterized by