. i

This paper proposes a hybrid ANFIS (Adaptive Neuro-Fuzzy Inference System) controller with DMRAC (Direct Model Reference Adaptive Control) and mathematical modeling of the kinematic and dynamic solutions. The controller was hybrid with a classical controller, and was designed for a spherical-wristed 6-DOF elbow manipulator. The manipulator’s trajectory overshoot and settling time affect movement; their minimization was thus aimed for. The whole manipulator-controller system was modeled and simulated on MATLAB Version 2011a and Robotics Toolbox 9. To increase accuracy, the ANFIS controller was trained to use many paths in rules and memberships selection. A 3D display model for the manipulator was built in MATLAB. The simulation of the design had done by using the MATLAB/SIMULINK through connection the design with 3D model. Satisfactory results show the hybrid controller’s capacity for precision and speed, both of which are higher than a classical controller’s alone.


INTRODUCTION
Intelligent control systems increase the effectiveness of control strategies and overcome limits of classical and adaptive controllers. They are expected to have in-built adaptation/learning and decision-making capabilities to handle uncertainties so the desired performance can be achieved. To overcome traditional computing paradigm limits, researchers look for new computational approaches to partial modeling of neural system functionality and that can solve real-world problems effectively. Novel computational models have emerged, collectively called soft computing. Incorporating intelligence into soft computing are ANN (artificial neural network), FL (fuzzy logic), ANFIS, GA (genetic algorithm), and knowledge-based expert systems. Intelligent self-learning or self-organizing control of expert systems, AI (artificial intelligence), FL, NN (neural networks), hybrid networks, etc. are the new performance-improving tools of industrial power-electronics-based drive systems. Control that combines intelligence and adaptation is the most promising in research into implementation and control of electrical drives [1,2].
Fuzzy logic (FL) was introduced by Zadeh in 1965 [3]. It processes data via partial, rather than crisp, set membership. Similar to neural network, FL can generate definite conclusions from vague, ambiguous, imprecise, and missing, input information. A proper FIS is essential to correcting fuzzy membership functions and fuzzy rules but constructing it takes time and needs profound expertise. Converting domain knowledge into if-then fuzzy rules is another difficulty, even to domain experts [4,5].
ANFIS was developed in the early 90s by Jang [1]. Combining the concepts of fuzzy logic and neural network, it is a hybrid intelligent system that enhances automatic learning and adaptation. Researchers have used such a system to predict and model in various engineering systems. Basic to neuro-adaptive learning techniques is a fuzzy modeling procedure that learns the data set and automatically computes the membership function parameters that best allow the associated FIS to track the given input/output data [6,7].
The membership function parameters are tuned by a combination of least-squares estimation and back-propagation algorithm for membership-function parameter estimation. Parameters of the membership function change through a learning process similar to that in a neural network. Their adjustment is facilitated by a gradient vector, which measures how well the FIS models the input/output data of a given set of parameters. Once the gradient vector is obtained, any of several optimization routines can adjust the parameters to reduce the error between the actual and the desired outputs. The fuzzy system then learns from the data it is modeling. Adjustment of the membership-function boundaries does not need a human operator, so this is an advantage over pure-fuzzy paradigm [8][9][10].
Continuous and repetitive tasks of production lines are tiring, and fatigue can cause accident/injury or long-term health problems. A robot manipulator arm can repeatedly carry huge and heavy parts from one production line to another, so is nowadays extensively used in factories to increase efficiency and handle repeated/hazardous/delicate tasks (e.g., semiconductor wafer production) [11,12].
Redundancy of the robot manipulator can be advantageous when the DOF of a given task is less than that of the manipulator. When a joint failure occurs, the robot manipulator is still able to perform its task reliably. Singular configuration of the robot manipulator can be avoided by controlling redundancy through robust inverse Jacobian singularity [13]. w w w . i j c t o n l i n e . c o m Methods have been proposed for the learning of fuzzy membership functions and fuzzy rules and for automatic FIS upgrade through analysis of input and output data. ANFIS is a sophisticated neuro-fuzzy system able to model complicated fuzzy relationships. It learns the Sugeno-Takagi FIS through forward and backward passes (see Figure1, and Equations 1 and 2 for the Sugeno-Takagi FIS format). It effectively constructs FIS through training data [14].
To aid ANFIS construction, fuzzy subtractive clustering clusters the available data into fuzzy clusters, from which a FIS is then generated. Fuzzy subtractive clustering works better than does other FIS clustering methods. ANFIS then refines the resulting FIS. In fuzzy subtractive clustering, the main parameters to adjust are the influential radii of a cluster center in multiple-dimension data space. The method assumes all data to fall within a hyper-box unit. Smaller influential radii generate more clusters for further process, and larger radii generate fewer clusters. Different radius combinations generate different FIS. Choosing the proper influential radii to a given problem is thus important [15,16]. :

