On the computational analysis of the genetic algorithm for attitude control of a carrier system

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


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 [1]. CanSat is constituted from the words "can" and "sat," which collectively means a satellite that is embeddable in a soda can [2]. In these apparatuses, an electronic payload placed into a container dimensionally comparable to a soda can; it is then launched into space with a rocket or balloon [3]. The attained altitude is a few thousand meters, which is much lower than the altitude of sounding rockets [4].
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 [5]. For example, Precup and Hellendoorn [6] and Larsen [7] have used fuzzy logic in controllers for various industrial and research applications. The control area has attracted the most significant studies on fuzzy systems [8][9][10][11][12][13][14][15][16][17]. Petrov et al. have used fuzzy-PID controllers to control systems with different nonlinear terms [18]. Hu and colleagues proposed a new and simple method for fuzzy-PID controller design based on fuzzy logic and GA-based optimization [19]. Juang et al. have used triangular membership functions in fuzzy inference systems along with a genetic algorithm to tune parameters or fuzzy-PID controllers [20]. Operating fuzzy-PID controllers and online adjustment of fuzzy parameters were the main output of Resnick et al. researches [21].
In 1950, Alan Turing proposed a "learning machine" which would parallel the principles of evolution [22]. Genetic algorithms (GAs) are stochastic global search and optimization methods that mimic the metaphor of natural biological evolution [23]. 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 [24] 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 [25] 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 [26] 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 [27].
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 paper 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 paper 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"

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 thrust with body centerline. The dynamics of the system can be summarized in: in which is the moment around the center of mass, is the inertial moment, and is the angular acceleration about an axis perpendicular to the plane. Eq. (1) can be expanded to (2) In the notation is used for the length of the vehicle, for the thrust force, and for 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 and are, respectively, the force along the vertical axis and the mass of the launch vehicle. Eq. (3) can be rewritten as below: Insertion of (5) into (2) in a similar pattern yields to with considering = 0 and substitution of (7) in (8) results in: By substituting −1 2 ( + ) by and ( ) by , the dynamic equation of the system leads to ̈= (10) in which is the control parameter. Therefore, equations of system states take the following form: where and ̇ are, respectively, represented by 1 ( ) and 2 ( ). The measurable state vector is notated by = [ 1 , 2 ] .

Fuzzy controller design
Two types of fuzzy inference engines are utilized in the proposed fuzzy controller [17]. The first type is single input fuzzy inference engine (SIFIE). The second inference motor type is the preferential fuzzy inference engine (PFIE) that represents the control priority order of each norm block output.
The SIFIE-i represents to single input inference engine which accepts the ℎ input, and is the ℎ rule of the ℎ single input inference engine. Also, and are relevant membership functions. Each input item usually has a different role in the implementation of control. In order to express the different impacts of implementing each input item in the system, single input fuzzy inference engine defines a dynamic importance degree ( ) for each input item as (13).
− block calculates as follows: The membership functions of SIFIEs are shown in Figure 2. As mentioned before 1 , 2 and 3 , the SIFIEs fuzzy rules are extracted from Table 1.  Table 1. Fuzzy rules of SIFIEs.
The other type of fuzzy inference engine (PFIE) guarantees satellite control system performance using desired values in one or more axes of the coordinate system. PFIE-i calculates ∆ as follows: The membership functions of PFIEs are shown in Figure 3, while their fuzzy rules are tabulated in Table 2.  Table 2. Fuzzy rules of PFIEs.
By calculating and ∆ , it is possible to define fuzzy-PID controller as (16).
where Fuzzy PID u − is the control action and ∫̂, ̂ and ̂ are, respectively, the fuzzy forms of ∫ , , and , and should be obtained from SIFIE. In other words, we have ∫̂= 1 , ̂= 2 and ̂= 3 . Parameters of ̂, ̂ and ̂ in (7) are fuzzy variables calculated by following equations: , and are the base variables and , , and are regulation variables. While it is possible to find these variables by try and error, the best way to find them is using optimization approaches like evolutionary algorithms, especially genetic algorithm (GA).

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 paper, 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. 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 paper, the configuration of GA is set at the values given in Table 3.  Table 3. GA configuration parameters.

Results and discussion
In this section, by regarding two aforementioned OFs, the impact 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 thrust vector of the CanSat carrier system is demonstrated in Figure 6. Tables 4-6 display the magnitude of design variables. OF1 and OF2 are shown for optimum points of , , and in Table 7-9. 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 ( = 1,2, … ,9), ( = 1,2, … , 9), and ( = 1,2, … ,9) are, respectively, the best for the first, the second, and both OFs.  Table 9. Objective functions for Ai, Bi and Ci (i =7, 8,9).

Value
Further, as seen in Figure 4, point Ai and are 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 . A similar behaviour is observed from Pareto fronts of the situation, angular velocity, and angle of the thrust vector for the launch vehicle.
To analyse the impact of each parameter in GA, Figures 7-12 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 8 represents dependency of OF2 (at points ) 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 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.

Conclusion
This paper represented a design of a fuzzy controller based on the GA for the purpose of controlling thrust vector of a launch vehicle which carries CanSat. Minimizing the errors caused by system deviation from equilibrium state and thrust vactor deviation are two objectives for optimizing this controller. This was done by manipulating GA parameters in nine different combination forms to satisfy each objective function and also both of them simultaneously. Further it was examined how these parameters affect the optimal points. By observing constraints of minimum settling time and overshoot, the results showed 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 were introduced.