Hi, I'm wondering what is the best way to make duplicates of curve follow project.
In the image I attached, the basic shape is drawn in solid line and duplications are drawn in dotted line.
Currently, I make pattern copies in 3D CAD and import STEP file from it into RoboDK.
Then, I make curve follow projects for each shape, and selecting curve path.
I want to improve this process.
One method which came to my mind is that,
create basic shape STEP file
create frames for original one and each duplicates
import STEP files into each frame
make curve follow projects for each and select path
By this, I can relocate duplicates inside RoboDK which is somewhat smarter than going back to 3D CAD.
If there is better way than that, please let me know.
For example, is it possible to create one curve follow project for basic (solid lined) shape and make duplicates (dotted lines) of Robot motion by using different frames?
Yes, it should be easy to replicate the toolpath prepared for one part, on different locations.
Your suggested approach is valid but it could be simplified even better by not having to load the STEP file again on multiple coordinate systems.
An easier approach would be to first create the program from your curve follow project, then, show the instructions on that program (removes the link with the curve follow project) and delete the instruction to set the coordinate system (usually one of the first 4 instructions). Then, you can call this program from another main program where you set the desired coordinate system and then call this first program multiple times (set reference 1 - run path program - set reference 2 - run path program again - etc).
You can also automate this procedure using the API, it should not be very complicated. For example, if you use the API it may be easier to duplicate the part with curves already loaded in RoboDK with the curves already selected.
Let us know if this works for you, if you can share a sample project we can help you better.
Thank you for your reply and sorry for my lazy response (I've been waiting Email notification which is not sent by unknown reason).
The first method (set reference 1 - run path program - set reference 2 - run path program again - etc) went well for me.
Attached is the project I tried that way.
Would you show me an example python program to use API method?
I'm content with the first method, but to improve my knowledge, I'ld like to know the second way.
07-21-2025, 12:41 PM (This post was last modified: 07-21-2025, 12:41 PM by Sergei.)
Here is a script that uses the RoboDK Python API to copy the program at locations specified by selected frames.
Initially, you need to select a group of frames and then run the script.
We've also packaged this script into an add-in (attached) so you can run it from the toolbar.
I've also attached your slightly modified station that we used for testing
Please note that, depending on the frame's position, replicated program points may not be reachable when using linear moves to them
Code:
from robodk import robolink # RoboDK API
from robodk import robomath # Robot toolbox
RDK = robolink.Robolink()
frames_selected = RDK.Selection()
frames = []
frame_names = []
for f in frames_selected:
if f.type == robolink.ITEM_TYPE_FRAME:
frames.append(f)
frame_names.append(f.Name())
if len(frames) == 0:
RDK.ShowMessage("Select one or more coordinate systems and try again")
quit()
prog_orig = RDK.ItemUserPick('Select the program to replicate on frames:<ol><li>' + '</li><li>'.join(frame_names) + "</li></ol>", robolink.ITEM_TYPE_PROGRAM)
# Create or reuse existing program:
prog_name = prog_orig.Name() + '_' + 'NoFrame'
prog = RDK.Item(prog_name, robolink.ITEM_TYPE_PROGRAM)
if not prog.Valid():
prog_orig.Copy()
prog = RDK.Paste()
prog.setName(prog_name)
ins_count = prog.InstructionCount()
ins_id = 0
while ins_id < ins_count:
ins = prog.Instruction(ins_id)
if ins[1] == robolink.INS_TYPE_CHANGEFRAME:
prog.InstructionDelete(ins_id)
continue
if ins[1] == robolink.INS_TYPE_MOVE and ins[2] == robolink.MOVE_TYPE_JOINT:
prog.InstructionDelete(ins_id)
break
if ins_id > 10:
print("No joint move found")
break
ins_id = ins_id + 1
# Create main program
main_prog = RDK.AddProgram('Main_' + prog_orig.Name())
for fr in frames:
main_prog.setFrame(fr)
main_prog.RunInstruction(prog.Name(), 0)
Thank you very much! It is quite a good learning material for me to dig into RoboDK API.
Though unfortunately, it turned out that calling path on different frames does not produce correct Yasukawa motoman pulse program.
It produces program like bellow which repeatedly calls a same pulse sub-program, and apparantly the robot will not move as intended.
This result does not change even if I used inline subprogram (pulse data are same).
I appreciate if you have any other suggestions.
Best regards,
Code:
'Program generated by RoboDK v
'5.9.2 for Motoman GA50 on 22/
'07/2025 11:09:58
'Using nominal kinematics.
'Tool K61_laser_head should be
' close to:
'377.9,0.0,150.4,0.0,90.0,0.0
'Using Frame 1 (targets wrt ba
'se):
'-59.8,377.8,115.0,0.0,0.0,99.
'0
CALL JOB:CPTS1
'Using Frame45 (targets wrt ba
'se):
'0.0,0.0,115.0,0.0,0.0,99.0
CALL JOB:CPTS1
'Using Frame 2 (targets wrt ba
'se):
'59.8,-377.8,115.0,0.0,0.0,99.
'0
CALL JOB:CPTS1
END
Good point. By default, RoboDK's post processor for Yaskawa Motoman calculates the targets with respect to the robot base. So this approach won't work unless you change the coordinate system in your program.
You can force using relative targets on Yaskawa Motoman robot controllers by following these steps:
Duplicate the file C:/RoboDK/Posts/Motoman_Cartesian.py and call it Motoman_Cartesian_Frame.py (save it in the same folder).
Edit the variable USE_MFRAME and set it to True (not False)
In RoboDK, right click on your robot and select Select Post Processor
Choose the post you just created Motoman_Cartesian_Frame
Let us know if it works for you. If not, we can also look at duplicating curve follow projects.
Thank you Albert, I did as you mentioned but it generated the attached file which (I think) does not include frame change instruction (just comment lines?).
This was generated using "multiloc_md.rdk" and "multilink" above with "inline subprogram option".
You are right. I forgot an extra step, you should rename your coordinate systems so they are not considered numbered frame IDs. To do so, you can simply replace the space before the number by another character like an underscore. For example, instead of Frame 3, use Frame_3 for the frame names. This will force setting the frames. It will use up to 3 spare registers using the index defined in the variable SPARE_PR.
Summarizing, You can force using relative targets on Yaskawa Motoman robot controllers by following these steps:
Duplicate the file C:/RoboDK/Posts/Motoman_Cartesian.py and call it Motoman_Cartesian_Frame.py (save it in the same folder).
Edit the variable USE_MFRAME and set it to True (not False)
Rename your coordinate systems so they don't end with a space character and a number (for example, use underscore and a number instead).
In RoboDK, right click on your robot and select Select Post Processor
Choose the post you just created Motoman_Cartesian_Frame
Generate the program again
You should then see this output when you use the sample project attached: