A DISSERTATION - Department of Computer Sciencenayans/upload/Robot_Dynamic_Engine.pdf · A...

42
I MPLEMENTATION OF ROBOT DYNAMICS WITH S TANDARD C ONTROL L IBRARY A DISSERTATION SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF BACHELOR OF TECHNOLOGY IN INFORMATION TECHNOLOGY BY NAYAN SINGHAL IIT2010164 UNDER THE GUIDANCE OF Prof. SUDIP SANYAL IIIT-Allahabad INDIAN INSTITUTE OF INFORMATION TECHNOLOGY, ALLAHABAD (A UNIVERSITY ESTABLISHED UNDER SEC.3 OF UGC ACT, 1956 VIDE NOTIFICATION NO. F.9-4/99-U.3 DATED 04.08.2000 OF THE GOVT. OF INDIA) A CENTRE OF EXCELLENCE IN INFORMATION TECHNOLOGY ESTABLISHED BY GOVT. OF INDIA

Transcript of A DISSERTATION - Department of Computer Sciencenayans/upload/Robot_Dynamic_Engine.pdf · A...

IMPLEMENTATION OF ROBOT DYNAMICS WITHSTANDARD CONTROL LIBRARY

A DISSERTATIONSUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE

DEGREE OF

BACHELOR OF TECHNOLOGY

IN

INFORMATION TECHNOLOGY

BY

NAYAN SINGHALIIT2010164

UNDER THE GUIDANCE OF

Prof. SUDIP SANYALIIIT-Allahabad

INDIAN INSTITUTE OF INFORMATION TECHNOLOGY, ALLAHABAD(A UNIVERSITY ESTABLISHED UNDER SEC.3 OF UGC ACT, 1956 VIDE NOTIFICATION NO. F.9-4/99-U.3

DATED 04.08.2000 OF THE GOVT. OF INDIA)A CENTRE OF EXCELLENCE IN INFORMATION TECHNOLOGY ESTABLISHED BY GOVT. OF INDIA

ABSTRACT

Computers have entered the age when it is able to learn from their own mis-takes. Several developments have been made in this regard but the new computingapproach is based on the biological nervous system which specifies how neuronsinteract with other neurons and react towards stimulus but the main problem with itis that it required several megawatts of power as compare to 20 watts of power usedby the actual brain.

In this project we are trying to control the robot with neuromorphic chipset thatmimic the million neurons but the main challenge is to implement the dynamic al-gorithm on neuromorphic chipset.

To implement these algorithm using 3-D vector in not possible, hence 6-D vectorcome in picture but analysis of all the 3 algorithm is still not done. So, in thisproject we are trying to implement these algorithms in Standard Control Libraryand analyze it so that we will get an idea where it fails and what are its drawbacksand try to analyze the problem that may occur while implementing on neuromorphicchipset.

CANDIDATE DECLARATION

I hereby declare that the work presented in this project entitled “Implementationof Robot Dynamics with Standard Control Library”, being submitted as a VIIIsemester project evaluation at Indian Institute of Information Technology, Alla-habad, is an authenticated record of my original work under the guidance and su-pervision of Prof. Sudip Sanyal.

This project is done till now is in full compliance with the requirements and con-straints of the prescribed curriculum.

Date: May 1st ,2014Place: Allahabad

CERTIFICATE

This is to certify that the statement made by the candidate is correct to the best of myknowledge and belief. The project entitled “Implementation of Robot Dynamicswith Standard Control Library” is a record of candidates work carried out bythem under my guidance and supervision.

Prof. Sudip Sanyal1st May, 2014

ACKNOWLEDGEMENTS

As understanding of the study like this is never the outcome of the efforts of asingle person, rather it bears the imprint of a number of persons who directly orindirectly helped me in completing the present study. I would be failing in my dutyif I don’t say a word of thanks to all those whose sincere advise makes my thisdocumentation of topic a real educative, effective and pleasurable one.

At the start I think the Almighty God for his divine grace and blessings showeredon me and thereby giving me strength and courage to complete work and in turn mycourse successfully.

It is my privilege to study at Indian Institute of Information Technology, Al-lahabad where students and professors are always eager to learn new things andto make continuous improvements by providing innovative solutions. I am highlygrateful to the honourable Director In-charge, IIIT-Allahabad, Prof. G.C. Nandi,for his ever helping attitude and encouraging us to excel in studies and for providingall the necessary requirements and his moral support for this dissertation work.

Regarding this project, first and foremost, I would like to acknowledge and extendmy heartful gratitude to Prof. Sudip Sanyal for his expert guidance and continuousencouragement throughout to see that this project rights its target since its com-mencement to its completion. His keen vital encouragement, superb guidance, andconstant support are the motive behind this project work.

I would like to heartily thank my mentor Mr. Samir Menon, Ph.D Scholar, Stan-ford University for his able guidance. His fruitful suggestions, valuable commentsand support were an immense help for me. In spite of his hectic schedule he tookpains, with smile, in various discussions which enriched me with new enthusiasmand vigour.

