Skip to content

GPSFault Module Documentation

Toolbox: RflySim PHM

GPSFault Module Appearance

Introduction

One-sentence Description: This module injects specified faults into raw GPS information based on the input fault configuration, and outputs the fault-affected GPS signal encapsulated in bus format, for use in UAV PHM (Prognostics and Health Management) simulation scenarios.

This module belongs to the RflySim PHM interface library and is a core component of the RflySim toolchain for UAV fault simulation, primarily used for simulating various GPS sensor faults. It accepts raw position information in the planar Earth frame and fault configuration as inputs, adjusts GPS output noise, 3D fix status, and available satellite count according to fault flags and parameters, and finally encapsulates the processed GPS signal into a bus output.

This module is commonly used together with the FaultParamsExtract module, supports co-simulation with CopterSim, RflySim3D, and PX4 flight controller, and can simulate various GPS faults—including GPS drift, signal loss, and abnormal satellite count—in closed-loop simulations. It is suitable for UAV GPS fault diagnosis and verification/development of fault-tolerant control algorithms.

Port Descriptions

Input Ports

Port Name Data Type Dimension Description
Xe double 3×1 Position input in the planar Earth frame
FaultIn double N×1 [To be confirmed] Fault input vector containing fault type and fault parameter information

Output Ports

Port Name Data Type Dimension Description
GPSSignal Bus - Simulink bus output encapsulating 3DFix, GPSOut, and Sats signals

Parameter Configuration

This module has no configurable parameters.

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
FaultParamsExtract Extracts parameters for various faults from the fault input vector; can be used to extract GPS fault parameters for use by this module

Notes and Common Issues

  • Initialization Order: This module relies on the RflySim platform’s simulation environment initialization. It must be placed after the FaultParamsExtract module when building the model to ensure fault parameters are correctly parsed; otherwise, parameter parsing errors may occur, leading to abnormal simulation behavior.
  • Parameter Dimension Requirement: The input GPSFaultParam must be a vector of length 3, corresponding respectively to noise gain, 3D fix value, and satellite count. Dimension mismatch will cause module computation errors and prevent normal output generation.
  • Fault ID Matching: This module only supports GPS fault injection with fault ID 123546. If other fault IDs are used, the internal fault judgment logic of the module must be modified accordingly; otherwise, the corresponding fault effect will not be triggered.
  • Bus Output Compatibility: The module outputs a bus of type GPSSignal, which must match the GPS input bus format of the RflySim flight controller interface module. If a custom bus structure is used, it must include the three signals: 3DFix, GPSOut, and Sats; otherwise, bus connection errors will occur.
  • Sample Time Matching: The module must be configured with the same sample time as the flight controller interface module and the raw GPS output module. Mismatched sample times may cause abnormal fault injection timing, resulting in position output jumps or ineffective fault injection.
  • Fault Gain Range: To simulate complete GPS signal loss, set GPSFaultParam(1) to 0. Avoid setting excessively large gain values, as this may cause position output overflow and trigger flight controller protection shutdown.

Changelog

  • v4.10 (2024-07-25): Initial release. Implements GPS fault injection functionality, supporting adjustment of GPS noise, 3D fix status, and satellite count via fault parameters; outputs encapsulated bus signal.