Many robotic and mechanical systems require the calculation of kinematic equations to express the relationship between variables that are to be controlled (motor/actuator position obtained via feedback sensors and manipulated by motors/actuators) and variables that are to be commanded, such as the position of a tool tip or objective.

Two types – inverse and forward kinematic equations – are required to employ such systems. Inverse kinematics provides solutions to the following situation: if one knows the desired values for commanded variables, what should the corresponding controlled variables be? Conversely, forward kinematics determine what the commanded variables should be if the controlled variables are known.

To get a good idea of what kinematic equations are, a simple example gives some insight to a complicated hexapod system, such as a 6 DOF Stewart Platform Hexapod. Suppose a system comprises an XY motor stage, and on the XY stage is a rotary motor that controls the angle of a tool (T) with length (from the rotation pivot)L.

The user will want to control the angle T, and the location of the tool tip in the XY plane (xT,yT). These are the commanded variables. The controlled variables are the angle T, and the motor positions XM and YM. The inverse kinematic equation for this system will tell us what should the controlled variables be for a desired set of commanded variables. Often, inverse kinematic equations are less difficult to obtain than their forward counterparts, and for many systems they are discussed and solved first. Then, the forward equations are solved by inverting the inverse equations, either directly or via an iterative step approach (the Hexapod uses the latter). Here, both forward and inverse equations are directly obtainable, and the inverse equations are shown in Equation 1:

Equation 1:

I1 (XT ,YT ,T)=(XM,YM,T)

XM = XT -Lcos(T)

YM = YT -Lsin(T)

T=T

From the equation, it is obvious that there are 3 equations comprising the inverse kinematics, although the last equation (T=T) is redundant. In this system, determining the forward kinematic equations is straightforward and can be done by inspecting the system, or by inverting the equations of (1). The solution to the forward kinematic equations is shown in Equation 2.

F1 (XM, YM, T) = (XT, YT, T)

XT = XM + Lcos (T)

YT = YM + Lsin (T)

T = T

For this system, both the forward and inverse kinematic equations were easily obtained in closed-form solutions. For many systems including the 6 DOF Hexapod, this is not necessarily the case.

#### Inverse Kinematics

For the Hexapod parallel manipulator, there are 6 individual linear motors controlling the length of 6 legs. Each of these legs is connected to a base structure, and a platform structure. The inverse kinematic equations for this system tell the user: Given a desired platform position (x, y, z, roll(α), pitch (β), and yaw (γ)), what should the lengths of the six legs be?

After bypassing some geometry and algebra, the inverse kinematics equations can be simply written as a vector function I2, which takes six “commanded” variables as inputs, and produces six “controlled” variables as a result:

I2 (x, y, z, α, β, γ)= (l1, l2, l3, l4, l5, l6)

For the 6 DOF hexapod, this is in fact a closed-form solution. So, to command the hexapod to move to a certain value, one must compute the inverse kinematics to find the corresponding values, and then command the legs to move to those positions. This seems pretty easy so far, but how should one command the motors to get to positions? One cannot simply set the commanded (reference) positions to l1, l2, l3, l4, l5, l6, or else the motor will instantaneously try to jump to this position. Instead, motion trajectories must be generated for each of the leg motors. Calculating forward and reverse kinematics enables accurate generation of motion control profiles to regulate robots and other mechanical systems. To do this, one can use software such as ACS Motion Control’s SPiiPlus controller software to implement kinematic equations to control the hexapod. Through the software’s CONNECT function, users can direct the “commanded” variables and the inverse kinematics calculation and CONNECT function will automatically move the motors accordingly. This allows profiles to be generated for all six axes.

One of the controller’s program buffers is needed to continuously calculate the inverse kinematic equations, whose arguments are updated every controller cycle by the MPU. This is because the motion profile generated by the MPU is in terms of commanded variables and servo needs to be given its commands in terms of the controlled variables. The CONNECT function does not need to be executed every cycle, since the controller automatically evaluates its argument every cycle.

The inverse kinematics buffer starts by defining all of the x, y, and z positions of the base and platform joints. Then, the initial logical axis (APOS) and physical axis (RPOS) variables are set (where the motors are known to be at their starting positions), after which the first calculation of the inverse kinematics is done. Then, the CONNECT function is issued for all axes, and the loop is entered, which continuously calculates the inverse kinematics and corresponding leg lengths that are used by the CONNECT functions.

Using inverse kinematics as described above, it is possible to send commands in terms of commanded variables and let the servo algorithm work in terms of controlled variables. But once the user commands a move, how does he/she know what is actually happening in terms of the commanded variables? Or, if the axis is disabled, how does the user know the positions of the commanded variables?

A specific example regarding the hexapod would be the following: A user disables the hexapod at a certain position. After some time, the user wishes to know: what are values of the commanded variables? Have they changed since disabling the motors at the last commanded position? In this situation, it is likely that the legs have moved some amount, even though the user has not commanded any movement.

Solving this problem requires forward kinematic equations. Simply put, the forward kinematics equations tell the user: what are the values of the commanded variables, given the values of the controlled variables. For the hexapod application, forward kinematics tells the user the position of the platform given the lengths of the legs. Just as we did for the inverse kinematic equation, the forward kinematic equation can be written mathematically as a vector function F2:

F2 (l1, l2, l3, l4, l5, l6 )= (x, y, z, α, β, γ)

For the hexapod in this application, there is not a closed form solution to this problem that is practical for real-time execution. Instead, the solution is most readily obtained by performing an iterative process involving estimating the solution, evaluating the estimation, forming a new estimation, evaluating the new estimation, and so on until the estimation is below some error threshold. This iterative process is also done in one of the controller’s program buffers.

For both forward and inverse kinematics, the ACS SPiiPlus controller can be used to calculate the values of both the commanded and controlled variables. 