All Collections
xArm-Gripper/ IO/ PLC and other external devices
Guide to use the Robotiq Gripper on UFACTORY xArm
Guide to use the Robotiq Gripper on UFACTORY xArm

This article mainly explains the connection method of the Robotiq Gripper and UFACTORY xArm, and the usage example of the Robotiq Gripper.

W
Written by Wang Daniel
Updated over a week ago

1. Applicable version of the Robotiq Gripper

 

2. Connection method of the Robotiq Gripper and the UFACTORY xArm 

●  The connector of the Robotiq Gripper

●  The tool/end connector of the UFACTORY xArm

●  Connection method of the Robotiq Gripper and UFACTORY xArm

The following table shows the corresponding connection between the connector of the robotiq gripper and the end/tool connector of the UFACTORY xArm:

3. The software setting of Robotiq Gripper

3.1 TCP settings

3.1.1 TCP settings on the UFACTORY xArm Studio

TCP Payload Settings

1) Enter "Settings"-"TCP"-"TCP-Payload"

2) Set the TCP Payload of Robotiq 2F/85 Gripper(/Robotiq 2F/140 Gripper) as the default TCP Payload parameters.

3)Click the button of the "Save"

TCP Offset Settings

1) Enter "Settings"-"TCP"-"TCP Offset "

2) Set the TCP Offset of Robotiq 2F/85 Gripper(/Robotiq 2F/140 Gripper) as the default TCP Offset parameters.

3)Click the button of the "Save"

3.1.2 TCP settings on the xArm-Python-SDK

TCP Payload Settings

Please use the following interface to set the TCP Payload of the Robotiq Gripper.

# Robotiq 2F/85 Gripper
arm.set_tcp_load(0.925,[0,0,58])

# Robotiq 2F/140 Gripper
arm.set_tcp_load(1.025,[0,0,73])

TCP Offset Settings

Please use the following interface to set the TCP Offset of the Robotiq Gripper.

# Robotiq 2F/85 Gripper
arm.set_tcp_offset([0,0,174,0,0,0])

# Robotiq 2F/140 Gripper
arm.set_tcp_offset([0,0,244,0,0,0])

3.2 Self-Collision Prevention Model Settings

3.2.1 Self-Collision Prevention Model Settings on the UFACTORY xArm Studio

1) Enter "Settings"-"End Effector"

2) Select the type of Robotiq Gripper

3) Turn on the switch of the self-collision prevention model

4) Click the button of the "Save"

Note:

1. The opening and closing speed of the gripper can be adjusted.

2. When "TCP payload compensation" is turned on, the default TCP payload will be changed to the TCP payload parameter of the gripper.

3.If the state of the Self Collision Prevention is OFF, you can through the following method to turn on the Self Collision Prevention.

Method:

1) Enter "Settings"-"Advanced"-"Advanced Tool"-"Advanced Logic"

2) Turn on the switch of the self-collision prevention

3) Click the button of the "Save"

3.2.2 Self-Collision Prevention Model Settings on the xArm-Python-SDK

Please use the following interface to set the Self-Collision Prevention Model of the Robotiq Gripper.

# Robotiq 2F/85 Gripper
arm.set_collision_tool_model(4)

# Robotiq 2F/140 Gripper
arm.set_collision_tool_model(5)

4. Control Robotiq 2F-85 through UFACTORY xArm Studio

Blockly Example

The role of this program:

execute this program to control the gripper to grip the target object at the specified position, and then place the target object at the target position.

5. Control Robotiq 2F-85 through Modbus-RTU protocol on UFACTORY xArm Python SDK

Example:
Example of controlling the Robotiq Gripper ( 2F-85 / 2F-140 ) by sending commands through xArm-Python-SDK.

#!/usr/bin/env python3  
# Software License Agreement (BSD License)
#
# Copyright (c) 2019, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman

"""
Example: Robotiq Gripper Control Please make sure that the gripper is attached to the end.
"""
import os
import sys
import time
sys.path.append(os.path.join(os.path.dirname(__file__), '../../..'))

from xarm.wrapper import XArmAPI
from configparser import ConfigParser
parser = ConfigParser()
parser.read('../robot.conf')
try:
ip = parser.get('xArm', 'ip')
except:
ip = input('Please input the xArm ip address[192.168.1.194]:')
if not ip:
ip = '192.168.1.194'

arm = XArmAPI(ip)
time.sleep(0.5)

if arm.warn_code != 0:
arm.clean_warn()
if arm.error_code != 0:
arm.clean_error()

ret = arm.core.set_modbus_timeout(5)
print('set modbus timeout, ret = %d' % (ret[0]))
ret = arm.core.set_modbus_baudrate(115200)
print('set modbus baudrate, ret = %d' % (ret[0]))

# robotiq open/close test
data_frame = [0x09, 0x10, 0x03, 0xE8, 0x00, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
ret = arm.core.tgpio_set_modbus(data_frame, len(data_frame))
print('set modbus, ret = %d' % (ret[0]))
time.sleep(0.1)

data_frame = [0x09, 0x10, 0x03, 0xE8, 0x00, 0x03, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00]
ret = arm.core.tgpio_set_modbus(data_frame, len(data_frame))
print('set modbus, ret = %d' % (ret[0]))

arm.disconnect()

Request is: 09 10 03 E8 00 03 06 00 00 00 00 00 00 73 30

Bits

Description

09

SlaveID

10

Function Code 16 (Preset Multiple Registers)

03E8

Address of the first register

0003

Number of registers written to

06

Number of data bytes to follow (3 registers x 2 bytes/register = 6 bytes)

0000

Value to write to register 0x03E9 (ACTION REQUEST = 0x01 and GRIPPER OPTIONS = 0x00): rACT = 1 for "Activate Gripper"

0000

Value written to register 0x03EA

0000

Value written to register 0x03EB

7330

Cyclic Redundancy Check (CRC)

Request is (clear rAct): 09 10 03 E8 00 03 06 01 00 00 00 00 00 72 E1

Bits

Description

09

SlaveID

10

Function Code 16 (Preset Multiple Registers)

03E8

Address of the first register

0003

Number of registers written to

06

Number of data bytes to follow (3 registers x 2 bytes/register = 6 bytes)

0100

Value to write to register 0x03E9 (ACTION REQUEST = 0x01 and GRIPPER OPTIONS = 0x00): rACT = 1 for "Activate Gripper"

0000

Value written to register 0x03EA

0000

Value written to register 0x03EB

72E1

Cyclic Redundancy Check (CRC)

Note:

When using the SDK to control the gripper, there is no need to send the CRC check code when sending the command.

Did this answer your question?