Design and Implementation of Fuzzy Control for Industrial Robot

The dynamic equations of motion for a mechanical manipulator are highly non-linear and complex. It is therefore, very difficult to implement real-time control based on a detailed dynamic model of a robot, if not impossible (Luh et al., 1980; Lee et al., 1982). The control problem becomes more difficult if adaptive control is necessary to accommodate changing operational conditions. Such a requirement frequently exits in the manufacturing environment; therefore, an alternative design approach would be attractive to the industrial practitioner. A better solution to the complex control problem might result if human intelligence and judgement replaces the design approach of finding an approximation to the true process model. A practical alternative would be the use of fuzzy logic. It has been reported that fuzzy logic controllers performed better, or at least as good as, a conventional controller and can be employed where conventional control techniques are inappropriate (Li et al., 1989; Sugeno, 1985; Ying et al., 1990). In contrast to adaptive control, fuzzy logic algorithms do not require a detailed mathematical description of the process to be controlled and therefore the implementation of fuzzy logic should, theoretically, be less demanding computationally. Fuzzy logic algorithms can be designed for environments where the available source information is not accurate, subjective and of uncertain quality. Furthermore, these algorithms provide a direct means of translating qualitative and imprecise linguistic statements on control procedures into precise computer statements. In this chapter, a proposed fuzzy logic design to control an actual industrial robot arm is outlined. The description of fuzzy logic controller is described in Section 2. It includes the methodology for the design of a fuzzy logic controller for use in robotic application. Section 3 presents the robot control system architecture. In Section 4, the relevant issues that arise relating to the design techniques employed are discussed in detailed. These issues include choise of sampling time, fuzzy rules design strategy, and controller tuning strategy. To evaluate the effectiveness of the proposed design strategy, studies are made to


Introduction
The dynamic equations of motion for a mechanical manipulator are highly non-linear and complex. It is therefore, very difficult to implement real-time control based on a detailed dynamic model of a robot, if not impossible (Luh et al., 1980;Lee et al., 1982). The control problem becomes more difficult if adaptive control is necessary to accommodate changing operational conditions. Such a requirement frequently exits in the manufacturing environment; therefore, an alternative design approach would be attractive to the industrial practitioner. A better solution to the complex control problem might result if human intelligence and judgement replaces the design approach of finding an approximation to the true process model. A practical alternative would be the use of fuzzy logic. It has been reported that fuzzy logic controllers performed better, or at least as good as, a conventional controller and can be employed where conventional control techniques are inappropriate Sugeno, 1985;Ying et al., 1990). In contrast to adaptive control, fuzzy logic algorithms do not require a detailed mathematical description of the process to be controlled and therefore the implementation of fuzzy logic should, theoretically, be less demanding computationally. Fuzzy logic algorithms can be designed for environments where the available source information is not accurate, subjective and of uncertain quality. Furthermore, these algorithms provide a direct means of translating qualitative and imprecise linguistic statements on control procedures into precise computer statements. In this chapter, a proposed fuzzy logic design to control an actual industrial robot arm is outlined. The description of fuzzy logic controller is described in Section 2. It includes the methodology for the design of a fuzzy logic controller for use in robotic application. Section 3 presents the robot control system architecture. In Section 4, the relevant issues that arise relating to the design techniques employed are discussed in detailed. These issues include choise of sampling time, fuzzy rules design strategy, and controller tuning strategy. To evaluate the effectiveness of the proposed design strategy, studies are made to investigate which design strategy leads to the best control performance under various robot conditions. Section 5 concludes this chapter.

