A graphical multi-configuration transformation spacecraft control system simulation program generation method
Through graphical interactive operation and model-driven design, a simulation program for multi-configuration spacecraft can be quickly generated, solving the problems of low efficiency and difficulty in ensuring correctness in existing technologies, and realizing the simulation of autonomous and controllable multi-configuration spacecraft control systems.
Patent Information
- Application Number
- CN202310211804.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-02-27
AI Technical Summary
Existing technologies cannot efficiently generate simulation programs for multi-configuration spacecraft, resulting in low efficiency and difficulty in guaranteeing program correctness.
Using a graphical interactive operation method, a combined dynamic model is constructed from the dynamic model of a single spacecraft, the basic model is encapsulated to form a model library, and a simulation program is generated based on the simulator template to realize rapid modeling and mathematical simulation verification of the control system of multi-configuration spacecraft.
It significantly improves the generation efficiency of simulation programs for multi-configuration spacecraft, ensures the autonomous controllability and correctness of the programs, and solves the simulation problem of control systems for multi-configuration spacecraft.
Smart Images

Figure CN116243907B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a graphical multi-configuration transformation spacecraft control system simulation program generation method and belongs to the technical field of spacecraft control system design. BACKGROUND
[0002] The space station comprises a core cabin, an experiment cabin I and an experiment cabin II, and during assembly and construction, docking with manned spaceships and cargo spaceships is involved in each stage, and a total of dozens of configurations and multiple control modes are involved. In the prior art, only one or more spacecraft simulations of a single configuration are supported in the'spacecraft attitude and orbit control simulation program automatic generation method', if multiple simulation programs for multiple configurations are established according to the method, or a simulation program is manually established and codes for conversion between configurations are edited, the implementation efficiency is low, and the program correctness is difficult to guarantee. SUMMARY
[0003] The application solves the technical problem that the prior art has the defects, and provides a graphical multi-configuration transformation spacecraft control system simulation program generation method, which can standardize and centrally manage basic models (including sensor models, controller models, actuator models, dynamics models and environment models) written in C / C++ language, form a reusable model library, adopt a digital means, and quickly build a multi-configuration spacecraft GNC system simulation model in a graphical interactive operation mode, and perform mathematical simulation verification, so that the spacecraft GNC system simulation model is self-controllable and the development efficiency is significantly improved.
[0004] The technical solution of the application is a graphical multi-configuration transformation spacecraft control system simulation program generation method, which comprises the following steps:
[0005] A combined body dynamics model is constructed through a single spacecraft dynamics model;
[0006] The preset basic model is encapsulated and a model library is constructed;
[0007] The multi-configuration transformation spacecraft control system is modeled, including single spacecraft modeling, combined body spacecraft modeling, flight scene modeling and flight scene switching modeling;
[0008] Automatic connection and layout of the models are performed according to the model interface relationship;
[0009] A simulation program is generated based on a simulator template.
[0010] Further, the combination body dynamics model comprises: a combination body attitude dynamics simulation module, a combination body orbit dynamics simulation module, a module for configuring whether a single body exists, a position relationship and a relative attitude relationship between the single body and the combination body, a conversion module for converting the control force and the moment generated from each single body into the resultant force and the resultant moment of the combination body, and a conversion module for converting the attitude and the orbit position of the combination body into the attitude and the position of each single body.
[0011] Further, the single body spacecraft dynamics model comprises an interface for taking the output of the combination body dynamics model as the input of the single body spacecraft dynamics model, and when the interface is empty, the single body spacecraft dynamics model is calculated according to the independent single body dynamics model; and when the interface is not empty, the output information of the received combination body dynamics model is taken as the dynamics output information of the single body spacecraft dynamics model.
[0012] Further, the encapsulation of the preset basic model and the construction of the model library comprise:
[0013] The external interface of the preset C / C++ basic model is scanned, various information required for graphical modeling, including the interface and the parameter, is extracted, the neutral description file of the model is formed, and the encapsulation of the C / C++ basic model is completed;
[0014] The encapsulated C / C++ basic model is centrally managed through the basic model library, and uploading, downloading and version control functions are provided, thereby providing basic data for the graphical spacecraft control system modeling.
[0015] Further, the interface comprises an initialization function, a calculation function, an instruction response function, a breakpoint saving function and a breakpoint recovery function; and the parameter comprises an initialization parameter, an input parameter, an output parameter and a received instruction table.
[0016] Further, the modeling of the multi-configuration transformation spacecraft control system comprises:
[0017] Single body spacecraft modeling: the required model is selected from the model library, the connection of the input and the output of the selected model, including the sensor, the controller, the actuator, the dynamics and the environment, is completed, and the initialization setting, the calculation setting, the storage and display setting of the model are performed, thereby forming the single body spacecraft model;
[0018] Combination body spacecraft modeling: the input and the output of the single body spacecraft model and the preset basic model are connected, the relationship between the model or the spacecraft interfaces is determined, and the combination body spacecraft model is formed;
[0019] Flight scene modeling: the relationship between the spacecraft in the scene and the spacecraft is determined;
[0020] Flight scene switching modeling: arranging the positions of the scenes where the spacecrafts are located, and determining the transition relationship between the scenes through directional connection lines.
[0021] Further, the automatic connection and layout of the models according to the model interface relationship comprises:
[0022] Step 1: establishing the rule of whether the interfaces between the models can be connected;
[0023] Step 2: determining the set of interface pairs that can be connected according to the rule, and connecting the interfaces;
[0024] Step 3: determining the area occupied by the models that the connection line cannot pass through;
[0025] Step 4: discretizing the entire layout area into an m-row n-column grid;
[0026] Step 5: determining the grid positions of the starting point A and the ending point B of a connection line;
[0027] Step 6: obtaining the path of the connection line by simplifying the linked list of the grid through which the path from A to B can pass;
[0028] Step 7: repeating steps 5 to 6 to complete the connection of all the models.
[0029] Further, the rule of whether the interfaces between the models can be connected comprises:
[0030] One input interface and one output interface are allowed to be connected; two input interfaces are not connected; two output interfaces are not connected;
[0031] The same type of interfaces are allowed to be connected;
[0032] One input interface has only one connection line, and one output interface has one or more connection lines;
[0033] The interfaces of the same model are not connected.
[0034] Further, the generation of the simulation program based on the simulator template comprises:
[0035] The code generator generates the simulator code file and the simulator engineering description file according to the spacecraft control system modeling information and the simulator template, and copies the model source code file to the code generation directory;
[0036] The simulator VC project is generated by using the VC project generator and the engineering description file;
[0037] The simulator dll is compiled from the simulator VC project by using the VC project compiler.
[0038] A computer readable storage medium, the computer readable storage medium stores a computer program, the computer program is executed by a processor to realize the steps of the simulation program generation method of the graphical multi-configuration transformation spacecraft control system.
[0039] Compared with the prior art, the application has the advantages that:
[0040] (1) The application is based on the model-driven design concept, utilizes the model reusability and modular design means, directly calls the model from the basic model library, avoids the code repeated writing work, and saves about 2 / 3 of the total time for generating the code compared with the all manual code writing;
[0041] (2) The application adopts the graphical interactive operation mode, the graphical module automatic wiring and layout, can quickly build the multi-configuration spacecraft GNC system simulation model, and performs mathematical simulation verification, realizes the self-controlling, and significantly improves the development efficiency;
[0042] (3) The application breaks through the spacecraft control system simulation problem of a kind of model connection relationship variable such as multi-configuration transformation, solves the difficult problem that the space station multi-configuration simulation is difficult to maintain. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 The simulation program generation method flowchart of the application. DETAILED DESCRIPTION
[0044] In order to better understand the above technical solutions, the application technical solutions will be described in detail below by means of the accompanying drawings and specific embodiments. It should be understood that the embodiments of the application and the specific features in the embodiments are detailed descriptions of the application technical solutions, but not limitations of the application technical solutions. In the case of no conflict, the technical features in the embodiments of the application and the embodiments can be combined with each other.
[0045] The application embodiment provides a graphical multi-configuration transformation spacecraft control system simulation program generation method, which will be further described in detail below in combination with the accompanying drawings of the specification. The specific implementation mode can include (as shown in the figure): Figure 1 The single spacecraft dynamics model is used to construct the combination body dynamics model; the preset basic model is encapsulated and the model library is constructed; the multi-configuration transformation spacecraft control system is modeled; the simulation program is generated based on the simulator template; and the simulation program is generated based on the simulator template.
[0046] The combination body dynamics model is constructed by the single spacecraft dynamics model, including the following steps:
[0047] Step 1: Construct a combination body dynamics model, the combination body dynamics model includes a combination body attitude dynamics simulation module, a combination body orbit dynamics simulation module, a single body existence, a single body and a combination body position relationship and relative attitude relationship configuration module, a conversion module for converting the control force and torque generated from each single body into the resultant force and resultant torque of the combination body, and a conversion module for converting the combination body attitude and orbit position into the attitude and position of each single body;
[0048] Step 2: In the single spacecraft dynamics model, an interface for outputting the combination body model as the dynamics input of the single spacecraft is added: when the interface is NULL, the single spacecraft dynamics is calculated according to the independent single body dynamics model; when the interface is not NULL, the received combination body model output information is taken as the dynamics output information of the single spacecraft.
[0049] The encapsulation of the preset basic model and the construction of the model library include the following steps:
[0050] Step 1: The model encapsulation scans the external interface of the C / C++ basic model, extracts various information required for graphical modeling, mainly including two categories: one is the interface, including the initialization function, the calculation function, the instruction response function, the breakpoint saving function, the breakpoint recovery function, etc.; the other is the parameter, including the initialization parameter, the input parameter, the output parameter, the received instruction table (instruction ID, instruction name, instruction description, instruction parameter), forming the neutral description file of the model;
[0051] Step 2: Through the basic model library, the encapsulated C / C++ model is centrally managed, and functions such as uploading, downloading and version control are provided to provide basic data for the graphical spacecraft control system rapid modeling.
[0052] The modeling of the multi-configuration transformation spacecraft control system includes the following steps:
[0053] Step 1: Single spacecraft modeling, by dragging the required model from the model library to the spacecraft, connecting the sensor, controller, actuator, dynamics, environment and other basic models for input / output, and initializing the model, setting the calculation, storage and display settings, etc., to form a single spacecraft model;
[0054] Step 2: Combination spacecraft modeling, dragging the single spacecraft model, basic model, etc. to the spacecraft, connecting the input / output to determine the relationship between the model or spacecraft interfaces, forming a combination spacecraft model;
[0055] Step 3: Flight scene modeling, by dragging the required spacecraft from the spacecraft list to the scene to determine the relationship between the spacecraft in the scene and the spacecraft;
[0056] Step 4: Flight scene switching modeling, by dragging the required scene from the scene list to the scene graph, and appropriately arranging their positions, and then determining the transition relationship between scenes through directional connection lines.
[0057] The model automatic connection and layout according to the model interface relationship includes the following steps:
[0058] Step 1: Establish rules for whether the interfaces between models can be connected:
[0059] An input interface can be connected with an output interface; two input interfaces cannot be connected; two output interfaces also cannot be connected;
[0060] Interfaces of the same type can be connected, which means that the data structures represented by the interfaces are the same;
[0061] An input interface can only have one connection, while an output interface can have multiple connections;
[0062] Interfaces of the same model cannot be connected.
[0063] Step 2: Determine the set of connectable interface pairs according to the rules and perform connection;
[0064] Step 3: Automatic layout of connections, first determine the area occupied by the model, which cannot be passed through by the connection;
[0065] Step 4: Discretize the entire layout area into an m-row n-column grid;
[0066] Step 5: For a connection, determine the grid positions of the starting point A and the ending point B;
[0067] Step 6: The algorithm becomes finding the shortest path of the grid from A to B, and after simplification, the path of the connection is obtained;
[0068] Step 7: Repeat steps 5 to 6 until all connections are traversed, completing the connection of all models.
[0069] The simulation program is generated based on the simulator template, including the following steps:
[0070] Step 1: Standardize a simulator template, which realizes the start, stop, pause, breakpoint saving and restoring, instruction injection, data saving and synchronization, etc., and can meet the monitoring and control requirements of control system simulation, realize instruction control and fault mode simulation;
[0071] Step 2: The code generator generates a simulator code file and a simulator engineering description file according to the spacecraft control system modeling information and the simulator template, and copies the model source code file to a code generation directory;
[0072] Step 3: A simulator VC project is generated by using a VC project generator (qmake.exe) and the engineering description file.
[0073] Step 4: The simulator VC project is compiled into a simulator dll by using a VC project compiler (MSBuild.exe).
[0074] In the scheme provided in the embodiments of the present application, the following steps are included:
[0075] Step 1: A combination body dynamics model is constructed, which includes a combination body attitude dynamics simulation module, a combination body orbit dynamics simulation module, a single body existence module, a position relationship and relative attitude relationship configuration module between the single body and the combination body, a conversion module for converting the control force and torque generated from each single body into the resultant force and resultant torque of the combination body, and a conversion module for converting the attitude and orbit position of the combination body into the attitude and position of each single body.
[0076] Step 2: In the single body spacecraft dynamics model, an interface is added for outputting the combination body model as the input of the single body spacecraft dynamics: when the interface is empty (NULL pointer), the single body spacecraft dynamics is calculated according to the independent single body dynamics model; when the interface is not empty, the received combination body model output information is taken as the dynamic output information of the single body spacecraft.
[0077] Through the construction of the combination body dynamics model and the modification of the interface of the single body spacecraft dynamics model, the sensor, the actuator and the dynamic connection relationship in the single body spacecraft remain unchanged, and when the single body is used as a sub-body in the combination body spacecraft, only the connection relationship between the combination body model and the single body spacecraft dynamics model needs to be configured, so that the spacecraft can be used as a sub-body in the combination body.
[0078] Step 3: The model encapsulation scans the external interface of the basic C / C++ model, extracts various information required for graphical modeling, mainly including two categories: one is the interface, including the initialization function, the calculation function, the instruction response function, the breakpoint saving function and the breakpoint recovery function; the other is the parameter, including the initialization parameter, the input parameter, the output parameter and the received instruction table (instruction ID, instruction name, instruction description and instruction parameter), to form a neutral description file of the model.
[0079] Step 4: Through the basic model library, the encapsulated C / C++ model is centrally managed, and functions such as uploading, downloading and version control are provided to provide basic data for the rapid modeling of the graphical spacecraft control system.
[0080] Step 5: Monomer spacecraft modeling, by dragging the required model from the model library to the spacecraft, connecting the sensor, controller, actuator, dynamics, environment and other basic models for input / output, and initializing the model, solving the setting, storage and display settings, etc., to form a monomer spacecraft model.
[0081] The monomer spacecraft model is stored in the monomer spacecraft list in the form of components and can be used for combined spacecraft modeling.
[0082] Step 6: Because there are many models and many connections during monomer spacecraft modeling, if the connections are directly connected, the connections will overlap with the models, and the graphics will appear very messy, which requires automatic layout technology for the connections.
[0083] In the automatic layout of the connection, the area occupied by the model is first determined, and these areas cannot be passed through. Then the entire layout area is discretized and divided into m rows and n columns of grids. The size of m and n needs to be appropriate, too large and the algorithm will take longer, too small and the effect will not be good. For a connection, determine the grid position of the starting point A and the ending point B, the algorithm becomes finding the shortest path of the grid from A to B, and finally the path of the connection is obtained through simplification.
[0084] Step 7: Combined spacecraft modeling, drag the monomer spacecraft model, basic model, etc. to the spacecraft, and perform input / output connection to determine the relationship between the model or spacecraft interfaces to form a combined spacecraft model.
[0085] Using existing monomer models, a large number of different configurations of combined bodies can be quickly modeled.
[0086] Step 8: Flight scene modeling, by dragging the required spacecraft from the spacecraft list to the scene to determine the relationship between the spacecraft in the scene and the spacecraft.
[0087] Step 9: Flight scene switching modeling, by dragging the required scene from the scene list to the scene graph and arranging their positions appropriately, and then connecting them with directional connections to determine the transition relationship between scenes.
[0088] Through scene switching, the simulation requirements of spacecraft multi-configuration transformation are realized.
[0089] Step 10: A simulator template is standardized, which realizes the start, stop, pause, breakpoint saving and restoring, instruction injection, data saving and synchronization of simulation, and can meet the monitoring and control requirements of the control system simulation, and realize the simulation of instruction control and fault mode;
[0090] Step 11: The code generator generates a simulator code file and a simulator engineering description file according to the spacecraft control system modeling information and the simulator template, and copies the model source code file to the code generation directory;
[0091] Step 12: The VC engineering generator (qmake.exe) and the engineering description file are used to generate a simulator VC engineering;
[0092] Step 13: The simulator VC engineering is compiled into a simulator dll by using the VC engineering compiler (MSBuild.exe).
[0093] The application provides a computer readable storage medium, which stores computer instructions, when the computer instructions run on a computer, make the computer execute Figure 1 The method.
[0094] Those skilled in the art should understand that the embodiments of the application can be provided as a method, a system, or a computer program product. Therefore, the application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the application can adopt a computer program product in the form of one or more computer usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer usable program codes.
[0095] The application is described with reference to flowcharts and / or block diagrams according to the methods, devices (systems), and computer program products of the embodiments of the application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks
[0096] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0097] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0098] It is to be understood that the phrases "first" and "second" are used only to distinguish one entity or action from another, and do not necessarily imply that these entities or actions are in any way mutually exclusive or that one precedes the other in any manner. Also, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0099] It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application cover modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.
[0100] The details of the application described herein are not intended to limit the scope of the application but rather to provide an example of how the application can be implemented.
Claims
1. A graphical method for generating simulation programs for multi-configuration transformation spacecraft control systems, characterized in that, include: A combined dynamic model is constructed by using a single spacecraft dynamic model. Encapsulate the preset basic models and build a model library; Modeling of the control system for multi-configuration transform spacecraft includes modeling of individual spacecraft, modeling of combined spacecraft, modeling of flight scenarios, and modeling of flight scenario switching. Automatically connect and lay out models based on model interface relationships; Generating simulation programs based on simulator templates; The single spacecraft dynamics model includes an interface that takes the output of the combined dynamics model as the input of the single spacecraft dynamics model. When the interface is empty, the single spacecraft dynamics model is solved according to the independent single-unit dynamics model. When the interface is not empty, the output information of the received combined dynamics model is used as the dynamics output information of the single spacecraft dynamics model. The modeling of the control system for the multi-configuration change spacecraft includes: Single spacecraft modeling: Select the required model from the model library, and complete the basic model input and output connection of the selected model's sensors, controllers, actuators, dynamics, and environment. Also, perform initialization settings, solution settings, storage and display settings for the model to form a single spacecraft model. Modeling of combined spacecraft: Connecting the input and output of individual spacecraft models and preset basic models, determining the relationships between models or spacecraft interfaces, and forming a combined spacecraft model; Flight scenario modeling: Determining the spacecraft and the relationships between them within the scenario; Flight scene transition modeling: Arrange the positions of each spacecraft in the scene, and then determine the transition relationship between scenes by connecting them with directional lines.
2. The graphical simulation program generation method for a multi-configuration transformation spacecraft control system according to claim 1, characterized in that, The combined dynamics model includes: a combined attitude dynamics simulation module, a combined orbital dynamics simulation module, a module for configuring the existence of individual units, the positional relationship between individual units and the combined system, and the relative attitude relationship, a conversion module for converting the control forces and torques generated by each individual unit into the resultant force and resultant torque of the combined system, and a conversion module for converting the attitude and orbital position of the combined system into the attitude and position of each individual unit.
3. The graphical simulation program generation method for a multi-configuration transformation spacecraft control system according to claim 1, characterized in that, The process of encapsulating the preset basic model and building a model library includes: The external interfaces of the pre-defined C / C++ basic model are scanned to extract various information required for graphical modeling, including interfaces and parameters, forming a neutral description file of the model and completing the encapsulation of the C / C++ basic model. The basic model library provides centralized management of encapsulated C / C++ basic models, offering upload, download, and version control functions, and providing basic data for graphical spacecraft control system modeling.
4. The graphical simulation program generation method for a multi-configuration transformation spacecraft control system according to claim 3, characterized in that, The interface includes an initialization function, a solution function, an instruction response function, a breakpoint saving function, and a breakpoint recovery function; the parameters include initialization parameters, input parameters, output parameters, and a received instruction table.
5. The graphical simulation program generation method for a multi-configuration transformation spacecraft control system according to claim 1, characterized in that, The automatic model connection and layout based on model interface relationships includes: Step 1: Establish rules for whether or not model interfaces can be connected; Step 2: Determine the set of connectable interface pairs according to the rules, and then connect them; Step 3: Determine the areas occupied by the model that the connecting lines cannot pass through; Step 4: Discretize the entire layout area into a grid of m rows and n columns; Step 5: For a given line, determine the grid positions of the starting point A and the ending point B; Step 6: The linked list of the grid with the shortest path from A to B is simplified to obtain the connecting path; Step 7: Repeat steps 5 and 6 to complete the connection of all models.
6. The graphical simulation program generation method for a multi-configuration transformation spacecraft control system according to claim 5, characterized in that, The rules governing whether or not the model interfaces can be connected include: A connection is allowed between one input interface and one output interface; a connection is not allowed between two input interfaces; a connection is not allowed between two output interfaces. Connections are allowed when the interface types are the same; An input interface has only one connection, while an output interface has one or more connections. Interfaces within the same model are not connected.
7. The graphical simulation program generation method for a multi-configuration transformation spacecraft control system according to claim 1, characterized in that, The generation of the simulation program based on the simulator template includes: The code generator generates simulator code files and simulator engineering description files based on the spacecraft control system modeling information and simulator template, and copies the model source code files to the code generation directory; Use the VC project generator and project description file to generate a VC project for the simulator; Use the VC project compiler to compile the emulator VC project into an emulator DLL.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Modelica model-based spacecraft dynamics and control model library construction method
CN108732938A
Method for generating a simulation model to evaluate aircraft flight systems
US10747917B1