I owe my gratitude to Mr. Mithilesh Mishra, Coordinator, IIIT-A Network De-velopment, Engineering & Management(INDEM); to provide me the privilege to in-ternet for exploring world’s largest base.I am also thankful to Dr. Pavan Chakrabortyto issue me a Computer system with all the necessary accessories and configuration.

Implementation of Robot dynamics with Standard Control Library

I was always supported in the ups and downs of my life by my family members.I am blessed with such wonderful family; without their love, support and encour-agement, more than anything else, I would have never reached this stage in my life.I was provided with everything I required. I thank them all for all their love andsupport. I hope that with the completion of this course, I have made them proud.

Last, but not the least special thanks to all my friends, especially Manisha Ti-wari, Manish Sharma, Safeer Afaque, Arun Kumar, Somya Agarwal, Man-ish Aswani, Keshav Maheshwari who helped me in someway or the other in thisproject work.

Nayan SinghalIIT2010164May 1,2014

TABLE OF CONTENTS

1 INTRODUCTION 011.1 TOPIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 011.2 OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 011.3 OBJECTIVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 021.4 MOTIVATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . 021.5 PROBLEM DEFINITION . . . . . . . . . . . . . . . . . . . . . . 031.6 SCOPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 031.7 STRUCTURE OF REPORT . . . . . . . . . . . . . . . . . . . . . 041.8 SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 04

2 LITERATURE SURVEY 052.1 3-D VECTORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 052.2 6-D VECTORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 052.3 SPATIAL VECTORS . . . . . . . . . . . . . . . . . . . . . . . . . 062.4 SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 07

3 METHODOLOGY 083.1 PROPOSED APPROACH . . . . . . . . . . . . . . . . . . . . . . 083.2 DETAILS OF APPROACH . . . . . . . . . . . . . . . . . . . . . . 093.3 LANGUAGE TOOLS, LIBRARY AND TECHNIQUES USED . . 133.4 SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 RESULTS AND ANALYSIS 144.1 RESULTS OF INVERSE DYNAMICS ALGORITHM . . . . . . . 144.2 ANALYSIS OF INVERSE DYNAMICS ALGORITHM . . . . . . 214.3 RESULTS OF FORWARD DYNAMICS ALGORITHM . . . . . . 214.4 ANALYSIS OF FORWARD DYNAMICS . . . . . . . . . . . . . . 294.5 SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

5 CONCLUSION AND FUTURE WORK 305.1 CONCLUSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305.2 FUTURE WORK . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

APPENDIX A: REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . 31

LIST OF FIGURES

Figure 1 Proposed Approach for the solution 8

Figure 2 Spatial Vector System for Inverse Dynamics 10

Figure 3 Spatial Vector System for Forward Dynamics 10

Figure 4 Puma and Pr2 Robot while following figure 8 trajectory 14

Figure 5 Puma Robot Torque Error while following Circle & Figure 8trajectory

15

Figure 6 Pr2 Robot Torque Error while following Circle & Figure 8trajectory

16

Figure 7 Puma Robot Torque Root Mean Square Error in Circle & fig-ure 8 with varying amplitude at Link 1,2,3,4

17

Figure 8 Puma Robot Torque Root Mean Square Error in Circle & fig-ure 8 with varying frequency at Link 1,2,3,4

18

Figure 9 Pr2 Robot Torque Root Mean Square Error in Circle & figure8 with varying amplitude at Link 1,2,3,4

19

Figure 10 Pr2 Robot Torque Root Mean Square Error in Circle & figure8 with varying frequency at Link 1,2,3,4

20

Figure 11 Puma Acceleration Torque Error while following Circle & fig-ure 8 trajectory

22

Figure 12 Pr2 Acceleration Torque Error while following Circle & figure8 trajectory

23

Figure 13 Puma Robot Acceleration Root Mean Square Error in Circle& figure 8 with varying amplitude at Link 1,2,3,4

24

Figure 14 Puma Robot Acceleration Root Mean Square Error in Circle& figure 8 with varying amplitude at Link 1,2,3,4

25

Implementation of Robot dynamics with Standard Control Library

Figure 15 Pr2 Robot Acceleration Root Mean Square Error in Circle & fig-ure 8 with varying amplitude at Link 1,2,3,4

26

Figure 16 Pr2 Robot Acceleration Root Mean Square Error in Circle & fig-ure 8 with varying amplitude at Link 1,2,3,4

27

Figure 17 Time Chart showing time taken by CRBA/ABA at Different tra-jectories for Puma Robot

28

Figure 18 Time Chart showing time taken by CRBA/ABA at Different tra-jectories for Pr2 Robot

28

LIST OF TABLES

Table 1 Difference between 3-D Vectors and 6-D Vectors 6

Table 2 Analysis Table for Newton Euler Recursive Algorithm 21

Table 3 Time Taken by CRBA & ABA while following Trajectories Circle& Figure 8

28

Table 4 Analysis Table for Composite Rigid Body Algorithm & ArticulatedBody Algorithm

29

Implementation of Robot dynamics with Standard Control Library

1 INTRODUCTION

