Open access peer-reviewed chapter

On the Computational Analysis of the Genetic Algorithm for Attitude Control of a Carrier System

By Hadi Jahanshahi and Naeimeh Najafizadeh Sari

Submitted: December 3rd 2017Reviewed: January 17th 2018Published: August 29th 2018

DOI: 10.5772/intechopen.74121

Downloaded: 716


This chapter intends to cover three main topics. First, a fuzzy-PID controller is designed to control the propulsion vector of a launch vehicle, accommodating a CanSaT. Then, the genetic algorithm (GA) is employed to optimize the controller’s performance. Finally, through adjusting the algorithm parameters, their effect on the optimization process is examined. In this regard, the motion vector control is programmed based on the governing system’s dynamic equations of motion for payload delivery in the desired altitude and flight-path angle. This utilizes one single input and one preference fuzzy inference engine, where the latter acts to avoid the system instability in high angles for the propulsion vector. The optimization objective functions include the deviations of the thrust vector and the system from the stability path, which must be met simultaneously. Parameter sensitivity analysis of the genetic algorithm involves examining nine different cases and discussing their effect on the optimization results.


  • fuzzy-PID controller
  • CanSat
  • genetic algorithm
  • parameter sensitivity analysis

1. Introduction

Due to costly space projects, affordable flight models and test prototypes are of incomparable importance in academic and research applications, such as data acquisition and subsystems testing. In this regard, CanSat could be used as a low-cost, high-tech, and light-weight model; this makes it popular in academia. CanSat is constituted from the words “can” and “sat,” which collectively means a satellite that is embeddable in a soda can [1]. In these apparatuses, an electronic payload is placed into a container dimensionally comparable to a soda can; it is then launched into space with a rocket or balloon [2]. The attained altitude is a few thousand meters, which is much lower than the altitude of sounding rockets [3].

The concept of fuzzy logic was introduced by Zadeh in 1965; it has been improved by several researchers, forming a potent tool for a variety of applications [4]. For example, Precup and Hellendoorn [5] and Larsen [6] have used fuzzy logic in controllers for various industrial and research applications. The control area has attracted the most significant studies on fuzzy systems [715]. Petrov et al. have used fuzzy-PID controllers to control systems with different nonlinear terms [16]. Hu and colleagues proposed a new and simple method for fuzzy-PID controller design based on fuzzy logic and GA-based optimization [17]. Juang et al. have used triangular membership functions in fuzzy inference systems along with a genetic algorithm to tune parameters or fuzzy-PID controllers [18]. Operating fuzzy-PID controllers and online adjustment of fuzzy parameters were the main output of Resnick et al. researches [19].

In 1950, Alan Turing proposed a “learning machine” which would parallel the principles of evolution [20]. Genetic algorithms (GAs) are stochastic global search and optimization methods that mimic the metaphor of natural biological evolution [21]. GAs consider the principle of survival of the fittest to produce better generations out of a population. Although genetic algorithms cannot always provide the optimal solution, it has its own advantages [22] and is a powerful tool for solving complex problems. GA is an effective strategy and had successfully been used in the offline control of systems by a number of studies. Krishnakumar and Goldberg [23] have shown the efficiency of genetic optimization methods in deriving controller structures in aerospace applications compared to traditional methods such as LQR and Powell’s gain set design. Porter and Mohamed [24] have taken initiative and by the use of GA have offered a simple and applicable eigenstructure assignment solution which is applied to the design of multivariable flight-control system of an aircraft. Others have denoted how to use GA to choose control structures [25].

Heuristic methods are highly dependent on their agents and parameters. Therefore, GA properties (mainly population size and crossover ratio) are of high importance in finding optimum points which are usually found by sensitivity analysis. These parameters are defined for a better acquaintance of readers in the following.

This chapter focuses on designing a GA-based fuzzy-PID controller. A two-termed cost function containing path and thrust vector deviations is fed into GA code to be optimized. The code adjusts the parameters. Nine different combinations with relative optimality are discussed. The chapter is dissected into following sections:

  • “CanSaT carrier system” which presents a simple model of the carrier system

  • “Fuzzy-PID controller” that describes controller design and its parameters

  • “Optimization” which describes the optimization process

  • “Results and discussion” that clarify results and comparisons

  • “Conclusion”

  • “References”


