HOME JOURNALS CONTACT

Journal of Applied Sciences

Year: 2008 | Volume: 8 | Issue: 24 | Page No.: 4644-4649
DOI: 10.3923/jas.2008.4644.4649
Design and Implementation of a Controller for Magnetic Levitation System Using Genetic Algorithms
I. Hassanzadeh, S. Mobayen and G. Sedaghat

Abstract: This research presents an optimum approach for designing of controller parameters for an unstable system using Genetic Algorithms (GA). The design goal is to minimize the integral absolute error and reduce transient response by minimizing overshoot, settling time and rise time of step response. We define an objective function of these indexes. Then by minimizing the function using binary and real-coded GA, the optimal controller parameters can be assigned. In this study, a magnetic levitation system is considered as a case study and the controller is designed to keep a magnetic object suspended in the air counteracting the weight of the object. The proposed algorithms are implemented using xPCtarget® toolbox and Simulink® which facilitate to utilize hardware in the loop (HIL) property, Tele-lab implementation and fast prototyping approach. Simulation and experimental results show the effectiveness and robustness of the proposed methods which are applicable to various control systems. Also, binary and real-coded performances are compared and discussed.

Fulltext PDF Fulltext HTML

How to cite this article
I. Hassanzadeh, S. Mobayen and G. Sedaghat, 2008. Design and Implementation of a Controller for Magnetic Levitation System Using Genetic Algorithms. Journal of Applied Sciences, 8: 4644-4649.

Keywords: hardware in the loop, Genetic algorithms, magnetic levitation system, unstable systems and tele-lab

INTRODUCTION

Traditionally, the problem of tuning controller parameters has been accomplished by a trial and error method and that is usually a computing burden. Classical optimization methods are based on assumptions such as differentiability, convexity of the cost function and constraints that must be satisfied. Because these assumptions cannot be satisfied by the constrained optimization and to reduce the complexity of tuning controller parameters, several new heuristic methods such as ant colony optimization (Hsiao and Chuang, 2004), Particle Swarm Optimization (Gaing, 2004), fuzzy logic (Visioli, 2001), simulated annealing (Zhou and Birdwell, 1994) and pattern recognition (Bezdek, 1994) have been developed.

In this study, we present GA for tuning controller parameters of magnetic levitation system. GA are stochastic global search methods that emulate the process of natural evolution and because of their simplicity and robustness; they are more popular and applicable. A major advantage of the proposed methods over the recent conventional search and optimization methods is parallel searching a population of points instead of single one point search. It doesn`t require any derivative information or any other additional knowledge (Haupt, 2004). Also, it depends entirely on responses from its environment and evolution operators such as reproduction, crossover and mutation to arrive at the best solution. By starting at several independent points in search space and searching global optima in parallel, the algorithms avoid converging to local minima. Thus, these features illustrate the superiority of the proposed methods than other heuristic methods.

In this study, we formulate the problem of adjusting controller parameters as an optimization problem. The goal is to design a well performance controller by adjusting four performance indexes, i.e., the maximum overshoot, the settling time, the rise time and the integral absolute error of step response. The proposed algorithms are implemented using xPCtarget® toolbox and Simulink® which facilitate to utilize hardware in the loop (HIL) property, Tele-lab implementation and fast prototyping approach.

MAGNETIC LEVITATION SYSTEM

Magnetic Levitation (Maglev) systems have become more attractive because of the vital applications in various fields of technology such as high speed ground transportation and vibration isolation (Hill, 1990).

Fig. 1: Implemented magnetic levitation system

Fig. 2: Schematic view of a magnetic levitation system

Figure 1 shows the magnetic levitation system built in robotics research lab in the department.

Also, Fig. 2 shows the plant`s schematic view. The maglev system can be decomposed into two subsystems: the mechanical and electrical subsystems. The object position in the mechanical subsystem can be controlled by adjusting the current through the electromagnet. The electromagnet coil has an inductance L and a resistance R. The voltage V applied to the coil results in a current I governed by the following equation (Kuo, 1995):

(1)

On the other hand, the force experienced by the object under the influence of the electromagnet is provided by:

(2)

Fig. 3: Block diagram of the implemented magnetic levitation system