In this chapter we introduce our project topic. This chapter gives the reader the basicidea about the given topic and consists of objective, motivation, problem definitionand structure of report documentation.

1.1 TOPIC

Implementation of Robot Dynamics with Standard Control Library.

1.2 OVERVIEW

Robot dynamics determines the correlation between the force acting on the robot andthe acceleration they produce. There are many problems in robot dynamics whichare described as follows:

1. Forward dynamics: Given the forces, find out the accelerations.2. Inverse dynamics: Given the accelerations, find out the forces.3. Hybrid dynamics: Given the forces of some joints and accelerations of someother joints, find out the unknown forces and acceleration.

Rigid body has 6 degrees of freedom so why should not use 6-D vector for describingthe motion and force acting upon the rigid body?

6-D vector come in various forms just like screws, twists etc. but here we are onlyconcerned with spatial vectors. The main advantage of using 6-D vector is that itsolves the problem more quickly, in fewer steps, implementation is easy, result iscompact and lesser number of lines of code required.

In this project we will try to analyze spatial vector that helps in simplifying the dy-namics of rigid body system. To analyze it in detail, a model-based inverse dynamicscalculation using recursive Newton-Euler algorithm is implemented and results areanalyzed using 3-D vectors.

Further two main recursive algorithms for forward dynamics: the composite rigidbody algorithm and the articulated body algorithm is implemented and analyze itwith 3-D vectors algorithm.

1

Implementation of Robot dynamics with Standard Control Library

1.3 OBJECTIVE

Our objective for this project is, “To implement the three cutting edge algorithmusing 6-D vectors with Standard Control Library and analyze it so that user get anidea where it fails and what are its drawbacks and try to analyze the problem thatmay occur while implementing on neuromorphic chipset.”

To analyze its behavior, we are trying to follow the different trajectories forRobot Puma and Pr2 at different frequencies and amplitude.

So, we have divide our objective in two parts: first related to inverse dynamicsand second to forward dynamcis. In the first part, we will analyze Newton EulerAlgorithm and in the second part we will try to analyze Composite Rigid BodyAlgorithm and Articulated Body Algorithm.

1.4 MOTIVATION

Computers have entered the age when it is able to learn from their own mistakes.Several developments have been made in this regard but the new computing ap-proach is based on the biological nervous system which specifies how neurons in-teract with other neurons and react towards stimulus but the main problem with it isthat it required several megawatts of power as compare to 20 watts of power used bythe actual brain.

In this project we are trying to control the robot with neuromorphic chipset thatmimic the million neurons but the main challenge is to implement the dynamic al-gorithm on neuromorphic chipset.

To implement these algorithm using 3-D vector in not possible, hence 6-D vectorcome in picture but analysis of all the 3 algorithm is still not done. So, in this projectwe are trying to implement these algorithms: Newton Euler Recursive Algorithm,Composite Rigid Body Algorithm and Articulated Body Algorithm in Standard Con-trol Library and analyze it so that we will get an idea where it fails and what are itsdrawbacks and try to analyze the problem that may occur while implementing onneuromorphic chipset.

All the above facts give us the motivation to implement these algorithms and analyzeit in details.

2

Implementation of Robot dynamics with Standard Control Library

1.5 PROBLEM DEFINITION

In this project, we are implementing the three cutting edge algorithms usingStandard Control Library and analyze the performance and stability of all these al-gorithms.We are trying to analyze it so that we will get an idea where it fails and whatare its drawbacks and try to analyze the problem that may occur while implementingon neuromorphic chipset.

1) Newton Euler Recursive Algorithm2) Composite Rigid Body Algorithm3) Articulated Body Algorithm

In this Project, we are trying to analyze it on the points described as follows:

• Run-time as a function of input size•Worst Case scenario• Best Case scenario•Most complex robot whose dynamics we can compute in real-time.• Conditions at which algorithms start pooping out.• Compare the consummation of the algorithms.

1.6 SCOPE

As we know, computers have entered the age when it is able to learn from theirown mistakes. Several developments have been made in this regard and for which wehave come across 6-D vectors implementation and in this project topic, we discussthe scope of the project which are given as follows:

1. The new computing approach is based on the biological nervous system whichspecifies how neurons interact with other neurons and react towards stimulus to in-terpret information but the main problem is that it required several megawatts powerin comparison to 20 watts of power used by the biological brain. Using 6-D vectorswe can compute it in real time.

2. Once these neuromorphic chips are built, it will help in removing the saturationof Moose law that is going to come within 3-4 years.

3. Since all these algorithms are not implemented and analyzed under different con-ditions, it will help people to know what are the pros and cons of all the 3 algorithmwhile implementing in real time robot.

3

Implementation of Robot dynamics with Standard Control Library

1.7 STRUCTURE OF REPORT

The remainder of the report consists of various chapters which are given asfollows:

Chapter 2 literature Survey provides the detail description of 3-D vectors and6-D vectors, to solve our problem. Then the most appropriate vector is used to solvethe problem we have.

Chapter 3 Methodolgy It gives implementation details of the solution of ourproblem.

Chapter 4 Results and Analysis It gives implementation details of the solutionof our problem.

