Design a PID Controller of BLDC Motor by Using Hybrid Genetic-Immune

In this paper hybridization between two optimization methods that are Genetic Algorithm (GA) and Artificial Immune System (AIS) is presented for determining the optimal proportional-integral derivative (PID) controller parameters, for speed control of a linear brushless DC motor. The brushless DC motor is modeled in Simulink and the Hybrid GA-AIS algorithm is implemented in MATLAB. The capability of overcoming the shortcomings of individual algorithms without losing their advantages makes the hybrid techniques superior to the stand-alone ones based on the dominant purpose of hybridization. The Hybrid GA-AIS method has superior features, stable convergence characteristic and good computational efficiency. The results that get it from hybridization are improved compares with that results can get from GA and AIS alone.  The hybrid GA-AIS consists of two processes, the first one is a genetic algorithm (GA) is typically initialized population randomly. Hybridization is faster and more accurate compare with GA AIS alone.

The artificial immune system (AIS) implements a learning technique inspired by the human immune system which is a remarkable natural defense mechanism that learns about foreign substances, (Yang Liu, Bo Xue Tan, Xue Zhang. 2007).The AIS aim at using idea derived from immunology for the development of systems capable of perform different tasks in different areas of research (Leandro Nunes de Castro, Fernando J. Von Zuben.2000).
Our immune system has as its main task the detection of the infectious foreign elements (called pathogens) that attack us, and defend us from them .Examples of such pathogens are bacteria and viruses.Any molecule that can be recognized by our immune system is called antigen.Such antigens provoke a specific response from our immune system.Lymphocytes are a special type of cells that play a major role in our immune system.Two types of lymphocytes exist: B cells (or B lymphocytes) and T cells (or T lymphocytes).Upon detection of an antigen, the B cells that best recognize (i.e., match) the antigen are cloned.Some of these clones will be differentiated into plasma cells, which are the most active antibodies secretors, while others will act as memory cells.These cloned cells are subject to a high somatic mutation rate (normally called hypermutation) in order to increase their affinity level (i.e., their matching to the antigens).These mutations experienced by the clones are proportional to their affinity to the antigen.The highest affinity cloned cells experiment the lowest mutation rates, whereas the lowest affinity cloned cells have high mutation rates, Figure .1,show the Mechanism of Immune System.Due to the random nature of this mutation process, some clones could be dangerous to the body and are, therefore, eliminated by the immune system itself.Plasma cells are capable of secreting only one type of antibody, which is relatively specific for the antigen.Antibodies play a key role in the immune response, since they are capable of adhering to the antigens, in order to neutralize and eliminate them.These cloning and hypermutation processes are collectively known as the clonal selection principle.It is worth noting, however, that the immune response is certainly more complex than the above explanation, in which we only focused on the B cells, in order to keep our discussion very short.Once the antigens have been eliminated by the antibodies, the immune system must return to its normal conditions, eliminating the in-excess cells.(LeandroNunes de Castro, Fernando J. Von Zuben.2000) However, some cells remain in our blood stream acting as memory cells, so that our immune system can 'remember' the antigens that have previously attacked it.When the immune system is exposed again to the same type of antigen (or a similar one), these memory cells are activated, presenting a faster (and perhaps improved) response, which is called secondary response.Based on the previous (oversimplified) explanation of the way in which our immune system works, we can say that, from a computer science perspective, the immune system can be seen as a parallel and distributed adaptive system.Clearly, the immune system is able to learn; it has memory, and is able of tasks such as associative retrieval of information.These features make immune systems very robust, fault tolerant, dynamic and adaptive.All of these properties make it very attractive to be emulated in a computer.Artificial Immune Systems (AIS) are composed of the following basic elements: A representation for the components of the system (e.g., binary strings, vectors of real numbers, etc.).A set of mechanisms to evaluate the interaction of individuals with their environment and with each other.Such an environment is normally simulated through an affinity function, which is based on the objective function(s) in the case of optimization problems.Procedures of adaptation, that indicates the way in which the behavior of the system changes over time.These procedures of adaptation consist of, for example, mutation operators.AIS are population-based meta-heuristics, and have been widely used for a wide variety of optimization and classification tasks.

