## 4 Implementation and Validation DT in AS Ecosystem
Through this exchange, the digital twin becomes a mirror, accurately  
Figure 7: The cylinder (U/D) for two approaches: (**a**) the pneumatic diagram for positioning cylinder in AS; and (**b**) displacement of cylinder for different position references. reflecting the state of the real-world mechatronic system. Furthermore, the OPC server also relays control directives from the digital twin to the PLC, effectively empowering the digital twin to guide the operational state of the real system. The OPC server diligently ensures rapid data delivery to the digital twin, thereby maintaining congruence between the digital twin and the real system. Hence, the OPC server's role is pivotal in simplifying and streamlining the communication and data translation processes between the digital twin and the PLC. By adhering to the OPC standard, the server guarantees seamless interfacing capabilities with any compliant system. This results in the more efficient, flexible, and robust development and utilisation of digital twins across diverse mechatronic systems. In the project, communication with the PLC model XBC-DR30 SU occurs via an Ethernet communication module, specifically the EMTA configured as a Modbus TCP server. The process involves creating a generic channel (because the model of PLC is not in the standard library of KEPServerEX and adding the device connected through its IP address. Initially, all inputs and outputs are defined in the server (Figure 8a, and subsequently, they are set up in the client within AS. AS has the capability to connect to an OPC Server, which simplifies the process of pairing OPC tags with sensors and solenoid valves from the virtual model (Figure 8b). The DT can effectively communicate with the real-world PLC by establishing this connection. This simulation makes it easy to understand the impact of different parameters (flows, pressures from pneumatic circuit) in the behaviour robot to make the finest adjustments to synchronise the robot 1:1 with its DT. In a pneumatic system, the flow rate significantly affects the speed at which the pneumatic cylinder operates. A higher flow rate means more air can fill the cylinder per unit of time, resulting in faster cylinder actuation and vice versa. To ensure that the DT of the pneumatic robot accurately replicates the real-world system, its behaviour must be validated. The validation process entails a series of steps that compare the DT's performance with that of the actual system, ensuring that the DT effectively represents the real-world system's behaviour. In the industrial domain, the accuracy of a DT is of paramount importance, often even more so than in academia. This is because industries rely on DTs to make informed decisions regarding optimisation, control strategies, predictive maintenance, training and safety, and last but not least, customisation and personalisation. All these things have significant financial, operational, and safety implications. A systematic approach validation process for DT involves several interconnected stages that work together to improve the DT's accuracy and reliability:  
* **Establish performance metrics**--it is important to establish key performance indicators (KPIs) for the modelled system and prioritise them based on their significance for the specific application. This prioritisation helps focus the validation process on the most critical aspects of the system's performance. * **Set-up working scenarios**--this step involves defining the working scenarios. A bottom-up approach can be employed, starting with the individual components  
Figure 8: Configuration of the OPC mechanism: (**a**) the screenshot from the KEPServerEX—defining the OPC server; and (**b**) the screenshot from the AS—the OPC client linked with the variable from DT. of the robot and progressing towards the entire system. This method ensures a comprehensive understanding of the system at each level of complexity.