Chapter 5 Conclusion and Future Work gives the conclusion of project andsuggest some future enhancements to it.

Appendix A References contains the list of papers, books or online resourceswe have referred in our project report.

1.8 SUMMARY

The driving reasons behind this project have been described in this chapter.Next chapter explains the reason for selecting 6-D vectors for our solution and thenillustrates the part related to spatial vector system.

4

Implementation of Robot dynamics with Standard Control Library

2 LITERATURE SURVEY

This chapter provides detailed description of 3-D vectors and 6-D vectors, to solveour problem. Then the most appropriate vector is used to solve the problem we have.

As stated earlier, our problem requires real time implementation of robot dy-namics on neuromorphic chipset for a solution. There are two types of vectors de-fined for robot dynamics: 3-D vector and 6-D vector which are presented as follows:

2.1 3-D Vectors

3-D are set of three mutually orthogonal unit vectors. They are used to representthe quantities that has magnitude and possess direction. We can define any point inthe universe with position vector consist of three mutually orthogonal unit vectors,but we need reference point for defining it.

P =

px

py

pz

P point in space is define using three position vectors px, py&pz.But this doesn’t sol-ve our problem, we also need to define orientation of the vector. Let us suppose thepoint is located between the fingers of the hand, complete orientation of the hand isnot described because we can oriented our hand in any manner keeping the points

between the fingers. To describe the orientation, we will attach a frame to the bodyand then give describe of this frame with respect to reference frame.

2.2 6-D Vectors

6-D vectors are used to describe the motion and the forces acting upon the rigid bodysystem. 6-D vectors are normally considered as ordered pair of two 3-D vector but 6-D vector does not take into account the reference point. The main advantage of using6-D vector is that it solves the problem more quickly, in fewer steps, implementationis easy, result is compact and lesser number of line of codes required.

5

Implementation of Robot dynamics with Standard Control Library

S.No. 3-D Vectors 6-D Vectors

1. Define various points in space. No need to define points in space.

2. Quantities and equation need tobe transferred from one referenceframe to another. A poor choice ofreference points can lead to a com-plicated solution procedure to evenmore complicated.

Absence of Reference points is thekey feature.

Table 1:Difference between 3-D Vectors & 6-D Vectors

2.3 Spatial Vectors

Let us suppose that particle P is moving in a 3-D space with velocity v, in Euclideanspace it suggests that v is a velocity whose magnitude and velocity matches with thespeed and direction of P. Again suppose that rigid body B is moving with velocity v,it suggests that v M6, but how it defines the motion without using a reference point?

6-D vector come in various forms just like screws. Consider screw theory, there arethree quantities that describe the motion of the rigid body- linear magnitude, angularmagnitude and directed line. Two quantities describe the pace at which body isrotating and translating along the directed line. If linear magnitude is zero, then it’sa pure rotational motion and if angular magnitude is zero, then it’s a pure translationmotion along a directed line. That’s why reference point is not needed. Similarly wecan explained the force vectors comprising of couple force and general force alonga directed line.

2.3.1 Spatial Vectors Rules [6]

There are some rules that describe the formulas for the spatial vectors.

1. Action And Reaction: If a body a exerts a force f on body b, then body b exertsequal and opposite force f on body a.This is called Newton’s third law for spatialvectors.

2. Summation of Forces: If two forces f1 and f2 are acting on the same body, then the

6

Implementation of Robot dynamics with Standard Control Library

equivalent force ftot = f1 + f2.

3. Power : If a force f is applied on a body moves with velocity v, power = f.v .4. Inertia: If body a and body b are connected to form complex rigid body havinginertias I1and I2, then the inertia of complex body is Ttot = I1 + I2.

5. Momentum: If a body of inertia I is moving with velocity v, then the momentumof body is Iv.

2.4 SUMMARY

This chapter provides the detailed description of 3-D vectors and 6-D vectorsand has explained the reasons for selecting 6-D vectors.In next chapter we discussthe methodology for the given problem.

7

Implementation of Robot dynamics with Standard Control Library

3 METHODOLGY

In this chapter we are going to discuss our methodology for the given problem.Firstwe give and explain the suitable flow chart proposed for the problem. Then we dis-cuss about all the three algorithms: Newton Euler Recursive Algorithm, CompositeRigid Body Algorithm and Articulated Body Algorithm.

3.1 PROPOSED APPROACH

Following figure 1 represents the approach for the solution of our problem.

Figure 1: Proposed Approach for the solution

As explained in chapter 1, we need high degree of spatial vector system to solveour problem. To analyze the condition at which system fails and its drawbacks, wepropose the above approach for the problem.

8

Implementation of Robot dynamics with Standard Control Library

3.2 DETAILS OF APPROACH

The details of different parts in our approach are as follows:

3.2.1 SPECS

Specs contains the information of each link which are describe as follows:

1. Position in parent: Integer array describing the parent position of joint withineach body.

2. Orientation in parent: Integer array describing the parent orientation of jointwithin each body.

3. Mass of the link: Integer array containing the mass of each link.

4. Centre of mass position: Integer array describing the centre of mass position ofeach joint.

