INTRODUCTION Servo motors are widely used in the field of motion control in factory automation. The control target can be position, speed, or force, among others. For this example application we take force as the control variable. In order to implement force control, we need to know the compliance (response) of the controlled object to force. The feedback gain in the control loop changes as a function of compliance. Grasping a range of objects from, for example, a soft tennis ball to a hard steel ball using conventional servo control is extremely difficult. The traditional control model does not handle a variety of objects with differing material characteristics very well. The system can become unstable. Fuzzy logic, with its inherent flexibility, can be employed effectively as an alternative in this situation. FUZZY FORCE CONTROLLER Control Objective Grasp objects of various compliance, ranging, for example, from a soft tennis ball to a hard steel ball with a constant force. Control System The control block diagram is shown in Figure 1. Output force applied to the object is measured by a sensor and compared against a reference force to obtain the difference. A control gain Kg is applied to diminish this force difference. This gain also varies as a function of the compliance of the grasped object. Thus, control gain Kg is affected by two factors: (1) the compliance of the object and (2) the difference between a reference force and the measured force. Branches coming off the error (e) node and speed (v) node of the above diagram are expansions of those nodes, and represent variables to be used to determine the control gain. They do not represent additional control paths. We can write the control gain and diagram its components as shown in Figure 2 below. Ks (compliance component) is a function of Ke. Kf (force component) is a function of error e and its time derivative ‚. Both can be inferred by fuzzy logic. The compliance Ke is determined by injecting a speed command v into the servo motor and measuring the output force f. Compliance is expressed as follows: Ke = df/dx = (df/dt)/(dx/dt) = âf/v We obtain Ke = (fk-f(k-1))/v(k-1) Compliance can be thought of as the change in force (df) required for a given deformation (dx) of an object. For example, a tennis ball has a large compliance because the force needed to initiate deformation is small, but increases significantly as the deformation process proceeds. The change in force from initiation to termination is large. At the other extreme is the steel ball, which has small compliance. Although the force required to initiate deformation is large, the force to continue deformation does not change significantly. Consequently, the change from initiating to terminating force is small. It is known that the control gain Kg is the reciprocal of the compliance Ke, so Ks can be inferred from Ke by the following fuzzy rules: If Ke is small then Ks is large If Ke is large then Ks is small These two rules make up the fuzzy inference unit A which connects Ke with Ks. Definition of Input/Out Variables for Unit B Now let us consider fuzzy inference unit B, inferring Kf from e and ‚. The two inputs into Unit B are error e and its time derivative ‚. e is the difference between a reference force and the applied output force. Labels and membership functions for e and ‚ are defined as shown in Figure 3a, 3b respectively. Figure 3c shows the labels and membership functions for Kf. FIU Source Code of Unit B The following is the source code of Unit B written in FIDE's Fuzzy Inference Language (FIL). Note that in the definition of input variable Error, the value of P_VerySmall is given as (@-3, 0, @0, 1, @50, 0), and that of N_VerySmall is (@-50, 0, @0, 1, @3, 0). We use -3 and 3 instead of -1 and 1 respectively because the data range of Error must be accommodated in a resolution of 8 bits. This means the smallest interval of Error is 600/256 = 3. The membership functions of these fuzzy sets are shown in Figure 3a, 3b, and 3c as we have seen. $ FILENAME: motor/motor1.fil $ DATE: 08/12/1992 $ UPDATE: 08/14/1992 $ Two inputs, one output, to determine control gain $ INPUT(S): Error, Derivative(_of_Error) $ OUTPUT(S): Gain $ FIU HEADER fiu tvfi (min max) *8; $ DEFINITION OF INPUT VARIABLE(S) invar Error " " : -300 () 300 [ P_Large (@100, 0, @200, 1, @300, 1), P_Medium (@50, 0, @100, 1, @200, 0), P_Small (@0, 0, @50, 1, @100, 0), P_VerySmall (@-3, 0, @0, 1, @50, 0), N_VerySmall (@-50, 0, @0, 1, @3, 0), N_Small (@-100,0, @-50, 1, @0, 0), N_Medium (@-200,0, @-100, 1, @-50, 0), N_Large (@-300,1, @-200, 1, @-100,0) ]; invar Derivative " " : -30 () 30 [ P_Large (@10, 0, @20, 1, @30, 1), P_Medium (@5, 0, @10, 1, @20, 0), P_Small (@0, 0, @5, 1, @10, 0), P_VerySmall (@-1, 0, @0, 1, @5, 0), N_VerySmall (@1, 0, @0, 1, @-5, 0), N_Small (@0, 0, @-5, 1, @-10,0), N_Medium (@-5, 0, @-10, 1, @-20,0), N_Large (@-10, 0, @-20, 1, @-30,1) ]; $ DEFINITION OF OUTPUT VARIABLE(S) outvar Gain " " : -2 () 2 * ( P_Large = 2.00, P_Medium = 1.00, P_Small = 0.50, P_VerySmall = 0.25, Zero = 0.00, N_VerySmall = -0.25, N_Medium = -1.00 ); $ RULES if Error is N_Large and Derivative is P_Large then Gain is P_Medium; if Error is N_Large and Derivative is P_Medium then Gain is P_Medium; if Error is N_Large and Derivative is P_Small then Gain is P_Medium; if Error is N_Large and Derivative is P_VerySmall then Gain is P_Medium; if Error is N_Large and Derivative is N_VerySmall then Gain is P_Medium; if Error is N_Large and Derivative is N_Small then Gain is P_Medium; if Error is N_Large and Derivative is N_Medium then Gain is P_Small; if Error is N_Large and Derivative is N_Large then Gain is P_Small; if Error is N_Medium and Derivative is P_Large then Gain is P_Medium; if Error is N_Medium and Derivative is P_Medium then Gain is P_Medium; if Error is N_Medium and Derivative is P_Small then Gain is P_Medium; if Error is N_Medium and Derivative is P_VerySmall then Gain is P_Medium; if Error is N_Medium and Derivative is N_VerySmall then Gain is P_Medium; if Error is N_Medium and Derivative is N_Small then Gain is P_Medium; if Error is N_Medium and Derivative is N_Medium then Gain is P_Small; if Error is N_Medium and Derivative is N_Large then Gain is Zero; if Error is N_Small and Derivative is P_Large then Gain is P_Medium; if Error is N_Small and Derivative is P_Medium then Gain is P_Medium; if Error is N_Small and Derivative is P_Small then Gain is P_Medium; if Error is N_Small and Derivative is P_VerySmall then Gain is P_Medium; if Error is N_Small and Derivative is N_VerySmall then Gain is P_Medium; if Error is N_Small and Derivative is N_Small then Gain is P_Small; if Error is N_Small and Derivative is N_Medium then Gain is P_VerySmall; if Error is N_Small and Derivative is N_Large then Gain is N_VerySmall; if Error is N_VerySmall and Derivative is P_Large then Gain is P_Medium; if Error is N_VerySmall and Derivative is P_Medium then Gain is P_Medium; if Error is N_VerySmall and Derivative is P_Small then Gain is P_Medium; if Error is N_VerySmall and Derivative is P_VerySmall then Gain is P_Medium; if Error is N_VerySmall and Derivative is N_VerySmall then Gain is P_Large; if Error is N_VerySmall and Derivative is N_Small then Gain is P_VerySmall; if Error is N_VerySmall and Derivative is N_Medium then Gain is N_VerySmall; if Error is N_VerySmall and Derivative is N_Large then Gain is N_Medium; if Error is P_VerySmall and Derivative is P_Large then Gain is N_Medium; if Error is P_VerySmall and Derivative is P_Medium then Gain is N_VerySmall; if Error is P_VerySmall and Derivative is P_Small then Gain is P_VerySmall; if Error is P_VerySmall and Derivative is P_VerySmall then Gain is P_Large; if Error is P_VerySmall and Derivative is N_VerySmall then Gain is P_Medium; if Error is P_VerySmall and Derivative is N_Small then Gain is P_Medium; if Error is P_VerySmall and Derivative is N_Medium then Gain is P_Medium; if Error is P_VerySmall and Derivative is N_Large then Gain is P_Medium; if Error is P_Small and Derivative is P_Large then Gain is N_VerySmall; if Error is P_Small and Derivative is P_Medium then Gain is P_VerySmall; if Error is P_Small and Derivative is P_Small then Gain is P_Small; if Error is P_Small and Derivative is P_VerySmall then Gain is P_Medium; if Error is P_Small and Derivative is N_VerySmall then Gain is P_Medium; if Error is P_Small and Derivative is N_Small then Gain is P_Medium; if Error is P_Small and Derivative is N_Medium then Gain is P_Medium; if Error is P_Small and Derivative is N_Large then Gain is P_Medium; if Error is P_Medium and Derivative is P_Large then Gain is Zero; if Error is P_Medium and Derivative is P_Medium then Gain is P_Small; if Error is P_Medium and Derivative is P_Small then Gain is P_Medium; if Error is P_Medium and Derivative is P_VerySmall then Gain is P_Medium; if Error is P_Medium and Derivative is N_VerySmall then Gain is P_Medium; if Error is P_Medium and Derivative is N_Small then Gain is P_Medium; if Error is P_Medium and Derivative is N_Medium then Gain is P_Medium; if Error is P_Medium and Derivative is N_Large then Gain is P_Medium; if Error is P_Medium and Derivative is P_Large then Gain is P_Small; if Error is P_Medium and Derivative is P_Medium then Gain is P_Small; if Error is P_Medium and Derivative is P_Small then Gain is P_Medium; if Error is P_Medium and Derivative is P_VerySmall then Gain is P_Medium; if Error is P_Medium and Derivative is N_VerySmall then Gain is P_Medium; if Error is P_Medium and Derivative is N_Small then Gain is P_Medium; if Error is P_Medium and Derivative is N_Medium then Gain is P_Medium; if Error is P_Medium and Derivative is N_Large then Gain is P_Medium end Input/Output Response Figure 4 shows the response surface of the FIU defined above. This surface is obtained by using the Analyzer tool provided in FIDE. COMMENTS Through experimentation, we can obtain a set of rules to infer compliance Ke from speed v, and the measured force f. The rules are in essence as follows: If v is large and â is small, then Ke is very small If v is large and â is medium,then Ke is small If v is large and â is large, then Ke is medium If v is small and â is small, then Ke is medium If v is small and â is medium,then Ke is large If v is small and â is large, then Ke is very large The label names used here give an intuitive sense of how the rules apply. However, even though label names are the same for different variables, the fuzzy sets associated with these labels may be different. For speed v, the label large may be a fuzzy set as shown in Figure 5a, and for compliance Ke, label large could be another fuzzy set as shown in Figure 5b. The ranges of these variables can be determined by experiment on the devices and objects of interest. For example, compliance data gathered from a soft tennis ball and a hard steel ball can be used to define large and small labels respectively for variable Ke. If we use an FIU to infer compliance Ke, the control gain function now becomes three FIUs and an operations block (FOU) as shown in Figure 6. The FOU implements Kg = Ks . Kf . Using Fide's Composer capability, these four blocks can be combined into a single system for analysis and simulation purposes. (Weijing Zhang, Applications Engineer, Aptronix Inc.) For Further Information Please Contact: Aptronix Incorporated 2150 North First Street #300 San Jose, CA 95131 Tel (408) 428-1888 Fax (408) 428-1884 FuzzyNet (408) 428-1883 data 8/N/1 Aptronix Company Overview Headquartered in San Jose, California, Aptronix develops and markets fuzzy logic-based software, systems and development tools for a complete range of commercial applications. The company was founded in 1989 and has been responsible for a number of important innovations in fuzzy technology. Aptronix's product Fide (Fuzzy Inference Development Environment) -- is a complete environment for the development of fuzzy logic-based systems. Fide provides system engineers with the most effective fuzzy tools in the industry and runs in MS-Windows(TM) on 386/486 hardware. The price for Fide is $1495 and can be ordered from any authorized Motorola distributor. For a list of authorized distributors or more information, please call Aptronix. The software package comes with complete documentation on how to develop fuzzy logic based applications, free telephone support for 90 days and access to the Aptronix FuzzyNet information exchange. Servo Motor Force Control FIDE Application Note 003-140892 Aptronix Inc., 1992