Animate robots with up to 6 rotary axes using RobotKinematicsV2 (from version 1.6)
Video: This video shows a six-axis robot animated with RobotKinematicsV2 that transports workpieces with a magnetic TCP between multiple predefined robot targets.
With the RobotKinematicsV2 skill, you can control articulated-arm robots with one to six rotary axes via PLC signals. (Linear or translational axes are not supported by this skill.) In this mode, the robot tool is moved to the desired position in space. The required joint angles for each rotary axis are calculated automatically.
What is an articulated-arm robot?
Articulated-arm robots (also known as jointed-arm robots) are industrial robots whose serial axes are connected by joints. They emulate the motion of a human arm and, with typically six degrees of freedom, provide high flexibility to reach any point in the working area in three dimensions. Three axes determine the position in space (X, Y, Z), and the other three axes determine the orientation of the tool (tilt, rotation, roll).
The RobotKinematicsV2 skill is intended for controlling a six-axis robot from the PLC program. The target position can be specified either by a program number and/or by Cartesian X, Y, and Z offsets. This skill is not a complete robot simulation and does not replace a real robot controller or commissioning process. It is particularly not suitable for checking whether a specific robot type reaches exactly the axis angles specified in the manufacturer data sheet at a given position. The purpose of the skill is the virtual validation of the PLC program and plant sequence. This allows you to test whether the robot, in interaction with sensors, actuators, and other plant components, reaches the intended positions and whether the programmed process runs correctly.
The skill requires:
- a fixed robot base,
- one to six rotary joints in a unique parent-child hierarchy,
- a TCP object at the last joint,
- optionally at least one robot target with a program number. Without defined robot targets, the robot can be moved from the home position using the offset values.
Important: PLC-Lab 3D Studio uses the object origins and local axes from Blender. Clean preparation of the model is therefore essential.
Summary for experienced users
Note: The Blender plugin (section Robot) from PLC-Lab 3D Studio greatly simplifies preparation. Information and download.
-
Import the robot model into Blender, scale it, and position it. The pose in Blender becomes the robot's home pose. This pose does not need to match the mechanical zero position from the manufacturer data sheet. STEP files can be converted into a Blender-compatible format via this URL: https://mhj.de/step2blender//
-
For each rotary joint, set the object origin to the mechanical axis of rotation and create a serial parent-child hierarchy from the fixed base to the last joint. The robot base is the parent object. Joint 1 is the child of the base, joint 2 is the child of joint 1, and so on. The TCP object is placed beneath the last joint. For the following axes, the reference is the local axis of the joint.
-
Assign the
{RobotKinematicsV2}skill to the base. Mark each joint with exactly one local axis tag ({x},{y}, or{z}). The direction is not relevant at this stage—only the axis itself. -
Create exactly one TCP object under the last joint with
{tcp}and a local direction tag ({x},{y},{z},{x-},{y-},{z-}). -
Create target positions using 3D objects (for example, a cone) as direct children of the base, align their local axes with the TCP, and assign unique tags such as
{RobotPos1},{RobotPos2}, ...{RobotPos1}can be reached via PrgNr1. -
Export the model with the PLC-Lab 3D Studio plugin as an FBX file. During this export, all 3D objects are automatically scaled to
1. Check the detected axes, joint limits, target positions, TCP direction, home pose, and motion parameters in PLC-Lab 3D Studio. Click the base with the mouse. The properties open. You can test the movements in demo mode. -
Control the robot from the PLC either via
PrgNr, offsets, and a start pulse, or via preconfigured waypoint programs. Use the rising edge ofReadyto confirm the completion of a movement.
In the image, the TCP (orange object) is a magnet that can grip the cubes. The 5 yellow objects are the robot targets.
Use the Blender plugin
| Blender-Plugin | Image |
|---|---|
![]() |
We have integrated new functions into the Blender plugin for PLC-Lab 3D Studio. This lets you define the axes, pivot points, TCP, and targets with minimal effort. Please install the plugin in Blender. Information and download. |
Useful Blender hotkeys
| Task | Input |
|---|---|
| Select object | Left mouse button |
| Select multiple objects | Shift + left mouse button |
| Select all | A |
| Move | G, then optionally X, Y, or Z |
| Rotate | R, then optionally X, Y, or Z |
| Rotate around a local axis | Set Transform Orientation to Local or press the axis twice, e.g. R, X, X |
| Scale | S |
| Enter an exact value | Start the operation, enter the value, press Enter, e.g. S, 1000, Enter |
| Duplicate | Shift + D |
| Set parent | First select the child, then select the parent while holding Shift, then press Ctrl + P → Object (Keep Transform) |
| Remove parent | Alt + P → Clear Parent (Keep Transform) |
| Apply transformation | Ctrl + A → Rotation & Scale or just Rotation |
| Sidebar with position and rotation | N |
| Add object | Shift + A |
| Search for command | F3 |
| Set object origin to 3D cursor | F3 → Origin to 3D Cursor |
You can find the Transform Orientation at the top of the 3D view. For joints, Local must be used.
This page as a YouTube video
Playing the video connects to YouTube (Google). No data is transferred until you click.
The following sections are a summary of the video. We recommend that you watch the video, as the individual steps are demonstrated in detail there.
Sections from the video:
Import a CAD file of a KUKA robot
Drag and drop the 3D model in Blender-compatible format into the software and confirm the import dialog. In most cases, the model is initially the wrong size or in the wrong position. Select the robot, then click Scale Robot 1m in the PLC-Lab 3D Studio plugin to adjust the size. If the robot is lying down, align it with the hotkeys R, X, and enter -90.
Remove unnecessary 3D objects from the robot
Select all objects, covers, or cables that should not be visible in the simulation and delete them with Del. To adjust the color of the remaining components, select the corresponding parts, then choose the robot base last (which carries the desired material) and transfer the color via Ctrl + L → Link Materials.
Simplify the mesh
Manufacturer models often contain many polygons and small details. Simplifying the mesh improves performance in PLC-Lab 3D Studio and speeds up scene loading.
Possible optimizations for the robot:
- Remove hoses, brackets, and invisible internal parts if they are not important for display.
- Delete geometry inside closed housings.
- Use the Limited Dissolve modifier and reduce the number of edges.
- Use the Decimate modifier (reduce mesh detail) and lower the value cautiously.
- Use Merge by Distance in Edit Mode to remove duplicate points.
- Reduce unnecessary materials (colors).
- Remove unused objects and materials.
Define colors
Material colors can be set via the PLC-Lab 3D Studio plugin. Existing image textures from the manufacturer model are not imported for performance reasons. Instead, use simple material colors from the PLC-Lab 3D Studio assets.
Insert the RobotKinematicsV2 skill at the robot base
Select the main base of the robot. In the PLC-Lab 3D Studio plugin, under the Skill Actuators section, click Robot Kinematics V2. The base object's name is automatically extended with the tag {RobotKinematicsV2}.
Configure robot axes and define the local rotation axis
Each rotary joint must be prepared individually. Isolate the corresponding joint in local view (key /). In Blender, change the orientation (transform orientation) to Local. Zoom in so the axis fills as much of the screen as possible. Click Try find Origin of Axis in the plugin (plugin section Robot). The algorithm searches for the circular geometry of the joint in the current view, sets the object origin precisely at the pivot center, and inserts the correct local axis tag (for example, {y} or {z}) into the object name. Repeat this process for all six axes. After this step, all axes are defined; the correct hierarchy of the axes must still be established. See the next section.
The skill determines the order of the joints from the hierarchy, not from names such as "Axis 1" or "Axis 2". The hierarchy is defined in the next section.
Define the axis hierarchy (parent-child relationships)
To ensure that the robot transmits motion correctly, a parent-child structure must be created: the base is the main parent (root) and parent of joint 1, joint 1 is parent of joint 2, and so on.
Select all subordinate components, select the parent joint last, and link them with Ctrl + P → Object (Keep Transform). Finally, verify with rotations (R + local axis) that all attached components are carried along correctly.
Base
└── Joint 1
└── Joint 2
└── Joint 3
└── Joint 4
└── Joint 5
└── Joint 6
└── TCP (gripper, magnet, or tool center point)Insert the TCP object
Select the last joint. In the plugin, click the function to insert a TCP object. A cube is generated and placed as a child of the last joint. Adjust its shape and scale as needed. This TCP defines the tool center point to which a gripper or magnet will later be mounted.
TCP stands for Tool Center Point. This is the tool center point that is later moved to the robot targets.
Examples:
- center point of a vacuum gripper,
- gripping point of a mechanical gripper,
- center point of a magnet,
- tool tip.
The TCP object must be a child of the last joint and must exist exactly once. The TCP object must be tagged with {tcp}. The corresponding direction tag (for example, {z}) can be found in the Blender plugin under Skill Modifiers → Reference Axis.
Examples:
Gripper_TCP {tcp}{z-}
Magnet_TCP {tcp}{y}For the TCP, the direction tag is important. It is used, among other things, for retraction before a target.
TCP origin and rotation:
The origin of the TCP object is the exact target position of the robot. You can also insert a small cube as a TCP object and place it as a child below the last joint. You can hide it in the simulation using {Hide}.
- Place the origin at the actual gripping point.
- Rotate the TCP object so the working direction points in the desired direction.
- Apply the rotation:
Ctrl+A→ Rotation. - The TCP object's rotation should then display as
0, 0, 0in Blender.
Example of the complete hierarchy
Example result:
Base {RobotKinematicsV2}
└── Joint 1 {y}
└── Joint 2 {z}
└── Joint 3 {y}
└── Joint 4 {z}
└── Joint 5 {x}
└── Joint 6 {z}
└── TCP {tcp} {z-}
Image: The robot hierarchy in Blender.
Define the home position and zero position
The pose exported from Blender becomes the robot's home position at the same time. Do not choose a random or fully extended pose. A fully extended posture (a so-called singularity) results in no unique mathematical solution for inverse kinematics. This can lead to uncontrollable or unexpected joint compensation movements during target-position calculations.
In PLC-Lab 3D Studio, the joint angle 0° corresponds to the pose set in Blender during export. This pose does not need to match the mechanical zero position from the manufacturer data sheet.
A recommended pose is one close to a robot target position. For example:
- a raised target position,
- a position near
{RobotPos?},
This starting pose helps the calculation algorithm. For the same TCP position, there are always several possible joint configurations. A sensible home pose reduces awkward joint rotations.
When the simulation switches to stop mode, the robot returns to this home position within one second.
Define robot targets and create teach points called "RobotPos"
Select the TCP object and click Insert Robot Pos Cone in the plugin. A cone is created representing the first target position ({RobotPos1}). Create as many copies as needed with Shift + D (for example, {RobotPos2}, {RobotPos3}) and position them in the virtual space (for example, above a conveyor belt). Ensure that all "RobotPos" objects are direct children of the robot base.
Each cone receives a unique program number:
{RobotPos1}
{RobotPos2}
{RobotPos3}Examples with additional text to make the targets easier to distinguish in the Blender scene:
Pick-up {RobotPos1}
Drop-off left {RobotPos2}
Drop-off right {RobotPos3}Rules:
- Each number may appear only once. The number can later be selected in the PLC via
PrgNr. - Each RobotPos cone must be a direct child of the robot base.
- RobotPos objects must not be located under a moving joint.
- All RobotPos objects therefore move together with a moving robot base.
Image: The yellow objects are the robot targets. Each target has the name {RobotPos[Nr]}.
Example hierarchy:
Base {RobotKinematicsV2}
├── Joint 1 {z}
│ └── ...
├── Pick-up {RobotPos1}
├── Drop-off left {RobotPos2}
└── Drop-off right {RobotPos3}Create a project folder, save the Blender file, and export FBX
Once the hierarchy, axes, TCP, targets, and home pose have been checked:
- Press
Ctrl + Sand create a new project folder on your hard drive. Save your Blender file (.blend) there. - Start the export function of the PLC-Lab 3D Studio plugin. The model, including its hierarchy, tags, and target positions, is exported as an FBX file into the project folder. During this process, all 3D objects are automatically scaled to
1.
The FBX file can now be opened in PLC-Lab 3D Studio.
Open the project in PLC-Lab 3D Studio and check RobotKinematicsV2
- Open the exported FBX file in PLC-Lab 3D Studio.
- Navigate to a clear view in which the entire robot and all target cones are clearly visible. Save this default view with
Shift+1as camera position 1. - Click the robot base. The settings for
RobotKinematicsV2should now appear in the properties window.
If no settings appear, check the tag {RobotKinematicsV2} on the base.
Image: Settings of the RobotKinematicsV2 skill in PLC-Lab 3D Studio. When the settings are opened, the joints are shown in different colors.
Check the detected axes
NumberOfAxes
This displays the number of detected joints. For a six-axis robot, this should normally be 6. An incorrect count usually indicates one of the following problems:
- A joint has no axis tag (
{x},{y}, or{z}). - A joint is not in the hierarchy.
- Several marked joints are on the same hierarchy level.
- The TCP was accidentally marked as a joint.
Check the joints in the Joints section
Settings are displayed for each detected joint.
Move each joint to the min and max positions using the buttons. Set sensible limits that match the mechanical limits of the robot. Angles are given in degrees. Enable UseLimits so the configured limits are considered.
Settings:
-
JointAxis: defined local rotation axis. -
UseLimits: enables angle limits. -
MinAngleDeg: smallest allowed angle in degrees. -
MaxAngleDeg: largest allowed angle in degrees.
Check:
-
Is the correct axis rotating?
-
Does it rotate around the correct origin?
-
Do all subsequent joints move with it?
-
Are the minimum and maximum values sensible?
Check target positions in the RobotTargets section
This lists the RobotPos targets defined in Blender if they were detected.
Check whether all targets you created in Blender appear here.
Use the button to drive the robot directly to this target in simulation stop mode. If the target is outside the reach range, all axes turn red. In that case, scale the robot larger in Blender or adjust the target position.
To scale the robot in Blender without scaling the target positions:
Hide all objects except the robot with H. In the N-panel under Tool, enable Parents. Then select all robot objects by dragging a selection box with the mouse, and scale them with S. After that, show the previously hidden objects again with Alt + H and disable Parents.
General settings in the RobotKinematicsV2 skill
FollowTargetRotation
Enable this setting if the robot should also adopt the rotation of the RobotPos cone in addition to its position. For pick-and-place tasks, this setting should normally be enabled.
Visual aids
-
ShowTargets: shows the robot targets. -
ShowTrail: shows the traveled path. -
ShowOperatingRange: shows the estimated working range of the robot. -
ShowPretargets: shows the prepositions for retraction. -
ShowWorkingHeight: shows the configured working height. -
ColorRobotAxisObjects: colors the objects of each axis differently.
If a target is not reachable, all axes of the robot turn red.
Movement section
DefaultDurationInSeconds
This value defines the normal travel time to a target and therefore the robot's speed. The time is specified in seconds. The value represents the duration of the full movement. The resulting speed depends on the distance to the target and the required joint movements.
Recommended starting value: 2 to 3 seconds.
UseCircularTrack
Enable this setting so the motion from the current target to the next target follows a circular path. The path is interpolated from the two positions (current position and target position) and the center point of the robot base. (Recommended)
PreMoveRetractionDistance
This value defines how far the TCP retracts initially along its working direction before switching to another target.
Example: 0.10 = 10 cm
This value is especially useful for grippers or magnets. It moves a workpiece away from the pick-up or drop-off point vertically before the actual motion. This option avoids the need to define additional RobotPos targets used only for retraction.
WorkingHeight
The working height (m) is used as the global Y-height above the origin of the robot base.
If a working height is set, the robot first moves to this height, travels to the next target area there, and then moves to the target.
Select a height at which the gripper clears conveyor belts, boxes, and other obstacles.
Recommendation: Use either WorkingHeight or PreMoveRetractionDistance, but not both at the same time.
DemoMode
DemoMode can only be used when simulation is paused.
When you activate the switch, the robot moves to the defined RobotTargets one after another in a loop.
Check whether all targets are reachable within the calculated workspace and the set joint angles. If a target is unreachable, the robot's axes turn red.
This allows you to quickly check:
- Target positions,
- target rotations,
- speed,
- joint limits,
- working height,
- retraction movements,
- circular paths.
When you turn off demo mode, the robot returns to the home position defined in Blender.
Controlling the Robot from the PLC Program
Option 1: Move to a target using a program number (PrgNr)
This option uses a program number (PrgNr) and optional Cartesian offsets.
Commands to the robot (PLC outputs)
| Property | Type | Function |
|---|---|---|
Enable |
BOOL | Enables the robot. |
Start |
BOOL | A rising edge starts the movement. |
Stop |
BOOL | Stops a current movement. |
PrgNr |
Integer | Number of the RobotPos target, for example 2 for {RobotPos2}. |
TargetOfsX |
Floating-point number | Offset in the global X direction in meters. Note: Refers to the rigid world coordinate system of the 3D scene. |
TargetOfsY |
Floating-point number | Offset in the global Y direction in meters. Refers to the world coordinate system. |
TargetOfsZ |
Floating-point number | Offset in the global Z direction in meters. Relates to the world coordinate system. |
Robot Sensors (PLC Inputs)
| Property | Type | Function |
|---|---|---|
Ready |
BOOL | The robot is ready for a new job. |
IsMoving |
BOOL | The robot is currently performing a movement. |
TargetOutOfRange |
BOOL | The desired position could not be reached. |
Procedure in the PLC Program
- Set
Enableto TRUE. (Can remain permanently TRUE by entering1in the Properties window.) - Enter the desired target number in
PrgNr. - If necessary, enter values in
TargetOfsX,TargetOfsY, andTargetOfsZif you also want to move the TCP in world coordinates. - Generate a rising edge at
Start. - A rising edge on
IsMovingindicates that the robot is moving toward the target. - A rising edge on
Readyindicates that the robot has reached the target.
Important: After starting, do not simply check the state of
Ready. The signal may still be TRUE from the previous movement. Since the PLC program and robot simulation run asynchronously,Readyonly becomes FALSE after the new movement starts and returns to TRUE after the target is reached. Therefore, evaluate the rising edge ofReady.
Typical Use of Offsets
Offsets are useful when many positions are arranged at regular intervals, for example:
- Compartments in a box,
- Positions on a pallet,
- Multiple storage locations with equal spacing.
In this case, a single RobotPos base target is sufficient. The exact compartment position is calculated using X, Y, and Z offsets.
Option 2: Navigating to Targets via Waypoints
With Waypoints, you can define a fixed sequence consisting of one or more RobotTargets.
This option is suitable for simpler PLC programming of the robot, since no analog value processing is required.
The PLC program works only with a BOOL start pulse and a BOOL Ready signal; processing of program numbers is not required. Each waypoint program can be linked to a BOOL operand.
Properties of a Waypoint Program
| Property | Function |
|---|---|
Start |
BOOL operand. A rising edge starts the waypoint program. |
PrgNr |
Optional program number. This allows the sequence to be called via the general inputs PrgNr and Start. |
StartForEveryTarget |
If this option is off, a pulse starts the entire sequence. If it is enabled, each subsequent waypoint requires another start pulse. |
UseLevelTriggeredStart |
If UseLevelTriggeredStart is disabled, the system responds only to a rising edge of the start signal. If the option is enabled, a TRUE signal is interpreted as a start request. |
Targets |
List of RobotPos targets to be approached. |
For PrgNr, use a number that is not already used by a direct RobotPos target.
Properties of a single Waypoint
| Property | Function |
|---|---|
TargetNr |
Number of an existing RobotPos target. |
DurationToTargetInSeconds |
Travel time to this target. |
PauseInSecondsAfterMovement |
Wait time after reaching the target. |
PreMoveRetractionDistance |
Individual retraction distance for this waypoint. |
Image: Settings of a waypoint program in PLC-Lab 3D Studio. The labels “Waypoints 0” and “Targets 0” are zero-based list indices in the user interface. They are not identical to PrgNr or TargetNr.
Notes on Waypoints
TargetNralways refers to an existing{RobotPos...}object.- The order in the list is the movement sequence.
- Each waypoint can have its own movement time and pause.
- Each waypoint can have its own
PreMoveRetractionDistance. - The global X, Y, and Z offsets are not normally required for fixed waypoint sequences.
- The global
WorkingHeightis not used in waypoint sequences. Use appropriate intermediate targets instead. UseCircularTrackis taken into account for suitable waypoint movements.
Using Intermediate Targets
If the robot is to navigate around obstacles, create additional RobotPos targets, for example:
{RobotPos10} = safe position above the pickup point
{RobotPos11} = pickup point
{RobotPos12} = safe position above the drop-off point
{RobotPos13} = drop-off pointThese targets are then entered into the waypoint list in the desired order.
The Coordinate Systems
| Setting | Coordinate System |
| ----------------------------- | ----------------------------------------------------------- - |
| Joint tag {x}, {y}, {z} | Local coordinate system of the joint |
| TCP direction | Local coordinate system of the TCP |
| RobotPos position | World coordinate system of the 3D scene. Stored relative to the robot base |
| TargetOfsX/Y/Z | World coordinate system of the 3D scene |
| WorkingHeight | Relative to the robot base. |
The RobotKinematicsV2 skill
Here you will find an overview of all the skill's settings..
Error Checking
Target/Rotation Not Reached
Check the following:
- Is
TargetOutOfRangeTRUE? - Is the target within the actual range? You may need to scale the robot larger or place the target closer to the robot.
- Is the required target rotation achievable?
- Are the joint limits set too tight?
- Is
FollowTargetRotationenabled? - Is the home pose chosen appropriately?
- Is the robot fully extended and therefore in an unfavorable position?
TCP is pointing in the wrong direction
Check the following:
- Is there exactly one TCP?
- Is the TCP located below joint 6?
- Is the origin at the actual grip point?
- Is the direction tag correct?
- Does
{x}need to be swapped with{x-}or another direction tag? - Was the TCP rotation applied in Blender?
Incorrect Number of Axes
Check the following:
- Does each of the six joints have exactly one axis tag?
- Are all joints connected in series?
- Are there accidentally two tagged joints at the same hierarchy level?
- Was the TCP mistakenly recognized as a joint?
