Welcome to myCobot 320 Arm repository
2.Use of force-controlled grippers
Serial port control method
USB-485 module wiring :
Connect the 24V, GND, 485_A (T/R+, 485+), 485_B (T/R-, 485-) wires at the gripper end. The power supply is a 24V DC regulated power supply. Insert the USB port of the module into the USB port of the computer.

485A is connected to 485 to USB module A+; 485B connected to 485 to USB module B-; 24V is connected to the positive pole of 24V DC regulated power supply; GND is connected to the negative pole of 24V DC regulated power supply
Serial port debugging assistant debugging :
The user can use UartAssist serial debugging assistant to send the corresponding gripper command as shown in the figure below. The CRC check code does not need to be filled in, as it will be automatically generated by UartAssist serial debugging assistant.

Gripper serial port default configuration
Gripper ID: 14
Baud rate: 115200
Data bits: 8
Stop bits: 1
Check digit: No check digit
Protocol Instructions
The gripper uses a custom protocol. One instruction consists of a frame header (2 bytes), length (1 byte), address code ID (1 byte), function code (1 byte), register address (2 bytes), register data (2 bytes), and check code (2 bytes). Let's take reading the gripper angle as an example.
| Frame Header | length | ID | Function code | Register Address | Register data/parameters | CRC-16 MODBUS checksum |
|---|---|---|---|---|---|---|
| Fe Fe | 08 | 0e | 03 | 00 0C | 00 00 | B1 C0 |
Frame header : 254 254
Length : Command length 08
ID : 0E, can be modified in the device, the default ID is 14, 0E means the current ID of the gripper is 14
Function code : Identify whether the instruction is a setting or obtaining function, 06 (write operation to the register)/03 (read operation to the register).
Register address : 00 0c Gripper function corresponding register address
Register parameter : 00 00. No parameter is required in the read instruction. You can give 00 00. In the setting instruction, write data for the gripper address as the parameter.
CRC check : B1 C0, to ensure that the terminal equipment does not respond to data that has changed during transmission, to ensure the security and efficiency of the system, CRC check uses a 16-bit cyclic remainder method. All hexadecimal values of the frame header, length, function code, register address, and register parameter are directly checked to obtain the B1 C0 check code.
Command Overview
Read the firmware major version number
Command: fe fe 08 0e 03 00 01 00 00 72 51
Function code: 03 Read operation
Parameters: None
Return: fe fe 08 0e 03 00 01 00 01 B2 90
Note: Data returned is 00 01, and the returned version number is 1
Read the firmware minor version number
Command: FE FE 08 0E 03 00 02 00 00 72 A1
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 02 00 01 B2 60
Note: Data return 00 01, indicating the returned version number is 1
Set/read device ID
set up
Command:FE FE 08 0E 06 00 03 00 0E 76 BD
Function code: 06 write operation
Parameter: 00 0E, ID setting range (1-254)
Return: FE FE 08 0E 06 00 03 00 01 72 FD
Note: Success returns 00 01, failure returns 00 00. After the device ID is modified, the ID in the command also needs to be modified to the same in order to communicate.
Read
Instruction: FE FE 08 0E 03 00 04 00 00 73 41
Function code: 03 Read operation
Parameters: None
Return:FE FE 08 0E 03 00 04 00 0E B7 C0
Note: Data return 00 0E, indicating the current gripper ID number
Set/read 485 baud rate
set up
Command: FE FE 08 0E 06 00 05 00 00 73 1D
Function code: 06 write operation
Parameter: Parameter 00 00, 0-115200, 1-1000000, 2-57600, 3-19200, 4-9600, 5-4800. If it is set to 1000000, the parameter is changed to 00 01.
Return: FE FE 08 0E 06 00 05 00 01 72 FD
Note: Success returns 00 01, failure returns 00 00
Read
Instruction: FE FE 08 0E 03 00 06 00 00 B3 E0
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 06 00 00 B3 E0
Note: Return data 00 00, which corresponds to the baud rate value of the setting parameter
Set the gripper enable state
Command:FE FE 08 0E 06 00 0A 00 00 B0 EC
Function code: 06 write operation
Parameter: 00 00, 00 means disconnection, 00 01 means enablement
Return: FE FE 08 0E 06 00 0A 00 01 70 2D
Note: Success returns 00 01, failure returns 00 00
Set/read the gripper jaw angle
set up
Command:FE FE 08 0E 06 00 0B 00 64 9B BC
Function code: 06 write operation
Parameter: Parameter 00 64, set the angle to fully open
Return:FE FE 08 0E 06 00 0B 00 01 B0 7C
Note: Success returns 00 01, failure returns 00 00
Read
Command:FE FE 08 0E 03 00 0C 00 00 B1 C0
Function code: 03 Read operation
Parameters: None
Return:FE FE 08 0E 03 00 0C 00 64 5A C1
Note: Return data 00 64, indicating the current angle is 100, fully open
Setting the gripper jaw zero position
Command: FE FE 08 0E 06 00 0D 00 00 71 5D
Function code: 06 Write operation
Parameters: None
Return:FE FE 08 0E 06 00 0D 00 01 B1 9C
Note: Success returns 00 01, failure returns 00 00
Note : When setting the zero position, the gripper will move on its own. If there is an object blocking the movement, the setting will fail. Please check whether there is any obstacle around the gripper before setting.
Read the gripping status of the gripper
Command: FE FE 08 0E 03 00 0E 00 00 71 61
Function code: 03 Read operation
Parameters: None
Return:FE FE 08 0E 03 00 0E 00 01 B1 A0
Marking: 00 01, return data 0 is moving, 1 is stopped and no clamping is detected, 2 is stopped and clamping is detected, 3 is detected and the object is dropped
Set/read gripper P value
set up
Command:FE FE 08 0E 06 00 0F 00 64 5A FD
Function code: 06 write operation
Parameter: Parameter 00 64, set P value to 100, setting range (1-150)
Return: FE FE 08 0E 06 00 0F 00 01 71 3D
Note: Success returns 00 01, failure returns 00 00
Read
Instruction: FE FE 08 0E 03 00 10 00 00 77 01 Function code: 03 Read operation parameters: None Return: FE FE 08 0E 03 00 10 00 64 9C 00 Note: Return data 00 64, indicating that the current P value is 100
Set/read the gripper D value
set up
Instruction: FE FE 08 0E 06 00 11 00 64 5C 9D
Function code: 06 write operation
Parameter: Parameter 00 64, set D value to 100, setting range (1-150)
Return: FE FE 08 0E 06 00 11 00 01 77 5D
Note: Success returns 00 01, failure returns 00 00
If the gripper vibrates, increase the D value appropriately.
Read
Command: FE FE 08 0E 03 00 12 00 00 B7 A0
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 12 00 64 5C A1
Note: Return data 00 64, indicating that the current D value is 100
Set/read gripper I value
set up
Command: FE FE 08 0E 06 00 13 00 00 77 3D
Function code: 06 write operation
Parameter: Parameter 00 00, set I value to 0, setting range (1-150)
Return:FE FE 08 0E 06 00 13 00 01 B7 FC
Note: Success returns 00 01, failure returns 00 00
Read
Command: FE FE 08 0E 03 00 14 00 00 B6 40
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 14 00 00 B6 40
Note: Return data 00 00, indicating that the current I value is 0
Set/read the clockwise runnable error of the gripper jaws
set up
Instruction: FE FE 08 0E 06 00 15 00 01 B6 1C
Function code: 06 write operation
Parameter: Parameter 00 01, setting value is 1, setting range (0-16)
Return: FE FE 08 0E 06 00 15 00 01 B6 1C
Note: Success returns 00 01, failure returns 00 00
Read
Instruction: FE FE 08 0E 03 00 16 00 00 76 E1
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 16 00 01 B6 20
Note: Return data 00 01, indicating the current value is 1
Set/read the clockwise runnable error of the gripper jaws
set up
Instruction: FE FE 08 0E 06 00 17 00 01 76 BD
Function code: 06 write operation
Parameter: Parameter 00 01, setting value is 1, setting range (0-16)
Return: FE FE 08 0E 06 00 17 00 01 76 BD
Note: Success returns 00 01, failure returns 00 00
Read
Command: FE FE 08 0E 03 00 18 00 00 B5 80
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 18 00 01 75 41
Note: Return data 00 01, indicating the current value is 1
Set/read the minimum actuation force of the gripper jaws
set up
Instruction: FE FE 08 0E 06 00 19 00 18 7F 1D
Function code: 06 Write operation
Parameters: 00 18
Return:FE FE 08 0E 06 00 19 00 01 B5 DC
Note: Success returns 00 01, failure returns 00 00
Read
Command: FE FE 08 0E 03 00 1A 00 00 75 21
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 1A 00 18 7F 21
Note: The returned data is 00 18, indicating that the current value is 24
Setting/reading torque
set up
Command:FE FE 08 0E 06 00 1B 00 64 F8 BC
Function code: 06 Write operation
Parameter: 00 64 Set the torque to 100, parameter range (0-100)
Return: FE FE 08 0E 06 00 1B 00 01 75 7D
Note: Success returns 00 01, failure returns 00 00
Read
Instruction: FE FE 08 0E 03 00 1C 00 00 74 C1
Function code: 03 Read operation
Parameters: None
Return:FE FE 08 0E 03 00 1C 01 2C 39 C1
Note: Return data 01 2C, indicating that the current value is 300. The greater the torque, the greater the current and the greater the gripper strength.
io output settings
Instruction: FE FE 08 0E 06 00 1D 00 10 78 5D
Function code: 06 write operation
Parameter: 00 10 Set IO output to 10, parameter range (00, 01, 10, 11)
Return: FE FE 08 0E 06 00 1D 00 01 74 9D
Note: Success returns 00 01, failure returns 00 00
Set the io opening angle
set up
Instruction: FE FE 08 0E 06 00 1E 00 32 61 2D
Function code: 06 Write operation
Parameter: 00 32 Set the IO opening angle to 50, parameter range (0-100)
Return: FE FE 08 0E 06 00 1E 00 01 74 6D
Note: Success returns 00 01, failure returns 00 00
Read instruction: FE FE 08 0E 03 00 22 00 00 B8 A0
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 22 00 32 6D 21
Note: 00 32 data returned is 50 degrees
Set io closing angle
Setting command: FE FE 08 0E 06 00 1F 00 00 74 FD
Function code: 06 Write operation
Parameter: 00 32 Set IO closing angle to 0, parameter range (0-100)
Return:FE FE 08 0E 06 00 1F 00 01 B4 3C
Note: Success returns 00 01, failure returns 00 00
Read
Command: FE FE 08 0E 03 00 23 00 00 78 F1
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 23 00 00 78 F1
Note: 00 00 data is returned as 0 degrees
Set/read the gripper speed
set up
Command:FE FE 08 0E 06 00 20 00 32 AD 4C
Function code: 06 Write operation
Parameter: 00 32 Set the speed to 50, parameter range (1-100)
Return: FE FE 08 0E 06 00 20 00 01 B8 0C
Note: Success returns 00 01, failure returns 00 00
Read
Command: FE FE 08 0E 03 00 21 00 00 B8 50
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 21 00 32 6D D1
Note: 00 32 data returned is 50
Set absolute angle
Instruction: FE FE 08 0E 06 00 24 00 64 52 8D
Function code: 06 Write operation
Parameter: 00 64 Set the absolute angle to 100, parameter range (0-100)
Return: FE FE 08 0E 06 00 24 00 01 79 4D
Note: Success returns 00 01, failure returns 00 00
Due to the long response time, if the user keeps sending this command, it will be put into the queue and executed one by one. Absolute Angle will wait for the gripper to move to the specified position before returning the command. If there is an object blocking the movement during the movement, making the gripper unable to move to the specified position, the waiting timeout will return the failure command.
Pause exercise
Command: FE FE 08 0E 06 00 25 00 00 79 DD
Function code: 06 Write operation
Parameters: None
Return: FE FE 08 0E 06 00 25 00 01 B9 1C
Note: Success returns 00 01, failure returns 00 00
Pause motion is used to set the absolute angle. After sending this command, the absolute angle command will not be executed from the queue.
Resume exercise
Command: FE FE 08 0E 06 00 26 00 00 79 2D
Function code: 06 Write operation
Parameters: None
Return:FE FE 08 0E 06 00 26 00 01 B9 EC
Note: Success returns 00 01, failure returns 00 00
Resume motion is used to set the absolute angle. This instruction can resume the absolute angle queue execution.
Stop Movement
Command: FE FE 08 0E 06 00 27 00 00 B9 7C
Function code: 06 Write operation
Parameters: None
Return: FE FE 08 0E 06 00 27 00 01 79 BD
Note: Success returns 00 01, failure returns 00 00
Stop motion acts on absolute angles. This command will clear the absolute command queue.
Get the amount of data in the current queue
Command: FE FE 08 0E 03 00 28 00 00 BA 80
Function code: 03 Read operation
Parameters: None
Return: FE FE 08 0E 03 00 28 00 00 BA 80
Mark: 00 00, indicating that the number of instructions in the absolute angle queue is 0
This command is used to set the absolute angle. This command can obtain the number of commands in the absolute angle queue.
Set the virtual position value of the servo
set up
Command:FE FE 08 0E 06 00 29 00 08 BC 1C
Function code: 06 Write operation
Parameter: 00 08 Set the gripper position error range, parameter range (0-254)
Return:FE FE 08 0E 06 00 29 00 01 BA DC
Note: Success returns 00 01, failure returns 00 00
Read
Command: FE FE 08 0E 03 00 2A 00 00 7A 21
Function code: 03 Read operation
Parameters: None
Return:FE FE 08 0E 03 00 2A 00 08 BC 20
Note: 00 08 Data return 8
The default value is 8. The larger the virtual position setting, the lower the accuracy of the gripper position determination.
Set/read holding current
set up
Command:FE FE 08 0E 06 00 2B 00 FE 3A 3D
Function code: 06 Write operation
Parameter: 00 FE Set the clamping current to 254, parameter range (0-254)
Return:FE FE 08 0E 06 00 2B 00 01 7A 7D
Note: Success returns 00 01, failure returns 00 00
Read
Command:FE FE 08 0E 03 00 2C 00 00 7B C1
Function code: 03 Read operation
Parameters: None
Return:FE FE 08 0E 03 00 2C 00 FE FB 40
Note: 00 FE data returns 254. When setting the torque, the current of the clamped object will adapt accordingly. This command can set the clamping current by itself.