Skip to content

Chapter 7: Health Management and Safety Assessment

Intelligent unmanned systems belong to typical complex systems, where "complex systems" generally refer to those with large scale, complex structure, diverse functions, varied fault modes, and unknown or dynamically changing external environments. Unmanned systems typically exhibit characteristics such as nonlinearity, dynamic variability, large scale, hierarchical structure, and decentralization. As system complexity increases, the number and probability of component failures also rise significantly. Therefore, reducing failure probability and mitigating the consequences of failures are central concerns in system health and safety assessment.


7.1 Background and Theory

Health management and safety assessment are critical for intelligent unmanned systems. Health management emphasizes real-time monitoring of system status and predictive maintenance, whereas safety assessment focuses on risk identification, probability calculation, and hazard mitigation.

alt text

7.1.1 Safety Requirements for Unmanned Systems

Safety requirements vary significantly across different types of unmanned systems: Embodied intelligent systems (e.g., quadruped robots) operate indoors at low speeds, thus having relatively lower safety requirements; autonomous vehicles operate at high speeds on roads, demanding extremely high safety standards; drones operate in complex three-dimensional meteorological environments and face dual threats of "potential energy + kinetic energy," making low-altitude safety a key bottleneck constraining industry development.

7.1.2 Core Value of Health Management and Safety Assessment

Constructing a systematic and standardized framework for health management and safety assessment is not only an essential technical pathway to ensure stable and reliable operation of unmanned systems, but also a core strategic initiative for building a trustworthy intelligent system framework for the future—enabling unmanned systems to transition from “functional” to “trustworthy.”


7.2 Framework and Interfaces

RflySim provides a comprehensive support system for health management and safety assessment, enabling rapid testing under extreme conditions, a closed-loop evaluation framework integrating hardware-in-the-loop and software-in-the-loop, real-time state monitoring with indicator visualization, data-driven predictive health management, and high-fidelity “simulation-to-reality” transfer capabilities.

alt text

7.2.1 Fault Modeling and Injection Framework

The fault modeling and injection framework supports multi-layer fault injection across model, firmware, environment, communication, intelligent algorithm, and swarm task layers. It accommodates typical fault scenarios—including sensor failures, motor malfunctions, and communication interruptions—enabling multi-dimensional, multi-level validation of system robustness.

alt text

7.2.2 Evaluation and Diagnosis Algorithm Development Framework

Leveraging dual-channel interfaces for Simulink/DLL models and flight controllers, this framework enables structured test case design and automatic triggering mechanisms, supporting a unified evaluation workflow across simulation and real-world phases. Through flight controller log parsing and safety metric computation, it facilitates multi-dimensional performance analysis—including mission success rate, fault recovery capability, and more.

alt text


7.3 Showcase of Representative Cases

Fault Injection Experiment:

Fault Injection and Diagnosis Algorithm Validation:


7.4 Course-Linked Video Lectures

Public Lecture Replay (Session 6: Health Management and Societal Safety Assessment):

7.5 Chapter Experiment Cases

The relevant verification experiments and guided cases for this chapter are stored in the [Installation Directory]\RflySimAPIs\7.RflySimPHM folder.

7.5.1 Interface Learning Experiments

Stored in the 7.RflySimPHM\0.ApiExps folder, covering foundational platform interface tutorials and general introductions to various tools.

Experiment 1: Learning and Using the Signal Tag Module

📝 Experiment Overview:
Learn the usage of Goto and From blocks in Simulink through examples, and master the method of broadcasting and receiving data using identical tags.

Experiment 2: Fault Parameter and Encapsulated Parameter Reference

📝 Experiment Overview:
Learn how to create encapsulated parameters using Simulink’s Constant block, read fault parameters from the workspace, and run the model—mastering the usage of the Constant block.

Experiment 3: RflySim Fault Injection MATLAB API Test

📝 Experiment Overview:
Use MATLAB/Simulink to send fault injection parameters via UDP mode; learn how to set fault IDs and fault parameters, and master fault injection techniques for motors, propellers, batteries, GPS, etc.

Experiment 4: UDP Mode Fault Injection API Test

📝 Experiment Overview:
Learn to send fault injection parameters via UDP using Python; master the usage of the sendSILIntFloat function in the PX4MavCtrlV4 library to achieve fault injection effects.

Experiment 5: Sending and Receiving External Messages to/from PX4

📝 Experiment Overview:
Learn to send external messages to PX4 and receive status information via MATLAB/Simulink; master the usage of the UDP Receiver block (port 30100 is used for fault injection).

Experiment 6: Using the Motor Fault Injection Module

📝 Experiment Overview:
Learn to use the built-in MotorFaultModel motor fault injection module in Simulink; observe changes in motor PWM output waveforms during fault injection, and master the usage of the fault injection module.