5. Joint limit: Integer array describing the limit of each joint. If revolute joint, itdescribe the rotation limit that is allowed for the joint.

6. Joint type: Integer array describing the joint type, whether joint is revolute,prismatic or helical.

7. Inertia Matrix: Integer array containing the spatial inertias of each link withineach body.

3.2.2 SPATIAL VECTOR SYSTEM

Spatial Vector System is a system define for the robot dynamic. It consist of twoparts: Forward Dynamics and Inverse Dynamics. Inverse Dynamics uses NewtonEuler Recursive Algorithm and its class diagram is describe in fig 2.

9

Implementation of Robot dynamics with Standard Control Library

Figure 2: Spatial Vector System for Inverse Dynamics

Forward Dynamics uses two algorithms: Composite Rigid Body Algorithm and Ar-ticulated Body Algorithm and its class diagram is describe in fig 3.

Figure 3: Spatial Vector System for Forward Dynamics

These classes are describe as follows:

10

Implementation of Robot dynamics with Standard Control Library

3.2.2.1 MODEL DATA STRUCTURE

Model data structure contains the following information which is describe as fol-lows:

1. model.N: Total number of bodies in the rigid body system.2. model.parent: An array containing the parent of the ithlink.3. model.Xtree: an array of transformation matrix of the joints within each body.4. model.pitch: an array describing the type of joint.5. model.I: an array of spatial inertias.

3.2.2.2 CONNECTIVITY

Connectivity of a rigid body system is represented through unidirected graph andthe numbering is done as follows:1. Fixed base is given the number 0.2. Remaining bodies are number accordingly from 1 to N such that parent of allbodies have less number as compared to their children in the rigid body system.

0 < λ(i)< i ∀1≤ i≤ N3. Joints are numbered such that ith joint joins between body i ad its parent.

3.2.2.3 NEWTON EULER RECURSIVE ALGORITHM

It solves the inverse dynamics problem (Given the accelerations, find out the forces).Algorithm is defined as follows:

vi = vp(i)+ siq̇i

ai = ap(i)+ siq̈i + viXsiq̇i

fBi = Iiai + vix∗Iivi

fJi = fBi +∑ j∈c(i) fJi

τi = sTi fJi

1. Velocity across joint i depends upon the sum of velocities of its parent and its ownvelocity.2. Acceleration across joint i depends upon the sum of accelerations of its parentand its own acceleration.3. fBi is the total force acting on a body i. fJi is the force transmitted from jointλ(i) to i. Thus, + f Ji act on body i and− f Ji act on body λ(i).

11

Implementation of Robot dynamics with Standard Control Library

3.2.2.4 COMPOSITE RIGID BODY ALGORITHM

It solves the forward dynamics problem (Given the forces, find out the acceleration).Equation of motion for rigid body system is describe as follows:

τ = Hq̈+C

where H is the joint space Inertia matrix and C is a matrix describing the Centrifugal,Coriolis and gravitational forces.C can be calculated by making the joint acceleration vector to be zero.Algorithm is described as follows:

Ici = Ii +

iX∗j Icj

jXi

λ( j) fi =λ( j)X∗j

j fi

Hi j =

j f T

i s j if i ∈ v( j)

H ji if j ∈ v(i)

0 otherwise

3.2.2.5 ARTICULATED BODY ALGORITHM

It solves the forward dynamics problem but its complexity is O (n). As we know thatacceleration of bodies in rigid body system is linear function of forces applied.

fi = IAi ai + pA

i

where IAi and pA

i , are articulated body inertia and bias force.

fi− f j = Iiai + pi

f j = IAj a j + pA

j

a j = ai + c j + s jq̈ j

τ j = sTj f j

pi = viX∗Iivi

c j = v jXs jq̇ j

12

Implementation of Robot dynamics with Standard Control Library

3.3 LANGUAGE TOOLS, LIBRARY AND TECHNIQUES USED

This topic cover the language tools, library and techniques usedto solve ourproblem are as follows:

3.3.1 Ubuntu 11.04:

3.3.1.1 Processor: 2.6 GHz Intel Pentium IV or equivalent

3.3.1.2 Memory: 6 GB

3.3.1.3 Graphic Card: 1 GB

3.3.1.4 Disk space: 2 GB of free disk space

3.3.2 Language Used: C++

3.3.3 Libraries Used: Standard Control Library, Eigen, Standard Template Library

3.4 SUMMARY

In this chapter we have proposed our approach to obtain our objective of prob-lem which contains proposed architecture and class diagram of the spatial vectorsystem. It has two parts: in the first part, we have given the the details of implemen-tation of inverse dynamics system to calculate the torques from given accelerations.In second part we have given the details about how we have implemented the for-ward dynamics system to calculate the joint accelerations from given joint torques.In the next chapter we will present and discuss the results obtained from our solution.

13

Implementation of Robot dynamics with Standard Control Library

4 RESULTS AND ANALYSIS

In this chapter we will discuss about the results obtained from our solution. It isdiscussed in two sections: First section gives and discusses the results related toInverse Dynamics and the second section provides ad analyzes results obtained fromforward dynamics.

