top of page

8.7.4.5. Extended Axis Programming

8.7.4.5. Extended Axis Programming

In “Teaching Program” -> “Program Programming”, create a new user program “testServo.lua” and select “Peripheral Instructions”.

Figure 8.7‑43 Open Peripheral Instructions

Click “Extended Axis” to open the Add Extended Axis Instruction interface. Select the combination method as “Controller + Servo Drive (485)”, set the control mode to “Position Mode”, and click the “Add” button on the right. Scroll to the bottom of the Add Extended Axis Instruction interface and click the “Apply” button.

Figure 8.7‑44 Set Extended Axis Control Mode

Now, a set of instructions for switching the servo control mode appears in the “testServo.lua” program. You can switch the robot to automatic mode and execute this program.

Figure 8.7‑45 Set Servo Control Mode Program

How to control servo motion through a user program? Similarly, open the Add Extended Axis Instruction interface, as shown below, find the parameter configuration bar. Taking position mode as an example, enter the target position and run speed, click the “Add” button; scroll to the bottom of the Add Extended Axis Instruction interface, click the “Apply” button, and close the Add Extended Axis Instruction interface.

Figure 8.7‑46 Add Position Mode Motion Instruction

The “testServo.lua” program adds a servo motion instruction: “AuxServoSetTargetPos(1,50,5)”. The meanings of the three parameters in the instruction function are:

  • 1: Servo number is 1.

  • 50: Target position.

  • 5: Target speed.

Figure 8.7‑47 Position Mode Servo Motion Program

Switch the robot to automatic mode and run the program. Now your servo will move to the 50mm position at a speed of 5mm/s.

So far, we have completed the preliminary configuration and testing of RS485 controlled servo extended axes. You can write programs combining robot motion and servo motion according to the actual situation, such as the example program below.

8.7.4.5.1. Example Program for Coordinated Motion between Extended Axis and Robot

No.

Command Format

Comment

1

AuxServoSetTargetPos(1,50,5)

#Extended axis moves to reset point

2

if(GetDI(8,0) == 1) then

#If CI0 input is valid

3

AuxServoSetTargetPos(1,50,5)

#Extended axis moves to 50mm

4

PTP(testptp1,100,-1,0)

#Robot moves to testptp1 point

5

elseif(GetDI(9,0) == 1) then

#If CI1 input is valid

6

AuxServoSetTargetPos(1,150,5)

#Extended axis moves to 150mm

7

PTP(testptp2,100,-1,0)

#Robot moves to testptp2 point

8

else

#If both CI0 and CI1 inputs are invalid

9

AuxServoSetTargetPos(1,300,5)

#Extended axis moves to 300mm

10

PTP(testptp3,100,-1,0)

#Robot moves to testptp3 point

11

end

#End

8.7.4.6. Summary

In summary, the key points for configuring RS485 communication between the collaborative robot and the servo extended axis are as follows:

  1. Correctly connect the RS485 communication cable between the collaborative robot and the servo drive;

  2. Correctly select the control mode for the servo extended axis;

  3. After switching the control mode, you must first disable the servo, then enable the servo again for the control mode switch to take effect.

8.8. Line Laser Sensor

The F&R collaborative robot is used in conjunction with a laser sensor to identify feature positions such as welds, achieving the goals of simplified programming and improved production efficiency. The collaborative robot can be adapted to laser sensors from three manufacturers: Ruiniu, Chuangxiang, and Quanshi. When using different sensors, only the corresponding communication protocol needs to be loaded.

8.8.1. Hardware Connection

Before using the laser sensor, it needs to be installed in a suitable position. Connect the laser sensor’s network cable directly or through a switch to any RJ45 interface on the robot control box.

8.8.2. Sensor Configuration

Please ensure your laser sensor and welding torch are fixedly installed on the robot end flange, the laser sensor is connected to the robot control box via a network cable, and the IP addresses of the laser sensor and the robot control box are on the same subnet. Turn on the power for both the robot and the sensor. The figure below shows the installation of a Ruiniu laser sensor.

Figure 8.8‑1 Laser Sensor Installation

In the communication configuration section, enter the sensor’s IP address and port number, click the “Configure” button. The sampling period defaults to 25, select “Laser Plane Coordinate System” for the coordinate system, choose the corresponding communication protocol according to your sensor model, and click the “Load” button.

Figure 8.8‑2 Laser Sensor Configuration

In the “Tracking Sensor Test” section, click “Open” and then “Close” the sensor sequentially, observing whether the sensor’s laser turns on or off. If the laser turns on and off normally, it indicates that communication has been successfully established between the robot and the sensor. Otherwise, please check if parameters such as the IP address and port number are correct, and if the network connection between the sensor and the robot is proper.

Figure 8.8‑3 Laser Sensor Communication Test

8.8.3. Sensor Calibration

Before using the laser sensor, it needs to be calibrated. The calibration accuracy directly affects the tracking accuracy of the laser sensor. Calibration methods for the laser sensor include the Five-Point Method, Six-Point Method, and Eight-Point Method. Taking the most commonly used Five-Point Method in welding applications as an example, the calibration principle is to first point the tool (welding torch) to a fixed calibration point (as shown in Figure 4), and then have the laser sensor irradiate and recognize this point from four different poses.

Note

This calibration point must be accurately recognizable by the laser sensor; otherwise, precise calibration cannot be achieved.

Then, the sensor coordinate pose is calculated. The calibration process is described in detail below:

Figure 8.8‑4 Laser Sensor Calibration Point

Step1: Open the robot WebApp, navigate to “Initial” -> “Basic” -> “Tool Coordinate” to enter the Tool Coordinate System interface. Select an unused tool coordinate system, click to modify its name to “Welding Torch”, set the tool type to “Tool”, and the installation location to “End Flange”.

Figure 8.8‑5 Setting the “Welding Torch” Coordinate System

Select another unused coordinate system, change its name to “Laser Sensor”, set the tool type to “Sensor”, and the installation location to “End Flange”.

Figure 8.8‑6 Setting the “Laser Sensor” Coordinate System

Step2: Calibrate the tool coordinate system of the welding torch using the Six-Point Method: Select the “Welding Torch” coordinate system, click the modify button, and use the Six-Point Method to calibrate the welding torch tool coordinate system (for specific calibration methods, refer to the F&R documentation, which will not be detailed here).

Figure 8.8‑7 “Welding Torch” Coordinate System Calibration

Step3: In the “Tool Coordinate System Settings”, select the 0th coordinate system (Base Coordinate System), default name “toolcoord0”, click “Apply” to switch the current coordinate system to the base coordinate system.

Figure 8.8‑8 Sensor Calibration Step 1

Step4: Select the previously set “Laser Sensor” coordinate system again (do not click “Apply”), click the “Edit” button, select the tool type as “Sensor”, confirm the sensor is fixed on the “Robot End Flange”, and select the calibration method as “Five-Point Method”.

Figure 8.8‑9 Sensor Calibration Step 2

Step5: Jog the robot so that the tip of the welding torch aligns with the calibration point, select the “Welding Torch” coordinate system, click “Apply”, then click “Set Point 1”, as shown in Figure 13.

Figure 8.8‑10 Sensor Calibration Step 3

Figure 8.8‑11 Sensor Calibration Step 4

Step6: Select the 0th coordinate system (“toolcoord0”) again; then select the “Sensor” coordinate system (do not click “Apply”), and you can continue with the calibration.

Figure 8.8‑12 Sensor Calibration Step 5

Figure 8.8‑13 Sensor Calibration Step 6

Step7: Move the laser sensor position so that the laser beam just scans the calibration point, click “Set Point 2”; at this time, the sensor output value at the corresponding sequence number on the left will display the current sensor data. If the data is normal, it indicates the current calibration point was successful; otherwise, recalibration is needed.

Figure 8.8‑14 Sensor Calibration Step 7

Figure 8.8‑15 Sensor Calibration Step 8

Step8: Sequentially make the laser irradiate the calibration point from three more different poses, and click “Set Point 3”, “Set Point 4”, and “Set Point 5” respectively. Finally, ensuring the data for each point is normal, click the “Calculate” button.

Figure 8.8‑16 Sensor Calibration Step 9

Step9: At this point, the WebApp displays the sensor calibration result and accuracy. Click the “Apply” button to complete the laser sensor calibration. If the calibration accuracy is too poor, you can choose to click the “Cancel” button and recalibrate.

Figure 8.8‑17 Sensor Calibration Accuracy

8.8.4. Laser Sensor Application

Before using the laser sensor, first apply the “Welding Torch” tool coordinate system as the current tool coordinate system.

Figure 8.8‑18 Apply Welding Torch Coordinate System

8.8.4.1. Laser Sensor Teaching Points

Jog the robot so that the laser sensor beam points to the desired weld seam point for teaching. In the WebApp, select the sensor as “Laser Sensor”, enter the sensor point name as “laserPt”, and click the “Add” button. Create a new user program “testLaser.lua”, create a PTP motion command, select “laserPt” as the target point, and execute this instruction step by step. At this point, the welding torch will move to the point previously indicated by the laser sensor.

Figure 8.8‑19 Laser Sensor Weld Seam Point

Figure 8.8‑20 Teaching Sensor Point

Figure 8.8‑21 Welding Torch Pointing to Weld Seam Point

8.8.4.2. Laser Seam Finding + Tracking

The collaborative robot, working with the laser sensor, requires the following steps to complete the laser seam finding + laser tracking function:

  1. The robot moves to a point outside the weld seam;

  2. Start laser seam finding, and the robot moves towards the weld seam position carrying the laser sensor;

  3. The laser sensor identifies the weld seam, and the robot moves the welding torch to the identified weld seam start point;

  4. Laser tracking begins, and simultaneously the robot moves towards the weld seam end point, with the laser sensor recording the position in real time during the movement;

  5. The welding torch moves along the positions recorded by the laser sensor, achieving the tracking effect.

Before debugging seam finding and tracking, please ensure the sensor is correctly installed, the “Welding Torch” tool coordinate system is correctly calibrated, and the laser sensor is also correctly calibrated. Assuming the green line in the figure is the weld seam to be welded, to make the robot automatically find the welding start point A and automatically weld to point B, the following instructions need to be written:

