Cyber-physical-robotic System (CPRS)-based Modeling and Execution of Assembly Tasks

In this study, we develop an autonomous process of conducting an assembly task by attaching systematic assembly sequence information to an object’s computer-aided design (CAD) model. The information registered in the CAD model is then captured to arrange the robot trajectory, programmable logic controller commands, part three-dimensional printing, and actuator/vision system commands. The vision system can feedback information to modify the CAD model, the operating system, and the position errors in the robot space to achieve the cyber-physical-robotic system (CPRS) closed-loop control. This innovative system can reduce the fixture implementation time, the (robot) manual teaching time, the error variation, and the demand for robot teaching experts in production lines in fast-changing and easy expansion situations. The capability of automatic trajectory generation will increase the precision of the operation to extend the work range from tasks such as loading-unloading, pallet, spray, and welding, which rely on a tolerance of about ±0.5 mm, to assembly, which relies on a tolerance of ±0.1 mm.


Introduction
In recent years, industrial automation from the third industrial revolution (factory automation and flexible manufacturing systems) evolved into Industry 4.0, (1) of which robots are an important component, but failed to include computer numerical control (CNC) machine tools such as product development and sample preparation process, and can be transplanted to a mass production line with work coordinates set on different CNC machine tools. When an order changes, the material supply chain is abnormal, business process reengineering (BPR) or optimization of processing flow causes process change design, and different processing programs can be applied to hardware-compatible CNC machine tools without modification and easily change the production process. Because there is still an absolute space error of several millimeters (max. 2.1 mm) on the robot under the rated load, the maximum error after correction is 0.696 mm. (2) Such error limitation restricts the robot to work that requires less precision. If the production line requires work adjustment due to scheduling, all working points require manual inspection and reprogramming of each robot to conform to operation requirements, thereby undermining line change efficiency, increasing changes in the manual adjustment of various types of equipment, and reducing the processing capability.
Conventional robot programming is divided into online programming and off line programming (OLP). (3) Online programming uses programming tools to program working points to conform with robot specifications and precision limitations, so the robot's production capacity decreases during programming and undermines production efficiency. Because only professional personnel can reduce programming error, the dispatch of professional personnel and online programming will become bottlenecks in production. OLP sets the work trajectory in three-dimensional (3D) software, but site operation still requires professional personnel to perform certain portions of the programming operation. This article refers to the fourth stage of the industrial revolution (1) and CNC processing programming and adds the cyber-physical -robotic system (CPRS) to the site operation to reduce the workload of professional personnel and improve process capability.
This paper is organized in five sections. In Sect. 2, we present the current programming of the robot. In Sect. 3, we use a CPRS to improve the OLP. In Sect. 4, we describe the experiment and give a discussion. A summary of the study and future research trends are presented in Sect. 5.

Programming Methods for Industrial Robots
Conventional robot programming is divided into online programming and OLP, but both methods have shortcomings that make duplication of the production line and expansion of production or workstation process adjustment less convenient than CNC machine tools since the advent of the third industrial revolution of the robot. In exploring the tolerance of the robot and CNC machine tools, we seek an appropriate programming method for the robot so a production line for assembling the robot can duplicate production capacity as easily as a CNC production line.

Robot tolerance
Most robot controllers' forward kinematics use the Denavit-Hartenberg matrix parameter as a value on a specification sheet, but geometric and dimensional errors that result from the manufacture and assembly of robots cause the coordinates and controls on the robot end effector to have an error of 0.7 to 2.1 mm (2) for the coordinates calculated from a Denavit-Hartenberg matrix and each joint encoder feedback angle. The absolute precision in space of the robot is a maximum of 2.1 mm before calibration and a maximum of 0.7 mm after calibration. Such error has limited robot applications to loading, unloading, spraying, welding, and stacking with a comparatively larger tolerance in work while making it unfavorable for assembly with a smaller tolerance in workstation task adjustment and process change. At production expansion, the robot program of the original production line cannot be duplicated to the new production line and goes into immediate production because reprogramming is required to eliminate the error caused by different robots from the allocation of each workstation's tasks. The robot's maximum angular error of ±0.1°( 2) is acceptable for a general assembly process.

CNC error
According to ISO 10791-1/ISO10791-4.2 Travel X/Y/Z: 900/610/610 mm, the CNC machine tool space error is 0.02 mm or less, and its precision is 0.01 mm or less; (4) therefore, the scheduling of the CNC machine tool production line in the machine room can still produce workpieces that conform to general assembly error. Production expansion can be accomplished by duplicating its original program to a compatible CNC controller.