where, X is the distance of the levitated object from the coil, g is the gravitational constant, Kf is the magnetic force constant and m is the mass of the object. Using Newton`s second law, the differential equation governing the object position is obtained as:

(3)

Maglev system is unstable and very sensitive to disturbance and plant uncertainties (Campo and Palt, 1998). GA controller implemented in the computer framework produces a command signal which runs the PWM circuit to adjust current through the electromagnet and allows the object to track the position command. The implemented system diagram is shown in Fig. 3. This system consists of the following parts:

Coil: One thousand turns copper wire (1.8 mm diameter) wrapped on an iron screw (0.02 m diameter)
PWM driver: driven by Simulink® program via two DI/O channel of PCL-818L DAQ-card
Sensor: UGN3503 Hall Effect sensor. In the absent of the magnetic field, sensor output is about 2.5 V
PCL-818L DAQ card: Advantech data acquisition card. Sensor output and PWM input are conducted through this card
Floating object: It consists of a plastic pipe ended with two permanent magnets

For achieving a real time system, a Simulink® model is designed which supports both simulation and real time implementation. Desired height of the floating object is defined in terms of the sensor output.

Fig. 4: Simulink® model of the overall system

The simulation part of the model is shown in Fig. 4. In this model, the reference signal is set to 2 and the signal generator amplitude is 0.2. Also, the sampling period of control system is 0.0002 sec.

The identification process is done using the Identification Toolbox (ident) of Matlab®. After several trial and errors, the Process Model Block has been chosen. As a result the model is validated and matched to the real model with more than 87% of success. The Fig. 6 that is used for identification process, is calculated using the ident ® toolbox.

HIL property of xPC target® toolbox utilizes us to implement various algorithms in a fast prototyping manner. Also, proposed configuration allows doing Tele-lab applications.

OVERVIEW OF GENETIC ALGORITHMS

The genetic algorithms are optimization and search methods based on the principles of natural genetics and natural selection and are widely recognized as effective search paradigms in many areas. GA first were described by John Holland, 1975 over the course of the 1960s and 1970s and popularized by David Goldberg who was able to solve a difficult problem such as the controlling of gas-pipeline transmission for his thesis (Haupt and Haupt, 1998). The biological basis of the algorithms are Darwinian natural selection that is elimination of weak and inefficient elements by optimal and near-optimal individuals and maintaining and recombination of features of good individuals to make new generations and better individuals. Binary GA introduces variables as an encoded binary string and works with the strings to arrive at the global best solution and maximize the fitness (i.e., minimize the cost function) (Haupt and Haupt, 1998; Kwok et al., 1993). For optimizing problems with continuous variables, the real representation of individuals has shown to be easier and more direct. In continuous or real-coded GA, no coding and decoding are needed and then a simpler implementation is applied. However, in our case, Binary GA outperforms the continues GA, because Binary GA maximizes the number of hyperplane partitions directly available in the encoding for schema processing. In other words, binary alphabets allow for greater sampling of the solution space and for the processing of more combinations of alleles (Haupt and Haupt, 1998).

The optimization process is performed in cycles called generations and during each generation, a set of new chromosomes is created using the crossover, inversion and mutation processes and only the best individuals (chromosomes) are allowed to survive to the next cycle of reproduction. We set the GA parameters for verifying the performance of the controller in searching the parameters according to the trial and error manner as follows:

Population size = 20 Crossover rate = 0.5
Mutation rate = 0.01 Maximum generation = 30

DESIGN PROCEDURE OF CONTROLLER FOR MAGLEV SYSTEM

Phase-lead controller is appropriate, when speed is required, because it will speed up the original response. Phase-lead compensation has a stabilizing effect. It also increases system bandwidth, resulting in a faster time response. The general form of the controller transfer function is described as:

(4)

where, kc, zc and pc are the gain, zero and pole of the controller, respectively. A performance criterion in the time domain includes the overshoot Mp, rise time Tr, settling time Ts and steady-state error Ess. We find the optimal controller parameters that minimize the performance indexes in terms of the load disturbance and transient responses. That is minimizing (Hsiao and Chuang, 2004):

(5)

where, K is [kc, zc, pc]. The GA for searching optimal controller parameters are as follows:

At first, specify the lower and upper bounds of controller parameters and generate initial, random population of chromosomes. Each chromosome K (controller parameters) is sent to Matlab® Simulink® and on the other hand the values of four performance criteria in the time domain namely Mp, Ess, Tr and Ts are calculated iteratively. Then cost function is evaluated for each chromosome according to these performance criteria. Comparing the fitness values for all chromosomes, the fittest members of the population are selected. According to a probabilistic method (e.g., Roulette Wheel) reproduction is executed and then crossover operation on the reproduced chromosomes is implemented. Afterward, the algorithms execute mutation operation with low probability. At the end of each iteration, programs check the predefined convergence criterion. If the number of iterations reaches the predefined maximum value, programs record the latest global best solution and stop.

EXPERIMENTAL RESULTS

The lower and upper bounds of the controller parameters are shown in Table 1. To shown the effectiveness of the proposed design methodologies and the developed theory, the simulation and experimental results are presented. At first, Maglev identification is done using Matlab® identification toolbox. Then the proposed GA controllers are implemented. Figure 5 shows a sample of the signals derived for system identification. The actual and estimated outputs are shown in Fig. 6. The error signal between these signals is shown in Fig. 7. It can be distinguished that difference between the real and the estimated output is negligible.

The best controller parameters and the corresponding system characteristics obtained by GA methods are shown in Table 2.

The simulation responses of controller output and magnetic object position are shown in Fig. 8 and 9, respectively. Simulation results reveal that the binary method has superior performance in terms of rise time, settling time and overshoot.

Table 1: Range of three controller parameters

Fig. 5: Position sensor output (upper trace) and PWM output (lower trace)

Fig. 6: Measured and estimated outputs

Fig. 7: Error between measured and simulated outputs

Figure 10 shows the actual position of the magnetic object. The well performed proposed binary GA method is confirmed in practice.

Table 2: Controllers` parameters and the corresponding system characteristics

