# Optimizing Assembly in Wiring Boxes Using API Technology for Digital Twin
## 4 Proof of Concept for Optimizing Assembly in Wiring Boxes
### Creating the Digital Twin Model Using API Technology  
The 3D model of the real wiring boxes (Figure 4) was made using reverse engineering in the Onshape application. This printed model of wiring boxes was used in the preliminary tests. The dimensions for the fuses used in that box are presented in the next figure. In Figure 5a, only the necessary dimensions for defining the gripper have been provided. The remaining dimensions conform to the actual model. In this case study, new fuses were used, as well as the original wiring box, to achieve optimal results. Figure 4: Wiring/fuse box: (**a**) 3D-printed model, (**b**) real fuse box. Figure 3: Real fuse box with fuses and relays. Due to the small size of the resistors, it was necessary to design and 3D print a gripper that was adapted to the dimensions of the two types of resistors that were previously presented in order to create the proof-of-concept prototype; the execution drawing of the gripper arm is presented in Figure 6.  
Figure 7 presents how the gripper arm holds the fuse. After the wiring box model was created and printed, the fuses were created in the virtual model. Using the same application, Onshape, the fuses were assembled in their place, taking into account the real model (Figure 8). Figure 5: Fuse dimensions: (**a**) virtual 3D model, (**b**) real model [18]. Figure 6: The execution drawing of the gripper. Figure 7: The gripper arm holds the fuse: (**a**) the isometric section, (**b**) the view from the fuse box. The setup made for digital twin is presented in Figure 9. The setup for creating a digital twin is designed as follows: the fuses will be taken from a fixed point that was previously established in the storage location (the white locations where the fuses are inserted). Each type of fuse has its own column where it is stored. The robot, using computer vision, identifies where the fuse is and knows its type based on its location. The robotic arm takes the fuse and places it in the designated location in the box, as determined by the program. The system uses computer vision algorithms to identify the fuses in the environment. This process starts with image capture from a high-resolution camera, followed by image processing techniques like edge detection and shape recognition. The algorithm then classifies the fuses based on predefined attributes such as size, shape, and color. Once the fuses are identified, their positions are calculated relative to the robotic arm's reference frame using transformation matrices. This positional data is then sent to the robot's control system, enabling the arm to adjust its movements for precise grasping and insertion. The identified positions of the fuses are translated into the robotic arm's reference frame using kinematic transformations. This enables the robotic arm to move precisely toward the fuses, grasp them, and perform the insertion process with minimal error. By continuously updating the arm's movements based on real-time feedback, the system ensures accuracy even in dynamic environments. The robot places the fuse in its location in the box and releases it at only 2 mm inside the location. After the release, the robot raises the gripper to a safe distance, rotates the gripper 90 degrees, and presses the fuse into the location with the gripper closed and turned perpendicular to the fuse. This way, the robot controls precisely the amount of force applied to each fuse, without the risk of the fuse slipping inside the gripper. In support of the points mentioned above, we have a video documenting the entire process, which is included as a Supplementary Material to the manuscript. This video  
Figure 8: Fuses: (**a**) 3D, virtual fuse models, (**b**) real fuses. Figure 9: Creating a digital twin: (**a**) 3D, virtual models, (**b**) real model. offers a detailed view of the procedure, including the precise placement of the fuse, its release, and the pressing action performed by the robotic arm.