How to design a safety - critical algorithm for ASIL - D functions?
Time: May 12, 2025
Form: 利氪科技LeeKr

As a provider of ASIL-D Functional Safety, I understand the critical importance of designing algorithms for ASIL-D functions. ASIL-D, the highest Automotive Safety Integrity Level defined by ISO 26262, demands the utmost reliability and safety in automotive systems. In this blog, I will share insights on how to design a safety-critical algorithm for ASIL-D functions.

Understanding ASIL-D Requirements

Before delving into algorithm design, it is essential to have a comprehensive understanding of ASIL-D requirements. ASIL-D is associated with the highest level of risk in automotive systems, where a malfunction could lead to life-threatening situations. The ISO 26262 standard sets strict guidelines for the development of safety-critical systems, including requirements for functional safety concepts, safety analysis, and verification and validation processes.

When designing an algorithm for ASIL-D functions, it is crucial to consider the following aspects: - Fault Tolerance: The algorithm must be able to tolerate single-point faults and latent faults without compromising safety. Redundancy and fault detection mechanisms are often employed to achieve fault tolerance. - Diagnostic Coverage: High diagnostic coverage is required to detect faults in a timely manner. Diagnostic mechanisms should be designed to identify faults with a high degree of accuracy and report them to the system. - Safety Integrity: The algorithm must meet the safety integrity requirements specified by ASIL-D. This includes ensuring that the probability of a dangerous failure per hour (PFH) is within the acceptable limits. - Determinism: ASIL-D algorithms need to be deterministic, meaning that they produce the same output for a given input under the same conditions. This is essential for ensuring the predictability and reliability of the system.

Designing the Algorithm Architecture

The architecture of the safety-critical algorithm plays a crucial role in meeting ASIL-D requirements. A well-designed architecture can enhance fault tolerance, diagnostic coverage, and safety integrity. Here are some key considerations when designing the algorithm architecture: - Modularity: Divide the algorithm into smaller, independent modules. This makes the algorithm easier to understand, test, and maintain. Each module should have a well-defined interface and perform a specific function. - Redundancy: Implement redundant modules or components to provide fault tolerance. Redundancy can be achieved through hardware redundancy (e.g., using multiple sensors or processors) or software redundancy (e.g., running multiple copies of the algorithm). - Separation of Concerns: Separate the safety-critical functionality from the non-safety-critical functionality. This helps to isolate faults and reduces the complexity of the safety analysis. - Hierarchical Structure: Adopt a hierarchical structure for the algorithm architecture. This allows for a clear separation of different levels of abstraction and simplifies the design and verification process.

Implementing Safety Mechanisms

To ensure the safety of the algorithm, various safety mechanisms need to be implemented. These mechanisms help to detect and handle faults, prevent dangerous failures, and ensure the correct operation of the system. Here are some common safety mechanisms used in ASIL-D algorithms: - Watchdog Timers: Watchdog timers are used to monitor the execution of the algorithm and detect if it has stopped or is running too slowly. If a fault is detected, the watchdog timer can trigger a safety response, such as resetting the system. - Error Detection and Correction Codes: Error detection and correction codes, such as cyclic redundancy checks (CRC) and Hamming codes, are used to detect and correct errors in data transmission and storage. These codes help to ensure the integrity of the data used by the algorithm. - Fault Injection and Testing: Fault injection techniques are used to simulate faults in the algorithm and test its fault tolerance. By injecting faults at different points in the algorithm, we can verify that the safety mechanisms are working correctly and that the system can tolerate faults without compromising safety. - Safety Analysis: Conduct a thorough safety analysis of the algorithm to identify potential hazards and evaluate the effectiveness of the safety mechanisms. Safety analysis techniques, such as fault tree analysis (FTA) and failure mode and effects analysis (FMEA), can be used to identify the root causes of faults and develop appropriate mitigation strategies.

Verification and Validation