2. CanSaT carrier system

The dynamic equations of a CanSaT carrier system is derived from the Newtonian law. It should be added that in the separation stage, the projection of satellite velocity vector must be tangent to the horizontal plane. Figure 1 shows a simplified model of a launch vehicle in which θis the angle of the longitudinal vector of the vehicle in the perpendicular direction (toward the ground) and φis the angle of its propulsion with body centerline.

Figure 1.

Carrier system scheme.

The dynamics of the system can be summarized in


in which MCMis the moment around the center of mass, Iis the inertial moment, and Iis the angular acceleration about an axis perpendicular to the plane. Eq. (1) can be expanded to (2)


In the notation lis used for the length of the vehicle, Ffor the propulsion force, and Fnfor its projection perpendicular to the longitudinal direction of launch vehicle. It is known that the vehicle moves along the vertical axis with acceleration of. Therefore, Newton equation for that axis is rearranged as below:


in which Fzand mare, respectively, the force along the vertical axis and the mass of the launch vehicle. Eq. (3) can be rewritten as below:


Meanwhile, geometric relations dictate the following equations in the vertical plane:


By substituting (6) in (4), we have


Insertion of (5) into (2) in a similar pattern yields to


with considering θ=0and substitution of (7) in (8) results in


By substituting 12Imla+gby band tanφby ut, the dynamic equation of the system leads to


in which utis the control parameter. Therefore, equations of system states take the following form:


where θand θ̇are, respectively, represented by x1tand x2t. The measurable state vector is notated by X=x1x2T.


3. Fuzzy controller design

Two types of fuzzy inference motors are utilized in the proposed fuzzy controller [26]. The first type is single input fuzzy inference motor (SIFIM). The second inference motor type is the preferred fuzzy inference motor (PFIM) that represents the control priority order of each norm block output.


The SIFIMipoints to single input inference motors which accepts the ithinput, and Rijis the jthrule of the ithsingle input inference motor. Also, Aijand Cijare relevant membership functions. Each input item usually has a different role in the implementation of control. In order to express the different effects of implementing each input item in the system, single input fuzzy inference motor defines a dynamic importance degree (wiD) for each input item as (13)


where wi, Bi, and wiare control parameters described by fuzzy rules. SIFIMiblock calculates fias follows:


The membership functions of SIFIMs are shown in Figure 2. As mentioned before f1, f2,and f3, the SIFIMfuzzy rules are extracted from Table 1.

Figure 2.

Membership functions of SIFIMs (note: NB = negative big; Z = zero; PB = positive big).


Table 1.

Fuzzy rules of SIFIMs.

The other type of fuzzy inference motors (PFIMs) guarantees satellite control system performance using desired values in one or more axes of the coordinate system. PFIM-icalculates wias follows:


The membership functions of PFIMs are shown in Figure 3, while their fuzzy rules are tabulated in Table 2.

Figure 3.

Membership functions of PFIM (note: DS = distance short; DM = distance medium; DL = distance long).


Table 2.

Fuzzy rules of PFIMs.

By calculating fiand wi∆Wi, it is possible to define fuzzy-PID controller as (16)


where uFuzzyPIDis the control action and θ̂dt, θ̂, and dθ̂dtare, respectively, the fuzzy forms of θdt, θ, and dtand should be obtained from SIFIM. In other words, we have θ̂dt=f1, θ̂=f2, and dθ̂dt=f3. Parameters of K̂, K̂and K̂in (7) are fuzzy variables calculated by following equations:


in which Kb, Kθb,and Kbare the base variables and Kr, Kθr, and Krare regulation variables. While it is possible to find these variables by trial and error, the best way to find them is using optimization approaches like evolutionary algorithms, especially genetic algorithm (GA).


4. Optimization