Experiment 7: Minimal Fault Injection Template

📝 Experiment Overview:
Learn to use the minimal fault injection template, which has no fault effect and can replace any fault injection module; primarily focuses on becoming familiar with and applying the minimal template.

Experiment 8: Motor Fault Injection Based on Minimal Template

📝 Experiment Overview:
Learn motor fault injection based on the minimal template; master the injection method of the MotorFault1 motor fault module in Simulink. After drone startup, a fault occurs immediately, preventing normal takeoff and causing severe shaking.

Experiment 9: Drone Fault Data Collection

📝 Experiment Overview:
Collect drone fault flight data automatically in SITL/HITL simulation environments to provide training data for fault diagnosis and predictive maintenance.

Experiment 10: PHM Flight Data Processing
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview:
    Converts ULog flight logs to CSV format using Python scripts, performs data filtering, cleaning, time alignment, and feature engineering to generate a processed_data.csv table directly usable for neural network training.

Experiment 11: Fault Model Validation

📝 Experiment Overview:
Validates the accuracy of a TensorFlow-based UAV fault diagnosis model by running model_ver.py, supporting both hardware-in-the-loop and software-in-the-loop simulation modes. Learns the deployment and inference workflow of machine learning models on actual flight controllers.

Experiment 12: UAV Health Assessment Fundamentals

📝 Experiment Overview:
Collects UAV flight data via the RflySim simulation environment, implements health assessment algorithms and fault injection functionality, and grasps the fundamental implementation methods of PHM (Prognostics and Health Management) algorithms.

Experiment 13: PHM Neural Network Model Training

📝 Experiment Overview:
Implements two-layer hidden-layer neural network training using Jupyter Notebook, mastering data preprocessing, network architecture design (110-56-32-2), compilation optimization, and model training procedures for binary classification of faults and health states.

Experiment 14: Automated Generation of UAV Sensor Fault Test Cases

📝 Experiment Overview:
Automates the generation and database import of UAV sensor fault test cases. Python scripts generate test cases for accelerometers, gyroscopes, magnetometers, barometers, GPS, etc., and store them in an SQLite database.

Experiment 15: Custom Control Sequence Configuration and Usage

📝 Experiment Overview:
Parses control sequences from the db.json file using Python scripts and maps them to UAV control commands, mastering the basic configuration and usage of custom control sequences.

Experiment 16: Automatic QGC Log Download

📝 Experiment Overview:
Automates the download of QGC ground station logs using Python scripts, mastering the usage of the qgc.ReqQgcLog() function and learning methods for acquiring and managing UAV flight logs.

Experiment 17: Visual System Custom Control Sequence Configuration and Usage

📝 Experiment Overview:
Parses db.json files via Python scripts to map control sequences to UAV control commands, enabling configuration and usage of custom control sequences for visual systems.

Experiment 18: Fault Injection and Flight Log Timestamp Extraction

📝 Experiment Overview:
Injects faults by calling the RflySim SDK interface and learns how to extract fault injection timestamps from flight logs by parsing vehicle_command_0.csv for command=31000.

7.5.2 Fundamental Usage Experiments

Stored in the 7.RflySimPHM\1.BasicExps folder, these experiments provide a complete set of supplementary teaching materials for beginners.

Experiment 1: Maximum Fault Injection Template

📝 Experiment Overview:
Learn to use the maximum fault injection template and understand the distinction between maximum and minimum templates (external fault injection interfaces). This template has no fault effects and can serve as a drop-in replacement for various fault injection modules.

Experiment 2: GPS Module Fault Injection

📝 Experiment Overview: This experiment implements GPS module fault injection based on the Max Template. Fault signals are transmitted to the Simulink Max Template GPS fault injection module via FaultInjectAPITest.py. Learners will understand the implementation principles of GPS fault injection and the impacts of three key parameters: noise gain, 3D mode, and satellite count.

Experiment 3: Motor Module Fault Injection

📝 Experiment Overview: This experiment introduces the principle of motor module fault injection based on the Max Template. Learners will master the method of motor fault injection using FaultInjectAPITest.py and the PX4MavCtrlV4 library, and understand the structure and implementation mechanism of the MotorFault module.

Experiment 4: Sensor Module Fault Injection

📝 Experiment Overview: This experiment introduces the principle of sensor module fault injection based on the Max Template. Fault signals are transmitted to Simulink modules via the PX4MavCtrlV4 library, enabling noise fault injection simulations for accelerometers, gyroscopes, magnetometers, and barometers.

Experiment 5: Environmental Wind Fault Injection