Online programming
Online programming is divided into two types. One is to use the robot's teaching device to command every task of the arm, and the operator visually checks whether the arm has reached the working point. Upon reaching the working point, the robot coordinates and posture are recorded in the temporary controller working point register. Because most robots can only adjust the percentage of movement to control the amount of feed, each different type of robot has a different movement rate. Another method of robot operator programming is to leadthrough the robot to maintain the robot's ideal position and location.
Both methods require prolonged training of an operator with inconsistent error of each training, thereby decreasing the production line's processing capability, increasing the defective yield, and taking up a considerable portion of the robot's operation time. An unskilled robot operator can easily crash the machine or make the production process too time-consuming.

OLP
OLP cannot fully automate the process of computer-aided design (CAD) to robot programming, (3) even though the computer-aided manufacturing (CAM) system developed before the OLP must be added to the manual selection of tools, workmanship, cutting point, feed mode, feed rate, and other parameters. When a product contains more and more parts, its life cycle is short, and its design changes frequently, and engineers must complete the design changes in the fastest robot assembly trajectory planning. Online programming takes up robot production time and makes production less efficient. Therefore, most robot factories have configured OLP software, but the function is not easy to expand. Self-development is not subject to factory restrictions. Self-development can be divided into two categories: the use of CAD software application programming interface (API) functions such as Autodesk Inventor, (5) FreeCAD, (6) SolidWorks, (7) and AutoCAD, (8) and the use of a drawing library or ROS.
Compared with the teaching method of the CNC machine, the traditional teaching process of industrial robots does not know the teaching target error amount and the industrial arm space precision is insufficient; therefore, new methods must be developed to perform the assembly task. References 2,9, and 10 used laser trackers to measure the absolute coordinates of the ends of robots, and it has been shown that the absence of sensors on the robots for feeding back the absolute coordinates of the end space of the robots requires an additional sensing system. Most OLPs generate industrial robot programs by the open-loop method. (3) Even if each step is optimized, it does not solve the absolute accuracy error of robots.

CPRS
Most commercially available OLP systems only work with large-tolerance tasks such as loading and unloading, stacking, painting, and welding. CPRS changes the traditional OLP workflow process by business process reengineering, as shown in Fig. 1. It reduces the setting time of tags. The commands run the same tasks in different industrial robots. The amount of tag information of an assembly task is more than that of a general task. Adding tag information in the part file is shown in Fig. 2. This reduces the set time of the tag information of the assembled parts. The traditional OLP is modeled first, and the tag is then changed to the same stage execution. The vision system of the CPRS flowchart is shown in Fig. 3.
The CPRS hardware architecture is shown in Fig. 4. Users send g-codes of parts to the 3D printer in the PC's CAD software. Assembly information is added to the CAD drawing system, and CAD software API function analysis assembly information is used to generate a programmable logic controller (PLC), gripper, vision system, ROBOT, and other actuator commands transmitted via Ethernet to the PLC. The PLC follows the order control ROBOT and vision system via Ethernet to complete the position feedback control system. The PLC's I/O port controls a gripper and an actuator to finish I/O action.

3D CAD model and tag creation
In recent years, the computing power of CPUs and graphics processing units (GPUs) has grown considerably. The computer hardware and software in most design departments of a modern company meet the requirements for 3D simulation of automated design. The suppliers of parts or equipment take the initiative to provide evaluation-specific 3D model appearance for users to evaluate the design and reduce sample costs and time to lease, and upon completion of the design, it naturally eliminates the chances of incompatible installation. Workpieces not available for 3D modeling can be modeled using 3D scanning (11,12) or manual measurement of assembly dimensions. Tag creation is usually a time-consuming process and can require secondary programming for automatic tag recognition. (2) The 3D CAD models provided by the robot manufacturers often lack interconnection details. Therefore, we must define the interconnection details between every connecting joint and define the zero angle position for each joint to allow the detection of all robot joint angles in the model space.
In 1988, owing to the hardware and software limitations of PCs at that time, 3D simulation could not be carried out. Robot Assembly Language Planner in Harmony (RALPH) (13,14) was built using 3D CAD models based on constructive solid geometry. RALPH is not intuitive. Traditional OLP would take a lot of time on tag creation after building 3D CAD models. CPRS allows the addition of basic tag information in the part-model building stage. The trajectory planning of an industrial robot that involves the part models can be edited in a much more intuitive manner.   Most CAD software can set up multiple configurations with a particular part drawing. On the basis of the requirements, variable values or shape features would be specified in each configuration. For example, various types of bearings can be defined by different configurations, which means that different types of bearings can be chosen simply by choosing the bearing configuration in the combination drawing. The combination section of configuration data and product database is convenient for drawing file management.
The method of extending the configuration settings of parts is to set the main assembly order in the model configuration, as shown in Fig. 5. The operator refers to Tables 1 and 2 to input the subassembly instruction into the description column of each main assembly configuration, as shown in Fig. 6. The actuator and the state of the visual system are set as shown in Table 3. The variable   preinstallment height and visual height are equal to the line insertion assembly distance and the working height of the visual system. The camera's front end taper height is the working height of the vision system. The green circle under the cone bottom is used to determine whether the landmark deviates from the visual detection range, as shown in Fig. 2. The statuses of the gripper, fixture, and visual system are set as shown in Table 3. The tag of the main assembly calibration has been completed, as shown in Fig. 7 and Table 4.

Trajectory planning and simulation
The assembly order and instructions can be obtained by API functions after reading the assembly model's configuration data. Table 1 lists the assembly instructions, T, V, G, F, and P. Table 2 lists the conversion from industrial robot movement to subassembly configuration. Traverse the tree of feature manager of each assembly to find the name of the part, which includes "_G" as a gripper, "_F" as a fixture, and "_V" as the vision system. The configuration of the part acquired determines whether the part is involved in the action. The 3D model is modified according to the preinstall height and visual height. The robot motion is then checked in terms of reachability and collisions. Each configuration of the gripper, the fixture, and the visual system status constitutes the assembly command. The STEP0055-generated configuration of the subassembly is shown in Table 5.

Process planning
The movement sequence of the industrial robot has been set in the assembly model configuration. The visual assistant positioning system can find the optimal trajectory of the robot by solving a traveling salesman problem.  provide examples to solve the traveling salesman problem using genetic algorithms. The vision system is switched off to increase the assembly speed after recording the corrected position in every work point that requires vision correction. The vision system is turned on when the sampling test of statistical process control is executed.

Postprocessing and robot command
The I/O control of the gripper, the I/O control of the fixture, and the name of the visual inspection program must correspond to the name of the external controller. CPRS generates industrial robot position movement instructions. The controller of the industrial robot performs a written explanation CPRS instruction program. Various industrial arms can perform the same instruction without postprocessing. Instructions include the transfer matrix for the vision system to fix the robot space error.

Calibration and execution
In this paper, the maximum error of the pixel size correction of the visual system is 0.0268 mm, using two solid dots of 6 mm diameter marked at a distance of 20 mm with the tolerance of the workpiece placed at a ±20 mm error range. Foci of the CCD and light source have been properly adjusted in advance, and the center of two circles, the position of the visual system, and the camera work height are registered, as shown in Fig. 9.
The traditional teaching process requires the fixture to be fixed to a working surface. The correction process is time-consuming and is subject to potential collision. In CPRS, the same landmarks described in the previous paragraph are generated on the fixture. During the calibration process, the fixture is placed on the desk, and the industrial robot clamps the workpiece to be on top of the fixture. The fixture position is manually adjusted so that the workpiece is tightly fit for a quality insertion to the fixture. The fixture is then fixed, and  Table 3 the industrial arm moves up to the default height of the visual system (camera). The camera system now registers the landmark coordinates as the standard values of this fixture, which will be efficiently used when a new robot is used to perform the insertion in a new production line. This proposed process, which can be used with other robots, will save considerable time compared with the traditional teaching process, which is only valid with the current robots. After the registration process is completed, the program can be used in any new production line with a new robot. For a new robot, the visual system is moved to a preset position and allowed to detect the distance of the two landmarks (solid dots) and the angle between the horizontal axis and the line connecting two dots, and then return error values of ∆x, ∆y, ∆z, and ∆ϕ of the Z-axis. These error values are substituted into Eq. (5) to obtain the displacement correction and into Eq. (4) to obtain the angle correction for the new industrial robot. The visual servoing process will use these error values to minimize the camera position errors to reach the same relative position for successful insertion. When the error is less than 1.8 mm or 0.2°, the required movement of the industrial robot in the visual servoing needs to be cut in half to ensure rapid convergence. x y x y z z

Experiment
We will conduct two assembly tasks in the experiment. For each assembly task, the operation of the robot teaching process is first performed so that the landmark positions in the camera system for each single insertion are registered. This robot assembly task can then be implemented in a new production line with a new robot with satisfactory efficiency. The CPRS system will move the robot with the camera system to the default position based on the positions of the fixture and the robot position defined in the CAD model. The robot with the camera system will perform a new calibration operation to move it to a precise position at which the landmarks appear at identical positions to the camera. The end-effector position is registered as the new assembly position of this robot for the particular task. When the end effector position is registered, the six joint angles are recorded. The robot will then repeatedly perform the assembly task at the same location with high repeatability and accuracy. No further vision calibration will be needed at the routine operation stage. The two common assembly tasks selected include the installment of the printed circuit board assembly (PCBA) into the case of a jumper box and the screw-tightening operation of a bottle cap onto a bottle. In this experiment, the fixture of two operations was randomly placed in the work area to show its robust applicability.

