· web viewfuzzy logic systems are used as control systems that need to handle the vagueness of...

14

Upload: vuongkhue

Post on 20-May-2018

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary
Page 2:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

Group Technical Paper

Fuzzy Control System Optimization

Submitted To

The 2012 Academic Year NSF AY-REU ProgramPart of

NSF Type 1 STEP Grant

Sponsored ByThe National Science FoundationGrant ID No.: DUE-0756921

College of Engineering and Applied ScienceUniversity of Cincinnati

Cincinnati, Ohio

Prepared By

Andrew Janson, Senior, Computer ScienceNicklas Stockton, Sophomore, Aerospace Engineering

Report Reviewed By:

_________________________

Dr. Kelly CohenREU Faculty Mentor

University of CincinnatiSeptember 9 – December 5, 2013

Page 3:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

Introduction

Fuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary logic of conventional computers.1 In fuzzy logic, the truth of any statement becomes a matter of degree. Take for example, determining the timespan of your weekend. As seen in Fig. 1, binary logic only allows a yes/no answer to the question: “Is this day part of my weekend?” However, in the real world we do not consider exactly 12am Saturday to be the start of our weekend. We usually view most of Friday a part of the weekend, determined by when we decide to quit working. Fuzzy logic allows us to specify that most of Friday is considered the weekend as well by assigning it a value of less than one but greater than 0. This distinction gives the fuzzy logic system much more robustness compared to binary logic.

Figure 1. Comparison between binary and multivalued membership of a weekend.1

Many of structural dynamics problems may be represented by a coupled set of second-order dynamic systems. Coupled rigid-body and flexible body dynamics are sensitive to gust loads and low flutter speeds. The best solution is to use active control to augment structural dynamics.

The objective for this research project is to develop an effective non-linear active structural control methodology to provide stability in large flexible structures. This goal also takes into consideration performance and managing this stability with minimum cost. An emulation of a minimum time controller using a fuzzy logic universal approximator will be used in order to develop this methodology. The simplified model will consist of two rigid bodies connected by a spring, which must travel a specified distance in minimum time. This is shown in Fig. 2. The output of the fuzzy inference system (FIS) is the force on car 2 that accelerates and decelerates the spring-mass system.

Figure 2. Diagram of two rigid bodies connected by a spring traversing distance L in minimum time.

Page 4:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

Materials and Methods

Simulation

A simulated environment of the model depicted in Figure 2 above is necessary to test the efficacy of the proposed fuzzy inference systems. The constants for the model are the weight (mass) of the cars, the spring constant of the spring connecting the two cars, and the distance to the wall that must be traversed.

m1=1kgm2=2kg

K=250N /mL=100m

The modeled system contains displacement and velocity sensors on each cart. Therefore, the four inputs to the FIS are the distances traveled and the velocities of both car 1 and car 2. The output of the system is the force to be applied to car 2, limited to ±1N. At each time instant the FIS will use the four inputs and determine the force that must be applied to cart 2, governed by a set of fuzzy rules.

Input: y ( t )=[ x1(t )x2(t )x1(t )x2(t )

]Output: |F (t)|≤1N

The initial conditions at time t=0 are that both car 1 and car 2 are at rest and are starting at position zero. The maximum runtime for the simulation was 500 seconds. The final conditions for the simulation stipulate that the distance traveled by the two cars should not exceed 100m and they should be at rest without oscillating.

y (0 )=[0000] , y (500 )=[¿100¿10000 ]

The acceleration of car 1 is determined by the displacement between the two cars, the spring constant, and the mass of the car. The acceleration of car 2 is also determined by these factors in addition to the output force exerted on the car over its mass.

Car 1: x1=km1

( x2−x1 )

Car 2: x2=km2

(x1−x2 )+ fm2

MATLAB’s ode45 differential equation solver and Fuzzy Tool Box were utilized to simulate the spring-mass system and integrate with the fuzzy controller.

Page 5:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

Data Evaluation

The efficiency of a FIS’s control of the system will be based upon how fast it traverses the distance to the wall and how close the cars settle to the wall without hitting it. The cost function J is then defined by the settling time t f, the time taken to settle the cars within 1m of the wall and the steady state error, the distance between the front car and the wall. The control system that produces the lowest value of J will be proven to be the best solution.

t f=|L−xi ( tf )|≤1m

J=t f100

+2 [L−x2 (500 ) ]

In order to provide a frame of reference for the performance of any control system the theoretical limits of the simulation were calculated to provide a lower bound. This lower bound is the minimum cost that an ideal, optimal solution can obtain. For a rigid body, the mass of the two cars is 3kg and the maximum possible force exerted on car 2 is 1N. From these values the maximum average acceleration of the system is defined as:

Force (F )=mass (m)∗acceleration (a)

a= Fm

= 1N3kg

=13m /s2

From the maximum acceleration of the system the minimum time to traverse the distance to the wall, 100m, can be calculated. There are two different scenarios to consider.

(1) Applying maximum force over the entire distance and instantaneously stopping the cars at the wall. This scenario is not feasible, but will serve as the absolute minimum time it will take for the cars to approach the wall.