Fig. 8: Controller output signal

Fig. 9: Magnetic object position signals obtained by GA and desired position signal

Fig. 10: Actual position of magnetic object using by the Binary GA controller

CONCLUSION

In this study, we present GA to determine controller parameters of magnetic levitation system. In present case, Binary GA out performs the continues GA, because Binary GA maximizes the number of hyperplane partitions directly available in the encoding for schema processing. In other words, binary alphabets allow for greater sampling of the solution space and for the processing of more combinations of alleles. High promising results demonstrate that the binary GA can obtain higher quality solutions with better computational efficiency. Designing of optimal controller parameters for this system using modified heuristic techniques and comparing their efficiency with each other can be the topic of our future research. Outcome of this study can be used as an adequate foundation for the next studies in this area to levitate heavier objects in different directions.

ACKNOWLEDGMENT

This research is part of a research was supported by a grant-in-aid of research (No. D-27-55, 2007) to the first author from research affair of University of Tabriz.

REFERENCES

  • Bezdek, J.C., 1994. Hybrid fuzzy controller designs that use pattern recognition and neural networks. Proceedings of the Southcon Conference, March 29-31, 1994, Orlando, FL, USA., pp: 20-25.


  • Campo, A.B. and F.M. Palt, 1998. Design of a magnetic levitation and propulsion system with two degrees of freedom. Proceedings of the International Conference on Control Applications, September 1-4, 1998, Trieste, Italy, pp: 1190-1193.


  • Gaing, Z.L., 2004. A particle swarm optimization approach for optimum design of PID controller in AVR system. IEEE Trans. Energy Conver., 19: 384-391.
    CrossRef    PubMed    Direct Link    


  • Haupt, R.L. and S.E. Haupt, 1998. Practical Genetic Algorithms. 2nd Edn. John Wiley and Sons Inc., New York, ISBN: 0-471-18873-5, pp: 123-190


  • Hill, R.J., 1990. Teaching electromagnetic levitation theory. IEEE Trans. Edu., 33: 346-354.
    CrossRef    


  • Hsiao, Y. and C. Chuang, 2004. Ant colony optimization for designing of PID controllers. Proceeding of the International Symposium on Computer Aided Control Systems Design, September 4-5, 2004, Taipei, Taiwan, pp: 321-326.


  • Kuo, B., 1995. Automatic Control Systems. 7th Edn., Prentice-Hall, Englewood Cliffs, ISBN: 0471366080


  • Kwok, D.P., T.P. Leung and F. Sheng, 1993. Genetic algorithms for optimal dynamic control of robot arms. Proceedings of the International Conference on Industrial Electronics, Control and Instrumentation, November 15-19, 1993, San Francisco, CA., pp: 380-385.


  • Visioli, A., 2001. Tuning of PID controllers with fuzzy logic. IEE Proc. Control Theor. Appl., 148: 1-8.
    CrossRef    


  • Zhou, G. and J. Birdwell, 1994. Fuzzy logic-based PID auto-tuner design using simulated annealing. Proceeding of the IEEE/IFAC Joint Symposium, Computer Aided Control System Design. March 7-9, 1994, Tucson, AZ., USA., pp: 67-72.

  • © Science Alert. All Rights Reserved