4.1 RESULTS OF INVERSE DYNAMICS ALGORITHM

In our solution we have used Newton Euler Recursive Algorithm for inversedynamics problem (Given the joint accelerations, obtain the joint torques). We tryto follow the Circle and Figure 8 trajectories for Puma and PR2 robot by varyingamplitude and frequencies. Puma and Pr2 robot is shown in fig 4 while followingtrajectory 8.

(a) Puma Robot (b) Pr2 Robot

Figure 4: Puma & Pr2 Robot while following Trajectory 8

4.1.1 TORQUE ERROR

For Torque Error, we have calculated the difference between torque value atdifferent joints (predicted value and the actual value). Though there are 6 links inPuma robot and 20 links in PR2 robot but due to lack of space, we are showing only1 link for each robot.

fig 5 shows the torque error plot for Puma robot while following trajectoriescircle and figure 8 by varying amplitude from 0.2 to 0.5 and frequency from 2 to 5.

14

Implementation of Robot dynamics with Standard Control Library

Figure 5: Puma Robot Torque Error while following Circle & Figure 8 trajectory

Plot of link 1 of Puma Robot while following Circle and Figure 8 trajectoryshows that with increase in amplitude, error increase and error is too large for am-plitude 0.5 because it is out of reachable workspace (i.e it becomes unstable at thatmoment).

15

Implementation of Robot dynamics with Standard Control Library

fig 6 shows the torque error plot for Pr2 robot while following trajectories circleand figure 8 by varying amplitude from 0.2 to 0.5 and frequency from 2 to 5.

Figure 6: Pr2 Robot Torque Error while following Circle & figure 8 trajectory.

Plot of link 1 of Pr2 Robot while following Circle and Figure 8 trajectory showsthat with increase in amplitude, error increase and error is too large for amplitude 0.5because it is out of reachable workspace (i.e it becomes unstable at that moment).

16

Implementation of Robot dynamics with Standard Control Library

4.1.2 TORQUE ROOT MEAN SQUARE ERROR

For Torque Root Mean Square Error, we have calculated the root mean squareerror between the torque value at different joints (predicted value and the actualvalue) by varying the amplitude and frequency while following the circle and figure8 trajectory.

fig 7 shows the torque root mean square error plot for Puma robot from link 1to 4 while following circle and figure 8 trajectories by varying amplitude from 0.2to 0.5 while fixing frequency at 2.

Figure 7: Puma Robot Torque Root Mean Square Error in Circle & figure 8 with varyingamplitude at Link 1,2,3,4.

Plot of Puma Robot while following circle and figure 8 trajectory shows thatwith increase in amplitude, root mean square error increases but it’s too low that itcan be neglected.

17

Implementation of Robot dynamics with Standard Control Library

fig 8 shows the torque root mean square error plot for Puma robot from link 1to 4 while following circle and figure 8 trajectories by varying frequencies from 2 to5 while fixing amplitude at 2.

Figure 8: Puma Robot Torque Root Mean Square Error in Circle & figure 8 with varyingFrequency at Link 1,2,3,4.

Plot of Puma Robot while following circle and figure 8 trajectory shows thatwith increase in frequency, root mean square error increases but it’s too low that itcan be neglected.

18

Implementation of Robot dynamics with Standard Control Library

fig 9 shows the torque root mean square error plot for Pr2 robot from link 1 to4 while following circle and figure 8 trajectories by varying amplitude from 0.2 to0.5 while fixing frequency at 2.

Figure 9: Pr2 Robot Torque Root Mean Square Error in Circle & figure 8 with varying ampli-tude at Link 1,2,3,4.

Plot of Pr2 Robot while following circle and figure 8 trajectory shows that withincrease in amplitude, root mean square error increases but it’s too low that it can beneglected.

19

Implementation of Robot dynamics with Standard Control Library

fig 10 shows the torque root mean square error plot for Pr2 robot from link 1 to4 while following circle and figure 8 trajectories by varying frequencies from 2 to 5while fixing amplitude at 2.

Figure 10: Pr2 Robot Torque Root Mean Square Error in Circle & figure 8 with varying fre-quency at Link 1,2,3,4.

Plot of Pr2 Robot while following circle and figure 8 trajectory shows that withincrease in frequency, root mean square error increases but it’s too low that it can beneglected.

20

Implementation of Robot dynamics with Standard Control Library

4.2 ANALYSIS OF INVERSE DYNAMICS ALGORITHM

We performed the steps for analyzing the Newton Euler Recursive Algorithmusing 6-D Vectors as discuss in topic 4.1. Table 2 shows the analysis of the NewtonEuler Recursive Algorithm which shows complexity, best case scenario, worst casescenario, condition at which algorithm start crapping out and complex robot whosedynamics we can compute in real time.

1. Complexity O(n)

2. Best Case Scenario Low Amplitude and Frequency fortrajectory generation.

3. Worst Case Scenario High Amplitude and Frequencyfor trajectory generation.

4. Condition at which algorithmstart crapping out

Reaches out of work space.

5. Complex Robot whose dynam-ics, compute in real time