Figure 8.8‑22 Sensor Installation

8.8.4.2.1. Writing Seam Finding Instructions

Create a new user program “laserTrack.lua”, select “Welding Instructions”. Click “Laser Tracking”, and the laser tracking instruction addition page will pop up.

Figure 8.8‑23 Laser Tracking Instruction

Find the “Seam Finding Command”, select the coordinate system name as “Laser Sensor”, direction select “+x” indicating the robot carrying the laser sensor moves from the current position along the “+x” direction of the “Welding Torch” coordinate system while searching for the weld seam. “Speed” is the moving speed for the laser sensor seam finding, Length is the maximum seam finding length for the laser sensor. If the robot exceeds this length without finding the weld seam, it will report an error. Maximum Seam Finding Time is similar to the length; if this time is exceeded without finding the weld seam, the robot reports an error. Please input the above parameters correctly according to the actual scenario. Click the “Seam Finding Start” and “Seam Finding End” instructions sequentially, and click the “Apply” button.

Figure 8.8‑24 Adding Seam Finding Instructions

At this point, the corresponding laser seam finding start and end instructions will be added to “laserTrack.lua”.

Figure 8.8‑25 Seam Finding Program

8.8.4.2.2. Writing Instruction to Move to Seam Finding Point

Add a Linear (LIN) point-to-point motion instruction, with the target point being “seamPos”, which is the laser sensor seam finding point.

Note

The “seamPos” point is an internal point in the robot system dedicated for laser sensor seam finding. There is no need to teach this point manually; after laser sensor seam finding, the seam finding point information is automatically stored in the “seamPos” point.

Offset can be set for the seam finding point. The offset type can be “Base Coordinate System Offset”, “Tool Coordinate System Offset”, or “Laser Raw Data Offset”.

Figure 8.8‑26 Seam Finding Offset Options

When the seam finding offset function is enabled, offset parameters can be set. “dx” represents the offset distance along the x-direction of the selected coordinate system, “drx” represents the rotation angle around the x-axis of the selected coordinate system. Click the “Add” button, then click the “Apply” button.

Figure 8.8‑27 Seam Finding Offset Parameter Settings

At this point, the instruction to move to the seam finding point will be added to “testTrack.lua”, as shown in Figure 32.

Figure 8.8‑28 Seam Finding Offset Program

8.8.4.2.3. Writing Laser Tracking Instructions

Open the “Laser Tracking” instruction addition page again, click the “Start Tracking” and “Stop Tracking” buttons sequentially, and finally click the “Apply” button at the bottom of the page.

Figure 8.8‑29 Laser Tracking Start and Stop

The user program “testTrack.lua” at this stage:

Figure 8.8‑30 Laser Tracking Program

8.8.4.2.4. Writing Seam Finding Start Point and Tracking End Point Instructions

Before starting laser seam finding, a seam finding start point needs to be specified. The robot first moves to the seam finding start point, then performs seam finding along a certain direction and speed. Teach the seam finding start point “seamStartPt” near where the laser sensor beam is close to the weld seam start point A. Pay attention to matching the seam finding start point with the seam finding direction to ensure the robot can find the weld seam position within the set distance and maximum seam finding time.

Figure 8.8‑31 Seam Finding Start Point

Teach the tracking end point “trackEndPt” at the end of the weld seam.

Figure 8.8‑32 Seam Finding End Point

Add the above two points to the “testTrack.lua” user program. The final user program is as follows:

Figure 8.8‑33 Seam Finding and Tracking Program

8.8.4.2.5. Writing Welding Related Instructions

Finally, add welding instructions between the welding seam finding point “seampos” and “trackEndPt”. The final program is as follows:

Figure 8.8‑34 Seam Finding, Tracking, and Welding Program

Execute the above program. The robot will carry the laser sensor to start the seam finding movement from the seam finding start point. After finding the weld seam, the robot immediately moves to the weld seam start point and executes the arc starting operation. After successful arc starting, the robot moves towards the weld seam end point and tracks the weld seam trajectory during the movement. The robot stops welding upon reaching the weld seam end point.

8.8.4.3. Laser Trajectory Recording + Trajectory Replay

The workflow for laser trajectory recording + trajectory replay is:

  1. The robot carries the laser sensor to move along a segment of the weld seam, and the laser sensor records the weld seam position trajectory data in real time during the movement;

  2. After the trajectory recording is completed, the robot moves to the starting point of the recorded trajectory;

  3. The robot performs trajectory replay motion along the trajectory recorded by the laser sensor.

8.8.4.3.1. Writing Robot Trajectory Recording Instructions

Create a new user program “testRecord.lua”, click “Laser Recording” to open the laser recording instruction addition page, find “Weld Seam Data Recording”, select “Start Recording”, click the “Add” button, select “Stop Recording”, click the “Add” button again; finally click the “Apply” button.

Figure 8.8‑35 Laser Recording

Figure 8.8‑36 Start Recording and Stop Recording

At this point, the trajectory recording start and stop instructions appear on the page.

Figure 8.8‑37 Trajectory Recording Program

Assuming the green line segment AB in the figure is the weld seam, make the laser irradiate the weld seam start point A and the weld seam end point B respectively, and teach the trajectory recording start point “recordStartPt” and end point “recordEndPt”.

Figure 8.8‑38 Trajectory Recording Start and End Points

Add two Linear (LIN) motion instructions to “testRecord.lua”, for moving to the trajectory recording start point “recordStartPt” and end point “recordEndPt” respectively. Adjust the instruction order so that the robot performs the following operations: first move to the “recordStartPt” point, start trajectory recording, robot moves to the “recordEndPt” point, stop trajectory recording.

Figure 8.8‑39 Trajectory Recording Program

8.8.4.3.2. Writing Instruction for Robot to Move to Trajectory Recording Start Point

Click “Laser Recording” to open the laser recording instruction addition page, find the “Move to Weld Seam Point” section, select the motion mode as PTP, input a certain motion speed, click “Move to Start Point”, then click the “Apply” button.

Figure 8.8‑40 Move to Trajectory Start Point

The “testRecord.lua” user program at this stage is as follows:

Figure 8.8‑41 Move to Trajectory Start Point Program

8.8.4.3.3. Writing Laser Sensor Trajectory Replay Instructions

Click “Laser Recording” to open the laser recording instruction addition page, find “Weld Seam Data Recording”, select “Trajectory Replay”, click the “Add” button, click the “Laser Tracking Replay” button, and finally click the “Apply” button.

Figure 8.8‑42 Trajectory Replay

The program after addition is as follows:

Figure 8.8‑43 Trajectory Replay Program

8.8.4.3.4. Writing Welding Related Instructions

Finally, add welding start and welding end instructions before the trajectory replay starts and after it ends:

Figure 8.8‑44 Trajectory Recording and Replay Welding Program

Execute the above program. The robot will first carry the laser sensor to move along the weld seam trajectory and record the entire trajectory. Then the robot moves to the start point of the recorded trajectory. The robot starts the arc and begins welding along the trajectory recorded by the laser sensor. When the robot completes the trajectory replay, the welding arc is extinguished, completing the welding.

8.8.5. Laser Sensor Adaptation Controller Peripheral Open Protocol

Step1: If you need to use “Open Protocol Connection” and “Control Laser Sensor”, then in the sensor tracking configuration, select “Peripheral Open Protocol” for the “Protocol Type” option. If using the original scheme, select “Adapted Device”, and configure and load the laser peripheral in the tracking sensor interface.

Figure 8.8‑45 “Open Protocol Connection” and “Control Laser Sensor” Configuration Interface

Step2: Click “Peripheral Open Protocol” to enter the interface. In the “Open Protocol Settings”, upload the peripheral open protocol corresponding to the laser sensor. After successful upload, select the protocol number and the uploaded file name, click Configure. Then, in the Device Operation and Status section, run the uploaded laser sensor protocol to establish a connection with the corresponding laser sensor.

Figure 8.8‑46 Laser Sensor Connection Establishment

8.9. Polishing

In the “Initial” -> “Peripherals” -> “Polishing” interface, polishing can currently be used via adapted devices or the peripheral open protocol.

Figure 8.9-1 Polishing Status Configuration Page

8.9.1. Adapted Devices

Communication Configuration and Loading: Configure communication information, including IP address, port, sampling period, and communication protocol. Establish communication with the polishing device using the Load/Unload buttons.

Figure 8.9-2 Communication Configuration and Loading

Device Functions: Operations such as device enabling, error clearing, and force sensor zeroing can be performed.

Figure 8.9-3 Device Functions

Parameter Configuration: Parameters such as the polishing device’s rotation speed, contact force, extension distance, and control mode can be set. After successful setting, the corresponding data and status are displayed in the right “Polish” status feedback column.

Figure 8.9-4 Parameter Configuration

Figure 8.9-5 Parameter Configuration

8.9.2. Peripheral Open Protocol

Click “Peripheral Open Protocol” to enter the interface. In the “Open Protocol Settings”, upload the peripheral open protocol corresponding to the polishing device. After successful upload, select the protocol number and the uploaded file name, click Configure. Then, in the Device Operation and Status section, run the uploaded polishing peripheral open protocol to establish a connection with the corresponding polishing device.

Figure 8.9‑6 Polishing Device Connection establishment

8.10. Auxiliary Sensors

In the “Initial” -> “Peripherals” -> “Auxiliary Sensors” interface, it is currently available for use with adapted devices. The custom protocol function is not yet open.

Figure 8.10‑1 Auxiliary Sensors–Adapted Devices

8.10.1. Adapted Devices

Click “Adapted Devices” to enter the auxiliary sensor configuration interface.

The configuration information for auxiliary sensors includes manufacturer, type, software version, and mounting location. Users can configure the corresponding auxiliary sensor information according to specific production requirements.

If users need to change the configuration, they can first select the corresponding auxiliary sensor number, click the “Clear” button to clear the corresponding configuration, and then reconfigure according to requirements.

Figure 8.10‑2 Auxiliary Sensors–Adapted Devices

8.11. Combined Devices (SmartTool + Force Sensor Combination)

