Welcome to a somewhat unorthodox post about a project that I've been working on: A Peg Solitaire-playing delta-robot. This is a hobby-project that I've been tinkering with in my spare time for a while now, and I've finally gotten the robot to work, so without further ado, let me introduce Peggy:

I'm a programmer by heart and love card games, which is why I created Online Solitaire and recently bought World of Card Games, but I also love tinkering with physical things, such as robots. I've designed, built, and programmed this robot from scratch, and it's without a doubt my biggest project to date. There's still a lot of potential for optimizations on the robot, but it works!

I expect this to be the first part in a series of posts where I'll go through a lot of details concerning the robot. I've put a lot of man-hours into the robot, so I hope that people who have an interest in tinkering with robots will benefit from my experiences building one.

So without further ado, let's begin at the beginning, which when creating a robot is all about the kinematic calculations. There are two types of kinematic calculations: forward kinematics and inverse kinematic. They each solve their own problem and have their own use case. This post will focus on the inverse kinematics.

The formula derived from the forward kinematic calculations can give the mobile base's position based on the actuators' angle. The mobile base is often referred to as the end effector as well, and it's where the grabbing mechanism is attached, which in this case is a suction cup. The forward kinematics can be used if corrections need to be made to the mobile base's position. For example, if a camera is used to determine the mobile base's real-life position, and it does not match the position from the kinematic calculations, the discrepancy can be determined, and corrections can be made in the robot's position.

The formula derived from the inverse kinematic calculations can give the angle of the actuators based on a given position in the x-y-z space. These calculations will form the basis for programming the movement of the robot.

Below, we'll go through the calculations for the inverse kinematics. Before we can do that, some definitions must be set for the lengths and angles that will be used in the calculations. These definitions can be seen in figure 1 below.

In figure 1, the stationary base and the mobile base are depicted as two equilateral triangles, both horizontal. Throughout the calculations, the length of the side of the stationary base (\(l_S\)), mobile base (\(l_M\)), and the length of the upper arm (\(r_O\)) and lower arm (\(r_U\)) will be used. The origin for the entire system is defined to be in the middle of the stationary base.

In figure 2, it can be seen that not all arms operate in the same plane, but that the lower arm can be offset from the plane that its corresponding upper arm is part of. This is because not all joints are of the same type. The stationary joint at the actuator (\(S_1\)) is a rotational joint that operates in the y-z plane, where it can (theoretically) rotate in a circle with the origin in \(S_1\) and a radius of \(r_O\). The elbow joint (\(A_1\)), on the other hand, is a universal joint, and so is the joint on the mobile base (\(M_1\)).

This means that \(r_U\) does not necessarily stick to a path in the y-z plane. Since both joints are universal joints and can therefore rotate freely, they can (theoretically) create a sphere with a center in \(M_1\) and a radius of \(r_U\). The intersection between this sphere and the y-z plane is indicated by \(M_1^{'}\), which serves as the origin in a circle with a radius of \(r_U^{'}\). Finally, the mobile base's origin is defined as \(M_0\) and the angle between the y-axis and \(r_U\) is defined as \(\theta_{1}\).

With all these definitions, it is now possible, using algebra, to find the point \(A_{1}\) as the intersection of two circles.

An illustration of the y-z plane can be seen in figure 3 below. \(A_1\) is the intersection point between the two aforementioned circles, so if point \(A_{1}\) is known, \(\theta_{1}\) can be calculated.

The distance between points \(M_0\) and \(M_1\) can now be found using Pythagoras. In figure 4, an illustration of the mobile base's x-y plane is seen.

The distance \(M_{0}M_{1}\) is be found to be:

\begin{align}

|M_{0}M_{1}| &= \dfrac {l_{M}}{2}\cdot \tan (30) = \dfrac {l_{M}}{2 \cdot \sqrt{3}}

\end{align}

The coordinate set for the points of the mobile base can now be found:

\begin{align}

M_{0} &=

\begin{bmatrix}

x_{0}

\\

y_{0}

\\

z_{0}

\end{bmatrix}

\\

M_{1} &=

\begin{bmatrix}

x_{0}

\\

y_{0} - \dfrac {l_{M}}{2 \cdot \sqrt{3}}

\\

z_{0}

\end{bmatrix}

\\

M_{1}^{'} &=

\begin{bmatrix}

0

\\

y_{0} - \dfrac {l_{M}}{2 \cdot \sqrt{3}}

\\

z_{0}

\end{bmatrix}

\end{align}

And the coordinate set for the points of the stationary base can be found:

\begin{align}

S_{1} &=

\begin{bmatrix}

0

\\

0-\dfrac {l_{S}}{2 \cdot \sqrt{3}}

\\

0

\end{bmatrix}

\end{align}

The length from point \(M_{1}^{'}\) to \(A_{1}\) can be calculated:

\begin{align}

|M_{1}^{'}A_{1}| &= r_{U}^{2} - x_{0}^{2}

\end{align}

Pythagorean theorem for right-angled triangles (\(a^{2} + b^{2} = c^{2}\)) can now be used for the two triangles formed by the upper and lower arms:

\begin{align}

r_{O}^2 &= (A_{y1} - S_{y1})^2 + (A_{z1} - S_{z1})^2

\\

r_{U}^{2} - x_{0}^{2} &= (A_{y1} - M_{y1}^{'})^2 + ( A_{z1} - M_{z1}^{'})^2

\end{align}

And if the known values are inserted:

\begin{align}

r_{O}^2 &= (A_{y1} + \dfrac {l_{S}}{2 \cdot \sqrt{3}})^2 + A_{z1}^2

\\

r_{U}^{2} - x_{0}^{2} &= (A_{y1} - y_{0} + \dfrac {l_{M}}{2 \cdot \sqrt{3}})^2 + (A_{z1} - z_{0})^2

\end{align}

In the above two equations, only \(A_{y1}\) and \(A_{z1}\) are unknown. We now have two equations with two unknowns, so a solution can be found. If solved symbolically, the solution looks very complex. However, all values are known, so in practice, it is not that complex. Based on the found variables, the coordinate set for \(A_{1}\) can be defined as:

\begin{align}

A_{1} &=

\begin{bmatrix}

0

\\

A_{y1}

\\

A_{z1}

\end{bmatrix}

\end{align}

It is now possible to find the angle \(\theta_{1}\) by using the inverse of the trigonometric functions:

\begin{align}

\theta_{1} &= \arctan\left(\dfrac{A_{z1}} {A_{y1}-S_{y1}}\right)

\end{align}

The above calculations can be reused to find \(\theta_{2}\) and \(\theta_{3}\). Since the robot is symmetrical, the x-y plane is simply rotated around the z-axis. This is done by defining a new \(x_{0}\) and \(y_{0}\), which are used in the calculations instead.

When this is done in the clockwise direction, the values for \(\theta_{2}\) can be defined as:

\begin{align}

x_{0}^{'} &= x_{0} \cdot cos(120) + y_{0} \cdot sin(120)

\\

y_{0}^{'} &= -x_{0} \cdot sin(120) + y_{0} \cdot cos(120)

\end{align}

The values for \(\theta_{3}\) can be defined as:

\begin{align}

x_{0}^{'} &= x_{0} \cdot cos(120) - y_{0} \cdot sin(120)

\\

y_{0}^{'} &= x_{0} \cdot sin(120) + y_{0} \cdot cos(120)

\end{align}

Now, by inserting the actual values for the robot, the mobile base can be moved to a specific location in the x-y-z space by giving it a coordinate.