Figure 1. Equivalent ANFIS architecture for first-order Sugeno-Takagi FIS from Equations (1) and (2)
Control strategies aim to improve conventional algorithms' disturbance rejection and/or parameter variation. In many control applications, FL controllers with ANN have been implemented successfully; where load disturbance is present, fuzzy regulators improve performance. With its capabilities for powerful learning, adaptation, robustness, and rapidity, an ANFIS controller suits complicated, non-linear, and ill-defined systems well [17].

MODELING OF 6-DOF MANIPULATOR
The number of joints determines the manipulator's DOF. A typical manipulator must have at least 6 independent DOF: three for positioning and three for orientation. With fewer than 6 DOF, the arm cannot reach in arbitrary orientation every point in its work environment. Applications such as reaching around or behind obstacles need more than 6 DOF. Increased links, however, increases control difficulties (a manipulator with more than six links is called a kinematically redundant manipulator). The workspace is the total volume swept out by the end-effector through all the possible movements of the manipulator's repertoire. It is constrained by the manipulator's geometry and the joints' mechanical constraints [18].
A control problem in robot manipulators is determination of the time history of the joint inputs necessary for the endeffector's execution of a motion command. Depending on the controller design model, the joint inputs may be joint forces and torques or inputs to actuators (e.g., voltage input to motor). The motion command is typically either a sequence of end-effector positions and orientations or a continuous path [19].
Direct-driving the robot eliminates gear problems of backlash, friction, and compliance. The coupling among the links, however, is more significant, and the motor dynamics may be much more complex. To extract higher performance from this type of manipulator, a different set of control problems must be addressed [20]. This paper proposes a hybrid DMRAC-based ANFIS-classical controller for a spherical-wristed 6-DOF manipulator. An offset in the manipulator's shoulder joint slightly complicates both the forward and the inverse kinematics problems.  Table 1 for the DH parameters). Computation of the Ai matrices is straightforward (see below).  For the manipulator's end-effector at the point with coordinates given by (o) and orientation given by R=(rij), the wristcentre coordinates (oc) must be (and sufficiently so) The inverse kinematics is obtained by analytical solution of the above equations. General solutions for the rotation angles are as summarized below [22]:   Substituting d1=15cm, d6=10cm, a2=20cm, and a3=25cm respectively for end-effector positions and orientations at 25, 30, 15, π/2, -π/2, and π/2 gives: In real-world applications, for the robot to interact with its environment, a suitable compliance in Cartesian space must be specified. Use of compliant, rather than stiff, position control has also been proposed, mainly to avoid the large forces resulting from a stiff robot arm's contact with the environment (especially if the environment is unknown and unstructured). The manipulator is a stiff mechanical structure, so an advanced control strategy is needed to achieve compliance. Impedance control [14] does this well, controlling the dynamic relation between the manipulator and the environment by establishing a mass-spring-damper system relation between the Cartesian position x and the Cartesian force f [23]: withMk, Dk and Kk respectively being virtual Cartesian inertia, damping, and stiffness. Impedance control aims to mask the robot's natural properties, replacing them with the specified mechanical impedance. These important assumptions must now be made: that the tele-operator control incorporates stiffness and damping but does not reveal any inertial properties, that the manipulator is a mass-less robot, and that the user feels the inertia of only the currently-used tool or the transported loads. The control strategy uses an extension of stiffness control. Cartesian matrices Dk and Kk are mapped onto joint spaces Dj and Kj through extended Jacobian geometry: In the 6-DOF manipulator, Dk and Kk are 6×6 diagonal matrices corresponding to the desired stiffness/damping in the task-space coordinates (three translational, three rotational, and q parameter), so null-space dynamic behavior is also controlled. The 6×6 Dk and Kk matrices are thus intentionally non-diagonal. Post-compensation of the manipulator's natural dynamics, the control law is as given by [28]: (11) where e q  and . The chosen control strategy requires inversion of neither the manipulator Jacobian nor the manipulator inertia matrix [24].