Verification and validation are essential steps in the development of ASIL-D algorithms. Verification ensures that the algorithm meets the specified requirements, while validation ensures that the algorithm performs as intended in the real-world environment. Here are some key considerations for verification and validation: - Unit Testing: Conduct unit tests on individual modules of the algorithm to verify their functionality. Unit tests should cover all possible input scenarios and edge cases to ensure the correctness of the module. - Integration Testing: Perform integration tests to verify the interaction between different modules of the algorithm. Integration tests should simulate the real-world operating conditions and ensure that the modules work together correctly. - System Testing: Conduct system tests on the entire algorithm to verify its performance in the real-world environment. System tests should include a variety of scenarios, such as normal operation, fault conditions, and extreme conditions, to ensure the reliability and safety of the system. - Safety Validation: Validate the safety of the algorithm by conducting safety analyses and tests. Safety validation should include fault injection tests, reliability analyses, and compliance tests to ensure that the algorithm meets the ASIL-D requirements.

Case Study: Autonomous Braking Algorithm

To illustrate the design process of a safety-critical algorithm for ASIL-D functions, let's consider an example of an Autonomous Braking algorithm. Autonomous braking is a safety-critical function that can help to prevent collisions by automatically applying the brakes when a potential collision is detected.

Algorithm Architecture

The autonomous braking algorithm can be designed with a modular architecture, consisting of the following modules: - Sensor Interface Module: This module is responsible for interfacing with the sensors, such as radar and cameras, and processing the sensor data. - Object Detection and Tracking Module: This module uses the sensor data to detect and track objects in the environment. It identifies potential collision targets and calculates their relative position and velocity. - Collision Prediction Module: This module analyzes the object data and predicts the likelihood of a collision. It uses algorithms to calculate the time to collision (TTC) and determines if braking is required. - Braking Control Module: This module receives the collision prediction information and controls the braking system. It calculates the appropriate braking force and sends the control signals to the brakes.

Safety Mechanisms

To ensure the safety of the autonomous braking algorithm, the following safety mechanisms can be implemented: - Redundant Sensors: Use multiple sensors, such as radar and cameras, to provide redundant information about the environment. This helps to improve the reliability of the object detection and tracking. - Diagnostic Monitors: Implement diagnostic monitors in each module to detect faults and errors. Diagnostic monitors can check the integrity of the sensor data, the correctness of the calculations, and the operation of the control signals. - Watchdog Timers: Use watchdog timers to monitor the execution of the algorithm and detect if it has stopped or is running too slowly. If a fault is detected, the watchdog timer can trigger a safety response, such as activating the emergency brakes. - Fault Injection and Testing: Conduct fault injection tests on the algorithm to verify its fault tolerance. By injecting faults at different points in the algorithm, we can ensure that the safety mechanisms are working correctly and that the system can tolerate faults without compromising safety.

Verification and Validation

The autonomous braking algorithm should be thoroughly verified and validated to ensure its safety and reliability. The verification and validation process can include the following steps: - Unit Testing: Conduct unit tests on each module of the algorithm to verify its functionality. Unit tests should cover all possible input scenarios and edge cases to ensure the correctness of the module. - Integration Testing: Perform integration tests to verify the interaction between different modules of the algorithm. Integration tests should simulate the real-world operating conditions and ensure that the modules work together correctly. - System Testing: Conduct system tests on the entire algorithm to verify its performance in the real-world environment. System tests should include a variety of scenarios, such as normal operation, fault conditions, and extreme conditions, to ensure the reliability and safety of the system. - Safety Validation: Validate the safety of the algorithm by conducting safety analyses and tests. Safety validation should include fault injection tests, reliability analyses, and compliance tests to ensure that the algorithm meets the ASIL-D requirements.

Conclusion

Designing a safety-critical algorithm for ASIL-D functions is a complex and challenging task. It requires a deep understanding of the ASIL-D requirements, a well-designed algorithm architecture, the implementation of appropriate safety mechanisms, and thorough verification and validation. By following the guidelines and best practices outlined in this blog, you can design a reliable and safe algorithm for ASIL-D functions.

If you are interested in learning more about our ASIL-D Functional Safety solutions or have any questions about algorithm design for ASIL-D functions, please feel free to contact us for procurement discussions. We are committed to providing high-quality safety solutions to meet your needs.

References

  • ISO 26262: Road vehicles -- Functional safety
  • Leveson, N. G. (2012). Engineering a Safer World: Systems Thinking Applied to Safety. MIT Press.
  • Smith, C. M., & Anderson, J. C. (2016). Autonomous Vehicles Technology: A Guide for Policymakers. RAND Corporation.