Unmanned aerial vehicle control simulation method, simulator thereof and storage medium
By constructing a state-driven closed-loop computing architecture in the drone control simulator, the logical decoupling problem of racing drone simulators is solved, achieving higher simulation accuracy and realistic flight feel reproduction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN ZEXIN FUTURE TECH CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-05-12
AI Technical Summary
Existing racing drone simulators suffer from logical decoupling issues in flight control and physical feedback processing, resulting in reduced simulation accuracy and an inability to reproduce the realistic feel of flying a racing drone.
By acquiring the current physical state information and remote control input signals of the target UAV model in real time in the UAV control simulator, flight control, physical torque, power thrust and air resistance calculations are performed to construct a state-driven closed-loop computing architecture, ensuring real-time linkage and coupling of each calculation link.
It improves simulation accuracy, can reproduce the real feel of flying a racing drone, improves logic decoupling issues, and enhances the physical simulation accuracy of the simulator.
Smart Images

Figure CN122018526A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of unmanned aerial vehicle (UAV) simulation control technology, and in particular to a UAV control simulation method, its simulator, and storage medium. Background Technology
[0002] Racing drones, with their high thrust-to-weight ratio and high maneuverability, are widely used in racing competitions, aerial filming, and special operations. Due to the high difficulty of operating racing drones, operators require extensive training to master the skills, making hands-on training the core training method. However, the hardware characteristics of racing drones limit the effectiveness of hands-on training, making high-fidelity physical simulation training tools a necessity in the industry. Racing drone flight simulation technology has become an important direction in the drone field.
[0003] An ideal racing drone simulator must accurately reproduce the physical characteristics of the real world within a virtual environment, including aerodynamic interference, motor dynamic response, and especially flight control algorithm logic. The accuracy of the simulator's physical simulation becomes a core indicator of its performance. Currently, mainstream racing drone simulators on the market simplify the real flight control and physical models of drones to enable rapid simulator development and meet basic flight training needs. However, these solutions generally suffer from logic decoupling issues in the handling of simulated flight control and physical feedback, leading to a significant reduction in simulation accuracy and an inability to reproduce the realistic feel of flying a racing drone. Summary of the Invention
[0004] The embodiments of this application aim to at least solve one of the technical problems existing in the prior art. To this end, the embodiments of this application propose a drone control simulation method, its simulator, and storage medium, which can improve the logic decoupling problem in the processing of simulated flight control and physical feedback, resulting in improved simulation accuracy and helping to reproduce the realistic flight feel of a racing drone.
[0005] The drone control simulation method according to a first aspect of the present application is applied to a drone control simulator, the method comprising: The current physical state information of the target drone model is acquired in real time in the drone control simulator, and the remote control input signal is also acquired. Flight control calculations are performed based on the remote control input signal and the current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis; Physical torque calculations are performed based on the preset inertia tensor corresponding to the target UAV model and the drive control parameters to obtain the rotational torque characterization parameters of the target UAV model. Based on the remote control input signal, the throttle input is analyzed to obtain the driving thrust characterization parameters of the target UAV model; Based on the current physical state information, air resistance is analyzed to obtain the air resistance characterization parameters of the target UAV model; Based on the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter, the target UAV model is simulated for control, so as to update the current physical state information of the target UAV, and return to the process of acquiring the remote control input signal until the current physical state information triggers the preset control simulation termination condition.
[0006] According to some embodiments of this application, the world coordinate system is a coordinate system defined relative to the simulated scene in the UAV control simulator. Before performing flight control calculations based on the remote control input signal and the current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis, the method further includes: Extract the current angular velocity corresponding to the world coordinate system from the current physical state information; The current angular velocity is converted to the body coordinate system to determine the local angular velocity of the aircraft corresponding to the body coordinate system; wherein, the body coordinate system is a coordinate system defined in the UAV control simulator relative to the target UAV model, and each coordinate axis of the body coordinate system corresponds to each rotation axis of the target UAV model.
[0007] According to some embodiments of this application, the step of performing flight control calculations based on the remote control input signal and the current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis includes: The remote control input signal is analyzed using control logic to determine the target angular velocity corresponding to each rotation axis. For each rotation axis of the target UAV model, the deviation is calculated based on the corresponding target angular velocity and the local angular velocity of the body to obtain the angular velocity deviation characterization parameter; The control parameters are calculated based on the local angular velocity of the body, the target angular velocity, and the angular velocity deviation characteristic parameter to determine the drive control parameters.
[0008] According to some embodiments of this application, the step of calculating control parameters based on the local angular velocity of the body, the target angular velocity, and the angular velocity deviation characterization parameter to determine the drive control parameters includes: Obtain the preset proportional gain, integral gain, derivative gain, and feedforward gain; The proportional term is calculated based on the angular velocity deviation characterization parameter and the proportional gain to obtain the proportional term parameter; The integral term is calculated based on the cumulative value of the angular velocity deviation characterization parameter and the integral gain to obtain the integral term parameter; The differential term is calculated based on the rate of change of the local angular velocity of the body and the differential gain to obtain the differential term parameter; The feedforward term is calculated based on the change in the target angular velocity and the feedforward gain to obtain the feedforward term parameters. The desired angular velocity is calculated based on the proportional term parameter, the integral term parameter, the differential term parameter, and the feedforward term parameter to obtain the drive control parameters.
[0009] According to some embodiments of this application, the step of analyzing the throttle input based on the remote control input signal to obtain the driving thrust characterization parameters of the target UAV model includes: Obtain the maximum thrust value corresponding to the target UAV model; Throttle input is extracted from the remote control input signal to obtain the raw throttle input data; The original throttle input data is linearized and compensated to obtain the compensated throttle control quantity. Based on the compensated throttle control amount and the maximum thrust value, the basic thrust is calculated to obtain the basic thrust characterization parameters. The original throttle input data is subjected to anti-gravity compensation processing to obtain anti-gravity compensation characterization parameters; The driving thrust characterization parameters are obtained by performing thrust synthesis based on the basic thrust characterization parameters and the antigravity compensation characterization parameters.
[0010] According to some embodiments of this application, the anti-gravity compensation processing of the original throttle input data includes: The rate of change of the original throttle input data is analyzed to determine the parameter representing the rate of change of throttle. The throttle change rate parameter is filtered to remove high-frequency noise, resulting in a filtered change rate parameter. The compensation amount is calculated based on the filtered rate of change characterization parameter and the preset compensation gain to obtain the anti-gravity compensation characterization parameter.
[0011] According to some embodiments of this application, the step of performing air resistance analysis based on the current physical state information to obtain the air resistance characterization parameters of the target UAV model includes: Extract the linear velocity of the target UAV model from the current physical state information; Nonlinear drag calculation is performed on the linear velocity of the aircraft body to determine the air resistance characterization parameters of the target UAV model; wherein, the nonlinear drag calculation includes: determining the magnitude and direction of the air resistance characterization parameters based on the product relationship between the magnitude of the linear velocity of the aircraft body and the linear velocity of the aircraft body.
[0012] According to some embodiments of this application, the step of performing nonlinear drag calculation on the linear velocity of the airframe to determine the air resistance characterization parameters of the target UAV model includes: For each coordinate axis direction of the body coordinate system corresponding to the target UAV model, the corresponding axial linear velocity component is extracted from the linear velocity of the body. For each of the aforementioned axial linear velocity components, a corresponding axial drag coefficient is configured. For each coordinate axis of the body coordinate system, the axial air resistance components in each coordinate axis direction are calculated based on the product relationship between the axial linear velocity component, the magnitude of the axial linear velocity component, and the corresponding axial drag coefficient. Vector synthesis is performed on each of the axial air resistance components to determine the air resistance characterization parameters.
[0013] According to some embodiments of this application, the step of performing control simulation on the target drone model to update the current physical state information of the target drone includes: Flight mode trigger detection is performed based on the current physical state information to determine the current flight mode of the target drone model; Based on the current flight mode, a corresponding target control simulation strategy is determined from a variety of preset control simulation strategies; Based on the target control simulation strategy, differentiated torques are applied to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information.
[0014] According to some embodiments of this application, the step of performing flight mode trigger detection based on the current physical state information to determine the current flight mode of the target UAV model includes: The current flight state of the target UAV model is detected based on the current physical state information; In response to detecting that the current flight state is a fall-inverted state, the current flight mode is determined to be a flip recovery mode; The target control simulation strategy involves applying differentiated torques to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information, including: Based on the target manipulation simulation strategy corresponding to the flip recovery mode, perform the following operations: Obtain the propeller arm length and maximum thrust corresponding to the target UAV model; The remote control input signal is subjected to single-axis locking and dead zone processing to obtain the flip-back-to-center control command; Based on the flip-back control command, the propeller arm length, and the maximum thrust, the flip-back torque is calculated to obtain the flip-back recovery torque. The target UAV model is flipped back to its original position based on the flipping recovery torque, so as to update the current physical state information.
[0015] According to some embodiments of this application, the step of calculating the rollover torque based on the rollover return control command, the propeller arm length, and the maximum thrust to obtain the rollover recovery torque includes: The flip power is analyzed in response to the flip-back control command to determine the flip power percentage; The basic overturning torque is obtained by multiplying the maximum thrust, the propeller arm length, and the overturning power ratio. The current angular velocity of the target UAV model is extracted from the current physical state information, and the angular velocity decay factor is determined based on the current angular velocity; The basic overturning torque is attenuated and corrected based on the angular velocity attenuation factor to determine the overturning recovery torque.
[0016] According to some embodiments of this application, after the target UAV model is driven to flip back to its upright position based on the flipping recovery torque, the method further includes: Perform homing state detection based on the current physical state information; In response to detecting that the target drone model has returned to normal flight attitude, the flip recovery mode is switched to normal flight mode; In response to the detection that the target drone model has not returned to its normal flight attitude, the calculation of the flip torque based on the flip-back control command, the propeller length, and the maximum thrust is performed to continuously adjust the flip recovery torque until the target drone model returns to its normal flight attitude.
[0017] According to some embodiments of this application, the step of performing flight mode trigger detection based on the current physical state information to determine the current flight mode of the target UAV model further includes: In response to detecting that the current flight state is an impending crash state, the current flight mode is determined to be a crash recovery mode; The target control simulation strategy involves applying differentiated torques to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information, including: Based on the target control simulation strategy corresponding to the crash recovery mode, the current angular velocity of the target UAV model is extracted from the current physical state information; The damping torque is calculated based on the current angular velocity and the preset damping deceleration rate to obtain the crash damping torque; The crash damping torque is applied to the target drone model to suppress its rotational motion and update the current physical state information.
[0018] Secondly, embodiments of this application provide a drone control simulator, including: a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the drone control simulation method as described in any one of the embodiments of the first aspect of this application.
[0019] Thirdly, embodiments of this application provide a computer-readable storage medium storing a program that is executed by a processor to implement the drone control simulation method as described in any one of the embodiments of the first aspect of this application.
[0020] The drone control simulation method, simulator, and storage medium according to the embodiments of this application have at least the following beneficial effects: The UAV control simulation method according to the embodiments of this application, applied to a UAV control simulator, requires real-time acquisition of the current physical state information of the target UAV model and acquisition of remote control input signals within the UAV control simulator; flight control calculations are performed based on the remote control input signals and the current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis; physical torque calculations are performed based on the preset inertia tensor and drive control parameters corresponding to the target UAV model to obtain the rotational torque characterization parameters of the target UAV model; throttle input analysis is performed based on the remote control input signals to obtain the drive thrust characterization parameters of the target UAV model; air resistance analysis is performed based on the current physical state information to obtain the air resistance characterization parameters of the target UAV model; based on the rotational torque characterization parameters, drive thrust characterization parameters, and air resistance characterization parameters, control simulation is performed on the target UAV model to update the current physical state information of the target UAV, and the process returns to acquire the remote control input signals until the current physical state information triggers a preset control simulation termination condition. In this way, the logical decoupling problem in the processing of simulated flight control and physical feedback can be improved, resulting in improved simulation accuracy and helping to reproduce the realistic flight feel of a racing drone.
[0021] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description
[0022] The above and / or additional aspects and advantages of the embodiments of this application will become apparent and readily understood from the description of the embodiments in conjunction with the following drawings, wherein: Figure 1 This is a flowchart illustrating a drone control simulation method provided in an embodiment of this application. Figure 2 This is another schematic flowchart of the drone control simulation method provided in the embodiments of this application; Figure 3 This is another schematic flowchart of the drone control simulation method provided in the embodiments of this application; Figure 4 This is another schematic flowchart of the drone control simulation method provided in the embodiments of this application; Figure 5 This is another schematic flowchart of the drone control simulation method provided in the embodiments of this application; Figure 6 This is another schematic flowchart of the drone control simulation method provided in the embodiments of this application; Figure 7 This is another schematic flowchart of the drone control simulation method provided in the embodiments of this application; Figure 8 This is another schematic flowchart of the drone control simulation method provided in the embodiments of this application; Figure 9 This is another schematic flowchart of the drone control simulation method provided in the embodiments of this application; Figure 10 This is a schematic diagram of the hardware structure of the drone control simulator provided in this application embodiment. Detailed Implementation
[0023] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting the embodiments of this application.
[0024] In the description of the embodiments of this application, "several" means one or more, "multiple" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. If "first" or "second" is used in the description, it is only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0025] In the description of the embodiments of this application, it should be understood that the orientation descriptions, such as up, down, left, right, front, and back, are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.
[0026] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with an embodiment or example that are included in at least one embodiment or example of the embodiments of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0027] In the description of the embodiments of this application, it should be noted that, unless otherwise explicitly limited, terms such as "setting," "installing," and "connecting" should be interpreted broadly. Those skilled in the art can reasonably determine the specific meaning of the above terms in the embodiments of this application in conjunction with the specific content of the technical solution. In addition, the identification of specific steps in the following text does not represent a limitation on the order of steps and execution logic. The execution order and execution logic between each step should be understood and inferred with reference to the content described in the embodiments.
[0028] With the rapid development of drone technology, racing drones and heavy-duty industrial drones are placing higher demands on the power density and continuous load capacity of their power systems. As a core component of the drone power system, the brushless motor electronic speed controller (ESC) directly determines the overall power limit of the drone due to its continuous current carrying capacity. Against this backdrop, the four-in-one ESC, integrating four independent ESC circuits onto a single printed circuit board, offers advantages such as high integration, simple wiring, and convenient installation, making it the mainstream configuration for multi-rotor drones. However, conventional four-in-one ESC products in the industry generally adopt a four- to six-layer printed circuit board design, with the power layer often featuring a single-layer copper foil layout. This involves supplying power to multiple motor drive circuits through a single-sided input and distributed wiring. While this traditional architecture can meet the basic needs of conventional consumer drones, it has shown significant limitations in high-power applications.
[0029] The aforementioned existing technical solutions have several structural limitations. Regarding current carrying capacity, the limited cross-sectional area of a single power layer results in a continuous overcurrent capacity generally only supporting outputs in the tens of amperes range, making it difficult to meet the stable current requirements of high-power drones. Under high load conditions, this can easily lead to printed circuit board burn-out and device failure. Regarding current distribution, traditional distributed routing designs result in varying current path lengths for each output current path, causing uneven current distribution. Local current concentration leads to overheating, and the limited heat dissipation area of a single routing layer further exacerbates heat buildup, severely impacting long-term reliability. Regarding electromagnetic compatibility, existing designs lack dedicated isolation between the power and signal layers. Electromagnetic interference from high-current power loops can easily crosstalk to drive and control signal loops, causing drive signal distortion, reduced control accuracy, and in extreme cases, even motor runaway. Regarding power transmission efficiency, traditional routing designs have long current loop paths and redundant vias, resulting in high line impedance and parasitic inductance. This leads to high voltage drop losses under high current, low power conversion efficiency, and exacerbates voltage spikes and device heating during switching.
[0030] To address the aforementioned technical limitations, this technical solution aims to resolve the structural bottleneck of achieving high-current transmission in multi-channel integrated motor controllers on a single board. By redesigning the stack-up architecture and current path topology of the multilayer printed circuit board, a symmetrical dual-power-layer structure with multiplied current-carrying capacity is constructed. A radial current distribution method from the center to the edge is adopted to achieve balanced current distribution and path minimization for multiple outputs, thereby breaking through the current-carrying limit of traditional single-layer power supplies. Simultaneously, a dedicated isolation layer is placed between the power layer and the signal layer to form a physical shielding structure, suppressing electromagnetic interference from high-current power loops on control signals. Furthermore, by optimizing the current path design, reducing redundant vias, and shortening the current loops of power devices, line impedance and parasitic inductance are reduced, thereby suppressing voltage spikes during high-current switching and improving power conversion efficiency and system stability. Ultimately, through the synergistic effect of these structural improvements, the requirements of high-power UAVs for continuous high-current output, low loss, and high reliability of the ESC are met.
[0031] Multi-rotor drone technology has developed rapidly in recent years. Among them, racing drones (first-person perspective drones) have been widely used in racing competitions, aerial filming, and special operations due to their high thrust-to-weight ratio and high maneuverability. The market demand for professional racing drone operators continues to surge. Because racing drones are difficult to operate, operators need extensive training to master the skills. Real-world training has become the core training method. However, the hardware characteristics of racing drones limit the effectiveness of real-world training. High-fidelity physical simulation training tools have become a necessity in the industry, leading to the development of racing drone flight simulation technology, which has become an important research direction in the drone field.
[0032] Racing drones possess high thrust-to-weight ratios, extremely high angular velocities, and exceptionally high control sensitivity. However, the risk of crashing during live-action training is extremely high, not only causing frequent hardware damage and incurring high training costs, but also posing safety hazards to the operator and the surrounding environment. Therefore, racing drone simulators that can realistically reproduce the physics of flight have become an essential tool for operator training.
[0033] An ideal racing drone simulator must accurately reproduce the physical characteristics of the real world within a virtual environment, including aerodynamic interference, motor dynamic response, and especially flight control algorithm logic. Operators develop "muscle memory" during simulator training. If the simulator's physical model deviates from real physical laws, this "muscle memory" will completely fail during actual flight, potentially leading to flight accidents. Therefore, the accuracy of the simulator's physical simulation becomes a core indicator of its performance.
[0034] Currently, most mainstream racing drone simulators on the market are foreign products. Their core implementation logic involves writing simplified flight control algorithms within a game engine, combining this with the engine's built-in physics system, receiving remote control input, and providing feedback on the simulated flight effects to achieve virtual flight training for racing drones. The core design idea of this approach is to leverage the visualization and physics capabilities of mature game engines to simplify the realistic flight control and physical models of drones, enabling rapid simulator development and meeting basic flight training needs.
[0035] Existing foreign racing drone simulators generally suffer from logic decoupling issues in flight control and physics feedback processing, resulting in a significant reduction in simulation accuracy and an inability to reproduce the realistic feel of racing drone flight. Specific drawbacks include, but are not limited to, the following important aspects: Most simulators use a simplified proportional-integral-derivative control algorithm within their game engines. The code logic is completely different from the firmware used by real racing drones. The generated correction torque has a "linear" characteristic and cannot reflect the vibration of a racing drone under extreme maneuvers, resulting in a significant difference from the control feedback of real flight.
[0036] The physics step size of the game engine is fixed at 50Hz-60Hz, while the sampling frequency of the flight control of a real racing drone is as high as 4kHz-8kHz. The difference in magnitude between the two means that the simulator cannot capture the physical feedback changes caused by high-frequency noise, and the real-time performance and accuracy of the flight response are far lower than those of the real machine.
[0037] Simply equating the motor thrust to a force proportional to the throttle ignores the propeller's rotational inertia and the reverse current effect of the electronic speed controller during braking (electronic speed controller active braking technology), thus failing to reproduce the dynamic response characteristics of a real racing drone's power system.
[0038] The embodiments of this application aim to at least solve one of the technical problems existing in the prior art. To this end, the embodiments of this application propose a drone control simulation method, its simulator, and storage medium, which can improve the logic decoupling problem in the processing of simulated flight control and physical feedback, resulting in improved simulation accuracy and helping to reproduce the realistic flight feel of a racing drone.
[0039] The following explanation is based on the accompanying drawings.
[0040] Reference Figure 1 The drone control simulation method according to the embodiments of this application is applied to a drone control simulator. The drone control simulation method according to the embodiments of this application may include: Step S101: In the UAV control simulator, the current physical state information of the target UAV model is obtained in real time, and the remote control input signal is obtained. Step S102: Based on the remote control input signal and the current physical state information, perform flight control calculations to obtain the drive control parameters of the target UAV model corresponding to each rotation axis; Step S103: Calculate the physical torque based on the preset inertia tensor and drive control parameters corresponding to the target UAV model to obtain the rotational torque characterization parameters of the target UAV model. Step S104: Based on the remote control input signal, perform throttle input analysis to obtain the driving thrust characterization parameters of the target UAV model; Step S105: Based on the current physical state information, perform air resistance analysis to obtain the air resistance characterization parameters of the target UAV model; Step S106: Based on the rotational torque characterization parameter, driving thrust characterization parameter, and air resistance characterization parameter, perform control simulation on the target UAV model to update the current physical state information of the target UAV, return to execute the acquisition of remote control input signal, until the current physical state information triggers the preset control simulation termination condition.
[0041] The UAV control simulation method proposed in this application solves the logical decoupling problem of the isolated flight control algorithm, dynamic model, and physics engine in traditional simulators by constructing a state-driven closed-loop computational architecture. The core of this application lies in establishing a real-time feedback system with current physical state information as the hub, so that flight control calculation, physical torque calculation, dynamic thrust calculation, and air resistance calculation no longer operate as isolated modules, but are dynamically correlated based on the aircraft's state data at the same moment.
[0042] In some embodiments, step S101 involves acquiring the current physical state information of the target drone model in real time in the drone control simulator, and acquiring the remote control input signal. It should be noted that the embodiments of this application solve the logical decoupling problem existing in traditional racing drone simulators by establishing a closed-loop computing architecture. Logical decoupling refers to the design flaw in system architecture design where functional modules that should be closely related are loosely connected through simplified interfaces, resulting in independent calculations by each module and delays or distortions in data transmission. The drone control simulator refers to a software system running on a computing device, used to construct a virtual flight environment and simulate the flight characteristics of a real drone, receiving external control inputs and outputting visualized flight status. During the simulator's operation, the embodiments of this application do not treat flight control algorithms, dynamic response, and physical evolution as independent modules, but rather use the current physical state information as the core hub to construct a coupling mechanism for real-time linkage of various computational links. The current physical state information is a set of data describing the kinematic characteristics of the target drone model at a certain moment, which may include parameters such as three-dimensional spatial position, linear velocity, attitude angle, and the speed of each motor. The target drone model is a digital entity established within the drone control simulator, containing the drone's geometric parameters, mass characteristics, aerodynamic characteristics, and power configuration, serving as the object of physical calculations and state updates.
[0043] In step S101, the UAV control simulator first synchronizes the data acquisition. This embodiment acquires the current physical state information of the target UAV model in real time, while simultaneously acquiring remote control input signals from external control devices. Remote control input signals refer to operation command data from the remote controller, which can be represented in channel numerical form and may include throttle input, pitch angle command, roll angle command, and yaw rate command, reflecting the operator's real-time control intentions towards the UAV. This synchronous acquisition mechanism establishes the time reference for all subsequent calculation stages, ensuring that flight control calculations can be adjusted based on the actual dynamic feedback of the aircraft, rather than relying on a preset fixed trajectory.
[0044] In some embodiments, step S102 involves performing flight control calculations based on remote control input signals and current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis. It should be noted that step S102 performs flight control calculations, which simulates the operation of flight control software. It receives remote control input signals and current physical state information, and calculates the required adjustment amounts for each motor based on a preset control algorithm. Specifically, this embodiment does not merely perform static mapping of the remote control input signals; instead, it uses both the remote control input signals and current physical state information as input parameters, and calculates the drive control parameters for each rotation axis of the target UAV model based on a preset attitude control algorithm. The drive control parameters can be the output of the flight control calculations, representing the control command values applied to each rotation axis. These parameters are converted into motor speed adjustment commands, the magnitude of which is dynamically determined by the deviation between the current airframe attitude and the desired attitude, reflecting the control logic of a real flight control system performing closed-loop adjustments based on real-time feedback.
[0045] Reference Figure 2 According to some embodiments of this application, the world coordinate system is a coordinate system defined relative to the simulated scene in the UAV control simulator. Before step S102, which performs flight control calculations based on the remote control input signal and current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis, the following may also be included: Step S201: Extract the current angular velocity corresponding to the world coordinate system from the current physical state information; Step S202: Convert the current angular velocity to the body coordinate system to determine the local angular velocity of the aircraft corresponding to the body coordinate system; wherein, the body coordinate system is a coordinate system defined in the UAV control simulator relative to the target UAV model, and each coordinate axis of the body coordinate system corresponds to each rotation axis of the target UAV model.
[0046] In some embodiments, step S201 involves extracting the current angular velocity corresponding to the world coordinate system from the current physical state information. It should be noted that in the virtual environment of a drone control simulator, a coordinate reference system conforming to physical laws is needed to accurately reproduce the flight control logic of a real racing drone. This application's embodiment introduces a dual reference architecture of a world coordinate system and a body coordinate system. The world coordinate system is a fixed coordinate system defined relative to the simulated scene in the drone control simulator, used to describe the absolute position and attitude of the target drone model in virtual space. The body coordinate system is a dynamic coordinate system defined relative to the target drone model in the drone control simulator, with each axis corresponding to the rotational axes of the target drone model, namely the pitch axis, roll axis, and yaw axis, rotating in real time as the attitude of the target drone model changes. This coordinate system division method originates from the engineering practice of real flight control systems. Because the flight control algorithm of a racing drone can perform angular velocity sensing and control torque calculation based on the body coordinate system, while the physics engine often simulates rigid body motion in the world coordinate system, ignoring the conversion between the two coordinate systems and directly performing control calculations will lead to a misalignment of the reference base between the flight control commands and the actual dynamic response of the drone, resulting in logical decoupling.
[0047] In step S201, the current angular velocity corresponding to the world coordinate system is extracted from the current physical state information. The current physical state information contains the complete kinematic parameters of the target UAV model in the virtual environment, wherein the angular velocity data can describe the rotational motion of the body with the world coordinate system as the reference.
[0048] In some embodiments, step S202 involves converting the current angular velocity to the body coordinate system to determine the local angular velocity of the aircraft corresponding to the body coordinate system; wherein the body coordinate system is a coordinate system defined in the UAV control simulator relative to the target UAV model, and each coordinate axis of the body coordinate system corresponds to each rotation axis of the target UAV model.
[0049] It should be noted that, since subsequent flight control calculations require independent control based on the aircraft's own rotation axes, the current angular velocity needs to be converted to the aircraft coordinate system to determine the corresponding local angular velocity. This conversion can be achieved through quaternion rotation operations. Using the quaternion representation of the target UAV model's current attitude, the angular velocity vector in the world coordinate system is rotated to align with the aircraft coordinate system. The conversion formula follows the basic principles of rigid body kinematics, ensuring that the components of the angular velocity on each rotation axis accurately reflect the true local rotational state of the aircraft.
[0050] In the physics calculation process of a drone control simulator, to establish a coordinate reference system that conforms to the working logic of a real racing drone flight control system, a coordinate transformation from the world coordinate system to the body coordinate system is required. This transformation process begins by extracting the current angular velocity corresponding to the world coordinate system from the current physical state information. This current angular velocity describes the absolute rotational motion of the target drone model with the world coordinate system as the reference, including the angular velocity component about a fixed spatial axis. Since the flight control algorithm of a real racing drone is usually based on the aircraft's own rotation axis for angular velocity sensing and control calculation, the system needs to transform this current angular velocity to the body coordinate system to determine the corresponding local angular velocity of the aircraft in the body coordinate system.
[0051] The conversion formulas in some embodiments are as follows, and the local angular velocity of the body is expressed as: ; in, This parameter represents the local angular velocity of the aircraft corresponding to the body coordinate system. It describes the rotation rate of the target UAV model about its own pitch, roll, and yaw axes in the form of a three-dimensional vector. Its value reflects the rotation state of the aircraft relative to its own structure rather than relative to the simulated scene. It is the basic input for the flight control algorithm to perform angular velocity control calculations.
[0052] in, This parameter represents the current angular velocity corresponding to the world coordinate system. It also exists in the form of a three-dimensional vector, but describes the absolute rotational motion of the target UAV model relative to a fixed reference coordinate system in the simulation scene. Its components are defined along a fixed axis of the world coordinate system and are usually directly output by the physics engine or extracted from the current physical state information.
[0053] in, This represents the inverse of the quaternion describing the current attitude of the target UAV model. This inverse quaternion is equivalent to the reverse operation of attitude rotation. By performing a quaternion multiplication operation between this inverse quaternion and the current angular velocity in the world coordinate system, the absolute angular velocity vector can be rotated to align with the body coordinate system, resulting in the angular velocity components in the local body coordinate system. This transformation ensures that the angular velocity values on each rotation axis accurately reflect the local rotational state of the target UAV model around its own pitch, roll, and yaw axes, rather than its absolute rotation relative to the simulated scene.
[0054] After obtaining the local angular velocity of the machine body, the system further performs degree conversion, which is expressed as: ; in, This parameter represents the local angular velocity of the machine body after unit conversion. The unit of measurement was changed from radians per second to degrees per second to make its value conform to the measurement standards of real racing drone flight control firmware and operator cognitive habits. This function represents the conversion from radians to degrees. By multiplying the radian value by a fixed proportionality coefficient, it standardizes the angular dimension, ensuring that subsequent control gain parameters based on angular units can correctly apply to the angular velocity data, maintaining dimensional consistency in the control algorithm and accuracy in physical calculations. This conversion transforms the local angular velocity of the aircraft from radians to degrees because the proportional-integral-derivative (PID) control algorithms in real racing drone flight control firmware typically use degrees as the unit of measurement for angular velocity, and the operator's perception of the aircraft's angular velocity is also intuitively measured in degrees per second.
[0055] The local angular velocity degree representation of the airframe obtained through this conversion can provide a numerical dimension basis consistent with the real flight control system for subsequent flight control calculations. This enables the control parameter calculation based on the local angular velocity, target angular velocity, and angular velocity deviation parameters to output accurate drive control parameters, ensuring close coupling between the flight control algorithm and physical state perception.
[0056] According to some embodiments of this application, step S102 performs flight control calculations based on the remote control input signal and current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis, which may include: The control logic is analyzed based on the remote control input signal to determine the target angular velocity corresponding to each rotation axis. For each rotation axis of the target UAV model, the deviation is calculated based on the corresponding target angular velocity and local angular velocity of the body to obtain the angular velocity deviation characterization parameter; Control parameters are calculated based on the local angular velocity of the body, the target angular velocity, and the angular velocity deviation characteristic parameters to determine the driving control parameters.
[0057] In the flight control calculation stage, the embodiments of this application construct a complete closed-loop angular velocity control process through three consecutive calculation steps to ensure that the remote control input signal can be converted into drive control parameters that conform to physical laws through the actual flight control algorithm logic.
[0058] It should be noted that the embodiments of this application perform control logic parsing on the remote control input signal to determine the target angular velocity corresponding to each rotation axis. The parsing process is based on the control mode settings of the racing drone, mapping the joystick displacement of the remote controller to the desired rotation rate of the aircraft around the pitch, roll, and yaw axes, rather than directly mapping it to attitude angles or torques. This mapping method is consistent with the angular velocity control mode used in real racing drones, so that the operator inputs angular velocity commands through the joystick rather than absolute attitude, thereby restoring the command receiving logic of the real flight control system.
[0059] This embodiment of the application calculates the deviation of the target UAV model along each rotation axis based on the corresponding target angular velocity and local angular velocity of the aircraft body, thus obtaining an angular velocity deviation characterization parameter. The local angular velocity of the aircraft body is the actual angular velocity measurement value corresponding to the aircraft body coordinate system obtained through coordinate system transformation in step S202 above, while the target angular velocity is the angular velocity setting value expected by the operator. By calculating the difference between the two on each rotation axis, this embodiment of the application obtains the angular velocity deviation characterization parameter. The angular velocity deviation characterization parameter serves as an error signal in closed-loop control, accurately describing the difference between the current rotation state of the aircraft body and the desired state, providing a basis for subsequent control parameter calculations.
[0060] After obtaining the angular velocity deviation characterization parameter, this embodiment calculates control parameters based on the local angular velocity of the aircraft, the target angular velocity, and the angular velocity deviation characterization parameter to determine the drive control parameters. The calculation process can be implemented using various control algorithms, such as proportional-integral-derivative (PI-DE) control algorithms or other attitude control algorithms. The core of these algorithms is to generate control commands acting on each rotation axis based on the error signal and the current motion state, enabling the target UAV model to track the target angular velocity input by the operator. Through this control parameter calculation based on real-time state feedback, the drive control parameters generated in this embodiment accurately reflect the control logic of the actual racing drone flight control firmware, achieving tight coupling between the flight control algorithm and physical state perception, and providing precise control input for subsequent calculations of physical torque based on the inertia tensor.
[0061] Reference Figure 3 According to some embodiments of this application, the calculation of control parameters based on the local angular velocity of the body, the target angular velocity, and the angular velocity deviation characteristic parameter to determine the drive control parameters may include: Step S301: Obtain the preset proportional gain, integral gain, derivative gain, and feedforward gain; Step S302: Calculate the proportional term based on the angular velocity deviation characterization parameter and the proportional gain to obtain the proportional term parameter; Step S303: Calculate the integral term based on the cumulative value of the angular velocity deviation characterization parameter and the integral gain to obtain the integral term parameter; Step S304: Based on the rate of change of the local angular velocity of the body and the differential gain, perform differential term calculation to obtain differential term parameters; Step S305: Calculate the feedforward term based on the change in target angular velocity and the feedforward gain to obtain the feedforward term parameters; Step S306: Calculate the desired angular velocity based on the proportional, integral, differential, and feedforward parameters to obtain the drive control parameters.
[0062] In some embodiments, the calculation of control parameters involved in step S303 can be implemented using a quaternion proportional-integral-derivative control algorithm.
[0063] In some embodiments, step S301 involves obtaining a preset proportional gain, integral gain, derivative gain, and feedforward gain. It should be noted that the pre-set proportional gain, integral gain, derivative gain, and feedforward gain are obtained. These gain parameters are the core adjustment coefficients of the control algorithm. Among them, the proportional gain determines the instantaneous response strength of the system to the current error, the integral gain determines the correction strength of the system to the historical accumulated error, the derivative gain determines the predictive damping of the system to the changing trend, and the feedforward gain determines the system's ability to directly track changes in the input command. Together, they constitute a complete control parameter system. Based on the above gain parameters, the embodiments of this application calculate four independent sub-parameters respectively.
[0064] In step S302 of some embodiments, a proportional term is calculated based on the angular velocity deviation characterization parameter and the proportional gain to obtain the proportional term parameter; It should be noted that, in this embodiment of the application, the proportional term is calculated based on the angular velocity deviation characterization parameter and the proportional gain to obtain the proportional term parameter. The calculation is performed by multiplying the angular velocity deviation characterization parameter with the proportional gain to generate an instantaneous control component that is proportional to the current error.
[0065] In step S303 of some embodiments, the integral term is calculated based on the cumulative value of the angular velocity deviation characterization parameter and the integral gain to obtain the integral term parameter; It should be noted that, in this embodiment, the integral term is calculated based on the cumulative value of the angular velocity deviation characterization parameter and the integral gain to obtain the integral term parameter. The calculation is performed by integrating the angular velocity deviation characterization parameter at historical time points over time and multiplying it by the integral gain to generate the cumulative control component used to eliminate steady-state error.
[0066] In some embodiments, step S304 involves calculating differential terms based on the rate of change of the local angular velocity of the body and the differential gain, to obtain differential term parameters. It should be noted that, in this embodiment, the differential term is calculated based on the rate of change of the local angular velocity of the body and the differential gain to obtain the differential term parameter. The calculation is performed by obtaining the rate of change of the local angular velocity of the body per unit time, multiplying it by the differential gain to generate the damping control component that suppresses system oscillation.
[0067] In some embodiments, step S305 involves calculating the feedforward term based on the change in the target angular velocity and the feedforward gain to obtain the feedforward term parameters. It should be noted that, in this embodiment, the feedforward term is calculated based on the change in the target angular velocity and the feedforward gain to obtain the feedforward term parameters. The instantaneous change in the target angular velocity is then calculated and multiplied by the feedforward gain to generate a predictive control component that responds in advance to the control intention, which is used to compensate for system response lag.
[0068] In some embodiments, step S306 involves calculating the desired angular velocity based on proportional, integral, differential, and feedforward parameters to obtain the drive control parameters.
[0069] It should be noted that the desired angular velocity is calculated based on proportional, integral, differential, and feedforward parameters to obtain the drive control parameters. The calculation algebraically superimposes the four sub-parameters, so that the final drive control parameters simultaneously include corrections for current errors, compensation for historical accumulation, suppression of changing trends, and tracking of expected inputs. This fully reproduces the control logic of the actual racing drone flight control firmware, providing accurate control inputs for subsequent calculations of physical torque based on the inertia tensor.
[0070] In some more specific embodiments, the drive control parameters are calculated using a quaternion proportional-integral-derivative control algorithm. The output of this algorithm is the sum of the proportional term, integral term, derivative term, and feedforward term. The algorithm output can be expressed as: The calculation formulas and parameters for each item are as follows: Proportional term: The proportional parameter P is represented by the angular velocity deviation parameter Error and the preset proportional gain. Multiplying the results, this calculation achieves an instantaneous linear response to the deviation of the current angular velocity error from the target value, with a proportional gain. As a parameter of the proportional-integral-derivative control algorithm, the sensitivity of the system to transient errors is quantified.
[0071] Integral term: The integral term parameter I is obtained by superimposing the historical cumulative integral term value ITerm with the current error integral increment. This increment is calculated by multiplying the angular velocity deviation parameter Error, the integral gain I_Gain, and the sampling time step Δt. The integral gain I_Gain is a parameter of the proportional-integral-derivative control algorithm, the sampling time step Δt represents the time interval between two adjacent control calculations, and the cumulative integral term value ITerm represents the continuous cumulative effect of the historical angular velocity deviation, which is used to eliminate the steady-state error of the system.
[0072] Differential term (using the rate of change of angular velocity): The differential parameter D is obtained by multiplying the rate of change of the local angular velocity of the body by the differential gain D_Gain. This rate of change is obtained through... Indicates the current angular velocity Find the time derivative, which reflects the instantaneous change in angular velocity, and the differential gain. As a parameter of the proportional-integral-derivative control algorithm, it is used to provide damping to suppress system oscillations.
[0073] Feedforward term: Among them, the feedforward parameter F is the change in the target angular velocity. With feedforward gain Multiplying the values yields a change that represents the magnitude of the change in the target angular velocity setpoint per unit time, reflecting the change in the operator's control intention. (Feedforward gain) As parameters of the proportional-integral-derivative control algorithm, they are used to respond to input changes in advance and reduce system lag.
[0074] In step S103 of some embodiments, physical torque calculation is performed based on the preset inertia tensor and drive control parameters corresponding to the target UAV model to obtain the rotational torque characterization parameters of the target UAV model. It should be noted that the embodiments of this application calculate physical torque based on drive control parameters. This is a calculation process based on the principles of rigid body dynamics, combining drive control parameters with the rigid body mass distribution characteristics to calculate the torque required to change the aircraft's attitude. The process introduces a preset inertia tensor corresponding to the target UAV model. The inertia tensor describes the rigid body mass distribution characteristics; its elements reflect the rotational inertia of the UAV around each coordinate axis and the coupling between axes, and are the fundamental physical parameters for calculating the torque required for rotational motion. Based on the fundamental formula that torque equals rotational inertia multiplied by angular acceleration, the embodiments of this application convert the drive control parameters into the torque required to change the aircraft's attitude, obtaining the rotational torque characterization parameter of the target UAV model. The rotational torque characterization parameter is the numerical result output from the physical torque calculation, represented in the form of a torque vector. It describes the magnitude and direction of the torque acting on each rotation axis of the target UAV model, directly determining the angular acceleration of the aircraft, thus achieving a physical and compliant conversion from flight control electrical commands to mechanical torque.
[0075] In some more specific embodiments, the physical torque calculation process involved in step S103 corresponds to the rigid body dynamics solution stage. The physical torque calculation module receives the desired angular acceleration generated in the aforementioned steps, which is a component of the drive control parameters. The desired angular acceleration describes the expected angular acceleration values of the target UAV model around the pitch, roll, and yaw axes in the form of a three-dimensional vector, and is the output result of the angular velocity proportional-integral-derivative control algorithm. In addition, the target UAV model corresponds to a preset inertia tensor, which is used to describe the distribution characteristics of the rotational inertia of the target UAV model's mass around each coordinate axis and the inter-axis coupling, and is a fundamental physical parameter characterizing the rotational inertia of a rigid body.
[0076] Based on the above input, the system first performs local torque calculation in the body coordinate system. The calculation formula is as follows: ; in, This represents the physical torque in the local coordinate system, and the calculation is performed using the inertia tensor. With desired angular acceleration The matrix multiplication operation, based on Euler's equations for rigid body rotation, converts the desired angular acceleration output by the flight control system into the torque required to generate that angular acceleration, thus obtaining the representation of the rotational torque parameter in the local coordinate system. This calculation strictly follows the physical law that torque equals moment of inertia multiplied by angular acceleration, ensuring that the conversion from control commands to mechanical torque conforms to the laws of rigid body dynamics.
[0077] Subsequently, the local torque is transformed to the world coordinate system to adapt to the application requirements of the physics engine. The calculation formula is as follows: ; in, This represents a quaternion describing the current attitude of the target drone model. This represents the torque in the transformed world coordinate system. This coordinate transformation is achieved through quaternion multiplication, rotating the torque vector described in the body coordinate system to a fixed reference frame in the world coordinate system, ensuring that the physics engine can correctly resolve the direction of the torque under a unified global coordinate reference.
[0078] Ultimately, the world coordinate system torque, as the final form of the rotational torque parameter, is used to drive the target UAV model to generate the corresponding angular acceleration, thus achieving a close coupling between the flight control algorithm and the physical evolution.
[0079] In some embodiments, step S104 involves analyzing the throttle input based on the remote control input signal to obtain the driving thrust characterization parameters of the target UAV model. It should be noted that the embodiment of this application performs throttle input parsing on the remote control input signal. This process involves processing the throttle channel data in the remote control input signal, considering the response characteristics of the electronic speed controller and the speed establishment process of the brushless motor, and converting the throttle position into the thrust value generated by the propulsion system. This parsing yields the driving thrust characterization parameters of the target UAV model. These parameters are the output of the throttle input parsing, representing the magnitude and direction of the thrust generated by each propeller. They constitute the main power source for the UAV to generate linear acceleration in space and reflect the dynamic process of speed establishment in a real propulsion system rather than instantaneous changes.
[0080] Reference Figure 4 According to some embodiments of this application, step S104, which analyzes the throttle input based on the remote control input signal to obtain the driving thrust characterization parameters of the target UAV model, may include: Step S401: Obtain the maximum thrust value corresponding to the target UAV model; Step S402: Extract throttle input from the remote control input signal to obtain raw throttle input data; Step S403: Perform linearization compensation processing on the original throttle input data to obtain the compensated throttle control quantity; Step S404: Calculate the basic thrust based on the compensated throttle control amount and the maximum thrust value to obtain the basic thrust characterization parameters. Step S405: Perform anti-gravity compensation processing on the original throttle input data to obtain anti-gravity compensation characterization parameters; Step S406: Thrust synthesis is performed based on the basic thrust characterization parameters and the anti-gravity compensation characterization parameters to obtain the driving thrust characterization parameters.
[0081] In some embodiments, the throttle input parsing process involved in step S104 solves the problem of logical decoupling caused by the simple linear equivalence of motor thrust and throttle in traditional simulators by constructing a high-fidelity dynamic response model.
[0082] In some embodiments, step S401 involves obtaining the maximum thrust value corresponding to the target UAV model. It should be noted that the first step is to obtain the maximum thrust value corresponding to the target UAV model. The maximum thrust value serves as the physical benchmark of the power system, representing the ultimate thrust that the power unit on the target UAV model can generate at full throttle. It is the dimensional basis for all subsequent thrust calculations.
[0083] In some embodiments, step S402 involves extracting the throttle input from the remote control input signal to obtain the raw throttle input data. It should be noted that, in this embodiment of the application, throttle input is extracted from the remote control input signal to obtain raw throttle input data. The raw throttle input data can represent the real-time manipulation of the throttle channel by the operator in a normalized numerical form, reflecting the thrust output ratio desired by the operator.
[0084] In step S403 of some embodiments, linearization compensation processing is performed on the original throttle input data to obtain the compensated throttle control quantity; It should be noted that after obtaining the original throttle input data, this embodiment performs linearization compensation processing on the original throttle input data to obtain the compensated throttle control quantity. The linearization compensation processing is designed for the nonlinear characteristics of the actual racing drone's power system. The thrust output of the actual electronic governor and brushless motor combination is not a simple linear relationship with the throttle command, especially with significant nonlinear deviations in the low and high throttle ranges. By introducing a compensation algorithm to correct the original throttle input data, the compensated throttle control quantity can more accurately map the actual power output response.
[0085] In some embodiments, step S404 involves calculating the basic thrust based on the compensated throttle control amount and the maximum thrust value to obtain the basic thrust characterization parameters. It should be noted that the basic thrust is calculated based on the compensated throttle control amount and the aforementioned maximum thrust, resulting in a basic thrust characterization parameter. This parameter characterizes the theoretical thrust that the power system should generate under the current throttle command.
[0086] In some embodiments, step S405 involves performing anti-gravity compensation processing on the original throttle input data to obtain anti-gravity compensation characterization parameters. It should be noted that anti-gravity compensation processing is performed on the original throttle input data to obtain anti-gravity compensation characterization parameters. This anti-gravity compensation processing is used to compensate for attitude disturbances on the pitch axis caused by rapid throttle changes. Specifically, it calculates the rate of change of the original throttle input data and performs low-pass filtering to generate a compensation amount related to the throttle change trend. This compensation amount can provide additional thrust adjustment during drastic throttle changes, counteracting pitch disturbances caused by inertia.
[0087] In some embodiments, step S406 involves performing thrust synthesis based on the basic thrust characterization parameters and the anti-gravity compensation characterization parameters to obtain the driving thrust characterization parameters.
[0088] It should be noted that the embodiments of this application synthesize thrust based on the basic thrust characterization parameters and the anti-gravity compensation characterization parameters to obtain the driving thrust characterization parameters. The driving thrust characterization parameters comprehensively reflect the power output requirements of the target UAV model under the current control input. They include both the basic thrust required for steady-state flight and the compensation thrust required for dynamic control, thereby fully restoring the dynamic response characteristics of the real racing drone's power system and providing accurate main power input for the subsequent physics engine execution module.
[0089] According to some embodiments of the present application, performing anti-gravity compensation processing on the original throttle input data may include: The rate of change of the original throttle input data is analyzed to determine the parameter representing the rate of change of throttle. The throttle change rate parameter is filtered to remove high-frequency noise, resulting in the filtered change rate parameter. The compensation amount is calculated based on the filtered rate of change characterization parameter and the preset compensation gain to obtain the anti-gravity compensation characterization parameter.
[0090] It should be noted that in some embodiments, the purpose of performing anti-gravity compensation processing on the original throttle input data is to address the dynamic coupling problem existing in the power system of a real racing drone. When the operator rapidly changes the throttle input, the target drone model's power system response will generate nonlinear attitude disturbances, especially in the pitch axis direction. Due to changes in propeller torque and the inertia of the airframe, simple increases or decreases in thrust cannot maintain attitude stability. Anti-gravity compensation processing detects the changing trend of the throttle input and generates corresponding compensating thrust components to counteract these attitude disturbances during the dynamic process. This tightly couples the electrical response of the power system with the rigid body dynamics of the airframe, avoiding the simplified processing of throttle and attitude control being independent in traditional simulators.
[0091] The rate of change of the original throttle input data is analyzed to determine the parameter representing the rate of change of throttle. Rate of change analysis quantifies the aggression of the operator's control over the throttle channel by calculating the difference in the original throttle input data per unit time, generating the parameter representing the rate of change of throttle. This parameter represents the transient rate of change of throttle input in the form of a time derivative; a positive value indicates an increase in throttle, and a negative value indicates a decrease in throttle. Its amplitude reflects the rate of change, providing a dynamic input benchmark for subsequent compensation calculations.
[0092] Subsequently, this embodiment of the application performs filtering on the throttle change rate parameter to remove high-frequency noise, resulting in a filtered rate of change parameter. Since the remote control input signal may contain high-frequency components introduced by operator hand tremors, remote control signal transmission noise, or electromagnetic interference, directly using the original throttle change rate parameter would cause high-frequency oscillations in the compensation amount, leading to system instability. The filtering process can employ a low-pass filtering algorithm to retain the low-frequency change trend reflecting the operator's intention while suppressing high-frequency noise, ensuring that the filtered rate of change parameter smoothly and accurately represents the operator's true control trend, rather than instantaneous interference.
[0093] Finally, this embodiment calculates the compensation amount based on the filtered rate of change characterization parameter and the preset compensation gain to obtain the anti-gravity compensation characterization parameter. The compensation gain is a proportional coefficient preset according to the dynamic characteristics of the target UAV model, used to adjust the intensity of anti-gravity compensation. By multiplying the filtered rate of change characterization parameter with the compensation gain, this embodiment generates an anti-gravity compensation characterization parameter that is proportional to the throttle change trend. The parameter is expressed in the form of thrust correction value, providing additional positive thrust compensation when the throttle increases rapidly and negative compensation when the throttle decreases rapidly, thereby dynamically balancing the pitch torque disturbance caused by throttle changes and achieving tight coupling between the power system response and flight control attitude maintenance.
[0094] In some more specific embodiments, the maximum thrust obtained in step S401 corresponds to the MaxThrust parameter, and the raw throttle input data extracted in step S402 corresponds to Throttle. The linearization compensation process performed in step S403 corresponds to the following formula: ThrottleCompensated=Throttle / (1+k×(1-Throttle)²); Wherein, ThrottleCompensated is the compensated throttle control amount, and k is the compensation coefficient. This formula makes the compensation result closer to the thrust response characteristics of the actual racing aircraft power system by nonlinearly correcting the original throttle input.
[0095] Furthermore, step S404 calculates the basic thrust characterization parameters based on the compensated throttle control value and the maximum thrust value, with the corresponding formula: BaseThrust=ThrottleCompensated×MaxThrust; BaseThrust is the basic thrust characterization parameter, which represents the theoretical steady-state thrust under the current throttle command.
[0096] Furthermore, the anti-gravity compensation process in step S405 corresponds to an anti-gravity compensation mechanism, which requires the following steps: First, calculate the throttle derivative: ThrottleDerivative = (Throttle - LastThrottle) / Δt; where t corresponds to the rate of change analysis step, Δt is the sampling time step, and LastThrottle is the throttle value at the previous sampling time. Secondly, the throttle derivative is low-pass filtered to obtain the FilteredDerivative, which corresponds to the filtering process to remove high-frequency noise. Third, calculate the antigravity compensation amount; AntiGravityBoost=FilteredDerivative×Gain; where Gain is the compensation gain, and the antigravity compensation amount is used to counteract the attitude disturbance caused to the pitch axis when the throttle changes rapidly.
[0097] It should be understood that step S406 superimposes the basic thrust characterization parameter with the anti-gravity compensation characterization parameter to obtain the driving thrust characterization parameter, which corresponds to the thrust finally applied to the target UAV model, thus completing the complete mapping from throttle input to physical thrust.
[0098] In some embodiments, step S105 involves analyzing air resistance based on the current physical state information to obtain air resistance characterization parameters for the target UAV model. It should be noted that in step S105, this embodiment of the application performs air resistance analysis based on the current physical state information. This is a process of calculating aerodynamic drag based on the current physical state information. According to the UAV's velocity vector, attitude angle, geometric shape, and ambient air density, the drag effect generated by the relative motion between the UAV and the air is calculated. The process yields the air resistance characterization parameters of the target UAV model. The air resistance characterization parameters are the output results of the air resistance analysis, expressed in the form of a drag vector. The magnitude of the air resistance characterization parameters is approximately proportional to the square of the flight speed, and the direction of the air resistance characterization parameters is opposite to the direction of the airframe's linear velocity. These constitute environmental disturbance forces affecting the UAV's motion and can dynamically reflect the nonlinear increase in drag caused by speed changes and the aerodynamic shape changes caused by attitude changes.
[0099] Reference Figure 5 According to some embodiments of this application, step S105, based on the current physical state information, performs air resistance analysis to obtain air resistance characterization parameters of the target UAV model, which may include: Step S501: Extract the linear velocity of the target UAV model from the current physical state information; Step S502: Perform nonlinear drag calculation on the linear velocity of the airframe to determine the air resistance parameters of the target UAV model; wherein, the nonlinear drag calculation may include: determining the magnitude and direction of the air resistance parameters based on the product relationship between the modulus of the linear velocity and the linear velocity of the airframe.
[0100] In some embodiments, the air resistance analysis process involved in step S105 solves the problem of insufficient simulation accuracy caused by traditional simulators using constant drag coefficients or linear drag formulas by introducing a nonlinear drag model. When a real racing drone flies at high speed, air resistance is proportional to the square of the speed, and the differences in aerodynamic shape in different directions of motion result in significant directional drag characteristics. If a simplified linear model or a uniform drag coefficient is used, it is impossible to accurately reproduce the aerodynamic feedback characteristics of the racing drone in extreme maneuvers.
[0101] In some embodiments, step S501 involves extracting the linear velocity of the target drone model from the current physical state information. It should be noted that the linear velocity of the target UAV model is extracted from the current physical state information. The linear velocity is a three-dimensional vector describing the motion state of the target UAV model relative to the virtual environment's air medium. It can include forward, lateral, and vertical velocity components and is a fundamental state parameter for calculating air resistance.
[0102] In some embodiments, step S502 involves performing nonlinear drag calculations on the linear velocity of the airframe to determine the air resistance parameters of the target UAV model. The nonlinear drag calculation may include determining the magnitude and direction of the air resistance parameters based on the product of the linear velocity and the airframe linear velocity.
[0103] It should be noted that nonlinear drag calculations are performed on the airframe linear velocity to determine the air resistance parameters of the target UAV model. The core of nonlinear drag calculation lies in establishing a mathematical relationship between the magnitude of drag and the square of the velocity. Specifically, this is achieved by multiplying the magnitude of the airframe linear velocity by its magnitude to determine the magnitude and direction of the air resistance parameter. The magnitude of the airframe linear velocity, i.e., the velocity scalar value, is multiplied by the airframe linear velocity vector to generate a drag magnitude proportional to the square of the velocity, while maintaining a direction opposite to the velocity direction. This calculation method ensures that the air resistance parameter is small at low speeds and significantly increases at high speeds, conforming to real aerodynamic laws, and its direction is always opposite to the direction of motion, eliminating the need for additional direction determination logic.
[0104] In some embodiments, the nonlinear drag calculation can be further extended to a three-axis independent drag model. That is, for the components of the aircraft's linear velocity in the forward, lateral, and vertical directions, independent drag coefficients are applied for nonlinear calculation to recreate the differences in aerodynamic drag characteristics caused by variations in the aircraft's shape in different motion directions. In this way, the air resistance parameters generated in this embodiment can accurately reflect the aerodynamic disturbance effects of the target UAV model in the virtual environment, providing realistic environmental disturbance force input to the subsequent physics engine execution module, and realizing the correlation between the aircraft's motion state and environmental physics feedback.
[0105] Reference Figure 6 According to some embodiments of this application, step S502, which performs nonlinear drag calculation on the linear velocity of the airframe to determine the air resistance characterization parameters of the target UAV model, may include: Step S601: For each coordinate axis direction of the body coordinate system corresponding to the target UAV model, extract the corresponding axial linear velocity component from the body linear velocity. Step S602: Configure the corresponding axial drag coefficient for each axial linear velocity component; Step S603: For each coordinate axis of the body coordinate system, the axial air resistance components in each coordinate axis direction are calculated based on the product relationship between the axial linear velocity component, the magnitude of the axial linear velocity component, and the corresponding axial drag coefficient. Step S604: Perform vector synthesis for each axial air resistance component to determine the air resistance characterization parameters.
[0106] In step S601 of some embodiments, for each coordinate axis direction of the body coordinate system corresponding to the target UAV model, the corresponding axial linear velocity component is extracted from the linear velocity of the body. It should be noted that, for each coordinate axis of the target UAV model's body coordinate system, the corresponding axial linear velocity components are extracted from the body linear velocity. Since the target UAV model has different geometric shapes and aerodynamic characteristics along each coordinate axis, for example, it may have a streamlined shape along the pitch axis, while it may have a large frontal area along the roll and yaw axes, it is necessary to decompose the three-dimensional vector of body linear velocity into axial linear velocity components corresponding to each coordinate axis. This allows for independent drag calculations for aerodynamic characteristics in different directions, thereby accurately reproducing the aerodynamic differences of the target UAV model in different flight directions.
[0107] In step S602 of some embodiments, a corresponding axial drag coefficient is configured for each axial linear velocity component; It should be noted that corresponding axial drag coefficients are configured for each axial linear velocity component. Because the aerodynamic shape of the target UAV model differs significantly along different coordinate axes of the body coordinate system, the air drag characteristics in each direction are not the same. Therefore, independent axial drag coefficients need to be set for the axial linear velocity components in different directions, such as forward, lateral, and vertical. These axial drag coefficients are pre-set proportionality constants based on the geometric parameters and aerodynamic characteristics of the target UAV model. They are used to quantify the physical relationship between velocity changes and drag generation in each direction, ensuring that subsequent calculations can reflect the differentiated aerodynamic drag of a real racing drone in different motion directions.
[0108] In step S603 of some embodiments, for each coordinate axis direction of the body coordinate system, the axial air resistance component of each coordinate axis direction is calculated based on the product relationship between the axial linear velocity component, the magnitude of the axial linear velocity component and the corresponding axial drag coefficient. It should be noted that, for each coordinate axis of the airframe coordinate system, the axial air drag components are calculated based on the product of the axial linear velocity component, its magnitude, and the corresponding axial drag coefficient. The calculation process establishes a non-linear relationship between drag magnitude and the square of velocity by multiplying the axial linear velocity component by its magnitude. This is then multiplied by the corresponding axial drag coefficient to generate the axial air drag components along the coordinate axis. This calculation method ensures that the drag magnitude in each direction exhibits a quadratic growth characteristic with velocity, while maintaining the opposite direction to the axial linear velocity component, thus accurately reproducing the physical law in real aerodynamics that drag is proportional to the square of velocity.
[0109] In some embodiments, step S604 involves vector synthesis of each axial air resistance component to determine air resistance characterization parameters.
[0110] It should be noted that vector synthesis is performed on the air resistance components along each axis to determine the air resistance characterization parameter. After calculating the axial air resistance components along each coordinate axis of the aircraft coordinate system, this embodiment synthesizes these components according to the principle of vector superposition to generate a complete air resistance characterization parameter. The air resistance characterization parameter is represented in the form of a three-dimensional drag vector. Its magnitude and direction comprehensively reflect the overall effect of air resistance experienced by the target UAV model under the current linear velocity state, providing accurate input of environmental disturbance forces for the subsequent physics engine execution module, and realizing a tight coupling between the aircraft's motion state and environmental physical feedback.
[0111] In some more specific embodiments, corresponding to the calculation process of the split-axis nonlinear drag established in steps S601 to S604, the core formula of the nonlinear air drag model can be expressed as: ; in, This represents the air resistance parameter ultimately applied to the target UAV model. The air resistance parameter describes the total resistance effect of the ambient air on the motion of the aircraft in the form of a three-dimensional drag vector.
[0112] Among them, parameters Corresponding to the axial drag coefficient configured for each axial linear velocity component in step S602, this coefficient is a proportional constant independently set for each coordinate axis direction of the target UAV model in the body coordinate system. Since the target UAV model has different aerodynamic shape characteristics in the forward, lateral and vertical directions, the system sets independent axial drag coefficients for these three directions to accurately reproduce the differences in aerodynamic characteristics in different motion directions.
[0113] Among them, parameters This corresponds to the axial linear velocity component extracted from the body linear velocity in step S601, and The magnitude of the linear velocity component corresponding to that axis, i.e., the magnitude of the velocity scalar.
[0114] It should be understood that the calculation performed in step S603 is precisely the core operation of this formula. In its specific implementation, this product relationship ensures that the magnitude of drag is proportional to the square of the velocity, reflecting the physical law that nonlinear drag increases with velocity in real aerodynamics. The negative sign in the formula indicates that the direction of drag is opposite to the direction of motion, that is, the direction of the air drag parameter is always opposite to the direction of the axial linear velocity component, which is consistent with the vector direction processing logic implicit in step S603.
[0115] Furthermore, step S604 performs vector synthesis on the air resistance components of each axis, combining the resistance components calculated in the forward, lateral, and vertical directions into a complete air resistance characterization parameter according to the principle of vector superposition. The air resistance characterization parameter calculated by this nonlinear air resistance model is applied to the physical model of the drone as an environmental disturbance force, participating in the rigid body dynamics evolution together with the rotational torque characterization parameter and the driving thrust characterization parameter, thereby achieving a high-fidelity simulation of the aerodynamic disturbance effect of the target drone model in the virtual environment.
[0116] In some embodiments, step S106 involves performing a control simulation on the target UAV model based on rotational torque characterization parameters, driving thrust characterization parameters, and air resistance characterization parameters to update the current physical state information of the target UAV, returning to execute the acquisition of remote control input signals, until the current physical state information triggers a preset control simulation termination condition.
[0117] It should be noted that the execution of control simulation is a process of updating the current physical state information of the target UAV model by integrating the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter through rigid body dynamics integral calculation, thereby realizing the motion evolution of the UAV in the virtual environment.
[0118] Specifically, in some more concrete embodiments, the obtained rotational torque characterization parameter, the obtained driving thrust characterization parameter, and the obtained air resistance characterization parameter can be vector-synthesized. These three parameters correspond to control torque, active force, and environmental disturbance force, respectively. In this embodiment, the kinematic parameters of the target UAV model in the next time step are calculated by comprehensively considering the real-time effects of the three through integral calculation, thereby updating the current physical state information of the target UAV model. The updated current physical state information is fed back to the input end in real time, and the operation of acquiring remote control input signals is resumed, forming a continuously iterative closed-loop calculation architecture. This ensures that flight control output, motor response, airframe rotation, and environmental disturbances interact and constrain each other within the same time step. This process continues until the current physical state information triggers a preset control simulation termination condition. The control simulation termination condition refers to the criteria for determining whether the simulation process has ended, such as the UAV colliding with the ground or exceeding the preset flight boundary. Through this multi-physics coupled calculation method, a high-fidelity reproduction of the real UAV flight feel is achieved.
[0119] Reference Figure 7 According to some embodiments of this application, step S106, which involves simulating the manipulation of the target drone model to update the current physical state information of the target drone, may include: Step S701: Perform flight mode trigger detection based on the current physical state information to determine the current flight mode of the target UAV model; Step S702: Based on the current flight mode, determine the corresponding target control simulation strategy from a variety of preset control simulation strategies; Step S703: Based on the target control simulation strategy, differentiated torques are applied to the rotational torque characterization parameter, driving thrust characterization parameter, and air resistance characterization parameter to update the current physical state information.
[0120] In some embodiments, step S701 involves performing flight mode trigger detection based on current physical state information to determine the current flight mode of the target drone model. It should be noted that flight mode trigger detection is performed based on the current physical state information to determine the current flight mode of the target UAV model. The process involves real-time monitoring of the target UAV model's kinematic parameters and control inputs to determine the control logic state to be activated. Specifically, this embodiment extracts key parameters such as angular velocity, attitude angle, and linear velocity from the current physical state information, combines them with the activity level of the remote control input signal, and compares them with preset threshold conditions: when the detected angular velocity exceeds the preset threshold and the control input is below a set level, a crash recovery mode is triggered; when the detected aircraft is in an inverted attitude and in an uncontrolled fall, a roll recovery mode is triggered; when the above special conditions are not met, the normal flight mode is maintained. This dynamic detection mechanism ensures that the target UAV model can automatically switch to the corresponding control logic according to the real-time flight state, rather than relying on manual selection by the operator, thereby achieving automatic response to abnormal flight states.
[0121] In some embodiments, step S702 involves determining a corresponding target control simulation strategy from a variety of preset control simulation strategies based on the current flight mode. It should be noted that, based on the current flight mode, a corresponding target control simulation strategy is determined from a variety of preset control simulation strategies. The preset control simulation strategies include a standard physics integration strategy suitable for normal flight mode, a damping torque application strategy suitable for crash recovery mode, and a directional rollover and reverse thrust strategy suitable for rollover recovery mode. The standard physics integration strategy directly performs vector synthesis and integration calculations on the rotational torque characterization parameter, driving thrust characterization parameter, and air resistance characterization parameter according to conventional rigid body dynamics equations. The damping torque application strategy, based on the standard physics calculation, introduces an additional damping torque opposite to the current angular velocity direction to suppress infinite rotation by rapidly dissipating rotational kinetic energy. The directional rollover and reverse thrust strategy reconfigures the torque and thrust application logic, calculating a specific rollover torque and reversing the motor thrust direction to drive the inverted fuselage back to upright. In this embodiment, based on the current flight mode determined in step S701, the corresponding target control simulation strategy is called from the above-mentioned strategy library, providing clear calculation rules for the subsequent application of physical quantities.
[0122] In some embodiments, step S703 involves applying differentiated torques to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter based on the target control simulation strategy, in order to update the current physical state information.
[0123] It should be noted that, based on the target control simulation strategy, differentiated torques are applied to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information. The execution phase, according to the definition of the selected target control simulation strategy, performs specific vector operations and synthesis on the three physical characterization parameters calculated in the preceding steps. In normal flight mode, this embodiment directly applies the rotational torque characterization parameter to the center of mass of the target UAV model, driving attitude changes; applies the driving thrust characterization parameter along the vertical axis of the body coordinate system, generating linear acceleration; and applies the air resistance characterization parameter as an external environmental force, hindering motion. In crash recovery mode, this embodiment additionally calculates a damping torque and superimposes it on the rotational torque characterization parameter to accelerate angular velocity decay. In rollover recovery mode, this embodiment calculates a specific rollover torque based on the attitude error to replace or correct the rotational torque characterization parameter, and applies the driving thrust characterization parameter in reverse. Through rigid body dynamics integral calculation, this embodiment calculates the acceleration and angular acceleration of the target UAV model in the next time step based on the synthesized force and torque, and then updates the position, linear velocity, attitude angle and angular velocity and other parameters in the current physical state information to complete a complete physical state evolution.
[0124] Reference Figure 8 According to some embodiments of this application, step S701, which involves flight mode trigger detection based on current physical state information to determine the current flight mode of the target drone model, may include: Step S801: Detect the current flight status of the target UAV model based on the current physical state information; Step S802: In response to detecting that the current flight state is a falling inverted state, the current flight mode is determined to be the flip recovery mode; In step S703, based on the target control simulation strategy, differentiated torques are applied to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information. This may include: Based on the target manipulation simulation strategy corresponding to the flip-recovery mode, perform the following operations: Step S803: Obtain the propeller arm length and maximum thrust corresponding to the target UAV model; Step S804: Perform single-axis locking and dead-zone processing on the remote control input signal to obtain the flip-back control command; Step S805: Calculate the overturning torque based on the overturning return control command, propeller arm length, and maximum thrust to obtain the overturning recovery torque; Step S806: Drive the target UAV model to flip back to the right position based on the flip recovery torque, so as to update the current physical state information.
[0125] In some embodiments, step S801 involves detecting the current flight state of the target drone model based on current physical state information. It should be noted that the current flight state of the target drone model is detected based on the current physical state information. The steps involve reading the current physical state information of the target drone model, extracting kinematic parameters such as attitude angles, angular velocities, and linear velocities, and determining whether the drone is in an abnormal state of falling and inversion. Specifically, this embodiment detects the attitude relationship between the drone's coordinate system and the world coordinate system. When the pitch angle or roll angle exceeds the normal flight range and approaches an inverted state, it simultaneously detects that the vertical velocity vector is pointing downwards and the altitude is continuously decreasing, comprehensively determining whether the target drone model meets the criteria for falling and inversion.
[0126] In some embodiments, step S802, in response to detecting that the current flight state is a fall-inverted state, determines the current flight mode as a roll-back recovery mode; It should be noted that, in response to the detection of a falling inverted state, the current flight mode is determined to be the roll recovery mode. When the system determines that the target drone model is in a falling inverted state, it automatically switches the current flight mode from normal flight mode to roll recovery mode. Roll recovery mode is an emergency control mode specifically designed to handle the inverted attitude of the aircraft during a fall. By applying a specific roll torque and reverse thrust, it drives the target drone model to rotate around a specific axis of the aircraft coordinate system to achieve uprighting and prevent the aircraft from continuing to fall inverted and impacting the ground.
[0127] In some embodiments, step S803 involves obtaining the propeller arm length and maximum thrust value corresponding to the target UAV model. It should be noted that the following operations are performed based on the target control simulation strategy corresponding to the rollover recovery mode. The target control simulation strategy corresponding to the rollover recovery mode is a special physical simulation logic that differs from the normal flight mode. The target control simulation strategy defines the application methods and calculation rules of the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to adapt to the nonlinear dynamic characteristics of the airframe in the inverted state, ensuring that controllable attitude recovery can still be achieved through a specific torque combination under abnormal attitude conditions. The propeller arm length and maximum thrust corresponding to the target UAV model are obtained in 803. The propeller arm length is a key physical parameter describing the geometry of the target UAV model, representing the vertical distance from the propeller rotation center to the airframe's center of mass. This parameter determines the magnitude of the lever arm that generates the rollover torque. The maximum thrust is the performance limit parameter of the target UAV model's power system, representing the maximum thrust that the motor can generate at full throttle. These two parameters together constitute the physical basis for calculating the torque required for rollover recovery.
[0128] In some embodiments, step S804 involves performing single-axis locking and dead-zone processing on the remote control input signal to obtain a flip-back-to-center control command. It should be noted that single-axis locking and dead-zone processing are performed on the remote control input signal to obtain the flip-to-center control command. In the flip-to-center mode, this embodiment performs specific input processing on the remote control input signal: single-axis locking is used to limit the operator's control input in the non-centering direction, retaining only the effective component for controlling the flip axis, and avoiding control confusion caused by simultaneous input from multiple axes; dead-zone processing is used to filter out small jitter or noise signals near the neutral position of the joystick, ensuring that only clear control intentions exceeding the threshold are recognized as valid flip-to-center control commands.
[0129] In some embodiments, step S805 involves calculating the overturning torque based on the overturning return control command, the propeller arm length, and the maximum thrust, to obtain the overturning recovery torque. It should be noted that the rollback torque is calculated based on the rollback-to-right control command, propeller arm length, and maximum thrust. In this embodiment, the rollback power ratio is calculated based on the amplitude of the rollback-to-right control command. Combined with the propeller arm length and maximum thrust, the magnitude of the rollback torque is calculated using the physical formula that torque equals force multiplied by the lever arm. The calculation process considers the mass distribution characteristics of the target UAV model in its inverted state. The generated rollback torque is proportional to the intensity of the rollback intention input by the operator, while being limited by the physical output limits of the power system.
[0130] According to some embodiments of this application, step S805, which calculates the rollover torque based on the rollover return control command, the propeller arm length, and the maximum thrust, to obtain the rollover recovery torque, may include: The flip power is analyzed based on the flip-to-right control command to determine the flip power percentage. The basic overturning torque is obtained by multiplying the maximum thrust, the propeller arm length, and the overturning power percentage. Extract the current angular velocity of the target UAV model from the current physical state information, and determine the angular velocity decay factor based on the current angular velocity; The basic overturning torque is attenuated and corrected based on the angular velocity attenuation factor in order to determine the overturning recovery torque.
[0131] It should be noted that entering the flip recovery mode corresponds to step S701, after the flight mode trigger detection is determined to be in a falling inverted state based on the current physical state information, step S802 determines the current flight mode as the flip recovery mode, and step S803 starts the subsequent operation sequence based on the target control simulation strategy corresponding to the flip recovery mode. The flight mode management module sends mode commands to the physical torque calculation module and the thrust calculation module through this process.
[0132] The joystick input is acquired and processed in step S804. After receiving the remote control input signal, the input processing module performs single-axis locking and dead-zone processing, retaining only the valid input for flipping back to center and filtering out invalid interference signals to obtain the flipping back to center control command.
[0133] The calculation of the overturning power and the basic overturning torque corresponds to the first half of step S805. First, the overturning power is analyzed based on the overturning and returning control command to determine the overturning power ratio. This overturning power ratio corresponds to PowerPercent in the formula, which represents the overturning intensity ratio input by the operator. Then, the basic overturning torque is obtained by multiplying the maximum thrust, the propeller arm length, and the overturning power ratio. This calculation corresponds to the formula LocalTorque=MaxThrust×ArmLength×PowerPercent, where MaxThrust corresponds to the maximum thrust obtained in step S803, representing the ultimate output capability of the power system, ArmLength corresponds to the propeller arm length obtained in step S803, representing the lever arm size that generates torque, and PowerPercent is the aforementioned overturning power ratio. The product of the three values yields the torque reference value under ideal conditions.
[0134] The angular velocity decay processing corresponds to the latter half of step S805. The current angular velocity of the target UAV model is extracted from the current physical state information. An angular velocity decay factor is determined based on the current angular velocity. This angular velocity decay factor corresponds to RateAttenuator in the formula, which is a function value that decreases as the amplitude of the current angular velocity increases. Then, the basic flipping torque is decayed and corrected based on the angular velocity decay factor to determine the final flipping recovery torque. The decay function RateAttenuator=f(CurrentAngularRate) is applied, where CurrentAngularRate is the current angular velocity extracted from the current physical state information, and f represents the preset decay function relationship.
[0135] In some embodiments, step S806 involves driving the target drone model to flip back to its original position based on the flipping recovery torque, in order to update the current physical state information.
[0136] It should be noted that the target UAV model is driven to flip back to its normal position based on the roll-restoring torque, thereby updating the current physical state information. In this embodiment, the calculated roll-restoring torque is applied to the center of mass of the target UAV model, driving the body to rotate around the corresponding axis of the body coordinate system to achieve attitude restoration; simultaneously, a specific thrust configuration strategy is employed to enable the target UAV model to complete the roll maneuver. Through rigid body dynamics integral calculations, this embodiment calculates the angular acceleration and attitude change of the target UAV model in the next time step based on the applied roll-restoring torque, thereby updating parameters such as attitude angle and angular velocity in the current physical state information until the body returns to its normal flight attitude.
[0137] According to some embodiments of this application, after step S806 drives the target UAV model to flip back to its original position based on the flipping recovery torque, the following may also be included: Perform homing state detection based on current physical state information; In response to the detection that the target drone model has returned to normal flight attitude, the recovery mode will be flipped and the normal flight mode will be switched. In response to the detection that the target drone model has not returned to its normal flight attitude, the system returns to the execution of the flip torque calculation based on the flip-back control command, propeller length, and maximum thrust, so as to continuously adjust the flip recovery torque until the target drone model returns to its normal flight attitude.
[0138] It should be noted that the return-to-normal state detection is performed based on the current physical state information. After applying the roll recovery torque, this embodiment monitors the attitude change of the target UAV model in real time, extracts attitude angle data from the current physical state information, and determines whether the pitch and roll angles of the body coordinate system relative to the world coordinate system have returned to the threshold range of normal flight attitude. The return-to-normal state detection quantitatively assesses whether the target UAV model has completed the transition from the inverted state to the normal attitude by comparing the current attitude angles with the preset normal attitude judgment criteria, providing a decision basis for subsequent mode switching or continuous adjustment.
[0139] Upon detecting that the target drone model has returned to its normal flight attitude, the system will switch from the roll recovery mode to normal flight mode. When the system determines that the pitch and roll angles of the target drone model have returned to the allowable range of normal flight attitude, and the airframe stability meets preset conditions, the control logic of the roll recovery mode will automatically terminate, and the current flight mode will be switched to normal flight mode. This switch restores the system to the standard flight control calculation process, resuming control based on the conventional proportional-integral-derivative (PIC) control algorithm and physical torque calculations, ensuring that the target drone model receives conventional flight control commands in its normal attitude.
[0140] In response to the detection that the target UAV model has not returned to its normal flight attitude, the system returns to the calculation of the roll recovery torque based on the roll-back control command, propeller arm length, and maximum thrust. This calculation is continuously adjusted until the target UAV model returns to its normal flight attitude. If the system determines that the target UAV model is still in an inverted attitude or its attitude angle is not within the normal range, the process returns to the roll recovery torque calculation stage. The roll recovery torque is recalculated based on the latest roll-back control command, propeller arm length, and maximum thrust. Simultaneously, the angular velocity decay factor is adjusted according to the updated current physical state information to generate a corrected roll recovery torque, which is then applied. This closed-loop control mechanism ensures that the system continuously monitors the attitude recovery progress and dynamically adjusts the control output until the target UAV model finally returns to its normal flight attitude, achieving complete closed-loop control of the roll recovery process.
[0141] In some embodiments, after obtaining the flip-restoring torque, a flip-restoring torque and a reverse thrust can be further applied. The physics engine execution module applies the flip-restoring torque calculated above to the target UAV model, and at the same time, in conjunction with the reverse thrust output, jointly drives the target UAV model to start flipping back to the right position.
[0142] The alignment detection and mode exit or loop correspond to the alignment status detection step based on the current physical state information. The flight status sampling module detects the attitude in real time. If the normal flight attitude has been restored, the flight mode management module switches the system to the normal flight mode and exits the roll recovery mode. If the attitude has not been restored, the roll torque calculation step is re-executed and the adjustment continues until the attitude is aligned.
[0143] Reference Figure 9 According to some embodiments of this application, step S701, which performs flight mode trigger detection based on current physical state information to determine the current flight mode of the target UAV model, may further include: Step S901: In response to detecting that the current flight state is an impending crash state, the current flight mode is determined to be crash recovery mode; In step S703, based on the target control simulation strategy, differentiated torques are applied to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information. This may include: Step S902: Based on the target control simulation strategy corresponding to the crash recovery mode, extract the current angular velocity of the target UAV model from the current physical state information; Step S903: Calculate the damping torque based on the current angular velocity and the preset damping deceleration rate to obtain the crash damping torque; Step S904: Apply a crash damping torque to the target drone model to suppress the rotational motion of the target drone model and update the current physical state information.
[0144] In some embodiments, step S901, in response to detecting that the current flight state is an impending crash state, determines the current flight mode as a crash recovery mode; It should be noted that, in response to the detection that the current flight state is about to crash, the current flight mode is determined to be crash recovery mode. By analyzing parameters such as angular velocity, attitude angle, and control input in the current physical state information, it identifies whether the target UAV model is in a critical state of uncontrolled rotation and about to hit the ground. Specific judgment conditions include angular velocity exceeding a preset threshold and remote control input signal being lower than a set level, indicating that the aircraft is in uncontrolled high-speed rotation. When the system confirms that the judgment criteria for an impending crash are met, it automatically switches the current flight mode from normal flight mode to crash recovery mode. Crash recovery mode is specifically used to solve the problem of infinite rotation caused by the physical calculation characteristics in the simulator environment, and prevents the aircraft from continuing to lose control by actively applying damping intervention.
[0145] In step S902 of some embodiments, the current angular velocity of the target UAV model is extracted from the current physical state information based on the target control simulation strategy corresponding to the crash recovery mode. It should be noted that, based on the target control simulation strategy corresponding to the crash recovery mode, the current angular velocity of the target UAV model is extracted from the current physical state information. After determining that the crash recovery mode has been entered, the real-time angular velocity data of the target UAV model in the world coordinate system or body coordinate system is read from the current physical state information, including the angular velocity components about the pitch, roll, and yaw axes. The current angular velocity serves as the basic input for calculating the damping torque, reflecting the actual rotational kinetic energy level of the aircraft in a runaway state, providing an accurate kinematic reference for subsequent calculations.
[0146] In some embodiments, step S903 involves calculating the damping torque based on the current angular velocity and a preset damping deceleration rate to obtain the crash damping torque. It should be noted that the crash damping moment is calculated based on the current angular velocity and a preset damping deceleration rate. The process follows the damping principle in rigid body dynamics, multiplying the extracted current angular velocity by the preset damping deceleration rate and combining this with the inertia tensor of the target UAV model to generate a crash damping moment opposite to the current rotation direction. The preset damping deceleration rate is an attenuation coefficient set according to the physical characteristics of the target UAV model and the simulation stability requirements. This calculation process ensures that the magnitude of the generated crash damping moment is proportional to the current angular velocity, and that the magnitude of the crash damping moment is opposite to the rotation direction, thus effectively dissipating the rotational kinetic energy of the aircraft.
[0147] In some more specific embodiments, when the drone's angular velocity is detected to exceed a preset threshold and the remote control input is less than a set value, a crash recovery mode is triggered. This step determines the current flight state as an impending crash state and switches to crash recovery mode to solve the infinite rotation problem unique to simulators.
[0148] Extract the current angular velocity of the target drone model from the current physical state information; Furthermore, the physics torque calculation module calculates the damping torque based on the current angular velocity, deceleration rate, and inertia tensor. The corresponding formula for calculating the damping torque is expressed as follows: DampingTorque=-AngularVelocity×DecelerationRate×InertiaTensor; Among them, AngularVelocity represents the real-time rotation rate of the target UAV model in the body coordinate system or world coordinate system; the preset damping deceleration rate corresponds to the DecelerationRate in the formula, which represents the proportional coefficient of the attenuation intensity; the inertia tensor corresponds to the InertiaTensor in the formula, that is, the preset inertia tensor of the target UAV model, which describes the rotational inertia of the mass distribution; the negative sign in the formula indicates that the direction of the damping torque is opposite to the direction of the angular velocity; the calculated DampingTorque is the crash damping torque.
[0149] In some embodiments, step S904 involves applying a crash damping torque to the target drone model to suppress its rotational motion and update its current physical state information.
[0150] It should be noted that a crash damping torque is applied to the target drone model to suppress its rotational motion and update the current physical state information. The calculated crash damping torque is applied to the center of mass of the target drone model via the physics engine execution module, driving the body to generate angular acceleration opposite to the current rotation direction. Through rigid body dynamics integration, this embodiment calculates the angular velocity change for the next time step based on the applied crash damping torque and the inertia tensor of the target drone model, updating the angular velocity parameters in the current physical state information. This process is iterated until the angular velocity drops below a preset threshold, thereby quickly suppressing the rotational motion of the target drone model and eliminating the infinite rotation phenomenon unique to simulators.
[0151] Reference Figure 10 , Figure 10 This illustration shows another embodiment of a drone control simulator, which may include: The processor 1001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 1002 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called and executed by the processor 1001 using the drone control simulation method of the embodiments of this application. Input / output interface 1003 is used to implement information input and output; The communication interface 1004 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1005 transmits information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004); The processor 1001, memory 1002, input / output interface 1003 and communication interface 1004 are connected to each other within the device via bus 1005.
[0152] This application also provides a computer program product, which includes a computer program. The processor of a computer device reads and executes the computer program, causing the computer device to perform the aforementioned drone control simulation method.
[0153] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “including,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.
[0154] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0155] It should be understood that in the description of the embodiments of this application, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.
[0156] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0157] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0158] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0159] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this disclosure, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium may include: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code.
[0160] It should also be understood that the various implementation methods provided in this application can be combined arbitrarily to achieve different technical effects.
[0161] The above is a detailed description of the embodiments of this disclosure. However, this disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this disclosure. All such equivalent modifications or substitutions are included within the scope defined by the claims of this disclosure.
Claims
1. A method for simulating the operation of a drone, characterized in that, The method, applied to a drone control simulator, includes: The current physical state information of the target drone model is acquired in real time in the drone control simulator, and the remote control input signal is also acquired. Flight control calculations are performed based on the remote control input signal and the current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis; Physical torque calculations are performed based on the preset inertia tensor corresponding to the target UAV model and the drive control parameters to obtain the rotational torque characterization parameters of the target UAV model. Based on the remote control input signal, the throttle input is analyzed to obtain the driving thrust characterization parameters of the target UAV model; Based on the current physical state information, air resistance is analyzed to obtain the air resistance characterization parameters of the target UAV model; Based on the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter, the target UAV model is simulated for control, so as to update the current physical state information of the target UAV, and return to the process of acquiring the remote control input signal until the current physical state information triggers the preset control simulation termination condition.
2. The UAV control simulation method according to claim 1, characterized in that, The world coordinate system is a coordinate system defined relative to the simulated scene in the UAV control simulator. Before performing flight control calculations based on the remote control input signal and the current physical state information to obtain the drive control parameters of the target UAV model corresponding to each rotation axis, the following steps are also included: Extract the current angular velocity corresponding to the world coordinate system from the current physical state information; The current angular velocity is converted to the body coordinate system to determine the local angular velocity of the aircraft corresponding to the body coordinate system; wherein, the body coordinate system is a coordinate system defined in the UAV control simulator relative to the target UAV model, and each coordinate axis of the body coordinate system corresponds to each rotation axis of the target UAV model.
3. The UAV control simulation method according to claim 1, characterized in that, The step of analyzing the throttle input based on the remote control input signal to obtain the driving thrust characterization parameters of the target UAV model includes: Obtain the maximum thrust value corresponding to the target UAV model; Throttle input is extracted from the remote control input signal to obtain the raw throttle input data; The original throttle input data is linearized and compensated to obtain the compensated throttle control quantity. Based on the compensated throttle control amount and the maximum thrust value, the basic thrust is calculated to obtain the basic thrust characterization parameters. The original throttle input data is subjected to anti-gravity compensation processing to obtain anti-gravity compensation characterization parameters; The driving thrust characterization parameters are obtained by performing thrust synthesis based on the basic thrust characterization parameters and the antigravity compensation characterization parameters.
4. The UAV control simulation method according to claim 3, characterized in that, The anti-gravity compensation processing of the original throttle input data includes: The rate of change of the original throttle input data is analyzed to determine the parameter representing the rate of change of throttle. The throttle change rate parameter is filtered to remove high-frequency noise, resulting in a filtered change rate parameter. The compensation amount is calculated based on the filtered rate of change characterization parameter and the preset compensation gain to obtain the anti-gravity compensation characterization parameter.
5. The UAV control simulation method according to claim 1, characterized in that, The air resistance analysis based on the current physical state information yields air resistance characterization parameters for the target UAV model, including: Extract the linear velocity of the target UAV model from the current physical state information; Nonlinear drag calculation is performed on the linear velocity of the aircraft body to determine the air resistance characterization parameters of the target UAV model; wherein, the nonlinear drag calculation includes: determining the magnitude and direction of the air resistance characterization parameters based on the product relationship between the magnitude of the linear velocity of the aircraft body and the linear velocity of the aircraft body.
6. The UAV control simulation method according to claim 1, characterized in that, The step of simulating the operation of the target drone model to update the current physical state information of the target drone includes: Flight mode trigger detection is performed based on the current physical state information to determine the current flight mode of the target drone model; Based on the current flight mode, a corresponding target control simulation strategy is determined from a variety of preset control simulation strategies; Based on the target control simulation strategy, differentiated torques are applied to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information.
7. The UAV control simulation method according to claim 6, characterized in that, The step of performing flight mode trigger detection based on the current physical state information to determine the current flight mode of the target drone model includes: The current flight state of the target UAV model is detected based on the current physical state information; In response to detecting that the current flight state is a fall-inverted state, the current flight mode is determined to be a flip recovery mode; The target control simulation strategy involves applying differentiated torques to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information, including: Based on the target manipulation simulation strategy corresponding to the flip recovery mode, perform the following operations: Obtain the propeller arm length and maximum thrust corresponding to the target UAV model; The remote control input signal is subjected to single-axis locking and dead zone processing to obtain the flip-back control command; Based on the flip-back control command, the propeller arm length, and the maximum thrust, the flip torque is calculated to obtain the flip recovery torque. The target UAV model is flipped back to its original position based on the flipping recovery torque, so as to update the current physical state information.
8. The UAV control simulation method according to claim 6, characterized in that, The step of performing flight mode trigger detection based on the current physical state information to determine the current flight mode of the target UAV model further includes: In response to detecting that the current flight state of the target drone model is about to crash, the current flight mode is determined to be a crash recovery mode; The target control simulation strategy involves applying differentiated torques to the rotational torque characterization parameter, the driving thrust characterization parameter, and the air resistance characterization parameter to update the current physical state information, including: Based on the target control simulation strategy corresponding to the crash recovery mode, the current angular velocity of the target UAV model is extracted from the current physical state information; The damping torque is calculated based on the current angular velocity and the preset damping deceleration rate to obtain the crash damping torque; The crash damping torque is applied to the target drone model to suppress its rotational motion and update the current physical state information.
9. A drone control simulator, characterized in that, include: The device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the unmanned aerial vehicle (UAV) control simulation method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The storage medium stores a program that is executed by a processor to implement the drone control simulation method as described in any one of claims 1 to 8.