Description of Fuzzy Logic Controller Architecture
The basic structure of the fuzzy logic controller (FLC) most commonly found in the literature is presented in Fig. 1 (Lee, 1990a). The basic configuration of a fuzzy system is composed of a fuzzification interface, a knowledge base, a fuzzy inference machine and a defuzzification interface as illustrated in the upper section of Fig. 1. The measured values of the crisp input variables are mapped into the corresponding linguistic values or the fuzzy set universe of discourse at the fuzzification interface. The knowledge base comprises both the fuzzy data and fuzzy control rules. The fuzzy data base contains all the necessary definitions used in defining the fuzzy sets and linguistic control rules whereas, the fuzzy control rule base includes the necessary control goals and control policy, as defined by an experts, in the form of a set of linguistic rules. The fuzzy inference engine emulates human-decision making skills by employing fuzzy concepts and inferring fuzzy control actions from the rules of inference associated with fuzzy logic. In contrast to the fuzzification stage, the defuzzification interface converts the values of the fuzzy output variables into the corresponding universe of discourse, which yields a non-fuzzy control action from the inferred fuzzy control action. In general, for a regulation control task, the fuzzy logic controller maps the significant and observable variables to the manipulated variable(s) through the chosen fuzzy relationships. The feedback from the process output is normally returned a crisp input into the fuzzification interface. The crisp or non-fuzzy input disturbance, illustrated in Fig. 1, would normally include both error and change in error, and these are mapped to their fuzzy counterparts at the fuzzification stage. These latter variables are the inputs to the compositional rules of inference from which the fuzzy manipulated variable is obtained. At the output from the defuzzification process, a crisp manipulated variable is available for input to the process. In conclusion, it can be stated that to design a fuzzy logic controller, six essential stages must be completed: 1. Input and output variables to be used must be identified. 2. Design the fuzzification process to receive the chosen input variables. 3. Establish the data and rule bases. 4. Select the compositional rule of inference for decision making. 5. Decide which defuzzification process is to be employed. 6. Develop the computational units to access the data and rule bases.

Input and Output Variables
In any fuzzy logic control system, the observed input must be fuzzified before it is introduced to the control algorithm. The most commonly used antecedents at this fuzzification stage are the state variables, error and rate of change in error. For the case of positioning a joint within a robot arm, the first variable is the difference (error) between the desired and the current joint position. The value of the second state variable is the numerical difference between two successive values of error (change in error). These two state variables give a good indication of the instantaneous performance of the system and both variables are quantifiable by fuzzy sets. In this project, error (E) and change in error (CE) are defined as the input fuzzy sets and the controlled action (CU) as the output fuzzy set. The evaluation of the error and the change in error at sample interval, k, is calculated as follows :

Method of Representing Fuzzy Sets
According to Lee (1990a), there are two methods for defining a fuzzy set; nu-merical and functional, depending on whether the universe of discourse is discrete or continuous. In the case of a discrete universe, a numerical definition is employed where the value of the membership function is represented by a vector; the order of the vector dependent on the degree of discretisation. The user has to specifically define the grade of membership of each cardinal in the fuzzy sets. For a continuous universe of discourse, a functional definition can be utilised to define the membership function of a fuzzy set. The triangle, trapezoidal and the bell shaped functions are the popular types found in many engineering applications. In this Chapter, this latter form of representation is adopted. The evaluation of the membership function is evaluated on-line during process operation. A combination of bisected trapezoidal, trapezoidal and triangular shaped fuzzy set templates are used to represent the input and output variables; template shapes that are readily evaluated and require the minimum of computer memory storage. At present, researchers are still looking for the best guidance to determine the best shape for a fuzzy set to provide an optimum solution to a specific control problem. In general, the use of simple shapes could provide satisfactory performance. The geometry of these templates can be defined by the base width and the side slope when mapped to the universe of discourse.

Mapping Fuzzy Sets to the Universe of Discourse
In any application, it is essential for a practitioner to identify the most appropriate parameters prior to the mapping of the fuzzy sets to the chosen universe of discourse; the determination of the size of both the measurement and control spaces; the choice of the discretisation levels for both the measurement and control spaces, the definition of the basic fuzzy sets within these discretised spaces and finally the sample interval to be used. The size of both the measurement and control spaces can be directly determined by estimating the probable operating range of the controlled system. However, the choice of the discretisation levels in both the measurement and control spaces, and the fuzzy set definitions can only be defined subjectively and are normally based on the experience and judgement of the design engineer. From a practical point of view, the number of quantisation levels should be large enough to provide an adequate resolution of the control rules without demanding excessive computer memory storage. Generally 5 to 15 level of discretisations are found to be adequate. It should be emphasised that the choice of these parameters has a significant influence on the quality of the control action that can be achieved in any application (Lee, 1990a). The use of higher resolution in the discretisation levels will result in an increase in the number of control rules and thereby make the formulation of these control rules more difficult. It should also be emphasised that the fuzzy sets selected should always completely cover the whole of the intended working range to ensure that proper control action can be inferred for every state of the process. The union of the support sets on which the primary fuzzy sets are defined should cover the associated universe of discourse in relation to some value, . This property is referred to as the " -completeness" by Lee (1990a). To ensure a dominant rule always exists, the recommendation is that the value of at the crossover point of two overlapping fuzzy sets is 0.5. At this value of , two dominant rules will be fired. To define the input fuzzy sets, error (E) and change in error (CE), the following procedure is adopted. In the case of the former fuzzy sets, the maximum range of error for a particular joint actuator is calculated. For example, a robot waist joint with a counter resolution of 0.025 degree per count, and a maximum allowable rotation of 300.0 degree would result in a maximum positional error of 12000 counts. A typical schematic representation for the error fuzzy set universe of discourse would be as illustrated in Fig. 2. The linguistic terms used to describe the fuzzy sets in Fig where N is negative, P is positive, B is big, M is medium, S is small and ZE is zero; a notation that is used throughout this chapter. Combinations of these letters are adopted to represent the fuzzy variables chosen, for example Posi-tiveBig, PositiveMedium and PositiveSmall. As a result, 7 discretisation levels are initially defined for each input and output domain. The size and shape of the fuzzy sets displayed in Fig. 2 are chosen subjectively and tuned during process operation to obtain the most appropriate response. The proposed tuning methodology of these fuzzy sets is detailed later in Figure 4.2. To determine the domain size for the change in error variable in this project, an open loop test was conducted. In this test, a whole range of voltage (from the minimum to the maximum) was applied to each of the robot joint actuator and the respective change in angular motion error was recorded every sample interval. From this information, the fuzzy sets illustrated in Fig. 3 for the change in error were initially estimated. Although the open loop response of the system will be different from the close loop response, it will give a good initial guide to the size of the domain appropriate for use with the fuzzy logic controller. It should be noted that the choice of sampling interval is very important because it will affect the maximum change in error value recorded. It was found that the use of a very high sampling rate caused the recorded maximum change in angular motion error to be close to zero and this made it impossible to define the location of each fuzzy set in the domain of discourse. For example, a sampling period of 0.001 seconds will result in a maximum change in waist positional error of 2 counts; a value found experimentally. In a similar manner, the control variable output fuzzy sets were selected. However, in this particular case, the dimentionality of the space is determined by the resolution of the available D/A converters. The D/A converters adopted are of an 8-bit type which yield 256 resolution levels as indicated on the horizontal axis in Fig. 4(a). Again, the universe of discourse was partitioned into 7 fuzzy set zones as depicted in Fig. 4(b).

Figure 4(a). A typical characteristic for the waist joint actuator
It should be noted that the fuzzy set labelled Zero is defined across the dead zone of the dc-servo motor in order to compensate for the static characteristics of the motor in this region. The initial sizes and distribution of the fuzzy sets are tuned during operation to improve the closed loop performance of the system.

Transforming a Crisp Input to a Fuzzy Variable
Consider the trapezoidal representation of an error fuzzy set as illustrated in Fig In a similar manner the properties of a triangular or bisected trapezoidal fuzzy set template can be defined.

Defining the Fuzzy Rule Base
The fuzzy rule base employed in FLC contains fuzzy conditional statements which are currently chosen by the practitioner from a detailed knowledge of the operational characteristics of the process to be controlled. The fuzzy rule base can be derived by adopting a combination of four practical approaches which are mutually exclusive, but are the most likely to provide an effective rule base. These can be summarised as follows (Lee, 1990a): 1. Expert experience and control engineering knowledge. In nature, most human decision making are based on linguistic rather than numerical descriptions. From this point of view, fuzzy control rules provide a natural framework for the characterisation of human behaviour and decision making by the adoption of fuzzy conditional statements and the use of an inference mechanism. 2. Operational experience. The process performance that can be achieved by a human operator when controlling a complex process is remarkable because his reactions are mostly instinctive. An operator through the use of conscious or subconscious conditional statements derives an effective control strategy. These rules can be deduced from observations of the actions of the human controller in terms of the input and output operating data. 3. Fuzzy model of the process. The linguistic description of the dynamic characteristics of a controlled process may be viewed as a fuzzy model of a process. Based on this fuzzy model, a set of fuzzy control rules can be generated to attain an optimal performance from a dynamic system. 4. Learning. Emulation of human learning ability can be carried out through the automatic generation and modification of the fuzzy control rules from experience gained. The rule base strategy adopted in this work Design and Implementation of Fuzzy Control for Industrial Robot 417 is developed from operational and engineering knowledge. The initial control rule base adopted is displayed in the look-up