Genetic Algorithm
A GA is an intelligent optimization technique that relies on the parallelism found in nature; in particular its searching procedures are based on the mechanics of natural selection and genetics.GAs was first conceived in the early 1970s by Holland.GAs is used regularly to solve difficult search, optimization, and machine-learning problems that have previously resisted automated solutions (Ian Griffin. 2003).They can be used to solve difficult problems quickly and reliably.These algorithms are easy to interface with existing simulations and models, and they are easy to hybridize.GAs includes three major operators: selection, crossover, and mutation, in addition to four control parameters: population size, selection pressure, crossover and mutation rate.Population-based optimization methods are addressed also.This paper is concerned primarily with the selection and mutation operators(Ian Griffin. 2003).There are three main stages of a genetic algorithm; these are known as reproduction, crossover and mutation.This will be explained in details in the following section.

A. Reproduction
During the reproduction phase the fitness value of each chromosome is assessed.This value is used in the selection process to provide bias towards fitter individuals.Just like in natural evolution, a fit chromosome has a higher probability of being selected for reproduction.An example of a common selection technique is the Roulette Wheel Selection method as shown in Figure 2.Each individual in the population is allocated a section of a roulette wheel.The size of the section is proportional to the fitness of the individual.A pointer is spun and the individual to whom it points is selected.This continues until the selection criterion has been met.The probability of an individual being selected is thus related to its fitness, ensuring that fitter individuals are more likely to leave offspring.Multiple copies of the same string may be selected for reproduction and the fitter strings should begin to dominate.There are a number of other selection methods available and it is up to the user to select the appropriate one for each process.All selection methods are based on the same principal that is giving fitter chromosomes a larger probability of selection (Ian Griffin. 2003).Four common methods for selection are:

B. Crossover
One of the three basic operators in any genetic algorithm (GA) is crossover.Two chromosomes which are the parents that combined through crossover which is a genetic operator through mating to produce a new chromosome or offspring.The main point behind crossover is that it takes the best characteristics from each of the parents to form a new chromosome that may be better than both of the parents.According to a user-definable crossover probability, crossover occurs during evolution.
To produce better chromosomes, the crossover operations exchange certain parts of the two selected strings in an attempt to acquire the good parts of old chromosomes.Various crossover techniques exist for organisms which use different data structures to store themselves.Figure 3 show the kinds of crossover: Using selection and crossover on their own will generate a large amount of different strings.However there are two main problems with this: 1) Depending on the initial population chosen, there may not be enough diversity in the initial strings to ensure the Genetic Algorithm searches the entire problem space.
2) The Genetic Algorithm may converge on sub-optimum strings due to a bad choice of initial population.
These problems may be overcome by the introduction of a mutation operator into the GA.Mutation is the occasional random alteration of a value of a string position.It is considered a background operator in the GA.The probability of mutation is normally low because a high mutation rate would destroy fit strings and degenerate the GA into a random search.Mutation probability values of around 0.1% or 0.01% are common, these values represent the probability that a certain string will be selected for mutation i.e. for a probability of 0.1%; one string in one thousand will be selected for mutation.Once a string is selected for mutation, a randomly chosen element of the string is changed or mutated.For example, if the GA chooses bit position 4 for mutation in the binary string 1011101, the resulting string is 1011001 as the fourth bit in the string is flipped as shown in  Optimization is the task of getting the best solution among the feasible solutions.There are many methods available to obtain an optimized solution.
The proposed algorithm contains two major processes which are the GA and AIS.
GA starts with procedure below: 1) Generate initial population of individuals randomly 2) Calculate the fitness values of the individuals in the current population.
3) Select individuals for reproduction.4) Apply crossover and mutation operator.5) Compute the fitness value of the individuals 6) Select the best individuals to create the new population.
Steps 3 to 6 are repeated until a pre-defined stopping criterion is attained The second process (AIS) usually initializes with random population, the new technique that used here says that AIS uses the best population of GA as input to AIS procedures.Figure 5, shows the hybrid of GA-AIS.
AIS process start with procedures below: 1) Generate initial population of Ab from the last population of GA 2) Compute the fitness of each Ab.
3) Select n antibodies with best affinity.
4) Generate clones of selected set 5) Mutate clonal set affinity maturation 6) Calculate affinity clonal set 7) Select candidate(s) memory cells 8) Replace lowest d affinity antibodies.9) Steps 3 to 6 are repeated until a pre-defined stopping condition is reached.

Test Function
Many novel algorithms are introduced to solve the optimization problem accordingly the researchers looking for various benchmark functions with various properties in order to make comparison and evaluate different algorithms.Many of these popular benchmark functions have some properties that have been exploited by some algorithms to achieve excellent results..Xi [-5.12, 5.12] It has a global minimum at X=0 where f(x)=0.The mathematical formula that defines Griewank's function is: Function definition: 8) Sum of different power function 9 The sum of different powers is a commonly used unimodal test function.
Function definition:

Simulation Results and Discussions
To testify the efficiency and effectiveness of Hybrid GA-AIS algorithm, several tests of the hybridization algorithm were made in the Matlab programming language.All the implementations were developed using a computer with processor Intel(R) Core (TH)2 Duo CPU T8100 that works to a frequency of clock of 2.10 GHZ, 4 GB of RAM Memory and Windows 7 operating system.Experimental Results of the Artificial Immune System (AIS), Genetic Algorithm (GA) and Hybrid GA-AIS algorithm optimization methods.The results obtained after applying methods to the mathematical functions are shown on the table 1. Figure6 shows results of Rastrigin's Function.

Design a Pid Contrller of A Linear BLDC Motor
There are mainly two types of dc motors used in industry.
The first one is the conventional dc motor where the flux is produced by the current through the field coil of the stationary pole structure.The second type is the brushless dc motor (BLDC motor) where the permanent magnet provides the necessary air gap flux instead of the wire-wound field poles.Brushless DC motors are reliable, easy control, and inexpensive.Due to their favorable electrical and mechanical properties, high starting torque and high efficiency, the BLDCM are widely used in most servo applications such as actuation, robotics, machine tools, and so on.The design of the BLDCM servo system usually requires time consuming trial and error process, and fail to optimize the performance.In practice, the design of the BLDCM drive involves a complex process such as model, devise of control scheme, simulation and parameters tuning.Step response for BLDC motor with PID controller optimized by Hybrid GA-AIS method

Conclusion
The analysis of the simulation results showed that the Hybrid GA-AIS optimization is better in terms evaluating the minimum value for eight mathematical test functions.
The obtained results for the hybrid AG-AIS are very good results compare to AIS and GA results (see

Figure 4 .
Figure 4. Illustration of mutation operation 4. Hybrid GA-AIS Mechanism this paper used eight test function that have various Rastrigin's function, Rosenbrock's valley function, Griewank's function, Ackley's function, Rotated hyper-ellipsoid function, Moved axis parallel hyper-ellipsoid function, Goldstein-Price's function, Sum of different power properties to compare between AIS, GA, and Hybrid AIS-GA.Below eight test functions (Fevrier Valdez,Patricia Melin.2008): 1) Rastrigin's function Test The Rastrigin function is a non-convex function used as a performance test problem for optimization algorithms.It is a typical example of non-linear multimodal function.Function definition:

Figure 5 .
Figure 5. Whole flowchart shows the Hybrid GA-AIS 2) Rosenbrock's valley function (De Jong's function 2) In mathematical optimization, the Rosenbrock function is a non-convex function used as a performance test problem for optimization algorithms introduced by Rosenbrock (1960) hyper-ellipsoid function An extension of the axis parallel hyper-ellipsoid is Schwefel's function1.2.It is continues, convex and unimodal.axis parallel hyper-ellipsoid function This function is derived from the axis parallel hyper-ellipsoid.function [GP71] is a global optimization test function.

Figure 6 .Figure 7 .
Figure 6.Chart shows Hybrid methods compared with AIS and GA for Rastrigin's function

Figure 8 .
Figure 8. Charts Show Hybrid methods compared with AIS and GA for a) Ackley's function.b) Rotated hyper-ellipsoid function.c) Moved axis parallel hyper-ellipsoid function.d) Goldstein-Price's function.

Figure 9 .
Figure 9. Chart shows Hybrid methods compared with AIS and GA Sum of different power function

Table 1 .
Show the values of AIS, GA and Hybrid for eight test functions The dynamic characteristics of BLDC motors are similar to permanent magnet DC motors.The characteristic equations of BLDC motors can be represented as(Fevrier Valdez,Patricia Melin.2008): ) is the applied voltage, ω (t) is the motor speed, L is the inductance of the stator, i(t) is the current of the circuit, R is the resistance of the stator, v emf (t) is the back electromotive force, T is the torque of motor, D is the viscous coefficient, J is the moment of inertia, Kt is the motor torque constant, and Kb is the back electromotive force constant.Figure4.1 shows the block diagram of the BLDC motor.From the characteristic equations of the BLDC motor, the transfer function of speed model is obtained.
TABLE.2).For the engineering problem its clear the improvement in the step response of the Hybrid GA-AIS optimization compare with GA step response and AIS step response in terms of Overshoot, Rising time and Setting time. method