In the “Initial” -> “Peripherals” -> “Combined Devices” interface, it is currently available for use with adapted devices. The custom protocol is not yet open.

Figure 8.11-1 Combined Devices

8.11.1. Adapted Devices

Click “Adapted Devices” to enter the configuration interface.

The configuration information is divided into manufacturer, type, software version, and mounting location. Different manufacturers correspond to different types. The current manufacturer is FR.

Users can configure the corresponding device information according to specific production requirements. After successful configuration, the device information table is displayed. If users need to change the configuration, they can first select the corresponding number, click the “Clear” button to clear the corresponding information, and then reconfigure the device information according to requirements.

Important

Before clicking to clear the configuration, the corresponding device should be in an inactive state.

Figure 8.11‑2 Adapted Devices

8.11.1.1. FR

The type corresponding to FR is “SmartTool” used in combination with a force sensor. The collaborative robot can be adapted to three types of force sensors: XJC, NSR, and GZCX. When using different sensors, only the corresponding communication protocol needs to be loaded, as follows:

  • SmartTool + XJC-6F-D82 (XJC).

  • SmartTool + NSR-FT Sensor A (NSR).

  • SmartTool + GZCX-6F-75A (GZCX).

  • Hardware Installation

  • Disassemble the SmartTool handle, take out the middle fixture, and install it on the robot end. After the fixture is installed, reassemble the SmartTool handle. After successful reassembly, connect the cable to the robot end.

Figure 8.11‑3 Installing the Middle Fixture of the SmartTool Handle

Figure 8.11‑4 SmartTool Handle Installed Successfully

  1. After the SmartTool handle is installed, mount the force sensor (using GZCX as an example) to the end of the SmartTool handle, and connect the cable to the SmartTool handle.

Figure 8.11‑5 GZCX Force Sensor Installed at the End of the SmartTool Handle

  1. Device Configuration

Important

Please ensure that your SmartTool handle is securely installed on the robot end and correctly connected to the robot end, and that the force sensor is securely installed on the end of the SmartTool handle and correctly connected to the SmartTool handle.

  1. Configure the SmartTool handle (refer to Welding Handle Key Function Configuration).

  2. After configuring the SmartTool handle key functions, set the manufacturer to “FR”, select the “Type”, “Software Version”, and “Mounting Location” information, and click the “Configure” button.

Figure 8.11‑6 FR Device Information Configuration Interface

  1. After successfully configuring the device information, select the configured force sensor, click the “Activate” button to activate the force sensor. After successful activation, click the “Zero Calibration” button to zero the force sensor, and view the table data.

Figure 8.11‑7 Force Sensor Zero Calibration

  1. According to the current end installation, configure the load data in the “Load” interface, and configure the tool coordinate data, tool type, and installation position in the “Tool Coordinate” interface.

Figure 8.11‑8 “End Load” Configuration

Figure 8.11‑9 “Tool Coordinate” Configuration

  1. Application

After the device information is successfully configured, it can independently implement the SmartTool button functions and force sensor functions, such as measuring the magnitude and direction of force, and auxiliary drag locking based on the force sensor.

Figure 8.11‑10 Measuring Force Magnitude and Direction

8.11.2. Combined Device End-Effector Lua Protocol

Currently, the end-effector can support the application of combined protocols for two devices. The second device can be connected via a one-to-two communication cable or through the F&S SmartTool 485 interface.

The operation steps are as follows:

Open the WebApp, click “Initial Setup”, “Peripherals” in sequence, and select one of the device types to be combined (e.g., welding handle). Choose “Custom Protocol”. Click “Protocol Management” to configure the end-effector protocol.

Currently, the preset built-in combined device protocols include: Junduo Gripper + Xinjingcheng Force Sensor, SmartTool + Junduo Gripper, SmartTool + Xinjingcheng Force Sensor. The preset protocols for combined devices belong to user-defined protocols, starting with “Custom_End”. They can be downloaded and deleted, as shown in the figure below.

Figure 8.11‑11 Welding Handle Preset Built-in Protocol

8.12. Array Suction Cups

8.12.1. Overview

Installing array suction cups on the robot end can help quickly deploy material grasping workstations for different scenarios. The number and layout of suction cups can be customized for materials of different sizes and shapes, improving work efficiency and stability.

The collaborative robot supports an array of up to 20 suction cups. Individual suction cups can be controlled for grasping and releasing, or the entire connected array can be controlled to act synchronously. Each suction cup supports configuration of station numbers from 1 to 20, configured based on DynamicLAB software.

8.12.1.1. Hardware Description

The collaborative robot communicates with and controls the suction cup array via an Ethernet to 485 module. The WebApp generates the communication protocol for the array suction cups. The protocol sends control data to the Ethernet to 485 module via TCP/IP. The module then sends the received control data to each suction cup via 485, thus achieving control of the array suction cups (the control data format is ModbusRTU protocol format).

The Ethernet to 485 module acts as the server for Ethernet communication and the master for 485 communication. Each suction cup in the array is a 485 communication slave station, and each suction cup should be configured with a different slave station number.

Figure 8.12-1 Collaborative Robot Suction Cup Array Gripper Application

The Ethernet to 485 module usually has two TCP Server ports corresponding to multiple 485 slave ports. Taking CH9121 as an example, its TCP Server port 1 corresponds to 485 slave ports 1-10, and TCP Server port 2 corresponds to 485 slave ports 11-20. The robot establishes two TCP communications with the Ethernet to 485 module, ultimately controlling 20 suction cups respectively.

The aforementioned Ethernet to 485 module needs to be configured as follows:

  • ① Ethernet end configured as TCP Server, IP address: 192.168.58.10, Port 1 number: 50001, Port 2 number: 50002;

  • ② 485 end configured with baud rate 115200, data bits 8, stop bits 1, no parity. The Ethernet to 485 module usually comes with a debugging software where the above configuration can be performed. The following figure shows the configuration tool page for the CH9121 model Ethernet to 485 module:

8.12.2. Function Configuration

Open the WebApp, click sequentially “Initial” -> “Peripherals” -> “Array Suction Cups”; The control modes for array suction cups are Unicast Mode and Broadcast Mode:

Unicast Mode: The communication protocol includes control content for each suction cup, allowing independent control of each suction cup in the array.

Broadcast Mode: Generates a communication protocol for all suction cups in the array, allowing synchronous control of grasping and releasing for all suction cups in the array, but cannot control a single suction cup individually.

Depending on the actual scenario, you can configure only Unicast Mode, or configure both modes simultaneously (allowing both individual control of specific suction cups and synchronous control of all suction cups).

Figure 8.12-3 Array Suction Cup Control Mode

8.12.2.1. Unicast Mode Configuration

Open the WebApp, click sequentially “Initial” -> “Peripherals” -> “Array Suction Cups” -> “Unicast Mode”. There are two methods for configuring the Unicast Mode protocol: “Auto Configuration” and “Manual Configuration”:

Figure 8.12-4 Unicast Configuration Mode

Auto Configuration: Upload an existing protocol file directly to the robot controller. The existing protocol file may come from: ① Downloaded from another robot that has already configured and debugged the array suction cups; ② Written by technical personnel according to the actual scenario (users writing protocol files can achieve more flexible and efficient suction cup control). If multiple devices use the same array suction cups, using Auto Configuration to directly upload the protocol can improve deployment speed.

Manual Configuration: Configure the communication protocol for each suction cup according to the slave ID and vacuum level of the suction cups in the array. The manual configuration steps are as follows:

Select slave station number 1, input the maximum vacuum, minimum vacuum, grasp timeout time (timeout is not yet open), and click the “Configure” button. At this time, a suction cup protocol with protocol number 1 appears in the “Device Operation and Status” column, and the “Manual Configuration” and “Slave Station Number” labels will display all currently configured slave station numbers.

Figure 8.12-5 Configuring Unicast Suction Cup

Repeat the above steps to configure suction cups for multiple slave station numbers as needed. Each time a suction cup is configured, the robot system automatically updates the suction cup communication protocol content corresponding to “Protocol Number: 1”, supporting up to 20 suction cups. After all suction cups are configured, click the “Connect” button in the “Protocol Number 1” box. The communication between the robot and the suction cups starts running, and the “Run Status” indicator lights up (Note: Please complete the configuration of all slave station number suction cups first, then click the “Connect” button. Configuring suction cup slaves after communication is established is invalid).

After the communication between the robot and the suction cups is successfully established, a list of operation boxes for all configured suction cup slave stations appears in the “Device Operation and Status” column; In the operation box page corresponding to each slave station number suction cup, suction cup control and status monitoring can be performed (including “Suction Status”, “Current Vacuum”, “Suction Cup Pressure”, etc.). The suction cup slave station IDs configured in the figure below are 2 and 11 respectively.

Figure 8.12-6 Unicast Suction Cup Connection

Click the “Suction” button in the upper right corner of the control box for slave station number 1 suction cup, and the suction cup will execute the “Set Vacuum Suction” action. At this time, the “Suction” button becomes the “Release” button. Click this button again, and the suction cup will execute the release action. When the suction cup performs the above actions, the corresponding status items such as “Suction Status” and “Current Vacuum” will display the suction cup’s status in real time.

Note

Note: After configuring the suction cup protocol and completing the connection, you need to click the “Suction” button once to activate the suction cup. This can also test whether the communication between the robot and the suction cup is normal.

If the connection between the robot and the suction cup fails, the suction cup control box will not be displayed, and the run status indicator in “Protocol Number: 1” will be off.

Note

Note: If the physical communication connection between the suction cup and the Ethernet to 485 module is disconnected and then reconnected during use, it may cause the protocol to fail to establish a connection. In this case, you can unplug and replug the network cable of the Ethernet to 485 module and try to connect again.

Figure 8.12-7 Robot and Suction Cup Connection Failed

8.12.2.2. Unicast Mode Protocol Download

Click the “Download” button in “Manual Configuration” to download the suction cup protocol to the local computer. The suction cup protocol is a cyclically executed LUA program. The program executes the following steps in each cycle:

  • ① Read suction cup control data from the robot;

  • ② Write control data to the suction cup via socket;

  • ③ Read status data from the suction cup via socket;

  • ④ Feedback suction cup status data to the robot;