THE CONTROLLER DESIGN PROPOSED
MRAC (model reference adaptive control) and DRAC (direct reference adaptive control) are simple and very effective techniques to improve a control system's tracking performance through use of past system-operation experiences. They must solve the problem of parametric optimization by minimizing the cost function of specifying system performance. They w w w . i j c t o n l i n e . c o m use the information gleaned from past trials to improve the reference input of the present trial, creating a hybrid ANFISclassical controller with the ANFIS reference input adjusted, approximating the system output from the desired to the actual. The proposed approach and the design are simple to implement, needing neither intermediate plant model nor real-time identification of model parameters. Figure 3 is a basic block diagram of the proposed structure. Modeling of the classical controller can be by any easy control-design method (e.g., trial and error). In this work, the classical controller is used as the hybrid ANFIS controller's initial condition, eliminating the identification necessary in other adaptive control techniques.  Figure 1 shows the general ANFIS control structure for the control of any plant. This work hybridized an ANFIS controller with a classical controller. The control law driving the manipulator's end-effector to the desired position and orientation used the computation method proposed. The manipulator has six joint variables to control; each must use the hybrid ANFIS-classical controller. Each of the ANFIS controllers has the same structure and gets the same adaptation and training rules. The ANFIS controller structure has the same components as does the FIS but minusthe NN block. The network structure is a set of units (and connections) arranged in five connected network layers (L1 to L5) as follows: Layer 2 (the membership layer): checks for the weight of each membership function. It receives input values xi from the first layer, acts as the membership function for each fuzzy set of individual input variables, and computes the membership values that specify the degree with which input ix belongs to the fuzzy set inputting the next layer.
Layer 3 (the rule layer): every neuron in this layer performs pre-condition matching of the fuzzy rules; each computes the activation level of each rule. Each node of the layers calculates the normalized weights.
Layer 4 (the defuzzification layer): provides the output values resulting from the inference of rules. Connections between the layers are weighted by fuzzy singletons that represent another set of the neuro-fuzzy network's parameters.
Layer 5 (the output layer): sums up all the inputs coming from Layer 4 and transforms fuzzy classification results into crisps. The ANFIS structure is tuned automatically by least-square estimation and back-propagation algorithm for membership-function parameter estimation. The algorithm shown above is used with six ANFIS controllers controlling the manipulator's various parameters.
The ANFIS controller's and the classical controller's outputs are summed. Post-starting, the training of the parameters is adapted to the ANFIS controller's parameters according to fuzzy adaptation training rules (explained next). The classical PID controller tunes the variables Kp, Ki, Kd offline before using them; they represent the initial training conditions of the new intelligent controller (the proposed hybrid ANFIS controller).

SIMULATION RESULTS
The proposed design was simulated by VR modeling on MATLAB Version 2011a with Robotics Toolbox 9. Simulation began with reliability checking of the hybrid ANFIS-classical controller (which incidentally is faster and more precise than the classical controller alone). The hybrid ANFIS controller was tested on different transfer function models,   After reliability checking, the hybrid controller is now suitable for use in the simulation block diagram of the 6-DOF manipulator. The simulation model of the manipulator's kinematics and dynamics must match the hybrid controller's (see Figure 6 for the 3D MATLAB display of the 6-DOF manipulator's simulation of the inverse kinematics and dynamics).
Training of the ANFIS and selection of the FIS controller structure then proceed. The error signal between the required joint angle (qr) and the output joint angle (q) and its derivatives ( ) are input to the first layer of the ANFIS. After the procedure of the layers (see previous pages), structures as in Figure 7, representing set of rules, the input signal to the ANFIS identifier, and the surface error, appear.

CONCLUSIONS
 Solutions to the forward and the inverse kinematics equations were derived in D-H notation. Simulations were done on the 3-D model, and on MATLAB with Robotics Toolbox 9. The modeling solution for the hybrid controller design enables investigation of the robot parameters through forward and inverse kinematics; this facilitates design, construction, and inspection of real robots.
 The high flexibility of the ANFIS controller strategy suits many control applicationshuman/robot interaction, biomedical, and dynamic system control where the exact dynamic characteristic is difficult to obtain through direct training (this research used hybrid direct MRAC so the overall system error could be minimized in real time). Satisfactory simulation results show the effectiveness of the proposed scheme.
 Comparison of the simulation results of both the conventional and the hybrid ANFIS controller shows the increased system paths reduced overshoot and settling time, the reduction very important in real applications. This work hybridized the proposed ANFIS controller with a classical controller existent in a system and modified the responses before retrofitting the hybrid controller into the system without reconstructing the system into compatibility.

ACKNOWLEDGMENTS
Special thanks are due to University of Anbar -Iraq / Renewable Energy Research Centre for supporting me with the work with Grant No. RERC-TP12.