Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Point on TCP Frame for Second Robot
#1
Hi Guys,
I am trying to set a second robot to follow the path of first robot.  I have started by setting a target on Robot 1 and am looking to understand how to rotate that cartesian point so that the 2nd bot tcp is aligned on the z axis but rotated 180 around y.  I will then want to offset by some arbitrary number.  I used the offset command first but that resulted in more of a 1st robot moves right and 2nd robot moves right (after rotation).  Here is my current code:
Code:
# Type help("robolink") or help("robodk") for more information
# Press F5 to run the script
# Documentation: https://robodk.com/doc/en/RoboDK-API.html
# Reference:     https://robodk.com/doc/en/PythonAPI/index.html
# Note: It is not required to keep a copy of this file, your python script is saved with the station
from robolink import *    # RoboDK API
from robodk import *      # Robot toolbox
RDK = Robolink()

#



tool1  = RDK.Item('Fan1 Tool 1')                # Get an item named Tool (name in the RoboDK station tree)
robot1 = RDK.Item('Fan1', ITEM_TYPE_ROBOT)   # Get the first available robot
robot2 = RDK.Item('Fan2', ITEM_TYPE_ROBOT)
target = RDK.Item('Target 1', ITEM_TYPE_TARGET)
frameA = RDK.AddFrame('FrameA',tool1)

#set frame rel to tool tcp
frameA
#set tool

#add target to frame in cartesian
tar1 = RDK.AddTarget('tar1','frameA')
tar1 = tar1*roty(pi)

#move to target with other bot
It seems I am also struggling with an error with dropping a target onto the new frame.  Let me know if this seems like a good path.  
Thanks, Jacob

(12-16-2019, 05:57 PM)Jacob Wrote: Hi Guys,
I am trying to set a second robot to follow the path of first robot.  I have started by setting a target on Robot 1 and am looking to understand how to rotate that cartesian point so that the 2nd bot tcp is aligned on the z axis but rotated 180 around y.  I will then want to offset by some arbitrary number.  I used the offset command first but that resulted in more of a 1st robot moves right and 2nd robot moves right (after rotation).  Here is my current code:
Code:
# Type help("robolink") or help("robodk") for more information
# Press F5 to run the script
# Documentation: https://robodk.com/doc/en/RoboDK-API.html
# Reference:     https://robodk.com/doc/en/PythonAPI/index.html
# Note: It is not required to keep a copy of this file, your python script is saved with the station
from robolink import *    # RoboDK API
from robodk import *      # Robot toolbox
RDK = Robolink()

#



tool1  = RDK.Item('Fan1 Tool 1')                # Get an item named Tool (name in the RoboDK station tree)
robot1 = RDK.Item('Fan1', ITEM_TYPE_ROBOT)   # Get the first available robot
robot2 = RDK.Item('Fan2', ITEM_TYPE_ROBOT)
target = RDK.Item('Target 1', ITEM_TYPE_TARGET)
frameA = RDK.AddFrame('FrameA',tool1)

#set frame rel to tool tcp
frameA
#set tool

#add target to frame in cartesian
tar1 = RDK.AddTarget('tar1','frameA')
tar1 = tar1*roty(pi)

#move to target with other bot
It seems I am also struggling with an error with dropping a target onto the new frame.  Let me know if this seems like a good path.  
Thanks, Jacob

Just in case anyone wants a visual to understand what I am aiming to do.  I have a robodk station with a target attached to a frame.  This is linked to second robot so that the 1st and 2nd tcp are always in line and offset.  I am trying to figure out how to do this by code now rather than graphically. Thanks
#2
Hi Jacob,

When you add a target, RoboDK automatically uses the current position of the robot to set the target. I see that you applied a rotation added to the current target.

I also noticed you are not passing an reference frame to your target but a string. Make sure you retrieve the item as shown in the example attached.

Also, if you have 2 robots in your project I recommend you to specify the robot you want to use when you create a new target.

Code:
tar1 = RDK.AddTarget('Target 1', RDK.Item('frame name'), RDK.Item("robot name"))
tar1 = transl(100,200,300)*roty(pi)

More information here:
https://robodk.com/doc/en/PythonAPI/robo....AddTarget

It would help if you can send the RoboDK project file to better understand.

Albert
#3
Albert,
Was on a trip to Utah and missed this reply.  I tried a different tactic.  May or may not be correct.  I am getting an occasional error related to robolink.py and target unreachable even though if I manually use the points it reaches fine.  Take a look at the robodk project and let me know what you think.  Not sure if its related to joint overtravel or singularities that compound as each movement occurs.

I attached a frame to the R1 and then rotated it before setting a target (with hopes of it orientating 180* opposite the r1 tcp).  Then set program to move R2 to that point.

My goal is to be able to add some paths to robot1 and then have robot2 follow.  My next steps are to synch the move speeds, but I need to be able to hit all the arbitrary points with now errors first.

Thanks,
Jacob


Attached Files
.rdk   FanDual.rdk (Size: 941.62 KB / Downloads: 174)
#4
Hey guys I think I found a piece I was missing.  I am guessing that the error in my script is related to joint over travel.  It seems things work well until a certain number of movements (depends on path).  Once the joint reaches close to limit and is asked to go forward in linear fashion it errors out and is unreachable.  If I reset the joints and run the script again the point is reachable.  Where is the best start to handle errors and exceptions such as this.  This gets more into the collision mapping side of things, of which I am unfamiliar in robodk.  Sidenote for next step after error handling: do you have the kuka sync project available that we can take a look at from the youtube video?
#5
Hi Jacob,
Thank you for letting us know.
I attached some examples related to the sample shown in the video.
Albert


Attached Files
.rdk   Screen event Sync Method 1 - Using Virtual IO.rdk (Size: 5.01 MB / Downloads: 128)
.rdk   Screen event Sync Method 2 - Using a call to a macro.rdk (Size: 5.01 MB / Downloads: 118)
.rdk   Screen event Sync Method 3 - Speed Adjustment - 3.1.rdk (Size: 5.02 MB / Downloads: 139)
#6
Thanks Albert! I'll dig deeper into this right after lunch. Really appreciate the help
#7
@Albert I have been looking at the speed settings int the move_robot file.   It seems that the bots are calculating speed on a point to point basis with no consideration of moving thru points.  Given all the small points together this is resulting in a quite slow speed.  Do you have a recommendation for speeding them up?  I've attached another rdk station below to show what I am talking about.  When both robots are at their T1 targets then hit move_robots.  

I am considering if there is value in tracking current speed and adding that to the speed calc in the python script.  I modified the fanuc .ls path file to get higher speed manually, but want to see about syncing the two at higher speeds.

Thanks!


Attached Files
.rdk   FanDual4.rdk (Size: 1.63 MB / Downloads: 141)
#8
Hi Jacob,

You should use a rounding instruction (setRounding greater than 0 using the API). In this case, RoboDK assumes the speed remains constant. This is not realistic in situations where the robot can't maintain the speed constant (such as important changes in direction at high speeds).

More information here:
https://robodk.com/doc/en/General.html#CycleTime

Albert
  




Users browsing this thread:
1 Guest(s)