Distance (d )=Velo city(v )time(t)

t= vd

The velocity is the average velocity of the cars over the distance traversed, 100m. If a constant force of 1N is applied to the cars and the initial velocity is zero, the traversal time can be calculated.

d=v i t+12a t 2, vi = 0

d=12a t2

t=√ 2da =√ 2(99m)13m /s2

=24.37 seconds

Page 6:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

(2) Applying maximum force over half the distance and then applying maximum negative force in the second half to slow the velocity of the cars to zero right at the wall.

First Half:

t=√ 2da =√ 2(49.5m)13m /s2

=17.23 seconds

Decelerating back to rest over the next fifty meters takes the same amount of time; therefore the total time taken to reach 100m is 34.46 seconds. However, we want the time taken to reach the 99m mark. The time taken to travel the last meter is 2.45 seconds. Therefore, the best time to reach the 99m mark and reach zero velocity at the wall is:

t=32.19 seconds

If the car stops at exactly 100m the cost function evaluates to:

J=32.19100

+2 [100−100 ]=0.3219

The latter scenario is the more realistic of the two and will be the limit that the control systems will try to achieve. The actual system is a flexible body structure that will oscillate, so the control systems will not reach this rigid body limit.

Fuzzy Controller Development

After developing the basic structure for the fuzzy controller, an iterative process was developed which varied each of six chosen membership function parameters to a small degree in order to observe the effect on controller performance and cost. The goal was to accumulate enough data to understand which changes would be most beneficial to lowering the cost function output. Out of 300 iterations, one in particular showed promise of dramatically reducing the overall cost and was chosen as a platform from which to develop an optimum solution.

Using these new parameters and the intuition gained from studying the data from the other iterations, certain parameters were varied in a more structured manner to obtain an optimum solution.

Robustness Test

An initial evaluation of each solution’s robustness, ability to perform under varying conditions, was performed. The three solutions tested were the linear system, the best provided fuzzy system, and the fuzzy system developed during this project. To test the robustness of the systems the spring constant was varied ±20% from its nominal value. The simulations were run with this new value of K and the cost function was calculated and compared to the value obtained at nominal K.

Knom=250Nm, K 0.8=200

Nm, K1.2=300

Nm

Results

Page 7:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

Analysis of the provided solutions show similar approaches with nearly identical rule bases. The best three solutions given are:

Table 1 - Solutions from former students were provided as a reference point of study

Student t f x2 (500 ) JA1 32.550s 99.998766m 0.32797B2 32.366s 99.984220m 0.35522C3 42.000s 99.965200m 0.48960

To better understand the dynamics of the plant model, various means of non-fuzzy control are employed. Fine-tuning of switch point (between acceleration and deceleration) and damping strength are key factors in reducing the cost function. The following table shows the linear (non-fuzzy) attempts at a solution:

Table 2 - Non-fuzzy solutions were developed using simple if-else structures

Attempt # Switch pt. Damping force t f x2 (500 ) J1 17.2896875s f=− x2 35.707s 99.9988m 0.359562 17.2999299s f=−1.9 x2 32.811s 99.9606m 0.408863 17.2999299s f=− x2 ¿ 32.269s 99.9983m 0.32590

Using the lessons learned from developing a linear solution, formulation of a Fuzzy Inference System (FIS) begins by defining three membership functions for both the x2 and x2 inputs, namely {far,close,veryclose} and {negative,zero,positive} respectively (see figures 1, 2). The output value was constructed of three membership functions, namely {negative,zero,positive} (see figure 3).

Figure 1 – Membership functions for input x2 Figure 2 – Membership functions for input x2

Page 8:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

The rules for this FIS were obtained using the knowledge gleaned from working with the non-fuzzy model. Due to the minimal number of membership functions, few rules were necessary as shown below in table 3.

Table 3 - Rule base for FIS Controller

x2Negative Zero Positive

x2Far Positive

Close Positive Zero NegativeVeryClose Positive Zero Negative

The FIS herein demonstrated produced the following results.

Table 4 – Final results from successful FIS

t f x2 (500 ) J32.303s 99.999821m 0.32339

Robustness Test Results

Tests were run on each controller by varying the spring constant K by ±20% and ±40%. The linear controller was adjusted to match each new value, and the fuzzy systems were left as they were initially developed. The linear system left unadjusted varied up to 258% while both fuzzy systems varied less than 2% from their nominal costs.

Figure 4 – Plot of system control force over time. Note the low-amplitude oscillations

Page 9:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

Table 5 - Robustness test results. Shown are the cost values obtained from each test and the percent change from nominal values.

-40% -20% Nominal 20% 40%150 N/m 200 N/m 250 N/m 300 N/m 350 N/m

Linear 1.1551 0.4817 0.3227 0.7813 0.5835FIS A 0.3337 0.3269 0.3287 0.3292 0.3257Project FIS 0.3235 0.3286 0.323 0.3256 0.3245Linear Adjusted 0.4126 0.3263 0.3227 0.3349 0.3694

