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

Synchronizing external axises and switching robots from 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)
   
#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:

   


Attached Files
.rdk   w_cell_3ax_v2.rdk (Size: 6.82 MB / Downloads: 6)
  




Users browsing this thread:
1 Guest(s)