The suction cup communication protocol cyclically executes to achieve communication control between the robot and the suction cups. In the communication protocol, users can customize the cycle period, control data register address, and status data register address, and can modify the protocol content according to the actual situation. The following is a suction cup communication protocol code example:

Suction Cup Protocol Program Example:

local id = 1
local ctrlValues = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
local realTimeState = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
local suckerConfig = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
clearSuckerState()
socket1 = TCPClientConnect('192.168.58.10', 50001, 500, 10, 2, 3)
socket2 = TCPClientConnect('192.168.58.10', 50002, 500, 10, 2, 3)
suckerConfig[1] = 30
suckerConfig[2] = 20
suckerConfig[3] = 100
ModbusRTUOverTCPWriteMultiReg(socket1, 0, 0x0501, 3, suckerConfig)
ModbusRTUOverTCPWriteMultiReg(socket2, 0, 0x0501, 3, suckerConfig)
sleep_ms(10)
while(1) do
  setAllCtrl,ctrlValues[1],ctrlValues[2],ctrlValues[3],ctrlValues[4],ctrlValues[5],ctrlValues[6],ctrlValues[7],ctrlValues[8],ctrlValues[9], ctrlValues[10], ctrlValues[11], ctrlValues[12],ctrlValues[13],ctrlValues[14],ctrlValues[15],ctrlValues[16],ctrlValues[17],ctrlValues[18],ctrlValues[19], ctrlValues[20] = getSuckerCtrlState()
  if(setAllCtrl ~= 0) then
    ModbusRTUOverTCPWriteSingleReg(socket1, 0, 0x0500, setAllCtrl)
    ModbusRTUOverTCPWriteSingleReg(socket2, 0, 0x0500, setAllCtrl)
    ctrlValues = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    sleep_ms(1)
  else
    ModbusRTUOverTCPWriteSingleReg(socket1, 2, 0x0500, ctrlValues[2])
    ModbusRTUOverTCPWriteSingleReg(socket2, 11, 0x0500, ctrlValues[11])
  end
  suckerState, pressValue, error, default1, default2 = ModbusRTUOverTCPReadReg(socket1, 2, 0x0600, 3)
  realTimeState[1] = suckerState
  realTimeState[2] = pressValue
  realTimeState[3] = error
  ctrlState, maxPress, minPress, time, default2 = ModbusRTUOverTCPReadReg(socket1, 2, 0x0500, 4)
  realTimeState[4] = ctrlState
  realTimeState[5] = maxPress
  realTimeState[6] = minPress
  realTimeState[7] = time
  setSuckerRealtimeState(2, realTimeState)
  suckerState, pressValue, error, default1, default2 = ModbusRTUOverTCPReadReg(socket2, 11, 0x0600, 3)
  realTimeState[1] = suckerState
  realTimeState[2] = pressValue
  realTimeState[3] = error
  ctrlState, maxPress, minPress, time, default2 = ModbusRTUOverTCPReadReg(socket2, 11, 0x0500, 4)
  realTimeState[4] = ctrlState
  realTimeState[5] = maxPress
  realTimeState[6] = minPress
  realTimeState[7] = time
  setSuckerRealtimeState(11, realTimeState)
  local stopFlag = GetOpenLUAStopFlag(id)
  if(stopFlag ~= 0) then
    TCPClientDisconnect(socket1)
    TCPClientDisconnect(socket2)
    clearSuckerState()
    break
  end
  sleep_ms(100)
end

The above protocol uses the getSuckerCtrlState() instruction to obtain suction cup control data, uses the ModbusRTUOverTCPWriteSingleReg() instruction to write control data to the suction cups via communication, uses the ModbusRTUOverTCPReadReg() instruction to read the status data of the suction cups, and then uses the setSuckerRealtimeState() instruction to feedback the suction cup status data to the robot. The detailed definitions of these instructions are as follows:

Table 8.12-1 getSuckerCtrlState() Return Values

No.

Type

Variable Name

Description

1

int

setAllCtrl

Broadcast mode control data: 1-Suction at max vacuum; 2-Suction at set vacuum, i.e., suction cup vacuum maintained between max and min vacuum; 3-Stop suction

2 ~ 21

int

ctrlValues[i]

Suction cup control data corresponding to slave station numbers 1 ~ 20: 1-Suction at max vacuum; 2-Suction at set vacuum, i.e., suction cup vacuum maintained between max and min vacuum; 3-Stop suction

Table 8.12-2 ModbusRTUOverTCPWriteSingleReg() Detailed Parameters

No.

Type

Variable Name

Description

1

int

socket

Socket handle

2

int

slaveID

Slave station number 0-20; 0-Broadcast; 1~20-Slave station number

3

uint16_t

regAddr

Write register address

4

uint16_t

data

Data to write

Table 8.12-3 ModbusRTUOverTCPWriteMultiReg() Detailed Parameters

No.

Type

Variable Name

Description

1

int

socket

Socket handle

2

int

slaveID

Slave station number 0-20; 0-Broadcast; 1~20-Slave station number

3

uint16_t

regStartAddr

Start address for writing multiple registers

4

int

num

Number of registers to write

5

uint16_t[]

data

Array of data content to write

Table 8.12-4 ModbusRTUOverTCPReadReg() Detailed Parameters

No.

Type

Variable Name

Description

1

int

socket

Socket handle

2

int

slaveID

Slave station number 0-20; 0-Broadcast; 1~20-Slave station number

3

uint16_t

regStartAddr

Start address for reading multiple registers

4

int

num

Number of registers to read

Table 8.12-5 ModbusRTUOverTCPReadReg() Return Values

No.

Type

Variable Name

Description

1

int

suckState

Suction cup current status: 0-Object released or suction cup started successfully; 1-Workpiece detected, object adsorbed; 2-No object adsorbed; 3-Object detached

2

float

pressValue

Current vacuum/pressure

3

int

err

Error code: 0-Normal; Others: Abnormal

Table 8.12-6 setSuckerRealtimeState() Detailed Parameters

No.

Type

Variable Name

Description

1

int

slaveID

Slave ID

2

int[]

states

states[1]: Current status 0-Object released or suction cup started successfully; 1-Workpiece detected, object adsorbed; 2-No object adsorbed; 3-Object detached.

states[2]: Current vacuum/pressure; states[3]: Wait register value; states[4]: Control status; states[5]: Maximum vacuum; states[6]: Minimum vacuum; state[7]: Timeout time; states[8~10]: Reserved.

8.12.2.3. Broadcast Mode

The collaborative robot can control all connected suction cups to act simultaneously through Broadcast Mode.

Note

Note: Unicast Mode must be configured first before configuring Broadcast Mode.

Open the WebApp, click sequentially “Initial” -> “Peripherals” -> “Array Suction Cups”, first complete the configuration of all required suction cup slave stations in Unicast Mode (configure only, do not establish communication protocol connection).

Click “Broadcast Mode”, input the “Maximum Vacuum”, “Minimum Vacuum”, “Grasp Timeout Time” (timeout is not yet open) for the suction cups in the “Parameter Configuration”, and click the “Configure” button. At this time, the broadcast mode communication protocol appears in the “Device Operation and Status” box. In broadcast mode, setting the vacuum parameters takes effect for every connected suction cup.

Figure 8.12-8 Broadcast Mode Parameter Configuration

Click the “Connect” button in the “Protocol Number 1” operation box. The “Run Status” indicator lights up, indicating that communication has been established between the robot and the array suction cups. After successful connection, the operation box list for all connected suction cups is displayed in the “Device Operation and Status” column.

Click “Start” in “Parameter Configuration” -> “One-key Suction”, and each suction cup in the array suction cups will perform the “Set Vacuum Suction” action. Click “Stop”, and each suction cup in the array suction cups will stop the suction action.

Figure 8.12-9 Broadcast Mode Communication Established

Downloading the protocol file in Broadcast Mode is the same as in Unicast Mode. The protocol files downloaded from both locations can be uploaded to the robot via the “Auto Configuration” in the Unicast Mode page.

8.12.3. Array Suction Cup LUA Program Application

Adding array suction cup control, status acquisition, and other instructions to the robot LUA program, combined with robot motion instructions, can flexibly and conveniently implement material grasping and handling applications.

Open the WebApp, click sequentially “Teach Program” -> “Program Programming”, and create a new LUA program “testSucker.lua”.

Figure 8.12-10 Create New “testSucker.lua” Program

Select the instruction type as “Peripheral Instruction”, and click the “Suction Cup” button in the peripheral instructions. At this time, the “Sucker” array suction cup instruction addition page appears on the right side of the WebApp.

Figure 8.12-11 Array Suction Cup Instruction Addition

8.12.3.1. Suction Cup Control Instruction Addition

Writing suction cup control instructions in the LUA program allows for suction control and release control of the suction cups. Unicast Mode and Broadcast Mode controls have different logical effects.

8.12.3.1.1. Unicast Mode Control Instruction Addition

Unicast Mode control can control single or multiple suction cups based on the starting slave station address and quantity, and can set different control states for each suction cup.

In the suction cup instruction addition page, click “Suction Cup Control Instruction”, select the control mode as “Unicast Mode”, input the slave station number as 1, the write quantity as 2, and the suction states as “1,2”. Click the “Add” button to add a Unicast Mode suction cup control instruction in the “Program Preview”.

Figure 8.12-12 Add Suction Cup Control Instruction

The meanings of the parameters in the suction cup control instruction are as follows:

  • Slave Station Number: The starting slave station number for Unicast Mode control of suction cups.

  • Write Quantity: The number of suction cups to control starting from the starting slave station number in Unicast Mode.

  • Suction States: In Unicast Mode, starting from the starting slave station number, the control state flag for each suction cup (1-Suction at max vacuum; 2-Suction at set vacuum, i.e., suction cup vacuum maintained between max and min vacuum; 3-Stop suction); The control state flags for each suction cup are separated by “,”, and the number of control flags must match the number of suction cups to be controlled; If you want to control two suction cups, with control operations being “Suction at max vacuum” and “Suction at set vacuum” respectively, then the input for this item is “1,2”.

