Field of the Invention
This invention relates to a method and apparatus for controlling the output of a process so that it follows a desired profile or trajectory, and particularly, the invention is a method and apparatus for controlling such a process with an adaptive fuzzy rule-based methodology that does not require an explicit model of the system.
Background of the Invention
In the related art, adaptive control is divided into two categories-direct adaptive control and indirect adaptive control. In direct adaptive control, the adaptation mechanism adjusts the controller parameters directly to reduce some error. For direct adaptive fuzzy controllers, the controller parameters that can be adjusted are the input membership functions, the output membership functions, and/or the rules i.e., fuzzy rules.
In indirect adaptive control, the adaptation mechanism adjusts the parameters of a process model to reduce some error, which in turn affects the control. For indirect adaptive fuzzy controllers, the process is modeled using a fuzzy model, and the parameters that are adjusted are the input membership functions, output membership functions, and/or fuzzy rules for the model.
Summary of the Invention
This invention describes an adaptation mechanism for a direct adaptive fuzzy controller that modifies the locations of the output membership functions to improve performance. This adaptation mechanism does not appear to be known in the art. The mechanism offers significant advantages for many applications.
One advantage of the adaptation mechanism is that it can be applied to almost any fuzzy controller without substantial revision. Unlike most adaptation mechanisms in the art, it is simple and has minimal processing requirements.
Another advantage is that the adaptation mechanism can be used for on-line training, off-line training, or a combination of the two. Many adaptation mechanisms in the art are only suitable for off-line use and can not be used to adjust controller performance once the controller has been implemented. These adaptation mechanisms train fuzzy controllers in much the same way neural networks are trained, using backpropagation techniques, orthogonal least squares, table look-up schemes, and nearest neighborhood clustering. (See Wang, L., Adaptive fuzzy systems and control, New Jersey: Prentice-Hall (1994).)
Another advantage of the adaptation mechanism is that it does not rely on an explicit system model, unlike many of the on-line adaptation mechanisms such as those based on Lyapunov methods. (See Wang, 1994; Kang, H. and Vachtsevanos, G., "Adaptive fuzzy logic control," IEEE International Conference on Fuzzy Systems, San Diego, Calif. (Mar. 1992).) (On model-reference adaptive control, see Layne, J., Passino, K. and Yurkovich, S., "Fuzzy learning control for antiskid braking systems," IEEE Transactions on Control Systems Technology 1 (2), pp. 122-129 (1993).) The present system not only reduces the information that the control designer must provide but it also reduces the complexity of the adaptive fuzzy controller.
The adaptive fuzzy controller (AFC) is a nonlinear, multiple-input multiple-output (MIMO) controller that couples a fuzzy control algorithm with an adaptation mechanism to continuously improve system performance. The adaptation mechanism modifies the location of the output membership functions in response to the performance of the system. The adaptation mechanism can be used off-line, on-line, or a combination of both. The AFC can be used as a feedback controller, which acts using measured process outputs and a reference trajectory, or as a feedback controller with feedforward compensation, which acts using not only measured process outputs and a reference trajectory but also measured disturbances and other system parameters.
The adaptation mechanism can be implemented with the present fuzzy controller, or independently with another fuzzy control algorithm. When the adaptation mechanism is implemented independently, there is one restriction on the form of the fuzzy controller. The fuzzy controller must have a fuzzy rule base with a different or unique output membership function for each fuzzy rule.
Brief Description of the Drawing
FIG. 1a is an overview of the system consisting of the adaptive fuzzy controller and process.
FIG. 1b is a block diagram of the adaptive fuzzy control logic consisting of the fuzzy control logic and the adaptation mechanism.
FIG. 1c reveals the apparatus of the fuzzy control logic.
FIG. 1d is a functional diagram of the adaptation mechanism.
FIG. 1e shows a hardware layout incorporating the adaptive fuzzy controller.
FIG. 2 is a diagram of a dual heat exchanger combi-boiler controlled by the adaptive fuzzy controller.
FIGS. 3a, 3b, 3c and 3d show typical input membership functions that are triangular, trapezoidal, Gaussian, and singleton, respectively.
FIG. 4 illustrates the output membership functions for a nine-rule controller.
FIG. 5 is a graph of input membership functions.
Description of the Preferred Embodiment
The adaptive fuzzy controller (AFC) 10 regulates the output 14 of a process 18. The overall system 10 consists of a process 18 to be controlled, adaptive fuzzy control logic 28, and input 56 and output 61 processing, which are illustrated in FIG. 1a.
In FIG. 1a, y' is a vector of measured process outputs 14, such as domestic water temperature from sensor 42 of a combi-boiler 50 (FIG. 2), or other commonly controlled physical parameters such as pressure, temperature, and flow of like systems, or speed of an automobile. y parameters are converted to electrical signals y' by sensors 59, which includes the temperature sensor 42, to signal y' to go as input 30 to input processing unit 56. y' provides feedback signals. d is a vector of measured disturbances, as noted at input 16 of process 18, such as flow rate at domestic hot water outlet 54 detected by flow rate sensor 41, air pressure from sensor 64, flue gas temperature from sensor 65, and central heating water temperature from sensor 66, which are part of sensors 55, pressure in ductwork for fan control of a heating, ventilation, and air conditioning ventilation (HVAC) system or an incline sensed via a level sensor in an automobile cruise control device. d is converted by sensors 55 into electrical signals d' which is an input 57 to a input processing section 56. d' can provide feedforward signals. s is a vector of set points or reference trajectories to input 24 of input processing 56. p is a vector of parameters, which could include set points or control positions for other parts of the system 50 and is to input 58 of processing block 56. p may be a catch-all for other parameters and may also indicate the type of processing desired by units 56 and 61. Processors 56 and 61 are design or application dependent.
In FIG. 2 combi-boiler 50 also has a primary heat exchanger 51, secondary heat exchanger 53, three-way valve 52, three way valve actuator 67, fan 68, fan actuator 69, combustion process area 70, injector 71, ignition actuator 72, gas valve 73, gas valve actuator 60, pump 74, pump actuator 75, inlet pipe 76, outlet pipe 77, central heating water outlet 78, central heating water inlet 79, T-junction 80, domestic cold water inlet 81, gas inlet 82, air inlet 83 and flue gas outlet 84. y', d', s, and p are all inputs 30, 57, 24 and 58, respectively, to the input processing block 56. x is a vector of controller inputs 20 calculated from s, y', d', p, and other parameters. For example, for combi-boiler 50, x could consist of the temperature error, which is the difference between set points and the measured temperature, the derivative of the temperature error, and the measured domestic hot water outlet 54 flow rate. This is a simple example of what the input processing block 56 may do. The input processing block 56 can also perform analog-to-digital conversion, filter d' or y' to minimize the effects of sensors 55 and 59, respectively, such as noise; estimate process states from y' using Kalman filtering or another estimation technique; take derivatives or integrals of y', d', s, or p; or combine the measured or calculated parameters in any way; or transform or manipulate the input signals as specified by an application. This description of the input processing block 56 is not meant to limit its function to what has been described here but to serve as a description of a specific embodiment.
The input x on line 20 and input x' on line 62 to the adaptive fuzzy controller are used to compute the control output u on line 22, which could be the gas valve 73 actuator 60 position signal for combi-boiler 50, a gas throttle position signal for cruise control, or a fan speed signal for an HVAC system. The logic 28 output u is fed into an output processing block 61 that calculates u', which is the vector of control signals sent to process 18 on line 63. x' is a subset of x. In some situations, output processing block 61 does nothing. In other cases, u could be filtered, integrated, limited, transformed from a digital to an analog signal, or otherwise processed. Once again, this description of output processing block 61 is not meant to limit its function to what has been described here but to serve as a description of a specific embodiment.
Adaptive fuzzy control logic 28 is fuzzy control logic 85 coupled to an adaptation mechanism 86. Adaptive fuzzy control logic 28, of figure 1b, has inputs 20 and 62 connected to outputs x and x' respectively, of processing unit 56 and has a set 22 of outputs u that goes to output processing unit 61. Adaptive fuzzy control logic 28 has an adaptation mechanism 86 has an input or set 62 of inputs x' indicating system information, a second set 87 of inputs .mu..sub.Rj indicating degrees of membership of fuzzy control logic rules (for each time the controller cycles, to what degree that each rule was used --1 means it was used completely and 0 means that it was not used at all, or a number "a," where 0<a<1, which means it was used partially, and further it indicates a relationship between the inputs and the outputs of the fuzzy control logic), a third set 88 of inputs Rj indicating current (present) locations of output member functions, and a set 89 of outputs R.sub.j ' indicating new locations of output membership functions.
FIG. 1d illustrates adaptation mechanism 86. Unit 100 takes set 62 of inputs x' and computes an error measure J. The result of unit 100 goes to decision unit 101 which asks the question of whether the absolute value of the error measure J is less than the adaptation threshold, i.e., .vertline.J.vertline.<.epsilon.? If the answer is yes, then there is no change to output membership functions as indicated by label 102. If the answer is no, then degrees of membership of the rules .mu..sub.Rj on input 87 and the current locations of the output membership functions R.sub.j on input 88 are obtained from fuzzy control logic 85. The input information to unit 103 is combined and sent to unit 104 which calculates the new locations R.sub.j ' of the output membership functions R.sub.j with the following equations ##EQU1## The information of functions Rj' the new locations of the output membership functions Rj' is passed on by unit 105 to fuzzy control logic 85 via line 89.
Adaptive fuzzy control logic 28 also has a fuzzy control logic 85 having a first set 20 of inputs x for receiving (indicating) system information, a second set of inputs connected to the set of 89 outputs Rj' from adaptation mechanism 86, a first set of outputs .mu..sub.Rj connected to the second set 87 of inputs of adaptation mechanism 86, a second set of outputs connected to the third set 88 of inputs of adaptation mechanism 86, and a third set 22 of outputs u indicating raw control command information.
Fuzzy control logic 85 of FIG. 1c, has a fuzzifier 90 having first set 20 of inputs for receiving x signals, and a second set 91 of inputs indicating shapes and locations of input membership functions from collection of input membership functions 92, and a set 93 of outputs providing fuzzified x signals indicating shapes and locations of the input membership functions (fuzzified means taking measured or crisp values of x and transforms them into fuzzy values, in view of the input membership functions, as the set of outputs).
Collection of input membership functions 92 has a set 91 of outputs connected to second set of inputs of fuzzifier 90. Also, there is a fuzzy rule base 94 which receives a first set 91 of signals from collection of input membership functions 92, a second set 95 of signals from a collection of output membership functions 96 and a set 97 of signals indicating and mapping membership functions; that is, fuzzy rule base 94 maps a combination of input membership functions to each output membership function.
A fuzzy inference engine 98 receives a first set of inputs from set 93 of outputs of fuzzifier 90, a second set of inputs from set 97 of outputs of fuzzy rule base 94, and puts out a set 87 of outputs .mu..sub.Rj indicating the degree to which each fuzzy rule is used (which is the function of fuzzy inference engine 98).
Collection of output membership functions 96 has a first set 95 of outputs indicating the shape and locations of the output membership functions, a second set 88 of outputs R.sub.j indicating the current locations of the output membership functions, and a set 89 of inputs R.sub.j ' indicating the new locations of the output membership functions.
A defuzzifier 99 has first and second sets of inputs, respectively, connected to set 87 of outputs .mu..sub.Rj from fuzzy inference engine 98 and to set 95 of outputs from collection of output membership functions 96, and a set 22 of outputs u indicating raw command information signals.
Output processing unit 61 has a set of inputs which receives set 22 of outputs u from defuzzifier 99 and has a set 63 of outputs u' indicating raw control command information which are transformed input signals u due to normalizing, scaling, filtering, integrating, taking derivatives, digital-to-analog conversion and/or other processing of raw command information into set 63 of actuating output signals u'.
Process 18 is the physical system being controlled which may be affected by parameters such as combi-boiler 50 temperatures, automobile speed, ventilation, chemical reaction, etc. Process 18 has a first set of inputs connected to set 63 of outputs u' from output processing unit 61, a second set of inputs d which are measured disturbances such as environmental effects, and a set 14 of outputs y indicating the parameter or parameters, such as temperature, speed, the state of the process, etc., being controlled.
From a methodology perspective, fuzzy controller 10 consists of a set of input 92 and output 96 membership functions, a rule base 94, a fuzzification method 90, a defuzzification method 99, and an inference method 98. Each input and output to the fuzzy controller 10 of FIG. 1 has a set of membership functions 92 and 96, respectively, associated with it. For this controller, the shape and number of membership functions 92 associated with each input can be selected freely. Typical membership functions are triangular 11, trapezoidal 12, Gaussian 13, or singleton 26 (as shown in FIGS. 3a, 3b, 3c, and 3d, respectively).
For convenience, membership functions usually have a set of linguistic labels associated with them. In general, one can refer to the labels associated with the membership functions for the i.sup.th input as L.sub.i.sup.k.sbsp.i, wherein L is an input label, i signifies which input and ranges from 1 to n, where n is the number of controller inputs (or, equivalently, the dimension of x). k.sub.i indicates which membership function and ranges from 1 to p.sub.i, which is the total number of membership functions for the i.sub.th input. FIG. 5 shows typical input membership functions--left shoulder 37, triangle 39 and right shoulder 38. For the case illustrated, p.sub.i is 3 and the linguistic labels are L.sub.i.sup.1,L.sub.i.sup.2, and L.sub.i.sup.3.
For adaptive fuzzy controller 10, the shape of the output membership functions 96 can be selected freely. However, to use adaptation mechanism 86, one must have a unique or different output membership function for each rule. For convenience, the output membership functions have the labels Rj, where j varies from 1 to r, and where r is the number of rules. Rj is used both as a label and as the location of the membership function. FIG. 4 illustrates a typical set of output membership functions 31, 32, 33, 34, 35, 36, 37, 38 and 39 for a nine-rule controller using fuzzy singletons 26. n is the number of controller inputs. r is calculated from ##EQU2## For example, for a controller having two inputs and three membership functions for each input, then p1 is 3 and P2 is 3, with P1.times.P2 equal to nine rules.
The fuzzy rules of base 94 are of the general form:
where Uj is the output for the j.sup.th rule. j varies from 1 to r. This defines a mapping between each different and unique combination of membership functions and a rule number for each output. This form of the rules is very general and most rules can be cast into this form, including non-fuzzy rules.
Fuzzifier 90, defuzzifier 99, and inference engine 98 can be selected freely. In almost every fuzzy control application, the singleton fuzzifier is used. Common defuzzifiers include the maximum defuzzifier, center of average defuzzifier, and modified center of average defuzzifier. Common inference methods include the min inference and product inference.
The adaptation mechanism updates the location of the output membership functions using the relationship ##EQU3## Rj is the location of the output membership function for the j.sup.th rule. Usually, one selects Rj to be the center of the j.sup.th output membership function, but it can be any point on the membership function, such as the point where the membership function takes on its maximum, the left edge, or the right edge. If the output membership functions are fuzzy singletons (FIG. 3d), which are commonly used, then Rj is the location of the j.sup.th fuzzy singleton. Rj is bounded so it remains within the universe of discourse. It is not necessary to specify Rj accurately in advance of implementation. Rj can be initialized to any value in the universe of discourse and the algorithm will adapt or learn their locations, accordingly, to minimize .vertline.J.vertline..
.gamma. is the adaptation rate. It governs how quickly the controller adapts; that is, how fast the Rj change location. .gamma. can be a constant or a variable.
J is an error measure that is being driven to zero. J is selected based on the specific control application. Frequently, J is the difference between the set point s and feedback variable y. If J is zero, the locations of the output membership functions do not change.
.epsilon. is an adaptation threshold. If the absolute value of J is inside the adaptation threshold, the locations of the output membership functions do not change. .epsilon. prevents the controller from adapting to sensor noise and small unmeasured disturbances. .epsilon. must be specified prior to implementation and can be constant or variable.
.mu..sub.Rj is the degree of membership of rule j. The degree of membership of each rule is a measure of how much that rule is being used to control the process. If a rule is not being used to control the process at all, its degree of membership will be zero, and the location of the output membership function for the corresponding rule will not be changed.
.DELTA.t is the adaptation sampling period, which is the time between the current time and the last time the output membership function locations were changed. Usually .DELTA.t is the same as the controller sampling period, but this is not a requirement.
Adaptation mechanism 86 can be used off-line, on-line, or a combination of the two. For example, the adaptation mechanism could be used off-line to learn the locations of output membership functions 96 that are implemented in a fuzzy controller 10 that is not adaptive. Off-line training is performed by repeatedly exercising the process and controller in simulation and/or a laboratory through their range of performance. This is frequently done by varying s, varying d', or varying both s and d'. The number of repetitions necessary depends on the number of rules in rule base 95. Experience shows that for a controller with less than thirty rules, it takes about three repetitions to learn the Rj.
Adaptation mechanism 86 can also be used on-line with no off-line training. In this case, controller 10 may have poor performance initially, unless the initial Rjs are selected accurately. Most commonly, the adaptation mechanism is used both off-line and on-line. Off-line training provides accurate estimates of Rj prior to implementation, providing better control at start-up.
There are numerous advantages to adaptation mechanism 86. One advantage of the adaptation mechanism is that it can be applied to almost any fuzzy controller.
Another advantage is that adaptation mechanism 86 can be used for on-line training, off-line training, or a combination of the two. Many adaptation mechanisms in the art are only suitable for off-line use and can not be used to adjust controller performance once the controller has been implemented. These adaptation mechanisms train fuzzy controllers in much the same way neural networks are trained, using backpropagation techniques, orthogonal least squares, table look-up schemes, and nearest neighborhood clustering (Wang, 1994).
Another advantage of adaptation mechanism 86 is that it does not rely on an explicit system model, unlike many of the on-line adaptation mechanisms such as those based on Lyapunov methods (Wang, 1994; Kang and Vachtsevanos, 1992) or model-reference adaptive control (Layne, Passino, and Yurkovich, 1993). This not only reduces the information that the control designer must provide but it also reduces the complexity of the adaptive fuzzy controller (AFC) 10.
Due to the simplicity of adaptation mechanism 86, the AFC is computationally simple and therefore suitable for real-time implementation with inexpensive processors. The code size and memory estimates needed for the adaptive fuzzy control algorithm are given in table 1, for an adaptive fuzzy controller logic 28 having n inputs, m outputs and p membership functions. The adaptive fuzzy controller code budget is estimated for a floating point C implementation. The code segment of table 1was estimated using a THINKC 6.0 compiler on a MACINTOSH. These requirements may vary for other languages and compilers.
The adaptive fuzzy control algorithm can be applied to a wide range of processes for either feedback control or feedback control with feedforward compensation. Table 6 shows examples of applications for adaptive fuzzy controller 10, which include duct pressure static control and duct air temperature control for an air handling unit in an HVAC system, residential temperature control, automobile cruise control, furnace temperature control, and combi-boiler domestic hot water control temperature.
FIG. 1e reveals the hardware applicable to controller 10 Sensors 55 and 59 provide analog sensor signals such as central heating water temperature sensor 66 signal 43, domestic hot water temperature sensor 42 signal 44, domestic hot water flow rate sensor 41 signal 45, and exhaust gas temperature sensor 65 signal 46 to analog-to-digital converter 115 which is part of input processing unit 56. Air pressure sensor 64 output is a digital signal 47 that goes to digital input processor 116 which is also a part of input processing unit 56. Converter 115 signals 48 and digital input processor 116 signal 49 go to a microprocessor 114. Setpoint d' signals 24 are input to microprocessor 114 which also performs some of the input processing unit 56 functions. Microprocessor 114 provides adaptive fuzzy control logic 28 processing and contains databases for such processing. Microprocessor 114 may also perform some functions of output processing unit 61. Output signals 107 and 108 go to digital-to-analog converter 117 and digital outputs processor 118 which are also a part of output processing unit 61. Converter 117 outputs a gas valve 73 control signal 109 to gas valve actuator 60 which is a part of actuators 106. Digital output processor 118 sends fan 68 enable signal 110, ignition enable signal 111, pump 74 enable signal 112 and 3-way valve 52 enable signal 113, to fan actuator 69, ignition actuator 72, pump actuator 75 and 3-way valve actuator 67, in that order, which are a part of actuators 106. Actuators 106 are incorporated in process 18.
The adaptive fuzzy control algorithm (AFC) has been applied to domestic hot water outlet 54 temperature control for combi-boiler 50. A combi-boiler is a boiler that provides both central heating water at outlet 78 for hydronic heating and hot water for domestic use. FIG. 2 shows an example of a dual-heat-exchanger combi-boiler 50, which is one type of combi-boiler construction. The central heating water is heated by the primary heat exchanger 51, which is an air-water heat exchanger. When boiler 50 senses a demand for domestic hot water, a three-way valve 52 diverts the central heating water through a secondary heat exchanger 53. Secondary heat exchanger 53 is a water-water heat exchanger that heats the domestic hot water.
The domestic hot water temperature control problem is a single- or multiple-input single-output control problem. For domestic hot water temperature control, either one or two sensors is used (table 6). The measured parameters are domestic hot water temperature and, optionally, domestic hot water flow rate. If one sensor is used, it is a domestic hot water temperature sensor 42 that is used for feedback control. In feedback control, one measures or estimates a process parameter and compares it to a set point. The difference between the process parameter and the set point is an error that is fed to controller 10 to determine the control action. For combi-boiler 50, one measures domestic hot water temperature and compares it to the domestic hot water temperature set point.
If two sensors are used, a domestic hot water flow sensor 41 is used in addition to temperature sensor 42 to provide feedforward control d' to input 57 in addition to feedback control y' to input 30. In feedforward control, one measures a disturbance that one knows will affect the process output and takes preemptive action to minimize or eliminate the undesirable process change. Usually feedforward control is used in conjunction with feedback control. For combi-boiler 50, the feedforward and feedback controls are incorporated into the same fuzzy rule base 94. Table 2 summarizes various AFC configurations that have been implemented on combi-boiler 50. In table 2, and the following discussion, temperature and temperature error are shorthand for the domestic hot water temperature and domestic hot water temperature error, while flow is shorthand for the domestic hot water flow rate.
Of input membership functions 92, there are three membership functions for each input (FIG. 5). The left membership function is a left shoulder 37, the right membership function is a right shoulder 38, and the center membership function is a triangle 39. For convenience, input membership functions 92 for each input are given linguistic labels, which are summarized in table 3.
Input membership functions 92 for each input are completely defined if the minimum and maximum values for the universe of discourse are specified, along with the bias 40 (which is illustrated in FIG. 5). FIG. 5 shows the input membership functions. A and B define the range of the universe of discourse. C is at the center of the universe of discourse. D is equidistant from A and C, while E is equidistant from C and B. With 3 membership functions per input, there are 3 rules for a one-input controller, 9 rules for a two-input controller, and 27 rules for a three-input controller (from equation (2)). For the embodiment described here, the universe of discourse and biases for the input membership functions are constants, although this is not a requirement.
Output membership functions 96 are fuzzy singletons 26, with one output membership function for each rule in the fuzzy controller. The universe of discourse for the output ranges from 0 to 100. FIG. 4 shows the output membership functions for a nine-rule controller.
A fuzzy rule base 94 is noted here. Once the input membership functions 92 have been defined, a mapping between each rule and every unique combination of input membership functions 92 is made. A mapping for controller configuration no. 2 of table 2, which has temperature error and domestic hot water flow rate as inputs, is given in table 5. Table 5 summarizes the rule mapping for adaptive fuzzy controller 10 with temperature error and domestic hot water flow rate as inputs. This mapping is shorthand for fuzzy rule base 94. For instance, rule 4 is
U.sub.4 is the output to rule 4 and R.sub.4 is both the linguistic label and location of the fuzzy singleton output membership function corresponding to rule 4.
Rule 1: IF Temperature Error is NEGATIVE AND IF Flow is LOW, THEN U1 is R1
Rule 2: IF Temperature Error is ZERO AND IF Flow is LOW, THEN U2 is R2
Rule 3: IF Temperature Error is POSITIVE AND IF Flow is LOW, THEN U3 is R3
Rule 5: IF Temperature Error is ZERO AND IF Flow is MEDIUM, THEN U5 is R5
Rule 6: IF Temperature Error is POSITIVE AND IF Flow is MEDIUM, THEN U6 is R6
Rule 7: IF Temperature Error is NEGATIVE AND IF Flow is HIGH, THEN U7 is R7
Rule 8: IF Temperature Error is ZERO AND IF Flow is HIGH, THEN U8 is R8
Rule 9: IF Temperature Error is POSITIVE AND IF Flow is High, Then U9 is R9
Mappings for the other controller configurations are constructed similarly.
The control can be computed once the fuzzification 90 method, fuzzy inference engine 98 and defuzzification 99 method have been selected. For combi-boiler 50, fuzzifier 90 is the singleton 26 fuzzifier. Fuzzy inference engine 98 uses the min operator to compute the degree of membership of each rule .mu..sub.R.sbsb.1 from the degrees of membership for the corresponding input membership functions 92. For rule 4, for example
where .mu.NEGATIVE (Temperature Error) is the degree of membership of the Temperature Error in the NEGATIVE membership function and .mu.MEDIUM (Flow) is the degree of membership of the Flow in the MEDIUM membership function and the min function takes the minimum of the two. The calculation of degrees of membership for the other rules are noted:
.mu..sub.R.sbsb.1 =min(.mu.NEGATIVE(Temperature Error), .mu.MEDIUM(Flow))
.mu..sub.R.sbsb.2 =min(.mu.ZERO(Temperature Error), .mu.LOW(Flow))
.mu..sub.R.sbsb.3 =min(.mu.POSITIVE(Temperature Error), .mu.LOW(Flow))
.mu..sub.R.sbsb.5 =min(.mu.ZERO(Temperature Error), .mu.MEDIUM(Flow))
.mu..sub.R.sbsb.6 =min(.mu.POSITIVE(Temperature Error), .mu.MEDIUM(Flow))
.mu..sub.R.sbsb.7 =min(.mu.NEGATIVE(Temperature Error), .mu.HIGH(Flow))
.mu..sub.R.sbsb.8 =min(.mu.ZERO(Temperature Error), .mu.HIGH(Flow))
.mu..sub.R.sbsb.9 =min(.mu.POSITIVE(Temperature Error), .mu.HIGH(Flow))
Once the .mu..sub.Rj have been computed, the control u is computed using the center average defuzzifier, ##EQU4##
Adaptation mechanism 86 continuously updates the location of output membership functions 96 using the relationship ##EQU5## where .epsilon. is the bias specified for the temperature membership functions. When temperature rate is not used as an input, the cost function J that is driven to zero is the tracking error:
When temperature rate is used as an input, J is a weighted tracking error that takes into account the temperature rate
W is a constant configuration parameter that weights the effect of the temperature rate. Output membership functions 96 are constrained between 0 and 100, inclusively.
The following is a listing of the C code for the adaptive fuzzy control algorithm, which includes implementations of configurations 2 and 3 from table 2. The code consists of three files-two header files and one file with the functions for the controller.