Fuzzy Control: An Adaptive Approach Using Fuzzy Estimators and Feedback Linearization

center average defuzzyﬁer, and Gaussian membership functions. One of the most important contributions of the adaptive scheme used here is the real convergence of the estimates f ( x | ˆ θ f ) and g ( x | ˆ θ g ) to their optimal values f ( x | θ ∗ f ) and g ( x | θ ∗ g ) while keeping the tracking error with respect to a reference signal within a compact set (Schnitman, 2001). Convergence properties are investigated using Lyapunov candidate functions. In order to illustrate the methodology, a nonlinear and open-loop unstable magnetic levitation system is used as an example. Experimental tests in a real plant were conducted to check the reliability and robustness of the proposed algorithm. The inherent magnetic ﬁeld nonlinearities may be inverted via provided real-time algorithms for linear control implementation or the full system dynamics may be studied.


Introduction
In recent years the area of control for nonlinear systems has been the subject of many studies (Ghaebi et al., 2011;Toha & Tokhi, 2009;Yang & M., 2001). Computational advances have enabled more complex applications to provide solutions to nonlinear problems (Islam & Liu, 2011;Kaloust et al., 2004). This chapter will present an application of fuzzy estimators in the context of adaptive control theory using computational intelligence (Pan et al., 2009). The method is applicable to a class of nonlinear system governed by state equations of the forṁ x = f (x)+g(x)u, where f (x) and g(x) represent the nonlinearities of the states. Some classic control applications can be described by this specific class of nonlinear systems, for example, inverted pendulum, conic vessel, Continuously Stirred Tank Reactor (CSTR), and magnetic levitation system. The direct application of linear control techniques (e.g.: PID) may not be efficient for this class of systems. On the other hand, classical linearization methods may lead an adequate performance when the model is accurate, even though normally limited around the point in which the linearization took place (Nauck et al., 2009). However, when model uncertainties are considerable the implementation of the control law becomes difficult or unpractical. In order to deal with model uncertainties an adaptive controller is used (Han, 2005;Tong et al., 2011;Wang, 1994). The controller implements two basic ideas. First, the technique of exact feedback linearization is used to handle the nonlinearities of the system (Torres et al., 2010). Second, the control law formulation in presence of model uncertainties is made with the estimates of the nonlinear functions f (x) and g(x) (Cavalcante et al., 2008;Ying, 1998). The adaptation mechanism is used to adjust the vector of parameters θ f and θ g in a singleton fuzzyfier zero-order Takagi-Sugeno-Kang (TSK) structure that provides estimates in the form f (x|θ f ) and g(x|θ g ). The fuzzy logic system is built with a product-inference rule, center average defuzzyfier, and Gaussian membership functions. One of the most important contributions of the adaptive scheme used here is the real convergence of the estimates f (x|θ f ) and g(x|θ g ) to their optimal values f (x|θ * f ) and g(x|θ * g ) while keeping the tracking error with respect to a reference signal within a compact set (Schnitman, 2001). Convergence properties are investigated using Lyapunov candidate functions. In order to illustrate the methodology, a nonlinear and open-loop unstable magnetic levitation system is used as an example. Experimental tests in a real plant were conducted to check the reliability and robustness of the proposed algorithm.

A specific structure
The proposed method is applicable to a specific class of nonlinear system that can be described by state equations of form: where, n is the dimension of the system x ∈ X ⊂ℜ n , are the states of the system or, in an equivalent form: where X, U f and U g are compact sets, sign(g(x)) = sign(g L )=sign(g U ) and x = 0i sa n interior point of X.

Examples of nonlinear systems
Once the class of nonlinear systems is defined, it is important to select a plant to highlight the controller properties. As this structure is very common in control applications, some classic systems can be written using Equation (1)