Percent Change from NominalLinear 257.95% 49.27% 0.00% 142.11% 80.82%FIS A 1.52% -0.55% 0.00% 0.15% -0.91%Project FIS 0.15% 1.73% 0.00% 0.80% 0.46%Linear Adjusted 27.86% 1.12% 0.00% 3.78% 14.47%

Discussion

Significant time was spent on the linear solution to this problem in order to discern what aspects of the system contribute to a minimal cost. It was determined by this process that the final position of x2 far outweighed the

settling time in the cost function and much effort was expended in minimizing the distance of x2 from the wall; therefore, the goal became twofold: 1) reach a minimum settling time and 2) minimize final distance from the wall.

Initially, this goal of approaching the wall closely was undertaken by attempting to “tweak” the switch point between acceleration and deceleration; the thinking was that if an accurate enough switch point was determined, the damping would bring the system to a stop very near the wall. It was quickly discovered, however, that the damping force is far more important to the final position of the system in the final meter than the switching point. The switch point effectiveness is exhibited in the settling time of the system. As seen in table 2, attempt #2 has a lower settling time due to a more precise switch point, but this improved time does not lead to a lower cost.

It was determined from these trials that a damping force needs be proportional to the velocity of the system, but it was unknown by what ratio. By means of trial and error a constant was found which settled the system in the requisite distance, but led to a poor overall cost. From this, it was determined that a proportionality constant which varied over distance was necessary in order to effectively damp the oscillations in minimum time. This

discovery led to the damping force, f=− x2( 7.9112100−x2 ) as shown in table 2. This force, which increases in

magnitude as the system approaches the 100m wall, drastically decreased the value of the cost function because it allows the cart to approach the wall more closely before damping is completed.

Having gained the insight from working with a linear control structure, an attempt was then made to develop a FIS structure. Using one of the provided solutions2 as a base, changes were made to reduce the number of membership functions and to reduce the rule base. Because critical damping does not need to occur until the system is very close to the wall, it was decided to consider the system as a rigid body until it at least reached the settling envelope of 1m from the wall, thus the switch point from “far” to “close” is a sharp transition much like a linear solution would produce. The “veryclose” function was given the bounds [99.9 100.1] in order to reduce all of the damping to the final .1m of the system’s movement.

Page 10:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

The membership functions for the data from x2 were made to be symmetrical for ease of adjustment; being centered on zero, only one parameter was tuned. Again by trial-and-error, the cost was quickly reduced to a near-optimal 0.32339. As can be seen in figure 4, the amplitude of the damping force is kept at a minimum due to these tuned membership functions.

The robustness test has shown that fuzzy systems accommodate variations in system parameters. Though the linear solution was finely-tuned to provide a low-cost solution, it proves to be system specific and performs poorly under varied conditions.

Conclusion

Fuzzy systems are a low-cost, robust control option for active control of flexible structures. It has been shown that a fuzzy system outperformed the nominal linear solution in every test case and did so with less developmental effort expended. The fuzzy system provides near-optimal control even under different conditions than were used in development. This demonstrates the system-independent characteristics of fuzzy control.

The control methodology developed from this research can be summarized as follows:

1. Determine in which frames the system behaves like a rigid or flexible body2. Treat system as flexible body only in those frames where it behaves as such3. Tune flexible control mechanism to minimize cost

The optimal solution arose from the combination of a number of factors. First, the FIS developed in this research provided oscillatory damping in minimal time. This allowed the controller to exert most of its force in linear fashion, accelerating and decelerating the system as a rigid body. Due to optimal damping control, damping was exerted only as the system approached the wall. The extent of the damping increased in proportion to the distance from the wall while factoring in the decrease in velocity of the cart system. Due to the specific application of damping force, more time is allowed for the system to be accelerated and decelerated, which reduces settling time. This results in a system which performs optimally.

References

Page 11:  · Web viewFuzzy logic systems are used as control systems that need to handle the vagueness of the real world. Fuzzy logic can model and control nuances overlooked by the binary

1. Vick, Tyler. (2013). “Fuzzy Logic,” AEEM 6096 Report, College of Engineering and Applied Sciences, University of Cincinnati, Cincinnati, Ohio

2. Walker, Alex. (2013). “Fuzzy Control Systems,” AEEM 6096 Report, College of Engineering and Applied Sciences, University of Cincinnati, Cincinnati, Ohio

3. Carson, Aaron. (2013). “Two Mass System: Fuzzy Logic Control,” AEEM 6096 Report, College of Engineering and Applied Sciences, University of Cincinnati, Cincinnati, Ohio

Nomenclature

a = accelerationd = distancef = forceF(t) = force at time tJ = cost functionK = spring constantL = distance to wallm1 = mass of car 1m2 = mass of car 2t = timetf = settling timev = velocityvi = initial velocityx1 = position of car 1x2 = position of car 2x1 = velocity of car 1x2 = velocity of car 2x1 = acceleration of car 1x2 = acceleration of car 2y(t) = input to FIS at time t