Click the “Apply” button. At this time, a suction cup control instruction is added to the “testSucker.lua” program. Switch the robot to automatic mode and execute this LUA program. The robot will control the two suction cups with slave station numbers 1 and 2 to perform suction actions at maximum vacuum and set vacuum respectively.

Figure 8.12-13 Add Suction Cup Instruction in LUA Program

8.12.3.1.2. Adding Broadcast Mode Control Commands

The suction state set by the broadcast mode control command takes effect on all currently connected suction cups.

Click “Suction Cup Control Command”, select the control mode as “Broadcast Mode”, and enter the suction state as 1 (suction with maximum vacuum). Click the “Add” button.

Figure 8.12-14 Adding a Broadcast Control Command

Click the “Apply” button. At this point, a broadcast mode suction cup control command is added to the “testSucker.lua” file. Switch the robot to automatic mode and execute this program, then all connected suction cups will start the suction action with maximum vacuum.

Figure 8.12-15 Adding a Broadcast Control Command in the LUA Program

8.12.3.2. Adding Suction Cup Status Acquisition Command

Click “Get Suction Cup Status”, select the slave station number of the suction cup whose status you want to obtain, then click the “Add” and “Apply” buttons sequentially. This adds a command “GetSuckerState(1)” to get the suction cup status in “testSucker.lua”.

Figure 8.12-16 Adding the Get Suction Cup Status Command

The GetSuckerState() command returns 3 values, as follows:

  • state: The current state of the suction cup: 0-Object released or suction cup started successfully; 1-Workpiece detected, object adsorbed; 2-No object adsorbed; 3-Object detached.

  • pressValue: Current vacuum/pressure value;

  • err: Error code: 0-Normal; Others: Abnormal.

In “testSucker.lua”, use three variables to receive the return values of the GetSuckerState() function. Use Lua variable queries to display the above information in the WebApp Variable Query Display Area.

Figure 8.12-17 Program for Getting Suction Cup Status

8.12.3.3. Adding Wait for Suction Cup Adsorption Status Command

In practical applications of array suction cups, it is often necessary to wait for the suction cup to complete suction (release) before executing the next action. The collaborative robot provides a command to wait for the suction cup action to complete. This command ends execution when the suction cup reaches the set state; otherwise, it blocks and waits for the suction cup action to complete within the set timeout period.

On the array suction cup command addition page, click “Wait for Suction Cup Adsorption Status”, select the corresponding suction cup slave station number 1, select the control mode as “Workpiece detected, object adsorbed”, and enter the timeout time as 10000ms. Click the “Add” button.

Figure 8.12-18 Adding the Wait for Suction Cup Status Command

Click the “Apply” button. A command to wait for the suction cup to adsorb an object is added to “testSucker.lua”.

Figure 8.12-19 Adding Wait for Suction Cup to Adsorb Object in LUA Program

8.12.3.4. Application Example

Example LUA program for suction cup handling control:

while (1) do
::satety_suck::
PTP(sucker_safey,100,-1,0)
PTP(sucker_suck,100,-1,0)
SetSuckerCtrl(2, 1, {2})
SetSuckerCtrl(11, 1, {2})
loop1 = 0
while (loop1 < 10) do
    state, press, errorcode = GetSuckerState(2)
    RegisterVar("number","state")
    RegisterVar("number","press")
    RegisterVar("number","errorcode")
    state11, press11, errorcode11 = GetSuckerState(11)
    RegisterVar("number","state11")
    RegisterVar("number","press11")
    RegisterVar("number","errorcode11")
    loop1 = loop1 + 1
    WaitMs(50)
end

if(state11 == 1) then
    PTP(sucker_safey,100,-1,0)
    PTP(sucker_release,100,-1,0)
    WaitMs(1000)
    SetSuckerCtrl(2, 1, {3})
    SetSuckerCtrl(11, 1, {3})
    WaitMs(500)
else
    PTP(sucker_safey,100,-1,0)
    SetSuckerCtrl(2, 1, {3})
    SetSuckerCtrl(11, 1, {3})
    WaitMs(2000)
    goto satety_suck
end
::satety_release::
PTP(sucker_safey,100,-1,0)
PTP(sucker_release,100,-1,0)
SetSuckerCtrl(2, 1, {2})
SetSuckerCtrl(11, 1, {2})
loop1 = 0
while (loop1 < 10) do
    state, press, errorcode = GetSuckerState(2)
    RegisterVar("number","state")
    RegisterVar("number","press")
    RegisterVar("number","errorcode")
    state11, press11, errorcode11 = GetSuckerState(11)
    RegisterVar("number","state11")
    RegisterVar("number","press11")
    RegisterVar("number","errorcode11")
    loop1 = loop1 + 1
    WaitMs(50)
end

if(state11 == 1) then
    PTP(sucker_safey,100,-1,0)
    PTP(sucker_suck,100,-1,0)
    WaitMs(1000)
    SetSuckerCtrl(2, 1, {3})
    SetSuckerCtrl(11, 1, {3})
    WaitMs(500)
else
    PTP(sucker_safey,100,-1,0)
    SetSuckerCtrl(2, 1, {3})
    SetSuckerCtrl(11, 1, {3})
    WaitMs(2000)
    goto satety_release
end
end

8.13. CNC Function Package Based on FOCAS (For Linux Systems Only)

8.13.1. Overview

To automate the loading and unloading process in machine tool processing, a CNC function package based on FOCAS communication has been developed, enabling communication interaction and coordinated motion between the collaborative robot and the CNC machine tool.

As shown in the figure, FOCAS communication is based on Ethernet. By connecting the robot control box network port to the embedded network port of the machine tool with an Ethernet cable, FOCAS communication between the robot and the machine tool can be established, enabling CNC control and machine tool status monitoring from the robot side.

Figure 8.13‑1 FOCAS Communication Topology Diagram Between Robot and CNC

The functions currently supported by the control box’s CNC function package based on FOCAS communication for machine tool control and status feedback are shown in the table.

Table 8.13-1 Supported Functions of the FOCAS-based CNC Function Package

No.

Function Name

Description

1

Machine Tool Type

Status Feedback

2

FOCAS Communication Status

Status Feedback

3

Auto Mode Operation

Control, Status Feedback

4

Alarm Status

Status Feedback

5

Safety Door

Status Feedback

6

Chuck

Control, Status Feedback

7

Emergency Stop

Control, Status Feedback

8.13.2. Related Operation Instructions

8.13.2.1. Establishing FOCAS Communication

FOCAS communication is based on Ethernet. It requires forming a local area network (LAN) connecting the robot, CNC machine tool, and PC to achieve physical link connection, and finally establishing FOCAS communication through the robot’s open protocol.

8.13.2.1.1. Network Configuration

Step1: First, change the IP address of the PC to the same subnet as the robot control box. The robot control box’s IP address is “192.168.58.2”.

If no switch is used for networking, you can use the two built-in network ports on the robot control box for networking. The operation is as follows: Log in to the robot’s WebAPP, go to System Settings -> General Settings -> Network Settings, set the IP address of Port 0 to: 192.168.58.2; set the IP address of Port 1 to 192.168.57.2. Simultaneously, set WebAPP to use Port 0 and WebRecovery to use Port 1, as shown in the figure. After completing all settings, click Set Network.

Figure 8.13‑2 Robot Network Configuration Diagram

Step2: Then restart the control box and connect it to the PC via the Port 0 network port, then log in to the robot WebApp. Also, configure the IP address of the CNC machine tool that needs communication to be in the same subnet as the PC and the robot control box, i.e., 192.168.58.xx, and change the machine tool’s port to 8193. This completes all network configuration.

8.13.2.1.2. Open Protocol File Configuration

Step1: Then proceed with the peripheral open protocol configuration. First, you need to create a new lua file named starting with CtrlDev_CNC as the open protocol file for establishing FOCAS communication, such as CtrlDev_CNC_demo.lua.

This file needs to set the Open Protocol ID and use the CNCComSet function to establish or disconnect the connection with the CNC. The parameter descriptions for the CNCComSet function are shown in the table below. Example code is as follows.

Table 8.13-2 CNCComSet Function Parameter Description Table

No.

Parameter Name

Description

1

Machine Tool Manufacturer

0-Invalid 1-Machine Tool (FOCAS)

2

Communication Command

1-Establish Connection 1001-Disconnect

3

Machine Tool IP Address

4

Machine Tool Port Number

Open protocol example code for establishing FOCAS connection:

local id = 1      --Open LUA Protocol ID
--FOCAS Disconnect
CNCComSet(1, 1001, '192.168.57.100', 8193)
sleep_ms(1000)
--FOCAS Establish Connection
CNCComSet(1, 1, '192.168.57.100', 8193)
sleep_ms(1000)
while(1) do
sleep_ms(5000)
end

Step2: After writing the open protocol lua file, select the just-created CtrlDev_CNC_fanuc.lua file and upload it. Select the ID set in the file, choose the uploaded open protocol file from the dropdown, and click Configure.

Figure 8.13‑3 Open Protocol File Upload and Configuration

Step3: Then check that all communication links are normal and confirm the CNC machine tool is powered on. Click the Connect button in the open protocol. You can confirm whether the connection with the machine tool is established through the CNC -> FOCAS Communication Status in the status feedback panel on the right (Red light: Connection established; Gray: Connection disconnected), as shown in the figure.

Figure 8.13‑4 FOCAS Communication Connection Established

8.13.2.2. CNC Status Feedback Description

The status feedback of the CNC machine tool is displayed on the CNC icon in the peripheral status feedback area on the far right of the WebAPP, as shown in the figure. Clicking it will display all current statuses of the machine tool, including equipment manufacturer, machine tool type, FOCAS communication status, alarm flag, machine tool operation status, machine door switch status, machine chuck status, and machine emergency stop status.

Figure 8.13‑5 CNC Status Feedback Panel

The meanings of the status feedback indicator lights for CNC are shown in the table below.

Table 8.13-3 Meanings of CNC Status Feedback Indicator Lights

No.

Function Name

Description

1

FOCAS Communication Status

Gray-Communication disconnected Red-Communication normal

2

Alarm Flag

Gray-No alarm Red-Alarm exists

3

Machine Tool Operation Status

