Modeling device for determining membership functions for fuzzy logic processing

Abstract: A fuzzy membership function modeling device in which membership functions, represented as geometric shapes or forms, and inference rules, represented in an If....Then format, are stored for access by a processor for making fuzzy inference of a control value for a controlled object. Also stored are parameters (h, r) that are required to shift the membership functions or changing their shapes and target inference values. In operation, corresponding membership functions and inference rules are fetched and an inference result is generated. A comparison is made between the stored target value and the inference result value and a difference determined. If the difference is outside a predetermined or selected range (δ), on the basis of stored parameters, the membership function is shifted or the shape thereof is changed by an incremental amount (h, r) and the inference process is executed again.

Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the modelling of membership functions for obtaining an optimum inference value through automatic adjustment of the membership functions in a system for controlling a controlled object using a fuzzy inference method. In the modelling process, the characteristics of the controlled object are represented by one or more inference rules and membership functions. 2. Description of the Background Art Fuzzy logic or fuzzy inference theory has been applied as an alternative to traditional expert systems that employ precise or "crisp" Boolean logic-based rules to the solution of problems involving judgment or control. Where the problems are complex and cannot be readily solved in accordance with the rigid principles of bilevel logic, the flexibility of fuzzy logic offers significant advantages in processing time and accuracy. The theory of fuzzy logic has been published widely and is conveniently summarized in "Fuzzy Logic Simplifies Complex Control Problems" by Tom Williams, Computer Design magazine, pp 90-102 (March 1991). In brief, however, the application of the theory requires the establishment of a set of rules conventionally referred to as "control rules", "inference rules" or "production rules" that represent the experience and knowhow of an expert in the particular field in which a problem to be solved exists. The inference rules are represented in the form of IF....(a conditional part or antecedent part)...THEN....(a conclusion part or consequent part). This is conventionally referred to as an "If...Then" format. A large number of rules typically are assembled in an application rule base to adequately represent the variations that may be encountered by the application. In addition, "membership functions" are defined for the "conditional parts" and the "conclusion parts". Specifically, variables in each of the parts are defined as fuzzy values or "labels" comprising relative word descriptions (typically adjectives), rather than precise numerical values. The set of values may comprise several different "levels" within a range that extends, for example, from "high" to "medium" to "low" in the case of a height variable. Each level will rely on a precise mapping of numerical input values to degrees of membership and will contain varying degrees of membership. For example, a collection of different levels of height from "high" to "low" may be assigned numerical values between 0 and 1. The collection of different levels is called a "fuzzy set" and the function of corresponding different height levels to numerical values is reflected by the "membership function. Conveniently, the set may be represented by a geometric form, such as a triangle, bell, trapezoid and the like. Then, in the fuzzy inference control procedure, the inference control is carried out in several steps. First, a determination is made of the conformity with each of the input "labels" in the "conditional part" according to the inference rules. Second, a determination is made of conformity with the entire "conditional part" according to the inference rules. Third, the membership functions of the control variables in the "conclusion part" are corrected on the basis of the conformity with the entire "condition part" according to the inference rules. Finally, a control variable is determined on an overall basis, i.e., made crisp, from the membership functions of the control variables obtained according to the inference rules. The method of determining the control variable, i.e., obtaining a crisp value, is based on any of several processes, including the center of gravity process, the area process and the maximum height process. The fuzzy inference rules and membership functions represent the knowledge of experts who are familiar with the characteristics of a complicated controlled object including non-linear elements, e.g . the temperature control of a plastic molding machine and the compounding control of chemicals, which are difficult to describe using mathematical models in a control theory. The fuzzy logic system employs a computer to perform the inference rule and membership function processing and thereby achieve expert-level inference. Fig. 7 shows the configuration diagram of a conventional fuzzy logic device, wherein numeral 1 indicates data input means for fetching information from a system to be controlled; 2 indicates fuzzy inference operation means for making fuzzy inferences based on the input data to the data input means; 3 indicates a data output means for outputting the inference result of the fuzzy inference operation means 2; 4 indicates an inference rule storage means for storing inference rules employed in the fuzzy inference operation means 2; and 5 is a membership function storage means for storing the shape data of the membership functions. In the conventional fuzzy inference device constructed as described above, the relationships between input data x1, x2, ... xn from the data input means 1 and output data y output from the data output means 3 are described by inference rules in the "If.. Then" format. For example, when the input variables are x1 and x2, a plurality of inference rules, such as the following, are stored beforehand in the inference rule storage means 4: R1: if (x1 is A11) and (x2 is A12) then (y is B1) R2: if (x1 is A21) and (x2 is A22) then (y is B2). A11 to A22, B1 and B2 are labels representing the membership functions of the inputs and outputs employed to describe the inference rules. Assuming that real values x1 0 and x2 0 are entered into the data input means 1, inference is made in the fuzzy inference operation means 2 as shown in Fig. 8. First, the fuzzy inference operation means 2 reads inference rules needed for the inference from the inference rule storage means 4 and relevant membership functions from the membership function storage means 5. Fuzzy inference operation means 2 then calculates the conformities W1, W2 of the condition part with each inference rule as shown in Fig. 8. This calculation may be indicated by the following mathematical expressions (1) and (2): W1 = A11(x1 0 ) ∧ A12(x2 0 ) W2 = A21(x1 0 ) ∧ A22(x2 0 ) where ∧ indicates a minimum (AND) operation, i.e., selection of the smallest value. The fuzzy inference operation means 2 then finds the output values B1'and B2' of each inference rule according to the following mathematical expressions (3), (4): B1' = W1 ∧ B1 B2' = W2 ∧ B2 and obtains an inference result B0 according to the following expression: B0 = B1' ∨ B2' where ∨ indicates a maximum (OR) operation, i.e., selection of the largest value. In practice, this inference result B0 has an inference result value comprising a weighted average (center of gravity) y0, this value is calculated by means of the weight B(y) of an element y in a trapezoid set. If the inference result value y0, found according to the above process, is undesirable to stabilize the object system, the membership functions such as A11 to A22 or B1, B2 may be slightly shifted. Then, calculations will be made according to the mathematical expressions (1) to (4), whereby an inference result value y0' slightly different from y0 can be found. For example, the membership function A21 in Fig. 8 can be defined as: A21 = (a, 0/b, 1/c, 0) employing the X coordinates a, c and y coordinate O of the base and the X coordinate b and Y coordinate 1 of the vertex. To shift this membership function by an amount k, set: A21' = (a-k, 0/b-k, 1/c-k, 0). This new function is not shown in Fig. 8 but would be understood by one of ordinary skill in the art. Conventionally, a correction of the membership functions provides the inference result value which ensures stable control of the system. However, in the known modeling method, it takes time during a modelling operation to consider how to change which membership functions and to make a compilation for converting the redescribed inference rules and membership functions into a knowledge base that the fuzzy inference operation means can understand. Such modelling operation is illustrated in Fig. 9. There, in steps 2-1 and 2-2, the user describes inference rules for fuzzy control using a membership function editor and an inference rule editor. The membership functions and inference rules described by the membership function description means and inference rule description means are transmitted to the fuzzy inference operation means employing an inference rule compiler, in step 2-3. Considerable time is thus consumed for reinferring, e.g. time to make a conversion into the knowledge base in step 2-4, time for the fuzzy inference operation means to read the knowledge base according to step 2-5, and time to store the knowledge base into the internal memory. Further, if the inference result found is rather good but subtly different from an expected inference value, it is very difficult to judge how to adjust which membership functions and the judgement must therefore depend on trial and error. Document EP-A-0 373 628 describes a fuzzy inference apparatus comprising means for correcting the inference operation for each inference rule by using absolute and relative weight coefficients, a fuzzy control system comprising a support apparatus including a knowledge base for storing fuzzy processing rules and membership functions, which can be edited on a display screen, and a simulation section, by which the desired inference result is achieved by altering the rules and membership functions and simulating the result to be obtained. In this document means are also provided for altering the membership functions based on the inference result obtained compared with a desired or target value. SUMMARY OF THE INVENTION It is, accordingly, an object of the present invention to overcome the disadvantages in the conventional system by providing a device and method for automatically modelling appropriate membership functions for the purpose of control without needing to consider how to correct the proper membership functions in order to provide an expected inference result. It is a further object of the present invention to provide a device and method for membership function modelling which permits automatic alteration of the membership function. It is another object of the present invention to permit automatic incremental alteration of the membership function, either by shifting the function or changing its shape. It is yet another object of the present invention to provide a device and method for membership function modelling which permits automatic alteration of the membership function, subject to limits on the amount and extent of the alteration, as count, maximum and minimum values. The invention relates to a fuzzy membership function modelling device and method as set out in claims 1 and 3 respectively. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram showing an embodiment of a membership function modelling device according to the present invention. Fig. 2 is a flowchart showing an embodiment of a membership function modeling method according to the present invention. Fig. 3 shows a CRT screen illustrating shift parameter setting according to the membership function modelling method of the present invention. Fig. 4 illustrates a shift status of a membership function. Figs. 5A - 5F illustrate how an inference result value changes by shifting the membership functions. Fig. 6 illustrates how the inclination and position of a membership function is changed. Fig. 7 is a block diagram showing the configuration of a conventional membership function inference device. Fig. 8 illustrates how the inference result is operated on from the membership functions. Fig. 9 illustrates the manner in which a knowledge base is constructed in the conventional art in order to permit appropriate shifts in the membership functions. DESCRIPTION OF THE PREFERRED EMBODIMENTS Fig. 1 shows the configuration diagram of a fuzzy membership function modelling device as an embodiment of the present invention. A membership function storage means 1-1 is used for storing membership functions corresponding to the "condition parts" of the applicable inference rules. An inference rule storage means 1-2 is used for storing fuzzy inference rules in an If...Then format. An inference rule management means 1-3 is operative to fetch corresponding membership functions and inference rules from the membership function storage means 1-1 and inference rule storage means 1-2. A fuzzy inference operation means 1-4 is for finding the conformities of modelling input data with the "condition part" of the inference rule using the membership function. A parameter storage means 1-5 is for storing various parameters for shifting the membership function or changing the shape (inclination) thereof. A membership function control means 1-6 is used for receiving the parameters from the parameter storage means 1-5 and shifting the membership functions in the membership function storage means 1-1 or changing the shapes thereof either leftward or rightward. A target value storage means 1-7 is for storing a target inference result value and its permissible range δ. A target value/result value comparison means 1-8 is used for comparing the target value and inference result value. Finally, an inference monitoring means 1-9 is used to display on a CRT, or the like, the target value and inference result value and a difference therebetween as a trend. The target inference result value and permissible range δ may be those set on the basis of an expert's experience or those set tentatively by an operator. When the operator has set them tentatively, he only needs to attempt an initial control function. Thereafter, he can change the target inference result value or permissible range δ on the basis of the initial control result. The operation of shifting membership functions and operating on an inference result will now be described. As in the background example, it is assumed that there are two inputs, one output and a plurality of rules applicable to a processing. In this case, it is assumed that the inference rule storage means 1-2 stores the following n inference rules when there are two input variables x1 and x2: R1: if (x1 is A11) and (x2 is A12) then (y is B1) R2: if (x1 is A21) and (x2 is A22) then (y is B2) . . Rn: if (x1 is An1) and (x2 is A2n) then (y is Bn). The shapes of the membership functions A11 to A2n and B1 to Bn are kept in the membership function storage means 1-1. In addition, required data is set for various parameters used during the membership function shifting operation. In the preferred embodiment, the setting is by an operator using a display, as seen in Fig. 3. The parameters to be set are shift increments h , and a membership function name for a single-membership function shift. Where plural membership functions are to be shifted, the set parameters include the sequence of inference rules and membership functions looped (shifted in order of R1: A11, R4: A12, R2: B2 in this example), the language variable name ("PRESSURE", in this example) whose membership functions are to be shifted, the label name of the membership functions ("BIG", in this example) and the shift directions of the membership functions, L (leftward) or R (rightward) for a multiple-membership function loop shift. These parameters are stored in the parameter storage means 1-5. Through the above setting, inference is made according to a flowchart shown in Fig. 2. Whose operation may be described as follows: In step S1, a target inference result value and its permissible range are entered into the target value storage means 1-7 as output y . In step S2, parameters used in relation to a possible shift are set. These parameters are set for use in the event that the inference result value does not satisfy the permissible range of the target inference result value. Specifically, the increments "h" for shifting the membership function, and the inference rule numbers to be shifted, i.e. the membership function name for a single membership function and the inference rules and membership functions to be shifted and a shifting sequence for multiple membership functions, are set by the operator. Also set is a language variable name to be shifted; however, the membership functions of any unspecified language variable name are not shifted. Further set is a membership function name belonging to the specified language variable name and described as an inference rule. Finally, the direction of shifting the membership function, leftward or rightward is set. In step S3, fuzzy inference, as described in the background art, is executed. In step S4, the target value/result value comparison means 1-8 determines whether or not the absolute value of a difference between the target value set in the step S1 and the inference result value found in the step S3 falls within the permissible range stored in the target value storage means 1-7. In step S5, if the difference between the target value and inference result value is still outside the permissible range in the step S4, the membership function control means 1-6 causes the membership function to be shifted (parallel movement) in the set direction by the increments h as shown in Fig. 4. The result is stored into the membership function storage means 1-1. In step S6, as shown in Fig. 4, it is determined whether or not the X coordinate of a vertex of the membership function has matched the shiftable maximum value β or minimum value α of that membership function (such maximum and minimum values are set simultaneously with the definition of the membership function) as a result of the shift in the step S5. The maximum and minimum values may be replaced by the number of shifts which can be obtained from the shiftable maximum value β or minimum value α and increments h . In step S7, if it has been determined that the X coordinate of the vertex has already reached either of the maximum or minimum value as a result of the judgement in the step S6, it is determined whether the membership function name currently to be shifted is the last-set membership function An2 or not. If it is already An2, the shift operation is stopped and step S9 urges the investigation of another inference rule. If another inference rule is to be investigated, the processing returns to the step S1. If no further investigation is to be made, ordinary fuzzy inference is to be executed (step S10). In step S8, if the last membership function An2 set in the step S2 is not the membership function name currently to be shifted, the next membership function name is selected for the shift and the processing returns to the step S3. Namely, in the step S3 in this stage, fuzzy inference is executed again using the first membership function name having been shifted leftward or rightward by the increments h or the next-defined membership function. An example can be considered where the plurality of rules is limited to two and only two membership functions are to be shifted, i.e., All of input language variable X1 and B2 of output language variable Y . The shift sequence in this case is assumed to be A11 first and then B2. The shift direction is rightward for A11 and is leftward for B2. The direction of movement is illustrated in Fig. 5A and the sequence, as it affects the state in Fig. 5A as described below, is illustrated in Figs. 5B - 5F. On the basis of this example, the flowchart of Fig. 2 is followed and the steps S1 and S2 are completed by setting the appropriate input values, ranges and parameters. Thereafter, an initial fuzzy inference operation is conducted in accordance with step S3. For purposes of this example, it is assumed that the result of the initial operation is as seen in Fig. 8 and the difference between the target inference result value set in step S1 and the inference result value found in step S3 is greater that the permissible range. On the basis of this determination, the remaining steps of Fig. 2 are followed and the results are illustrated in Figs. 5B - 5F: 1) A11 is first shifted rightward by an increment h , as specified in step S2, with B2 fixed, as seen in Fig. 5 B. 2) Fuzzy inference is made, as in step S3. 3) An inference result value found is compared with a target value. If a difference therebetween does not fall within the permissible error range δ , A11 is further shifted rightward by h , as specified in steps S4 and S5, and as illustrated in Fig. 5C. 4) This operation is performed until the vertex of the triangle of A11 reaches the maximum definition area β , as specified in step S6 and illustrated in Fig. 5C. If A11 has reached β but the difference between the inference result value and target value is still outside the permissible error range δ , B2 is shifted leftward by h and the operations in (1) to (4) are repeated, as illustrated in Figs. 5D and 5E. 5) If the difference between the inference result value and target value is still outside δ after the series of loop shift operations, the membership function of another rule may be loop-shifted. Fig. 5F shows the status of inference result values y0 and y0' operated on with the first membership function and the first membership function shifted by the increments h , respectively. The output membership functions for the first rule membership functions A12 and A12' is seen as a shift in value from B1' to B1'', and the output membership functions for the second rule membership function remains at B2'. The effect of the shift in the first membership function on the result is seen in the difference of position between y0 and y0'. The above operation causes fuzzy inference to be executed for all the language variable names and membership functions stored in the membership function storage means 1-1. When the difference between the target value and inference value falls within the permissible range δ as a result of the judgement in the step S4, the membership functions are not shifted any more and ordinary fuzzy inference is executed in the step S10. In the step S10, the expected inference result value of a certain output language variable set in the step S1 has been satisfied within the permissible range δ . In describing the second embodiment of the device of the invention, it should be appreciated that the membership functions which are altered by shifting, as described in the first embodiment, may be changed in shape (inclination) to produce an identical effect. In order to change the shapes of membership functions, the shifting increments, the membership functions to be shifted, the sequence of altering the membership functions, and the shifting direction set in the step S2 in the flowchart in Fig. 2 are replaced by an inclination value to be changed, membership functions to be changed in shape, a sequence of membership functions to be changed in shape, and inclination changing directions. These different parameters change the shifts made in the steps S5 and S8 into shape changes. It will also be appreciated that while the shift operation is stopped when the X coordinate of the vertex of a membership function has reached the maximum or minimum value of the shift in the first embodiment, the membership function shape changing operation may be stopped when the coordinates of both ends of the base of a membership function have reached a preset maximum or minimum value. Fig. 6 shows an example wherein the X coordinate is changed in increments of r . It will be apparent that the fuzzy membership function operating device of the invention, as described above, limits the known complicated, time-consuming modeling of membership functions to inference rules and membership functions specified by the user and shifts the membership functions or change the shapes thereof to automatically change an inference value, whereby complications in the conventional designs have been eliminated and the user is allowed to model the membership functions by merely monitoring the changes in inference value on the CRT. Although this invention has been described in at least one preferred form with a certain degree of particularity, it is to be understood that the present disclosure of the preferred embodiment has been made only by way of example and that numerous changes in the details and arrangement of components may be made without departing from the scope of the appended claims.

