UnderAutomation
¿Una pregunta?

[email protected]

Contactos
UnderAutomation
⌘Q
Esta página solo está disponible en inglés.

Inverse kinematics solutions

Why a position has up to 8 or 16 joint solutions on a Yaskawa robot, what they look like, which positions are reachable, and how to choose a solution.

  • Several solutions for one position
  • Reachable positions
  • Choose a solution
  • Closest to the current position
  • Other criteria
  • Errors
  • Reference
  • What to read next

This page explains the inverse kinematics of the Yaskawa SDK in detail: why one position has several joint solutions, how the solutions of a GP7 and of an HC10 look, and how to choose the solution to send to the robot. The computation is offline and works for the 169 models of the catalog.

Several solutions for one position

A 6-axis arm reaches most positions with several postures. InverseKinematics returns all of them:

  • Front or back: the S axis turns the arm toward the target, or the opposite way and the arm reaches over its base.
  • Elbow up or elbow down: the U axis is above or below the line from the L axis to the wrist.
  • Wrist flip: the R axis turns by 180 degrees, the B axis changes its sign. The flange has the same position.

These 3 choices give up to 8 solutions for a robot with a spherical wrist (GP7, MH, ES...). The example of the snippet below gives 8 solutions for a GP7:

The 8 solutions of the GP7 for the target X=400 Y=100 Z=300 Rx=180 Ry=0 Rz=0, seen from the side of the arm. Each view holds 2 solutions that differ only by the wrist flip.The 8 solutions of the GP7 for the target X=400 Y=100 Z=300 Rx=180 Ry=0 Rz=0, seen from the side of the arm. Each view holds 2 solutions that differ only by the wrist flip.
The 8 solutions of the GP7 for the target X=400 Y=100 Z=300 Rx=180 Ry=0 Rz=0, seen from the side of the arm. Each view holds 2 solutions that differ only by the wrist flip.
static void Main()
{
DhParameters dh = DhParameters.FromArmKinematicModel(ArmKinematicModels.GP7);
// Flange position in the robot frame: mm and degrees
var target = new CartesianPosition(400, 100, 300, 180, 0, 0);
// Every joint solution, angles in (-180, 180]. Empty if the position cannot be reached.
JointsAngles[] solutions = KinematicsUtils.InverseKinematics(target, dh);
foreach (JointsAngles solution in solutions)
Console.WriteLine(solution); // S=..., L=..., U=..., R=..., B=..., T=...
}
}
Click to see the full code

A cobot with a wrist offset along the B axis (HC10, HC10DT, HC20SDT) has more solutions, up to 16, because the offset of the wrist adds other ways to place the arm.

Reachable positions

The number of solutions changes with the position. The map below counts the solutions in the vertical plane Y = 0, with the flange pointing down:

Number of solutions found by InverseKinematics in the plane Y = 0, flange pointing down. GP7 on the left, HC10 on the right. The offset wrist of the HC10 cannot put the flange on the S axis with this orientation.Number of solutions found by InverseKinematics in the plane Y = 0, flange pointing down. GP7 on the left, HC10 on the right. The offset wrist of the HC10 cannot put the flange on the S axis with this orientation.
Number of solutions found by InverseKinematics in the plane Y = 0, flange pointing down. GP7 on the left, HC10 on the right. The offset wrist of the HC10 cannot put the flange on the S axis with this orientation.
  • Outside the reach of the arm, the array is empty.
  • At the border of the reach, the elbow is straight and some solutions merge.
  • For the HC10, the flange cannot be on the S axis with the flange pointing down: the wrist offset of 162 mm keeps it away.

The joint limits are not applied: a part of these solutions is outside the limits of the real robot.

Choose a solution

Closest to the current position

To move the robot with the smallest joint motion, keep the solution closest to the current joint angles. The snippet below keeps the solution with the smallest largest joint move:

DhParameters dh = DhParameters.FromArmKinematicModel(ArmKinematicModels.GP7);
var target = new CartesianPosition(400, 100, 300, 180, 0, 0);
// The current joint angles of the robot, in degrees
var current = new JointsAngles(10, 20, -10, 0, -60, 0);
// Keep the solution with the smallest joint move
JointsAngles best = null;
double bestDistance = double.MaxValue;
foreach (JointsAngles solution in KinematicsUtils.InverseKinematics(target, dh))
{
double distance = 0;
for (int i = 0; i < 6; i++)
distance = Math.Max(distance, Math.Abs(solution.Values[i] - current.Values[i]));
if (distance < bestDistance)
{
best = solution;
bestDistance = distance;
}
}
Console.WriteLine(best == null ? "Not reachable" : $"{best}, largest joint move {bestDistance:F1} deg");
}
}
Click to see the full code

Other criteria

  • Joint limits: remove the solutions outside the limits of your robot (from its data sheet or from the soft limits of the controller).
  • Posture: keep the front and elbow up solutions to stay in the same posture along a path.
  • Wrist singularity: a B angle close to 0 makes the R and T axes aligned. Prefer the solutions far from it for linear moves.

Errors

  • InverseKinematics returns an empty array when the position cannot be reached. It does not throw.
  • It throws a NotSupportedException for a structure that is not supported. See Supported robots.
  • It throws an ArgumentNullException when the position or the parameters are null.

Reference

Class
KinematicsUtils
C#Python

Forward and inverse kinematics of 6-axis Yaskawa arms.

MemberTypeDescription
ForwardKinematics(IJointAngles, IDhParameters)
Method
static
CartesianPosition
Computes the flange position for the given joint angles.
  • joints : Joint angles in degrees (S, L, U, R, B, T), pendant signs.
  • parameters : DH parameters of the robot.
InverseKinematics(ICartesianPosition, IDhParameters)
Method
static
JointsAngles[]
Computes all the joint solutions that put the flange at the given position. Joint limits are not checked. Angles are returned in the range (-180, 180].
  • position : Flange position in the robot frame, for example a position read from the robot.
  • parameters : DH parameters of the robot.
Class
JointsAngles
C#Python

Joint angles of a 6-axis arm, in degrees, with the same signs as the pendant (axes S, L, U, R, B, T).

MemberTypeDescription
JointsAngles()
Constructor
Initializes a new instance of JointsAngles with all angles at 0.
JointsAngles(double, double, double, double, double, double)
Constructor
Initializes a new instance of JointsAngles with the specified angles (degrees).
  • s : S axis angle.
  • l : L axis angle.
  • u : U axis angle.
  • r : R axis angle.
  • b : B axis angle.
  • t : T axis angle.
JointsAngles(double[])
Constructor
Initializes a new instance of JointsAngles from an array of at least 6 angles (degrees). The array is copied.
  • values : Angles of axes S, L, U, R, B, T.
B
Property
double
B axis angle (degrees).
L
Property
double
L axis angle (degrees).
R
Property
double
R axis angle (degrees).
S
Property
double
S axis angle (degrees).
T
Property
double
T axis angle (degrees).
U
Property
double
U axis angle (degrees).
Values
Property
read only
double[]
Angles of axes S, L, U, R, B, T in degrees.
ToString()
Method
string

What to read next

  • Kinematics models: the DH parameters of your robot.
  • Move the robot from a PC: send the target to the robot.

Integre fácilmente robots Universal Robots, Fanuc, Yaskawa, ABB o Staubli en sus aplicaciones .NET, Python, LabVIEW o Matlab

UnderAutomation
ContactosLegal

© All rights reserved.