**Limbi Spring 2019**

**Inverse Kinematics – 2 Degrees of Freedom**

Author/s: Daniel Trejo (E&C)

# Introduction

Simply put, kinematics is the study of motion. Inverse and forward kinematics are mathematical processes used to determine motion and location. For our project we utilized forward and inverse kinematics to accomplish our mission objective. Specifically, it was used to accomplish the second and third steps of Test Plan 3 (TC-3), and requirement 2.1.5.2. These steps of the test plan and the requirement say that the Limbi should be able to move to the second module, and attach to it. Inverse Kinematics was our solution to move Limbi into the module with more precise movements since it allows us to move Limbi straight forward, backwards, left and right as opposed to rotating around a joint.

##### Basic Kinematics Definitions and Concepts

Before we get into the mathematics and core concepts of forward and inverse kinematics there are a couple words we must define.

Lets begin with a joint. A joint is an object that is connected to a rigid link. The joint has the ability to allow the link to rotate around it. Joints are also referred to as degrees of freedom (DOF).

Many joints joined together by links is called an articulated body. An example of this is the human body. For example, your shoulder (a joint) connects to your upper arm (a link), which connects to your elbow (a joint), which connects to your forearm (a link), and so on. So therefore, your whole body is an articulated body made up of joints and links.

Two other important words we need to learn are root joint and end effector. If we are using the arm as an example again, and if we assume that the rest of your body is in a fixed position and not moving, the shoulder becomes the root joint since it is the root of all movement, and your finger tips become the end effector, or the farthest position of the most outward link.

However, using the body as an example becomes very complicated with forward/inverse kinematics because the more degrees of freedom an articulated body has, the more complicated the math becomes. So from this point forward we will be using Limbi as our example. Limbi has 4 DOF, and 5 links. All movement of Limbi is limited to a 2D, X,Y plane. Below is a simplified image of Limbi.

Even though Limbi has 4 DOF, Limbi was split in two sides as can be seen above and the kinematics operations are ever only performed on one side at a time. Lets assume this side is side 1. This causes the forward/inverse kinematics to be on only 2 DOF (Joint 1 and Joint 2). In this case, the root joint becomes Joint 2, and the end effector becomes the end of the most outbound link connected to Joint 1.

## Forward Kinematics

Now that we have a basic understanding of the words and definitions used in kinematics, we can begin understanding forward and inverse kinematics.

For our application, forward kinematics is the mathematical process used to determine the position of the end effector. This is done using basic trigonometry, where the angles of the joints and the lengths of the links are used to solve the end effector position.

For our project, since we are using a robot with 2 DOF in the XY plane, we have a set up as the one below.

Where Phi is the angle of our joint 1 (middle joint 1), theta is the angle of joint 2, L1 is the length of the link connected to Joint 2, and L2 is the length of the link connected to Joint 1. If we place Limbi in the XY plane, we get what is pictured below in Figure 4. As we can see from below, Joint 2 will always be placed at the point (0,0), and is our point of reference. From that point, using forward kinematics, we can determine an XY position for the end effector.

Using forward kinematics we get the two equations below:

These two equations give us the end effector position using the angles and lengths of our structure.

## Inverse Kinematics

Finally, after all the reading and investigating we can finally jump into the interesting and useful stuff—Inverse Kinematics. Inverse kinematics is exactly the opposite of forward kinematics. In inverse kinematics we have a desired X and Y position for the end effector, and using the given lengths of the links we find the angles of each joint necessary to achieve that positioning.

This type of mathematics is very useful, but also complicated. In forward kinematics, the process was very simple because there will ever only be one answer. However, in inverse kinematics there can be multiple solutions to one problem or there could even be no solution if the desired point is out of the reach of the links.

Inverse kinematics is out of the scope of this class, but I can provide you with the equations that we used for Limbi.

In these equations, x and y are the desired coordinates. Phi is the angle calculated for Joint 2 and Theta is the angle calculated for Joint 1.

# Conclusion

Inverse kinematics and forward kinematics are very useful types of math with many applications, however the complexity of the kinematics equations depends on a case to case basis. The first resource I have linked proved to be very useful for me and even contains an excel spreadsheet that can help you simulate forward and inverse kinematics. If you are interested in this subject I would recommend doing further research as well as reading the first reference I linked.

# References/Resources

- http://www.societyofrobots.com/robot_arm_tutorial.shtml
- https://medium.com/unity3danimation/overview-of-inverse-kinematics-9769a43ba956