Skip to content

3.Control

3.1UFACTORY Studio Control

1. Set up xArm Vacuum Gripper

  • Enter 'Settings-Motion-TCP'

After installing the vacuum head, set the Tcp load and offset, select the 'xArm Vacuum Gripper' and remember to save it!

2. Control xArm Vacuum Gripper

  • Control the vacuum gripper in the live control

Control Method:

  1. Firstly by selecting the connection method and then by clicking the "Open/Close" button, you can control the opening and closing of the vacuum gripper.

  • Control the vacuum gripper through Blockly

Find the example file 1008_xArm_Vacuum_Gripper in the blockly module

Find the file 1008_xArm_Vacuum_Gripper in the blockly module

The role of this program: execute this program to control the vacuum gripper to suck the target object at the specified position, and then place the target object at the target position.

Note:

  1. When the vacuum gripper is installed on the robotic arm, the TCP Payload of the vacuum gripper should be set in the Blockly program. When the total weight of the vacuum gripper changes after the object is sucked, a new TCP Payload needs to be set.

3.2 Python-SDK Control

The interface of controlling vacuum gripper:

arm.set_vacuum_gripper(True, wait=False)    #open the vacuum gripper 

arm.set_vacuum_gripper(False, wait=False)   #close the vacuum gripper

The download link of the Python-SDK:

https://github.com/xArm-Developer/xArm-Python-SDK

3.3 ROS-SDK Control

Please refer to Section 5.7.8 in the ReadMe file attached to the ROS package to control the vacuum gripper.

xArm ROS-SDK link :

https://github.com/xArm-Developer/xarm_ros

3.4 Private TCP Control

his section mainly explains how to control the xArm Vacuum Gripper by using the Modbus-TCP protocol through xArm control box.

3.4.1 Private TCP Communication Format

Modbus-TCP:

Modbus protocol is an application layer message transmission protocol, including three message types: ASCII, RTU, and TCP. The standard Modbus protocol physical layer interface includes RS232, RS422, RS485 and Ethernet interfaces, and adopts master / slave communication.

Modbus TCP Communication Process:

  1. Establish a TCP connection
  2. Prepare Modbus messages
  3. Use the send command to send a message
  4. Waiting for a response under the same connection
  5. Use the recv command to read the message and complete a data exchange
  6. When the communication task ends, close the TCP connection

Parameter:

Default TCP Port: 502

Protocol: 0x00 0x02

On the problem of users using communication protocols to organize data in big endian and little endian:

In this article, data analysis is big-endian analysis.

3.4.2 Private TCP Example

  • Open/Close the vacuum gripper
Open the Vacuum Gripper00 01 00 02 00 08 7F 09 0A 15 00 80 80 4300 01 00 02 00 08 7F 09 0A 15 00 00 00 44
Close the Vacuum Gripper00 01 00 02 00 08 7F 09 0A 15 00 00 80 4300 01 00 02 00 08 7F 09 0A 15 00 80 00 44

Please refer to the table below for specific parameters.

IO control on the End-effector
Register:127 (0x7F)
Request
Modbus TCP HeaderTransaction Identifier2 Bytesu160x00,0x01
Protocol2 Bytesu160x00,0x02
Length2 Bytesu160x00,0x08
Register1 Byteu80x7F
ParametersHost ID1 Byteu80x09
Address2 Bytesu160x0A,0x15
Parameters1(Open 0)Data:256.0: Close 0 257.0: Open 0512.0: Close 1 514.0: Open 14 Bytesfp320x00,0x80,0x80,0x43
Response
Modbus TCP HeaderTransaction Identifier2 Bytesu160x00,0x01
Protocol2 Bytesu160x00,0x02
Length2 Bytesu160x00,0x02
Register1 Byteu80x7F
ParametersState1 Byteu80x00
  • Get the status of the vacuum gripper

The steps to obtain the vacuum gripper status are shown in the following table:

Get Status(Request Commands)00 01 00 02 00 04 80 09 0A 14
Get Status(Response Commands) (The vacuum gripper picked up the object)00 01 00 02 00 06 80 00 00 00 00 01
Get Status(Response Commands) (The vacuum gripper does not pick up the object)00 01 00 02 00 06 80 00 00 00 00 00

Please refer to the table below for specific parameters.

Get the input of the end digital quantity
Register:128 (0x80)
Request
Modbus TCP HeaderTransaction Identifier2 Bytesu160x00,0x01
Protocol2 Bytesu160x00,0x02
Length2 Bytesu160x00,0x04
Register1 Byteu80x80
ParametersHost ID1 Byteu80x09
Address2 Bytesu160x0A, 0x14
Response
Modbus TCP HeaderTransaction Identifier2 Bytesu160x00,0x01
Protocol2 Bytesu160x00,0x02
Length2 Bytesu160x00,0x06
Register1 Byteu80x80
ParametersState1 Byteu80x00
Parameters1(0)The end byte indicates the input status. The digit of 0 corresponds to input 0 and the digit of 1 corresponds to input 1.4 Bytesu8*40x00,0x00,0x00,0x00