3dof planar robot using fuzzy logic anfis (1)

Upload: saqib-anwar

Post on 04-Jun-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 3DOF Planar Robot Using Fuzzy Logic ANFIS (1)

    1/6

    Int. J. of Computers, Communications & Control, ISSN 1841-9836, E-ISSN 1841-9844

    Vol. III (2008), Suppl. issue: Proceedings of ICCCC 2008, pp. 150-155

    Inverse Kinematics Solution of 3DOF Planar Robot using ANFIS

    Srinivasan Alavandar, M.J. Nigam

    Abstract: One of the most important problems in robot kinematics and control is, find-

    ing the solution of Inverse Kinematics. Traditional methods such as geometric, iterative and

    algebraic are inadequate if the joint structure of the manipulator is more complex. As the

    complexity of robot increases, obtaining the inverse kinematics is difficult and computation-

    ally expensive. In this paper, using the ability of ANFIS (Adaptive Neuro-Fuzzy Inference

    System) to learn from training data, it is possible to create ANFIS with limited mathematical

    representation of the system. Computer simulations conducted on 2DOF and 3DOF robot

    manipulator shows the effectiveness of the approach.

    Keywords: ANFIS, manipulator, Inverse kinematics, Degree of freedom(DOF)

    1 Introduction

    Robot control actions are executed in the joint coordinates while robot motions are specified in the Cartesiancoordinates. Conversion of the position and orientation of a robot manipulator end-effector from Cartesian space

    to joint space, called as inverse kinematics problem, which is of fundamental importance in calculating desired

    joint angles for robot manipulator design and control.

    For a manipulator withn degree of freedom, at any instant of time joint variables is denoted by i= (t), i =1, 2, 3,..., n and position variables xj= x(t), j = 1, 2, 3,...,m. The relations between the end-effector positionx(t)and joint angle (t)can be represented by forward kinematic equation,

    x(t) = f((t)) (1)

    where f is a nonlinear, continuous and differentiable function. On the other hand, with the given desired end

    effector position, the problem of finding the values of the joint variables is inverse kinematics, which can be solved

    by,

    (t) = f

    (x(t)) (2)

    Solution of (2) is not unique due to nonlinear, uncertain and time varying nature of the governing equations.

    The different techniques used for solving inverse kinematics can be classified as algebraic[1], geometric[2] and

    iterative[3]. The algebraic methods do not guarantee closed form solutions. In case of geometric methods, closed

    form solutions for the first three joints of the manipulator must exist geometrically. The iterative methods converge

    to only a single solution depending on the starting point and will not work near singularities. If the joints of

    the manipulator are more complex, the inverse kinematics solution by using these traditional methods is a time

    consuming.In other words, for a more generalized m-degrees of freedom manipulator, traditional methods will

    become prohibitive due to the high complexity of mathematical structure of the formulation. To compound the

    problem further, robots have to work in the real world that cannot be modeled concisely using mathematical

    expressions.

    Utilization of Neural network (NN) and Fuzzy logic for solving the inverse kinematics is much reported[4-8].

    Li-Xin Wei et al[9]., and Rasit Koker et al[10]., proposed neural network based inverse kinematics solution of arobotic manipulator. In this paper, neuro-fuzzy systems which provide fuzzy systems with automatic tuning using

    Neural network is used to solve the inverse kinematics problem. The paper is organized as follows, in section 2, the

    structure of ANFIS used is presented. Section 3 describes results and discussion. Section 4 ends with conclusion.

    2 ANFIS Architecture

    This section introduces the basics of ANFIS network architecture and its hybrid learning rule. Adaptive Neuro-

    Fuzzy Inference System is a feedforward adaptive neural network which implies a fuzzy inference system through

    its structure and neurons. Jang was one of the first to introduce ANFIS[11]. He reported that the ANFIS architec-

    ture can be employed to model nonlinear functions, identify nonlinear components on-line in a control system, and

    predict a chaotic time series. It is a hybrid neuro-fuzzy technique that brings learning capabilities of neural net-

    works to fuzzy inference systems. The learning algorithm tunes the membership functions of a Sugeno-type FuzzyInference System using the training input-output data. A detailed coverage of ANFIS can be found in[11-13].

    Copyright 2006-2008 by CCC Publications - Agora University Ed. House. All rights reserved.

  • 8/13/2019 3DOF Planar Robot Using Fuzzy Logic ANFIS (1)

    2/6

    Inverse Kinematics Solution of 3DOF Planar Robot using ANFIS 151

    For a first order Sugeno type of rule base with two inputs x, y and one output, the structure of ANFIS is shown

    in Figure 1. The typical rule set can be expressed as,

    Rule 1: Ifx1is A1AND x2 is B1, THEN f1= p1x + q1y + r1Rule 2: Ifx1is A2AND x2 is B2, THEN f2= p2x + q2y + r2

    N

    A 1

    A 2

    B 1

    B 2

    P

    P N

    f1(x, y )

    f2(x, y )

    S

    x2

    x1

    inputs

    IF partrules + norm

    THEN part

    output

    layer 1

    layer 2 layer 3 layer 4

    layer 5

    w1

    w2

    1w

    2wfw

    22

    fw1

    1

    Figure 1: Structure of ANFIS

    In the first layer, each node denotes the membership functions of fuzzy sets Ai,Bi, i=1,2 beAi(x1),Bi(x2).In the second layer the T-norm operation will be done related to AND operator of fuzzy rules. Considering T-norm

    multiplication:

    wi= Ai(x1).Bi(x2) (3)

    In the third layer, the average is calculated based on weights taken from fuzzy rules,

    wi= wi

    w1+ w2 (4)

    In the fourth layer, the linear compound is obtained from the input of the system as THEN part of Sugeno-type

    fuzzy rules as,

    wi.fi=wi(pix1+ qix2+ ri) (5)

    In the fifth layer, defuzzification process of fuzzy system (using weighted average method) is obtained by,

    f= i

    wi.fi=i wi.fi

    i wi(6)

    This paper considers the ANFIS structure with first order Sugeno model containing 49 rules. Gaussian mem-

    bership functions with product inference rule are used at the fuzzification level. Hybrid learning algorithm that

    combines least square method with gradient descent method is used to adjust the parameter of membership func-tion. The flowchart of ANFIS procedure is shown in Figure 2.

    3 Simulation and Results

    Figure 3(a)and 3(b) shows the two degree of freedom (DOF) and three DOF planar manipulator arm which is

    simulated in this work.

    3.1 Two Degree of Freedom planar manipulator

    For a 2 DOF planar manipulator havingl1and l2 as their link lengths and 1,2as joint angles withx,yas task

    coordinates the forward kinematic equations are,

    x=l1cos(1) + l2cos(1+2) (7)

  • 8/13/2019 3DOF Planar Robot Using Fuzzy Logic ANFIS (1)

    3/6

    152 Srinivasan Alavandar, M.J. Nigam

    Initialize the fuzzy system

    Usegenfis1orgenfis2commands

    Give the parameters for learning

    Number of Iterations (epochs)Tolerance (error)

    Start learning process

    Use command anfis

    Stop when tolerance is achieved

    Validate

    With independent data

    Figure 2: ANFIS procedure

    (a) (b)

    Figure 3: (a)Two degree of freedom (DOF) and (b)Three DOF planar manipulator

    y=l1sin(1) + l2sin(1+2) (8)and the inverse kinematics equations are,

    1=atan2(y,x)atan2(k2,k1) (9)

    2= atan2(sin2,cos2) (10)

    where,k1=l1+ l2cos2, k2=l2,sin2cos2= (x2+y2l21l

    22 )

    2l1l2andsin2=

    (1cos22).

    Considering length of first arm l1 = 10 and length of second arm l2 = 7 along with joint angle constraints

    0

  • 8/13/2019 3DOF Planar Robot Using Fuzzy Logic ANFIS (1)

    4/6

    Inverse Kinematics Solution of 3DOF Planar Robot using ANFIS 153

    the membership functions and the weights will be adjusted such that the required minimum error is satisfied or if

    the number of epochs reached. At the end of training, the trained ANFIS network would have learned the input-

    output map and it is tested with the deduced inverse kinematics. Figure 5 shows the difference in theta deduced

    analytically and the data predicted with ANFIS.

    0 50 100 150 200 250 300 350 400 4506

    4

    2

    0

    2

    4x 10

    3 Joint angle 1(Deduced Predicted)

    0 50 100 150 200 250 300 350 400 4504

    2

    0

    2

    4

    6x 10

    3 Joint angle 2(Deduced Predicted)

    Figure 5: Difference in theta deduced and the data predicted with ANFIS trained

    3.2 Three Degree of Freedom planar manipulator

    For a 3 DOF planar redundant manipulator, the forward kinematic equations are,

    x=l1cos(1) + l2cos(1+2) + l3cos(1+2+3) (11)

    y=l1

    sin(1

    ) + l2

    sin(1+

    2) + l

    3sin(

    1+

    2+3) (12)

    = 1+2+3 (13)

    and the inverse kinematics equations are,

    2=atan2(sin2,cos2) (14)

    1=atan2((k1ynk2xn), (k1xnk2yn) (15)

    3= (1+2) (16)

    where, k1 = l1+ l2cos2 , k2 =l2,sin2 cos2 = (x2+y2l21l

    22 )

    2l1l2, sin2 =

    (1cos22), xn =x l3cos and

    yn=y l3sin.For simulation, the length for three links arel1 = 10,l2 = 7 andl3= 5 with joint angle constraints0 < 1