GA is an approach for solving optimization problems based on biological evolution via repeatedly modifying a population of individual solutions. At each level, individuals are chosen randomly from the current population (as parents) and then employed to produce the children for the next generation. In this chapter, the following operators are implemented for optimization of the fuzzy-PID controller:

  • Population size (PS):Increasing the population size enables GA to search more points and thereby obtain a better result. However, the larger the population size, the longer it takes for the GA to compute each generation.

  • Crossover options:Crossover options specify how GA combines two individuals, or parents, to form a crossover child for the next generation.

  • Crossover fraction (CF):Crossover fraction specifies the fraction of each population, other than elite children, that are made up of crossover children.

  • Selection function:Selection function specifies how GA chooses parents for the next generation.

  • Migration options:Migration options determine how individuals move between subpopulations. Migration occurs if the population size is set to be a vector of length greater than 1. When migration occurs, the best individuals from one subpopulation replace the worst individuals in another subpopulation. Individuals that migrate from one subpopulation to another are copied. They are not removed from the source subpopulation.

  • Stopping criteria options:Stopping criteria options specify the causes of terminating the algorithm.

In this chapter, the configuration of GA is set at the values given in Table 3.

CF0.4, 0.6, 0.8
PS90, 200, 500
Selection functionTournament
Mutation functionConstraint dependent
Crossover functionIntermediate
Migration directionForward
Migration fraction0.2
Migration interval20
Stopping criteriaFitness limit to 10−4

Table 3.

GA configuration parameters.

Furthermore, the multi-objective optimization of the proposed fuzzy-PID controller is done with respect to six design variables and two objective functions (OFs). The base values [Kb, Kb, Kb] and regulation values [Kr, Kr, Kr] are the design variables. The system’s angle of deviation from equilibrium point and the thrust vector’s angle of deviation are, respectively, defined as OF1 and OF2:


5. Results and discussion

In this section, by regarding two aforementioned OFs, the effect of two parameters of PS and CF is measured in the optimization. Figure 4 represents Pareto fronts of these two functions after optimization. Meanwhile, Figure 5 shows the system’s position under performance of the designed controller. The angle of propulsion vector of the CanSaT carrier system is demonstrated in Figure 6. Tables 46 display the magnitude of design variables. OF1 and OF2 are shown for optimum points of Ai, Bi, and Ciin Tables 79. The best values satisfying the two OFs with the constraints of minimum settling time and overshoot are presented. The relevant magnitude of PS and CF to each figure is brought in its legend. The points Aii=129, Bii=129, and Cii=129are, respectively, the best for the first, the second, and both OFs.

Figure 4.

Pareto front by Objectives 1 and 2 corresponds to the (a) PS = 90 and CF = 0.4, (b) PS = 90 and CF = 0.6, (c) PS = 90 and CF = 0.8, (d) PS = 200 and CF = 0.4, (e) PS = 200 and CF = 0.6, (f) PS = 200 and CF = 0.8, (g) PS = 200 and CF = 0.4, (h) PS = 200 and CF = 0.6, and (i) PS = 200 and CF = 0.8.

Figure 5.

Time response of the CanSaT carrier system’s position for (a) A1, B1, and C1; (b) A2, B2, and C2; (c) A3, B3, and C3; (d) A4, B4, and C4; (e) A5, B5, and C5; (f) A6, B6, and C6; (g) A7, B7, and C7; (h) A8, B8, and C8; and (i) A9, B9, and C9 as the optimum points.

Figure 6.

Time response of the thrust angle of CanSaT carrier system for (a) A1, B1, and C1; (b) A2, B2, and C2; (c) A3, B3, and C3; (d) A4, B4, and C4; (e) A5, B5, and C5; (f) A6, B6, and C6; (g) A7, B7, and C7; (h) A8, B8, and C8; and (i) A9, B9, and C9 as the optimum points.

Design variablePoint PS = 90/CF = 0.4ValuePoint PS = 90/CF = 0.6ValuePoint PS = 90/CF = 0.8Value

Table 4.

Design variables for Ai, Bi, and Ci(i = 1, 2, 3).

Design variablePoint PS = 200/CF = 0.4ValuePoint PS = 200/CF = 0.6ValuePoint PS = 200/CF = 0.8Value

Table 5.

Design variables for Ai, Bi, and Ci(i = 4, 5, 6).

Design variablePoint PS = 500/CF = 0.4ValuePoint PS = 500/CF = 0.6ValuePoint PS = 500/CF = 0.8Value

Table 6.

Design variables for Ai, Bi, and Ci(i = 7, 8, 9).

