UnderAutomation
Any question?

[email protected]

Contact us
UnderAutomation
⌘Q

Forward and inverse kinematics

Compute the flange position from joint angles, and every set of joint angles for a position, for 169 Yaskawa arms and cobots, offline on the PC.

  • What the kinematics do
  • Conventions
  • Forward kinematics
  • Inverse kinematics
  • Supported robots
  • Accuracy and speed
  • Reference
  • What to read next

This page explains the offline kinematics of the Yaskawa SDK: forward kinematics (joint angles to flange position) and inverse kinematics (flange position to every set of joint angles) of 6-axis Motoman arms and cobots. The computation runs on the PC, without a controller and without a connection, for 169 robot models.

What the kinematics do

FunctionInputOutput
KinematicsUtils.ForwardKinematicsJoint angles in degrees (S, L, U, R, B, T)Flange position: X, Y, Z in mm, Rx, Ry, Rz in degrees
KinematicsUtils.InverseKinematicsFlange positionEvery joint solution, up to 8 or 16

Both take the geometry of the robot as DhParameters: from the catalog of models, from the ALL.PRM file of the controller, or from your own values. See Kinematics models.

Use cases: check that a target can be reached before you send a move, choose the posture of a move, compute a position in a simulation or a planner, or compare a position read on the controller with a model.

Conventions

  • Joint angles are in degrees, with the signs of the pendant. They are not encoder pulses: the conversion from pulses depends on the robot and is not done by the SDK.
  • The Cartesian position is the flange (tool 0) in the robot frame. Add your tool yourself, with CartesianPosition.ToHomogeneousMatrix() and a matrix product.
  • The robot frame has its origin on the S axis, at the height of the L axis, X forward and Z up.
  • The angles follow the Yaskawa convention: the orientation matrix is R = Rz(Rz) * Ry(Ry) * Rx(Rx), the same as the pendant.
A GP7 at zero pulse, drawn from its DH parameters. The flange position given by ForwardKinematics for this pose is X = 560 mm, Z = 485 mm.A GP7 at zero pulse, drawn from its DH parameters. The flange position given by ForwardKinematics for this pose is X = 560 mm, Z = 485 mm.
A GP7 at zero pulse, drawn from its DH parameters. The flange position given by ForwardKinematics for this pose is X = 560 mm, Z = 485 mm.

Forward kinematics

ForwardKinematics(joints, dh) returns the flange position for a set of joint angles.

static void Main()
{
// Geometry of the robot model
DhParameters dh = DhParameters.FromArmKinematicModel(ArmKinematicModels.GP7);
// Joint angles in degrees (S, L, U, R, B, T), with the signs of the pendant
var joints = new JointsAngles(0, 0, 0, 0, -90, 0);
// Position of the flange in the robot frame: mm and degrees
CartesianPosition flange = KinematicsUtils.ForwardKinematics(joints, dh);
Console.WriteLine(flange); // X=480, Y=0, Z=405, Rx=-180, Ry=0, Rz=0: the flange points down
}
}
Click to see the full code

JointsAngles takes the 6 angles in its constructor, or an array. S, L, U, R, B, T and Values read and change them.

Inverse kinematics

InverseKinematics(position, dh) returns every set of joint angles that puts the flange at the position. The angles are in the range (-180, 180]. The array is empty when the position cannot be reached.

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

The joint limits of the robot are not checked: remove the solutions outside the limits of your robot, then choose one. See Inverse kinematics.

Supported robots

The SDK chooses the solver from the DH parameters:

KinematicsCategoryStructureModels of the catalogSolutions
OpwOrtho-parallel base, spherical wrist: the R, B and T axes meet (D5 = 0)157 (GP, MH, ES, AR, MotoMINI, HC20DT, HC30PL...)Up to 8
J5OffsetWristOrtho-parallel base, wrist offset along the B axis (D5 is not 0, A1 and A3 are 0)12 (HC10, HC10DT, HC20SDT...)Up to 16

These structures are not supported: T axis offset from the B axis (MA1400, MA1550, MA1800, MA1900), painting wrists with tilted axes (MPX2600, MPX3500), R axis parallel to the L and U axes (MPXL2600), palletizing robots, SCARA, delta and 7-axis robots. For them, InverseKinematics throws a NotSupportedException.

Accuracy and speed

  • Each solution is checked with the forward kinematics before it is returned: the error is below 0.00001 mm.
  • The catalog gives the nominal geometry of each model. The controller can use calibrated values: compare a few positions with your robot before you rely on an offline result.
  • The SDK is tested with poses measured on real GP7 and HC10 robots.
  • An inverse kinematics takes about 20 µs for a GP7 and 100 µs for an HC10 on a desktop PC: 10000 targets of a path are checked in a fraction of a second.

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
Class
CartesianPosition
C#Python

Cartesian position of the robot flange in the robot frame.

MemberTypeDescription
CartesianPosition()
Constructor
Initializes a new instance of CartesianPosition at the origin, with zero angles.
CartesianPosition(double, double, double, double, double, double)
Constructor
Initializes a new instance of CartesianPosition with the specified values.
  • x : X position (mm).
  • y : Y position (mm).
  • z : Z position (mm).
  • rx : Rotation around the X axis (degrees).
  • ry : Rotation around the Y axis (degrees).
  • rz : Rotation around the Z axis (degrees).
CartesianPosition(ICartesianPosition)
Constructor
Initializes a new instance of CartesianPosition by copying any Cartesian position, for example a position read from the robot.
  • position : The position to copy.
Rx
Property
double
Rotation around the X axis in degrees.
Ry
Property
double
Rotation around the Y axis in degrees.
Rz
Property
double
Rotation around the Z axis in degrees.
X
Property
double
X position in millimeters.
Y
Property
double
Y position in millimeters.
Z
Property
double
Z position in millimeters.
FromHomogeneousMatrix(double[,])
Method
static
CartesianPosition
Creates a Cartesian position from a homogeneous matrix (3x4 or 4x4, translation in mm). When Ry is +90 or -90 degrees, Rx and Rz are not unique: Rz is set to 0.
  • matrix : Homogeneous matrix.
ToHomogeneousMatrix()
Method
double[,]
Returns the 4x4 homogeneous matrix of this position (rotation and translation in mm).
ToString()
Method
string
Enum
KinematicsCategory
C#Python

Kinematic structure of a 6-axis arm. It decides which inverse kinematics solver is used.

NameValueDescription
J5OffsetWrist
1
Ortho-parallel base with a wrist offset along the B axis (D5 is not 0): the R and T axes do not meet. Collaborative robots such as HC10, HC10DT, HC20SDT. Up to 16 inverse kinematics solutions.
Opw
0
Ortho-parallel base with a spherical wrist: the R, B and T axes meet at one point (D5 = 0). Most industrial arms (GP, MH, ES, HC20DT, HC30PL...). Up to 8 inverse kinematics solutions.

What to read next

  • Inverse kinematics: the solutions, the postures and how to choose one.
  • Kinematics models: DH parameters from the catalog, from the controller or from your values.

Easily integrate Universal Robots, Fanuc, Yaskawa, ABB or Staubli robots into your .NET, Python, LabVIEW or Matlab applications

UnderAutomation
Contact usLegal

© All rights reserved.