Claims: A fuzzy membership function modelling device for determining a control value for a controlled object, comprising: membership function storage means (1-1) for storing membership functions; inference rule storage means (1-2) for storing fuzzy inference rules; parameter storage means (1-5) for storing parameters required to alter the membership functions; target value storage means (1-7) for storing a target result value and its permissible error range (δ); inference rule management means (1-3) for fetching corresponding membership functions and inference rules from the membership function storage means (1-1) and the inference rule storage means (1-2); fuzzy inference operation means (1-4) for making fuzzy inference of the control value and operating on an inference result using the inference rules and membership functions; target value/result value comparison means (1-8) for comparing the target value and inference result value; and membership function control means (1-6) for receiving parameters from the parameter storage means (1-5) and altering the membership function according to the set parameters if the inference result does not satisfy the permissible error range (δ) of the target value, characterized by display means (1-9) adapted to display at least one of the set target value, the inference result value and a difference between the target value and the inference result value as a function of time representing a trend, said displayed trand being further used for setting said parameters required to alter said membership functions until said difference falls under said error range (δ) wherein the parameters are set by increments (h, r) of alteration, and said parameters comprise parameters (h) to shift the membership function incrementally, and parameters (r) to change the shape of the membership function, wherein the membership function is represented as a curve along an axis (x) and is shifted in increments (h) along said axis (x). The device as set forth in Claim 1, wherein the inference rules are in the IF...THEN... format. A fuzzy membership function modelling method for making fuzzy inference of the control value of a controlled object and operating on an inference result using selected inference rules and membership functions, comprising the steps of: a) setting the permissible error range (δ) of a predetermined target result value and parameters (h, r) for altering the membership functions; b) making fuzzy inference of a control value using the inference rules and membership functions and determining whether the inference result value falls within the permissible error range (δ) of the target result value; c) altering the membership functions according to the set parameters (h, r) if the inference result value does not satisfy the permissible error range (δ) of the target value; d) making fuzzy inference of the control value and operating on the inference result using the altered membership function and the inference rules, characterized by displaying at least one of the set target value, the inference result value obtained by inferring the control value of the controlled object using the inference rules and membership functions, and a difference between the target value and the inference result value as a function of time representing a trend said method further comprising the steps of : e) determining whether the inference result satisfies the set permissible error range (δ) of the target inference result; and f) repeating the steps c), d) and e) if the inference result does not satisfy the set permissible error range (δ) of the target inference result in the step d) wherein the parameters (h, r) comprise parameters (h) to shift the membership function incrementally, and parameters (r) to change the shape of the membership function, wherein the membership function is represented as a curve along an axis (x) and is shifted in increments (h) along the axis (x). The method of Claim 3, further comprising: in step (a), setting an alteration limit (α, β) for at least one membership function; in step b) making fuzzy inference of a control value using selected ones of the inference rules and membership functions and determining whether the inference result value satisfies the set permissible error range (δ); in step c) altering at least one the selected membership functions according to the set parameters (h, r) (i) if the inference result value does not satisfy the permissible error range (δ) of the target result value, or (ii) if the altering has reached the set permissible alteration limit (α, β) for the membership function, stopping the altering of the membership functions. The method as set forth in Claim 4 further comprising the following steps: determining whether the alteration has reached the set alteration limit (α, β); and repeating the steps c) and d) if the target result value does not satisfy the set permissible error range (δ) as determined in step b) and the alteration limit (α, β). The method as set forth in Claim 4 or 5, wherein the parameters (h, r) comprise parameters (h) to shift the membership function incrementally and the alteration limit (α, β) comprises at least one of maximum and minimum values (α, β). The method as set forth in Claim 4 or 5, wherein the parameters (h, r) comprise parameters (h) to shift the membership function incrementally and the alteration limit comprises a permissible number of alterations. The method as set forth in Claim 4 or 5, wherein the parameters (h, r) comprise parameters (r) to change the shape of the membership function and the alteration limit comprises at least one of maximum and minimum values. The method as set forth in Claim 4 or 5, wherein the parameters (h, r) comprise parameters (r) to change the shape of the membership function and the alteration limit comprises a permissible number of alterations. The method as set forth in any of Claims 4 to 9, wherein the membership function is represented as a curve along an axis (x) and is shifted in increments (h) along the axis (x). The method as set forth in any of Claims 4 to 10, wherein the parameters (h, r) comprise the sequence of the membership functions to be altered. The method as set forth in Claim 3, further comprising: in step a), setting parameters (h, r) required to shift the membership functions or to change the shape thereof, setting the maximum value (α) or minimum value (β) of altering the shift or shape, setting a permissible shift/shape change value, which may be the permissible number of shifts or the permissible number of shape changes of the membership function and setting the sequence of the membership functions to be shifted or shape changed; in step c), altering by shifting the membership function or changing the shape thereof according to the set parameters (h, r), if the target result value does not satisfy the permissible error range (δ), and stopping the shifting or changing of shape, if the shift or shape change value has reached the said permissible shift/shape change values, and reading the next membership function of the defined sequence and executing the steps from step b) onward.

Inventors: KINOSHITA NAOKI, KINOSHITA, NAOKI, Kinoshita, Naoki, c/o Mitsubishi Denki K.K.
Applicants: MITSUBISHI ELECTRIC CORP, MITSUBISHI DENKI KABUSHIKI KAISHA
Application year: 1992
Main classification: G06F7
IPC codes: G06F9, G06N7, G06F17, G05B13, G06N5