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

RobotiQ gripper force and speed set using the driver

#1
I am working on creating a station to control a UR10e robot and a RobotiQ 2F-85 gripper for performing pick-and-place tasks in the real world. 

Currently, I can control the gripper to open and close using both the "send program to robot" method (Method A) and the driver (Method B). Specifically, I use the program calls
Code:
rq_move_and_wait( 0 )
and
Code:
rq_move_and_wait( 255 )
, and these work as expected. 

However, when I try to use the program calls
Code:
rq_set_speed( 255 )
and
Code:
rq_set_force( 255 )
to adjust the gripper's speed and force, Method A works well, but Method B fails to change the default low values for speed and force. As a result, the gripper cannot securely hold the item, causing it to fall.

I have attached the station document and the progrobodk.script (saved as .py due to the tpye of attachment limitation), and I will appreciate if anyone can help me.


Attached Files
.rdk   Loop.rdk (Size: 4.9 MB / Downloads: 212)
.py   progrobodk.py (Size: 30.97 KB / Downloads: 175)
#2
Via the Universal Robots driver you'll receive the ID. To be able to trigger multiple program calls you should then customize the progrobodk.script file and map the ID of your program call to a program name and parameter.

For example, around line 987 of your progrobodk.script file you could customize it to something like this:
Code:
          if True:
           if prog_id >= 256*2:
              rq_set_force(prog_id-256*2)
           elif prog_id >= 256*1:
              rq_set_speed(prog_id-256*1)
            else:
              rq_move_and_wait(prog_id)
            end
          end
You can then change the speed and set it to 50% by doing this:
Code:
program_call(383)
# program_call(value+256)
#3
(10-08-2024, 07:54 AM)Albert Wrote: Via the Universal Robots driver you'll receive the ID. To be able to trigger multiple program calls you should then customize the progrobodk.script file and map the ID of your program call to a program name and parameter.
For example, around line 987 of your progrobodk.script file you could customize it to something like this:
Code:
          if True:
           if prog_id >= 256*2:
              rq_set_force(prog_id-256*2)
           elif prog_id >= 256*1:
              rq_set_speed(prog_id-256*1)
            else:
              rq_move_and_wait(prog_id)
            end
          end
You can then change the speed and set it to 50% by doing this:
Code:
program_call(383)
# program_call(value+256)

It works well. Thank you for your precise and generous help!

However, I have another question: the same command (e.g.,
Code:
program_call(512)
) cannot be executed via Method A ("send program to robot"), as it returns a warning:
Code:
error_name_not_found: program_call


Currently, I can set the gripper's speed and force using
Code:
program_call(512)
with Method B (the driver), but not with Method A ("send program to robot"). 

On the other hand, I can use
Code:
rq_set_speed( 512 )
and
Code:
rq_set_force( 512 )
via Method A ("send program to robot"), but not with Method B (the driver). 

This means I have to program differently to control the robot depending on whether I’m using Method A or Method B.
Is there a way to unify the approach so that I don’t need to program separately for each method?
#4
I'm happy to hear this workaround is somehow working better now.

The driver receives both, the string line for the program call and the ID. You can try passing just any name for the program call and see if the error persists. If so, you should make sure you ignore the program line and you only use the ID which is automatically extracted by RoboDK.
  




Users browsing this thread:
1 Guest(s)