Skip to content

Chapter 7: Health Management and Safety Assessment

Intelligent unmanned systems are 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, these experiments cover foundational platform interface tutorials and general introductions to various tools.

Experiment 1: Signal Tag Module Usage Example

📝 Experiment Overview:
Learn the usage of Goto and From blocks in Simulink, master the method of broadcasting and receiving data via tag labels, and observe the message after the From tag.

Experiment 2: Fault Parameter Encapsulation Structure

📝 Experiment Overview:
Learn how to read required fault parameters from the MATLAB workspace by creating encapsulated parameters, and master the method of referencing workspace variables using the Constant block in Simulink.

Experiment 3: RflySim Fault Injection MATLAB API Test

📝 Experiment Overview:
Send fault injection parameters via UDP mode using MATLAB/Simulink, learn the method of setting fault IDs and fault parameters, and master fault injection techniques for motors, propellers, batteries, GPS, etc.

Experiment 4: Fault Injection API Test

📝 Experiment Overview:
Learn to send fault injection parameters via UDP mode, achieve multiple fault injections by modifying fault IDs and parameters, and verify the fault effects.

Experiment 5: PX4 External Message Sending and Receiving

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

Experiment 6: Using the Fault Injection Library

📝 Experiment Overview:
Learn to use a Simulink model with a motor fault injection module from scratch, and master the method of setting fault switches and adjusting parameters.

Experiment 7: Fault Injection Minimal Template

📝 Experiment Overview:
Learn to use the RflySim fault injection minimal template, compile the Simulink model to generate a DLL file, and run hardware-in-the-loop simulation in CopterSim to implement UAV fault injection experiments.

Experiment 8: Motor Fault Injection Based on Minimal Template

📝 Experiment Overview:
Learn to use a motor fault injection model based on the minimal template, compile with Simulink and generate a DLL, and simulate UAV motor faults in software-in-the-loop simulation.

Experiment 9: Fault Simulation Data Collection Experiment

📝 Experiment Overview:
Collect UAV flight data under different fault conditions using automated scripts, providing training and validation data for fault diagnosis, predictive maintenance, and intelligent decision-making systems.

Experiment 10: PHM Flight Data Processing

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

Experiment 11: RflySimPHM Model Validation and Data Collection

📝 Experiment Overview:
Conduct UAV health management (PHM) experiments using the RflySim toolchain, learn to use machine learning models for fault prediction and health status assessment, and support software/hardware-in-the-loop simulation.

Experiment 12: Health Assessment Basic Experiment

📝 Experiment Overview:
Collect UAV operational data through simulation, learn the implementation method of health assessment algorithms, including fault judgment and fault injection functionality.

Experiment 13: Model Training

📝 Experiment Overview:
Train a model using a neural network to verify the health status of the flight control system, and learn to build and train a two-layer hidden layer neural network using Keras.

Experiment 14: Automated Generation of UAV Sensor Fault Test Cases

📝 Experiment Overview:
Implement automated generation and database import of UAV sensor fault test cases. Use Python scripts to automatically 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:
Learn to configure and run custom control sequences using the RflySim toolchain, generate UAV control commands by parsing the db.json file, and implement hardware or software-in-the-loop simulation.

Experiment 16: QGC Log Automatic Download

📝 Experiment Overview:
Implement automatic download of QGC ground station logs using Python scripts, master the usage of the qgc.ReqQgcLog() function, and learn the acquisition and management of UAV flight logs.

Experiment 17: Visual Custom Control Sequence Configuration and Usage

📝 Experiment Overview:
Learn how to configure and use custom control sequences with vision, map control commands by parsing the db.json file, and verify execution effects in the simulation environment.

Experiment 18: Fault Log Timestamp Acquisition Experiment

📝 Experiment Overview:
Master the method of obtaining fault injection timestamps from flight controller logs, and learn to use the RflySim toolchain for fault injection and log parsing.

7.5.2 Basic Usage Experiments

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

Experiment 1: Maximum Fault Injection Template

📝 Experiment Overview:
Learn the usage of the maximum fault injection template, including initialization, compilation, DLL file generation, and running software-in-the-loop simulation. Understand the differences between the minimum and maximum templates and the types of injectable faults.

Experiment 2: GPS Module Fault Injection

📝 Experiment Overview:
Learn to use the GPS fault injection module in the maximum template of the RflySim toolchain. Compile the Simulink model to generate a DLL file, inject GPS faults using a Python script, and observe the drone's automatic landing process after losing the GPS signal.

Experiment 3: Motor Module Fault Injection