Fuzzy Inference Mechanism
One virtue of a fuzzy system is its inference mechanisms which is analogous to the human decision making process. The inference mechanism employs the fuzzy control rules to infer the fuzzy sets on the universe of possible control action. The mechanism acts as a rule processor and carries out the tasks of manoeuvring the primary fuzzy sets and their attendant operations, evaluating the fuzzy conditional statements and searching for appropriate rules to form the output action. As mention earlier, the input and output variables of error, change in error and control action, UE , UCE and UCU. respectively, are all chosen to be discrete and finite, and are in the form of; (7) where indicates a fuzzy subset. As a result of selecting 7 discretisation levels for each fuzzy input and output variable, i.e. PB, PM, PS, etc., 49 fuzzy control rules result. These control rules are expressed in the form of fuzzy conditional statements; (8) At sample interval k, the jth fuzzy control rule, equation (8), can be expressed as; (9) where e(k), ce(k) and cu(k) denote the error, change in error and manipulated control variable respectively. The jth fuzzy subsets Ej , CEj and CUj are defined as; Alternatively, Equation (9) can be evaluated through the use of the compositional rule of inference. If the minimum operator is utilised, the resulting membership function can be expressed as; (11) where the symbol indicates the fuzzy implication function and j jj j EC EC U ℜ= × × denotes the fuzzy relation matrix on In term of the membership functions, this can be expressed as; To use the result of Equation (13), a defuzzification process is necessary to produce a crisp output for the control action value.

Choosing Appropriate Defuzzification Method
Several approaches (Lee, 1990b) have been proposed to map the fuzzy control action to a crisp value for input to the process. Basically, all have the same aim that is, how best to represent the distribution of an inferred fuzzy control action as a crisp value. The defuzzification strategies most frequently found in the literature are the maximum method and centre of area method: 1. The maximum method. Generally, the maximum method relies on finding the domain value, zo, that maximises the membership grade which can be represented by; In the case when there is more than one maximum membership grade in W, the value of zo is determined by averaging all local maxima in W. This approach known as mean of maximum method (MOM) is expressed as; 2. The center of area method (COA). The center of area method sometimes called the centroid method produces the center of gravity of the possibility distribution of a control action. This technique finds the balance point in the output domain of the universe of discourse. In the case when a discrete universe of discourse with m quantisation levels in the output, the COA method produces; where zi is the ith domain value with membership grade of (zi ).

420
Industrial Robotics: Theory, Modelling and Control

Experimental Setup
The robot control system is composed of the host computer, the transputer network, and the interface system to a small industrial robot. The schematic representation of the control structure is presented in Fig. 6. The controller structure is hierarchically arranged. At the top level of the system hierarchy is a desktop computer which has a supervisory role for supporting the transputer network and providing the necessary user interface and disc storage facilities. The Transputer Development System acts as an operating system with Occam II as the programming language. At the lower level are the INMOS transputers; in this application one T800 host transputer is resident on the COMET board and mounted in one of the expansion slots of the desktop computer with the remaining three transputers resident in a SENSION B004 system. The robot is the RM-501 Mitsubishi Move Master II, with the proprietary control unit removed to allow direct access to the joint actuators, optical encoders and joint boundary detection switches. The host transputer also provides an interface facilities to the user, for example, input and output operation from the keyboard to the screen. The three transputers resident in the SENSION B004 system are a T414 transputer which is resident on the GBUS-96 board and provides a memory mapped interface to the robot through a Peripheral Interface Adapter (PIA) Card. The remaining two T800 root transputers are used to execute the controller code to the robot. The PIA card allows a parallel input and output interface to the robot joint actuators and conforms to the interface protocol implemented on the GBUS-96 which is known as a GESPIA Card. The actual hardware arrangement together with the interfacing employed is shown in Fig. 7, with the Mitsubishi RM-501 robot shown in Fig.  8.

The Mitsubishi RM-501 Move Master II Robot
This industrial robot is a five degree of freedom robot with a vertical multijoint configuration. The robot actuators are all direct current servo motors, but of different powers. At the end of each joint, a sensor is provided to limit the angular movement. The length of link and its associated maximum angular motion is listed in Table 2. Fig. 9(a) and 9(b) illustrate the details of the robot dimensions1 and it's working envelop. The maximum permissible handling weight capacity is 1.2 kg including the weight of the end effector.  Figure 9(a). Range of movement of waist joint and robot dimensions (all dimensions are measured in millimeter).

Experimental Studies
A program code for the development of a FLC was written in the Occam language and executed in a transputer environment. This approach would enable the evaluation of the robustness of the controller design proposed and applied to the first three joint of a RM-501 Mitsubishi industrial robot. A T800 transputer is assigned to position each joint of the robot independently. To determine the effect on controller performance of changing different controller parameters, one joint only is actuated and the other two are locked. In the first experiment the impact on overall robot performance of changes in sample interval was assessed. This was followed by an investigation into how best to tune a controller algorithm and whether guide-lines can be identified for future use. The problem is to overcome the effect of changing robot arm configuration together with a varying payload condition.

The Choice of Sampling Time
Inputs (error and change in error) to the fuzzy logic control algorithm that have zero membership grades will cause the membership grades of the output fuzzy sets to be zero. For each sample period, the on-line evaluation of the algorithm with 49 control rules has been found by experiment to be 0.4 milliseconds or less. Hence, to shorten the run time, only inputs with non-zero membership grades are evaluated. For times of this magnitude, real-time control is possible for the three major joint controllers proposed. It has been cited in the literature that it is appropriate to use a 0.016 seconds sampling period (60 Hertz) because of its general availability and because the mechanical resonant frequency of most manipulators is around 5 to 10 Hz (Fu et al., 1987). Experiments have been carried out to determine how much improvement can be achieved by shorten the sampling period from 0.02 seconds to 0.01 seconds. In the first experiment, the waist joint is subjected to a 60.0 degree (1.047 radian or 2400 counter count) step disturbance with all other joints in a temporary state of rest. The results shown in Fig. 10 suggest that very little improvement in transient behaviour will be achieved by employing the shorter sampling period. The only benefit gained is a reduction in the time to reach the steady state of 0.4 seconds. In a second test, the waist joint is commanded to start from its zero position and to reach a position of 5 degree (0.0087 radian or 20 counter count) in 2 seconds; it remains at this position for an interval of 1 second after which it is required to return to its home position in 2 seconds as showed in Fig. 11. Again the benefit is only very marginal and of no significance for most industrial applications. Despite these results, it was decided that the higher of the two sampling rates would generally ensure better transient behaviour, hence the 0.01 seconds sampling period is used throughout this project.
Design and Implementation of Fuzzy Control for Industrial Robot 425 Figure 10. Waist response to a step input for different sampling periods. Figure 11. Waist trajectory tracking at different sampling periods.

Controller Tuning Strategies
Tuning of a FLC may be carried out in a number of ways; for instance modifying the control rules, adjusting the support of the fuzzy sets defining magnitude and changing the quantisation levels. The objective is always to minimise the difference between the desired and the actual response of the system. Because of the large number of possible combinations available and the different operational specifications that exist, no formal procedure exists for tuning the parameters of a FLC. In practice, trial and observation is the procedure most commonly employed. This can be tedious and time consuming and may not result in the selection of the most suitable parameters and in many practical situations does require safeguards to prevent excessive output variations and subsequent plant damage. To establish a rule base for a FLC, it is necessary to select an initial set of rules either intuitively or by the combination of methods described in Figure 2.3 for the process to be controlled. Rule modifications can be studied by monitoring the response of the close loop system to an aperiodic disturbance in a phase plane for error and change in error in this case. This trial and observation procedure is then repeated as often as required until an acceptable response is produced. In this project, three different ways for tuning the controller have been investigated. The initial control rules were initially selected by modifying the rule based initiated by Daley (1984). The modifications made to the rule base given in Daley (1984) were necessary to ensure a faster transient response with minimum overshoot and steady state error for the robot arm. The rule base listed in Table 1 was found to be the most appropriate for the robotic control process. A second procedure for tuning a FLC is investigate in this section and the final method will be presented in the next section. The use of two inputs and one output means that there is a three dimensional space in which to select the optimal solution. In most reported cases, scaling factors or gains were introduced to quantified these three universes of discourse. Hence, making it possible to tune a controller by varying the values of these gain terms. However, in this project, the functional forms of the fuzzy sets were utilised and these were mapped directly to the corresponding universe of discourse. Thereby, tuning is carried out by adjusting or redefining each fuzzy set location in the universe of discourse. The strategy developed in this project is to show the effect of changing each of the input and an output definitions to establish the impact on the overall performance of the robot. The initial estimate for the fuzzy sets employed in the three domains of discourse were made off-line as detailed in Figure 2.2.1. Fig. 12 shows the estimates for the error fuzzy set definitions. The corresponding estimates for the change in error and controlled action fuzzy set definitions are plotted in Fig. 13 and Fig. 14, respectively. Tuning of the error fuzzy sets is made by gradually moving the fuzzy set locations in the universe of discourse closer to the zero value of error. A similar procedure is adopted to tune the output fuzzy sets, however, the initial selection positioned these fuzzy sets as close as possible to the equilibrium point. For these sets, tuning is executed by gradually moving the fuzzy sets away from the equilibrium point until an acceptable close loop response is found. To demonstrate the effect of changing the error fuzzy sets definition, three choices of error fuzzy sets definition were made and are plotted in Fig. 12(a) -12(c) named Case 1, 2 and 3. The other two fuzzy set definitions remained unchanged and are shown in Fig. 13 and 14. A step disturbance of 30.0 degree (1200 counter counts or 0.523 radian) was introduced at the waist joint and the other joints, shoulder and elbow, were locked at 10 degrees and 90 degrees respectively2. This robot arm configuration was chosen to exclude variations in inertia, gravitational force and cross coupling resulting from the movement of these two joints. The impact from the use of an inappropriate definition for the output fuzzy sets is significant when variations in these forces are present and this is studied in latter experiments. The joint response to a 30.0 degree step disturbance is shown in Fig. 15(a) and the associated control signals are shown in Fig. 15(b). Notice that in Figure 15(a), at about 1.0 second the joint response for error fuzzy set definition Case 1 started to deviate from the other two cases because of the large spread in the fuzzy sets in comparison to the other two cases depicted in Fig. 12(a). There is no noticeable difference in transient response between Cases 2 and 3 because the fuzzy set definitions are close to the equilibrium point. However, differences start to emerge as the two responses approach the chosen set point, Case 3 response is more oscillatory. This corresponds to the excessive voltage variations that can be observed in Fig. 15(b). This phenomenon occurred because of the use of a very tight definition for error (close to zero) in Case 3 (Fig. 12(c)) which leads to a large overshoot and hunting around the set point. The use of the fuzzy set definition, Case 2 gives a good accuracy throughout the whole envelope of operation for the waist joint with this particular robot arm configuration. The maximum steady state error is found to be 0.0013 radian (3 counter count) as a result of the coarseness of the fuzzy sets used; fuzzy set labelled ZERO is defined between -5 to +5 counts.     This performance, however, is degraded when the robot arm configuration is changed. For example, when the shoulder and elbow joints are at full stretch and locked at 100.0 and 90.0 degree respectively, large overshoot cannot be avoided due to the increased inertia on the waist joint. Fig. 16 is provided as an illustration of the waist response to a small step disturbance of 1.0 degree (40 counter count or 0.017 radian). The blue line included in this figure is a waist response for the re-tune fuzzy sets definition which will be discussed later in this section. It can be seen that that despite exhaustive tuning of both the input fuzzy sets a large overshooting cannot be avoided for the second robot arm configuration. From these results, it can be concluded that to provide a better control a new combination of fuzzy sets have to be defined. A way of achieving this is to reduce the waist speed of operation. By redefining a smaller error, change in error and control action fuzzy sets in this region of operation, finer control around the equilibrium can be achieved but of a reduced operational speed. The smaller tuned fuzzy set combinations are plotted in Fig. 17, 18 and 19. The blue line in Fig. 16 shows the waist response and the corresponding controlled input signals for the smaller tuned fuzzy set combinations for com- The drawback of using the smaller fuzzy set combinations is obvious when the waist is subjected to a large step disturbance, for example at 30.0 degrees (1200 counter count or 0.523 radian) with the arm in the second configuration. The subsequent waist response is plotted in Fig. 20 together with the response for the second definition of the fuzzy set combinations. The waist response when using the smaller fuzzy set combinations of Fig. 16 and Fig. 20 show that the controller could position the waist with a smaller overshoot of 0.025 degree (1 counter count) and zero steady state error, however, the penalty to be paid is an increase in rise time. The zero steady state error is achieved because of the use of a fuzzy singleton definition in the error fuzzy set labelled ZERO, i.e. the error fuzzy set is defined between ± 1 in the universe of discourse as is depicted in Fig. 17. Although the Case 2 fuzzy set combinations can provide a faster response (about 1.2 seconds quicker for a 30.0 degree step input), the overshoot (0.25 degree) and steady state error (0.075 degree) are both greater, Fig. 20. These results deteriorate when the controller operates under gravitational force and variable payload. A further comparison to evaluate the performance between the smaller fuzzy set combinations and the Case 2 fuzzy set combinations is conducted by subjecting the waist to a sinusoidal signal disturbance of 30.0 degree amplitude and 4.0 seconds time periods. Fig. 21(a) shows clearly that trajectory following with the Case 2 fuzzy set combinations is by far the better result. Fig. 21(b) illustrates that the use of a smaller range of voltage in the output fuzzy sets definition could not generate an adequate controlled signal. These results suggest that tuning can never optimise simultaneously speed of response and accuracy. If fuzzy logic is to be used successfully in industrial process control, a method which can provides a fast transient response with minimum overshoot and steady state error must be found. One way to achieve this is to partition the problem into coarse and fine control, an approach suggested by Li and Liu (1989).     Having investigated the problems associated with the control of the waist joint, the investigation was extended to the more difficult upper-arm link, the shoulder joint. The control of this joint is difficult because of the gravitational force acting on it. For example, when the elbow is fully stretched and the shoulder is at 30.0 degree location to the working envelop, a load of 0.4 kg. is enough to drag the shoulder joint downwards with 0 voltage (127 DAC input value) applied to the actuator. The use of a single output fuzzy set definition was found only suitable for a limited range of operation and not applicable for the robot employed in this study. To illustrate this limitation, Fig. 22 shows the effect of using a single output definition in 4 different operational regions when the elbow is fully stretched. To compensate for the gravitational loading effect, 4 operational regions were identified, and each was assigned a different output fuzzy set. The switches 1, 2, 3 and 4 would control the choice of the output fuzzy set in the range of 0 to 10 degrees, 10 to 30 degrees, 30 to 90 degrees and 90 to 130 degrees of the shoulder joint working envelop, respectively. The four switched output fuzzy sets are presented in Fig. 23(a) -23(d) and these have been tuned as previously discussed. In all four modes of operation, the input fuzzy set combinations of Case 2 were utilised. From Fig. 23(a) -23(d), it is obvious that the fuzzy sets labelled ZERO is moving towards the right of the plot from the left as the region of operation moves from 1 to 4. This is to compensate for the gravitational load which forces the joint to overshoot when moving downwards as can be seen in Fig. 20. It should be noted that the use of the switches in selecting the output fuzzy set definition is just a coarse estimate, and as a result can give up to a maximum steady state error of 0.125 degrees (5 counter count) for the shoulder joint working envelop. If more accurate positional control is needed, it will be necessary to increase the number of switching regions or alternatively a different method will have to be found.    It should also be mentioned that the use of a trapezoidal function to represent the dead-zone area, mention in Section 2.2.1, is not suitable for implementation at this joint because of the unsymetrical nature of the actuator dead-zone in different regions of operation. Therefore, as an alternative the triangular function was used because it provides a more operational acceptable definition for the fuzzy sets. From the experiments gained in this section, it can be concluded that by using a trial and observation procedure, tuning of the FLC parameters can be successfully accomplished. To reduce the design time consumed adopting the trial and observation tuning method, a good initial estimate for the fuzzy set definitions is essential.

Conclusion
In this chapter, a methodology for the application of fuzzy logic theory to the development of a fuzzy logic controller had been presented and successfully implemented. The developed algorithm had been shown to be of simple design and implementable for real-time operation of a three joint industrial robot using joint space variables for control. The methodology to estimate the initial fuzzy sets has been presented. The use of the function form of template to represent the fuzzy sets provides a way to directly map these fuzzy sets into the corresponding universe of discourse. Unfortunately, this design could only be arrived at by the use of a trial and observation procedure and would suggest a more formal procedure must be developed for industrial applications. Furthermore, design by a trail and observation procedure cannot be guaranteed to yield the best result. In conclusion, it had been shown that a FLC can be designed to match specific process dynamics without the use of a process model within the control loop. Therefore, if automatic tuning can be introduced into the FLC design a very robust control approach will result and this could be directly applied to any poorly defined non-linear process.