# Application of Modeling and Simulation in a Self-Reprogrammable Prototype of a Manufacturing System
## 5 Test and Results  
The model validation was carried out considering a 95% confidence interval. All data related to cycle time virtual and real are shown in Table 1.  
Using the validation Equation (2) through the confidence interval, it is possible to state that the developed simulation model adheres to the real system by 95%. \[\overline{Xs}+\overline{Xr}\ \pm t_{1n-1,\frac{\pi}{2}}\ \sqrt{\frac{Ss^{2}+Sr^{2}}{n}} \tag{2}\]  
\(\mathrm{Xs}=\mathrm{Simulation}\) Mean  
\(\mathrm{Xr}=\mathrm{Real}\) Mean  
\(\mathrm{Ss}=\mathrm{Simulation}\) Standard Deviation  
\(\mathrm{Sr}=\mathrm{Real}\) Standard Deviation  
\(\mathrm{\alpha}=0.05\)  
\(\mathrm{t}=2.23\) (according to table t of Student)  
The development of the simulation model followed the recommendations in the previous section. For this, three programming codes were developed, and they can receive data from the real system and apply the work speed optimization equation. \begin{table}
\begin{tabular}{c c c c c} \hline  & **Real Time (s) Speed** & **Virtual Time (s)** & **Real Time (s) Speed** & **Virtual Time (s)** \\  & **11 cm/s** & **Speed 11 cm/s** & **15 cm/s** & **Speed 15 cm/s** \\ \hline Cycle 1 & 61.20 & 62.80 & 45.10 & 46.10 \\ Cycle 2 & 61.60 & 61.20 & 45.80 & 45.80 \\ Cycle 3 & 61.00 & 61.10 & 46.30 & 46.60 \\ Cycle 4 & 64.30 & 62.00 & 48.80 & 44.80 \\ Cycle 5 & 62.70 & 63.10 & 46.90 & 45.60 \\ Cycle 6 & 61.90 & 61 Figure 6 illustrates the development of the simulation model for this project, in which the codes \"MethodCycles\" and \"MethodTimes\" process variables received from the real system via the OPC tool. This data is utilized to calculate the number of cycles the system must execute and the time available to complete the part deliveries. These values are then applied to the equation developed in \"MethodSpeedControl,\" which determines the optimal operating speed for the real system. Code A: Method Speed Control. This method consists of multiplying the number of remaining cycles by the perimeter (670 cm) and dividing by the remaining time, thus determining the ideal working speed. SpeedControl:= speed;  
Is  
Do  
Code B: Method Cycles. This method consists of subtracting the number of scheduled parts from the number of parts already transported and dividing by the number of parts per cycle, thus determining the number of remaining cycles. Cycles:= integer;  
Is  
Do  
Cycles:= Programmed_Quantity - Drain.StatNumOut/4;  
End;  
Code C: Methode Time. This method consists of subtracting the planned work time from the time spent, thus determining the remaining time. Times:= time;  
Is  
Do  
Times:= TimeToDo - EventController.SimTime;  
End;  
To validate the operation of this prototype, three tests were conducted, each defined by the following initial requirements:  
Test 1--Transport 40 parts within 550 s.  
Test 2--Transport 40 parts within 600 s.  
Figure 6: Codes to receive the data and apply the optimization. Test 3--Transport 24 parts within 300 s.  
The initial transport cycle durations are set at 55 s, 60 s, and 50 s, respectively. Correspondingly, the initial conveyor speeds are 11 cm/s, 10.5 cm/s, and 13 cm/s. A physical constraint limits the system to transporting a maximum of four parts per cycle; however, instances where fewer than four parts are moved may occur. Additionally, variations in cycle duration can arise due to stochastic failures occurring at specific part-handling stations. Both scenarios are classified as failures. Tables 2-4 present the data collected during Tests 1, 2, and 3, respectively. The \"Total Parts\" columns indicate the cumulative number of parts transported per cycle, as well as the individual count of parts moved in each cycle. These values are incorporated into the simulation model based on data retrieved from count sensors. The \"Cycle Time\" columns display the recorded cycle durations, obtained from position sensors installed along the conveyor track. These measures facilitate the calculation of total operational time and the remaining time available to fulfill production requirements.