📝 Experiment Overview:
Based on the principle of motor module fault injection using the maximum template, compile the Simulink model to generate a DLL file, inject motor faults using a Python script, and observe drone crashes or motor failure phenomena.

Experiment 4: Sensor Module Fault Injection

📝 Experiment Overview:
Learn the principles of fault injection for four sensor types (accelerometer, gyroscope, magnetometer, barometer) based on the maximum template. Implement fault injection via Simulink model compilation and Python scripts, and verify the effects by reading logs.

Experiment 5: Environmental Wind Fault Injection

📝 Experiment Overview:
Learn environmental wind module fault injection based on the maximum template. Use Python scripts to inject four types of wind faults (steady wind, gust wind, turbulent wind, and shear wind) into the Simulink simulation and observe the drone's response.

Experiment 6: Load Module Fault Injection

📝 Experiment Overview:
Learn the method of load module fault injection based on the maximum template, including the principles and implementation of load fault, load drift fault, and load leakage fault.

Experiment 7: Propeller Module Fault Injection

📝 Experiment Overview:
Learn propeller module fault injection based on the maximum template. Compile the Simulink model to generate a DLL file and use a Python script to inject propeller efficiency faults, observing the drone crash phenomenon.

Experiment 8: Battery Module Fault Injection Based on Maximum Template

📝 Experiment Overview:
Learn to use the RflySim toolchain and the maximum template method. Generate a DLL file from the Simulink model to implement battery failure, low voltage, and low battery fault injection, and perform simulation verification in CopterSim.

7.5.3 Advanced Development Experiments

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

Experiment 1: Full Fault Module Template Experiment

📝 Experiment Overview:
Model all fault modules based on the maximum template. Export the model as a DLL file, load it via CopterSim, and inject fault codes using the UDP protocol to achieve concurrent multi-fault simulation.

Experiment 2: Fault Generation and Injection GUI Application

📝 Experiment Overview:
Based on the maximum template for various fault injections, design a MATLAB APP that can inject various fault parameters into the model. Inject the generated faults into the software-in-the-loop simulation to achieve the fault injection effect.

Experiment 3: PX4 Fault Injection Experiment

📝 Experiment Overview:
This experiment implements fault injection by directly modifying the PX4 source code, compiling the firmware and flashing it to the flight controller. Use hardware-in-the-loop simulation and Python scripts to send fault parameters, demonstrating the fault injection effect.

Experiment 4: Single-Unit Single-Instance Automated Testing

📝 Experiment Overview:
Master the basic structure and workflow of the automated testing platform. Through a single-drone, single-instance automated testing experiment, learn simulation environment initialization, Python script execution, and test data verification.

Experiment 5: Single-Unit Multi-Instance Automated Testing

📝 Experiment Overview:
Master the basic structure and workflow of single-unit multi-instance automated testing on the automated testing platform. Configure simulation parameters and run Python scripts to achieve multi-drone automated testing and data recording.

Experiment 6: Multi-Model Single-Instance Automated Testing

📝 Experiment Overview:
Master the basic structure and workflow of multi-model single-instance automated testing on the RflySim automated testing platform. Configure one quadcopter and one fixed-wing aircraft, automatically execute test cases, and record data.

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 RflySim automated testing platform, including steps such as configuring simulation parameters, running Python scripts, and checking test data.

Experiment 8: Safety Assessment Experiment

📝 Experiment Overview:
Master the basic structure and workflow of the safety assessment algorithm. Use Python scripts to set parameters and call the API to output the drone's safety score and level.

Experiment 9: Trajectory Tracking Experiment

📝 Experiment Overview:
Master the basic structure and workflow of trajectory tracking. Configure control sequences and parameters using Python scripts to achieve automatic drone trajectory tracking simulation.

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

📝 Experiment Overview:
Master the basic structure and workflow of single-unit multi-instance automated testing on the automated testing platform. Modify Python scripts to achieve multi-drone automated testing.

Experiment 11: Automated Testing Trajectory Tracking

📝 Experiment Overview:
Master the basic structure and workflow of trajectory tracking. Use Python scripts for parameter setting and algorithm implementation to achieve trajectory tracking.

7.5.4 High-Level Development Experiments

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

Experiment 1: Virtual Simulation Experiment for UAV Fault Diagnosis Based on Digital Twin and Deep Learning

📝 Experiment Overview:
By constructing a digital twin system for UAVs, this experiment utilizes a virtual-virtual simulation mode and a bidirectional LSTM deep learning model to analyze sensor data discrepancies, enabling automatic detection and classification of typical UAV faults.