Gray-Stopped Green-Running

4

Machine Door Status

Gray-Door closed Green-Door open

5

Machine Chuck Status

Gray-Loosened Green-Clamped

6

Machine Emergency Stop Status

Gray-E-stop inactive Green-E-stop active

8.13.2.3. CNC Control Description

The control for the CNC machine tool is located in the Peripheral Open Protocol. After the FOCAS communication connection is completed, click the upper right corner of the configured peripheral open protocol to open the CNC control page, as shown in the figure.

Note

The control buttons include Door Control (Open, Close), Chuck Control (Clamp, Loosen), Start/Stop Control (Run, Stop), and Emergency Stop Control (E-stop, Inactive). All control signals are edge-triggered.

Figure 8.13‑6 CNC Control Page

8.13.2.4. CNC Teach Program Description

The CNC function package supports calling control commands in teach programs and obtaining machine tool status in real time. Navigate sequentially to “Teach Program” -> “Program Programming” -> “Peripheral Commands” -> “CNC” to see all supported CNC teach commands, as shown in the figure.

Figure 8.13‑7 CNC Teach Commands

Note

The control commands correspond one-to-one with the CNC controls and are all edge signal effective, meaning that after a start command is executed, a stop command must be executed before the next start command will take effect.

“Get Current Machine Tool Status” is a Lua function. This function returns 9 parameters, whose meanings are shown in the table below.

Table 8.13-4 Return Value Description for “Get Current Machine Tool Status”

No.

Name

Meaning

1

Equipment Manufacturer

0-Invalid 1-Other-Reserved

2

FOCAS Communication Status

0-Communication normal Other-Communication disconnected

3

Machine Tool Model (string)

‘15’ : Series 150/150i ‘16’ : Series 160/160i ‘18’ : Series 180/180i ‘21’ : Series 210/210i ‘30’ : Series 300i ‘31’ : Series 310i ‘32’ : Series 320i ‘0’ : Series 0i

4

Machine Tool Type (string)

‘15’ : Series 150/150i ‘16’ : Series 160/160i ‘18’ : Series 180/180i ‘21’ : Series 210/210i ‘30’ : Series 300i ‘31’ : Series 310i ‘32’ : Series 320i ‘0’ : Series 0i

5

Machine Tool Operation Status

0-Stopped 1-Running

6

Machine Tool Emergency Stop Status

0-E-stop active Other-E-stop inactive

7

Machine Tool Alarm Status

0-No alarm Other-Alarm exists

8

Machine Tool Door Status

0-Door open 1-Door closed

9

Machine Tool Chuck Status

0-Loosened 1-Clamped

A Lua teach program example is written for the robot loading/unloading process. This example program includes controlling the CNC door (close, open), operation (run, stop), chuck (loosen, clamp), and uses the obtained CNC current status as judgment conditions to set the robot’s movement between three points: safety point, pick point, and place point, as shown in the code.

Example Lua Teach Program for Coordinated Motion between Robot and CNC:

 while (1) do
    CNCDoorClose()
    CNCWorkStart()
    WaitMs(1000)
    t1,t2,t3,t4,t5,t6,t7,t8,t9=CNCGetStatus()
    if t5 == 1 then
        PTP(CNCsafe,100,-1,0)
    else
        CNCWorkStop()
        CNCDoorOpen()
        WaitMs(1000)
        PTP(CNCg1,100,-1,0)
        WaitMs(1000)
        CNCChuckOpen()
        PTP(CNCg2,100,-1,0)
        PTP(CNCsafe,100,-1,0)
    end
    t1,t2,t3,t4,t5,t6,t7,t8,t9=CNCGetStatus()
    if t8 == 0 then
        if t5 == 0 then
            PTP(CNCg2,100,-1,0)
             PTP(CNCg1,100,-1,0)
             CNCChuckFastening()
             WaitMs(1000)
             PTP(CNCsafe,100,-1,0)
         end
     end
end

8.14. Virtual Wall Configuration Based on Force Sensor

The virtual wall function based on the force sensor allows setting virtual walls to limit the robot’s workspace and avoid direct collision contact.

8.14.1. Force Sensor Installation and Configuration

Step1: Taking the “Kunwei” sensor as an example, during installation, the coordinate system direction of the force sensor must be consistent with the end flange coordinate system, as shown in Figure 1 (In Figure 1, red indicates the X+ direction of the end flange coordinate system, green indicates the Y+ direction, and blue indicates the Z+ direction);

Figure 8.14‑1 Force Sensor Installation

Step2: Under the “Initial” -> “Peripherals” -> “Force Sensor” menu bar, click “Adapted Devices” to enter the force sensor device configuration interface.

The force sensor configuration information includes manufacturer, type, software version, and mounting location. Users can configure the corresponding force sensor information according to specific production needs. If users need to change the configuration, they can first select the corresponding number, click the “Clear” button to clear the corresponding information, and reconfigure according to requirements; the specific operation is shown in the figure.

Step3: Select the configured force sensor number, click the “Reset” button. After the page pops up indicating the command was sent successfully, click the “Activate” button. Check the activation status in the force sensor information table to determine if activation was successful. Additionally, the force sensor will have initial values. Users can choose “Zero Calibration” and “Remove Zero” according to usage needs. Force sensor zero calibration requires ensuring the force sensor is level and vertically downward, and the robot has no configured load.

Figure 8.14‑2 Force Sensor Configuration and Activation

Figure 8.14‑3 Force Sensor Activation

8.14.2. Virtual Wall Configuration

To use the force sensor for assisted dragging, a dragging handle needs to be installed under the force sensor, and a tool coordinate system needs to be configured. The specific operation is shown in Figure 4. At this point, the method for detecting the interference zone uses the set tool coordinate system position as a reference; if not set, the end flange is used as the reference.

Step1: Under the “Initial” -> “Safety” -> “Interference Zone” menu bar, click “Single” to enter the interference zone configuration function interface;

Step2: It is necessary to configure the interference method and the operation upon entering the interference zone; click “Cube Interference” to enter the configuration interface, set the operation upon entering the interference zone during dragging to “Do Not Restrict Dragging”, and the operation upon entering during motion can be set as needed;

Step3: According to requirements, the parameter configuration can be modified. The detection method is divided into two types: “Command Position” and “Feedback Position”. The interference zone mode is divided into two types: “Interference Within Range” and “Interference Outside Range”. The reference coordinate system is selected as “Base Coordinate”. Set according to actual use. Detailed operations are shown in the figure;

Figure 8.14‑4 Installing Dragging Handle and Setting Tool Coordinate System

Figure 8.14‑5 Virtual Wall Parameter Configuration

Step4: The interference zone mode under parameter configuration is divided into two types: “Interference Within Range” and “Interference Outside Range”;

Figure 8.14‑6 Interference Within Range

Figure 8.14‑7 Interference Outside Range

Step5: Establish the interference zone. The specific operation is shown in Figure 7 and Figure 8; it is recommended to set the interference area as large as possible when selecting “Interference Outside Range”.

Figure 8.14‑8 Establishing Interference Zone Using Two-Point Method

Figure 8.14‑9 Establishing Interference Zone Using Center Point + Side Length Method

8.14.3. Force Sensor Assisted Dragging

Step1: Under the “Application” -> “Tool App” menu, click “Drag Lock” to enter the force sensor assisted locking function interface;

Step2: Set the parameters as shown in the figure below to enable the virtual wall function based on the force sensor. The specific effect is: approaching the virtual wall, resistance increases; moving away from the virtual wall, the force sensor assisted dragging function works normally.

Figure 8.14‑10 Parameter Settings for Force Sensor Assisted Dragging

Specific functions of the parameters:

Adaptive Selection: Enable when assembly is needed; dragging becomes heavier after enabling;

Inertia Parameter: Adjusts the feel during dragging; operate with caution under the guidance of technical personnel.

Damping Parameter:

  • Translational Direction: Recommended parameter range [100-200];

  • Rotational Direction: Recommended parameter range [3-10], with the RZ direction range being [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 it too small);

  • Overall Damping Parameter Range: Translational XYZ: [100-1000]; Rotational RX, RY: [3-50], RZ: [2-10];

  • Maximum Drag Force is 50, Maximum Drag Speed is 180.

Stiffness Parameter: Set all to 0;

Drag Force Threshold: Translational XYZ is [5-10]; Rotational RX, RY, RZ is [0.5-5];

Maximum Drag Force: 50;

Maximum Drag Speed: 180;

8.14.4. Six-Axis Force and Joint Impedance Hybrid Dragging Function

8.14.4.1. Overview

The six-axis force and joint impedance hybrid dragging function utilizes the force sensor to perceive external forces, allowing the robot to perform assisted dragging in drag mode. Different dragging experiences can be achieved by adjusting the gain coefficients. Joint impedance uses impedance control to limit the drag force.

8.14.4.2. Force Sensor Installation Configuration and Zeroing Operation

  1. Force Sensor Installation Configuration

For detailed operations on force sensor installation configuration, refer to the section above: Virtual Wall Configuration Based on Force Sensor.

  1. Force Sensor Zeroing

To facilitate dragging the robot, a drag handle needs to be installed below the sensor, as shown in Figure 1.

Figure 8.14‑11 Drag Handle

Step1: Set the tool coordinate system according to the actual handle length, as shown in Figure 2.

Step2: Under the “Initial” -> “Basic” -> “Load” menu, click “Sensor” to enter the Force/Torque Sensor Load interface.

Using the drag button, adjust the robot end effector to face horizontally downwards. Then, click “Load” -> “Sensor Identification” to enter the interface, find the “Record Initial Position” button in the “Sensor Auto Zeroing” section. Then, switch the robot mode to automatic mode and click the “Auto Zero” button. After the program finishes running, the sensor zeroing is complete. Detailed operations are shown in the figures.

Figure 8.14‑12 Tool Coordinate System Setup

Figure 8.14‑13 Force/Torque Sensor Auto Zeroing

8.14.4.3. Six-Axis Force and Joint Impedance Hybrid Dragging

  1. Assisted Dragging

Step1: Under the “Application” -> “Tool App” menu, click “Drag Lock” to enter the drag lock function interface.

Step2: In the “Six-Axis Force and Joint Impedance Hybrid Dragging” section, set the Control Status to “On”, the Impedance Enable Status to “Off”, set the Drag Gain, the End Linear Speed to 1000 mm/s, the Angular Speed Limit to 100 °/s, then click the “Apply” button to enable the function. The specific configuration is shown in Figure 4.

Step3: Switch the robot mode to drag mode to drag the robot. The specific effect is: dragging the robot end effector feels easy and provides a good experience; dragging the robot joints feels heavy.

Figure 8.14‑14 Configuration Parameters for Six-Axis Force Assisted Dragging

  1. Joint Impedance Control

The role of impedance control is to limit the drag force and drag position. Its default status is “Off”.

The specific operation is shown in Figure 5. Set the Impedance Enable Status to “On”, then set the Damping Coefficient and Stiffness Coefficient as shown in Figure 5. The function of the Stiffness Coefficient is currently not available.

Figure 8.14‑15 Configuration Parameters for Joint Impedance

Specific functions of the parameters:

  • Control Status: After enabling, this function can be used in drag mode.

  • Impedance Enable: After enabling, stiffness and damping parameters need to be configured. Its role is to limit the drag force and drag position.

  • Drag Gain: Recommended parameter range [0-5]. Setting the parameter to 0 makes the robot undraggable. Setting to 1 shows no improvement in dragging effect. Setting greater than 1 makes dragging light and provides a good experience. The larger the parameter, the easier the dragging.

  • Stiffness Gain: Set to 0. Its role is to return to the initial position before dragging after dragging.

  • Damping Gain: Its role is to limit the drag force. Parameter range for axes 1-3 is [0-0.5], for axes 4-5 is [0-0.1]; for axis 6 it is [0-0.05].

  • End Linear Speed: 1000 mm/s. When the end linear speed limit is exceeded, the robot switches mode to manual mode and prompts TCP overspeed.

  • Angular Speed Limit: 100 °/s. When the angular speed limit is exceeded, the robot switches mode to manual mode and prompts TCP overspeed.

8.15. Extended Axis with Laser Point Tracking Function

8.15.1. Robot Extended Axis with Laser Point Tracking System Composition

Figure 8.15‑1 Robot Extended Axis with Laser Point Tracking System Composition

In the system, (a) is the computer, (b) is the robot and its control box, (c) is the positioner and drive equipment, (d) is the weld seam tracking laser sensor, (e) is the welder and supporting equipment.

Figure 8.15‑2 Peripheral Installation Diagram

The weld seam tracking laser sensor and welding torch (b) are installed on the end flange of the robot (a), and the positioner (c) is fixedly installed outside the robot.

8.15.2. Extended Axis Communication Configuration

The communication methods between the robot and the extended axis include using UDP or RS485.

Figure 8.15‑3 Extended Axis Configuration Page

Click “Initial” -> “Peripherals” -> “Extended Axis” on the robot operation interface to enter the extended axis configuration page. Taking connecting the robot to a PLC via UDP communication as an example, click the “UDP Communication” icon to enter the UDP communication extended axis configuration page.

Figure 8.15‑4 UDP Communication Configuration Interface

On the UDP communication extended axis configuration page, you can select the corresponding extended axis number, connect and configure UDP communication parameters (address, port, cycle, packet loss detection, etc.), and the extended axis positioning completion time.

The extended axis configuration content is not the focus of this function introduction. For detailed configuration, refer to the corresponding part of the user manual.

8.15.3. Weld Seam Tracking Laser Sensor Connection Configuration

Connect the weld seam tracking laser sensor through the following configuration page:

Figure 8.15‑5 Laser Sensor Connection and Configuration Page

Click “Initial” -> “Peripherals” -> “Line Laser Sensor” -> “Adapted Devices” to enter the configuration page. The configuration page includes “Sensor Configuration”, “Communication Configuration and Loading”, “Base Calculation”. Click “Sensor Configuration” to set the sensor input filter parameters. Click “Communication Configuration and Loading” to input the corresponding communication parameters to connect the laser sensor.

The laser sensor configuration content is not the focus of this function introduction. For detailed configuration, refer to the corresponding part of the user manual.

8.15.4. Welder Connection Configuration

Configure the welder through the following configuration page:

Figure 8.15‑6 Welder Configuration Page

Welder communication can use IO communication or RS485 communication. Click “Initial”, “Peripherals”, “Welder” to enter the configuration and connection interface, where you can configure modules such as “Control Type”, “Signal Corresponding IO”, “Welding Process Parameters”, “Welder Debugging”, etc.

The welder configuration content is not the focus of this function introduction. For detailed configuration, refer to the corresponding part of the user manual.

8.15.5. Tool Coordinate System and Laser Sensor Coordinate System Calibration

After installing the welding torch on the robot end, calibrate the extrinsic parameters between the welding torch and the laser sensor:

Figure 8.15‑7 Tool Coordinate System Configuration Page

Click “Initial”, “Basic”, “Coordinate System”, “Tool” to enter the tool coordinate system setup page.

Figure 8.15‑8 Selecting the 6-Point Method to Calibrate the Welding Torch

Select an empty coordinate system, select the tool type as “Tool”, and choose the 6-point method to calibrate the welding torch tool.

Figure 8.15‑9 Selecting the 5-Point Method to Calibrate the Laser Sensor

Select an empty coordinate system, select the tool type as “Sensor”, and choose the 5-point method to calibrate the laser sensor.

The tool coordinate system and laser sensor coordinate system calibration content is not the focus of this function introduction. For detailed calibration methods, refer to the corresponding part of the user manual.

8.15.6. Extended Axis and Laser Point Tracking Function

Extended axis and laser point tracking are divided into two methods: laser data with transformation executes a “record first, then replay” tracking strategy, and laser data without transformation executes a “record while replaying” tracking strategy.

8.15.6.1. Extended Axis Coordinate System Calibration

Calibrating the extended axis coordinate system is required when using the extended axis coordinate system to achieve synchronized laser tracking between the extended axis and the robot.

Figure 8.15‑10 Extended Axis Coordinate System Setup Page

Click “Initial” -> “Peripherals” -> “Extended Axis” to enter the extended axis coordinate system setup interface. Select the extended axis number that needs to be set, click the edit button, select “4-Single DOF Positioner” and save.

Figure 8.15‑11 Extended Axis Calibration Page

When calibrating the extended axis, pay attention to select “Robot Position Relative to Extended Axis” as “Outside Extended Axis”. For the case of a positioner, select the 4-point method for calibration.

The extended axis calibration content is not the focus of this function introduction. For detailed calibration methods, refer to the corresponding part of the user manual.

8.15.6.2. Synchronized Laser Tracking of Extended Axis and Robot

8.15.6.2.1. Laser Data with Transformation Method

Synchronized laser tracking of the extended axis and robot in the base coordinate system does not require external axis calibration. Other function settings and composition are consistent with synchronized tracking in the extended axis coordinate system.

First, configure the laser tracking data, setting the laser tracker data to the type with transformation.

Figure 8.15‑12 Setting Laser Data to Type with Transformation

Click “Initial”, “Peripherals”, “Tracking”, “Sensor”, click “Sensor Configuration” in the page dropdown, and adjust “Data Processing” to the data type with transformation.

Figure 8.15‑13 Laser Tracking Function Page

This function is implemented through a combination of multi-functional modules. The main functional modules are included within the “Laser Tracking” function. Click “Teach Program” -> “Program Programming” -> “Laser Tracking” to enter the laser tracking page, or click “Laser Record” to directly enter the recording page.

Figure 8.15‑14 Adding the Start Recording Laser Data Instruction

Add the start recording laser data instruction after the extended axis moves to the welding start point.

Figure 8.15‑15 Adding the Stop Recording Laser Data Instruction

Add the stop recording laser data instruction after the extended axis moves to the welding end point.

After the robot finishes recording the movement trajectory of the weld seam during the extended axis motion in place, the extended axis can be returned to the welding start point to prepare for synchronized tracking welding.

At the beginning of welding, the welding torch needs to be moved to the starting point position of the laser sensor recorded data. Add the Move to Welding Point instruction:

Figure 8.15‑16 Adding the Move to Welding Point Instruction

Click “Teach Program” -> “Program Programming” -> “Laser Record” button, select “Move to Welding Point”, set the motion mode and speed, click the “Start Point” button and apply.

Figure 8.15‑17 Adding the Trajectory Replay Instruction for Recorded Laser Data

In the “Laser Tracking” page, select the “Data Record” -> “Trajectory Replay” instruction, click “Add” and apply. In the instruction, the waiting time defaults to 0ms, and the speed is the ratio of the replay speed to the recording speed, recommended to be greater than 50%.

Adding an extended axis motion instruction after the “Trajectory Replay” instruction enables synchronized motion of the extended axis and robot laser tracking.

The following is a typical LUA program for extended axis with laser data transformation point tracking:

Figure 8.15‑18 Example Program for Extended Axis with Laser Data Transformation Point Tracking

The robot executes the “record first, then replay” process. It first records the changing trajectory of the workpiece weld seam during extended axis motion, and then during welding, the extended axis and trajectory replay are executed synchronously.

8.15.6.2.2. Laser Data without Transformation Method

Using the laser data without transformation method for point tracking does not require calibration of the extended axis coordinate system.

Set the laser tracking sensor data to the type without transformation.

Figure 8.15‑19 Setting Laser Data to Type without Transformation

Click “Initial” -> “Peripherals” -> “Line Laser Sensor”, click “Sensor Configuration” in the page dropdown, and adjust “Data Processing” to the data type without transformation.

Figure 8.15‑20 Laser Tracking Function Page

Click “Teach Program” -> “Program Programming” -> “Laser Tracking” to enter the laser tracking page, or click “Laser Record” to directly enter the recording page.

Figure 8.15‑21 Adding the Record While Replaying Instruction

In the “Laser Record” page, select the “Record While Replaying” instruction, click “Add” and apply. In the instruction, you can choose “Delay Time” or “Delay Distance” (distance is recommended). The compensation sensitivity coefficient is adjusted according to the actual sensor laser data; a lower value means lower adjustment sensitivity and better anti-interference. The replay speed defaults to 100%.

