# Emergent Behavior based Limb Control using the Repulsive Root Technique DOI : http://dx.doi.org/10.17577/IJERTV8IS110133 Text Only Version

#### Emergent Behavior based Limb Control using the Repulsive Root Technique

Patrick McDowell, Kuo-Pao Yang Department of Computer Science Southeastern Louisiana University Hammond, LA 70402 USA

Abstract The goal of this work was to create a method of controlling multiple joint arms that is adaptable to varying conditions over time. The method uses a combination of techniques; initially it uses emergent behavior, each segment acting independently, from which the functionality of the arm emerges. In order to reach targets at all points within the reach of the limb a "repulsive root" technique was employed. This paper details algebraic forms of solving for the limb segment angles for 2 and 3 degree of freedom arms, references the Jacobian Inverse technique, and then introduces the repulsive root technique. The system was tested in simulation using C/C++ and OpenGL; results are discussed. This method is not meant to be the final solution to the problem, but instead an exploration technique that provides data to an opportunistic learning system.

Keywords- Robot Kinematics; Emergent Behavior; Repulsive Root Technique

The following definitions and equations describe the locations of the relevant parts of the 2 DOF arm in a inverse kinematics situation. This situation is very important because it tells what 1 and 2 need to be for a desired end effectors position (P3).

1. INTRODUCTION

Robotic limbs are common in both mobile robots and in assembly robots in manufacturing plants. To find the position of the end effector of the arm, forward kinematics  is used. To determine the joint angles needed to put the end effector in some desired position, inverse kinematics  is used. For limbs with 2 or 3 degrees of freedom, there are algebraic/trigonometric solutions that are fairly straight forward. For arms with more than 3 degrees the inverse jacobian  is used along often in combination with a stepwise numerical solution.

One of the problems that occurs with these solution methods is that as the number of joints increases, the solution gets more and more complex. Part of this is because that each new joint introduces the possibility of having alternate solutions to the problem. Fig. 1 below illustrates the problem. As can be seen, the end effector can be placed at position P3 two different ways. For each new degree of freedom added to the limb this problem is compounded.

The following section briefly details the algebra of a 2- degree of freedom (DOF) solution. The location of P1 will be assumed to be (0,0), and the lengths of the segments, and the angles between the segments are known. Using these values, the locations of the ends of the segments, P2 and P3 can be calculated using forward kinematics as is shown below.

P2x = L1cos 1 P = L sin

Fig. 1. This figure shows that for the arm to reach point P3 there are two different solutions.

Two important formulas that will be used to algebraically solve these equations will be the Law of Sins and Law of Cosines. They are stated below:

Law of Sins:

a = b = c [see Fig. 2 below] sin(A) sin(B) sin(C)

D = tan-1( P3y – P1y )

P3x – P1x

c = (P3x – P1x)2 + (P3y – P1y)2

Law of Cosines:

a2 = b2 + c2 – 2bc cosA

rearranging we get:

A = cos-1 ( b2 + c2 – a2 )

2bc

a = c

sin(A) sin(C)

C = sin-1( sin(A)c )

2y 1 1

a

P3x = L1cos 1 + L1cos (1 + 2) P3y = L1sin 1 + L1sin (1 + 2)

Total Angle = D + A

Or

Total Angle = D – A

Inverse

x = x L3cos x = 1 1cos(90) x = 1

y = y L3sin y = 2 1sin(90) y = 1

(x, y) = (1, 1)

= tan-1(-y'/x' 2 +y' 2 / x'/x' 2 +y' 2)

_ _

Fig. 2. This figure shows a triangle outlining the 2DOF inverse kinematic solution. Side b and c represent the robot arm segment lengths.

Algebraic solutions for the forward and inverse kinematics

= tan-1(-1/2 / 1/2) = tan-1(-1)

= -45

1 = + cos-1 (

2 2 2

2 2 2

– (x' 2 + y'2 + L1 2 – L2 ) / (- 2L1x') + (- 2L1y') )

of a 3 DOF arm are somewhat similar to those described in the previous paragraphs. The difference is that the algebra gets more complex. In this section we show a numeric example for