Pr2 robot (since consist of 20links).

Table 2:Analysis Table for Newton Euler Recursive Algorithm

4.3 RESULTS OF FORWARD DYNAMICS ALGORITHM

In our solution we have used Composite Rigid Body Algorithm and ArticulatedBody Algorithm for inverse dynamics problem (Given the joint torques, obtain thejoint accelerations). We try to follow the Circle and Figure 8 trajectories for Pumaand PR2 robot by varying amplitude and frequencies.

4.3.1 ACCELERATION ERROR

For Acceleration Error, we have calculated the difference between accelerationvalue at different joints (predicted value and the actual value). Though there are6 links in Puma robot and 20 links in PR2 robot but due to lack of space, we areshowing only 1 link for each robot.

21

Implementation of Robot dynamics with Standard Control Library

fig 11 shows the acceleration error plot for Puma robot while following trajec-tories circle and figure 8 by varying amplitude from 0.2 to 0.5 and frequency from 2to 5.

Figure 11: Puma Robot Acceleration Error while following Circle & figure 8 trajectory

Plot of link 1 of Puma Robot while following Circle and Figure 8 trajectoryshows that with increase in amplitude, error increase and error is too large for am-plitude 0.5 because it is out of reachable workspace (i.e it becomes unstable at thatmoment).

22

Implementation of Robot dynamics with Standard Control Library

fig 12 shows the acceleration error plot for Pr2 robot while following trajecto-ries circle and figure 8 by varying amplitude from 0.2 to 0.5 and frequency from 2to 5.

Figure 12: Pr2 Acceleration Torque Error while following Circle & figure 8 trajectory

Plot of link 1 of Pr2 Robot while following Circle and Figure 8 trajectory showsthat with increase in amplitude, error increase and error is too large for amplitude 0.5because it is out of reachable workspace (i.e it becomes unstable at that moment).

23

Implementation of Robot dynamics with Standard Control Library

4.3.2 ACCELERATION ROOT MEAN SQUARE ERROR

For Acceleration Root Mean Square Error, we have calculated the root meansquare error between the acceleration value at different joints (predicted value andthe actual value) by varying the amplitude and frequency while following the circleand figure 8 trajectory.

fig 13 shows the acceleration root mean square error plot for Puma robot fromlink 1 to 4 while following circle and figure 8 trajectories by varying amplitude from0.2 to 0.5 while fixing frequency at 2.

Figure 13: Puma Robot Acceleration Root Mean Square Error in Circle & figure 8 with varyingamplitude at Link 1,2,3,4

Plot of Puma Robot while following circle and figure 8 trajectory shows thatwith increase in amplitude, root mean square error increases but it’s too low that itcan be neglected.

24

Implementation of Robot dynamics with Standard Control Library

fig 14 shows the acceleration root mean square error plot for Puma robot fromlink 1 to 4 while following circle and figure 8 trajectories by varying frequenciesfrom 2 to 5 while fixing amplitude at 2.

Figure 14: Puma Robot Acceleration Root Mean Square Error in Circle & figure 8 with varyingFrequency at Link 1,2,3,4

Plot of Puma Robot while following circle and figure 8 trajectory shows thatwith increase in frequency, root mean square error increases but it’s too low that itcan be neglected.

25

Implementation of Robot dynamics with Standard Control Library

fig 15 shows the acceleration root mean square error plot for Pr2 robot fromlink 1 to 4 while following circle and figure 8 trajectories by varying amplitude from0.2 to 0.5 while fixing frequency at 2.

Figure 15: Pr2 Robot Acceleration Root Mean Square Error in Circle & figure 8 with varyingamplitude at Link 1,2,3,4.

Plot of Pr2 Robot while following circle and figure 8 trajectory shows that withincrease in amplitude, root mean square error increases but it’s too low that it can beneglected.

26

Implementation of Robot dynamics with Standard Control Library

fig 16 shows the acceleration root mean square error plot for Pr2 robot fromlink 1 to 4 while following circle and figure 8 trajectories by varying frequenciesfrom 2 to 5 while fixing amplitude at 2.

Figure 16: Pr2 Robot Acceleration Root Mean Square Error in Circle & figure 8 with varyingfrequency at Link 1,2,3,4.

Plot of Pr2 Robot while following circle and figure 8 trajectory shows that withincrease in frequency, root mean square error increases but it’s too low that it can beneglected.

27

Implementation of Robot dynamics with Standard Control Library

4.3.3 TIME TAKEN

Table 3 shows the time taken by Composite Rigid Body Algorithm and Artic-ulated Body Algorithm for Puma and Pr2 robot while following the different trajec-tories.

S.No. TrajectoryPuma Pr2

CRBA ABA CRBA ABA

1. Circle 0.9482 1.2793 0.8021 0.878

2. Figure 8 1.9156 2.5915 1.6747 1.8181

3. Ellipse 0.948 1.3089 0.7986 0.8893

4. Square 1.2565 1.6581 2.3873 2.5808

Table 3:Time Taken by CRBA & ABA while following Trajectories Circle &Figure 8

