Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Synchronizing external axes using the API

#1
Hey, how can I synchronize external axises through the API and switch between different external axes in a curve follow projects settings?

For example, in the image attached, there are two single-axis positioners. If I create a curve follow project on one of the positioner and decide to move it to the other positioner. Can I change which positioner should be rotating within the project settings?


Attached Files Thumbnail(s)
Screenshot 2024-10-29 105438.png   
#2
Yes, you can synchronize the robot with external axes using the setLink() function:

https://robodk.com/doc/en/PythonAPI/robo...em.setLink

Code:
from robodk import robolink    # RoboDK API
from robodk import robomath    # Robot toolbox

RDK = robolink.Robolink()

robot = RDK.Item('rob')
ext_axis = RDK.Item('positioner')
robot.setLink(ext_axis)

You can also add such a script to the Program Events of the Curve Follow project or add it to the main program as a separate program call.

Changes to the postprocessor are also necessary because you need to output the coordinates in the correct format (the default post only outputs code for a robot with one synchronized axis)

You can modify the RunCode method and handle positioner switching like in the following example:

Code:
if code.startswith('side_1'):
                self.addline('Side_1;')
                self.rob.setLink(self.ax_2)
                self.side = 1
                return

elif code.startswith('side_2'):
                self.addline('Side_2;')
                self.rob.setLink(self.ax_3)
                self.side = 2
                return

I also attached an example of the station with a 3-axis positioner:

Untitled.png   


Attached Files
.rdk   w_cell_3ax_v2.rdk (Size: 6.82 MB / Downloads: 169)
#3
Hey Sergei, thank you for the help.

How can I sync both the rail and positioner to the Robot like the screenshot I attached?


Attached Files
.png   Screenshot 2025-03-06 110546.png (Size: 520.44 KB / Downloads: 65)
#4
You can call and concatenate setLink multiple times to group the rail and the turntable as one system using the API. Example:
Code:
robot.setLink(rail)
rail.setLink(turntable)
#5
Hey Albert,

I've already tried this but it just creates a single link to the robot and rail, and the rail to the positioner. When I open the robot's options it only has the joint axis for the rail. On the rail's options it has the turntable's joint axis.

I believe when we sync all the robots together and open their options. The robot's options is meant to open is that correct?

I'm using RoboDK 5.6


.png   Screenshot 2025-03-07 084625.png (Size: 655.3 KB / Downloads: 64)
  




Users browsing this thread:
1 Guest(s)