Stack assembly
The first experimental target is a jumper box that consists of three objects-the upper case, the middle PCBA, and the lower case-stacked together. The assembly accuracy required in this task is ±0.1 mm. The end effector of the robot comprises the camera system, which consists of two industrial cameras and one gripper with a pair of specially designed L-shaped clamps for picking up two objects of different sizes, as shown in Fig. 10(a). Before the calibration, the assembly fixture is placed with a positioning error of ±20 mm compared with the precise location defined in the teaching process. The calibration process will move the robot to the correct position by using visual servoing techniques to minimize the landmark location errors. After calibration, the robot will use the newly obtained trajectories to perform the assembly sequence. The entire assembly includes the insertion of the lower case into the fixture, the placement of the PCBA into the fixing recesses of the lower case, and finally the insertion of the upper case into the integrated set of the lower case and the PCBA. The CPRS-guided assembly procedure was proven successfully in the assembly task, with an assembly accuracy requirement of less than ±0.1 mm. A video that shows the entire assembly process can be seen in Ref. 18.

Bottle-filling assembly
The second experimental target is the glass bottle, a threaded bottle cap, and a cylindrical object to be put inside the bottle, as shown in Fig. 10(b). This bottle-filling assembly requires an assembly accuracy of ±0.1 mm. The end effector set contains industrial cameras, grippers, and a pneumatic jig to fix the glass bottle. Before the calibration, the assembly of the jig is set to a location within the range of ±20 mm. During the calibration process, the positioning errors are minimized with the visual servoing techniques based on the observed landmark errors captured by the camera. The corrected robot positions are recorded. The robot assembly procedure is performed by all registered robot positions and matching trajectories.
The entire assembly includes the pick and placement of the glass bottle into the pneumatic jig, the pick and placement of the cylindrical object into the glass bottle, and finally, the pick, placement, and screw-fastening of the bottle cap into the bottle. Again, the proposed CPRSguided assembly procedure was proven successfully in the assembly task with an assembly accuracy requirement of less than ±0.1 mm. A video that shows the entire assembly process can be seen in Ref. 19.

Results and discussion
During the calibration stage when a new production or a new robot is used, the first requirement is to fix the fixture within a zone that has a maximum position error of ±20 mm compared with the position defined in the CAD model. The robot will be automatically guided to be atop the fixture based on the CAD information. The calibration will then be fully autonomously performed at each assembly step and generate the precise robot assembly positions, which are registered in joint angles. After this, the setup on the new robot or new production line is completed. The robot can perform all required assembly tasks with high repeatability accuracy without the need of any visual adjustment.
The tolerance of the stacked assembly was ±0.1 mm. To ensure high reliability supported by sufficient position accuracy, the convergence threshold value of the position error during the visual servoing operation was set as ±0.04 mm and ±0.1°. With such vision landmark calibration level, 20 repeated stack assembly operations were 100% successful. The statistics of the visual servoing operation for calibration can be seen in Table 6.
The acceptable tolerance of the bottle-filling assembly was also ±0.1 mm. Because no angular adjustment is involved in the thread-screwing operation, the convergence threshold value of the position error during the visual servoing operation was set to a larger value of ±0.08 Table 6 Statistics of stack and helical assembly after 20 repetitions.

Conclusions
From the experiments, the CAD-based CPRS system significantly reduces the requirement of a high positioning accuracy on the robot and allows the fixture to have greater positioning tolerance. These advantages then reduce the setup time on a new production line or with a new robot. For example, in the stack assembly case shown in Sect. 4.1, the teaching time used for defining the new task will take 2 to 3 h. By using the proposed CPRS system, it takes only 5 min to teach a new landmark. When part trays are used in the assembly line, the traditional method will even double its teaching time while the time needed in CPRS remains the same with identical landmarks. When the manufacturing process is changed or the production line is extended, the setup time is shortened, the number of variation factors is decreased, the productivity rises, and the strict demand on an experienced engineer for the new setup operation is relaxed.
The operating environment of the CPRS system uses commercial CAD software available in the design department, which will lead to extra software or personnel-training costs. Since the CAD-based CPRS system uses CAD model files as its source content, the relative positions between the robot gripper and the parts can be defined in a fully automated manner. Furthermore, the alternative-part function in the CAD model can be used in the CPRS system when an alternative part is used and then all required new robot assembly commands will also be automatically redefined. The camera-system feedback-based CPRS system will increase the robot's capacity by increasing its positioning accuracy. With these advantages, the CPRS system can extend the work spectrum of the OLP from loading and unloading, stacking, painting, and welding tasks that permit a large tolerance to tasks such as precision assemblies that demand great positioning accuracy.
In the product design stage, the positioning features can be added to proper positions of the parts, the landmarks on the fixture used in the CPRS system will no longer be necessary, and the time spent for creating the landmarks on the fixtures can be saved. These landmarks printed on the products can be further used as features for positioning and measurement for quality control.