# Hardware-in-Loop Modules for Testing Automated Ventilator Controllers
## 1 Introduction  
Automated controllers have been developed for various tasks in a variety of different industries. Automation has been used in agriculture, the automotive industry, as well as the medical field [1, 2, 3]. Automation in medicine has the potential to streamline medical procedures, reduce the cognitive burden on medical providers, lower the skill threshold for challenging procedures, and improve patient outcomes, and has been implemented in extracorporeal circulatory support systems [4], resuscitation during hemorrhagic shock [5], and assisted ventilation in intensive care units [6]. Fully automated mechanical ventilation has been an increasingly researched topic due to the COVID-19 pandemic, resulting in studies on controllers being developed [7] and further integrated with patient monitoring [8]. Even with this increased research on mechanical ventilation, respiratory failure occurrences following trauma-induced shockoccur, even as other parameters, such as hemodynamics, may have appeared satisfactory to medical providers [9]. Failure to manage appropriate ventilation during respiratory failure can rapidly become fatal, serving as a significant contributor to potentially preventable mortality in trauma emergencies [10]. To increase the survival of patients requiring ventilation, automated ventilator controllers need to be able to manage the delivery of oxygen (O\({}_{2}\)), normalize alveolar ventilation in the lungs, increase lung volume, reduce the work required for breathing, and aid in carbon dioxide (CO\({}_{2}\)) removal, ensuring appropriate oxygenation and the removal of waste from the system [11]. Automated ventilation controllers, in addition to managing various aspects of patient respiration, will also need to include safeguards for the prevention of ventilator-induced lung injuries, which can be caused by both the over- and under-inflation of the lungs. This highlights the need for automated controllers to include precise ventilator strategies that minimize extending the lungs into the ranges where injury can occur, unless absolutely necessary for patient survival [12; 13]. Designing controllers to manipulate physiological parameters is difficult due to the complexity of biological systems [14]. This difficulty greatly increases with traumatic injury where the body's natural \"control\" systems are rapidly changing and interacting with each other to mitigate the effects of trauma and increase the likelihood of survival [15; 16]. The design of human physiological controllers often relies on data from animal studies [17; 18], such as those performed on swine. While swine are a recognized model for certain human physiology due to their similarities [19], there remain differences compared to humans that must be fully addressed in clinical trials prior to regulatory approval [20]. Large amounts of data from animal studies are usually required for designing and debugging physiological controllers, with additional large animal studies needed to field test the controllers post-designing and debugging. This iterative process is costly as large animals require housing at an accredited research facility that must provide a highly regulated regimen of care, following strict standards for appropriate nonurishment, general well-being, and veterinary services. This cost is compounded by the often-large number of animals required to statistically power these studies and the substantial time and personnel commitments required to complete studies. To mitigate the downsides of extensive animal testing, hardware-in-loop (HIL) bench-tops have been used for more streamlined testing. HIL testing enables the more robust evaluation of how controllers will perform when real-world equipment is in use--a feature lacking with strictly in silico models. With the rapidly accelerating advancement of computational capabilities that enable the use of larger and more sophisticated machine learning models, in silico ventilation patient simulators have been growing ever more robust.