📝 Experiment Overview: This experiment introduces environmental wind module fault injection based on the Max Template. Fault signals are transmitted to the Simulink Max Template via the PX4MavCtrlV4 library interface, enabling injection of four types of environmental wind faults: steady wind, gust wind, turbulent wind, and shear wind.

Experiment 6: Load Module Fault Injection

📝 Experiment Overview: This experiment introduces the principle and implementation of load module fault injection based on the Max Template. Fault signals are sent to the Simulink Max Template via FaultInjectAPITest.py, enabling injection of three types of load faults: load fault, load drift fault, and load leakage fault.

Experiment 7: Propeller Module Fault Injection

📝 Experiment Overview: This experiment introduces propeller module fault injection based on the Max Template. Learners will master the method of transmitting fault signals to the Simulink model via the PX4MavCtrlV4 library interface to achieve propeller fault injection.

Experiment 8: Battery Module Fault Injection

📝 Experiment Overview: This experiment introduces battery module fault injection based on the Max Template. Learners will master the method of injecting battery failure, low voltage, and low battery faults using FaultInjectAPITest.py and the PX4MavCtrlV4 library.

7.5.3 Advanced Development Experiments

Stored in the 7.RflySimPHM\2.AdvExps folder, these experiments further familiarize users with the configuration of the underlying firmware ecosystem.

Experiment 1: Full Fault Module Injection

📝 Experiment Overview: This experiment performs full fault module modeling based on the Max Template. The model is exported as a DLL file and loaded by CopterSim. Fault codes are injected via UDP mode to conduct multi-fault injection simulation experiments, enabling mastery of the Max Template’s usage and internal implementation.

Experiment 2: Fault Generation and Injection GUI Application

📝 Experiment Overview: Based on the full fault injection template, this experiment uses a MATLAB App to inject fault parameters in real time into software-in-the-loop (SITL) simulations, achieving fault injection effects.

Experiment 3: PX4 Fault Injection Experiment
  • 📦 Version Requirement: Free Edition

    📝 Experiment Overview: By modifying the PX4 flight control source code and importing it into the flight controller, hardware-in-the-loop simulation is conducted to validate fault injection for sensors such as magnetometer, GPS, remote controller, motors, and accelerometers.

Experiment 4: Single-Unit Single-Instance Automated Testing

📝 Experiment Overview: Learn and master the basic structure and workflow of the RflySim automated testing platform, and perform automated testing and data analysis for a single drone with a single instance by running the AutoTest.py script.

Experiment 5: Single-Unit Multi-Instance Automated Testing

📝 Experiment Overview: Learn how to conduct automated testing for a single-unit multi-instance scenario using the RflySim automated testing platform, and master methods for configuring multiple drones and test cases.

Experiment 6: Multi-Model Single-Instance Automated Testing with RflySim

📝 Experiment Overview: Master the basic structure and workflow of multi-model single-instance automated testing on the platform, and implement automated testing functionality via Python scripts.

Experiment 7: Multi-Model Multi-Instance Automated Testing

📝 Experiment Overview: Master the basic structure and workflow of multi-model multi-instance automated testing on the platform, including configuration parameter setup, multi-model test case configuration, drone instance management, and automated testing data logging.

Experiment 8: RflySim Safety Assessment

📝 Experiment Overview: Learn how to use the ProfustSA module for safety assessment, master the basic structure and workflow of safety assessment algorithms, and perform drone safety scoring by setting parameters via Python scripts.

Experiment 9: Trajectory Tracking Automated Testing

📝 Experiment Overview: Perform automated testing of drones by setting parameters and implementing trajectory tracking algorithms via Python scripts, mastering the basic structure and workflow of trajectory tracking.

Experiment 10: Single-Unit Multi-Instance Automated Testing on the Automated Testing Platform

📝 Experiment Overview: Learn the structure and workflow of single-unit multi-instance automated testing on the automated testing platform, and master methods for configuring multi-drone simulation parameters, executing tests, and viewing results using Python scripts.

Experiment 11: Automated Trajectory Tracking Testing

📝 Experiment Overview: This experiment configures parameters via Python scripts and combines the RflySim platform to achieve automated trajectory tracking for drones. It enables mastering the basic structure and workflow of trajectory tracking, allowing users to customize trajectories and generate flight data.

7.5.4 Advanced Development Experiments

Stored in the 7.RflySimPHM\3.CustExps folder, these experiments are designed for advanced users engaged in custom development.

Experiment 1: Digital Twin and Deep Learning for Drone Fault Diagnosis

📝 Experiment Overview: Explore the application of digital twin technology and deep learning methods in drone fault diagnosis. Through fault injection simulation, residual data between twin model outputs and actual outputs are fed into a deep learning model to achieve fault diagnosis and localization.