## 6 Hardware-in-the-Loop (HiL) Testbed Structure and Specifications  
The testbed components are actuated based on decisions made by the optimized EMS control besides the EVT local control units while considering the emulated torque and speed corresponding to the input driving profile. To this end, C codes generated from the optimized EMS blocks are uploaded to the control unit of the lab testbed for separated cases. The local control of the EVT machine worked based on the previously discussed set of currents applied to the machine. These currents are controlled using two inverters, and a current regulated dc-power supply. The sensing, measuring, and the control units send/receive the dataset and corresponding commands to/from mechanical and electronical components and their linkages are illustrated in Figure 12.  
Figure 13 presents a panorama of the laboratory experimental setup used for the real-time implementation. The EVT machine with 120 kW rated power was placed in the middle and coupled to two 30 kW induction motors located at the left (connected to inner rotor) and right (connected to outer rotor) sides. The two electrical ports at the inner rotor and stator were connected to two water cooled 150 kW and 100 kW inverters, respectively.  
In the prepared testbed, the left induction motor was controlled to represent an ICE and was connected to the inner rotor of the EVT. Compared to conventional setups, replacing an induction motor for a real engine in the testbed produced the following advantages:  
Figure 11: Study procedure of hardware-in-the-loop (HiL) vs. model-in-the-loop (MiL) verification.  
Figure 12: Schematic of the experimental setup [61].  
* A real engine produces tail gas during the test and causes pollution in contrast to an induction machine.
* To test a different design, an engine must be replaced with another specific one, whereas using the induction machine can provide more flexibility in terms of scaling.
* Operating an engine in the test environment comes with lower safety and higher operating costs when compared to an induction motor.  
On the right-hand, a second induction motor was connected to the outer rotor to emulate the road profile input based on the NEDC. The battery was replaced by a 40-kW dc power supply in the test bench. Torque sensors (with a maximum measurable torque of 100 Nm) and encoders were used to measure the torque and rotational speed of the inner and outer rotors, respectively, and the electrical power flows were measured by using a power analyzer. It is noteworthy that the measuring limitation of the setup's torque sensors (T \(<\) 100 N), maximum speed limitation of the inner rotor (\(\Omega r1<4300\) rpm), maximum speed limitation of the outer rotor (\(\Omega r2<4300\) rpm), and a setup safety shutdown limitation, related to the difference between the inner and outer rotor speeds (\(|\Omega r1-\Omega r2|<4000\)), were already considered in the optimized blocks uploaded to the control units. The dSPACE MicroLabBox was used with a fixed time step of TS = 0.0001 s for the components' local control and TS = 1 for the EMS to ensure adequate data resolution. Table 4 represents the specifications of the setup parameters in more detail, and Figure 14 plots the demand power of the cycle considered for the examinations.  
Figure 14: Demand load considered for the examinations.  
Figure 13: Experimental test bench of the study.