8.3.2. Force Sensor End-Effector Lua Protocol
Open the WebApp, click “Initial Setup”, “Peripherals”, “Force Sensor”, “Custom Protocol” in sequence. Click “Protocol Management” to configure the end-effector protocol. Currently, the preset built-in protocols for the force sensor are shown in the figure below.Version 3.9.2 has added two embedded combination protocols for gripper + force sensor: End_JD_XJC_V1.0.lua and End_JD_GZCX_V1.0.lua.
Figure 8.3‑2-2 Force Sensor Preset Built-in Protocol
8.3.3. Welding Handle End Lua Protocol
Open WebApp, then click “Initial Settings,” “Peripherals,” “Welding Handle,” “Custom Protocol” in sequence. Click “Protocol Management” to configure the end protocol. The currently preset embedded protocols for the welding handle are shown in the figure below. Version 3.9.2 added three new embedded combination protocols for SmartTool+gripper or force sensor: End_SM_JD_V1.3.lua, End_SM_GZCX_V1.3.lua, End_SM_XJC_V1.3.lua.
Figure 8.3‑2-3 Preset Embedded Protocols for Welding Handle
8.3.3.1. Automatic Generation of End Lua Protocol
This newly added feature allows for automatic generation of the end Lua protocol through web page configuration for protocols related to embedded SmartTool welding handle peripherals (currently only four protocols support automatic generation: End_SmartTool_V1.3.lua, End_SM_JD_V1.3.lua, End_SM_GZCX_V1.3.lua, End_SM_XJC_V1.3.lua). The generated protocol is uploaded and applied to the end without requiring the user to write it. Users configure the A, B, C, D, E, and IO keys of the SmartTool welding handle according to their needs. After configuration is complete, the robot must be disabled, and then click “Apply.” At this point, the page will prompt “Enter boot and apply open protocol?” Clicking Confirm will cause the robot to enter boot state and automatically upload the automatically generated end Lua protocol. After restarting the robot, the SmartTool can be used according to the configured keys.
Figure 8.3‑2-4 Automatic Generation of SmartTool Welding Handle Configuration Protocol
Figure 8.3‑2-5 Page Prompt “Enter boot and apply open protocol?”
8.3.3.2. SmartTool Program Generation Template Import
If the SmartTool key is configured with the program generation function, based on the open protocol, two types of generated programs are provided: a blank Lua program is generated by default, or the user can choose to upload a template starting with “template_” as the template for the new program. When the new program selects the template program, the Lua file generated by triggering “New Program” on the SmartTool includes the content of the uploaded template file. Any subsequently added instructions are appended after the template content.
Figure 8.3‑2-6 SmartTool Program Generation Template Import
8.3.3.3. SmartTool Motion Instruction Point Configuration
When configuring the “PTP,” “LIN,” and “ARC” instructions in SmartTool, you can choose the storage database for the generated instruction points to be “Global Teaching Points” or “Local Teaching Points.” When “Global Teaching Points” is selected, the generated instruction points can be viewed through “Teaching Program,” “Teaching Points.” When “Local Teaching Points” is selected, the generated instruction points can be viewed through “Teaching Program,” “Program Programming,” “Local Teaching Points.”
Figure 8.3‑2-7 SmartTool Motion Instruction Point “Global Teaching Points” and “Local Teaching Points” Configuration
8.3.3.4. SmartTool Anti-Mistouch Mode
The SmartTool based on the open protocol adds an anti-mistouch mode. Click “Initial Settings,” “Peripherals,” “Welding Handle,” “Custom Protocol” in sequence. After enabling the end protocol, you can see the switch for “Anti-Mistouch Mode.” When this function is enabled, the two key functions “Undo Program” and “Clear Program” on the SmartTool need to be pressed twice to trigger.
Figure 8.3‑2-8 SmartTool “Anti-Mistouch Mode” Function
8.3.3.5. Example of Lua End Peripheral Protocol for Welding Handle
The functions of the six keys A, B, C, D, E, and IO can be modified and defined by changing the key value on line 31 of the code. Among them, K38=Getbit(R[7],1) and K0=Getbit(R[7],2) are for “Clear Program” and “Undo Key” respectively and cannot be modified. The subsequent five K values can be modified according to the definitions in the End Full Peripheral Protocol document. In this example (embedded SmartTool protocol), the corresponding key functions are: A: LIN, B: PTP, C: Create Program, D: Weld Interruption Recovery, E: Weld Interruption Exit, IO: LIN+Welding+Weaving.
Example of Lua End Peripheral Protocol for Welding Handle (SmartTool)
function Getbit(X,Bit)
return ((X&(1<<Bit))>>Bit)
end
if(Getbit(GetRobotState(),0)==1)then
local SetParams={B6=3}-- B6 - Operating DO port number is DO3
SetWeldParams(SetParams)
while(1)
do
IwdgTaskHandle()
MainLoop()
UpDownLoadHandle()
SdoRwPara()
EndErrClear()
local BFlag=LuaBreak()
if(BFlag==1)then
break
end
local R={0}
local T={0x7D,0x01,0x30,0xC0,0x00,0x04,0x00,0x00,0x00,0x00}
DelayMs(100)
T[7],T[8],T[9],T[10]=GetIoCmd()
Dword=GetRobotState()
T[7]=Getbit(Dword,4)
T[12],T[11]=WeldToolCrcValue(T)
T[13]=0x0E
WeldToolSlaveSetCmd(T)
DelayMs(3)
Len=EndRxWeldData(R)
if((Len==13)and(R[1]==0x7D)and(R[2]==0x01)and(R[3]==0x30))then
local key={K38=Getbit(R[7],1),K0=Getbit(R[7],2),K3=Getbit(R[7],3),K25=Getbit(R[7],4),K39=Getbit(R[7],5),K27=Getbit(R[7],6),K28=Getbit(R[7],7), K44=Getbit(R[8],0),
K6=Getbit(R[8],1),K7=Getbit(R[8],2)}--smarttool welding handle key settings, Undo key - K38 Undo Program; Clear key - K0 Clear Program; A key - K3 LIN; B key - K25 PTP; C key - K39 Create Program; D key - K27 Weld Interruption Recovery; E key - K28 Weld Interruption Exit; IO key - K44 LIN+Welding+Weaving Manual/Auto key - K6 Manual/Auto; Run/Pause key - K7 Run/Pause
SetWeldToolKeys(key)
end
LuaGc()
end
end
8.3.4. Sensor Load Identification
Under the “Initial” -> “Basic” -> “Load” menu bar, click “Sensor Identification” to enter the sensor load identification interface.
Specific Pose Identification: Clear the end-effector load data, configure the force sensor, establish the sensor coordinate system, adjust the robot end-effector posture to vertical downward, perform “Zero Calibration” and then install the end-effector load. First, select the corresponding sensor tool coordinate system, adjust the robot so that the sensor and tool are vertical downward, record data, and calculate the mass. Then, adjust the robot to 3 different postures, record three sets of data respectively, calculate the center of mass, confirm it is correct and click Apply.
Dynamic Identification: Clear the end-effector load data, configure the force sensor, establish the sensor coordinate system, adjust the robot end-effector posture to vertical downward, perform “Zero Calibration” and then install the end-effector load. Click “Identification Start”, drag the robot to move, then click “Identification Stop”, and the load result will be automatically applied to the robot.
Auto Zero: After the sensor records the initial position, it can automatically zero.
Figure 8.3‑3 Sensor Load Identification
8.3.5. Force Sensor Assisted Dragging
After configuring the sensor, it can be paired with the sensor to provide better assistance for dragging the robot. For the first use, you can configure according to the data in the right figure. After applying, you do not need to enter the drag mode; directly drag the end-effector force sensor to control the robot to move in a fixed posture. (The data in the figure below is a reference standard)
Figure 8.3‑4 Force/Torque Sensor Drag Lock
Note
Singularity Strategy is a function developed under force sensor assisted locking for singularity crossing and avoidance.
Singularity Avoidance Strategy is the default function option. After enabling assisted dragging, the avoidance function is enabled by default. Singularity avoidance is a function that applies virtual force to move the robot away from a singular configuration when the robot is in a singular pose.
Singular Configurations:
Elbow Singularity: Rotation axes 2, 3, and 4 are in the same plane. At this time, the elbow joint is fully extended or fully contracted. Due to FR robot mechanical limits, the fully contracted configuration cannot be reached.
Wrist Singularity: Rotation axes 4 and 6 are parallel. Due to FR robot mechanical limits, this configuration cannot be reached.
Shoulder Singularity: The wrist center point is located in the plane formed by rotation axes 1 and 2.
Singularity Crossing Function: Select “Singularity Strategy” as “Cross” and apply. When the robot detects that the current pose is in a singular configuration, it automatically switches to the current loop drag mode. When it detects exiting the singular configuration, the drag mode switches back to force sensor assisted dragging to continue motion.
Adaptive Selection: Enable when assembly is required; after enabling, dragging becomes heavier;
Inertia Parameters: Adjust the feel during the dragging process, operate with caution under the guidance of technical personnel.
Damping Parameters:
Translation Direction: Recommended parameter range [100-200];
Rotation Direction: Recommended parameter range [3-10], with the RZ direction range [0.1-5];
Effect: When dragging with the sensor, increasing damping makes dragging difficult, decreasing damping makes dragging the robot too easy (recommended not to set too small);
Overall Damping Parameter Range: Translation XYZ: [100-1000]; Rotation RX, RY: [3-50], RZ: [2-10];
Maximum Drag Force is 50, Maximum Drag Speed is 180.
Stiffness Parameters: All set to 0;
Drag Force Threshold: Translation XYZ: [5-10]; Rotation RX, RY, RZ: [0.5-5];
Important
Locking is achieved by increasing the force threshold for translation directions XYZ or rotation directions RX, RY, RZ.
8.3.6. Force/Torque Sensor Collision Detection
Command Description: The “FT_Guard” command is the collision detection command. Select the corresponding sensor coordinate system, check the effective torque direction detection, set the current value, maximum collision threshold, and minimum collision threshold. The normal collision detection condition range is (Current Value - Min Threshold, Current Value + Max Threshold). Add the “Enable” and “Disable” commands to the program.
Figure 8.3‑5 FT_Guard Command Editing
Program Example:
No. | Command Format | Comment |
1 | FT_Guard(1,1,1,1,1,0,0,0,5,0,0,0,0,0,10,0,0,0,0,0,5,0,0,0,0,0) | # Force/Torque Collision Detection Enable |
2 | PTP(template1,100,-1,0) | # Motion Command |
3 | FT_Guard(0,1,1,1,1,0,0,0,5,0,0,0,0,0,10,0,0,0,0,0,5,0,0,0,0,0) | # Force/Torque Collision Detection Disable |
8.3.7. Force/Torque Sensor Force Control Motion
Command Description: The “FT_Control” command is the force control motion command, which allows the robot to move near the set force, commonly used in grinding scenarios. Select the corresponding sensor coordinate system, check the effective torque direction detection, set the detection threshold, and the PID proportional coefficients in each direction (generally set p to 0.001), set the maximum adjustment distance (for X,Y,Z) and maximum adjustment angle (for RX,RY,RZ). Add the “Enable” and “Disable” commands to the program.
Figure 8.3‑6 FT_Control Command Editing
Program Example:
No. | Command Format | Comment |
1 | FT_Control(1,11,1,0,1,0,0,0,10,0,5,0,0,0,0.001,0,0,0,0,0,0,0,0,10,5) | # Force/Torque Motion Control Enable |
2 | Lin(template3,100,-1,0,0) | # Motion Command |
3 | FT_Control(0,11,1,0,1,0,0,0,10,0,5,0,0,0,0.001,0,0,0,0,0,0,0,10,5) | # Force/Torque Motion Control Disable |
8.3.8. Force/Torque Sensor Spiral Insertion
Command Description: The “FT_Spiral” command is for spiral search insertion, generally used for shaft-hole assembly actions of cylindrical shafts. Before running the action, the robot end-effector needs to be dragged to the approximate position of the hole. According to the current scene, set the command parameters, add them to the program. After running, the robot will explore with a spiral motion.
Figure 8.3‑7 FT_Spiral Command Editing
Program Example:
No. | Command Format | Comment |
1 | FT_Control(1,10,0,0,1,0,0,0,0,0,5,0,0,0,0.0005,0,0,0,0,0,0,10,0) | # Force/Torque Motion Control Enable |
2 | FT_SpiralSearch(0,0.7,0,60000,5) | # Spiral Insertion |
3 | FT_Control(0,10,0,0,1,0,0,0,0,0,5,0,0,0,0.0005,0,0,0,0,0,0,10,0) | # Force/Torque Motion Control Disable |
8.3.9. Force/Torque Sensor Rotation Insertion
Command Description: The “FT_Rot” command is for rotation search insertion, generally used to follow the spiral insertion action, for keyed shaft-hole assembly. Before running the action, the robot end-effector needs to be moved to the hole position found by the spiral search or a taught hole position that is completely aligned. According to the current scene, set the command parameters, add them to the program. After running, the robot will explore with a slow rotation.
Figure 8.3‑8 FT_Rot Command Editing
Program Example:
No. | Command Format | Comment |
1 | FT_Control(1,10,0,0,1,0,0,0,0,0,5,0,0,0,0.0005,0,0,0,0,0,0,10,0) | # Force/Torque Motion Control Enable |
2 | FT_RotInsertion(0,3,0,5,1,0,1) | # Rotation Insertion |
3 | FT_Control(0,10,0,0,1,0,0,0,0,0,5,0,0,0,0.0005,0,0,0,0,0,0,10,0) | # Force/Torque Motion Control Disable |
8.3.10. Force/Torque Sensor Linear Insertion
Command Description: The “FT_Lin” command is for linear search insertion, generally used to follow the spiral insertion action or rotation insertion action, for keyed shaft-hole assembly. Before running the action, the robot end-effector needs to be moved to the hole position found by the spiral search, the end position of the rotation insertion action, or a taught hole position that is completely aligned. According to the current scene, set the command parameters, add them to the program. After running, the robot will perform linear motion in the set direction.
Figure 8.3‑9 FT_Lin Command Editing
Program Example:
No. | Command Format | Comment |
1 | FT_Control(1,10,0,0,1,0,0,0,0,0,5,0,0,0,0.0005,0,0,0,0,0,0,10,0) | # Force/Torque Motion Control Enable |
2 | FT_LinInsertion(0,50,1,0,100,1) | # Linear Insertion |
3 | FT_Control(0,10,0,0,1,0,0,0,0,0,5,0,0,0,0.0005,0,0,0,0,0,0,10,0) | # Force/Torque Motion Control Disable |
8.3.11. Force/Torque Sensor Surface Finding
Command Description: The “FT_FindSurface” command is for surface finding, generally used to find the surface of an object. According to the current scene, set the corresponding coordinate system, movement direction, movement axis, search linear speed, search linear acceleration, maximum search distance, action termination force threshold and other parameters, add them to the program. Run the program, the action starts executing, and the robot end-effector begins to slowly move towards the direction of the surface.
Figure 8.3‑10 FT_FindSurface Command Editing
Program Example:
No. | Command Format | Comment |
1 | PTP(1,30,-1,0) | # Initial Position |
2 | FT_FindSurface(0,1,3,1,0,100,5) | # Surface Finding |
8.3.12. Force/Torque Sensor Center Finding
Command Description: The “FT_CalCenter” command is for center finding, generally used to find the middle plane surface between two surfaces. According to the current scene, set the corresponding coordinate system, movement direction, movement axis, search linear speed, search linear acceleration, maximum search distance, action termination force threshold and other parameters, find surface A and surface B respectively, add them to the program. Run the program, the action starts executing, the robot slowly moves towards the direction of surface A, after locating surface A, the robot slowly moves towards the direction of surface B, after locating surface B, the center plane position can be calculated.
Figure 8.3‑11 FT_CalCenter Command Editing
Program Example:
No. | Command Format | Comment |
1 | PTP(1,30,-1,0) | # Initial Position |
2 | FT_CalCenterStart() | # Surface Finding Start |
3 | FT_Control(1,10,0,0,1,0,0,0,0,0,-10,0,0,0,0.00001,0,0,0,0,0,0,100,0) | # Force/Torque Motion Control Enable |
4 | FT_FindSurface(1,2,2,10,0,200,5) | # Locate Plane A |
5 | FT_Control(0,10,0,0,1,0,0,0,0,0,-10,0,0,0,0.00001,0,0,0,0,0,0,100,0) | # Force/Torque Motion Control Disable |
6 | PTP(1,30,-1,0) | # Initial Position |
7 | FT_Control(1,10,0,0,1,0,0,0,0,0,-10,0,0,0,0.00001,0,0,0,0,0,0,100,0) | # Force/Torque Motion Control Enable |
8 | FT_FindSurface(1,1,2,20,0,200,5) | # Locate Plane B |
9 | FT_Control(0,10,0,0,1,0,0,0,0,0,10,0,0,0,0.00001,0,0,0,0,0,0,100,0) | # Force/Torque Motion Control Disable |
10 | pos={} | # Define array pos |
11 | pos = FT_CalCenterEnd() | # Get located center Cartesian pose |
12 | MoveCart(pos,GetActualTCPNum(),GetActualWObjNum(),30,10,100,-1,0) | # Move to the located center position |
8.3.13. Custom Open Protocol
Click the “Custom Protocol” card to enter the interface, enable the force sensor. The configured device displays the force sensor. Click to enter the FT interface to query force sensor data.
Figure 8.3‑12 Enable Force Sensor
8.4. Welding Pendant
In the “Initial” -> “Peripherals” -> “Welding Pendant” interface, the welding pendant can currently be used through adapted devices and the end Lua custom open protocol.
8.4.1. Adapted Devices
8.4.1.1. Configuration Steps
Step1: Click the “Adapted Devices” card to enter the Adapted Devices interface. The configuration information is divided into Manufacturer, Type, Software Version, and Mounting Position. Users can configure the corresponding information according to specific production needs. If users need to change the configuration, they can first select the corresponding manufacturer, click the “Clear” button to clear the corresponding information, and reconfigure according to requirements.
Figure 8.4‑1 Welding Pendant Adapted Device Configuration
Important
The corresponding device should be in an inactive state before clicking to clear the configuration.
Step2: Configure key positions A-E and the IO key sequentially. After the Smart Tool configuration is completed, the task manager internally maintains the function corresponding to each button. When it detects that a button is pressed, it automatically executes the function item corresponding to that button.
A-E Key Functions:
Motion Command: When selecting PTP, LIN, or ARC motion commands, you need to input the corresponding point speed. For LIN and ARC commands, you can choose “Percentage” or “Physical Speed”:
Percentage: Input a debugging speed percentage. The robot moves at a percentage of its maximum speed. The actual robot movement speed is calculated as: V = Robot Maximum Speed × Global Speed Percentage × Point Speed Percentage. Hover the mouse over the small eye icon to the right of the “Point Speed” input box to display the actual physical speed (in mm/s) of the robot in both manual and automatic modes under the current settings.
Figure 8.4‑2-1 Display Actual Physical Speed Value When Inputting Percentage
Physical Speed: The input speed is the actual operating speed of the robot, in mm/s. The input acceleration is typically set to twice the speed. (The maximum physical speed of the LIN command is limited by the global speed percentage. If the robot’s maximum operating speed is 1000 mm/s and the global speed is 50%, then the maximum physical speed for the LIN command is 1000 × 50% = 500 mm/s).
Figure 8.4‑2-2 Input Actual Physical Speed
After successful configuration, a related motion command is added to the teaching program. When configuring the ARC motion command, you must first configure a PTP or LIN command.
DO Output: When selecting “DO Output,” a drop-down menu appears, allowing you to select DO0⁓DO7 options.
Figure 8.4‑2-3 Smart Tool Configuration (A-E Keys)
IO Key Functions:
IO Signal Configuration: The dropdown menu allows selection of DO0⁓DO7 options, CO0⁓CO7 options, End-DO0, End-DO1, and extended IO (Aux-DO0⁓Aux-DO127);
Combined Command: After selecting “IO Signal”, under specific conditions, the “Welder Selection” and “Point Speed” configuration items are displayed, generating different program commands.
Important
When the IO signal is configured as DO0~DO7 or CO0~CO7 (without “Arc Start” configured), the program adds SetDO; “Welder Selection” and “Point Speed” are hidden at this time.
When the IO signal is configured as End-DO0 or End-DO1, the program adds SetToolDO; “Welder Selection” and “Point Speed” are hidden at this time.
When the IO signal is configured as extended IO (without “Welder Arc Start” configured), the program adds SetAuxDO; “Welder Selection” and “Point Speed” are hidden at this time.
When the IO signal is configured as CO0~CO7 (with “Arc Start” configured) and “Welder Selection” is “None”, the program adds SetDO; “Welder Selection” and “Point Speed” are hidden at this time.
When the IO signal configuration item is extended IO (with “Welder Arc Start” configured) and “Welder Selection” is “None”, the program adds SetAuxDO; “Welder Selection” and “Point Speed” are hidden at this time.
When the IO signal is configured as CO0~CO7 (with “Arc Start” configured) or extended IO (with “Welder Arc Start” configured), and “Welder Selection” is “Welding”, the first press adds ARCStart, the second adds ARCEnd, the third adds ArcStart, the fourth adds ARCStart, alternating and repeating the above operations; “Welder Selection” and “Point Speed” are hidden at this time.
When the IO signal is configured as CO0~CO7 (with “Arc Start” configured) or extended IO (with “Welder Arc Start” configured), and “Welder Selection” is “LIN+Welding”, the first press adds LIN and ARCStart, the second adds LIN and ARCEnd, the third adds LIN and ARCStart, the fourth adds LIN and ARCEnd, alternating and repeating the above operations; “Welder Selection” and “Point Speed” are displayed at this time.
When the IO signal is configured as CO0~CO7 (with “Arc Start” configured) or extended IO (with “Welder Arc Start” configured), and “Welder Selection” is “LIN+Welding+Weaving”, the first press adds LIN, ARCStart, and WeaveStart, the second adds LIN, ARCEnd, and WeaveEnd, the third adds LIN, ARCStart, and WeaveStart, the fourth adds LIN, ARCEnd, and WeaveEnd, alternating and repeating the above operations; “Welder Selection” and “Point Speed” are hidden at this time.
Figure 8.4‑3 IO Key
8.4.2. Welding Handle End-Effector Lua Protocol
Click “Custom Protocol” to enter the welding handle function interface for adapting the end-effector Lua open protocol.
8.4.2.1. Protocol Management
Open the WebApp, click “Initial Setup”, “Peripherals”, “Welding Handle”, “Custom Protocol” in sequence. Click “Protocol Management” to configure the end-effector protocol. Currently, the preset built-in protocols for the welding handle are shown in the figure below.
Figure 8.4‑4 Welding Handle Preset Built-in Protocol
Turn on the “End-Effector Protocol Enable” slider to adapt the welding handle. The parameters are retained after a power restart once enabled.
Figure 8.4‑5 End-Effector Open Protocol Enable
8.4.2.2. Example of Combined Device Lua End-Effector Peripheral Protocol
The functions of the five buttons A, B, C, D, E can be modified and defined through the key values in line 30 of the code. Among them, K38=Getbit(R[7],1), K0=Getbit(R[7],2) are for “Clear Program” and “Undo Button” and cannot be modified. The subsequent 5 K values can be modified according to the definitions in the “End-Effector Full Peripheral Protocol” document.
In this example (embedded SmartTool protocol), the corresponding button functions are: A: MoveL, B: ArcStart, C: ArcEnd, D: Rewelding start, E: Rewelding quit.
function Getbit(X,Bit)
return ((X&(1<<Bit))>>Bit)
end
if(Getbit(GetRobotState(),0)==1)then
local SetParams={A3=2000,B6=3}--Set welding parameters, A3-Arc start/end timeout is 2000ms, B6-Operate DO port number is 3. To configure welding parameters, please refer to "RD36-Welding Handle Custom Parameter Table-V0.2-20250903"
SetWeldParams(SetParams)
while(1)
do
IwdgTaskHandle()
MainLoop()
UpDownLoadHandle()
SdoRwPara()
EndErrClear()
local BFlag=LuaBreak()
if(BFlag==1)then
break
end
local R={0}
local T={0x7D,0x01,0x30,0xC0,0x00,0x04,0x00,0x00,0x00,0x00}
DelayMs(100)
T[7],T[8],T[9],T[10]=GetIoCmd()
T[7]=Getbit(T[7],3)
T[12],T[11]=WeldToolCrcValue(T)
T[13]=0x0E
WeldToolSlaveSetCmd(T)
DelayMs(3)
Len=EndRxWeldData(R)
if((Len==13)and(R[1]==0x7D)and(R[2]==0x01)and(R[3]==0x30))then
local key={K38=Getbit(R[7],1),K0=Getbit(R[7],2),K3=Getbit(R[7],3),K32=Getbit(R[7],4),K33=Getbit(R[7],5),K27=Getbit(R[7],6),K28=Getbit(R[7],7),
K6=Getbit(R[8],1),K7=Getbit(R[8],2)}--SmartTool welding handle button settings, Undo button - K38 Undo program; Clear button - K0 Clear program; A button - K3 Linear Move; B button - K32 ArcStart; C button - K33 ArcEnd; D button - K27 Rewelding start; E button - K28 Rewelding quit; Manual/Auto button - K6 Manual/Auto; Run/Pause button - K7 Run/Pause
SetWeldToolKeys(key)
end
LuaGc()
end
end
8.4.2.3. Open Protocol Template
Taking the Jiashida adaptation open protocol as an example:
function Getbit(X,Bit) -- Extract the corresponding bit of X
return ((X&(1<<Bit))>>Bit)
end
while(1)
do
IwdgTaskHandle()
MainLoop()
UpDownLoadHandle()
SdoRwPara()
EndErrClear()
local BFlag=LuaBreak()
if(BFlag==1)then
break
end
RxData={}
T0={0x7D,0x08,0x22,0xB3,0x01,0x00}
T1={0x7D,0x08,0x22,0xB4,0x03,0x00}
T2={0x7D,0X08,0X22,0XB5,0x1E,0x00}
DelayMs(5)
RxLen=WeldToolMasterGetCmd(RxData) -- The WeldToolMasterGetCmd() function is used to get commands sent by the welding pendant (for when the welding pendant acts as the master station). Requires pushing an empty table onto the stack (X={}) when used.
if (RxData[1]==0x7D)and(RxData[2]==0x08)and(RxData[3]==0x22) then
if(RxData[4] == 0xB3)then
-- Taking Jiashida welding pendant function code as an example, here it is 0xB3 (Set Welding Parameters).
local SetParams={A2=RxData[7],A1=RxData[8],A6=(ByteToDwFloat(RxData[9],RxData[10],RxData[11],RxData[12]))*1000,
A8=(ByteToDwFloat(RxData[13],RxData[14],RxData[15],RxData[16])),A7=(ByteToDwFloat(RxData[17],RxData[18],RxData[19],RxData[20])),
A4=(ByteToDwFloat(RxData[21],RxData[22],RxData[23],RxData[24]))*1000,A5=(ByteToDwFloat(RxData[25],RxData[26],RxData[27],RxData[28]))*1000}
SetWeldParams(SetParams) -- The SetWeldParams() function is used to set the controller's welding parameters. Need to refer to the welding pendant custom parameter table to determine the welding parameters that need to be modified (divided into 3 areas A, B, C in total).
Dword=GetRobotState() -- The GetRobotState() function is used to get the robot's related status. Currently bit0 is the robot enable status, bit1 is the robot fault status, bit2 is the robot moving status, bit3 is the arc start/end command signal. Refer to End Full Peripherals Protocol V2.7.
T0[7]=((Dword)&(1<<1))
T0[8],T0[9]=WeldToolCrcValue(T0) -- WeldToolCrcValue() Faro custom protocol CRC check
T0[10]=0x0E
EndTxWeldData(T0) -- The EndTxWeldData() function is used to send packaged data (here it is responding to the welding pendant's set welding parameters command).
DelayMs(5)
end
if(RxData[4] == 0xB4)then -- 0xB4 Real-time Control Command
local key={K0=Getbit(RxData[7],0),K1=Getbit(RxData[7],1),K2=Getbit(RxData[7],2),K3=Getbit(RxData[7],3),
K4=Getbit(RxData[7],4),K5=Getbit(RxData[7],5),K6=Getbit(RxData[7],6),K7=Getbit(RxData[7],7),
K8=Getbit(RxData[8],0),K9=Getbit(RxData[8],1),K10=Getbit(RxData[8],2),K11=Getbit(RxData[8],3),
K12=Getbit(RxData[8],4),K13=Getbit(RxData[8],5),K14=Getbit(RxData[8],6),K15=Getbit(RxData[9],0),
K16=Getbit(RxData[9],1),K17=Getbit(RxData[9],2),K18=Getbit(RxData[9],3),K19=Getbit(RxData[9],4),
K20=Getbit(RxData[9],5),K21=Getbit(RxData[9],6),K22=Getbit(RxData[9],7),K23=Getbit(RxData[10],0),
K24=Getbit(RxData[10],1)} -- Key values need to refer to End Full Peripherals Protocol V2.7 Table 26. K0-K31 correspond to DWordInput10's bit0-bit31, K32-K63 correspond to DWordInput9's bit0-bit31.
SetWeldToolKeys(key) -- The SetWeldToolKeys() function is used to upload the welding pendant button status. Can adjust the key values filled in the table according to the actual situation of the welding pendant.
Dword=GetRobotState()
T1[7]=(Dword)&(0x1)
T1[8]=(Dword>>1)&(0x1)
T1[9]=(Dword>>2)&(0x1)
T1[10],T1[11]=WeldToolCrcValue(T1)
T1[12]=0X0E
EndTxWeldData(T1)
DelayMs(5)
end
if(RxData[4] == 0xB5)then
-- Read Welding Parameters (Get from the controller, give to the welding pendant)
local wldpams={"A2","A1","A6","A8","A7","A4","A5"}
-- Fill according to the welding parameters actually needed by the welding pendant. Jiashada needs these here, refer to End Full Peripherals Protocol V2.7 Table 26.
GetWeldParams(wldpams) -- GetWeldParams() gets the corresponding welding parameters and replaces their values in the table (assuming A2=100, then after calling the function, wldpams[1]=100).
T2[7]=wldpams[1]
T2[8]=wldpams[2]
wldpams[3]=wldpams[3]/1000
wldpams[6]=wldpams[6]/1000
wldpams[7]=wldpams[7]/1000
for i=0,4 do
T2[9+(i*4)+3],T2[9+(i*4)+2],T2[9+(i*4)+1],T2[9+(i*4)+0]=DwFloatToByte(wldpams[3+i])
end
for i=0,7 do
T2[29+i]=0
end
T2[37],T2[38]=WeldToolCrcValue(T2)
T2[39]=0x0E
EndTxWeldData(T2)
DelayMs(5)
end
end
LuaGc()
end
8.4.2.4. Instructions Supported by Open Protocol
The following instructions can be configured in the open protocol, while bits 39-63 are reserved for future expansion.
Table 8.4-1 Instructions Supported by Open Protocol
Bit | Description |
0 | Clear Program |
1 | Save Program |
2 | Generate Safe Point (LIN Command) |
3 | Generate Linear Motion Point (LIN Command) |
4 | Add Arc Transition Point |
5 | Add Arc End Point and Generate ARC Command |
6 | Switch Mode, default is Manual Mode |
7 | Toggle Robot Run Status |
8 | Toggle Robot Drag Status |
9 | Start Spot Weld |
10 | Add Start Weave Arc Command |
11 | Add End Weave Arc Command |
12 | Jog in Positive X Direction |
13 | Jog in Negative X Direction |
14 | Jog in Positive Y Direction |
15 | Jog in Negative Y Direction |
16 | Jog in Positive Z Direction |
17 | Jog in Negative Z Direction |
18 | Jog in Positive RX Direction |
19 | Jog in Negative RX Direction |
20 | Jog in Positive RY Direction |
21 | Jog in Negative RY Direction |
22 | Jog in Positive RZ Direction |
23 | Jog in Negative RZ Direction |
24 | Generate Start Point |
25 | PTP |
26 | Fixed Pose Drag |
27 | Weld Interruption Recovery |
28 | Weld Interruption Exit |
29 | SetDO |
30 | Offline |
31 | Configuration Parameter Update |
32 | ArcStart |
33 | ArcEnd |
34 | Lin+ArcStart+WeaveStart |
35 | Lin+ArcEnd+WeaveEnd |
36 | Lin+ArcStart |
37 | Lin+ArcEnd |
38 | Undo Program |
39 | Reserved |
… | Reserved |
63 | Reserved |
8.4.2.5. Configurable Parameters in Open Protocol
The following parameters can be configured in the open protocol.
Table 8.4-2 Configurable Parameters in Open Protocol
Index | Data Content | Data Type | Range |
0 | Welding Speed | float | 0-100% |
1 | Air Move Speed | float | 0-100% |
2 | Arc Start/End Timeout | float | 0-65535(ms) |
3 | Weave Left Dwell Time | float | 0-99999 (ms) |
4 | Weave Right Dwell Time | float | 0-99999 (ms) |
5 | Spot Weld Time | float | 0-99999 (ms) |
6 | Weave Width | float | 0-1000 (0.1mm) |
7 | Weave Frequency | float | 0-100(0.1Hz) |
8 | Welder Control Type; 0-Control Box IO; 1-Digital Communication Protocol (UDP) | float | 0-255 |
9 | Welding Process Number (0-99) | float | 0-99 |
10 | Weave Type | float | 0-255 |
11 | Current Control Output Analog Output Port | float | 0-1 |
12 | Voltage Control Output Analog Output Port | float | 0-1 |
13 | Operation DO Port Number | float | 0-15 |
14 | Weave Parameter Number | float | 0-255 |
15 | Manual Mode Global Speed | float | 0-100% |
16 | Auto Mode Global Speed | float | 0-100% |
17 | Welding Current | float | 0-999990 (0.1A) |
18 | Welding Voltage | float | 0-999990 (0.1V) |
19 | Single Jog Maximum Distance | float | 0-1000 (0.1mm) |
20 | Welder Ready Extended DI Port | float | 0-127 |
21 | Arc Success Extended DI Port | float | 0-127 |
22 | Weld Interruption Recovery Extended DI Port | float | 0-127 |
23 | Weld Interruption Exit Extended DI Port | float | 0-127 |
24 | Welder Arc Start Extended DO Port | float | 0-127 |
25 | Gas Detection Extended D0 Port | float | 0-127 |
26 | Forward Wire Feed Extended D0 Port | float | 0-127 |
27 | Reverse Wire Feed Extended D0 Port | float | 0-127 |
28 | Weld Interruption Recovery Enable | float | 0-1 |
29 | Go to Recovery Point Speed | float | 0-100% |
30 | Motion Mode | float | 0-1 |
31 | Welding Arc Interruption Detection Enable | float | 0-1 |
32 | Whether to Include Wait Time(ms) | float | 0-1 |
33 | Weave Callback Ratio | float | 0-100% |
34 | Weave Position Wait Type | float | 0-255 |
35 | Arc Start Time | float | 0-65535 (ms) |
36 | Arc End Time | float | 0-65535 (ms) |
37 | Welding Arc Interruption Confirmation Duration | float | 0-65535 (ms) |
38 | Overlap Distance | float | 0-1000(0.1mm) |
39 | Arc Start Current | float | 0-999990(0.1A) |
40 | Arc Start Voltage | float | 0-999990(0.1V) |
41 | Arc End Current | float | 0-999990(0.1A) |
42 | Arc End Voltage | float | 0-999990(0.1V) |
43 | Minimum Welding Current | float | 0-999990(0.1A) |
44 | Maximum Welding Current | float | 0-999990(0.1A) |
45 | Analog Output Corresponding to Minimum Welding Current | float | 0-100(0.1A) |
46 | Analog Output Corresponding to Maximum Welding Current | float | 0-100(0.1A) |
47 | Minimum Welding Voltage | float | 0-2000(0.1V) |
48 | Maximum Welding Voltage | float | 0-2000(0.1V) |
49 | Analog Output Corresponding to Minimum Welding Voltage | float | 0-100(0.1V) |
50 | Analog Output Corresponding to Maximum Welding Voltage | float | 0-100(0.1V) |
51 | Vertical Triangle Weave Left Chord Length | float | 0-1000(0.1mm) |
52 | Vertical Triangle Weave Right Chord Length | float | 0-1000(0.1mm) |
53 | Weave Direction Azimuth Angle | float | -1800-1800(0.1°) |
54 | Weave Direction Tilt Angle | float | -1800-1800(0.1°) |
55 | Vertical Triangle Weave Apex Wait Time | float | 0-99999(ms) |
8.5. Spray Gun
8.5.1. Spray Gun Peripheral Configuration Steps
Step1: In the “Initial” -> “Peripherals” menu bar, click “Spray Gun” to enter the spray gun configuration interface.
The spraying function allows one-click configuration of keys for quick setup of the required DOs for spraying (by default, DO10 is configured for spray start/stop, DO11 for gun cleaning).
Users can also customize DO configuration according to their needs in “Initial” -> “Basic” -> “I/O Settings”.
Important
Before using the spraying function, the corresponding tool coordinate system must be established and applied during program teaching.
Step2: After configuration is complete, click the four buttons “Start Spraying”, “Stop Spraying”, “Start Cleaning”, and “Stop Cleaning” to debug the spray gun.
Figure 8.5‑1 Spray Gun Configuration
Step3: Select the “Spray Gun” command in the program command interface. According to the specific program teaching requirements, add the four instructions “Start Spraying”, “Stop Spraying”, “Start Cleaning”, and “Stop Cleaning” at the appropriate locations.
Figure 8.5‑2 Spray Gun Commands
8.5.2. Spraying Program Teaching
No. | Command Format | Comment |
1 | Lin(template1,100,-1,0,0) | #Start spraying point |
2 | SprayStart() | #Start spraying |
3 | Lin(template2,100,-1,0,0) | #Spraying path |
4 | Lin(template3,100,-1,0,0) | #Stop spraying point |
5 | SprayStop() | #Stop spraying |
6 | Lin(template4,100,-1,0,0) | #Cleaning point |
7 | PowerCleanStart() | #Start cleaning |
8 | WaitTime(5000) | #Cleaning time ms |
9 | PowerCleanStop() | #Stop cleaning |
8.6. Welding Machine
Collaborative robots carrying welding torches for welding operations can significantly improve welding efficiency and quality. Faro collaborative robots can control welding through three methods: “Controller IO”, “Digital Communication Protocol (UDP)”, or “Digital Communication Protocol (Modbus TCP)”:
Controller IO: The robot controls the welding current and voltage by setting the control box analog output (0-10V), controls welding arc initiation, wire feeding, and gas supply through the control box digital output, and collects signals such as welder ready and arc success through the control box digital input.
Digital Communication Protocol (UDP): The robot communicates with a PLC via UDP, and the PLC then communicates with the welding machine via CANOpen bus or other protocols to control welding voltage, current, and operations like arc initiation, wire feeding, and gas supply (Refer to Appendix 1 for the robot UDP communication protocol content).
Digital Communication Protocol (Modbus TCP): This refers to the controller peripheral open protocol, typically a runnable LUA program. The program includes commands for creating communication, cyclically writing control data to the slave device, and reading real-time status data. When this LUA program is executed, the robot establishes communication with the device and performs data exchange. The IP address, port number, cycle, and other communication parameters can be customized in the controller peripheral open protocol LUA program. Users need to modify the protocol content according to the actual device situation when using it. Devices supported by the controller peripheral open protocol include grinding heads, laser sensors, CNC, welding machines, etc. The controller peripheral open protocol file name must start with CtrlDev_, such as “CtrlDev_Welding.lua”. A maximum of 4 open protocols can run simultaneously.
Figure 8.6‑1 Welding Machine
Welding control via “Controller IO” or “Digital Communication Protocol (UDP)” mainly includes the following steps: ① Welding torch installation and signal wiring; ② Welding machine parameter configuration; ③ Writing welding control programs.
8.6.1. Welding Torch Installation
The welding torch is installed at the robot end via an adapter plate, and the welding torch cable must be fixed to the robotic arm.
Figure 8.6‑2 Welding Torch Installed at Robot End
After the welding torch is fixed and installed, calibrate the welding torch tool coordinate system using the six-point method and apply it as the current tool coordinate system. The calibration accuracy of the welding torch tool coordinate system will affect the actual welding accuracy.
Figure 8.6-3 Robot Tool Coordinate System Calibration and Application
8.6.2. Welding Machine Parameter Configuration
Collaborative robots can control the welding process through “Controller IO” signals or “Digital Communication Protocol”. The configuration operations for these two methods mainly differ in the following two points:
① When using “Controller IO”, it is necessary to set the correspondence between the actual controlled welding current/voltage and the control box analog output values.
② When using “Digital Communication Protocol”, communication parameters need to be configured.
8.6.2.1. “Controller IO” Welding Control Configuration
In the “Initial” -> “Peripherals” -> “Welding Machine” menu bar, click the “Controller I/O” card to enter the interface.
Figure 8.6-4 Controller I/O
8.6.2.1.1. Welding IO Signal Configuration
As shown in the figure below, select the DI input ports for the welder status signals and the DO output ports for the welder control signals, then click the “Configure” button. The meanings of each signal are as follows:
Figure 8.6-5 Set Welding Machine Signal Ports
Welder Ready: This signal is output from the welding machine to the robot when the welding machine is ready to perform welding operations.
When the welding machine is not ready due to faults or other reasons, this signal is not input to the robot. At this time, the robot WebApp prompt in the upper right corner “Welder not ready”. If your welding machine does not have a welder ready signal, you can set this port to “None”.
Figure 8.6-6 Welder Not Ready Error
Figure 8.6-7 Welder Ready Set to “None”
Arc Success: The arc has been successfully initiated. After the robot outputs the arc initiation signal to the welding machine, it waits for the arc success feedback signal from the welding machine. If the robot does not detect the arc success signal from the welding machine within the set timeout period, the robot reports an “Arc initiation timeout” error.
If the arc success signal is not configured, welding can still be performed using the robot welding function, but the robot will report a “Arc success DI not configured” warning. If your welding machine has an arc success signal output, we recommend configuring this signal for safer welding.
Figure 8.6-8 Arc Initiation Timeout Error
Figure 8.6-9 Arc Success DI Not Configured Warning
Welding Interruption Recovery: Triggered when the arc is unexpectedly interrupted during robot welding or the operator actively pauses welding. When this signal input to the robot changes from invalid to valid after a welding interruption, the robot automatically resumes welding from the original interruption position.
Welding Interruption Exit: Triggered when the arc is unexpectedly interrupted during robot welding or the operator actively pauses welding. When this signal input to the robot changes from invalid to valid after a welding interruption, the robot terminates welding. After termination, welding cannot be resumed.
Welding Arc Initiation: The DO output port through which the robot controls the welding machine to initiate the arc. When the robot program executes the arc initiation command, the corresponding DO output port for arc initiation automatically outputs a valid signal.
Gas Detection: The DO output port through which the robot controls the welding machine to supply gas. When the robot executes the welding gas supply command, the corresponding DO output port for gas supply automatically outputs a valid signal.
Forward Wire Feed: The DO output port through which the robot controls the welding machine for forward wire feeding. When the robot executes the forward wire feed command, the corresponding DO output port for forward wire feed automatically outputs a valid signal.
Reverse Wire Feed: The DO output port through which the robot controls the welding machine for reverse wire feeding. When the robot executes the reverse wire feed command, the corresponding DO output port for reverse wire feed automatically outputs a valid signal.
8.6.2.1.2. Welding Process Parameter Configuration
As shown in the figure below, find the “Welding Process Parameters” section on the welding configuration page. The collaborative robot provides 100 sets of welding process parameters, numbered 0 to 99. Process number 0 indicates not using the welding process curve, while process numbers 1-99 use the welding process curve.
Figure 8.6-10 Welding Process Parameter Configuration
When using the welding process curve, take selecting welding process number 1 as an example. Input the parameters from Arc Initiation Current to Arc Closing Time as shown in Figure 8, then click the “Configure” button. The actual welding process represented by these parameters is as follows:
① Set welding current 200A, voltage 23V; ② Execute arc initiation, wait for arc success; ③ After arc success, maintain the arc for 500ms (Arc initiation time, robot does not move); ④ Set welding current 150A, welding voltage 21V, then the robot starts moving and performs welding; ⑤ After welding to the end point, set welding current to 100A, welding voltage to 19V (Arc closing current, Arc closing voltage); ⑥ After setting the arc closing current and voltage, maintain arc burning for 500ms (robot does not move), finally extinguish the arc.
When not using the welding process curve, i.e., selecting welding process parameter number 0, as shown below, the welding process is: ① Set welding current and welding voltage; ② The robot controls the welding machine to initiate the arc and waits for arc success; ③ After arc success, the robot starts moving and performs welding; ④ The robot extinguishes the arc immediately after welding to the end point.
Figure 8.6-11 Not Using Welding Process Curve