Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

download Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

of 21

Transcript of Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    1/21

    Advance in Electronic and Electric Engineering.ISSN 2231-1297, Volume 3, Number 1 (2013), pp. 7-24 Research India Publicationshttp://www.ripublication.com/aeee.htmOptimal Fuzzy Logic Tuning of Dynamic InversionFlight ControllerAlirezaAbaspour 1 , Mohammad Sadeghi 2 and SayedHosein Sadati 3Aerospace Department, Maleke_ ashtar University, Tehran, Iran.2,3 Aerospace Department, Maleke_ ashtar university, Tehran, Iran.AbstractIn this paper an Optimal fuzzy logic control (OFLC) law for a

    nonlinear control method is introduced. Dynamic inversion is anonlinear control synthesis technique in which the inherent dynamicsof a dynamical system are canceled out and replaced by desireddynamics, selected by the designer. The output of such an inner-loopcontroller is the control input, which produces the desired closed-loopresponse. The accuracy of control response in dynamic inversionmethod is depend on two gain which are locate before the outer loopand inner loop. This paper attempts to find a solution to tune thesegains for a better control performance in an intelligent way. We usedParticle Swarm Optimization (PSO) to optimize the membershipfunctions' (MFs) parameters of the proposed design. The distributionof the MFs is obtained by minimizing a nonlinear constrained multi-objective optimization problem where control errors are treated as

    competing objectives. The performance of the introduced control lawis compared with classical dynamic inversion. The simulation resultsshow that introduced method performs better than classical dynamicinversion. Moreover, the simulations show that the fuzzy pso dynamicinversion method that we proposed is robust on uncertainties of modelparameters such as mass.Keywords: Fuzzy logic, nonlinear model, dynamic inversion, controleffort, Particle swarm optimization, uncertainties.1. IntroductionMost airplanes must operate over a broad flight envelope, Which the aerodynamiccharacteristics within this envelope vary widely. A controller based on classical controlAlirezaAbaspour et al 8

    methodologies [1,2] such as root locus design, would require synthesis of manydifferent designs at selected operating points along the flight path. These classicalmethodologies can be time consuming, thereby increasing both design Time and costduring control system development. Additionally, gains need to be scheduled acrossthe flight envelope. In contrast, dynamic inversion is a candidate methodology thatseeks to eliminate gain scheduling through the inversion and cancellation of theinherent dynamics, by replacement with a set of user-selected desireddynamics. Theneed to gain schedule is thus reduced through the use of a high-fidelity, onboar

    daircraft model. For these reasons dynamic inversion is a promising candidate controldesign methodology aircraft with extensive flight envelopes.Within the last decade dynamic inversion has become a popular methodology foraircraft flight controller design. Much of the literature has applied this designmethodology to both the longitudinal and lateral/directional axes of high-performanceaircraft, such as the F-117A[3] the F-18HARV [4] and other modified versions of

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    2/21

    theF-18[5] and the F-16 [6]. The control performance of Dynamic Inversion (DI) methodis very sensitive to outer loop and inner loop gains . In this paper we used fuzzy logicoptimal control (OFLC) to tune the outer loop gain in an intelligent way to obtain abetter control performance. FLCs are developed to utilize human expert knowledgeincontrolling various systems. It is well known that while fuzzy rules are relatively easy

    to derive from human experts, the fuzzy MFs are difficult to obtain. Tuning of MFs isa time consuming and often frustrating exercise. To overcome these difficultiesvarioustechniques have been reported to automate the tuning process of MFs. An adaptivenetwork based fuzzy inference system (ANFIS) was introduced [7], where an adaptiveneural network was used to learn the mapping between the inputs and outputs andaSugeno-type of fuzzy system could be generated based on the neural network. Aquantum neural network was also used to learn the data space of a Tagaki-SugenoFLC[8]. Genetic algorithm has been used in the automatic design of FLCs [9,10] in t

    heareas of mobile robotics. In the current work, we introduce a fuzzy control lawwithrules obtained based upon the human experienced. Then, the MFs' parameters of theintroduced design will be optimized using PSO technique. In fact, PSO is a populationbased stochastic optimization technique developed by Eberhart and Kennedy [11,12].Based on their description, particle swarm optimization imitates human (or insects)social behavior. Individuals interact with one another while learning from theirownexperience, and gradually the population members move into better regions of the

    problem space. The swarm of PSO can be envisioned as multiple birds (particles)thatsearch for the best food source (optimum) by using their inertia, their knowledge, andthe knowledge of the swarm.Single particles behave similarly because traditionally they share the sameconfiguration. While searching for food, the birds are either scattered or go togetherbefore they locate the place where they can find the food. While the birds are searchingfor food from one place to another, there is always a bird that can smell the food verywell and having the better food resource information, that is the bird is percep

    tible ofthe place where the food can be found, in Figure 1 you can see a flock of swarmsusingPSO.Optimal Fuzzy Logic Tuning of Dynamic Inversion Flight Controller 9Figure 1: The flock swarms using PSO.Since they are transmitting the information, especially the good information atanytime while searching the food from one place to another, conducted by the goodinformation, the birds will eventually flock to the place where food can be foun

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    3/21

    d. Dueto its simplicity in implementation, PSO has gained popularities in engineeringapplications, such as in image processing [13] and in system modeling [14]. A numberof publications have also been reported in using PSO to automatically tune the FLCparameters [15,16,17,18]. These publications are focused on tuning the parametersinvolved in the TS-type fuzzy controllers. In general, the PSO is used to perform thelearning tasks that are usually associated with the NN in the TS FLCs. Although

    thereare research results in the area of automatic fuzzy MFs optimizing, most of themare inthe area of TS type of fuzzy controllers. To the best of our knowledge, there isnoreport on using PSO for the Mamdani-type of fuzzy controller MFs tuning.In this paper, we use PSO to automatically tune MFs of the proposed control law.The OFLCDI then is compared with classic DI .The paper is organized as follows:in section II we proceed with a brief overview of mathematical model of aircraft,whereas dynamic inversion method explained in section III, and combination of fuzzyand pso explained in section IV. Then in section V we proceed with the numerical

    simulation of classic DI and OFLCDI, while the conclusions are provided in sectionVI.2. Mathematical model of aircraftIn this paper we design a flight controller for a phantom fighter jet (known asF_4), theAerodynamic coefficient obtained from [19]. In table 1 you see the specificationof theairplane that we used. The inputs are delta aileron, delta elevator and delta rudder[ ] , , a e r ddd.taskof the controller is to track the commands of , aband whenaerodynamic model uncertainties exist. The body-fixed axes, nonlinear equations

    ofmotion for an aircraft over a flat Earth are given by [19].2 222( )[ ( ) ]xz x y zz aero xz aerox z xz x z xzz y z xzx z xzI I I I pq

    I l I np rI I I I I II I I I I qrI I I-++= +----

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    4/21

    +-&(1)221[ ( ) ( )]aero z x xzyq m pr I I I r pI

    = + -+ -&(2)AlirezaAbaspour et al 1022 22( ) ( )x y z xz x x y xzx z xz x z xzxz aero xx aerox z xzI I I I I I I Ir r p q

    I I I I I II l I nI I I -+ -+= + + -- +-&(3)

    1sincos [ . sin sin ].1[ cos sin cos ].p r m gmvY Tmvbaagbba=-+ +

    -&(4)(cos sin )tan1 1[ cos cos ] [ sin ]. cos . cosq p rL Mg Tmv mv

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    5/21

    aaabg abb=-+ +-+ + -&(5)1(cos sin )cossin

    tan cos cos [tan sin tan ].tan cos cos.p rg L Tv mvYmv aabab gg b

    g b=+ -++++&(6)1[ cos cos sin cos ].[sin sin cos cos sin ].L mg Y

    mvTmvg g b ba a=--++&(7)1[ sin sincos cos ]V D Y mg

    mTbgba=-+ -+&(8)Inabove equations: F is aerodynamic force about the body-fixed frame, I ismoment of inertia, L , M ,N are aerodynamic rolling, pitching, yawing moment, ,

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    6/21

    , p q rare roll, pitch, yaw rate about the body-fixed frame, q is dynamic pressure, Tis thrust,V is velocity, , , ab is angle of attack, sideslip angle, bank angle, and gis fliht pathangle.It is assumed that the aerodynamic forces and moments are expressed asfunctions of angle of attack, sideslip angle, bank angle, angular rates, and controlsurface deflection.3. Dynamic InversionIn this section, we present a feedback linearization technique known as Dynamic

    Inversion. Dynamic inversion is a control design methodology that uses a feedbacksignal to cancel inherent dynamics and simultaneously achieve a specified desireddynamic response [20].Consider a general time-invariant nonlinear system modeled by the ordinarydifferential equations.( , , )( , )x f x u ty H x u==

    &(9)Optimal Fuzzy Logic Tuning of Dynamic Inversion Flight Controller 11There are two separate differential equations: a set of slow dynamicsx&and a set offast dynamics y & .( ) ( )( , ) ( , )x f x g x yy h x y k x y u= += +

    &&(10)Figure 2: Two-timescale inversion of slow dynamics.TABLE 1: Phantom specification and aerodynamic coefficient in cruise flight[9]Symbol unit ValueMeasurementB Ft 38.7 Wing SpanS ft 2 530 Wing Areac ft 1.6 Chord LengthX cg ft 0.29 Xcgm lbs 39000 WeightI xx lbs. ft 2 25000 X axis Inertia moment

    I yy lbs. ft 2 122200 Y axis Inertia momentI zz lbs. ft 2 139800 Z axis Inertia momentI xz lbs. ft 2 2200 XZ palneinenrtia momentIf the system is affine in the controls, then solving explicitly for the controlvectoryields.1( ) [ ( )] y g x x f x-=-& (11)

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    7/21

    Replacement of the inherent dynamics with the desired dynamics results in thecontrol that will produce the desired dynamics.1( ) [ ( )]dy g x x f x-=-&(12)AlirezaAbaspour et al 12Substituting for the linear aircraft dynamics represented as x Ax Bu = + & yiel

    ds a setof slow dynamic equations for the rotational variables(1[ , , ] x ba = ) and a set of fastdynamic equations for the rotational rate variables(2[ , , ] x p q r = ).The rate variablesnow form the input for the slow dynamics, while the actual control surface commandsform the inputs for the rate dynamics. Inverting the slow and fast differentialequationsyields the two dynamic-inversion control laws for the outer dynamic inversion loop

    and inner dynamic inversion loop, whose block diagram is shown in Figure 2.The structure of the two-timescale controller is shown in Figure 3. In eachfeedback loop, control laws2dx and u are designed separately.FIGURE 3: Structure of the two-timescale controller3.1 Inner loop control for the fast variablesWhen designing a flight control system with the two-timescale assumption, the inner-loop controller is designed to control the fast states2x using the control input u, where

    the desired values of the fast states2dx are given by the outer loop. Now for usingdynamic inversion based on (1-8), for the fast differential equation we have:( )( ) ( )( )p aq er rp f xq f x g x

    r f xddd = +

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    8/21

    &&&(13)With considering (13) the controller of inner loop yields:1( )( ) ( )( )a d pe d q

    r d rp f xu g x q f xr f xddd- = = -

    &&&(14)While the desire angular rates defined with following equation:0 00 00 0d p c

    d q cd r cp p pq q qr r rwww- = - -

    &&&(15)Optimal Fuzzy Logic Tuning of Dynamic Inversion Flight Controller 13Where ,p qwwandr

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    9/21

    wthat shown in figure1 by2k , are inner loop control gainswhich chosen by designer to obtain desire performance, and the subscript cdenotes the commands.3.2 Outer loop control for the slow variablesIn the outer loop, the controller is designed to control the slow states1x , and the outputof outer loop used as inner loop commands. The inner-loop controller neglects the

    transient responses of the fast states2x . It assumes that the fast states track theircommanded values instantaneously and that the control surface deflection has noeffecton the outer-loop dynamics.For using dynamic inversion based on (1-8) for the slow variables we have:1 1 2 1( )( ) ( ) ( )( )s s s sf x p

    f x g x q g x uf x rbaba = + +

    &&&(16)Computing the relation between, ,c c c

    p q rand main control surfaces is difficult, sowe neglect the small term of2 1( )s sg x. With considering (16) the controller of outer loopyields.1 1

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    10/21

    ( )( ) ( )( )s sf x pf x g x qf x rbab

    a +

    &&&(17)While the desire angular variables defined with following equation.0 00 00 0d cd cc dba

    bwbbawaa w - = - -

    &&&(18)Where ,bwwanda

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    11/21

    wthat shown in figure1 by1k ,are outer loop control gainswhich chosen by designer to obtain desire performance and , ,c c cba are pilot

    scommands.By using (17), the output of outer loop derived as following equation.11 1( )

    ( ) ( )( )c dc s s dc dp f xq g x f xr f xbaba

    - = -

    &&&(19)AlirezaAbaspour et al 144. Fuzzy PSO controlEach FLC has the structure as shown in the following:Figure 4: The structure of FLC.

    The important components of a FLC are the Fuzzifier, the Inference engine, theFuzzy Knowledge base, and the Defuzzifier. According to Figure 4, the Fuzzifierconverts the crisp input to a linguistic variable using the MFs stored in the fuzzyknowledge base. By using If-Then type fuzzy rules the Inference engine convertsthefuzzy input to a fuzzy output. The Defuzzifier converts the fuzzy output of theinference engine to crisp one. In our design the centre of area (CoA) method, whichsupplies defuzzified output with better continuity is used for defuzzification.

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    12/21

    Ingeneral, CoA method with the output is calculated as:*( )( )ooum u duum u du=

    (20)Where u is the output variable, o is the output fuzzy set and0m is the MFs of theoutput fuzzy set. Minimum Mamdani (AND method), the most popular inferenceengine, is chosen to obtain the best possible conclusion. This type of inferenceengineallows easy and effective computation and it is appropriate for the real time controlapplication [21].The starting point of a fuzzy controller design is to choose the number and the

    shape of the MFs for input and output variables. Our fuzzy controller is similarto PDcontroller. It has two inputs ( , e e & ) and single output (o). So that, threegroups of MFsare chosen for the three corresponding variables and. Each group has 7 triangular MFsas shown in Figure 5. It has been found that using complex forms of MFs cannot bringany advantage over the triangular ones, where this kind of MFs gives faster response[22].In fact, appropriate number and shapes of membership functions are usually result

    of different compromises among contradicting factors, such as accuracy, hardwareandcomputation complexities. The ones, we are mostly concerned in this work, are relativeaccuracy, computation time, and complexity.Optimal Fuzzy Logic Tuning of Dynamic Inversion Flight Controller 15Figure 5: Typical set of MFs.Before defining the rules we normalize the input and output data of the controller,the normalization procedures are required to transform performance ratings withdifferent data measurement units into a decision matrix with compatible unit. Sothat,the variables, , e e & and C are quantized and normalized within [-1, 1], accord

    ing to thefollowing Equation:maxnormXXX=(21)Where, the variable has to be normalized to its maximum value. The maximum

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    13/21

    values of the controller's variables can be obtained from the engineering experience ofdesigner and simulation results. As the absolute maximum value of e ande&are alwaysbetween 0 and 1(radian), there is no need to normalize and denormalize them, butforC we use scaling factor of 20 to denormalize it. Each normalized variable then isreplaced by a set of linguistic values as shown in Table 2.TABLE2: Term sets adopted.

    e ,e&& u LN MN SN ZE SP MP BPWhere, the linguistic values {LN, MN LP} are abbreviations of {LargeNegative, Medium Negative Large Positive} respectively as shown in Figure 3.Now, we can obtain the rules based upon this paper conception.4.1 Defining the ruleWhile model is running, we have two parameter to control, the error of controllerwhich showed by e and its variation ratio showed bye&. As you can see in table3,because our controller is similar to PD controller, the relation between e and

    e&definedby a sum assumption.AlirezaAbaspour et al 16TABLE3: The entire Rules of FLCDI.PBPMPSZENSNMNBe

    e&ZE NS NS NM NM NB NB NBPS ZE NS NS NM NM NB NMPS PS ZE NS NS NM NM NSPM PS PS ZE NS NS NM ZEPM PM PS PS ZE NS NS PSPB PM PM PS PS ZE NS PMPB PB PM PM PS PS ZE PB4.2 PSOThe PSO is a population based stochastic optimization technique, consists of a swarmof particles flying through the search space. Every individual in the swarm contains

    parameters for position and velocity. The position of each particle represents apotential solution to the optimization problem. The dynamic of the swarm is governedby a set of rules that modify the velocity of each particle according to the experience ofthe particle and its neighbors depending on the social network structure withintheswarm. By adding a velocity to the current position, the position of each particle ismodified. As the particles move around the space, different fitness values are g

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    14/21

    iven tothe particles at different locations according to how the current positions of particlessatisfy the objective. At the iteration each particle keeps track of its personal bestposition. Depending on the social network structure of the swarm, the global bestposition, and/or the local best position, is used to influence the swarm dynamic. After anumber of iterations, the particles will eventually cluster around the area where fittest

    solutions are. The swarm behavior is influenced by the number of particles, theneighborhood size, the inertia weight, the maximum velocity, and the accelerationcalculation that modifies the velocity. The larger the number of particles in the swarm,the more likely the swarm will converge on the global optimum, because the socialinformation exchange is increased. The influence of the current velocity on thenewvelocity can be controlled by the inertia weight. The influence of the particle'sexperience and that of its neighbor is governed by the acceleration calculation.Theacceleration limits the trajectory of the particle oscillation. The new velocity

    is limitedby the given maximum velocity to prevent particles from moving too fast in the space.In particular, the velocity associated with each particle in PSO is calculated as:1 12 2( 1) . ( ) . ( )( ( )). ( )( ( ))i i g ipi iv k wv k c r k x x k

    c r k x x k+ = + -+-(22)Wherew is the momentum or inertia weight of the particle, ( )iv k is the velocity ofthe particle i at time step k ,gx is the global best performing particle up to time step kOptimal Fuzzy Logic Tuning of Dynamic Inversion Flight Controller 17in the entire population,p

    ix is the best experience particle has had up to time step k ,kix is the current location of particle i ,and1 2, c c are constants usually equal each toother,1 2, r r are random numbers within [0, 1] those represent random fiction[23]. To

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    15/21

    limit the searching space is limited to be within a certain range ofmin max i i iv v v . Thenew location of particle can be calculated as:( 1) ( ) ( 1)i i ix k x k v k + = + +(23)The evaluation of the particle performance is based on a problem specific objectivefunction that decides the `closeness' of the particle to the optimal solution. With

    Figure6, the optimization process is started with random initial values then the objectfunction is calculated. The first positions are automatically the best values. Based on(22 and 23) the PSO updates both velocity and position vectors. Object functioniscalculated again, if the new value of the object function is smaller than the old one, thecorresponding position vector is replaced by the old one, else it remained. Theprocessis re-run until a termination criterion, such as a limit on the number of iterations or

    satisfactory results, is reached.Figure6: Flowchart of PSO.AlirezaAbaspour et al 184.3 Optimization of the MFsEach triangular MFs is determined by three parameters such as a, b and c, wherea, clocate the "feet" of the triangle and b locates the peak (see Figure 5). Anywaythetriangular MF has the form:0,,( , , , ),

    0,trimx ax aa x bb af x a b cc xb x cc bc x

    - -=- -

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    16/21

    (24)The corresponding parameters have to satisfy the inequality Since there are 14 MFsin the inputs and 7 MFs in the output, in addition, each MF has its three ownparameters. In total we have 63 parameters for optimization, so that, a vector ofdimension particles is adopted in the optimization process. The population is set P=50

    as vectors, while the total searching iterations is set to be I=30. With the help of [23],the inertia weight w was set to be 0.9 decreased linearly to 0.4 and the weightingfactors1 2, c c were set to be 0.5 for both, while1 2, r r are randomized within [0,1].Therefore, it is possible to use PSO as a global optimization search method to find aset of such parameters that will produce the best control performance of the FLC.

    Throughout the optimization process we try to minimize the the miss distance , theobject function is defined as:TJ x Qxdt = (25)In (25) x is a vector which contain the parameter that should be optimized andQis a diagonal matrix which denotes the limitation and importance of errors.[ ]101 / 40 1 / ( 400 [6 ])T

    beta alpha mutx E E EQ diag==(26)Q is a parameters which chosen by designer according to system's dynamics andthe desired control behavior. For the optimization process, we assumed the followingdata:One of the important factors in the simulation process is usually the integration

    time-step. This is normally chosen based on nature of the problem or experience.Here,we use a time step equal to 0.01 second, mainly because a typical airplane-gyrogyratesaround 100 cycles per second.5. Numerical SimulationIn this paper we used the combination of dynamic inversion control and fuzzy logiccontrol and PSO as we described. To find the advantages and disadvantages of this

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    17/21

    Optnewinvethecomof Vtheoutpnw=unc

    centoutptimal Fuzzyw method wersion to a cperformancmmand valuV=0.9 MachTo make thedges, youput of filter=2 , x=1 toFor a better

    ertainties wter of graviput were tuna. e ald. e alphg. C aLogic Tuniwe should cocertain commce of controles of , abah, h=1000ft:Com

    da

    b

    he step inpucan see thedepends onmake the inFIr comparisowhich is usu

    ity(c.g) is fned by PSOlphaha dotalphaFIGing of Dynaompare the rmand. Sincller, we sele

  • 8/11/2019 Abaspour Optimal Fuzzy Logic Tuning of Dynamic Inversion Afcs

    18/21

    and are a:TABLETimemmand(degrut similar ase filter strun two paramnput like reaIGURE 7: Con between

    ually happenfixed in maO algorithm aGURE 8: Tumic Inversiresult of thie step inputected step inapplied to thE 4. Input coe(s)ree)0 0 t