Skip to content

WindFault Module Documentation

Toolbox: RflySim PHM

WindFault Module Appearance

Introduction

One-sentence Description: This module models multiple drone flight environment parameters, including ambient wind, and supports injecting various wind faults such as steady wind, gusts, turbulent wind, and wind shear, outputting a standardized environment parameter bus.

This module belongs to the environment fault modeling component of the RflySim PHX fault injection and health management toolchain, primarily providing realistic environment simulation with fault injection for drone flight simulation. It accepts fault input information and the 6-DOF model output bus, and in addition to core wind field modeling and wind fault injection, it can simultaneously model various conventional environmental parameters such as temperature, GPS positioning, gravity, air pressure, and atmospheric density. Finally, all environmental parameters are packaged into a standardized Environment Model Bus for output,供 subsequent simulation chain usage.

This module is typically used in conjunction with the 6-DOF rigid-body model in CopterSim, providing PX4 flight controller simulation with environment data closely resembling real flight conditions—including wind disturbances and wind faults—within the RflySim closed-loop simulation framework. It supports research such as testing the robustness of drone control algorithms, fault diagnosis, and fault-tolerant control algorithm validation under wind disturbance and wind fault scenarios. Simulation results can be visualized synchronously in the RflySim3D visualization environment.

Port Descriptions

Input Ports (Inputs)

Port Name Data Type Dimension Description
FaultIn double N×1 Fault input, containing fault ID and corresponding fault parameters
Bus_6DOF Bus - Bus encapsulating outputs from the simplified environment model and rigid-body 6-DOF model
envAltitude double 1×1 Current flight altitude of the drone

Output Ports (Outputs)

Port Name Data Type Dimension Description
EnvModelBus Bus - Bus encapsulating environment modeling results, including temperature TempC, GPS positioning PosGPS, gravity gravity, air pressure AirPressure, atmospheric density Rho, body-frame wind velocity Windb, and earth-frame wind velocity Wind

Parameter Configuration (Parameters)

This module has no configurable parameters.

Module Characteristics (Block Characteristics)

Characteristic Value
Supported Data Types double, single
Direct Feedthrough Yes
Sample Time Inherited
Code Generation Support No

Data Communication Protocol

This module does not involve network communication.

Module Name Description
TempCFault PHM module for modeling environmental temperature sensor faults
PosGPSFault PHM module for modeling GPS positioning faults
GravityFault PHM module for modeling gravity parameter faults
AirPressureFault PHM module for modeling air pressure sensor faults
RhoFault PHM module for modeling atmospheric density parameter faults

Notes and Frequently Asked Questions

  • Initialization Order: The 6-DOF model connected to this module must complete state initialization before connecting to the Bus_6DOF input port of this module. Otherwise, the wind field calculation will obtain incorrect drone position and velocity states, leading to abnormal simulation results.
  • Fault ID and Parameter Matching: Different wind fault types correspond to different numbers of fault parameters. Parameters must be strictly matched according to the fault ID: fault ID 123458 (steady wind fault) requires 3 parameters, 123459 (gust fault) requires 2 parameters, 123540 (turbulent wind fault) requires 1 intensity parameter, and 123541 (shear wind fault) requires 1 intensity parameter. Mismatched parameter counts will cause fault injection failure or computational errors.
  • Bus Format Matching: The input Bus_6DOF must conform to the RflySim standard 6-DOF plus simplified environment output bus format. The output EnvModelBus follows a fixed packaging format. Do not arbitrarily modify the bus structure, or bus connection errors will occur.
  • Sample Time Matching: The sample time of this module must match that of the upstream 6-DOF dynamic model. Mismatch will result in delayed wind field state updates and wind speed calculation timing errors.
  • Noise Fault Parameter Explanation: In noise fault mode, the first element of the input NoiseParams vector is fixed as the global noise gain. Ensure the length of NoiseParams is ≥1 to avoid array index out-of-bounds errors.
  • Gust Parameter Explanation: For gust faults, the first element of the input parameters is the maximum gust velocity vmax, and the second element is the gust frequency parameter. Do not reverse the order, or the generated gust wind field will not match expectations.

Changelog

  • v4.10 (2024-07-25): Initial release, supporting environment wind modeling with fault injection for steady wind, gusts, turbulent wind, and shear wind, while integrating modeling of environmental parameters such as temperature, GPS positioning, gravity, air pressure, and atmospheric density.