# Safe and Policy Oriented Secure Android-Based Industrial Embedded Control System
## 4 Experiment and Evaluation
### Real-time Performance  
An important metric to evaluate the real-time performance of the system is the periodicity and response times of the RT task. Conducting the same experiment in the previous section, the periodicity and response times of the RT task were measured following the detailed evaluation procedures presented in our previous works [25; 36]. The periodicity and response time of an RT task determines whether the task is schedulable or not. The response time is defined as the duration from the start of the task until all the required jobs are done. The jitter is defined as the difference between the configured task period, in this case 1 ms, and the actual measured value. In hard real-time applications that are safety-critical, such as industrial control, all the tasks should be schedulable and deterministic to avoid unwanted accidents and ensure safety. During the experiment, the system is kept isolated from the data acquisition and processing systems to avoid unwanted data perturbation (noises and interrupts), which could affect the validity of the results. The timing data were measured and stored in a buffer for offline processing/analysis. The samples were captured when the system was in steady-state,discarding the EtherCAT master-slave configuration and synchronization stage. We focus all the measurements of the real-time EtherCAT control task. The results of the timing analysis are shown in Table 2 with the statistical average (avg), maximum (max), minimum (min), and standard deviation (\(\sigma\)) values of each timing metric. The results show that the RT task was able to run periodically with an average of 1 ms. The response time also shows an average of approximately 91 us, which is the overall time duration of receiving the target velocity from the Android application, generating the instantaneous velocity command, and the EtherCAT communication processes. Due to the unavailability of a real-time device driver for the JECS-600 ITX, we have selected the generic EtherCAT driver that uses standard Linux system calls. This results in the maximum response time exceeding the required period (1073 us), which is vital in a multi-tasking environment. However, according to a presentation in ROSCON 2019 entitled Safety in Time [37], guaranteeing deadlines is typically impossible in most modern systems, and they should be given as probabilities. In this sense, the three-sigma probabilistic limit of the jitter is considered exceptional with approximately 4 us. Depending on the real-time application, developers can improve the response time by attaching an external network interface card with the necessary real-time driver [25; 36], or by developing a real-time device driver for the on-board Ethernet controller, which is outside the scope of this paper. Considering the average response times, we can determine that the average CPU utilization of the EtherCAT control task is 0.09. According to the schedulability analysis \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Task** & \multicolumn{3}{c}{**EtherCAT Control (99, 1 ms)**} \\ \hline
**Metric** & **Period (ms)** & **Response (us)** & **Jitter (us)** \\ \hline avg. & 1.000000 & 91.017 & 0.968 \\ max. & 1.157667 & 1073.000 & 159.000 \\ min. & 0.841000 & 75.333 & 0.000 \\ \(\sigma\) & 0.001645 & 9.944 & 1.330 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Real-time performance of the JECS-600 ITX for an EtherCAT control task. Figure 8: Comparison between the reference velocity and the encoder feedback: Span of (**a**) 60 s; (**b**) initial 5 s.  
presented in our previous work [31] and the utilization bound test, RT tasks are schedulable if the overall CPU utilization is less than the Liu and Leyland bound, which is 1 for a singular task. Thus, the EtherCAT control task is schedulable. This also means that the developed Android-based ICS can provide a viable method of integrating Android applications with RT tasks with hard real-time requirements such as EtherCAT control.