Skip to content

GroundModel Module Documentation

Toolbox: RflySim Model

GroundModel Module Appearance

Introduction

One-sentence Description: This module simulates contact collision and friction effects between a UAV and terrain, outputting forces and torques generated by ground interaction.

This module serves as a core supporting component within the RflySim Model toolchain for UAV dynamics simulation. It primarily works in conjunction with the 6-DOF (six-degree-of-freedom) dynamics simulation workflow to perform UAV simulations in terrain-inclusive environments. The module receives terrain height information from the terrain processing module and the 6-DOF motion state information from the 6DOF module, enabling calculation of the forces and reaction torques exerted on the UAV body by the ground upon contact.

The force and torque outputs generated by this module can be directly fed into the force/torque synthesis stage of the overall UAV dynamics model. It supports simulation scenarios such as takeoff/landing, ground rolling, and ground parking for various types of rotorcraft and fixed-wing UAVs. Within the RflySim simulation framework, the dynamic results from this module are passed to CopterSim for aircraft state computation and synchronized to RflySim3D for 3D visualization, ultimately enabling the full closed-loop simulation process from control decision-making to dynamics simulation in coordination with the PX4 flight controller.

Port Descriptions

Input Ports (Inputs)

Port Name Data Type Dimension Description
tZ double 1×15 Input signal from the terrain interaction module; currently, only the first element stores terrain height information
6DOF double 1×13 6-DOF bus signal output by the 6DOF module, containing UAV pose, velocity, and other state information [To be confirmed]

Output Ports (Outputs)

Port Name Data Type Dimension Description
FM double 1×6 Forces and torques generated by ground collision and friction; the first three dimensions represent forces, and the last three represent torques

Parameter Configuration (Parameters)

This module has no configurable parameters.

Parameter Setting Instructions

None

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
6DOF_NED_EC Implements UAV 6-DOF dynamics modeling and outputs the 6-DOF bus signal
TerrainReader Reads digital elevation model terrain data and outputs terrain height-related input signals
RFMoveCylinderGnd Models ground contact for mobile takeoff/landing platforms and provides ground reaction force outputs

Notes and Common Issues

  • Initialization Order: The GroundModel module must be placed after both the 6DOF module and terrain generation module during simulation initialization. Additionally, the topological order of the 6-DOF bus signal must precede this module’s signal computation; otherwise, NaN errors may occur in the force/torque outputs.
  • Sample Time Matching: This module must use the same sample time as the corresponding 6DOF module. Mismatched sample times can lead to discontinuous ground contact force calculations, resulting in abnormal simulation phenomena such as UAV bouncing or jittering.
  • Input Dimension Requirement: The input tZ must be a 15-dimensional TerrainIn15d format vector. The module only reads the first element for terrain height; any mismatch in input dimension will trigger a Simulink signal dimension error.
  • Flat Ground Simulation Adaptation: If terrain interaction is not required and only flat-ground contact simulation is needed, a constant flat-ground height value can be padded into a compliant 15-dimensional input vector and connected to this module, eliminating the need for additional terrain generation module configuration.
  • Collision Detection Logic: This module determines contact solely based on the relative relationship between UAV position and terrain height. If the UAV’s initial position is set below the terrain height, an abnormally large ground thrust will be generated at simulation start-up, potentially causing the UAV to shoot out of the simulation scene.
  • Friction Force Adaptation: The friction force output by this module is default-tuned for multi-rotor UAV ground takeoff scenarios. For fixed-wing UAV ground rolling simulations, the friction coefficient must be adjusted in the module parameters to match simulation requirements; otherwise, excessive or insufficient rolling resistance may occur under default coefficient settings.

Changelog

  • v4.0 (2024-01-01): Initial release. Implements ground terrain contact and friction simulation functionality, supporting 15-dimensional terrain input and 6-DOF bus input, and outputting forces and torques from ground collision and friction.