Objective functionPoint PS = 90/CF = 0.4ValuePoint PS = 90/CF = 0.6ValuePoint PS = 90/CF = 0.8Value

Table 7.

Objective functions for Ai, Bi, and Ci(i = 1, 2, 3).

Objective functionPoint PS = 200/CF = 0.4ValuePoint PS = 200/CF = 0.6ValuePoint PS = 200/CF = 0.8Value

Table 8.

Objective functions for Ai, Bi, and Ci(i = 4, 5, 6).

Objective functionPoint PS = 500/CF = 0.4ValuePoint PS = 500/CF = 0.6ValuePoint PS = 500/CF = 0.8Value

Table 9.

Objective functions for Ai, Bi, and Ci(i = 7, 8, 9).

Further, as seen in Figure 4, points Ai and Ciare in a near proximity in which in some cases a coincidence occurs. It is mainly due to non-convergence of CanSaT carrier launch vehicle points with points far from Ai. A similar behavior is observed from Pareto fronts of the situation, angular velocity, and angle of the propulsion vector for the launch vehicle.

To analyze the effects of each parameter in GA, Figures 712 are produced. Figure 7 shows the dependency of OF1 (at points Ai) to nine different combination forms of GA parameters. The figure shows that the minimum area under “situation of launch vehicle” curve is obtainable for PS = 200 and CF = 0.8. It is also inferred that for better results, parameters PS and CF must be increased simultaneously. For low PS, increasing CF helps to improve first OF, but with more magnitudes of PS, higher CFs yield better results.

Figure 7.

GA parameters versus OF1 for the best points from the viewpoint of OF1.

Figure 8.

GA parameters versus OF2 for the best points from the viewpoint of OF1.

Figure 9.

GA parameters versus OF1 for the best points from the viewpoint of OF2.

Figure 10.

GA parameters versus OF2 for the best points from the viewpoint of OF2.

Figure 11.

GA parameters versus OF1 for the best points from the viewpoint of OF1 and OF2.

Figure 12.

GA parameters versus OF2 for the best points from the viewpoint of OF1 and OF2.

Figure 8 represents dependency of OF2 (at points Ai) to nine different forms of combinations of GA parameters. The figure shows the least area below the deviation angle of the thrust curve for CanSaT carrier system when PS = 500 and CF = 0.6. Figures 9 and 10 propose that the smallest magnitude for the first and second OFs (pertaining to Bi) is achievable for, respectively, PS = 500 and CF = 0.6 and PS = 500 and CF = 0.4. In Figures 11 and 12, magnitudes of the first and second objective functions in Ci Points are represented, respectively. The first OF proposed the point C1 with PS = 90 and CF = 0.4. Meanwhile, the second function insists on the point with PS = 90 and CF = 0.8.


6. Conclusion

This chapter represents a design of a fuzzy controller based on a GA code for the purpose of controlling propulsion vector of a launch vehicle which carries CanSaT. Minimizing the errors initiated by system deviation from equilibrium state and propulsion thrust deviation are two objectives for optimizing this controller. This is done by manipulating GA parameters in nine different combination forms to satisfy each objective function and also both of them simultaneously. Further it is examined how these parameters affect the optimal points.

By observing constraints of minimum settling time and overshoot, the results show that the optimal points proposed by the first OF are in proximity with the ones from both OFs which in some cases end in coincidence. Finally, by comparing magnitudes of OFs for various combinations of GA parameters, the optimum points and their relevant parameters are introduced.


Conflict of interest

The authors declare that there is no conflict of interest.

© 2018 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Hadi Jahanshahi and Naeimeh Najafizadeh Sari (August 29th 2018). On the Computational Analysis of the Genetic Algorithm for Attitude Control of a Carrier System, Intelligent System, Chatchawal Wongchoosuk, IntechOpen, DOI: 10.5772/intechopen.74121. Available from:

chapter statistics

716total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Multiagent Intelligent System of Convergent Sensor Data Processing for the Smart&Safe Road

By Alexey Finogeev, Alexandr Bershadsky, Anton Finogeev, Ludmila Fionova and Michael Deev

Related Book

First chapter

Introductory Chapter: 2D Materials

By Yotsarayuth Seekaew and Chatchawal Wongchoosuk

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us