1
Control Surface Analysis
Introduction
The output equation analysis chapter demonstrates that the fuzzy logic controller (FLC) approximates a piecewise linear controller with many similarities to the classical controller. Graphical techniques. The goal of this chapter is to analyze the proportional FLC (PFLC) and proportional-plus-derivative FLC (PDFLC) by visually determining the effects of parameter variations on input-output relationships.
The input-output relationship for a controller can be interpreted graphically as a multi-dimensional surface. The PFLC has error as the independent variable and output as the dependent variable. The input-output relationship is plotted on the X-Y planes. For a PD controller, the error and change in error are the independent variables and the controller output is the dependent variable. The output graph is a three dimensional contour.
PFLC Control Surface Analysis
The P controller has a single input that is multiplied by a gain to produce the output. The equation of the controller can be expressed as:
PFLC Control Surface Analysis 2
zC=Kpe (1)
where e is the input error, Kp is the gain, and zC is the output. For the PFLC, error input
is first fuzzified and then the defuzzification process determines the final output. A general form of the PFLC is
zF=KpF(f(e)) (2)
where f( ) is the fuzzification of the input variables and F( ) is the defuzzification process. The gain, Kp, scales the output of the PFLC. As shown in (2), changing either the fuzzification or the defuzzification process parameters will change the output. Therefore, the effects of changing the PFLC parameters can be shown graphically by plotting PFLC output.
For the classical controller there is a constant linear relationship between input and output. The gain Kp, is the slope of the line for the input-output plots. The graphical analysis in this section is for the PFLC described by the constraints in the output equation analysis chapter. The fuzzification process uses triangular membership functions and the defuzzification process uses the simplified reasoning method. Equation (4) of the output equation analysis chapter shows that the PFLC is piecewise linear and the slope of each line segment is determined by input and output membership function parameters. By plotting the controller output, the effects of changing the PFLC parameters on the piecewise linearity of the PFLC can be visualized.
Slope 3
Slope
Equation (1) for the classical P controller is an equation of a line. Therefore, classical analytical descriptions of a line can be used. A line in rectangular coordinates is described by Ax+By+D=0 which corresponds to Kpe-zC=0 (D = 0). Any change to the gain Kp, changes the slope of the line. Kp is always positive because of the physical restrictions of the controller. Therefore, the output line will always have a positive slope.
Graphical analysis of the controller can determine the gain. For example, Figure 1 shows the output of a P controller with Kp equal to one and the output limited to ±1. The slope of the line is one. The second line in Figure 1 has a slope of 2 and the output is limited to ±2. The gain of the controller that produced the output is two.
-1.5 -1.2 -.9 -.6 -.3 0 .3 .6 .9 1.2 1.5 -2 -1.5 -1 -.5 0 .5 1 1.5 2 Error Controller Output Slope=1 Slope=2
Change in Membership Functions and Outputs 4 For the PFLC, the plot is not necessarily linear. However, the output gain determines the basic slope based on the assumption that equation (2) can be expressed as zF=Kpe. The output of the defuzzification process is normalized to [-1 ,1]. Equation (2) is only valid in the range -1< e < 1. Outside this range, the control output is ±Kp. Therefore, Kp is the gain of the controller as well as the maximum output.
The basic line is described by Kpe which best approximates the FLC output for the range -1< e < 1. The specific parameters for the fuzzification and defuzzification process determine how the PFLC output deviates from the basic line. The graphical analysis used for the classical controller output line can also be used for the FLC basic line.
Change in Membership Functions and Outputs
The error input to the PFLC is fuzzified by dividing the input into ranges and applying a membership function to each range. The defuzzification process determines the final output based on the rules. Therefore, over each range of input, the parameters used in fuzzification and defuzzification will affect the shape of the input-output graph.
Equation (4) of the output equation analysis chapter shows that the PFLC output for a specific range of input has an effective gain and a constant term. The effective gain is inversely proportional to the difference between peak values of the error fuzzy sets and directly proportional to the difference between peak values of the output fuzzy sets. The output of a PFLC with seven fuzzy sets for error shown in Figure 2 graphically demonstrates the effects of changing parameters on the effective gain and constant term. As defined in Table 1, the differences between peak values around the zero input fuzzy
Change in Membership Functions and Outputs 5
sets (NS-ZO and ZO-PS) are smaller than equally spaced peak values. The slopes of the narrower regions around zero have increased but the slope of the larger adjacent segments (NM-NS and PS-PM) has decreased. The dashed line that extends the plot of the PFLC output for the PS to PM shown in Figure 2 indicates the value of the constant term. The constant has increased from zero for the around zero output to 0.22 for the PS-PM region. The constant indicates that for this segment of the control action, if the input were zero, the controller output would be non-zero.
-1.5 -1.2 -.9 -.6 -.3 0 .3 .6 .9 1.2 1.5 -2 -1.5 -1 -.5 0 .5 1 1.5 2 Error Controller Output Slope=1 Slope=2
Change in Membership Functions and Outputs 6 Table 1. Rule base for narrower around zero center values for input fuzzy sets.
NB NM NS ZO PS PM PB
Input Fuzzy Sets -1 -2/3 -1/6 0 1/6 2/3 1
Output Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
Figure 3 shows the effects of changing the peak values for the output fuzzy sets. As listed in Table 2, the output values of the rules around zero are smaller. Therefore, the difference between the output values for the around zero rules are smaller and the corresponding slopes of the lines are also smaller. The adjacent regions where the difference between output values are larger than the narrower regions have a larger slope. The dashed line on this plot indicates the constant controller output for this region. In this case, the constant is negative which indicates that if the error input were zero, the
-1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1 -2.1 -1.8 -1.5 -1.2 -.9 -.6 -.3 0 .3 .6 .9 1.2 Error Controller Output
PDFLC Control Surface Analysis 7
controller output would be negative.
Though an exact equation was developed in output equation analysis chapter, the values for the slope and constant can be approximated from the plots. Some FLC may not have an exact mathematical equation. Therefore, graphical analysis is an effective tool for determining the output control action for the PFLC. Analysis of the PFLC is simple because there is only one input. Also, there are only two parameters to adjust; error peak values and output. The following section extends the graphical analysis to the two input control variables.
PDFLC Control Surface Analysis
For the PD controller, the input-output control function to be expressed graphically is
(
)
zC =Kd∆e+K ep =Kp KdKp∆e e+ (3)
where e and ∆e are error and change in error and zC is the control action. However, for
the PDFLC, the output is determined by the fuzzification of the input variables and the defuzzification scheme. Therefore, a general of the PDFLC is
(
)
( ) zF K F fp e f e K K d p = ∆ + (4)Table 2. Rule base for narrower around zero center values for output fuzzy sets.
NB NM NS ZO PS PM PB
Error Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
Orientation and Scaling 8 where f
( )
is the fuzzification of the input variables and F() is the defuzzification process. The gain KdKp scales the change in error input and Kp scales the output. Thefuzzification and defuzzification process are the same as the PFLC.
For the classical controller and the FLC, the gains determine scaling and orientation of the control surface. The control surface for the classical PD controller is always a plane. However, equation (9) of the output equation analysis shows that the shape of the graph of the PDFLC output is determined by input and output membership function parameters. Thus, plotting the output of the PDFLC, the effects of changing parameters can be visualized.
Orientation and Scaling
Equation (3) for the classical controller is the equation of a plane. Changes in the gains, Kp and Kd, change the orientation and scaling of the control surface. Classical analytical descriptions of a plane can be used to analyze the controller output. A plane in rectangular coordinates is described by Ax+By+Cz+D=0 which corresponds to Kpe+Kd∆e+zC=0 (D = 0). Changes in Kp change the orientation relative to the e-∆e axis and the e-z axis. Likewise, changes in Kd change the orientation relative to the e-∆e axis and the ∆e-z axis. Kp and Kd are always positive because of the physical restrictions of the
controller. Therefore, the output plane will always have a positive orientation relative to the major axes.
Changes in Kp and Kd in equal proportion will change the scaling of the plane but not the orientation. For a plane that extends indefinitely, the scaling determines the rate of
Orientation and Scaling 9 expansion of the plane. For a plane that has a set boundary, scaling determines the rate at which the input values reach the boundary.
Graphical analysis of the control surface visually indicates the relative values of the gains Kp and Kd. A controller with Kp equal to Kd will have the same slope of the line formed by the intersection of the output plane and the e-z plane as compared to the slope of the line formed by the intersection of the control output plane and ∆e-z plane. Figure 4. shows the output of a controller with Kp and KD equal to one and the output limited to ±1.0. For this controller, the slopes of the lines on the e-z and ∆e-z axes are equal as shown in Figure 6. . A larger value of Kd relative to Kp has a line on the ∆e-z axis with a larger slope than the slope of the line on the e-z axis. Figure 8 shows the control surface of a controller with Kd equal to two and KP equal to one and the output limited to ±1.0.
As expected, the plot of the slope of the line on the ∆e-z axis is exactly twice the slope of the line on the e-z axis as shown in Figure 9. Likewise, a larger Kp relative to Kd has a line on the e-z axis with a larger slope than the slope of the line on the ∆e-z axis. Figure 10 shows the output of a controller with Kp equal to two and Kd equal to one and the output limited to ±1.0. The graphs in Figure 12 verify that the slope of the line on the e-z axis is twice that of the slope of the line on the ∆e-z axis.
Orientation and Scaling 10 -1. 0. 1. DE -1. 0. 1. E -1. 0. 1. Output
Figure 4. Controller output for Kp = Kd = 1.0.
-1 -.5 0 .5 1 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1 Error (Change-in-Error=0) Controller Output -1 -.5 0 .5 1 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1
Change in Error (Error=0)
Controller Output
Orientation and Scaling 11 -1. 0. 1. DE -1. 0. 1. E -1. 0. 1. Output
Figure 8. Controller output for Kp=1.0 and Kd = 2.0.
-1 -.5 0 .5 1 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1 Error (Change-in-Error=0) Controller Output -1 -.5 0 .5 1 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1
Change in Error (Error=0)
Controller Output
Orientation and Scaling 12 -1. 0. 1. DE -1. 0. 1. E -1. 0. 1. Output
Figure 10. Controller output for Kp=2.0 and Kd=1.0.
-1 -.5 0 .5 1 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1 Error (Change-in-Error=0) Controller Output -1 -.5 0 .5 1 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1
Change in Error (Error=0)
Controller Output
Change in Membership and Output 13 For the PDFLC, the control surface is not necessarily a plane. However, the input and output gains determine the basic orientation of the control surface based on the assumption that equation (4) can be expressed as z Kp e e K e K e
K
K d p
d p
= ( ∆ + =) ∆ + . The
output of the defuzzification process is normalized to [-1,1]. Therefore, equation (4) is only valid in the range − <1 KdKp∆e+ <e 1. Outside this range, the control output is ±Kp. Therefore, Kp affects both the orientation and the maximum output.
The basic plane is described by K ep +Kd∆e which best approximates the FLC output surface for the range − <1 KdKp∆e+ <e 1. The specific parameters for the fuzzification
and defuzzification process determine how the control surface deviates from the basic plane. The same graphical analysis used for the classical controller output plane is used for the FLC basic plane.
Change in Membership and Output
The fuzzification of the input variables and the defuzzification process determine the shape of the output control surface. The defuzzification process affects the total control surface since a single operation is applied to all rules in the rule matrix. The fuzzification process divides the inputs and outputs into ranges and the membership functions are applied to each range. As the input values change from one range to another and if the membership functions are different, the shape of the contour changes around the range where the change has occurred. Table 3 indicates the labels that describe the fuzzy set peak values for the error, change in error and output that are used in this section.
Change in Membership and Output 14 Table 3. Rule Base for PDFLC indicating labels for fuzzy set peak value.
Error NB NS ZO PS PB NB NB NB NB NS ZO Change in NS NB NB NS ZO PS Error ZO NB NS ZO PS PB PS NB ZO PS PB PB PB ZO PS PB PB PB
Figure 14 shows the output for a PDFLC that has seven equally spaced fuzzy sets for error, change in error, and output. The fuzzy set peak values are given in Table 4. This contour shows the input-output response for both inputs in the range -1 to 1. Fixing one of the inputs to a constant value and plotting the other input versus output shows how the fuzzy sets determine the effective gain. As an example, Figure 15 shows error versus output for the change in error fixed at 0.5 and change in error versus output for error fixed
-1. 0. 1. DE -1. 0. 1. E -1. 0. 1. Output
Change in Membership and Output 15 at 0.5.
Table 4 Equally spaced peak values for error, change in error and output fuzzy sets.
NB NM NS ZO PS PM PB
Error Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
Change in Error Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
Output Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
-1 -.5 0 .5 1 -.6 -.4 -.2 0 .2 .4 .6 .8 1 Error (Change-in-Error=.5) Controller Output -1 -.5 0 .5 1 -.6 -.4 -.2 0 .2 .4 .6 .8 1
Change in Error (Error=.5)
Controller Output
Figure 15. FLC outputs plotted on e-z and ∆e-z axes.
Equations (14)-(16) of the output equation analysis indicate that changing either input fuzzy set for a PDFLC changes the effective proportional and derivative gains and the constant term. When an input error fuzzy set changes, the magnitude of the effective
Change in Membership and Output 16 derivative gain changes and the contour for the effective error changes shape. Figure 16 is an example of the controller output where the error fuzzy sets around zero have been set narrower. The fuzzy set peak values are given in Table 6. As compared to the output for the original fuzzy sets shown in Figure 15, Figure 17 shows that the contour for the output has changed shape. In fact, equation (9) of the output equation analysis chapter indicates that smaller the widths of the fuzzy sets, the greater the error gain and constant for that interval. The slope of the contour around the new fuzzy sets is larger than the previous example that corresponds to a greater effective gain. The constant term has increased from zero to 0.22 as demonstrated by the dashed line extended to the y-axis. Also, as expected, the change in error versus output has increased in magnitude but the shape has not changed.
-1. 0. 1. DE -1. 0. 1. E -1. 0. 1. Output
Change in Membership and Output 17 Table 6 Equally spaced peak values for change in error and output fuzzy sets with smaller
around zero peak values for error.
NB NM NS ZO PS PM PB
Error Fuzzy Sets -1 -2/3 -1/6 0 1/6 2/3 1
Change in Error Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
Output Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
-1 -.5 0 .5 1 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1 Error (Change-in-Error=0.0) Controller Output -1 -.5 0 .5 1 -.6 -.4 -.2 0 .2 .4 .6 .8 1
Change in Error (Error=0.5)
Controller Output
Figure 17. FLC outputs plotted on e-z and ∆e-z axes.
Figure 18 is an example of the controller output where the fuzzy sets around zero for the change in error have been set narrower. The fuzzy set peak values are given in Table 7. Similar to the previous example, Figure 19 shows that the contour for the change in
Change in Membership and Output 18 error versus output has changed shape but the error versus output has changed in magnitude but not shape.
-1. 0. 1. DE -1. 0. 1. E -1. 0. 1. Output
Figure 18. FLC controller output for narrower around zero fuzzy sets for change in error. Table 7 Equally spaced peak values for error and output fuzzy sets with smaller around
zero peak values for change in error.
NB NM NS ZO PS PM PB
Error Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
Change in Error Fuzzy Sets -1 -2/3 -1/6 0 1/6 2/3 1
Change in Membership and Output 19 -1 -.5 0 .5 1 -.6 -.4 -.2 0 .2 .4 .6 .8 1 Error (Change-in-Error=.5) Controller Output -1 -.5 0 .5 1 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1
Change in Error (Error=0.0)
Controller Output
Figure 19. FLC outputs plotted on e-z and ∆e-z axes.
Equations (10) and (11) of the output equation analysis chapter also show that if the output sets change, the effective gains and constant term will change. Figure 20 shows the input-output contour for output fuzzy sets around zero that are narrower than the equally spaced example. The fuzzy set peak values are given in Table 8. The plots of the cross sections of this contour shown in Figure 21 indicate that the effective gains are identical. The effective gains have reduced around zero because as shown in equation (10) of the output equation analysis chapter, the smaller the difference between output sets, the smaller the effective gain. The dashed line that extends the plot of the output for
Change in Membership and Output 20 the interval shows that the constant term for the interval is negative. If the input error or change in error were zero the output would be -0.33.
-1.
0.
1.
DE
-1.
0.
1.
E
-1.
0.
1.
Output
Figure 20. FLC controller output for narrower around zero fuzzy sets for output. Table 8. Equally spaced peak values for error and change in error fuzzy sets with smaller
around zero peak values for output.
NB NM NS ZO PS PM PB
Error Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
Change in Error Fuzzy Sets -1 -2/3 -1/3 0 1/3 2/3 1
Summary 21 -1 -.5 0 .5 1 -2.1 -1.8 -1.5 -1.2 -.9 -.6 -.3 0 .3 .6 .9 1.2 Error (Change-in-Error=0.0) Controller Output -1 -.5 0 .5 1 -2.1 -1.8 -1.5 -1.2 -.9 -.6 -.3 0 .3 .6 .9 1.2
Change in Error (Error=0.0)
Controller Output
Figure 21. FLC outputs plotted on e-z and ∆e-z axes.
Summary
This chapter demonstrated that plotting the input-output relationship for an FLC is an effective tool for determining the effects of changing the parameters of the FLC. Contours can be used even if a mathematical expression of the FLC can not be determined. Basic analysis techniques were applied to the classical controller and the FLC. The PFLC has only input which yield a two dimensional graph. From the graph, basic controller parameters can be determined such as gain and operating ranges. The PDFLC is a bit more complicated two inputs have a three dimensional control surface.
Summary 22 Graphical analysis is accomplished by plotting the perspective view and cross sections of the various fixed points for error or change in error.