## 3. Matherial and Methods
### Development of the System
#### 3.7.1 Physical System Development
It is observed that the system is capable of diagnosing and locating the failures induced in inputs and outputs selected in Table 3; in the third column, a specific number of induced failures is selected, and it is observed that the system in the eighth column can satisfactorily diagnose and locate all the induced failures. The proposed approach for a basic cyber-physical system is composed of a virtual twin simulating the process of the physical system. The virtual twin executed simultaneously with the operation of the physical systems allows for a comparison in real time. When the behavior of both do not match, a fault is diagnosed. The presented approach can be extended to diverse manufacturing systems. ## 5 Conclusions

This work proposed a novel scheme of a basic cyber-physical system that incorporates a virtual system at the supervisory control level. The virtual system is executed in a real-time simulation, providing means to monitor and diagnose failures in sensors, actuators and in the execution of the sequential logic control. In this approach, the digital twin is mainly a numerical simulation of the process and its controller, which is made up of algorithms that combine a hybrid automata as a virtual controller, along with the sensors and actuators modeled in a complex network. The implemented system acts as a supervisory control system capable of diagnosing and locating failures in physical systems in real time. The algorithms were validated in an automated storage and retrieval system. The implementation was required to solve some synchronization problems presented in the coordination of the digital twin with the physical system. One of the main tests showed

\[DI_{mPS_{k}}=DI_{mPS_{k-1}}+DI_{PS_{k}}\]6 Location of faults. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \begin{tabular}{c} **No.** \\ **Simulation** \\ \end{tabular}  & \begin{tabular}{c} **State** \\ **State** \\ \end{tabular}  & \begin{tabular}{c} **Input/Output** \\ **Induce Fault** \\ \end{tabular}  & \begin{tabular}{c} **Input** \\ **Physical** \\ **Vector** \\ \end{tabular}  & \begin{tabular}{c} **Input** \\ **Virtual** \\ **Vector** \\ \end{tabular}  & \begin{tabular}{c} **Output** \\ **Physical** \\ **Vector** \\ \end{tabular}  & \ \begin{tabular}{c} **Output** \\ **Virtual** \\ **Vector** \\ \end{tabular}  & \begin{tabular}{c} **Fault** \\ **Detection** \\ \end{tabular}  \\ \hline
1 & \(q_{73}\) & I10.4, Q11.4 & I10.4 = 0 & I10.4 = 1 & Q11.4 = 0 & Q11.4 = 1 & I10.4, \\
2 & \(q_{79}\) & I10.5, Q11.0 & I10.5 = 0 & I10.5 = 1 & Q11.0 = 0 & Q11.0 = 1 & I10.5, \\
3 & \(q_{74}\) & I11.0, I11.1 & I11.0 = 0 & I11. that the system was capable of detecting and locating failures in two actuators and two sensors. The obtained results validate that the proposed scheme is able to diagnose and locate concurrent faults in real time and can be incorporated as an advance automation function of manufacturing systems. Conceptualization, A.V. and F.M. ; methodology, A.V. and F.M. ; software, A.V. ; validation, A.V. ; formal analysis, A.V. and F.M. ; investigation, A.V. ; resources, F.M. ; data curation, A.V. ; writing--original draft preparation, A.V. and F.M. ; writing--review and editing, I.Y.S. and C.A.P. ; visualization, A.V. ; supervision, F.M. ; project administration, A.V. ; funding acquisition, A.V. All authors have read and agreed to the published version of the manuscript. Partially funded by CONAHCYT--scholarship program for graduate studies. Not applicable. The authors declare no conflict of interest.