## 3 Results and Discussion
### Hybrid Hardware-in-the-Loop Test-Bench  
Once the model introduced in Section 2.2 was validated under different conditions, the experimental setup described in Section 2.1 was \"connected\" with its real-time simulation to conform the whole proposed hybrid hardware-in-the-loop test bench. Figure 10 illustrates the main elements used in the HIL test bench, with a clear distinction between the hardware and software components. It also displays the data exchanged between the coach cabin model, the heating systems and the control system. A Simulink model was created (see Figure 11), including the coach cabin's thermal model, an OPC UA block to connect with the heating system hardware of the driver's zone (i.e., it represents the built experimental plant within the Simulink block diagram) and the PID controllers required to implement the same control system found in a real coach, \"Simulink Desktop Real-Time\", \"Industrial Communication\" and \"Control System\" toolboxes were used for real-time simulation and OPC communications, respectively. Such a Simulink model only implements the cascaded control structure for the driver's zone in detail, while that of the passengers' zone is represented with a single PID because only the HVAC unit of the driver's zone was available in the laboratory, as described in Section 2.1. The digital PID controller blocks were designed by the authors and their typical capabilities were implemented, including an anti-windup mechanism and a derivative filter, among others. Such blocks are implemented using code embedded in MATLAB functions for two reasons: Code is easier to translate to C++, the language in which the controllers are programmed in onboard systems, and the possibility to implement more complex algorithms in that way, such as gain scheduling integral action during the start-up sequence or in the dehumidification procedure, to cite two examples. Figure 10: Main components of the HIL test bench. The OPC UA block is configured as a client connected to the PLC, which is the OPC UA server, which interacts with the plant. This block has two main inputs: The valve opening to vary the hot water flow from the engine cooling circuit and the supply air fan speed. It has several outputs, the most important being the supply airflow rate and the supply air temperature, which are provided to the corresponding inputs of the cabin thermal model block (driver's zone). Other outputs not fed to the coach cabin model are configured in the OPC UA block for logging and analysis purposes. Under this consideration, the cooling valve position, flow rate and input/output temperatures of the water through the heat exchanger, etc., are included. Replications of actual tests from Table 4 were carried out to validate the proposed hybrid system and verify its usefulness as a test bench. In this context, the mean of experimental outside temperatures was considered and the temperature of the water coming from the engine cooling circuit was replicated, including the start-up time span, setting suitable setpoints on the boiler and mixing with cold water at predefined time instants. Initial conditions (such as initial temperatures of both coach cabin model zones) were also taken from experimental data, as well as fan speeds and temperature setpoints for driver and passenger zones. Figures 12-14 show the results obtained comparing the actual experimental coach cabin temperatures with those from the test bench. Figure 11: Simulink model implementation for the hybrid test bench. Figure 12: Comparison between \(T_{i1}\) and \(T_{i2}\) from hybrid test bench and actual experimental coach data (Experiment 1). As can be seen from the above figures, there is a close similarity between the temperature transient time responses and steady states in both zones from the hybrid test bench and the actual experimental coach data. Table 6 shows the MAEs and maximum errors.