I have a robot that has a secondary axis (Group 2). This axis is a turn table set up for continuous turn and is utilized by the Run command in the Fanuc controller to run the table at a set RPM simultaneously to the motion program. For programming with Robodk i have an Object (Turn table CAD model) set on user frame. Is there a way to simulate the continuous turn of this frame without creating a table mechanism? I don't want robodk to add group 2 positional data to the positions or program or it would conflict with the Run command by creating a table mechanism.
Could you please show the steps to attach a 1-axis mechanism to the turntable and how to add it to the simulation so it is continuously rotating while the robot program runs?
Just to give you more information, I am using the turntable from your examples and a UR30 that executes a curve follow project to paint a circular disc located on the turntable. I have attached an image of the set up.
03-26-2026, 08:05 PM (This post was last modified: 03-27-2026, 10:21 AM by Albert.)
Pablo,
Albert may have a better way to do this simulation. But i can tell you what i did. I wrote a script that will "continuously" spin a frame around the z axis. I just start it, select the table frame and then start your simulation. You could drop it into you program to do it automatically without the selection but would need to modify the script.
If interested, feel free to use:
Just change the ROTATION_SPEED_DEG_PER_SEC = # to modify the speed of the rotation.
Code:
# Continuous Frame Rotation in RoboDK
# Simulates a rotating table by continuously rotating a reference frame.
from robodk.robolink import *
from robodk.robomath import * # provides pi, rotx, roty, rotz
import time
# -------------------------------------------
# SETTINGS
ROTATION_SPEED_DEG_PER_SEC = 10 # rotation speed
AXIS = 'Z' # axis: 'X', 'Y', or 'Z'
UPDATE_HZ = 30 # refresh rate (frames/second)
# -------------------------------------------
def main():
RDK = Robolink()
# Select the frame to rotate
frame = RDK.ItemUserPick("Select a frame to rotate", ITEM_TYPE_FRAME)
if not frame.Valid():
RDK.ShowMessage("No frame selected.")
return
# Store initial pose
base_pose = frame.Pose()
angle = 0.0
dt = 1.0 / UPDATE_HZ
RDK.ShowMessage("Rotating... stop script to end.")
while True:
angle += ROTATION_SPEED_DEG_PER_SEC * dt
angle_rad = angle * pi / 180.0 # FIXED
# Choose rotation axis
if AXIS.upper() == 'X':
R = rotx(angle_rad)
elif AXIS.upper() == 'Y':
R = roty(angle_rad)
else:
R = rotz(angle_rad)
# Apply rotation
frame.setPose(base_pose * R)
time.sleep(dt)
if __name__ == "__main__":
main()
Also, with the latest version of RoboDK you have new instructions that help you reset a simulation so you can place a robot or mechanism to the home location and start running it using the user interface. You can find more information here: https://robodk.com/doc/en/Robot-Programs...EvtRobHome
03-27-2026, 10:28 AM (This post was last modified: 03-27-2026, 10:28 AM by Albert.)
By the way, when using a custom script, if you want to synchronize with the simulation speed of your simulation you can multiply by the SimulationSpeed factor. Example: