# Conceiving a Digital Twin for a Flexible Manufacturing System
## 2 Proposed Methodology
### Steps for Creating the Proposed Digital Twin  
The DT proposed in this work was created using four specific modules of the Amatrol V 88-113D CIMSoft (Jeffersonville, IN, USA) ERP and manufacturing execution system, namely production planning, manufacturing management, facilities layout, and system simulation. The production planning module is used for creating work centers and costs in the ERP system. The manufacturing management module is used to schedule and release manufacturing orders. The facilities layout module enables digitizing the FMS components in a virtual environment that interacts with the system simulation module in real time. In the facilities layout module, the human-machine interface (HMI) is defined. HMI development software packages vary in their development methods. Typically, objects are selected from a library of pre-written graphical objects. Each object has a set of parameters that must be defined. Such parameters may include the object's location within a coordinate system, among others. The graphical objects of the presentation are connected to a database through identifiers (tags). An identifier is an object that is used to reference a piece of data. When data within the database are updated (via the PLC or other controller), the object linked with the HMI display is updated. This update is based on the information sent by sensors, such as (a) rotary spindle speed, axis travel, tool indexer in the CNC lathe; (b) end effector torque sensor, travel speed in robot arm; (c) conveyor speed and RFID bar code sensor in pallet and conveyor. These pieces of equipment are present in FMS as shown in Figure 3. Transmission control protocol (TCP) was used in data acquisition and communication. This guarantees reliable point-to-point data transmission. The Amatrol CIMSoft graphic library contains several graphic objects that are already connected to the relevant data. This eliminates the need to enter identifiers during HMI development. Some of the general steps for developing an HMI using the CIMSoft V 88-113D (Jeffersonville, IN, USA) software package are as follows:  
Figure 3: Main sensors in the FMS. * Step 1: Choose the type and size of conveyor system to use. This identifies the shape, length, and any conveyor protractor. This information is important because the production rate simulation by DT takes into account these pieces of information as well as robot displacement speed. * Step 2: Choose the type of material storage and delivery. * Step 3: Locate the conveyor pallet positioning stations. These correspond to the locations where the pallets will stop by workstations. * Step 4: Identify pallet positioning stations with station number, work center ID, and programming address. This informs the system which work will be carried out and what address to use to send and receive data. * Step 5: Add equipment to work centers. This includes CNC machines, robot arms, conveyors, part feeders, computers, etc. * Step 6: Add descriptive texts to label stations or equipment. These steps are summarized in Figure 4.  
After these steps the user can then run a manufacturing simulation. At this point, the following steps should be observed: (a) verify that all data have been entered: bill of materials (BOM), identified work centers, completed and released manufacturing orders, created and saved HMI layout; (b) open an HMI layout file: the layout must match the route that is to be simulated; (c) add stock: supply virtual raw material; (d) select the manufacturing order (must correspond to HMI); (e) start the simulation. In this work, time and cost information were obtained from production tryouts in the real FMS. A batch of five parts was processed and average times were assigned to each work center. Table 2 shows the average values that were used in each step. These are important data to check the DT's precision during production rate simulation.