Figure 6,7 shows the comparison between the time taken taken by CRBA andABA algorithm for Puma and Pr2 robot while following different trajectories.

Figure 17: Time Chart showing time taken by CRBA/ABA at Different Trajectories for PumaRobot

Figure 18: Time Chart showing time taken by CRBA/ABA At Different Trajectories for Pr2Robot

28

Implementation of Robot dynamics with Standard Control Library

4.4 ANALYSIS OF FORWARD DYNAMICS ALGORITHM

We performed the steps for analyzing the Composite Rigid Body Algorithmand Articulated Body Algorithm using 6-D Vectors as discuss in topic 4.3. Table 3shows the analysis of the Composite Rigid Body Algorithm and Articulated BodyAlgorithm which shows complexity, best case scenario, worst case scenario, condi-tion at which algorithm start crapping out and complex robot whose dynamics wecan compute in real time.

S.No. Criterion Composite RigidBody Algorithm

Articulated Body Al-gorithm

1. Complexity O(n2) O(n)

2. Best Case Scenario Low Amplitude andFrequency for trajec-tory generation.

Low Amplitude andFrequency for trajec-tory generation.

3. Worst Case Scenario High Amplitude andFrequency for trajec-tory generation.

High Amplitude andFrequency for trajec-tory generation.

4. Condition at whichalgorithm start crap-ping out

Reaches out of workspace.

Reaches out of workspace.

5. Complex Robotwhose dynamics,compute in real time

Pr2 robot (since con-sist of 20 links).

Pr2 robot (since con-sist of 20 links).

Table 4:Analysis Table for Composite Rigid Body Algorithm & ArticulatedBody Algorithm

4.5 SUMMARY

In this chapter we have given and explained the results the results which weobtained from our analysis on forward dynamics and inverse dynamics. Next chapterwill conclude the result and dscuss the scope for future enhancements.

29

Implementation of Robot dynamics with Standard Control Library

5 CONCLUSION AND FUTURE WORK

5.1 CONCLUSION

In our project topic we addressed two problems. The first is related to inversedynamics problem and second is related to forward dynamics using 6-D vectors.

As the explanation and comparison of different available vectors suitable forour problem suggests, we can conclude that 6-D vectors can solve the addressedproblem. Analysis shows that it fails only when manipulator reaches out of reach-able work space and its best for low amplitude and low frequency while followingtrajectories.

5.2 FUTURE WORK

We have done our analysis for Puma and Pr2 robot. In future similar analysiscan be done for Stanbot, Bot-R6 and Bot-RPP robot for more different trajectories.

30

Implementation of Robot dynamics with Standard Control Library

Appendix A: References

[1] R. S. Ball, A Treatise on the Theory of Screws. London: Cambridge Univ.Press,1900 (Republished in 1998).

[2] E. J. Baker and K. Wohlhart, Motor Calculus: A New Theoretical Device forMechanics (Transl. of [10] and [11]). Graz, Austria: Institute for Mechanics, TUGraz, 1996.

[3] L. Brand, Vector and Tensor Analysis, 4th ed. New York: Wiley, 1953.

[4] R. Featherstone, Robot Dynamics Algorithms. Boston: Kluwer, 1987.

[5] R. Featherstone, “The acceleration vector of a rigid body,” Int. J. Robot. Res.,vol. 20, no. 11, pp. 841–846, 2001.

[6] R. Featherstone, “Plucker basis vectors,” in Proc. IEEE Int. Conf. Robotics andAutomation, Orlando, FL, May 15–19, 2006, pp. 1892–1897.

[7] R. Featherstone, Rigid Body Dynamics Algorithms. New York: Springer- Ver-lag, 2008.

[8] R. Featherstone andD. E.Orin, “Dynamics,” in Springer Handbook of Robotics,B. Siciliano andO. Khatib, Eds. Berlin: Springer-Verlag, 2008, pp. 35–65.

[9] R. Featherstone. (2010). Spatial vector algebra [Online]. Available: http://users.cecs.anu.edu.au/ roy/spatial/

[10] R. von Mises, “Motorrechnung, ein neues Hilfsmittel der Mechanik [MotorCalculus: a new Theoretical Device for Mechanics],” Zeitschrift fur AngewandteMathematik und Mechanik, vol. 4, no. 2, pp. 155–181, 1924.

[11] J. J. Craig, Introduction to Robotics: Mechanics and Control, 3rd ed. UpperSaddle River, NJ: Pearson Prentice Hall, 2005.

[12] R. Featherstone, “Efficient factorization of the joint space inertia matrix forbranched kinematic trees,” Int. J. Robot. Res., vol. 24, no. 6, pp. 487–500, 2005.

[13] R. Featherstone and D. E. Orin, “Dynamics,” Springer Handbook of Robotics,B. Siciliano and O. Khatib, Eds. Berlin: Springer-Verlag, 2008, pp. 35–65.

31

Implementation of Robot dynamics with Standard Control Library

[14] R. Featherstone, “A beginner’s guide to 6-D vectors (part 1),” IEEE Robot.Automat. Mag., vol. 17, no. 3, pp. 83–94, 2010.

32