## 5 Case Study: COTS-based Embedded Real-Time Control of a Time Mash Delivery Machine
### The COTS-Based Controller
#### 5.2.2 COTS-Based Control Software
As an outcome of this case study, a summary of such notable architectural features of COTS-based systems versus specialized or custom-built, and their qualitative metrics, is provided in Table 2.

Furthermore, the choice of open-source and general-purpose components, both in respect to COTS hardware (e.g., RPi3) and software (e.g., use of open-source Linux OS patched with PREEMPT_RT, and standard C and Python programming), broadens the capabilities of the control system. In this direction, a future objective is to substitute the expensive flowmeter with a simpler low-cost general-purpose fluid meter. ## 7 Conclusions

This paper presents an open architectural framework and infrastructure for reliable and low-cost real-time control systems and applications, based primarily on standardized/general-purpose (COTS) hardware/software architectural components, and its implementation. The system infrastructure of this architectural framework enables the integration and communication of hardware/software components \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature** & **Specialized System** & **COTS-Based System** \\ \hline Flexibility & Specific functionality, low adaptability to change & Ease of modifications or upgrades of commercial HW/SW components \\ Redundancy & Highly fault-tolerant architectures, low & Relevant critical components and functions are built-in \\ Integrity & Specific interconnections with other components & Ease of integration with other COTS components \\ Reliability & Often highly assured & Additional requirements needed to assure reliability \\ Reusability & Low versatility, specific low-level assembly code & Software and high-level code reusability \\ Time & Higher development time & Lower development time \\ Cost & Considerable variable costs & Lower development cost and system life cycle cost \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Architectural features of COTS-based systems versus specialized or custom-built. in real-time, making applications work together as one integrated system, as demonstrated with a case study in manufacturing. The applicability and validity of the proposed framework are tested with the implementation of a COTS-based control system, which utilizes a Raspberry Pi3 Model B microcontroller board running a Linux-based distribution (UBUNTU 18.04.2 LTS) patched with PREEMPT_RT for real-time processing. The system control software developed in C performs all the processing, communication, and control operations of a specific lime mash/slurry storage and delivery machine used in the case study experimentations. Software applications written in C and Python were developed for operation and performance testing purposes. The validity of the proposed system was evaluated through extensive experiments on the actual machine. The experimental results of the architectural working prototype provide evidence that the system performs correctly. Some of the key features of the implemented COTS-based control system can be summarized in the following:

* Open-source, low-cost, low-power, COTS-based control architecture, easily reprogrammed and reconfigured for integration with other automation systems (e.g., electromagnetic flowmeter). * Linux-based supportive software with real-time capabilities due to the real-time patch PREEMPT_RT in UBUNTU, capable of supporting future advanced timing control requirements (e.g., actual flowrate measurements). * Real-time control software, based on multithreaded modules in C, ensure reliable operation of the machine controller and provide reconfiguration flexibility of the embedded device. The proposed architectural framework and control system infrastructure could be used for a variety of control purposes and needs in manufacturing, as well as for experimental research in control of other control devices and machinery.