Adding an extended axis motion instruction after the “Record While Replaying” instruction enables synchronized motion of the extended axis and robot laser tracking.

The following is a typical LUA program for extended axis with laser data without transformation point tracking:

Figure 8.15‑22 Example Program for Extended Axis with Laser Data without Transformation Point Tracking

After aligning the welding torch with the offset from the front-mounted laser, the robot’s extended axis moves and executes the “record while replaying” process. The front-mounted laser tracker first records the changing trajectory of the workpiece weld seam during extended axis motion, and then adjusts at the welding torch after the set delay distance or time.

8.16. Laser Seam Finding Point Position Acquisition Function

8.16.1. Robot Laser Seam Finding Point Position Acquisition System Composition

Figure 8.16‑1 Robot Laser Seam Finding Point Position Acquisition System Topology Diagram

In the system, (a) is the computer, (b) is the robot and its control box, (c) is the laser sensor.

8.16.2. Laser Sensor Communication Configuration

Open WebApp, click sequentially “Initial” -> “Peripherals” -> “Line Laser Sensor” to configure the sensor communication.

Figure 8.16‑2 Sensor Communication Configuration

8.16.3. Laser Seam Finding Point Position Acquisition Function

The operation process for acquiring the laser seam finding point position is as follows:

Step 1: Before laser seam finding, first designate the seam finding start points “seamStartPt1”, “seamStartPt2”. Then click “Teach Program”, “Program Programming”, select “Point to Point”, and move the laser sensor’s beam close to the seam finding start point 1 “seamStartPt1” near the start of weld seam 1.

Figure 8.16‑3 Adding the Move to Seam Finding Start Point 1 Instruction

Step 2: In the instruction type, click “Seam Finding Start”, then select the calibrated sensor coordinate system, set the seam finding direction, speed, length, and maximum seam finding time, and click the “Add” button. Then click “Seam Finding End”, and click the “Add” button.

Figure 8.16‑4 Adding the Seam Finding Start Instruction

Step 3: Select “Sensor Point Acquisition Motion”, select the calibrated “Laser Sensor” for the coordinate system name, select “PTP” or “LIN” for the motion mode, set the debugging speed and choose whether to “Configure Pose”, click the “Add” button, then click the “Apply” button to add it to the LUA program.

Figure 8.16‑5 Adding the Sensor Point Acquisition Motion Instruction

Step 4: In the “Program Programming” interface, click the “Switch Mode” button, change the variable “pos” to “pos1”, and delete the move to seam finding point instruction.

Figure 8.16‑6 Program Programming Switch Mode

Figure 8.16‑7 Modifying the Acquire Laser Seam Finding Point Program

Step 5: Follow Steps 1-4 to perform seam finding for the second weld seam and acquire the laser seam finding point position.

Figure 8.16‑8 Second Weld Seam Seam Finding Point Acquisition

8.17. DARU DFC Force Control Polishing Head Application

8.17.1. Overview

Installing the DFC polishing head on the robot end-effector helps the robot quickly deploy grinding, polishing, and deburring tasks in different scenarios. It allows customizing the force control magnitude for workpieces of different sizes and shapes, improving the precision and effectiveness of grinding work.

8.17.1.1. Hardware Description

The collaborative robot communicates with and controls the DARU DFC polishing head via Ethernet. The WebApp generates the DARU DFC polishing head communication protocol, which sends control data to the DARU force control controller module via TCP/IP. The module then sends the received control data to the DFC force control actuator, thereby achieving control of the polishing head. The force control controller module acts as the server for Ethernet communication and can connect to polishing head actuators on two channels.

Figure 8.17‑1 Collaborative Robot DARU DFC Polishing Head Application

The force control controller module requires the following configuration: Ethernet port configured with IP address: 192.168.58.88, port number: 2000.

8.17.2. Function Configuration

Open the WebApp, click sequentially on “Initial Setup”, “Peripherals”, “Polishing”. The control types for the polishing head are Pre-adapted Devices and Peripheral Open Protocol: Pre-adapted Devices: Automatically generates and loads the open protocol for adapted polishing head device types, no user programming required. Peripheral Open Protocol: Users write the open protocol for the polishing head to be adapted using Lua to achieve communication control.

Figure 8.17‑2 Polishing Control Types

8.17.2.1. Pre-adapted Device Configuration

Open the WebApp, click sequentially on “Initial Setup”, “Peripherals”, “Polishing Head”, “Pre-adapted Devices”. In the device status, select “DARU DFC Polishing Head” for the type, then click “Configure”. This will automatically load the embedded peripheral open protocol “CtrlDev_DARUDFCPOLISH.lua”.

Figure 8.17‑3 DARU DFC Device Peripheral Open Protocol Auto-loading

With the hardware connection confirmed correct, the open protocol can be started. When the run status is green and the communication status feedback in the Polish status on the right shows “Connection Established”, it indicates successful communication between the robot and the polishing head controller. Parameters can then be configured to set the polishing head channel for force control and the set force value. The open protocol will cyclically send the set value, channel, and the robot’s current rx, ry, rz to the polishing head, as shown in Figure 2-3. Additionally, the Polish status feedback will also display the current force feedback value and force limit warning from the polishing head in real-time. When a warning occurs, an alarm reminder will also appear in the upper right corner of the page, as shown in Figure 2-4.

Figure 8.17‑4 DFC Polishing Head Page Settings and Status Feedback

Figure 8.17‑5 DFC Polishing Head Force Control Limit Exceeded Alarm

8.17.2.2. Peripheral Open Protocol Download

Click the “Download” button in “Peripheral Open Protocol” to download the protocol to the local computer. The peripheral open protocol is a cyclically executed LUA program. In each cycle, the program performs the following steps:

① Read control data for the DFC polishing head from the robot;

② Write control data to the DFC polishing head via socket;

③ Read status data from the DFC polishing head via socket;

④ Feedback DFC polishing head status data to the robot;

The communication protocol executes cyclically to achieve communication control between the robot and the polishing head. Within the communication protocol, users can customize the cycle period, the server port to connect to, and the IP address.

Below is a sample communication protocol code for the DARU DFC polishing head:

local id = 1
local ctrlValues = {0,00,00,00,0}
local realTimeState = {0,00,00,00,0}
socket1 = TCPClientConnect('192.168.58.88'20005001023)
sleepCnt = 100
while(sleepCnt > 0) do
    local stopFlag = GetOpenLUAStopFlag(id)
    if(stopFlag ~= 0) then
      TCPClientDisconnect(socket1)
      setDFCPolishRealtimeState(000)
      break
    end
  sleepCnt = sleepCnt -1
  sleep_ms(50)
end
local cnt = 5
while(1) do
    channel, force = getDFCPolishSet()
    comState, sendBuff = DFCPolishInput(socket1, channel, force)
    sleep_ms(50)

    byte, error, forceFeedback = DFCPolishOutput(socket1)
    setDFCPolishRealtimeState(comState, error, forceFeedback)
    sleep_ms(50)

  if(comState == 0) then
      TCPClientDisconnect(socket1)
      while(cnt > 0) do
        socket1 = TCPClientConnect('192.168.58.88'20005001023)
        cnt = cnt - 1
        if(socket1 > 0)then
          break
        end
      end
  end

    local stopFlag = GetOpenLUAStopFlag(id)
    if(stopFlag ~= 0 or cnt == 0) then
      TCPClientDisconnect(socket1)
      setDFCPolishRealtimeState(000)
      break
    end
end

8.17.3. DFC Polishing Head LUA Program Application

Adding DFC force control configuration, channel switching, status acquisition instructions, etc., to the robot LUA program, combined with robot motion instructions, enables flexible and convenient implementation of polishing applications. Open the WebApp, click sequentially on “Teach Program”, “Program Programming”, and create a new LUA program “testDFC.lua”.

Figure 8.17‑6 Create New “testDFC.lua” Program

Select the instruction type as “Peripheral Instruction”, and click the “Polishing Device” button in the peripheral instructions. The “Polish” polishing instruction addition page will then appear on the right side of the WebApp. Select “DARU DFC Polishing Head” for the device type.

Figure 8.17‑7 Polishing Head Instruction Addition

8.17.3.1. Polishing Head Control Instruction Addition

Writing polishing head control instructions in the LUA program allows force control setting and channel selection for the DFC.

In the polishing device instruction addition page, click “Set DFC”, select the polishing head channel mode as “2”, and the set force as “10”. Click the “Add” button to add the polishing head setting instruction in the “Program Preview”.

Figure 8.17‑8 Add Polishing Head Control Instruction

8.17.3.2. Polishing Head Status Acquisition Instruction Addition

Click “Get DFC Data”, then click “Add” and “Apply” buttons sequentially. This adds an instruction “GetDFCState()” to “testDFC.lua” for acquiring polishing head data.

Figure 8.17‑9 Add Get Polishing Head Status Instruction

The GetDFCState() instruction returns 2 values, as follows:

DFCwarn: Force control limit exceeded warning 0-Normal 1-Alarm;

force: Force feedback value.

In “testDFC.lua”, use three variables to receive the return values of the GetDFCState() function. Use Lua variable query to display the above information in the WebApp variable query display area.

Figure 8.17‑10 Get Polishing Head Status Program

8.17.3.3. Application Example

The following is a LUA program example for DFC polishing head control and monitoring:

SetDFCForce(0,25)
while (1) do
    PTP(c1,100,-1,0)
    SetDO(0,1,0,0)
    ARC(c2,0,0,0,0,0,0,0,c3,0,0,0,0,0,0,0,100,-1,0,100,200)
    DFCwarn,force = GetDFCState()
    RegisterVar("number","DFCwarn")
    RegisterVar("number","force")
    if(DFCwarn == 1) then
        PTP(safe,100,-1,0)
        break
    else
        PTP(p6,100,-1,0)
    end
    SetDO(0,0,0,0)
end

robotic arm
FAIRINO ROBOTIC ARMS

Contact

Location: 10637 Scripps Summit Court,

San Diego, CA. 92131
Phone: (619) 333-FAIR
Email: hello@fairino.us

© 2023 FAIRINO Proudly created By G2T

bottom of page