CN110134025A - A kind of small distributed hypersonic aircraft real-time emulation system - Google Patents
A kind of small distributed hypersonic aircraft real-time emulation system Download PDFInfo
- Publication number
- CN110134025A CN110134025A CN201910443127.3A CN201910443127A CN110134025A CN 110134025 A CN110134025 A CN 110134025A CN 201910443127 A CN201910443127 A CN 201910443127A CN 110134025 A CN110134025 A CN 110134025A
- Authority
- CN
- China
- Prior art keywords
- module
- data
- emulation
- real
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B17/00—Systems involving the use of models or simulators of said systems
- G05B17/02—Systems involving the use of models or simulators of said systems electric
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T90/00—Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- General Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Processing Or Creating Images (AREA)
Abstract
Present invention offer provides a kind of small distributed hypersonic aircraft real-time emulation system, by main control module, emulation module and what comes into a driver's module composition, the system contains human-computer interaction interface, user can emulate in the relevant parameter that aircraft is changed at the interface at any time without interrupting, contain what comes into a driver's interface simultaneously, the state of flight of the aircraft under parameter current can be clearly seen at the interface in user, have the characteristics that succinct, high real-time and visual.
Description
Technical field
The present invention relates to emulation field is belonged to, in particular to a kind of small-sized emulation platform towards hypersonic aircraft is set
Meter combines Simulink to build controller and dummy vehicle, in conjunction with VC++ and OpenGL development management under MATLAB environment
Platform and human-computer interaction interface form joint Mobile portable formula emulation platform, suitable for the emulation and verifying under on-line control.
Background technique
With the continuous development of science and technology, also more and more for the concern of aircraft.Aircraft, especially high ultrasound
The unmanned vehicles such as fast aircraft have served as various roles in different fields, be widely used in agricultural, business,
Military and national defence has irreplaceable value and potentiality.But the influence factor of aircraft performance is more, cost is high, easily
The features such as damage, often also constrains the development speed of aircraft.For the achievement obtained at present, practical feasibility often without
Method directly obtains verifying, and emulates and be widely used in control field, using emulation platform to the achievement obtained into
The emulation of row feasibility has the unrivaled advantage of actual flying test.Computer simulation platform economy, safety, not by place and
Weather environment limitation, controllable and repeatable test, these features occupy emulation platform importantly in aircraft research
Position, countries in the world give great attention to aerial vehicle simulation platform and as giving priority to project.
In order to verify the performance of different designs scheme, engineers would generally use the softwares such as MATLAB to carry out offline imitate
True verifying, but this mode has significant ASIC limitation, we can only be designed by analyses such as data, images in simulation result
The performance of scheme, but cannot see that the real-time flight state of aircraft in the case of parameter current.Secondly, MATLAB emulation is offline
Emulation, after emulation starts, if some parameters of system change, we can only just wait current emulation to terminate, Huo Zhezhi
Stopping emulation being connect, is re-started after changing parameter, the dynamic changing process that system responds when parameter changes is unable to get.
Furthermore the real-time simulation of emulation not truly under Simulink environment, it changes model to a certain extent
Simulation time.
Under normal circumstances, it in existing aerial vehicle simulation method, according to the difference of simulation model form and emulates not
Same mode, aerial vehicle simulation can be divided into three classes, i.e. matter emulation, HWIL simulation and full digital trigger technique.It is imitative to carry out aircraft
Very, the emulation of especially hypersonic aircraft needs a large amount of different types of resources, and model accuracy is higher, and structure is more complicated,
Resolving time will be longer, can hardly complete real-time simulation for this class model in single machine emulation.The side of this emulation simultaneously
Method needs operator that can have enough programming simulation abilities, and cannot change in real time parameter and be debugged, it is desirable that and it is higher, and
It is relatively cumbersome.Current some preferable online real-time emulation systems, the higher perhaps technical know-how of most cost or be dedicated
System, common engineering staff is not available.In addition, existing emulation platform does not have mobility mostly or mobility is poor,
It is unable to satisfy the practicability and requirement on flexibility of emulation.
In view of drawback present in existing emulation mode can not continuously adjust ginseng process, nothing including complicated model foundation
Method intuitively observes the state of aircraft in real time.In view of drawback present in existing emulation mode and emulation platform, including complexity
Model foundation, can not continuously adjust ginseng process, can not intuitively observe the state of aircraft in real time, the problems such as poor mobility.
Summary of the invention
Of the existing technology in order to solve the problems, such as, the present invention will provide a kind of small-sized movable Distributed Flight device and imitate in real time
The design scheme of true platform.The program will provide the design method for realizing real-time simulation, meanwhile, for can not be in simulation process
The problem of line tune is joined, this programme contain human-computer interaction interface, and user can change the related ginseng of aircraft at the interface at any time
Number is emulated without interrupting;The system contains what comes into a driver's interface simultaneously, and user can be clearly seen at the interface to join currently
The real-time flight state of several lower aircraft;So this programme has the characteristics that succinct, high real-time and visual.
In view of the problems of the existing technology, we, which adopt the following technical scheme that, is achieved:
A kind of small distributed hypersonic aircraft real-time emulation system, by main control module, emulation module and what comes into a driver's mould
Block is constituted,
Main control module is the hinge of entire Distributed Simulation Platform, in Simulink environment Imitating dummy vehicle,
Data are carried out with emulation module in simulation process mutually to pass, and attitude data is sent to what comes into a driver's module, while there is control to emulate
The function of start and stop and storage emulation data;
Emulation module is equivalent to the controller of aircraft, the flight control program of operation support Simulink external schema and
Server program, the attitude of flight vehicle data transmitted according to main control module and given parameters provide control instruction simultaneously by calculating
It is sent to main control module;Wherein, the emulation module includes data reception module, data real-time display module, data storage mould
Block, data check module, real-time curve drafting module and human-computer interaction interface;
What comes into a driver's module runs what comes into a driver's software, is responsible for the attitude of flight vehicle data that the transmission of real-time reception main control module comes, passes through
The form of animation shows aircraft real-time status, so that user is more intuitively observed entire simulation process, in which: the what comes into a driver's module
Including animation display unit, visual display unit, data reception processing unit and dummy vehicle and model of place.
The invention also includes following steps to be practiced:
Initial parameter is arranged in S1, emulation module;
S2, main control module start simulation process;
2.1, the winged control Program transformation based on RTW;
2.2, building conversion communication network;
2.3, real-time simulation is handled;
S3, emulation module receive corresponding data distribution different data processing modules implement human-computer interaction and export number to aircraft
According to output and curve image process;
S4, what comes into a driver's module receive the state of flight that corresponding data shows aircraft in the form of animation;
S5, emulation module by man-machine exchange interface realize on-line parameter adjust, if in emulation module curve image and
Flight state is met the requirements in what comes into a driver's module, then terminates simulation status;Otherwise return step S2.
The main control module and emulation module, which are based on TCP/IP communication agreement, to carry out data transmission, main control module and emulation mould
Block uses customer end/server mode, and the attitude data of dummy vehicle is sent to server by client, and server receives appearance
State data and will flight control program output control instruction be sent to dummy vehicle, select the SOCKET of C language to be socketed
Word writes client and server code to realize that the normal of data sends and receives function.
Beneficial effect
1, ginseng process can not be continuously adjusted including complicated model foundation in view of drawback present in existing emulation mode,
The state of aircraft can not be intuitively observed in real time;The present invention realizes the design method of real-time simulation by providing, meanwhile, for imitative
During true the problem of non-adjustable ginseng, this programme contains human-computer interaction interface, and user can change flight at the interface at any time
The relevant parameter of device is emulated without interrupting;Scheme contains what comes into a driver's interface simultaneously, and user can be clearly seen at the interface
The state of flight of aircraft under parameter current;Has the characteristics that succinct, high real-time and visual.
2, when carrying out proof of algorithm using the simulation softwares such as MATLAB or emulation platform, simulation result usually can not be real-time
It has been shown that, to modify system parameter, the current emulation such as needing to terminate or stop emulation just being can be achieved, and the result after change can not be stood
When show, therefore, it is difficult to embody real-time feature.For this purpose, the emulation platform purpose of invention is, such as needed when emulating and carrying out
Adjust system parameter, can be directly modified in the respective window of emulation module, emulation can continue under new parameter into
Row, without terminal, so as to observe in real time, simulation result changes because of caused by parameter change, realizes online tune ginseng.
3, the simulation time scale of existing emulation platform is mostly larger with real system gap, and this platform is in real-time side
It face can preferably approaching to reality system;Meanwhile the what comes into a driver's module of platform can be by state of flight of the aircraft in simulation process
It displays in real time out, allows user that can more intuitively understand the current state of aircraft.
Detailed description of the invention
Fig. 1 is flow chart of the invention;
Fig. 2 is emulation module interface layout schematic diagram of the present invention;
Fig. 3 is data real-time display module effect picture;
Fig. 4 data check module effect picture;
Fig. 5 emulation module human-computer interaction interface;
Fig. 6 what comes into a driver's modular structure block diagram;
Fig. 7 dummy vehicle schematic diagram;
The procedural block diagram of Fig. 8 animation
Fig. 9 distribution is analogue system structural block diagram;
Figure 10 what comes into a driver's modular simulation software implementation process figure;
Specific embodiment
The present invention relates to a kind of online real-time emulation method based on MATLAB, with longitudinal model of hypersonic aircraft
For, its design method is introduced, realizes the online real-time simulation of the visualization of hypersonic aircraft.
As shown in Figure 1, providing the whole design scheme of emulation platform first.This Distributed Simulation Platform is altogether by three big modules
It constitutes, respectively main control module, emulation module and what comes into a driver's module.
Main control module is the hinge of entire Distributed Simulation Platform, in Simulink environment Imitating dummy vehicle,
Data are carried out with emulation module in simulation process mutually to pass, and attitude data is sent to what comes into a driver's module, while there is control to emulate
The function of start and stop and storage emulation data.
Emulation module is equivalent to the controller of aircraft, the flight control program of operation support Simulink external schema and
Server program, the attitude of flight vehicle data transmitted according to main control module and given parameters provide control instruction simultaneously by calculating
It is sent to main control module.
What comes into a driver's module runs what comes into a driver's software, is responsible for the attitude of flight vehicle data that the transmission of real-time reception main control module comes, passes through
The form of animation shows aircraft real-time status, and user is made more intuitively to observe entire simulation process.
The invention also includes following steps to be practiced:
Initial parameter is arranged in S1 (101), emulation module;
S2 (102), main control module start simulation process;
2.1, the winged control Program transformation based on RTW;
2.2, building conversion communication network;
2.3, real-time simulation is handled;
S3 (103), emulation module receive corresponding data distribution different data processing modules implement human-computer interaction to aircraft
Output data output and curve image process;
S4 (104), what comes into a driver's module receive the state of flight that corresponding data shows aircraft in the form of animation;
S5 (105), emulation module realizes that on-line parameter adjusts by man-machine exchange interface, if curve graph in emulation module
Flight state is met the requirements in picture and what comes into a driver's module, then terminates simulation status;Otherwise return step S2, in which:
1, main control module
According to the function of main control module, realize mainly include three parts: the winged control Program transformation based on RTW, communication
The realization of building and the real-time simulation of network.
(1) the winged control Program transformation based on RTW
To realize the conversion for flying control program, first by taking longitudinal model of hypersonic aircraft as an example, in conjunction with Backstepping and
Dynamic inversion builds controller model in Simulink.
The main function of the controller is to go out control during emulation according to dummy vehicle state computation and refer to
It enables, change the parameter of controller in real time and the control instruction that controller exports is sent to dummy vehicle, make aircraft mould
Type makes corresponding change, and is able to achieve the function that real-time online changes data using the tool box RTW.Therefore, model is saved as
Flight_ctrl.mdl file carries out the generation of C code and external executable using RTW to controller model.
Before conversion, in order to save the dummy vehicle quantity of state of input after procedure simulation, first it is carried out
Output configuration: opening the scope module in model, and the History tabs in selection setting cancels Limit data option,
And Save data to workspace option is chosen, variable name is changed to All Data, and with the storage of Array format.
It is set followed by the generation option of C code and external program, opens Model Configuration
Parameters panel:
1. choose Solver tabs, will terminate the time be changed to inf, i.e. Infinite Time, set 0.05 for fixed step size, and
The higher ode4 algorithm of choice accuracy saves setting;
2. choosing Code Generation tabs, in Target selection option, Browse button is clicked,
Aims of systems file browser is opened, aims of systems file is changed to embedded real-time target, i.e. ert.tlc, clicks Apply,
Code Generation tabs is returned, Generate code only option is cancelled;
3. MAT-file logging option is chosen, to save the output data for flying control program.After the end of the program
Flight_ctrl.mat file can be generated, that the rt_yout in this document is saved is the two-way output data for flying control program, rt_
What tout was saved is simulation time.To avoid data from overflowing, sentence make_rtw OPTS is added in Make command window
="-DDEFAULT_BUFFER_SIZE=102400 ", so that Memory Allocation is reached 102400Byte, guarantees memory space,
Template makefile window adds ert_default_tmf;
4. choosing Interface tabs, External mode is selected in Interface option, in Transport
Tcpip is selected in layer option, so that the code generated is supported external schema emulation, saves arrangement above, return to Code
Generation tabs clicks Build button.After being successfully generated code, it will flight_ctrl.exe and ert_ occur
Main.c file.Flight_ctrl.exe is that the flight of the support external schema generated controls program, and ert_main.c is flight
Control the entrance of program.
(2) building of communication network
As shown in figure 9, the Distributed Flight device emulation platform in the present invention, which is based on TCP/IP communication agreement, carries out data biography
Defeated, main control module and emulation module use customer end/server mode, and the attitude data of dummy vehicle is sent to by client
Server, server receive attitude data and the control instruction of flight control program output are sent to dummy vehicle, select
Client and server code is write with the SOCKET Windows Sockets of C language to realize that the normal of data sends and receives function
Can:
The ert_main.c file for finding and opening previous step generation first, finds rt_ in int_T main () function
OneStep () function, before the function addition creation, binding, monitor, receive connection etc. socket word code and receive data
Correlative code, after it addition send data and disconnect close socket correlative code, save simultaneously to flight control
Simulation re-starts C code generation, has just obtained the flight control program for being added to code server, has realized emulation platform
Server in communication.After starting the program, program will be in client state be monitored, until client connection request arrives
Come, flight control program just will continue to run;
It adopts later and establishes client in a like fashion, the difference is that, benefit is not needed after establishing client socket
Socket binding is carried out with bind () function, but connect () function is used to send connection to specified server socket
Request.
After the building for completing communication network, still by taking longitudinal model as an example, dummy vehicle is built in simulink.It should
Controller shares seven inputs, and respectively speed V, flight-path angle γ, angle of attack, accelerator open degree β, height h, pitch rate q and throttle are opened
The first derivative of degreeThere are two outputs, instruct β for accelerator open degreecWith elevator angle δe.To guarantee that dummy vehicle is defeated
Data and flight control program received data out are the data of synchronization and same precision, are needed in dummy vehicle
Configuration Parameters panel in solution musical instruments used in a Buddhist or Taoist mass is set as fixed step size, ode4 algorithm, fixed step size 0.05,
This is identical as the flight control basic parameter setting of program.
It is subsystem by model encapsulation to enhance its readability, introduces C-MEX Sfunction module and serve as client
End, and it is named as client.c, it is communicated with the server of flight control program.In final dummy vehicle, C-MEX
The input of Sfunction module is seven output variables of dummy vehicle, and exporting is the two of the dummy vehicle received
A input variable.
It modifies later to C-MEX Sfunction module and client code is written:
The name of Sfunction module is changed to client by the first step, and the header file that client code needs is added, fixed
1 input port number is arranged in the required variable of justice in mdlInitializeSizes () function of Sfunction module, and
The dimension of input is 7;The port number of output is 1, and the dimension of output is 2;Sampling time is 0.05;Other settings keep default
Value;
Second step carries out the statement and definition of data type conversion subfunction outside all function bodies, and in mdlStart
Client socket is created in () function, and the server info to be connected is set, such as IP address and port numbers;?
Sending and receiving for data is carried out in mdlOutputs () function;
Third step closes client socket, free system resources in mdlTerminate () function;
Finally, the command window input mex client.c in MATLAB is instructed to the C-MEX just edited
Sfunction is compiled.
(3) realization of real-time simulation
Since the simulation model simulation time is faster than system time very much, in order to time for keeping MATLAB emulation used with
Actual time is consistent, needs to add delay code in client and server program, makes dummy vehicle by between certain time
Every reception control instruction.When being obtained with can be convenient used in currently emulation using the Clock module in the module library Simulink
Between, the time difference for needing to be delayed is calculated, is delayed using the Sleep function in C language, to reach the effect of real-time simulation
Fruit.C code and executable program, the Sfunction of dummy vehicle are regenerated to flight control program after modification code
Module needs to recompilate client.c file.
As shown in Fig. 2, emulation module should be able to realize five functional: data real-time reception, data real-time display, data are deposited
Storage, data are checked, real-time curve is drawn.Its system block diagram such as Fig. 1, data reception module receive the data that client transmits, will
Data pass to data real-time display module, data memory module and real-time curve drafting module respectively.Wherein data memory module
Data are passed to data after processing and check module.It is unified after all background modules carry out relevant treatment to the data transmitted
Human-computer interaction interface is passed to, data are shown, user checks so as to platform.
According to the functional requirement of emulation module, the planning such as Fig. 2 is carried out to its interface, wherein the upper left corner is aircraft figure
Piece, the upper right corner are that data store and check part, and lower section is the curve graph of data analysis, to show the real-time change of parameters
Change process.
Platform uses VC6.0 as developing instrument, is programmed using C++, its development process is explained below.
(1) integral layout designs
It is first turned on VC6.0, creates a new MFC single document exe program, saves and be named as chap10, insertion one
Its title, is changed to that " Distributed Flight device emulates flat by a new DIALOG, an and static text is inserted into middle position above
Platform simulation management software " adds three group frames respectively in DIALOG1, and wherein the upper right corner and underface group frame are respectively designated as
" data are stored and checked " and " data analysis ".Picture control is added in the group frame of the upper left corner, is inserted into aircraft picture.Data are deposited
List control is added with analysis group frame in storage, while data button is checked in addition, checks that module realization is prepared for subsequent data.Most
Afterwards, by taking the model of hypersonic aircraft longitudinal direction as an example, seven Teechart controls are sequentially added in data analysis group frame, it is big
It is small to make the appropriate adjustments, proper alignment.
(2) data real-time reception
Local server end, that is, management software socket port address is set using server=socket function
It is fixed, while socket attribute is set, and is bound with server_addr.sin_port=htons (6000) to socket,
Management software, that is, server socket is arranged to listening state, the management software moment is made to be in the state for waiting connection.
When management software, that is, server end listens to or receives the connection request of the i.e. dummy vehicle of client, response
It is requested, while establishing a new thread.The description of server end is sent to client, client is waited to confirm that this is retouched
State, once confirmation, connection establish, server to client provide respective service, server end be in again before monitoring shape
State continues waiting for the connection request for receiving other clients, to complete communication and service.It is received using Getdata () function
Data provide respective service to request.
(3) data real-time display
For data real-time display module, due to that will have new data to arrive every 20ms, data need 20ms
It updates primary.In interface appropriate location, that is, data storage with check one listbox control of insertion in group frame, control and by this
Part is associated with variable m_list, will be in list using m_list.InsertItem () function in control initialization procedure
The corresponding name variable of each column is labeled in the first row, will circulation connects every time in data real-time reception module in loop body
Seven data received are by sprintf () function by int type (rank-numeral, a not upper module receive) and double type
Variable (data that data reception module receives) is uniformly converted into char type variable, and uses m_list.InsertItem ()
Seven numbers that function receives this factually when display correspond to the corresponding position of table in human-computer interaction interface and (need herein
Pay attention to carrying out line feed processing).Display effect such as Fig. 3.
(4) data store
After data receiver, in addition to display, also need to be stored, to check.First with gcvt function floating-point
Number is converted into character string, while returning to direction character string storage location, that is, buffer area pointer.To data [i] assignment, and
By seven pointers, signified character string successively shows respectively.Then it generates and opens the testdata.txt text named
A character string, after being successfully written a character string, the position indicator pointer meeting of file is written to the document using fputs function in part
It automatically moves back, thus one group of data is written.Judged using conditional statement, seven data of every write-in enter a new line, simultaneously
Clear buffer.This process is repeated, until aircraft simulation system is out of service.
(5) data are checked and are separately deposited
The function that data are checked and separately deposited is realized on the basis of data storage.First one is added in main interface " to check
Data " button, and this button is executed into one specified external program of operation and control by ShellExecute () function
Function.In the design of this external program, an edit box, and associated variable m_ are added in appropriate location first
FileText, added respectively on interface two buttons " open " with " saving as ", realize open text document with by this text
Shelves save as the function in other paths.
The text document that open button click event is shown needed for opening, the content being successively read in document close choosing
The document selected, and content in document is shown in edit box;" saving as " button click event processing function will be deposited separately
It is shown for document path, the creation of this document of composing a piece of writing of going forward side by side, content shown in edit box, is separately being deposited before acquisition
For text document in be written edit box in data, by file.Close () close save as text document.Effect picture
Such as Fig. 4.
(6) real-time curve is drawn
It is every received one group of data after, by receive seven data respectively with timing node correspond, with coordinate
The form of point is added to respectively on corresponding seven real-time curve charts, and then constitutes seven curves.
Control Teechart is downloaded and registered, is successively added in the appropriate different location of interactive interface, that is, data analysis group frame
7 Teechart controls, are initialized respectively, such as are named, selected a chart type, the setting of transverse and longitudinal coordinate, and seven are controlled
Part is respectively associated m_chart, m_chart1, m_chart2, m_chart3, m_chart4, and m_chart5, m_chart6 seven
Variable.After receiving seven real time datas each time, using m_chart.Series (0) .Add () function every number
According to being depicted in curve graph, circulation drawing process terminates until emulation.Its end interface is as shown in Figure 5.
3, what comes into a driver's module
What comes into a driver's module most important function in emulation platform is exactly the flight of the real-time display aircraft in the form of animation
State for this purpose, what comes into a driver's module needs to have the function of data receiver, while will guarantee the real-time of animation transformation.Its structural frames
Figure such as Fig. 6.This patent is completed basic scene using OpenGL and is drawn, and is based on VC++, builds software by the exe program of MFC
Frame achievees the effect that aircraft moves by coordinate transform, realizes animation effect by Double buffer function, transmitted by data
Module realizes real-time simulation function.
(1) basic scene is drawn
The foundation of dummy vehicle and model of place is completed first.Dummy vehicle is drawn by link OpenGL shape library
And it is rendered, simple model such as Fig. 7.In order to allow emulation that there is more true visual effect, use glFrustum ()
Simulation space is built with functions such as gluLookAt (), the mode that comprehensive random refresh point and fixed point rule move makes starry sky
Background, and add earth model.
(2) software frame is built
Next OpenGL function is realized under MFC single document environment, builds the environment of entire simulation software.Start VC++
6.0 creation one new MFC single document exe program, change header file, before program be added #include gl gl.h and #
Include gl glu.h, open linking button, before the various libraries of link be added OpenGL32.Lib and glu32.Lib,
And mydraw (), mypixelformat (), myfirst () function are added, picture is set in function mypixelformat ()
Plain format creates rendering context in myfirst () function, and visual field and viewpoint are arranged in Onsize () function,
Background process is added in OnDraw (), plot statement is added in mydraw (), various icons are edited in Dialog and are pressed
Visual field creation is completed in button operation.
After visual field creation is completed, the dummy vehicle drawn and simulation space model, including starry sky and the earth are imported.
Timer function is opened by push-botton operation, the creation inquiry network connection code in timer function realizes net using socket
The foundation in network channel carries out the reception and use of data.
As shown in Figure 10, for the ease of observation, a new button is created in toolbar, button the corresponding command is established, adds
The class for adding receptance function, the write-in full screen display code in obtained respective function.Two mouse response letters are being established at the beginning
Number is written response code, respectively corresponds mouse button down and lift with mouse button, to open OpenGL program, due to not leading to also
The color that fixed point defines figure is crossed, so the basic software frame for being in black state is shown at this time.
OpenGL defines color using glColor () function, is defined next by calling glColor3f (x, y, z)
The color value that drawing uses, function three values are trichromatic display matrix.But the color shown sometimes can not natural terrain
Show the true colors of object, therefore OpenGL introduces the general of illumination and object material while defining object vertex color
It reads.
OpenGL passes through function glDisable by function glEnable (GL_LIGHTING) Lai Qidong illumination applications
(GL_LIGHTING) illumination is closed, passes through function glLightfv (GLenum light, GLenum pname, const
GLfloat*p illumination attribute) is defined, is diffused photograph used here as the general overall situation;OpenGL passes through function
Material variable is arranged in glMaterialfv (GLenum face, GLenum pname, const GLfloat*p), used here as
Most basic metalloid material setting.
Further, in order to make image seem softer, anti-aliasing processing is carried out.OpenGL passes through glEnable (GL_
POINT_SMOOTH the anti-aliasing for) carrying out opening point, shields anti-aliasing with glDisable (GL_POINT_SMOOTH), line and more
Side shape corresponds to LINE and POLYGON.
Finally carry out the setting of celestial body textures.OpenGL completes the bitmap behaviour of image by the direct operation to pixel
Make, to complete to draw.Specific as follows: OpenGL reads one piece of figure in color caching using glReadPixels () function
As simultaneously saving, by glDrawPixels () function by the position where the Image Rendering of array to screen grating, function
GlCopyPixels () completes the screen position where from screen copy image to grating.
(3) real-time animation and emulation
Building for simulated environment is completed, carries out the realization of animation and real-time simulation below.OpenGL utilizes Double buffer meter
Calculation machine drawing technique realizes animation, and model variation is realized by coordinate transform, and process is as shown in Figure 8.
When using coordinate transform drawing image, glTranslate (x, y, z) function can be called, to model in screen
The position of middle display carries out displacement definition;GlRotate (angle, x, y, z) function is called to respectively indicate around x, y, z-axis rotation
Angle angle realizes the control of aircraft angle;By calling the remote small nearly big variation of glScalef (a, b, c) function representation
Situation;By calling glMatrixMode (GL_PROJECTION) function to start projection matrix, projective transformation is carried out, three-dimensional
Coordinate is transformed to two-dimensional screen coordinates, and three-dimensional virtual object is shown on computer screen, and user is enabled to have sighting distance and visual field
Concept, viewing impression it is truer;It, can by calling the range of function glViewport (0,0, cx, cy) Lai Dingyi vision area
To generate the effect of split screen, i.e., multiple vision areas are shown under the same window.
In order to realize animation effect, switching variable flykey is added in public variable, button is added in public function
Function respond myflykey (), in myflykey () function add open system timer code SetTimer (1,50,
NULL), after pressing start button and entering state of flight, constantly refresh timer, then the image refreshed each time is drawn out, and
Using dual-cache mechanism, SwapBuffers () function is just called after completing the calculating that screen updates are drawn, complete screen with
Backstage cache image alternately displays, to generate animation effect.
Real-time reception processing for data, communicates referring initially to establishing above with emulation module, in the timer of main program
The code for receiving data is added in function, borrows the circulation of main program, real-time reception flight attitude data are simultaneously drawn.
This emulation platform is built based on Windows operating system, carries out dummy vehicle and controller using MATLAB
It builds, and is emulated, be based on VC6.0 using C++ and develop emulation module, be based on OpenGL using VC++ and develop what comes into a driver's module,
And carry out associative simulation.
Three modules are connected to the same interchanger using three ethernet lines, and locality connection is arranged in People Near Me respectively
IP address, make the IP address of three modules in same network segment.Test whether these three modules can communicate,
After inputting " ping target ip address " in windows command prompt, module can carry out communication test automatically.
Test it is errorless after, Distributed Flight device emulation platform can be started.In customer end/server mode, service
Device program has to start prior to client-side program, otherwise will be unable to go on smoothly communication.Therefore starting emulation mould is first had to
Block and what comes into a driver's module.
Then instructions are inputted in the MATLAB command window of main control module:
!flight_ctrl-tf inf-w&
The effect of the order is that flight control external program is opened with unlimited operating status, the start and stop of program by
Simulink control.The connection in flight control program Simulink model and operation button are clicked later.Server program is complete
After portion's starting, corresponding program can occur obstruction until dummy vehicle by client transmission come data, each program just can be after
Reforwarding row goes down.
After server program is all turned on, in dummy vehicle, operation button is clicked with normal state simulation mode, it is distributed
Aerial vehicle simulation platform brings into operation.It can be suspended at any time by the pause button in main control module in emulation platform operational process
With continue emulation, stop button terminate emulation.User can refer in directly modification in the Simulink model of flight control program
Parameter is enabled, realizes that real-time online adjusts the function of flight state by external schema.
The off-line simulation for first carrying out dummy vehicle and controller, configures consistent with emulation platform., as standard with
The result of emulation platform compares, to verify its feasibility.
It should be pointed out that for those of ordinary skill in the art, without departing from the inventive concept of the premise,
Various modifications and improvements can be made, and these are all within the scope of protection of the present invention.Therefore, the scope of protection of the patent of the present invention
It should be determined by the appended claims.
Claims (3)
1. a kind of small distributed hypersonic aircraft real-time emulation system, by main control module, emulation module and what comes into a driver's module
It constitutes, which is characterized in that
Main control module is the hinge of entire Distributed Simulation Platform, in Simulink environment Imitating dummy vehicle, is being emulated
Data are carried out with emulation module in the process mutually to pass, and attitude data is sent to what comes into a driver's module, while there are control emulation start and stop
With the function of storage emulation data;
Emulation module is equivalent to the controller of aircraft, the flight control program of operation support Simulink external schema and service
Device program, the attitude of flight vehicle data transmitted according to main control module and given parameters provide control instruction by calculating and send
To main control module;Wherein, the emulation module includes data reception module, data real-time display module, data memory module, number
It is investigated that seeing module, real-time curve drafting module and human-computer interaction interface;
What comes into a driver's module runs what comes into a driver's software, is responsible for the attitude of flight vehicle data that the transmission of real-time reception main control module comes, passes through animation
Form show aircraft real-time status, so that user is more intuitively observed entire simulation process, in which: the what comes into a driver's module includes
Animation display unit, visual display unit, data reception processing unit and dummy vehicle and model of place.
2. a kind of small distributed hypersonic aircraft real-time emulation system according to claim 1, it is characterised in that:
Include the following steps:
Initial parameter is arranged in S1, emulation module;
S2, main control module start simulation process;
2.1, the winged control Program transformation based on RTW;
2.2, building conversion communication network;
2.3, real-time simulation is handled;
S3, it is defeated to aircraft output data that emulation module receives corresponding data distribution different data processing modules implement human-computer interaction
Out with curve image process;
S4, what comes into a driver's module receive the state of flight that corresponding data shows aircraft in the form of animation;
S5, emulation module realizes that on-line parameter adjusts by man-machine exchange interface, if curve image and what comes into a driver's in emulation module
Flight state is met the requirements in module, then terminates simulation status;Otherwise return step S2.
3. a kind of small distributed hypersonic aircraft real-time emulation system according to claim 2, it is characterised in that:
The main control module and emulation module, which are based on TCP/IP communication agreement, to carry out data transmission, and main control module and emulation module are using visitor
The attitude data of dummy vehicle is sent to server by family end/server mode, client, and server receives attitude data simultaneously
And the control instruction of flight control program output is sent to dummy vehicle, select the SOCKET Windows Sockets of C language to compile
Client and server code is write to realize that the normal of data sends and receives function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910443127.3A CN110134025B (en) | 2019-05-26 | 2019-05-26 | Real-time simulation system of small distributed hypersonic aircraft |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910443127.3A CN110134025B (en) | 2019-05-26 | 2019-05-26 | Real-time simulation system of small distributed hypersonic aircraft |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110134025A true CN110134025A (en) | 2019-08-16 |
CN110134025B CN110134025B (en) | 2022-05-27 |
Family
ID=67581722
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910443127.3A Active CN110134025B (en) | 2019-05-26 | 2019-05-26 | Real-time simulation system of small distributed hypersonic aircraft |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110134025B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021035702A1 (en) * | 2019-08-30 | 2021-03-04 | 深圳市大疆创新科技有限公司 | Application program testing method, device and storage medium |
CN113435012A (en) * | 2021-06-02 | 2021-09-24 | 上海华穗电子科技有限公司 | Distributed aircraft simulation method and device and electronic equipment |
CN113658340A (en) * | 2021-07-07 | 2021-11-16 | 中国人民解放军火箭军工程大学 | Semi-physical simulation system of hypersonic aircraft navigation and control system |
CN115222851A (en) * | 2022-07-05 | 2022-10-21 | 上海烜翊科技有限公司 | Visual simulation method, visual simulation system, computer equipment and storage medium |
CN117555252A (en) * | 2023-11-14 | 2024-02-13 | 天津大学 | Wide-speed-domain hypersonic aircraft control virtual simulation verification system and assessment method |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101950157A (en) * | 2010-07-30 | 2011-01-19 | 北京航空航天大学 | Flight simulation system with high instantaneity |
CN102426424A (en) * | 2011-09-28 | 2012-04-25 | 天津大学 | Visual emulation method of near-space flying vehicle based on distributed framework |
CN102800130A (en) * | 2012-07-04 | 2012-11-28 | 哈尔滨工程大学 | Water level-close aircraft maneuvering flight visual scene simulation method |
CN103093047A (en) * | 2013-01-12 | 2013-05-08 | 天津大学 | Typical aircraft visual simulation system |
US20140172390A1 (en) * | 2010-09-08 | 2014-06-19 | The Boeing Company | Establishing availability of a two-engine aircraft for an etops flight or an etops flight path for a two-engine aircraft |
CN105159136A (en) * | 2015-07-23 | 2015-12-16 | 中国商用飞机有限责任公司北京民用飞机技术研究中心 | Flight simulation visual display method and system |
CN109709821A (en) * | 2018-11-28 | 2019-05-03 | 北京空天技术研究所 | Communication time-delay measurement method on bullet |
-
2019
- 2019-05-26 CN CN201910443127.3A patent/CN110134025B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101950157A (en) * | 2010-07-30 | 2011-01-19 | 北京航空航天大学 | Flight simulation system with high instantaneity |
US20140172390A1 (en) * | 2010-09-08 | 2014-06-19 | The Boeing Company | Establishing availability of a two-engine aircraft for an etops flight or an etops flight path for a two-engine aircraft |
CN102426424A (en) * | 2011-09-28 | 2012-04-25 | 天津大学 | Visual emulation method of near-space flying vehicle based on distributed framework |
CN102800130A (en) * | 2012-07-04 | 2012-11-28 | 哈尔滨工程大学 | Water level-close aircraft maneuvering flight visual scene simulation method |
CN103093047A (en) * | 2013-01-12 | 2013-05-08 | 天津大学 | Typical aircraft visual simulation system |
CN105159136A (en) * | 2015-07-23 | 2015-12-16 | 中国商用飞机有限责任公司北京民用飞机技术研究中心 | Flight simulation visual display method and system |
CN109709821A (en) * | 2018-11-28 | 2019-05-03 | 北京空天技术研究所 | Communication time-delay measurement method on bullet |
Non-Patent Citations (3)
Title |
---|
YU QI等: "A Model-based Fault Injection System For Aerocraft Wing Structure", 《IEEE》 * |
孙明玮 等: "飞行器定时航迹规划及其交互仿真平台设计", 《系统仿真学报》 * |
张健 等: "基于实时飞行仿真的无人机任务规划系统设计", 《数学的实践与认识》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021035702A1 (en) * | 2019-08-30 | 2021-03-04 | 深圳市大疆创新科技有限公司 | Application program testing method, device and storage medium |
CN113435012A (en) * | 2021-06-02 | 2021-09-24 | 上海华穗电子科技有限公司 | Distributed aircraft simulation method and device and electronic equipment |
CN113435012B (en) * | 2021-06-02 | 2024-07-02 | 上海华穗电子科技有限公司 | Distributed aircraft simulation method and device and electronic equipment |
CN113658340A (en) * | 2021-07-07 | 2021-11-16 | 中国人民解放军火箭军工程大学 | Semi-physical simulation system of hypersonic aircraft navigation and control system |
CN113658340B (en) * | 2021-07-07 | 2024-01-02 | 中国人民解放军火箭军工程大学 | Semi-physical simulation system of hypersonic aircraft navigation and control system |
CN115222851A (en) * | 2022-07-05 | 2022-10-21 | 上海烜翊科技有限公司 | Visual simulation method, visual simulation system, computer equipment and storage medium |
CN115222851B (en) * | 2022-07-05 | 2024-01-26 | 上海烜翊科技有限公司 | Visual simulation method, simulation system, computer equipment and storage medium |
CN117555252A (en) * | 2023-11-14 | 2024-02-13 | 天津大学 | Wide-speed-domain hypersonic aircraft control virtual simulation verification system and assessment method |
Also Published As
Publication number | Publication date |
---|---|
CN110134025B (en) | 2022-05-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110134025A (en) | A kind of small distributed hypersonic aircraft real-time emulation system | |
CN103870665B (en) | Space manipulator aids in docking operation three dimension dynamic simulation method | |
CN108074274A (en) | BIM model real-time rendering method and devices based on browser | |
CN116068990B (en) | Star group intelligent fault diagnosis interactive virtual simulation platform verification method | |
CN103886631A (en) | Three-dimensional virtual indoor display system based on mobile equipment | |
CN110765620A (en) | Aircraft visual simulation method, system, server and storage medium | |
CN102608922B (en) | Real-time visual simulation platform of photoelectric theodolite based on Vega and RTW | |
CN109901713A (en) | Multi-person cooperative assembly system and method | |
CN104850700B (en) | A kind of collaborative Visual Simulation System | |
CN107703775A (en) | Hard and soft liquid coupling Complex Spacecraft analogue system and method | |
CN112214902B (en) | Real-time simulation system for attitude and orbit control and single-machine communication of satellite | |
CN106981232A (en) | A kind of virtual driving simulator based on unity3D | |
CN106097420A (en) | A kind of information processing method, device and equipment | |
CN113673894A (en) | Multi-person cooperation AR assembly method and system based on digital twin | |
CN111300412A (en) | Method for controlling robot based on illusion engine | |
CN107274777A (en) | A kind of Robot Virtual teaching system based on V Rep | |
CN116244778A (en) | Hydropower engineering simulation cloud picture display method and device, electronic equipment and storage medium | |
CN109859294A (en) | A kind of VR cartoon character three-dimensional modeling optimization method | |
US20210229286A1 (en) | Cyber-physical system-based remote control framework for robots | |
CN114896644A (en) | Implementation method of three-dimensional (3D) tower crane construction scene display system based on ThreeJS | |
CN112202861B (en) | BIM-based hydropower engineering method management application system | |
CN111694637B (en) | Online full-automatic multi-agent control simulation compiling system | |
CN109933085A (en) | A kind of multiple no-manned plane earth station system | |
Liu et al. | Design of digital intelligent factory software based on digital twin | |
CN112598556A (en) | Virtual-real combined remote DDC experimental platform and application thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |