1. Introduction
Today’s software-driven automotive systems are considered heterogeneous and complex, and have a high degree of functional interdependencies [
1]. The emergence of intelligent assistance functions, such as Advanced Driver Assistance Systems (ADASs) [
2], has increased the complexity of the system architecture. In a modern vehicle, the system architecture includes up to 120 ECUs communicating over more than five system buses and exchanging 2 million messages per minute [
3,
4]. Testing such complex systems against functional and non-functional requirements is therefore a challenge in the industry. In addition, automotive safety systems in particular must be rigorously verified and validated according to the functional safety standard ISO 26262 [
5]. In the development cycle of ISO 26262, different test levels are defined, i.e., unit test, integration test and system test [
6]. It also provides requirements and recommendations for the development process to ensure the functional safety of the developed systems.
At the vehicle integration and testing level, open-road tests, i.e., real-world test drives, are conducted to detect unexpected faults that have not been detected in the design phases. In such a test approach, a real vehicle prototype is used by manufacturers to validate the integration of vehicle subsystems, including real ECUs, sensors and actuators, and their networks, on public roads [
7]. Meanwhile, data acquisition systems capture system behavior as multivariate time series data under realistic conditions. Despite the advantages of the real test drive in terms of high test coverage [
8], it suffers from several burdens:
To meet the requirements of ISO 26262, it is difficult to perform a large number of representative and relevant test kilometers [
9].
The higher the coverage of critical test situations, the higher the probability of a risk to the test driver during the tests [
10].
Validation of the system under fault conditions using fault injection methods is not feasible [
11].
The ability to reproduce an accurate test experiment is a challenge due to the high cost per test mile, time and uncontrolled environment [
12].
Finally, manual analysis of the huge amount of data recorded during road tests based on expert knowledge is costly, time consuming and labor intensive [
13,
14].
Therefore, a safe, reliable and flexible test framework is required to accelerate the test process, reduce the time and effort, and cover the critical scenarios. Recently, virtual methods have contributed to improve the V-cycle development in the automotive industry in terms of verification and validation [
15]. To overcome the limitations of real test drives, various virtual testing and validation methods, known as “X-in-the-loop” testing, have been introduced [
16]. Among them, model-in-the-loop (MIL) [
17], software-in-the-loop (SIL) [
18], processor-in-the-loop (PIL) [
19], hardware-in-the-loop (HIL) [
20] and vehicle-in-the-loop (VIL) [
21] have emerged in recent years. Depending on the virtual environment, the controller in the aforementioned methods is connected to the controlled system in a closed loop [
22].
In MIL, the behavioral models of the controller and the plant are developed together at the same level according to the specifications using a simulation environment, e.g., MATLAB/ Simulink [
23]. In this way, verification and validation of the System Under Test (SUT) can be performed efficiently at an early stage of the development process. To validate the system robustness and reduce potential risks, system behavior under abnormal conditions is analyzed using model-based fault injection (FI) [
24]. Notably, according to the functional safety standard ISO 26262 [
5], abnormal conditions that can lead to the failure of an element or object are called faults. Therefore, in our study, the term abnormal conditions was used to refer to the system behavior in the presence of faults in the system components, i.e., sensors and actuators. Normal condition, on the other hand, refers to the system behavior under fault-free conditions (“golden run”).
Once the functional logic architecture test is complete, SIL is performed to validate the generated control model code against the requirements, taking into account its interaction with the controlled system model. The goal of this test method is to verify the correctness of the production code in a virtual environment, focusing on the specifications of each component. This allows for the unlimited validation of multiple versions of control algorithms in the system environment and the ability to perform a large number of test runs. By reducing the cost and increasing the speed of the test process, MIL and SIL are superior to other methods in terms of early validation of the developed control strategy without requiring real hardware. However, since the control model/code and the plant are executed at the same simulation level, i.e., on the host PC, the real-time constraints and physical communication modeling are not considered. In addition, the conditions of the real environment and the target machine differ from those of the simulation environment, which in turn leads to deviations in test accuracy.
On the right side of the V-model, PIL is used to validate the executable object code in the processor. The compiled control code is deployed and executed on the embedded processor connected in the loop to the plant model. Despite the benefits of real-time control validation, considering real-time constraints, controlled system execution is limited to the non-real-time method, i.e., on a host PC.
The VIL method is used in a later phase of the mode-based development approach, where a real vehicle prototype is used to achieve a high degree of realism in vehicle behavior. In general, the VIL method is used to validate the target system against functional safety requirements (FSRs), taking into account driver behavior [
25]. To avoid the risk of a real test drive on public roads, a virtual simulation environment [
26] is used in which dynamic traffic with pedestrians can be modeled and displayed in a 3D visualization. However, the more complex the preparation of the VIL method, the higher the cost and time required, especially for complex systems.
Recently, HIL simulation has been introduced as the best solution to the aforementioned method issues, i.e., the time constraints and the complexity of the real vehicle prototype. HIL is characterized by high reliability and flexibility of the test environment, as well as low cost and time. The ability to execute the generated code of the control and plant model in real time allows comprehensive system behavior to be accurately captured and simulated. Moreover, critical scenarios and failures can be investigated without compromising the safety of the test engineer. In addition to the reproduced and automated test process, real physical components, e.g., sensors, actuators and steering system, can be connected to HIL to enable reliable validation at an early stage before production. In addition, FI based on HIL simulation paved the way for efficient system-level validation of functional safety in critical edge cases according to the ISO 26262 standard [
27].
The current state-of-the-art test methods do not ensure real-time conditions with HIL simulation. The reason is that the FI method is implemented by extending the system architecture with an additional simulation block to model the fault mode. However, the execution tasks of the added block require additional time, which in turn leads to a violation of real-time constraints during system execution on HIL. Moreover, in the case of complex systems, achieving a high coverage of fault modeling in different system components is not feasible. The shortcomings of the current simulation methods can be listed as follows:
Ignoring real-time requirements and being unable to replicate the interaction of physical hardware in the case of a pure non-real-time simulation, i.e., MIL and SIL.
Inability to efficiently troubleshoot network-related issues as in the case of PIL without connection to real hardware components.
The high modeling effort with the potential occurrence of real-time violations when the system is validated under fault conditions using HIL simulation.
Safety risks, high costs and the complexity of integrating real vehicle components in VIL tests.
To overcome the aforementioned drawbacks, a novel real-time test framework based on HIL simulation and fault injection is proposed in this study. Unlike the traditional validation methods, the proposed approach allows FI to be performed programmatically in real time via the CAN bus interface, keeping the structure of the system as a black box unchanged. In addition to the high coverage of possible fault types and locations, the analysis of the system behavior in case of faults during the virtual test drive by the user is enabled. The key objective of the framework is to validate the SUT under normal and abnormal conditions of the system components considering the driver behavior. In addition, a dynamic traffic environment is modeled and visualized as a 3D visualization to achieve a high degree of realism. To demonstrate the advantages and capabilities of the proposed framework, a high-fidelity entire vehicle model, including a complex gasoline engine model with vehicle dynamics and drivetrain, is used as a case study. It is essential to mention that the proposed framework is also applicable to other vehicle systems/subsystems, e.g., from internal combustion engines to electric or hybrid vehicles, as the development and validation process is unique. Since the FI process takes place at the CAN bus interface, only the configurations of the FI attributes should be specified to analyze the fault effects on other systems. To the best of our knowledge, this is the first time that such a problem has been investigated. Furthermore, no specific studies have been conducted to date that address this issue considering different road and environmental conditions during virtual test drives.
The contributions of this study can be summarized as follows:
Design and implementation of a virtual test framework for performing real-time validation activities at the system integration and testing phase of the V-model development process.
Development of a novel driving simulator capable of analyzing the system behavior in real time for safety validation purposes in case of fault occurrence, i.e., sensor/ actuator-related faults.
High degree of coverage of the system components as the location of fault injection, including several subsystems in the vehicle system.
Since the HIL operates as a black-box test, different types of faults can be injected programmatically and automatically, individually or simultaneously, without changing the original system model.
Development of a driving environment with 3D visualization, taking into account the effect of dynamic traffic, dynamic objects and weather conditions on system behavior.
The body of the article is organized as follows.
Section 2 provides an overview of related work, highlighting the main contributions of the proposed work in comparison to other research.
Section 3 contains a description of the proposed method with emphasis on the main structural phases.
Section 4 presents the hardware and software architecture of the proposed framework, including the development phases. The experimental and evaluation results are discussed in
Section 5. Finally,
Section 6 presents the conclusions and future work.
2. Related Work
Recently, virtual testing has attracted the attention of researchers in various fields to overcome the shortcomings of real test drives in terms of safety, cost and effort [
28,
29]. The scope of this approach is not limited to the validation of the developed control strategy [
10,
30], but also extends to the development of human–machine interfaces [
31]. In addition, quality assurance aspects of the developed overall system, e.g., ADAS, can be effectively ensured while maintaining low cost and complexity [
32,
33].
Various methods have been employed to implement the virtual driving system, based on pure simulation tools, real prototypes or real-time simulation systems. For example, Saraoğlu et al. [
34] have investigated the flexibility of the model-based development approach to propose a simulation framework for analyzing the safety characteristics of autonomous vehicle functions. In this work, considering the traffic model and driving scenarios, the FI method was used to validate the functional safety requirements of the target system. Furthermore, the fault propagation between the system components has been analyzed in the Simulink environment. Despite the demonstrated applicability of the proposed framework for systematic safety evaluation, the method is limited to non-real-time executions. Furthermore, manual driving is not considered in the simulation framework, which does not capture the driver’s behavior. In the same context, a validation methodology for decision and control strategies has been developed in [
35] with a focus on automated driving ECUs. Based on the Dynacar simulation tool, the results show a high degree of modularity and adaptability not only in the controller selection, but also in the scenario and vehicle type configurations. A 3D visualization of the driving environment was also modeled, taking into account the route with different roundabouts and intersections. Similarly, to enable the validation process in real time, Sievers et al. [
36] proposed a unified toolchain for autonomous vehicle testing. The advantages of the proposed tools were demonstrated in the validation of sensor-based ECUs at different test levels, i.e., SIL and HIL. Camera raw data injection has been used as an example setup to demonstrate the applicability of the proposed tool. However, the proposed work is limited to the validation process under normal behavior. In our study, on the other hand, the safety and reliability of the SUT has been evaluated in the case of fault occurrence considering hazardous situations.
To overcome the limitations of simulation-based non-real-time testing in evaluating the SUT under real operating conditions, various research works have been conducted to improve the VIL simulator. By doing so, the integration of real components with the SUT can be effectively validated considering the real driving and virtual environment for various automotive applications [
37]. As an example, Park et al. proposed a modular VIL topology for the validation of ADAS applications in [
38]. In addition to the 3D virtual environment and sensor emulation, a real vehicle was used to test the real-time stability of the ADAS. The results highlight the advantages of the proposed topology in terms of maintenance time and cost savings, as well as the high degree of driving realism. In this context, in [
39], a novel adaptive cruise control (ACC) system with a fuzzy-based controller has been developed and validated considering various weather conditions and road tire friction. The core concept of the proposed study is to generate a dynamic reference signal so that the safe relative distance and speed of the vehicle can be adjusted, resulting in high safety and comfort performance. Although the validation results in various driving maneuvers show the effectiveness of the proposed approach, the validation of the target system in the presence of faults in the system components has not been explored. To exploit the advantages of real road-based testing and pure simulation-based testing, Solmaz et al. in [
40] proposed a testing methodology called Hybrid Testing for ADAS. Compared to the conventional ADAS testing approaches, the study presents the advantages of the proposed methodology in which the virtual environment with simulated vehicle components is combined with the real vehicle prototype. The architecture and structure of the co-simulation framework have been described and demonstrated using the use case of a lane change maneuver. Notably, in the aforementioned study, the ADAS functions, namely the trajectory planning algorithm, were considered as a single SUT and executed in the MicroAutoBox. However, the safety level for the operator in the case of failure is rather low in the mentioned studies. Moreover, the performance of the target system cannot be evaluated under faulty conditions of the components. In contrast, in our research, the reliability and safety characteristics of the SUT can be efficiently evaluated in real time, taking into account the abnormal environmental conditions and the failures of the system components.
As a result, there is a high demand for a test approach that can bridge the gap between real-world test drive, SIL and VIL in terms of cost, safety, reliability, repeatability and flexibility. To meet the above requirements, real-time HIL simulation has been proposed as the best solution. HIL simulation has achieved remarkable success in various applications [
41]. Specifically, for the development of real-time driving simulators, several attempts have been proposed in the last decade [
42,
43,
44]. For example, in [
45], a signal HIL simulation platform focusing on electric vehicles was proposed to provide effective and accurate real-time validation of motion controllers. In this experimental platform, in addition to the possibility of manual driving, comprehensive characteristics of the target system were considered by modeling the vehicle dynamics in longitudinal, lateral and yaw directions. Furthermore, three driving scenarios were used to demonstrate the effectiveness of the proposed study, i.e., on a normal road, on a poor adhesion surface and on a slippery surface. However, unlike our study, the proposed platform does not take into account abnormal environmental conditions or failures due to faulty system components. Achieving the same goal, but for a different application, Chen et al. proposed a HIL simulation-based test platform in [
46]. The focus of the proposed study is the validation of real ECUs for autonomous vehicle development. According to the proposed architecture, the platform consists of three layers, system modeling, multi-sensor simulation and virtual test environment layers. Similar to our work, the real ECU is connected to the simulated system via the CAN bus in a closed loop, considering the interaction of multiple agents and modeling scenarios as 3D visualization. However, in our work, in addition to the self-driving mode, manual driving was also enabled to consider the user’s behavior. Regarding the problem of validation of safety-related systems, i.e., the ABS and ESC systems, Tumasov et al. in [
47] proposed a HIL test bench that enables virtual test driving. The proposed work is characterized by the connection of a real vehicle element, i.e., a hydraulic cylinder of the braking system, along with the real ECU and the dynamic model. The effectiveness of the proposed platform is validated by comparing the results of virtual and field tests of the same maneuver, taking into account the stability control requirements. However, significant damage to the system can occur if a failure occurs in the physical components. In contrast, in our proposed work, the physical components are simulated and implemented with a high fidelity simulation to accurately analyze the effects of faulty components in real time. Finally, the applicability of the HIL system to develop an integrated driving simulator (IDHIL) for the evaluation of cooperative eco-driving systems has been demonstrated in [
48]. The HIL simulator, the network simulator and the driving simulator are the key components of the proposed work, in which ASM, MicroAutoBox and dSPACE tools were used. In addition, two use cases were used to demonstrate the effectiveness of the simulator, i.e., normal hybrid electric vehicles (HEVs) during simulation and connected hybrid electric vehicles (CHEVs) during eco-speed. However, the environment was limited to the predefined normal conditions of the dSPCAE tool, i.e., defined scenarios in ModelDesk, whereas in our work a generic environment was modeled, covering abnormal conditions and critical scenarios. Another difference lies in the applicability of our proposed framework to simulate component faults, e.g., sensors and actuators faults, to validate the response of the SUT in case of a failure. An overview of related work is given in
Table 1.
In summary, the development of a generic validation framework that meets the requirements of flexibility, cost, coverage, repeatability and reliability has not been sufficiently explored. A review of existing work shows that most of the proposed work is limited to adapting test methods for specific goals during evaluation, without considering the fault conditions affecting SUTs. In addition, implementing the FI approach involves modifying the system architecture with additional blocks to model the faults that cause the real-time constraints to be violated.
Therefore, one of the main challenges facing the development of the virtual test approach is to simulate the system behavior under faults during the virtual real-time test drive while ensuring the structure of the SUT as a black box for real-time constraints. This challenge motivates us to investigate how to develop a real-time validation framework that meets these requirements and enables the safety and reliability analysis of the SUT under single and concurrent faults considering different environmental conditions. To this end, real-time HIL simulations, a high-fidelity full vehicle model, a virtual driving environment with high coverage of abnormal conditions, manual and self-driving, and real-time FI were used.
3. Methodology
This section presents the proposed methodology, highlighting the core hardware and software components and the communication between them.
In the automotive domain, the development process of safety-critical systems should comply with the relevant standard for functional safety, i.e., ISO 26262. In the proposed study, several aspects of testing in accordance with ISO 26262 have been taken into account. These include specifying test strategies, assessing the qualification of the test environment and verifying the suitability of the entire tool chain. The test process in the proposed approach follows a specified test strategy, that includes the definition of the test focus, the test object, the test level, the test method and the test environment. Since both HIL simulation and FI are explicitly recommended by ISO 26262 for the development process, they have been considered in the proposed approach. In addition, a software tool chain fully certified by TÜV SÜD, i.e., dSPACE tools, was used for the development process in the proposed approach.
The architecture of the proposed framework consists of three different layers, namely the hardware component layer, the data analysis and FI layer, and the system model layer with environment visualization.
Figure 1 illustrates the layers of the proposed framework architecture.
At the hardware component layer, the HIL simulation system is used to realize the simulation in real time, where the HIL simulator is directly connected to the real ECU. In this study, the control strategy is deployed and executed in the MicroAutoBox II, which acts as the real ECU, while the controlled system, representing the entire vehicle model, is executed in the HIL simulator. On the other hand, driving elements such as steering wheel, gearshift and pedals (accelerator, clutch and brake pedals) are employed to enable manual driving by the user. Remarkably, the driving system in the proposed approach supports both manual and automatic gears for manual driving. For real-time experiment setup and control, dSPCAE software tools are used on the host PC. MotionDesk, ModelDesk, ControlDesk and the FI GUI are used by the test engineer for parameterization, configuration, instrumentation, experiment execution, measurements and analysis. Thanks to the advantageous model-based design approach, the code is automatically generated from the models and implemented on the target machine via the host PC. The aforementioned hardware components of the proposed framework are interconnected via three communication protocols, namely Ethernet, CAN bus and USB. More specifically, the CAN bus is used to establish the interface signals between the controller and the controlled system, into which the disturbances are injected. On the other hand, the host PC is connected to the HIL system via Ethernet, which transfers the generated model code from the PC to the HIL elements. Finally, the driving commands of the HIL simulation controllers are transmitted to the host PC via the USB communication protocol.
To validate the robustness of the SUT and its performance under faulty conditions during execution, the real-time FI framework developed in previous work [
49] is used in the second layer. For this purpose, three different attributes are identified, i.e., fault type, target location and injection time. According to the requirements and test objectives, the fault injector provides a list of sensor and actuator faults, i.e., gain, offset, stuck-at, delay, data loss, hard over, noise, drift and spike. Detailed information about the fault types can be found in [
50]. Thanks to the CAN bus model feature, the signals from the SUT and the plant can be accessed during the real-time simulation. As a result, FI at the target component can be activated programmatically as a black-box test without changing the system model. Finally, the timing and duration of FI can be determined by the tester based on the standard system behavior, i.e., the desired drive cycle.
It is noteworthy that ISO 26262 does not define a specific location or type of faults to be injected into the target system. Instead, it mentions the potential system components that are prone to faults, including sensors, actuators and ECUs. Therefore, the selection of combinations of the faults’ attributes is derived from the FSR to be validated. Further details regarding the automated generation of fault test cases from FSR can be found in [
51]. In the event that the FSR is affected by two faulty components, two locations are selected for the injection of the list of fault types. Specifically, two types of faults are injected into two different locations simultaneously and reciprocally in each experiment. Otherwise, a single location is selected for the injection of the list of fault types in each experiment.
Mathematically, the combination of faults is determined based on Equation (
1). However, according to ISO 26262, the maximum affected points by fault are two locations. Consequently, any combination of more than two classes, e.g., three types at the same time, is disregarded.
where
represents the number of fault combinations and
d is the number of fault types.
The mathematical representation of the sensor-related faults used in the study is presented in Equation (
2) and
Table 2.
where
is faulty or manipulated signal value and
represents the gain value. The healthy or fault-free signal value is represented as
.
represents the offset/bias value.
In addition to the FI framework, data analysis and management are also performed in the second layer. This contains the input and output of the target experiments. In other words, the functional and non-functional requirements are documented and analyzed in this layer. Moreover, the specifications of the fault test cases and the functional test cases are identified, including the test data and the expected output. Notably, the test cases are designed based on the test scenario using the ModelDesk tool. After test execution, the captured system behavior is compared with the desired behavior based on the defined functional and non-functional requirements to identify the violations. In addition, an analysis of the system’s response to the faulty components is performed in order to identify weaknesses in the system design.
Finally, in the last layer, two phases are considered, namely the system modeling and the environment visualization. As mentioned before, the ASM vehicle dynamics model from dSAPCE [
52] is used as the target system from the automotive domain. The vehicle system has been modeled with high fidelity in the MATLAB/Simulink environment. However, the system model contains only the basic engine model. This limits the ability to capture and analyze detailed engine characteristics. Therefore, a complex ASM gasoline engine model was integrated into the dynamic model to address this challenge. To provide a comprehensive representation of the system behavior, other vehicle subsystems were also considered, including the electrical system, the drivetrain, the driver and the environment model. The code of all these models is generated and executed in the HIL simulator. On the other hand, the control algorithm is modeled separately and connected to the controlled system via a CAN bus model as a signal interface model. Notably, the FI framework is configured at this stage using the real-time interface CAN multimessage blockset (RTICANMM) model. Mathematically, the aerodynamic forces and moments can be represented as follows:
where
and
are the vehicle and wind speeds [m/s], respectively.
is the air density [kg/m
3]. The vehicle’s longitudinal shadow area [m
2] is represented by
, while
is the characteristic length for torque calculation [m].
represents the aerodynamic coefficients. Finally,
T is the angle of incidence [deg].
Equation (
10) represents the wheel speed
, where
,
and
represent the driving torque, effective tire torque and effective brake torque, respectively.
is the moment of inertia about the wheel axis.
The motion for the movement of the steering rod can be represented mathematically as Equation (
11):
where
,
,
and
represent the generalized force due to the front left tire forces, the generalized force due to the front right tire forces, the generalized force on the steering gear from the steering column and the generalized force due to friction in the steering rod, respectively.
is the total mass along the axis of
determined by the wheel inertia and masses.
At this stage, the driving environment is also modeled and visualized as a 3D visualization for the purpose of analyzing the effect of various environmental conditions on the system’s behavior. This is accomplished using the MotionDesk and ModelDesk tools. In addition to the normal condition, abnormal road and environmental conditions were also taken into account. For the environmental conditions, rain, snow, fog and lighting were considered. In particular, the road topology was modeled with surface irregularities to mimic the real environment to the greatest extent possible. Furthermore, the dynamic objects on the road were taken into account by modeling other vehicles and pedestrians. Finally, traffic signs and obstacles were modeled as transient events. To mimic the real-world road topology, a Google map of the target area served as the basis for the developed environment in our framework. In addition, the dimensions of the designed roads were set in the road geometry according to the standard dimensions of the real environment. Notably, the main goal of environmental modeling is to analyze the effects of environmental conditions, e.g., road and weather conditions, on the system behavior in a fault-free state and under fault conditions. The effects of FI on the system behavior during driving can be observed via 3D visualization.
5. Results and Discussion
In this section, the evaluation results of the proposed framework are presented and discussed. Focusing on three different test environments, i.e., non-urban, urban and highway, the system behavior under different internal and external conditions is analyzed. Based on the mentioned test scenarios, as an external abnormal condition, the system validation process under different environmental conditions is demonstrated. In addition, as an internal abnormal condition, the validation process of the target system under single and concurrent faults are discussed.
5.1. Validation of the Real-Time Simulation System
To verify the effectiveness of the proposed framework, the results of the real-time simulation of the HIL system were compared with the non-real-time simulation of MATLAB/Simulink (MIL). To this end, the RoadWork_Highway scenario was conducted at both test levels mentioned, i.e., MIL and HIL, with the same test specifications. The desired theoretical behavior was identified as a reference for comparing the simulation results, as shown in
Figure 8a, curve with brown color. The test scenario applied mimics a driving situation on the highway where a construction site is encountered. The vehicle speed should reach two maximum values at 15 s and 70 s with 100 and 120 (km/h), respectively. However, according to the vehicle speed reference profile, the behavior of the vehicle system changes so that the vehicle speed remains in the range [100–60] during the period [19–65] s, while passing through the work zone on the highway. In
Figure 8a, it can be clearly noticed that the system behavior with the proposed framework is closer to the decided behavior compared to the MIL results. The reason behind this fact is that the control strategy in HIL is executed accurately considering the real-time constraints. This in turn leads to a smooth change in the system state with little variation in the engine speed (rpm) compared to the MIL results (see
Figure 8b). To calculate the relative error, the discrepancy between the theoretically desired behavior and the actual real-time simulation results of the HIL was calculated.
Figure 8c shows the calculated error with low-level deviation while driving in the construction zone. The maximum relative error value is 13 at 34.8 s and the average value is 2.52. However, the absolute error value increases to 17.6 at 70 s due to the sudden change in the system speed from 60 to 120 km/h. Nevertheless, compared to the MIL results, the system performance with the HIL system is more accurate in performing the desired behavior.
As a comparison between MIL and HIL results,
Figure 8d–f show the behavior of the driving elements, i.e., the angle of the steering wheel, the position of the accelerator pedal and the position of the brake pedal. It can be observed that both simulation results show similar behavior, with the exception that the HIL system is able to show a more accurate behavior with less fluctuations, especially in the case of driving between 20 and 62 s (
Figure 8e). Similarly,
Figure 8f shows the status of the brake pedal with accurate response to the control command during the driving time. It can be concluded that using the HIL system as a platform to perform the virtual test drive has high accuracy and lower relative errors compared to non-real-time simulation methods.
To demonstrate the superiority of the proposed framework compared to other approaches, the characteristics of our approach in terms of relative error, fault injection capability and real-time constraint consideration have been summarized in
Table 5. It can be concluded that our proposed approach has a lower error rate compared to related works. Besides the real-time constraint consideration during the simulation process, the ability to analyze the system under faulty components shows its superiority and applicability compared to the related proposed studies.
5.2. System Validation under Various Roads and Weather Conditions
The consideration of abnormal road conditions in the driving environment, e.g., mountain roads with steep slopes and curves, plays an important role in the analysis of the system behavior in critical situations, especially for safety-critical systems. Therefore, in this study, the characteristics of the non-urban road between Goslar and Clausthal city have been modeled so that the unexpected faults and unobserved problems can be detected.
Figure 9 shows the vehicle system behavior during a virtual test drive performed manually by the user in the real-time for 450 s. Specifically, the recorded system variables, i.e., vehicle speed, engine speed, throttle position and engine temperature are shown in
Figure 9a–d, respectively. The above scenario was performed under fault-free conditions. As can be observed, the more curves in the road, the more the system’s dynamic behavior changes. Due to the mentioned conditions, the vehicle speed changes as a multi-mode behavior between 20 and 100 km/h without being able to maintain a steady state. Specifically, the vehicle speed decreases significantly from 100 to 40 km/h to tackle and skip turns. The corresponding engine speed, throttle position and engine temperature change frequently depending on the scenario. However, it should be noted that the more complex the system behavior, the more difficult the analysis and fault detection process.
Driving in snowy and foggy conditions is considered to be a risk not only at night but during the day as well. Therefore, the consideration of various weather situations is essential for the safety validation process. Aiming to overcome the limitations of real-world weather testing in terms of cost and safety, the proposed framework has covered the most critical situation of the testing environment. In this study, in addition to sunny weather, the developed system has been validated under rainy, foggy and snowy weather. During manual driving in the above cases, the user is unable to drive smoothly due to blurred vision. The effect of the aforementioned weather conditions on the user-based driving behavior is shown in
Figure 10. Compared to the fault-free behavior shown in
Figure 9a, the vehicle speed in
Figure 9a changes slightly between 0–50 s and 100–150 s. Similarly, the engine speed in
Figure 10a follows an uncertain pattern with dynamic nonlinear behavior.
5.3. System Validation in Occurrence of Single Faults
Unexpected faults in sensors and actuators within complex systems can potentially propagate to different components and subsystems. This phenomenon is known as fault propagation [
56]. This propagation can have a significant impact on the proper functioning of the system. For vehicle functions, especially ADAS and Autonomous Driving, failures due to fault propagation pose a violation to safety objectives and have serious consequences. To address these risks, it is essential to have simulations that reproduce the behavior of the system in the case of fault occurrence. Performing these simulations allows in-depth analysis of the nature and causes of the safety risks associated with fault propagation.
In the proposed framework, nine different types of time-series related faults [
57] have been considered. Among them, the effect of injecting the noise fault into the steering wheel angle sensor has been demonstrated in
Figure 11. The reason for selecting this sensor as the fault injection location is its critical effect on the safety-related automotive system, i.e., the steering system. The fault was introduced at 5 s, when the urban driving scenario, namely CLZ, was selected. The fault injected at the component level in the steering wheel angle sensor signal (
Figure 11a) has propagated to the subsystem level, resulting in an error in the torque signal at the power steering motor (
Figure 11b). This, in turn, has led to a failure at the interface of the vehicle dynamic subsystem. The aforementioned failure propagated and resulted in an error in the engine subsystem, i.e., in the EGR output pressure, (
Figure 11c). Compared to the fault-free behavior, i.e., green curve, in
Figure 11d, the propagated fault caused a deviation from the desired behavior in the period [5 to 60] s. By increasing the ratio of the deviation from 22 s, the system becomes unable to follow the defined scenario. Consequently, the fault propagates from the sensor to other system components, resulting in the termination of the required functionality at the system level after 28 s (
Figure 12b). However, from 40 s, since the target system is capable of performing the intended functionality, the resulting deviation is considered to be an acceptable anomaly that does not pose a serious risk. The reason behind this fact is that the SUT mitigates the injected fault during this period to achieve the desired behavior.
Thus, the analysis process can be repeated by changing one or more of the configurations of the injected faults, i.e., type, location or time. By analyzing the system behavior under fault conditions during a virtual test drive, it is possible to identify the weak points within the system and improve the safety mechanisms. This, in turn, leads to the improvement of the safety aspects of the target system. As a result, not only can potential hazards be averted, but the intended functionality of the system can be maintained, ensuring overall safety.
To illustrate the impact of the driving scenario on the FI experiment, the aforementioned FI results, i.e., with the CLZ scenario (
Figure 12a), have been compared with those of another driving scenario, namely the basic Road_work scenario (
Figure 12c). In this regard, the same FI configurations, including type, location and time, have been considered in both experiments. As illustrated in
Figure 12d, in the case that the desired system behavior is not complex, the SUT is capable of mitigating the fault and performing the required functionality. Conversely, due to the dynamic behavior required within the city (
Figure 12b), the effect of the fault is observable and poses a risk.
5.4. System Validation in Occurrence of Concurrent Faults
According to ISO 26262, not only a single fault, but also the simultaneous occurrence of two faults at different locations could violate the safety objectives. Due to the fact that two faults contribute to the resulting system-level behavior, the analysis process is considered critical and challenging during testing. The integrated FI method in the proposed approach provides the ability to inject concurrent faults into the target components in real time to analyze the safety and reliability characteristics.
Due to the fact that the occurrence of simultaneous transient faults is more critical than permanent faults, in this study, the effect of two sensor-related faults on the system behavior has been demonstrated. Specifically, gain and noise faults were simultaneously injected into the accelerator pedal sensor and RPM sensor, respectively. Both faults have been activated from 170 to 330 s as shown in
Figure 13. Once the faults have been injected, the deviation of the system behavior from the healthy behavior (green curve) can be clearly observed in a red curve. In this case, the mitigation of the concurrent faults by the SUT is considered as a complicating factor. Each fault played an individual role in shaping the erroneous system behavior. This, in turn, caused a temporary cessation in the execution of the intended functionality. Specifically, as shown in
Figure 13d, the engine is unable to provide the required torque to the drive system under fault conditions. Similarly, the engine temperature and rail pressure were also affected by the failure, as shown in
Figure 13b and
Figure 13c, respectively.
In terms of vehicle speed, the aforementioned functionality termination caused an observable change in vehicle behavior. However, the deactivation of the fault at 330 s allows the SUT to return to the safe state, resulting in the desired behavior. Thus, the critical concurrent faults with their corresponding attributes, type, location and time, can be identified in an efficient manner. However, the larger the set of the parameters, the larger the number of experiments that can be performed to achieve a high degree of test coverage. Therefore, to solve this problem, an automation tool has been integrated into the proposed framework so that the injection process is performed automatically. Thus, much of the analysis process can be carried out according to the safety requirements for validation.
6. Conclusions
A novel real-time testing framework for the validation of automotive software systems, i.e., safety-related systems, is proposed in this article. The main objective of the proposed approach is to perform the functionality and safety validation process at the system integration phase of the V-model. Based on HIL real-time simulation, a virtual test drive is enabled with automated and manual driving mode, considering the user behavior. In contrast to the traditional simulation methods, the proposed work allows not only the validation process in fault-free mode, but also the analysis of the system behavior under fault occurrence. Both single and simultaneous sensor/actuator-related faults can be injected during the real-time execution of the system in the target machine. Specifically, gain, offset/bias, noise, hard-over, spike, stuck-at, packet loss, delay and drift faults have been considered. These types of faults can be injected manually or automatically, as permanent or transient faults. In addition to traffic and road conditions, various weather conditions have been covered and included in the developed framework. Specifically, the system behavior can be validated under sunny, rainy, foggy and snowy weather conditions. Compared with the non-real-time simulation methods, the evaluation results show that the system behavior exhibits high performance in terms of accuracy with an average relative error of 2.52. Moreover, the comparison study with the related work demonstrated the superiority of the proposed approach with high capability of real-time simulation under critical situations. All in all, the proposed framework allows performing the validation activities according to the ISO 26262 standard to ensure safety and functionality during the development of safety critical systems. This, in turn, not only contributes to improving the safety and reliability of the developed system, but also reduces the cost and effort of real-world testing.
As future work, it is planned to extend the features and capabilities of the proposed approach by integrating real vehicle components and subsystems into the framework, e.g., real fuel pressure sensors and throttle valve. In this way, the uncertainty of the data caused by real elements will be taken into account during the validation process under realistic real-time conditions. However, this requires additional effort and cost in terms of computation time and setup. Moreover, to efficiently analyze the generated time series test data sets, AI-based intelligent models can be integrated into the proposed approach to automatically detect and classify the defects.