Robot Inverse Kinematics

This inverse kinematic solver is only included in realvirtual.io Professional.

With inverse kinematics you can control robots with the toolcenter position (TCP). The possible solutions to reach the toolcenter positions are calculated by the inverse kinematics.

With inverse kinematics, a robot can move along a path in point to point mode (PTP) or in a linear motion.

The Robot IK is located in this directory Assets/realvirtual/Professional/IK. Here you also find two demo scenes. The main demo scene can be also opened by selecting Additional demos > Robot Inverse Kinematic

Limitations

  • Inverse kinematics can only be used for standard 6-axis industrial robots.

  • Only robots that can align the TCP, Axis6, 5 and 4 on a straight line are possible.

  • Only linear accelarations are possible, smooth (sinoide) accelarations of robot axis are currently not supported.

  • It is necessary that the positions of the robot axes can be defined by the following parameters:

Robot Preparation

The robot must be prepared for inverse kinematics taking into account the following things:

  • The zero point of the robot must have the Unity X axis aligned forward, Z upward, and Y to the left (in the following picture you see an additional right handed coirdinate system - which is normally used in industrial robotis - Unity’s coordinate system is left handed)

  • The RobotIK script itself must be connected to the game object in the zero point.

  • The first rotation axis must also be at the zero point.

  • All other axes must not be rotated with respect to the zero point (i.e. again X to the front, Z to the top and Y to the left)

  • The TCP (standard TCP as well as possibly own shifted TCPs for tools) must also have Z aligned to the top, Y to the left and X to the front in the stretched position).

  • On each Axis a Drive needs to be attached. For the drive limits and accelarations needs to be defined. The upper and lower limits are considered for calculating the possible solutions

  • All 6 axis needs to be assigned in the Axis list in RobotIK.

Calculating the kinematic parameters

Calculating the kinematic parameters needs to be done once when the robot is prepared. All parameters (a1,a2,b,c1,c2,c3,c4) which are shown in the picture above are automatically calculated und used later on for calculating the inverse kinematic solutions. Before calculating the parameters you also need to define in which position the robot is in editor mode. If the Elbow is oriented in Unity X-Direction you need to select Elbow in Unity X. Activate "Do not follow in Edit Mode" to override the parameterv "Follow in Edit Mode" at all current Target positions. After everything is prepared Calc Kinematic Parameters can be pushed and you will see all parameters in the RobotIK inspector window.

Defining Pathes

Robot paths are defined by lining up targets. A target is the alignment of the robot’s TCP at a defined position. Robot paths and targets must be created under the RobotIK script (the robot’s zero point) as a child game object.

To create a path, an empty gameobject must first be created and an IKPath script added. New targets can be added in the IKPath Inspector window by pushing Add new target. As soon as a target is active, the robot will also follow in the editor to the defined position. If this is not reachable, then a red sphere appears around the target.

If the path is activated, all targets below the path can be moved in the editor window. If the CTRL key is held down, the targets can be rotated.

The secuence of the pathes can be arranged by changing the order in the target list.

Axis correction

In some situations it might happen, that an axis is missallgined by 360 degrees. If you are using PTP movements you can use the Axis correction values to set the Axis positions for the defined target to a manually corrected value:

Turn correction

In some special cases it might happens, that IK calculation is returning axis 4 and 6, each of them turned 180 degrees to much (which is 360 degrees together). If you turn on Turn correction in the case of a sum of 360 of axis 3 and 5 on both axis the value is corrected by -180 degrees.

Position correction

When working with large robots, the inverse kinematics (IK) system may experience some inaccuracies in positioning. To address this, a correction value can be applied to improve accuracy. This value is calculated by comparing the desired tool center point (TCP) position, as defined by the target, with the actual TCP position. To apply the correction, the user must manually press the "Set Correction" button within the Target interface. The correction value can be removed by pressing the "Clear Correction" button.

Path Properties

Speed Override

Override Speed between 0 and 1 to slow down the path. Standard is 1.

Set new TCP

Optional. Sets a new TCP for the robot which is used for the path

Draw Path

Draws the path as a sequence of lines in editor window. Linear movements are drawn in green, PTP movements in yellow.

Draw Targets

Draws the targets in editor window. Targets can be moved by the handles. With pressed CTRL they can be rotated.

Path

Sequence of targets.

Signal Start

A PLCOutput signal for starting the Path.

Start

Starts the path directly at simulation start.

Loop Path

Starts the path again as soon as the path is ended.

Signal is Started

A PLCInput signal when the Path is started.

Signal Ended

A PLCInput signal when the Path has ended.

Start Next Path

A Pointer to the next path which can be started after this path.

Targets

Targets are the desitination points in pathes. Within the target several parameters of the destination are controlled

Target Properties

Right Handed Robot Corrdinates

(Readonly) The position of the target in right handed coordinate system.

Speed to Target

The speed to the target. If set to 1 all axis are driving with the maximum speed (on PTP) or the given linear speed (on Linear Interpolation).

Linear Acceleration

Only applicable for Linear Move mode. The accelaration on the linear Path.

Interpolation to Target

The interpolation mode to the target.

Point to Point (PTP) All Axis will arrive at the same time at destination. The time is controlled by the axis which takes the longest time. The other axis acceleration is reduced so that they reach the target in the same time as the slowest axis. The movement of the TCP is in this case non linear and can not be controlled.

Point to Point unsynced Same as above but all axis drive with maximmum speed and reach the destination at different times.

Linear Linear Movement between the two Targets with the given linear accelaration and linear speed.

Linear Speed to Target

The linear speed to the target for Linear Interpolation.

Wait for Seconds

The robot waits for the defined time after reaching the target.

Solution

Slider for selecting one of the 8 possible solutions. Maybe not all solutions are possible.

Solutions

An overview over all solutions (different positions of the robot axis) to reach the target. Some of the solutions might not be possible.

Axis Pos

The Axis positions (rotations) for the selected solutions.

Reachable

True, if the Point is reachable with the selected solution.

© 2022 in2Sight GmbH https://realvirtual.io - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.

Last updated