Control law
Consider a nonlinear system described by state equations in the form of Equation (1). Let the control objective be to track a reference signal r(t) ∈ S ⊂ℜ , where S is a compact set of possible references which can be supplied to the nonlinear plant.
Exact feedback linearization technique can be used here for exacting cancellation of the nonlinear functions f (x) and g(x) (Isidori, 1995;Slotine & Li, 1991;Sontag, 1998 assumes that the functions f (x) and g(x) are known, then an interesting structure for the control law would be where D is to be selected in the design phase.
By substituting Equation (4) in the nonlinear system Equation(1) one getṡ so thatẋ n = D (x), which can be chosen as the desired dynamics for the controlled system.

Example
Let a gain vector K be K =[K 1 , ..., K n ] ∈ R n (6) 375 Fuzzy Control: An Adaptive Approach Using Fuzzy Estimators and Feedback Linearization www.intechopen.com and consider D (x) = r − Kx. The proposed control law becomes By substituting Equation (7) in the nonlinear system in Equation (1), one getṡ which yields a linear dynamic. In this case, the stability can be verified directly by computing the eingevalues of the matrix (A − BK). (4), a large number of control laws can be suggested. For instance, the control laws used in (Wang, 1994) and (Wang, 1993), as well as the control law proposed in Equation (7) are particular cases of Equation (4).

Remark 2.
Without loss of generality, r = 0 is considered for stability analysis and the nominal system is considered to be of the formẋ = (A − BK) x (9)
Consider singleton fuzzifier and let a fuzzy system be composed by R rules, each one of them of the form IF x 1 is A j 1 and x n is A j n THEN y is B j where x = [x 1 ,...,x n ] ∈ℜ n is the input vector, A j 1 ,...,A j n / B j are the input/output fuzzy sets related to the j th rule (j = 1,...,R), and y is the fuzzy output.
Consider y j as the point in which B j is maximum (μ B j (y j )=1) and define θ as the vector of parameters of the form Therefore, the fuzzy output can be expressed as where and is usually called the weight of the j th rule. The scheme is shown in Figure (2).

Fuzzy as universal approximators
For any given real continuous function f (x) on a compact set x ∈ X ⊂ℜ n and arbitrary ε > 0, there exists a fuzzy logic system f (x|θ * ) in the form of Equation (12) such that Remark 3. Proof of this theorem is available in (Wang, 1994).
This work follows the classical work by Wang Wang (1993), Wang (1994) and some of related papers (e.g.: Fischle & Schroder (1999); Gazi & Passino (2000); Lee & Tomizuka (2000); Tong et al. (2000)). Most of these works involve fuzzy estimators in order to approximate nonlinear functions which appear in the model describing the plant. The fuzzy estimates are then used in the control law which may, for instance, be based on the exact feedback linearization techniques. However, it is shown by an example that the convergence of the estimates may not be achieved, even though the system exhibits good reference tracking properties. The new approach proposed in this work is thus aimed at obtaining convergence of the estimates of the nonlinear functions which are modelled by fuzzy structures.
Notice that the control law in Equation (7) can not be implemented because the functions f (x) and g(x) are unknown and must be estimated. The idea is to construct fuzzy structures to generate the estimates f (x|θ f ) and g(x|θ g ), whereθ f andθ g are the respective vector of parameters.
In this work, Equation (1) uses the fuzzy structures of form where W(x) is associated with the antecedent part of the rules (see 13). Moreover, the parametersθ f andθ g are (see 12) obtained using an adaptation scheme. Thus, the implementable version of the control law in Equation (7) becomes

The proposed control structure
A control method is proposed here by introducing equations that are analogous to those of state observers but with f (x) and g(x) replaced by corresponding fuzzy approximationṡ where k is a gain vector of the form Remark 4. From Equation (2), it can be noticed that the pair (A, C) is observable.

Target Parameters
Fuzzy approximators possess universal approximation properties (see, for instance, (Wang, 1994;Ying, 1998;Ying et al., 1997)). Thus, given where X is the input universe of discourse and ε f , ε g > 0 are arbitrary positive constants. Hence, the real system (1) can be approximated by a model based on fuzzy structures up to the required precision by choosing ε f and ε g . Let the target fuzzy system be described bẏ If the parameters of the target model were available, then Equation (17) could be used to produce an approximating control law of the form In the present approach, θ * f and θ * g are replaced by estimatesθ f andθ g obtained by an adaptative scheme. Later, it will be shown that, under appropriate conditions,θ f → θ * f , θ g → θ * g . In order to establish, initially, the stability properties of the control based on the target model, consider r = 0 without loss of generality. Inserting Equation (22) into Equation (1) one obtains thatẋ which can be rewritten asẋ where λ x, θ * f , θ * g is given by Now, given a δ > 0, it is possible to choose ε f and ε g in Equation (20) so that for fixed target values θ * f and θ * g one has If θ * f and θ * g corresponded to the situation of exact matching, would be a vanishing perturbation so that Lemma 5.1 in Chapter 5 of (Khalil, 2001) could be applied to estabilish exponential stability. In general, the universal approximation properties of fuzzy structures only guarantees Equation (20) with ε f , ε g > 0. Therefore, one requires Theorem 5.1 in Chapter 5 of (Khalil, 2001) where β (·, ·) is a class of KL function.

Estimation errors
Define the estimation error vector by Subtracting Equation (18) from Equation (21) one getṡ For the sake of simplicity, introduce the notatioṅ where Because Λ is a stable matrix, there exists an unique positive definite and symmetric matrix P n×n , which satisfies the Lyapunov equation where Q n×n is an arbitrary positive definite matrix.

379
Fuzzy Control: An Adaptive Approach Using Fuzzy Estimators and Feedback Linearization www.intechopen.com

Adaptation law and convergence analysis
The target estimates θ * f and θ * g are not known a priori. Therefore, adaptation laws must be provided in order to forceθ f → θ * f ,θ g → θ * g and e → 0.
Following (Wang, 1997), adopt as a candidate function in the sense of Lyapunov where and γ f , γ g are positive constants.
The time-derivative is of the forṁ and an interesting choice for the adaptation laws are In fact, using the adaptation laws 36 each term of Equation (35) can be rewritten as and Equation (35) which is negative semi-definite.

Conclusion 5.
A semi-negative definition of Equation (38) guarantees that the error e is bounded. The application of the Barbalat's Lemma yields that e → 0 when t → ∞. From Equation (28), e → 0 implies that x f → x * f and the convergence of the parameter estimates to their respective target values is obtained.

Simulation results
Considering that a magnetic levitation system is available at the Control Lab of CTAI, it may represent future opportunities for continued researches with hands on experimentation. Hence it is selected as the system which will be used here as an example to illustrate the method. The scheme is presented in Figure (3) and the aim in this problem is to suspend an A model for this system isd where m is the mass of the disc, g r is the gravitational acceleration and F is the electromagnet force produced by a coil fed with current i with c a positive constant, and d the position of the disc.
Denoting by x 1 = d and x 2 =ḋ the components of the state vector and combining Equations (39) and (40) one may write Hence, comparison with Equation (1) yields the following association The free parameters are chosen as follows: For the initial condition of the nonlinear system let d(0)=x 1 (0)=1.2 and x 2 (0)=0. The initial conditions for the fuzzy estimates are zero.
Choosing Q as the identity matrix, Equation (32) leads to P = 1.2550 0.0100 0.0100 0.0051 From practical inspection of the actual experimental setup, let the range of d(t) be Rx 1 = [0.6, 3.4], which represents the fuzzy input universe of discourse. Also define as the lower bound of g(x|θ g ) , which also guarantees that g(x|θ g ) = 0.
Choosing the vector Xc of the centers of the membership functions as given by one gets membership functions for the sets A j as shown in Figure (4).

Fig. 4. Membership functions
Remark 6. This fuzzy input universe of discourse is desired in this application since the magnetic force increases with second power of d (situation that may put in risk the controller in experimental tests).
For each t ∈ℜand fuzzy set A j , define a single rule of the form where R = length(Xc).
In order to compute the target values of θ * g , not available in practical situation, but useful in simulation purposes to evaluate the method, note that rules can be generated simply by computing the real value of the function g(x|θ g ) as As for the actual initialization of the vectorθ g one can use randomly generated values such as Remark 7. The randomized initialization of θ g must satisfy the constraint g L (x) ≤ g(x|θ g ) and the sign of g(x|θ g ) must be equal to the sign of g(x).
Let the reference signal r(t) be a square wave in the range 1.2 to 2.8 . Figures from (5) to (8) present the obtained simulation results. The nominal case corresponds to the situation with real f (x) and g(x).

Fig. 5. Simulation Results
It could be observed in Figure (5(a)) that the reference signal r(t) was tracked by the plant output. The magnetic disc position (process variable) could be observed in Figure (5(a)) with some oscillations but bounded and stable in steady state. The adaptive scheme used here provides the real convergence of the estimates f (x|θ f ) and g(x|θ g ) to their optimal values f (x|θ * f ) and g(x|θ * g ) while keeping the estimation errors with respect to a reference signal within a compact set (according to Figures (8(a)) and (8(b)). The control effort u associated with the electrical current is bounded as shown in Figure (6(a)).

. Simulation Results
It is worth noticing in Figures (6(b)), (7(a)) and (7(b)) that the function estimates converge to their real values and, in turn, they force the system to reproduce the nominal case as proposed in Equation (4) where the knowledge of f (x) and g(x) are considered.

Magnetic levitation
The magnetic levitation test bed supplied by ECP Model 730 (see (ECP, 1999)) which is used for these experiment tests is shown in Figure (9). The plant shown in Figure (10), consists of upper and lower coils that produce a magnetic field in response to a DC current. One or two magnets travel along a precision ground glass guide rod. By energizing the lower coil, a single magnet is levitated through a repulsive magnetic force. As the current in the coil increases, the field strength increases and the levitated magnet height is increased. For the upper coil, the levitating force is attractive. Two magnets may be controlled simultaneously by stacking them on the glass rod. The magnets are of an ultra-high field strength rare earth (NeBFe) type and are designed to provide large levitated displacements to clearly demonstrate the principle of levitation and motion control. Two laser-based sensors measure the magnet positions. The lower sensor is typically used to measure a given position of the magnet in proximity to the lower coil, and the upper one for proximity to the upper coil. This proprietary ECP sensor design utilizes light amplitude measurement and includes special circuitry to desensitize the signal to stray ambient light and thermal fluctuations.
The Magnetic Levitation setup apparatus dramatically demonstrates closed loop levitation of permanent and ferro-magnetic elements. The apparatus includes laser feedback and high flux magnetics to affect large displacements and provide visually stimulating tracking and regulation demonstrations. The system is quickly set up in the open loop stable and unstable (repulsive and attractive fields) configurations as shown in Figures (9) and (10). By adding a second magnet, two SIMO plants may be created, and by driving both actuators with both magnets, MIMO control is studied. The field interaction between the two magnets causes strong cross coupling and thus produces a true multi-variable system. The inherent magnetic field nonlinearities may be inverted via provided real-time algorithms for linear control implementation or the full system dynamics may be studied. 1. The first subsystem is the Magnetic Levitation system itself (described above) which consists of the electromagnetic coils, magnets, high resolution encoders.
2. The next subsystem is the real-time controller unit that contains the Digital Signal Processor (DSP) based real-time controller, servo/actuator interfaces, servo amplifiers, and auxiliary power supplies. The DSP is capable of executing control laws at high sampling rates allowing the implementation to be modeled as continuous or discrete time systems. The controller also interprets trajectory commands and supports such functions as data acquisition, trajectory generation, and system health and safety checks.
3. The third subsystem is the executive program which runs on a PC under the Windows operating system. This menu-driven program is the user's interface to the system and supports controller specification, trajectory definition, data acquisition, plotting, system execution commands, and more. Controllers may assume a broad range of selectable block diagram topologies and dynamic order. The interface supports an assortment of features which provide a friendly yet powerful experimental environment. Real-time implementation of the controllers is also possible using the Real Time Windows Target (RTWT).

Experimental method
Following some related works with using the ECP Model 730 (Nataraj & Mukesh, 2008;, the steps followed to carry out the experiment are as follows: 1. Linearization of the sensor (see (ECP, 1999, p. 81)) with the following values: 2. Nonlinear compensation of the actuator (see (ECP, 1999, p. 81)) with the following values: 3. Construct the design control system in Simulink environment as shown in Figure  6. After the experiment is over, make the appropriate conversions and plot the data.
For experimental tests, this work adopted the following values for the plant parameters (see (ECP, 1999)

Experimental results
The adaptive fuzzy control system proposed in Section 5 is now implemented real time and experimentally tested for its performance. Initially, the magnet is brought to equilibrium position of 2cm as plant is linearized to 2cm. The upper coil (attractive force) was used with one magnet. Therefore, an open-loop unstable SISO system was implemented and tested with the designed controller. Now the reference signal is applied.
The response of the closed loop system for a given reference command signal is shown in Figure (14). The experimental results show that a reference input signal was tracked by the controller output signal while keeping the tracking error with respect to a reference signal within a compact set (Figure (15). The required control effort is low, with a peak of 6.5 volts (see Figure (16)).

Conclusions
The adaptive control scheme presented in this work considers the difference between the nonlinear system and an associated dynamic system using fuzzy estimates. The model of the associated dynamics is analogous to that of state observers but using fuzzy structures to estimate the nonlinear functions. If optimal parameters are considered, then the stability may be investigated using a classical method of perturbed system. Thus, since adequate fuzzy structures are used stability is assured when optimal parameters are considered. A Lyapunov function is then used in order to show the convergence of the estimates to their respective optimal values. Hence, when the fuzzy structures are carefully chosen, the estimates approach optimal values which may be arbitrarily close to the true values.
In some previous work, successful results have been attributed to nonlinear approximators such as fuzzy or neural blocks. However, the proof of the estimates convergence had not been presented. Moreover, the adaptation law does not force the convergence of the estimates. In these previous results, the robustness of the tracking error is reached as a consequence of the application of the tracking control theory. It keeps the error in a compact set without requiring the convergence of the estimates to their real values. It is important to mention that the real convergence of the estimates represents the most significant contribution of this work. The error analysis is analogous to the previous work, but a new scheme for the adaptive fuzzy control was proposed. Differently from previous research, the adaptation laws force the convergence of the function estimates. Moreover, although the tracking error is not considered to be of primary concern, it is obtained as a consequence of the proposed control law when the convergence of the estimates is attained.
The proposed adaptive controller is tested on ECP Model 730 Magnetic Levitation setup through Real Time Windows Target (RTWT). It has been successfully applied to experimental Magnetic Levitation setup and desired reference tracking properties are also achieved. Therefore, the experimental tests show the reliability and robustness of the proposed algorithm.

Future contributions
One of the most important contributions of this work is a new approach for designing of adaptive control techniques based on intelligent estimators which may be either fuzzy or neural. The continuation of this research may lead to: a. The analysis of the proposed method in other nonlinear systems; b. The application of the proposed method with artificial neural networks as estimators; c. The generalization of the obtained results for a larger class of nonlinear systems; d. Analysis of the proposed method in other practical applications. This book introduces new concepts and theories of Fuzzy Logic Control for the application and development of robotics and intelligent machines. The book consists of nineteen chapters categorized into 1) Robotics and Electrical Machines 2) Intelligent Control Systems with various applications, and 3) New Fuzzy Logic Concepts and Theories. The intended readers of this book are engineers, researchers, and graduate students interested in fuzzy logic control systems.