Universal visual flight simulation system
By combining Python and Unreal Engine, a general visual flight simulation system was built, which solved the limitations of the existing technology in aircraft configuration, control parameter adjustment and simulation operation efficiency, and achieved high-fidelity 3D rendering and open source, versatility and scalability of the system.
Patent Information
- Application Number
- CN202411899342.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-23
AI Technical Summary
The existing flight simulation technology has limitations in achieving high realistic visualization of the aircraft, especially in the configuration of the aircraft, control parameter adjustment and simulation operation efficiency, and most technical routes have not achieved full open source and free use.
By combining Python with Unreal Engine (UE), a universal visual flight simulation system is built. Python is used for aircraft guidance, control and simulation solutions, and UE is used for visual display of flight processes to achieve high-fidelity 3D rendering. The system adopts a modular idea, which allows flexible replacement of simulation models and is suitable for different types and numbers of aircraft.
It realizes a flight simulation system with open source code, realistic rendering effects, versatility and scalability, avoids authorization and code black box restrictions, and can replace models at will, which is suitable for a wide range of flight simulation needs.
Smart Images

Figure CN119783259A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of flight simulation, and in particular to a general visual flight simulation system. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and may not constitute prior art.
[0003] Flight simulation is to simulate the flight process of an aircraft on a computer through numerical calculation, visual rendering and other technologies, so as to provide support for guidance law design, control law design, air combat confrontation strategy research, flight simulation system development, etc. However, in the simulation process, if the success or failure or pros and cons of flight simulation is judged only by flight data or simulation curves, it is not intuitive enough and cannot bring people an immersive experience. Therefore, it is necessary to use visual simulation technology, combined with aircraft navigation, guidance and control technology, to build a realistic virtual environment, realistically display the flight process, and give users an intuitive audio-visual interactive experience, so as to achieve an effect close to real seeing, real hearing and real operation.
[0004] At present, the most commonly used technical route is to combine Matlab / Simulink and FlightGear (a multi-platform flight simulator) to achieve flight simulation and visualization. However, Matlab / Simulink is banned in some domestic universities and military units. Many users engaged in flight simulation cannot use it through normal channels. In addition, for a large number of Monte Carlo simulations, the running speed of Matlab / Simulink is also slow. Although FlightGear is open source, the configuration of the aircraft, the adjustment of control parameters, and the simulation operation are all carried out through XML files, which are particularly cumbersome to modify. In addition, due to the limitations of the SimGear (FlightGear's simulation engine) framework, its display effect has not kept up with the pace of the times, and the supporting modeling software AC3D has relatively simple functions.
[0005] Therefore, researchers at home and abroad have tried other technical routes to achieve flight simulation and visualization. For example:
[0006] 1. Flight simulation was achieved through the dynamics model in the game "Digital Combat Simulator (DCS) World", and head-mounted visualization systems for fixed-wing and quadrotor aircraft were developed through the game engines Unity 3D and Unreal Engine (UE), respectively.
[0007] 2. The flight dynamics model was written in C# language, the flight status of the aircraft was obtained by solving ordinary differentials, and a high-fidelity flight visualization environment was created using Unity 3D to display the flight process. Alternatively, the flight simulation model was established using Matlab / Simulink, and the visual simulation system was developed using VC++6.0 and OpenGL as the development environment.
[0008] 3. Use Matlab to realize aircraft flight simulation, and use Microsoft VC++6.0 to realize secondary development of digital earth and realize visualization of flight simulation.
[0009] 4. Use the open source six-degree-of-freedom nonlinear flight dynamics model JSBSim to achieve real-time solution of flight status, and develop a visualization system through Unity 3D to display the flight process in real time.
[0010] In the above technical routes, DCS and Unity 3D are commercial software and require fees. Therefore, all the technical routes in the above literature are not fully open source and free to use. Summary of the invention
[0011] The purpose of the present invention is to provide a general visual flight simulation system to solve the problems in the current prior art, and to realize flight simulation and visual rendering by combining Python and UE. Among them, Python language realizes aircraft guidance, control and simulation solution, reflecting the autonomous controllability, flexibility and efficiency of Python language; UE realizes the visual display of the flight process, reflecting its advantages in high-fidelity 3D rendering, and at the same time realizes code editability and free use; the flight simulation system is constructed through modularization, can flexibly replace simulation models, realize flight simulation of different types and numbers of aircraft, and has strong versatility.
[0012] The technical solution of the present invention is as follows:
[0013] A general visual flight simulation system, comprising: a flight simulation solution subsystem based on Python and a flight simulation visualization subsystem based on UE;
[0014] The flight simulation solution subsystem comprises:
[0015] A simulation framework, wherein the simulation framework is built based on the simulation model portability specification SMP2 and is used to improve the portability and repeatability of the simulation model;
[0016] The aircraft body mathematical model is used to realize real-time calculation of flight status and generate position and attitude information of the aircraft;
[0017] A control law model, wherein the control law model is used to achieve stable and autonomous flight of the aircraft;
[0018] A guidance law model, wherein the guidance law model provides guidance information for the aircraft as a desired input for position or attitude control of the aircraft;
[0019] An environmental model, wherein the environmental model is used to simulate the atmospheric environment, gravity environment and wind field environment in which the aircraft is located;
[0020] The flight simulation visualization subsystem includes:
[0021] The aircraft 3D visualization model is used to build a high-precision aircraft visual model to realistically display the details of the aircraft during flight;
[0022] A landscape model, wherein the landscape model is used to generate a space environment in which the aircraft is located;
[0023] A sound effect model, wherein the sound effect model is used to generate the sound emitted by the aircraft during flight;
[0024] A visual control script, which is used to control the 3D visual model of the aircraft to respond to the received flight status information and realize the human-computer interaction function;
[0025] The flight simulation solver subsystem runs the simulation framework, calls the aircraft body mathematical model, control law model, guidance law model, and environmental model, generates the aircraft's flight status information in real time, and sends the information to the flight simulation visualization subsystem;
[0026] The flight simulation visualization subsystem calls the aircraft 3D visualization model, landscape model, sound effect model and visualization control script according to the received aircraft status information, and presents the aircraft's flight status to the observer in real time.
[0027] Furthermore, the simulation model portability specification SMP2 provides an IModel model interface and adds a Model class that inherits from the IModel interface.
[0028] Furthermore, the aircraft body mathematical model includes: an actuator model, an aerodynamic model, an engine model, an aircraft dynamics model, and a sensor model;
[0029] The actuator model is established through a first-order inertia link, and the first-order inertia link is established through Python, using the control library in Python and defined through the control.TransferFunction function in the library;
[0030] The construction of the aerodynamic model includes:
[0031] Establish a mathematical model of aerodynamic force in the airflow coordinate system;
[0032] Establish aerodynamic torque mathematical model in the body coordinate system;
[0033] The construction of the aerodynamic model is completed through the interpolate module in the Python scientific computing library SciPy;
[0034] The construction of the engine model includes:
[0035] Establish the functional relationship between the effect of engine parameter changes on thrust;
[0036] Establish the forces and moments generated by the engine thrust in the body coordinate system;
[0037] The engine model is constructed using the interpolate module in the Python scientific computing library SciPy.
[0038] The construction of the aircraft dynamics model includes:
[0039] Assuming that the aircraft is a rigid body with six degrees of freedom, its dynamic model consists of multiple first-order nonlinear differential equations; among them, the first-order nonlinear differential equations can be solved using the odeint function in the Python scientific computing library SciPy;
[0040] The sensor model is constructed by simulating characteristics of the sensor such as delay, error, noise, and dead zone. The sensor model is constructed using related functions in the Python data analysis library Pandas.
[0041] Furthermore, the control law model is constructed through Python's control library; the control law model first linearizes the six-degree-of-freedom nonlinear model to obtain a linearized equation; secondly, the control links commonly used in the flight control system are built; finally, according to the characteristics of the aircraft and the results of the stability analysis, the control structure of the aircraft is designed and the control parameters are adjusted.
[0042] Furthermore, the construction of the guidance law model includes:
[0043] Select L1 guidance algorithm to design guidance law model and implement it using Python basic language;
[0044] The L1 guidance algorithm updates the normal acceleration as follows:
[0045]
[0046] in:
[0047] The generated aircraft acceleration command;
[0048] V is the flight speed;
[0049] R is the radius of the maneuvering arc;
[0050] L1 is the straight-line distance between the target point and the current position of the aircraft;
[0051] η is the angle between V and L1 direction;
[0052] The L1 guidance algorithm updates the angular velocity by:
[0053]
[0054] Among them, ω cmd is the generated angular velocity command.
[0055] Furthermore, the construction of the environment model includes:
[0056] Based on the analysis of the physical mechanism of the environment, mathematical models and formulas are used to describe the flight environment, and the atmospheric model, gravity model and wind model for aircraft flight simulation are established.
[0057] The COESA model is selected as the atmospheric model. The COESA model is a static atmospheric model. The input signal is the altitude of the aircraft, and the output is the atmospheric data of the corresponding altitude. The atmospheric data includes: atmospheric temperature, sound speed, atmospheric pressure and atmospheric density.
[0058] Select the WGS84 coordinate system to establish the gravity model, and calculate the gravity acceleration value under different coordinates by inputting the coordinate position;
[0059] The established wind models include discrete gusts, vertical winds, crosswinds, Dryden turbulence and Von Karman turbulence. The airspeed and attitude changes caused by the wind models are superimposed on the normal flight state to carry out flight simulation.
[0060] The gravity model uses Python's GeoPandas library, and the atmospheric model and wind model are implemented using Python basic language programming.
[0061] Furthermore, the construction of the aircraft 3D visualization model includes:
[0062] First, the basic model of the aircraft is constructed based on the data pictures to achieve preliminary modeling of the aircraft; next, the basic model is modified based on multiple data pictures, and the surface material of the model is selected and refined to generate a rendered model; finally, the model is further adjusted and optimized to finally generate a 3D visualization model that meets the rendering requirements;
[0063] The aircraft 3D visualization model is established using 3ds Max software.
[0064] Furthermore, the construction of the landscape model includes:
[0065] The landscape model is constructed through UE's built-in map editing system or third-party software and plug-ins.
[0066] Furthermore, the construction of the sound effect model includes:
[0067] Follow the steps of audio file selection and audio effect setting.
[0068] Furthermore, the visual control script consists of two parts: an aircraft model control script and a human-computer interaction control script.
[0069] The aircraft model control script implements the initialization of the aircraft state, and controls the aircraft's rudder deflection, position change, attitude change, and landing gear retraction and extension according to the simulation data, so as to achieve a realistic display effect; the aircraft model control script also adds a position jump judgment mechanism, among which the landing gear retraction and extension control sets the following two mechanisms: 1. If the retraction and extension animation has been established in the aircraft 3D visualization model, it is only necessary to call the animation in the script according to the retraction and extension command, and control the animation playback order and speed to complete the retraction and extension of the landing gear; 2. If the animation is not established in the aircraft 3D visualization model, after receiving the retraction and extension command, the script needs to coordinate the deflection of each component and the contraction of the rod during the retraction and extension of the landing gear to complete the retraction and extension of the landing gear;
[0070] The human-computer interaction control script realizes the following three functions: first, select the corresponding 3D model in the flight simulation visualization subsystem according to the aircraft model in the flight simulation; second, switch the flight simulation observation perspective according to the operator's keyboard instructions; third, complete the observation field of view control according to the mouse and keyboard operations.
[0071] Compared with the prior art, the present invention has the following beneficial effects:
[0072] 1. The present invention effectively overcomes the shortcomings of the existing system and has the advantages of open source code, realistic rendering effect, strong versatility and scalability.
[0073] 2. The system uses the object-oriented development language Python to achieve real-time calculation of flight status, and uses the open source game engine UE to achieve visualization of flight simulation. The simulation system is not subject to restrictions such as authorization and code black boxes, and can replace the aircraft model, guidance law model, control law model, landscape model and sound effect model in the system at will, with strong versatility, reusability and scalability; at the same time, on the basis of this general visualization flight simulation system, it also adds guidance law / control law design and Monte Carlo simulation functions to further improve the scope of application of the simulation system. At the same time, the model in the system can be exported and used as the input of the engineering-level combat simulation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 The overall implementation block diagram of the general visual flight simulation system;
[0075] Figure 2 Provide a block diagram for the flight simulation solver subsystem;
[0076] Figure 3 This is the interface diagram of the flight simulation model based on SMP2;
[0077] Figure 4 Implement the block diagram for the mathematical model of the aircraft itself;
[0078] Figure 5 It is a typical inner and outer loop control structure of an aircraft;
[0079] Figure 6 Implement a block diagram for the flight simulation visualization subsystem;
[0080] Figure 7 Modeling flow chart for 3D visualization of aircraft;
[0081] Figure 8 Design and implement block diagrams for visual control scripts. DETAILED DESCRIPTION
[0082] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0083] The features and performance of the present invention are further described in detail below in conjunction with the embodiments.
[0084] Embodiment 1
[0085] See also Figure 1 , a general visual flight simulation system, comprising: a flight simulation solution subsystem based on Python and a flight simulation visualization subsystem based on UE;
[0086] The flight simulation solution subsystem comprises:
[0087] A simulation framework, wherein the simulation framework is built based on the Simulation Model Portability Specification SMP2 (SMP2 stands for Simulation Model Portability 2)) and is used to improve the portability and repeatability of the simulation model;
[0088] The aircraft body mathematical model is used to realize real-time calculation of flight status and generate position and attitude information of the aircraft;
[0089] A control law model, wherein the control law model is used to achieve stable and autonomous flight of the aircraft;
[0090] A guidance law model, wherein the guidance law model provides guidance information for the aircraft as a desired input for position or attitude control of the aircraft;
[0091] An environmental model, wherein the environmental model is used to simulate the atmospheric environment, gravity environment and wind field environment in which the aircraft is located;
[0092] Flight simulation settings are used to initialize the flight simulation process, such as adjusting the simulation step size, selecting the numerical differential solution algorithm, controlling the output data type, and deciding whether to add a wind field model.
[0093] The flight simulation visualization subsystem includes:
[0094] The aircraft 3D visualization model is used to build a high-precision aircraft visual model to realistically display the details of the aircraft during flight;
[0095] A landscape model, which is used to generate the space environment in which the aircraft is located, such as mountains, cities, airports, oceans, vegetation, etc.;
[0096] A sound effect model, wherein the sound effect model is used to generate a roar and aerodynamic noise emitted by an aircraft during flight;
[0097] A visual control script, which is used to control the 3D visual model of the aircraft to respond to the received flight status information and realize the human-computer interaction function;
[0098] Visual simulation settings are used to initialize and adjust the visualization subsystem in real time, such as aircraft 3D model replacement, weather selection, perspective switching, simulation playback, etc.
[0099] After the simulation starts, the flight simulation solver subsystem runs the simulation framework, calls the aircraft body mathematical model, control law model, guidance law model, and environmental model, and generates the aircraft's position, speed, attitude angle, angular velocity, rudder angle and other flight status information in real time; and uses the UDP protocol to send it to the flight simulation visualization subsystem through the local area network;
[0100] The flight simulation visualization subsystem calls the aircraft 3D visualization model, landscape model, sound effect model and visualization control script according to the received aircraft status information, and presents the aircraft's flight status to the observer in real time;
[0101] Preferably, the two subsystems can run on the same computer or on different computers in a local area network.
[0102] It should be noted that the flight simulation solver subsystem implementation block diagram is as follows Figure 2 As shown in the figure, the simulation framework based on SMP2 is the basis of the flight simulation solution subsystem, which can improve the portability and repeatability of the model. This subsystem establishes the mathematical model of the aircraft body through the input of aerodynamic, geometric characteristics, engine, mass characteristics and other data, and then establishes the control law model and guidance law model in turn on this basis, and realizes the real-time solution of the flight state under the action of the environmental model.
[0103] In this embodiment, specifically, it should be noted that the purpose of SMP2 is to define a model development and integration standard, that is, to provide a model development framework to solve the problems of simulation model portability and reusability, and to achieve platform independence, cross-simulation platform reuse and integration of simulation models.
[0104] Therefore, this embodiment develops a flight simulation framework based on SMP2, and develops a mathematical model used in flight simulation on this basis; specifically, the SMP2 standard provides an IModel model interface, such as Figure 3As shown. Among them, the GetName() method returns the name of the model instance, the GetDescription() method returns a description of the model, the GetParent() method returns the parent model of the model in the model tree, the GetState() method returns the current state of the model, the Publish() method requests the model to publish its fields, the Configure() method supports the model to complete customized configuration, and the Connect() method connects the model to the simulation framework to support service subscription or subscription of other model connection points. In order to unify the parameter setting function of the flight simulation model and facilitate transplantation and reorganization, the Model class is added, which inherits from the IModel interface. All flight simulation models inherit from the Model class and implement the above methods.
[0105] In this embodiment, specifically, Figure 4 As shown, the aircraft body mathematical model includes: an actuator model, an aerodynamic model, an engine model, an aircraft dynamics model, and a sensor model.
[0106] In this embodiment, specifically, the actuator model is established through a first-order inertia link, and the first-order inertia link is established through Python, using the control library in Python, and is defined through the control.TransferFunction function in the library;
[0107] That is, for an aircraft, the actuator generally includes a servo and a throttle. Usually, the mathematical model of the actuator can be established through the following first-order inertial link:
[0108]
[0109] in, is the derivative of d, d cmd is the given input command, d is the actual output command, w is the actuator bandwidth, is a saturation function, which is defined as:
[0110]
[0111] To establish the first-order inertia link through Python, you need to use the control library and define the transfer function (i.e. the first-order inertia link) through the control.TransferFunction function in the library.
[0112] In this embodiment, specifically, the construction of the aerodynamic model includes:
[0113] Establish a mathematical model of aerodynamic force in the airflow coordinate system;
[0114] Establish aerodynamic torque mathematical model in the body coordinate system;
[0115] The construction of the aerodynamic model is completed through the interpolate module in the Python scientific computing library SciPy;
[0116] That is, in the aircraft dynamics system, aerodynamic force and torque are the most important external forces. Generally, the model is established based on numerical calculations or wind tunnel test data, using interpolation, linear superposition and other methods.
[0117] Aerodynamic forces are usually expressed in the airflow coordinate system S a -O a x a y a z a The mathematical model is established as follows:
[0118]
[0119] Among them, L, Y, D represent lift, side force and drag respectively; Q represents dynamic pressure; S w Represents the wing reference area; C L , C Y , C D represents the lift coefficient, side force coefficient and drag coefficient respectively; α and β represent the angle of attack and sideslip angle respectively; Ma represents the Mach number; p, q, r represent the roll angular velocity, pitch angular velocity and yaw angular velocity respectively; δ represents the rudder deflection angle;
[0120] The aerodynamic moment is usually expressed in the body coordinate system S b -O b x b y b z b The mathematical model is established as follows:
[0121]
[0122] in, M, N represent the pitch moment, rolling moment and yaw moment respectively; b represents the wing span; c represents the average aerodynamic chord length; C l , C m , C n They represent the rolling moment coefficient, pitching moment coefficient and yaw moment coefficient respectively.
[0123] In this embodiment, specifically, the construction of the engine model includes:
[0124] Establish the functional relationship between the effect of engine parameter changes on thrust;
[0125] Establish the forces and moments generated by the engine thrust in the body coordinate system;
[0126] The engine model is constructed using the interpolate module in the Python scientific computing library SciPy.
[0127] That is, to establish an engine model, it is necessary to first establish the functional relationship between the impact of engine parameter changes on thrust, and secondly, to establish the force and torque generated by the engine thrust in the body coordinate system.
[0128] Due to the different types of engines, it is not possible to use a unified expression to describe the engine model. Taking a turbojet engine as an example, its thrust can be expressed by a multivariable function:
[0129] T=P(δ T ,h,Ma,α,β)
[0130] Where T represents the engine thrust, δ T represents the throttle position and h represents the flight altitude.
[0131] The thrust of the engine in the body coordinate system is expressed as:
[0132]
[0133] Among them, T x , T y , T z They represent the three components of thrust along the x, y, and z axes of the aircraft body; δ z The thrust is in the symmetry plane O of the aircraft. b x b z b The projection inside and x b The angle between the axes; δ y Indicates the thrust in the aircraft O b x b y b Projection of the plane and the symmetry plane O b x b z b The angle between
[0134] The torque generated by the engine thrust in the body coordinate system is expressed as:
[0135]
[0136] Among them, (l x ,l y ,l z ) is the coordinate of the engine thrust application point in the body coordinate system;
[0137] The most frequently used function in aerodynamic and engine modeling is the multidimensional difference function, which requires the interpolate module in the Python scientific computing library SciPy.
[0138] In this embodiment, specifically, the construction of the aircraft dynamics model includes:
[0139] Assuming that the aircraft is a rigid body with six degrees of freedom, its dynamic model consists of multiple first-order nonlinear differential equations; among them, the first-order nonlinear differential equations can be solved using the odeint function in the Python scientific computing library SciPy;
[0140] That is, when establishing the aircraft dynamics model, it is assumed that the aircraft is a rigid body with six degrees of freedom. Its dynamics model consists of 12 first-order nonlinear differential equations, including the center of mass dynamics equation, the dynamics equation of rotation around the center of mass, the attitude angle motion equation, and the center of mass motion. The core of flight simulation is to continuously solve these differential equations to achieve real-time updates of flight status. It should be noted that the detailed derivation process of differential equations is known to those skilled in the art and will not be repeated here; the process of solving differential equations can use the odeint function in the Python scientific computing library SciPy.
[0141] In this embodiment, specifically, the construction of the sensor model is realized by simulating the delay, error, noise, dead zone and other characteristics of the sensor, and the construction of the sensor model is realized by using the relevant functions in the Python data analysis library Pandas;
[0142] It should be noted that the sensors used in aircraft mainly include environmental sensors, such as airspeed tubes, barometers, altimeters, etc.; position sensors, such as accelerometers, GPS navigation devices, rudder angle sensors, etc.; attitude sensors, such as wind vanes, gyroscopes, etc. The working principles of these sensors are different. When modeling, we should focus on their performance indicators such as dead zone, error, noise, delay, and scaling factors. According to different sensors, adding corresponding characteristic functions after the object output can simulate the output of the sensor;
[0143] The operations of sensor modeling can be implemented using relevant functions in the Python data analysis library Pandas.
[0144] In this embodiment, specifically, the control law model is constructed by using the control library of Python; the control law model first linearizes the six-degree-of-freedom nonlinear model to obtain a linearized equation; secondly, the control links commonly used in the flight control system are constructed; finally, according to the characteristics of the aircraft and the results of the control stability analysis, the control structure of the aircraft is designed and the control parameters are adjusted;
[0145] It should be noted that for aircraft, the most commonly used control method is traditional PID control, and the control law design process usually starts from the inner loop angular rate control, to the attitude angle control, and finally to the position control, layer by layer; Figure 5 This is a typical inner and outer loop control structure diagram;
[0146] This embodiment implements the flight control system through Python's control library. First, the six-degree-of-freedom nonlinear model is linearized to obtain the linearized equation; secondly, the control links commonly used in the flight control system are built, such as integrator, PID controller, low-pass filter, high-pass filter (wash-out network), lead-lag link, notch filter, limiter, dead zone, etc.; finally, according to the characteristics of the aircraft and the results of the stability analysis, the control structure of the aircraft is designed and the control parameters are adjusted.
[0147] In this embodiment, specifically, the construction of the guidance law model includes:
[0148] Select L1 guidance algorithm to design guidance law model and implement it using Python basic language;
[0149] The L1 guidance algorithm updates the normal acceleration as follows:
[0150]
[0151] in:
[0152] The generated aircraft acceleration command;
[0153] V is the flight speed;
[0154] R is the radius of the maneuvering arc;
[0155] L1 is the straight-line distance between the target point and the current position of the aircraft;
[0156] η is the angle between V and L1 direction;
[0157] The L1 guidance algorithm updates the angular velocity by:
[0158]
[0159] Among them, ω cmd is the generated angular velocity command;
[0160] It should be noted that the guidance law model is used to provide information such as the position and attitude of the aircraft as the input of the control law model;
[0161] This embodiment selects the L1 guidance algorithm to design the guidance law. The L1 guidance algorithm is a classic nonlinear UAV path following algorithm, first proposed by MIT (Massachusetts Institute of Technology) in 2004. Its basic idea is to find a reference point L1 away from the UAV on the target route, and use the reference point to tow the UAV to fly;
[0162] The guidance law model is implemented using Python basic language programming.
[0163] In this embodiment, specifically, the construction of the environment model includes:
[0164] Based on the analysis of the physical mechanism of the environment, mathematical models and formulas are used to describe the flight environment, and the atmospheric model, gravity model and wind model for aircraft flight simulation are established;
[0165] The COESA model is selected as the atmospheric model. The COESA model is a static atmospheric model. The input signal is the altitude of the aircraft, and the output is the atmospheric data of the corresponding altitude. The atmospheric data includes: atmospheric temperature, sound speed, atmospheric pressure and atmospheric density.
[0166] Select the WGS84 coordinate system to establish the gravity model, and calculate the gravity acceleration value under different coordinates by inputting the coordinate position;
[0167] The established wind models include discrete gusts, vertical winds, crosswinds, Dryden turbulence and Von Karman turbulence. The airspeed and attitude changes caused by the wind models are superimposed on the normal flight state to carry out flight simulation.
[0168] The gravity model uses Python's GeoPandas library, and the atmospheric model and wind model are implemented using Python basic language programming;
[0169] That is, the modeling process of the environmental model is as follows: based on the analysis of the physical mechanism of the environment, mathematical models and formulas are used to describe the flight environment, and the atmospheric model, gravity model and wind model for aircraft flight simulation are established. The first is the atmospheric model: This article selects the COESA model released by the American Standard Atmosphere Extension Committee as the standard atmospheric model. This model is a static atmospheric model. The input signal of the model is the altitude of the aircraft, and the output is the atmospheric temperature, sound speed, atmospheric pressure and atmospheric density at the corresponding altitude. The second is the gravity model: The WGS84 coordinate system is selected to establish the gravity model. By inputting the coordinate position, the gravity acceleration value under different coordinates is calculated. The third is the wind model: The established wind model mainly includes discrete gusts, vertical winds, crosswinds, Dryden turbulence and Von Karman turbulence, etc. The airspeed and attitude changes caused by them are superimposed on the normal flight state to carry out flight simulation;
[0170] The gravity model can be implemented using Python's GeoPandas library, and the atmosphere and wind models are implemented using Python basic language programming.
[0171] In this embodiment, it should be noted that the flight simulation visualization subsystem implementation block diagram is as follows: Figure 6 As shown;
[0172] First, a 3D visualization model of the aircraft is established through 3D modeling software. Secondly, in order to simulate the flight environment of the aircraft with high fidelity, a landscape model is established based on the established airport model and weather model. Next, a sound effect model is established to enhance the audio-visual effect. Finally, a visual control script is developed to realize the control of the aircraft 3D model and human-computer interaction functions.
[0173] In this embodiment, specifically, the construction of the aircraft 3D visualization model includes:
[0174] Use 3ds Max software to build a 3D visualization model of the aircraft;
[0175] It should be noted that the construction of the aircraft 3D visualization model is to build an aircraft model with a three-dimensional effect through modeling software. In this embodiment, 3ds Max software is selected to build the aircraft visualization model.
[0176] The modeling process is as follows Figure 7 As shown;
[0177] First, the basic model of the aircraft is constructed based on the data pictures to achieve preliminary modeling of the aircraft; next, the model is modified based on multiple data pictures, and the surface material of the model is selected and refined to generate a rendered model; finally, the model is further adjusted and optimized through steps such as color correction, adding details, and grasping the overall situation, and finally a 3D visualization model that meets the rendering requirements is generated. It should be noted that the final 3D model should minimize the number of faces while ensuring the rendering effect, thereby reducing the hardware requirements for real-time rendering in visualization simulation.
[0178] In this embodiment, specifically, the construction of the landscape model includes:
[0179] Build the landscape model through UE's built-in map editing system or third-party software and plug-ins;
[0180] It should be noted that the scenery model is used to simulate the spatial environment in which the aircraft performs flight missions, including mountains, cities, airports, oceans, vegetation, etc. There are many ways to create scenery, such as through the UE's built-in map editing system, third-party software, and plug-ins. This embodiment selects Landscaping + LandscapingMapbox plug-in to build the scenery; next, the airport and aircraft models need to be integrated into the scenery model to achieve seamless connection between low-precision scenery models and high-precision 3D models; on this basis, add weather elements such as the sky, atmosphere, fog effects, and the sun to form a realistic scene of aircraft flight.
[0181] In this embodiment, specifically, the construction of the sound effect model includes:
[0182] Follow the steps of audio file selection and audio effect setting;
[0183] It should be noted that the construction of the sound effect model is usually carried out according to the steps of audio file selection and audio effect setting; audio files are generally downloaded from the Internet, and the sound effects of the same model of aircraft, or engine sound effects similar to it, are selected; audio settings can use the Sound Attenuation module that comes with UE to set the sound propagation range, focus direction and attenuation style, etc.
[0184] In this embodiment, specifically, the visual control script consists of two parts: an aircraft model control script and a human-computer interaction control script. Its functional components are as follows: Figure 8 As shown;
[0185] That is, the aircraft model control script realizes the initialization of the aircraft state, and controls the aircraft's rudder deflection, position change, attitude change, landing gear retraction and extension, etc. according to the simulation data, so as to achieve a realistic display effect. In order to avoid the problem of screen flickering caused by the position returning to zero after the UDP communication protocol packet is lost, a position jump judgment mechanism is added to the control script. Two mechanisms are set up for the landing gear retraction and extension control. If the retraction and extension animation has been established in the aircraft 3D model, you only need to call the animation according to the retraction and extension command in the script, and control the animation playback order and speed to complete the retraction and extension of the landing gear; if the animation is not established in the aircraft 3D model, then after receiving the retraction and extension command, the script needs to coordinate the deflection of each component and the contraction of the rods during the retraction and extension of the landing gear to complete the retraction and extension of the landing gear;
[0186] The human-computer interaction control script mainly realizes three functions: first, it selects the corresponding 3D model in the visualization subsystem according to the aircraft model in the flight simulation; second, it switches the flight simulation observation perspective according to the operator's keyboard commands; third, it completes the observation field of view control according to the mouse and keyboard operations.
[0187] The above-mentioned embodiments only express the specific implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the protection scope of the present application. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the technical solution concept of the present application, and these all belong to the protection scope of the present application.
[0188] This background section is provided to generally present the context of the invention, and the work of the presently named inventors, the work to the extent described in this background section, and aspects of this section that did not constitute prior art at the time of application are neither explicitly nor implicitly admitted to be prior art to the present invention.
Claims
1. A general visual flight simulation system, characterized in that: include: Python-based flight simulation solution subsystem and UE-based flight simulation visualization subsystem; The flight simulation solution subsystem comprises: A simulation framework, wherein the simulation framework is built based on the simulation model portability specification SMP2 and is used to improve the portability and repeatability of the simulation model; The aircraft body mathematical model is used to realize real-time calculation of flight status and generate position and attitude information of the aircraft; A control law model, wherein the control law model is used to achieve stable and autonomous flight of the aircraft; A guidance law model, wherein the guidance law model provides guidance information for the aircraft as a desired input for position or attitude control of the aircraft; An environmental model, wherein the environmental model is used to simulate the atmospheric environment, gravity environment and wind field environment in which the aircraft is located; The flight simulation visualization subsystem includes: The aircraft 3D visualization model is used to build a high-precision aircraft visual model to realistically display the details of the aircraft during flight; A landscape model, wherein the landscape model is used to generate a space environment in which the aircraft is located; A sound effect model, wherein the sound effect model is used to generate the sound emitted by the aircraft during flight; A visual control script, which is used to control the 3D visual model of the aircraft to respond to the received flight status information and realize the human-computer interaction function; The flight simulation solver subsystem runs the simulation framework, calls the aircraft body mathematical model, control law model, guidance law model, and environmental model, generates the aircraft's flight status information in real time, and sends the information to the flight simulation visualization subsystem; The flight simulation visualization subsystem calls the aircraft 3D visualization model, landscape model, sound effect model and visualization control script according to the received aircraft status information, and presents the aircraft's flight status to the observer in real time.
2. A general visual flight simulation system according to claim 1, characterized in that: The simulation model portability specification SMP2 provides the IModel model interface and adds the Model class that inherits from the IModel interface.
3. A general visual flight simulation system according to claim 1, characterized in that: The aircraft body mathematical model includes: an actuator model, an aerodynamic model, an engine model, an aircraft dynamics model, and a sensor model; The actuator model is established through a first-order inertia link, and the first-order inertia link is established through Python, using the control library in Python and defined through the control.TransferFunction function in the library; The construction of the aerodynamic model includes: Establish a mathematical model of aerodynamic force in the airflow coordinate system; Establish aerodynamic torque mathematical model in the body coordinate system; The construction of the aerodynamic model is completed through the interpolate module in the Python scientific computing library SciPy; The construction of the engine model includes: Establish the functional relationship between the effect of engine parameter changes on thrust; Establish the forces and moments generated by the engine thrust in the body coordinate system; The engine model is constructed using the interpolate module in the Python scientific computing library SciPy. The construction of the aircraft dynamics model includes: Assuming that the aircraft is a rigid body with six degrees of freedom, its dynamic model consists of multiple first-order nonlinear differential equations; among them, the first-order nonlinear differential equations can be solved using the odeint function in the Python scientific computing library SciPy; The sensor model is constructed by simulating various characteristics of the sensor, and the sensor model is constructed using relevant functions in the Python data analysis library Pandas; the characteristics include: delay, error, noise, and dead zone.
4. A general visual flight simulation system according to claim 1, characterized in that: The control law model is constructed through Python's control library; the control law model first linearizes the six-degree-of-freedom nonlinear model to obtain a linearized equation; secondly, the control links commonly used in the flight control system are built; finally, according to the characteristics of the aircraft and the results of the stability analysis, the control structure of the aircraft is designed and the control parameters are adjusted.
5. A general visual flight simulation system according to claim 1, characterized in that: The construction of the guidance law model includes: Select L1 guidance algorithm to design guidance law model and implement it using Python basic language; The L1 guidance algorithm updates the normal acceleration as follows: in: a scmd The generated aircraft acceleration command; V is the flight speed; R is the radius of the maneuvering arc; L1 is the straight-line distance between the target point and the current position of the aircraft; η is the angle between V and L1 direction; The L1 guidance algorithm updates the angular velocity by: Among them, ω cmd is the generated angular velocity command.
6. A general visual flight simulation system according to claim 1, characterized in that: The construction of the environment model includes: Based on the analysis of the physical mechanism of the environment, mathematical models and formulas are used to describe the flight environment, and the atmospheric model, gravity model and wind model for aircraft flight simulation are established; The COESA model is selected as the atmospheric model. The COESA model is a static atmospheric model. The input signal is the altitude of the aircraft, and the output is the atmospheric data of the corresponding altitude. The atmospheric data includes: atmospheric temperature, sound speed, atmospheric pressure and atmospheric density. Select the WGS84 coordinate system to establish the gravity model, and calculate the gravity acceleration value under different coordinates by inputting the coordinate position; The established wind models include discrete gusts, vertical winds, crosswinds, Dryden turbulence and Von Karman turbulence. The airspeed and attitude changes caused by the wind models are superimposed on the normal flight state to carry out flight simulation. The gravity model uses Python's GeoPandas library, and the atmospheric model and wind model are implemented using Python basic language programming.
7. A general visual flight simulation system according to claim 1, characterized in that: The construction of the aircraft 3D visualization model includes: First, the basic model of the aircraft is constructed based on the data pictures to achieve preliminary modeling of the aircraft; next, the basic model is modified based on multiple data pictures, and the surface material of the model is selected and refined to generate a rendered model; finally, the model is further adjusted and optimized to finally generate a 3D visualization model that meets the rendering requirements; The aircraft 3D visualization model is established using 3ds Max software.
8. A general visual flight simulation system according to claim 1, characterized in that: The construction of the landscape model includes: The landscape model is constructed through UE's built-in map editing system or third-party software and plug-ins.
9. A general visual flight simulation system according to claim 1, characterized in that: The construction of the sound effect model includes: Follow the steps of audio file selection and audio effect setting.
10. A general visual flight simulation system according to claim 1, characterized in that: The visual control script consists of two parts: the aircraft model control script and the human-computer interaction control script. The aircraft model control script implements the initialization of the aircraft state, and controls the aircraft's rudder deflection, position change, attitude change, and landing gear retraction and extension according to the simulation data, so as to achieve a realistic display effect; the aircraft model control script also adds a position jump judgment mechanism, among which the landing gear retraction and extension control sets the following two mechanisms:
1. If the retraction and extension animation has been established in the aircraft 3D visualization model, it is only necessary to call the animation in the script according to the retraction and extension command, and control the animation playback order and speed to complete the retraction and extension of the landing gear; 2. If the animation is not established in the aircraft 3D visualization model, after receiving the retraction and extension command, the script needs to coordinate the deflection of each component and the contraction of the rod during the retraction and extension of the landing gear to complete the retraction and extension of the landing gear; The human-computer interaction control script realizes the following three functions: first, select the corresponding 3D model in the flight simulation visualization subsystem according to the aircraft model in the flight simulation; second, switch the flight simulation observation perspective according to the operator's keyboard instructions; third, complete the observation field of view control according to the mouse and keyboard operations.
Citation Information
Patent Citations
Flight control algorithm integrated training platform
CN114167748A
Aircraft intelligent virtual flight method based on deep learning
CN117951812A
Three-dimensional simulation platform and simulation method for intelligent algorithm verification of unmanned platform
CN118504203A