This blog article outlines the co-simulation between IPG CarMaker and Typhoon HIL, detailing how the fusion of high-frequency real-time simulations on Typhoon HIL and precise vehicle dynamics simulations in CarMaker introduces new functionalities. The co-simulation model, including a detailed battery and BMS model, is utilized for Fault Injection Testing according to ISO 26262 standards for functional safety.
Introduction | The Origins of the IPG-Typhoon HIL Co-Simulation
As part of Julian Riedel's thesis at HTW Saar, a co-simulation was developed between Typhoon HIL and IPG CarMaker. In this context, the Typhoon HIL HIL604 real-time simulator was connected to IPG CarMaker via CAN communication, and an all-wheel-drive simulation model of an electric vehicle was created. This simulation model was further developed in another thesis at Ravensburg-Weingarten University (RWU). A detailed battery model and a Battery Management System (BMS) were integrated into the drivetrain model on the HIL. Additionally, various methods for introducing faults into the system were integrated, and Fault Injection Testing (FIT) was carried out. The co-simulation between IPG CarMaker and Typhoon HIL allows for observing the real-time response of the electrical components simulated on Typhoon HIL and analyzing the vehicle's dynamic response on the road. Furthermore, it enables the validation of vehicle dynamics, routes, and environmental influences, providing a precise analysis of the effects of drivetrain faults on vehicle behavior.
Solution | The Co-Simulation Setup
To implement the co-simulation, in addition to the HIL604 hardware device and accompanying Typhoon HIL Control Center toolchain, the CarMaker software from IPG Automotive is employed, running on a host computer. Communication between the two components is realized via CAN. The setup is shown in Figure 1 below.
Figure 1. Setup of the Co-Simulation at Ravensburg-Weingarten University.
The vehicle model represents a battery-electric vehicle (BEV) with all-wheel drive, powered by two asynchronous motors, one per axle. The model vehicle is based on a Tesla Model X 100D. All drivetrain components, such as electric motors, inverters, controllers, battery, and battery management system, are simulated on the Typhoon HIL system. The road, the chassis, the driver, the resulting driving resistances, and the vehicle dynamics are simulated in the CarMaker simulation environment. By combining these simulation models, a comprehensive vehicle simulation at the system level is created, introducing new possibilities for testing.
In Figure 2, an overview of the drivetrain model simulated on the Typhoon HIL HIL604 is shown. The model is based on the electric vehicle example model developed in the initial thesis at HTW Saar and has been expanded with a detailed battery and Battery Management System (BMS) model at Ravensburg-Weingarten University. The 3-phase inverters and asynchronous motors are models sourced from the Typhoon HIL Library. In addition to the components shown in Figure 2, the field-oriented control, a CAN transceiver and receiver, are also represented on the HIL device.
Figure 2. Drivetrain model running on the Typhoon HIL including detailed battery and BMS model.
The battery model represents a 400V lithium-ion battery with a capacity of 103.55 kWh, utilizing the Typhoon HIL Battery Cell Model. The battery is composed of two strings, each consisting of 3 battery modules. Each module comprises 32 cells in series and 9 cells in parallel. Additionally, the capability to modify an individual cell is integrated into two modules. This feature is integrated to have the possibility to introduce faults into the battery later, testing the response of the Battery Management System (BMS) and the vehicle in CarMaker.
The Battery Management System monitors and controls the battery, constantly monitors the current, voltage, and temperature of each cell. This ensures protection against deep discharge, overcharging, overheating, and short circuits. Moreover, the BMS takes control during vehicle startup, pre-charging the DC-link capacitor, and subsequently closing the main contactor.
As mentioned earlier, the vehicle dynamics, driving route, and driver are simulated in IPG CarMaker. CarMaker is a simulation software that facilitates the representation of virtual driving scenarios, including the simulation of the physics of a real vehicle and its environment. Furthermore, it allows the execution of virtual driving tests to assess the dynamic behavior of a vehicle in various situations. The IPG Movie function enables the visualization of the vehicle's behavior on the road. Figure 3 shows the test vehicle during a test drive on a synthetic road in IPG Movie.
Figure 3. Vehicle running in IPG Movie.
To implement the co-simulation, an electric powertrain with two electric machines was utilized in CarMaker, and a corresponding substitute model was created. Since the electric powertrain is simulated on the Hardware-in-the-Loop (HIL) system, this substitute model includes communication with the real-time simulator, transmitting the current motor speed and load request to the HIL. The torque of each motor is then calculated on the HIL and sent back to CarMaker via CAN. Additionally, CarMaker defines all data related to the vehicle body, such as frontal area, vehicle weight, drag coefficient, and tire type.
The co-simulation combines the advantages of both systems. The drivetrain model on the Typhoon HIL enables a high-fidelity real-time simulation of the electrical components. CarMaker precisely simulates the driver, environment, and vehicle dynamics, displaying them in IPG Movie NX.
In the context of the thesis at Ravensburg-Weingarten University, Fault Injection Testing was conducted using co-simulation and its advantages. According to ISO 26262 for safety-related electrical/electronic systems in road vehicles, it is crucial to understand and evaluate the system's response to critical errors. Therefore, three different faults were deliberately introduced into the vehicle model to assess the reaction of the System to the faults. The responses of the electrical components of the drivetrain and the dynamic responses of the vehicle under various driving conditions were tested and analyzed. Using HIL SCADA, the embedded faults can be activated or deactivated and monitored by one click. For example, the temperature of a cell in the battery can be altered, and the response of the Battery Management System (BMS) to this temperature change can be tested. The detailed fault scenarios and analyses can be found in the referenced paper.
Thus, it is demonstrated that the co-simulation between Typhoon HIL and IPG CarMaker, combined with Fault Injection Testing, contributes to Functional Safety according to ISO 26262. This method not only opens up new possibilities for the assessment and optimization of the electric drivetrain, it also enables real-time testing, evaluation, and visualization of various test compositions and edge cases, creating new opportunities in vehicle development and validation.
Are you exploring adopting HIL in your work?
- Riedel, J., “Aufbau und Implementierung einer echtzeitfähigen SiL Co-Simulation eines batterieelektrischen Fahrzeugmodells” Master Thesis HTW Saar, 2022.
- Konzept, A., “HIL based Real-Time Co-Simulation for BEV Fault Injection Testing”, SAE Technical Paper 2023-24-0181, 2023, https://doi.org/10.4271/2023-24-0181
Text | Anja Konzept
Visuals | Anja Konzept, Karl Mickei
Blog Editor | Debora Santo