1 = -45 Â± cos-1 ( – (12 + 1

_

2 + 12 – 12) / ( 2(1) 12 + 12)

the 3 DOF arm, but do not show all of the details of the solution .

Fig. 3. This figure shows a 3 degree of freedom arm with the end effector at coordinates (1, 2).

Looking to Fig. 3, it can be seen that the end effector is located at P4 at position (1, 2). Since the end effector is pointing straight up, = 90. In this example, we will use the given angles and segment lengths to find the position of the end effector using forward kinematics. Then we will use the position of the end effector, the angle of the end effector and the lengths of the segments to find angles between the segments, inverse kinematics.

Forward

x = L1cos 1 + L2cos(1 + 2) + L3cos(1 + 2 + 3) x = cos(90) + cos(90 + 270) + cos(90 + 270 + 90)

x = 1

y = L1sin1 + L2sin (1 + 2) + L3sin (1 + 2 + 3) y = sin (90) + sin (90 + 270) + sin (90 + 270 +90)

y = 2

P4 = (1, 2)

1 = -45 Â± cos-1(-2/22)

1 = -45 Â± 135

1 = 90 or -180

Select 90 based on the diagram in Fig. 3. 1 = 90

2 = tan-1( (y – L1sin1)/L2 / (x – L1cos1)/L2) – 1 2 = tan-1(0/ 1) 90

2 = 0 90

2 = -90 or 270

Looking at the diagram in Fig. 3, either solution will work, we select 270.

3 = (1 + 2)

3 = 90 (90 + 270)

3 = 90 360

3 = 90 0

3 = 90

The above discussion has shown how to find the solution to problems in which the limb/robotic arm has 2 or 3 degrees of freedom. The forward solutions to limbs with more degrees of freedom is straight forward, as follows:

x = L1cos 1 + L2cos(1 + 2) + L3cos(1 + 2 + 3)

……… Lncos(1 + 2 + n-1 + n)

y = L1sin1 + L2sin (1 + 2) + L3sin (1 + 2 + 3)

……… Lnsin(1 + 2 + n-1 + n)

But, when more degrees of freedom are used in the inverse solution, a method relying on the Inverse Jacobian matrix is used . While it allows for more flexibility in the numbers of degrees of freedom that it offers, it is a more complex procedure. As stated before the complexity of the matrix, and its solution grows with each added segment and joint in the limb.

The next section describes a simple emergent behavior based algorithm that iteratively find a solution to the problem . It is relatively low in computational costs, and is effective.

2. APPROACH

When high numbers of segments are used in limbs, traditional control methods relying upon algebraic/Jacoby Inverse become complex and CPU intense operations. The method described here takes its inspiration from biology; the thinking is that animals with multi-segmented or highly flexible limbs, whether vertebrate or invertebrate, do not somehow do formal inverse kinematics in their brains in order to control their limbs.

Instead, it is proposed that they use a combination of memory and exploration. The thrust of this work is in exploration. Put another way, in order to effectively control a multi-jointed limb, a memory bank of positions is built using exploration. This memory bank can then be used as a basis for controlling the limb without having to do the exploration. For example, if the limb must be moved to a point that has been previously visited, the memory ca be accessed based on the location, and the needed joint angles can be accessed and delivered to the limbs actuator controllers. If the point has not been visited, several approaches can be taken, including the following:

• Nearest neighbor. The limb can be moved directly to the nearest previously explored point, and then the exploration routine can be started from there.

• The memory bank can be used by a concurrently running learning system that learns by generating a function based on the contents of the memory. Neural networks are a strong candidate for this method.

The algorithm developed for this work is emergent behavior based, meaning that during exploration each limb segment acts on its own to reach the target position. Initially, stage 1 of the exploration, we let each joint act independently in order to reach the target. Each joint independently seeks out the target position using a pair of left and right proximity sensors, see Fig. 4. To move towards the target, the segment adjusts its angle towards the sensor which detects the highest target strength. The effect is that the arm will smoothly move towards the target, if, and only if the target is not close to the base of the arm.

Target positions that are close to the base of the arm require the arm to contort itself into positions that require some joints to head away from the object and some to head towards the object. In order to solve this aspect of the problem we introduce the idea of the "repulsive root".

This idea is for when the target is within the perimeter of the total length of the segments. Once the stage one emergent behavior converges, starting at the lowest segment (it's base or "root"), segments are switched to moving away from the target, instead of to it. Using this strategy, a bend in the arm can be formed, and the bend will be smooth because the lowest segments will be repulsed one by one until the target is reached. Remember that while the lower segments are moving away from the target, the upper segments will be moving towards it.

Fig. 4. This figure illustrates the basic components of the smart limb. Each segment of the limb has its own proximity sensors for detecting the target. Each segment acts in a semi-autonomous fashion in that they all try to get as close to the target as possible, with no inter-segment communication.

3. IMPLEMENTATION AND TESTING

To test the algorithm, a program was written in C/C++ and OpenGL graphics. The arms are instantiated as objects in which the number of segments is an input parameter. The control techniques tested were algebraic (using the previously discussed methods), a table based learning technique in which a two jointed arm goes through a learning stage that populates a lookup table based on location, stage1 of the emergent behavior exploration technique, and finally the emergent behavior technique paired with the repulsive root. Fig. 5 below shows a 30-link arm touching its target (the red dot).

Fig. 5. This figure shows the simulation of a 30-link limb touching its target (the red dot). Note the dots on the left and right side of the multi-colored limb. These dots are the location of the proximity sensors. Looking at the script in the upper right of the screen shot, it can noted that the last segment, number 29 of 0 – 29, is very close to the target, indicated by the distance of 0.08.

Fig. 6 below shows two 10-link arms meeting at the target.

Fig. 6. Two 10-link arms meeting at the target. The target is the red dot.

During the simulation, the target is controlled by the mouse.

The simulation is set up so the mouse controls the targets location, leading to the limbs chasing the target about the screen.

4. RESULTS AND CONCLUSIONS

The simulation results are promising. The arm or arms find their way to the target reliably. Because this technique is iterative, vs. the analytical techniques discussed in the background section, the computation costs are low. While there are multitudes of ways that a 30 joint arm can touch a given target location, the repulsive root technique does not consider them, it only knows if it has reached the target, or if it needs to keep iterating towards it. Because of this, the algorithmic complexity is reduced when compared to a more traditional technique such as the Jacobian Inverse.

Although it was not an expressed goal of the work, the algorithm produces an almost life like movement of the limbs in the simulation. With more polish, this system may be useful in animation work.

Finally, this work is not meant to be the final algorithm of the control system. Instead it is meant to be a flexible exploration algorithm that feeds data to the learning system, which in turn develops the control function/algorithm.

REFERENCES

1. V. Gupta, R. Chittawadigi, and S. Saha, RoboAnalyzer: Robot Visualization Software for Robot Technicians, Proceedings of the Advances in Robotics (AIR '17), Article No. 26, 2017.

2. K. Erleben, S. Andrews, Inverse Kinematics Problems with Exact Hessian Matrices, Proceedings of the Tenth International Conference on Motion in Games (MIG '17), Article No. 14, 2017.

3. P. Harish, M. Mahmudi, B. Callennec, and R. Boulic, Parallel Inverse Kinematics for Multithreaded Architectures, ACM Transactions on Graphics (TOG), 35(2): Article No. 19, 2016.

4. N. Jaiswal, V. Kumar, Comparison between Conventional PID and Fuzzy PID Supervisor for 3-DOF Scara type Robot Manipulator, 2014 IEEE Students' Conference on Electrical, Electronics and Computer Science, DOI: 10.1109/SCEECS.2014.6804431, 2014.

5. Q. Jiang, and V. Kumar, "The Inverse Kinematics of 3-D Towing," Advances in Robot Kinematics, Ed. Lenarcic, J., Stanisic, M.M., Springer, pp. 321-328, 2010.

6. I. Chavdarov, R. Trifonov, G. Pavlova, and D. Budakova, Manipulability and Kinematic Dependences of a Leg of the Six- Legged Robot, Proceedings of the 19th International Conference on Computer Systems and Technologies (CompSysTech'18), pp. 116 119, 2018.

7. C. Szabo, and Y. Teo, An Objective-Based Approach for Semantic Validation of Emergence in Component-Based Simulation Models, Proceedings of the 2012 ACM/IEEE/SCS 26th Workshop on Principles of Advanced and Distributed Simulation (PADS '12), pp. 155 162, 2012.