Skip to content

CopterForceModel Module Documentation

Toolbox: RflySim Model

CopterForceModel Module Appearance

Introduction

One-sentence Description: This module computes the total external force and total external moment acting on a multi-rotor UAV in the body-fixed coordinate frame during flight.

This module belongs to the core动力学 (dynamics) calculation components within the RflySim Model interface library. It provides realistic and accurate modeling of thrust and aerodynamic forces for multi-rotor UAVs, forming a critical link in building a complete Simulink-based UAV dynamics simulation loop. The module supports multiple multi-rotor frame configurations and performs force and moment calculations based on input frame parameters, propulsion parameters, and aerodynamic parameters, combined with motor rotational speeds and the UAV’s current motion state.

Typically, this module receives motor speed signals processed by the MotorResponse module from throttle commands output by the PX4 flight controller. It also receives the current motion state information of the UAV from the SixDOF module’s output bus. The computed force and moment outputs are then fed into the SixDOF dynamics integration module to update the UAV’s motion state, enabling real-time dynamics simulation in conjunction with CopterSim, or supporting 3D visualization of UAV flight in RflySim3D.

Port Descriptions

Input Ports (Inputs)

Port Name Data Type Dimension Description
MotorRads double 1×8 Motor rotational speeds in rad/s, sourced from the MotorResponse module
6DOF Bus 6-DOF bus signal output by the SixDOF module, containing the UAV’s current motion state information

Output Ports (Outputs)

Port Name Data Type Dimension Description
FM double 1×6 Total force and total moment in the body-fixed frame; first 3 elements correspond to force components, last 3 to moment components

Parameter Configuration (Parameters)

The following parameters can be configured in the Mask dialog box opened by double-clicking the module:

Parameter Name Type Default Value Optional Values / Range Description
Param_uavType int 4 Positive integer Frame layout parameter, determines the positions of all motors in the body-fixed frame
Param_uavR double 0.4 > 0 Frame wheelbase (distance between opposite motors), unit: m
Param_motorJm double 4e-6 > 0 Motor + propeller moment of inertia, unit: kg·m²
Param_rotorCm double 1.8e-6 > 0 Propeller torque coefficient, unit: N·m/(rad/s)²
Param_rotorCt double 1.1e-5 > 0 Propeller thrust coefficient, unit: N/(rad/s)² [Pending confirmation]
Param_uavCd double 0.03 ≥ 0 Aerodynamic drag coefficient, unit: N/(m/s)²
Param_uavCCm double [0.01 0.01 0.01] 3D vector, each element ≥ 0 Aerodynamic damping moment coefficients, unit: N·m/(rad/s)²
Param_uavDearo double [0 0 0] 3D vector, arbitrary values Offset of the UAV center of gravity (CG) from the frame geometric center, unit: m

Parameter Setting Notes

Param_uavType

The frame layout parameter specifies the motor configuration type of the multi-rotor UAV. Different values correspond to different motor arrangements, and the module automatically computes the position coordinates of each motor in the body-fixed frame based on this parameter.

Param_rotorCt

The original documentation lists the unit as N·m/(rad/s)³. However, according to the standard physical definition of a propeller thrust coefficient, the typical unit should be N/(rad/s)². This discrepancy in the documentation is questionable; users should calibrate based on actual testing.

Param_uavDearo

When the actual center of gravity of the UAV does not coincide with the geometric center of the frame, this parameter sets the 3D offset of the CG relative to the geometric center, enabling more accurate calculation of forces and moments.

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
FixedWingForceModel Computes the force and moment acting on a fixed-wing UAV during flight
SixDOF Provides 6-DOF rigid-body dynamics simulation, outputting a bus containing UAV position, velocity, attitude, and other state information
MotorResponse Simulates motor speed response characteristics and outputs actual motor speeds

Notes and Common Issues

  • Initialization Order: This module depends on the 6-DOF bus signal from the SixDOF module and the motor speed signals from the MotorResponse module. Prior to simulation, ensure the corresponding upstream modules have been correctly initialized. Placing this module before its upstream modules will result in erroneous initial force and moment calculations, potentially causing simulation divergence.

  • Input Dimension Matching: The dimension of the MotorRads input must match the number of motors corresponding to the selected Param_uavType. For example, when selecting an X8 frame, an 8-dimensional motor speed vector must be provided; mismatched dimensions will trigger a signal dimension error.

  • Parameter Unit Requirements: All physical parameters must be entered using SI units. Wheelbase is in meters, inertia in kg·m², and thrust/torque coefficients must strictly follow the units specified in the documentation. Incorrect units can cause force and moment calculation errors by several orders of magnitude, leading to simulation anomalies.

  • Sample Time Matching: This module performs continuous computation. If placed within a discrete task, its sample time must be no greater than that of the motor and SixDOF modules; otherwise, delayed updates of force and moment may cause oscillation errors in the simulation results.

  • Center-of-Gravity Offset Impact: If a non-zero Param_uavDearo CG offset is set, this module will compute additional moments due to the offset. If your model assumes the CG coincides with the frame center, set this parameter to a zero vector to avoid introducing spurious moments.

Changelog

  • v4.00 (2024-07-10): Initial release. Published the outer-layer multi-rotor force and moment calculation module CopterForceModel, supporting multi-rotor frame layout configuration and aerodynamic force/moment computation.