A Python-based automated diagnostic method and control system for space electric propulsion.

An automated diagnostic method and control system implemented using Python has solved the problem of cumbersome manual operation in space electric propulsion diagnostic tests, and achieved efficient and reliable multi-condition performance diagnosis.

CN121614916BActive Publication Date: 2026-05-26BEIHANG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIHANG UNIV
Filing Date
2026-02-03
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing space electric propulsion diagnostic experiments rely on manual operation, which is labor-intensive and prone to operational errors, seriously affecting the reliability and efficiency of the experiments.

Method used

An automated diagnostic method based on Python is adopted, and a modular and scalable test process control is realized through a graphical user interface (GUI). It supports multi-level loops and preset variable settings, and automatically performs multi-condition performance diagnosis of electric propulsion.

Benefits of technology

The test process for multi-condition performance diagnosis of electric thrusters has been greatly simplified, improving test efficiency and reliability and reducing the need for manual operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121614916B_ABST
    Figure CN121614916B_ABST
Patent Text Reader

Abstract

This invention provides a Python-based automated diagnostic method and control system for space electric propulsion, relating to the field of space electric propulsion technology. The method includes: responding to an import operation of a Python function, displaying the imported Python function in the GUI of a host computer; responding to a configuration operation of preset variables, establishing a communication connection between the host computer and hardware instruments based on the preset variables, the hardware instruments including the space electric propulsion system to be diagnosed and its diagnostic equipment; responding to a configuration operation of a diagnostic script, adding the target Python function from the imported Python function to a specified location in the GUI, and having the GUI run to generate an automated diagnostic script; and responding to a running operation of the automated diagnostic script, running the automated diagnostic script on the hardware instruments to obtain the diagnostic experimental results of the space electric propulsion system. This invention can significantly simplify the multi-condition performance diagnostic test process for electric thrusters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of space electric propulsion technology, and in particular to a Python-based automated diagnostic method and control system for space electric propulsion. Background Technology

[0002] Space electric propulsion technology, due to its high specific impulse and low fuel consumption, has been widely used in missions such as deep space exploration and satellite attitude and orbit maintenance. In recent years, with the rapid development of commercial spaceflight, the construction of low-Earth orbit constellations has become a key focus in the aerospace field. For example, SpaceX's Starlink constellation (over 9,000 satellites) has already achieved large-scale space applications of electric propulsion technology. Currently, research on new high-performance space electric propulsion systems has become a hot topic, and evaluating the performance of newly developed space electric thrusters requires extensive testing.

[0003] Taking Hall thruster as an example, if the test conditions cover an anode voltage change of 200V, with one measuring point for every 25V, there would be nine measuring points; an anode gas flow rate change of 5sccm / 1sccm, six measuring points; a cathode position change, five measuring points; and an excitation coil current change of 2A / 1A, three measuring points; then there would be a total of 9*6*5*3, or 810 measuring points. If each measuring point is allowed to operate for a period of time until it reaches a relatively stable state, and then experiments such as plume divergence half-angle diagnosis (Faraday probe) and thrust diagnosis are performed, along with operations such as saving current waveforms and taking plume photos, each measuring point would require an average of at least 1-2 minutes of test time, resulting in a total test duration of 810-1620 minutes (over 24 hours). If manual operation is used throughout the entire test process, not only will the workload be extremely large, but operational errors are also prone to occur due to prolonged work, severely restricting the reliability and efficiency of the test. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a Python-based automated diagnostic method and control system for space electric propulsion, which can greatly simplify the multi-condition performance diagnostic test process for electric thrusters.

[0005] In a first aspect, the present invention provides a Python-based automated diagnostic method for space electric propulsion. The method is applied to a host computer in a diagnostic control system. The host computer stores Python functions corresponding to multiple modular sub-processes included in the diagnostic test procedure. The method includes:

[0006] In response to the import operation of Python functions, display the imported Python functions in the GUI of the host computer;

[0007] In response to the configuration operation of preset variables, a communication connection between the host computer and the hardware instruments and equipment is established based on the preset variables. The hardware instruments and equipment include at least the space electric propulsion system to be diagnosed and its diagnostic equipment.

[0008] In response to configuration operations on the diagnostic script, the target Python function that has been imported into the Python function can be added to a specified location in the GUI, and the GUI will run to generate an automated diagnostic script;

[0009] In response to the operation of the automated diagnostic script, the automated diagnostic script is run on the hardware instruments and equipment to obtain the diagnostic experimental results of the space electric propulsion system.

[0010] In one implementation, the host computer's GUI displays a loop tree setting control; in response to a configuration operation on the diagnostic script, the target Python function already imported into the Python function is added to a specified location in the GUI, and the GUI runs to generate an automated diagnostic script, including:

[0011] In response to the configuration operation of the loop tree setting control, the loop level and node distribution are determined to obtain a loop tree structure including multiple loop nodes;

[0012] In response to configuration operations on imported Python functions, determine the target Python function and its corresponding input variables from the imported Python functions;

[0013] In response to the selection operation of the loop node in the loop tree structure, the target Python function is added to the target loop node to obtain an automated diagnostic script.

[0014] In one implementation, in response to a selection operation on a loop node in a loop tree structure, a target Python function is added to the target loop node to obtain an automated diagnostic script, including:

[0015] In response to the selection operation of a cycle node in the cycle tree structure, the target cycle node is determined;

[0016] In response to the loop setting operation on the target loop node, the target Python function is added at the function addition position of the target loop node to obtain the initial diagnostic script; wherein, the function addition position is divided into Before sub-loop or After sub-loop. The Before sub-loop is used to indicate that the target Python function is executed before the child loop contained in the target loop node, and the After sub-loop is used to indicate that the child loop contained in the target loop node is executed before the target Python function.

[0017] In response to parameter setting operations on the initial diagnostic script, the return value of the target Python function is assigned to a specified variable to obtain an automated diagnostic script.

[0018] In one implementation, the method further includes:

[0019] In response to configuration operations on loop nodes in a loop tree structure, determine the node parameters corresponding to the loop node. The node parameters include one or more of the following: loop variable name, variable start value, variable end value, and step size.

[0020] In one implementation, the method further includes: in response to a save operation on the automated diagnostic script, saving the settings of the automated diagnostic script in the GUI as a file in a specified data exchange format, the GUI reading the file automatically completing the operations of importing script functions and setting preset variables, and reproducing the saved settings used by the GUI to generate the automated diagnostic script;

[0021] The method also includes: in response to the selection of a data exchange format file stored in the host computer, determining the target historical diagnostic settings and configuration operations; in response to the execution operation of the target historical diagnostic script, running the target historical diagnostic script for the space electric propulsion system to obtain the diagnostic experimental results of the space electric propulsion system.

[0022] In one implementation, the method further includes:

[0023] In response to custom operations in the sub-process scripts corresponding to modular sub-processes, the sub-process scripts are generated and wrapped as Python functions.

[0024] In one implementation, the method further includes:

[0025] The GUI of the host computer displays all or part of the diagnostic test results.

[0026] And / or, display the loop progress of the automated diagnostic script through the GUI of the host computer;

[0027] And / or, through the GUI of the host computer, display the target Python function currently being executed by the automated diagnostic script.

[0028] Secondly, the present invention also provides a space electric propulsion automated diagnostic control system based on Python, comprising:

[0029] The host computer is used to execute the Python-based automated diagnostic method for space electric propulsion provided in the first aspect;

[0030] Hardware instruments and equipment that are physically connected to the host computer via a serial port adapter cable, including at least the space electric propulsion system to be diagnosed and its diagnostic equipment.

[0031] Thirdly, the present invention also provides a host computer, including a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement any of the methods provided in the first aspect.

[0032] Fourthly, the present invention also provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement any of the methods provided in the first aspect.

[0033] This invention provides a Python-based automated diagnostic method and control system for space electric propulsion. Applied to a host computer within the diagnostic control system, the host computer stores Python functions corresponding to multiple modular sub-processes within the diagnostic test flow. First, in response to the import operation of the Python functions, the imported functions are displayed in the host computer's GUI. Then, in response to the configuration operation of preset variables, a communication connection is established between the host computer and the hardware instruments, which at least include the space electric propulsion system to be diagnosed and its diagnostic equipment. Next, in response to the configuration operation of the diagnostic script, the target Python functions from the imported functions are added to a specified location in the GUI, and the GUI generates an automated diagnostic script. Finally, in response to the execution operation of the automated diagnostic script, the script is run on the hardware instruments to obtain the diagnostic test results of the space electric propulsion system. This method uses Python to implement modular and scalable test flow control, flexibly assembling test functions through a graphical user interface (GUI), supporting multi-level loops and preset variable settings, thereby achieving automated diagnosis of multi-condition electric propulsion tests. Compared to existing technologies that typically rely on fixed scripts or dedicated software, resulting in poor flexibility and low integration efficiency, this invention solves the problems of variable diagnostic requirements, large experimental volume, and cumbersome operation in electric propulsion tests by leveraging Python's rich library ecosystem and modular design, significantly simplifying the multi-condition performance diagnostic test process for electric thrusters.

[0034] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0035] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0036] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0037] Figure 1 A flowchart illustrating an automated diagnostic method for space electric propulsion based on Python, provided as an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of a graphical user interface provided in an embodiment of the present invention;

[0039] Figure 3 A partial equipment connection diagram for a Hall electric propulsion diagnostic test provided in an embodiment of the present invention;

[0040] Figure 4 This is a schematic diagram of the structure of a host computer provided in an embodiment of the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] Currently, if manual operation is used throughout the entire experimental process for space electric propulsion diagnostic experiments, not only will the workload be enormous, but operational errors are also prone to occur due to prolonged work, which seriously restricts the reliability and efficiency of the experiment.

[0043] Because electric propulsion diagnostic tests exhibit localized consistency, particularly the highly similar operation of various diagnostic instruments / probes, these highly consistent operations can be extracted as basic units / modules. Furthermore, for a specific laboratory, the testing instruments and equipment used are mostly fixed; therefore, an automated diagnostic test control system for space electric propulsion can be built within a single laboratory. Based on this, this invention provides a Python-based automated diagnostic method and control system for space electric propulsion. Specifically, it provides a method and control system for modularly packaging electric thruster diagnostic test items, setting test procedures on a host computer according to the packaged test items, and executing automated electric propulsion diagnostic tests. Its Python-based approach demonstrates significant advantages in flexibility, scalability, and integration efficiency. Moreover, Python's rich library ecosystem allows users to quickly customize and extend functionality, easily integrating with web services or data analysis tools to achieve real-time data processing, thus greatly simplifying the multi-condition performance diagnostic test process for electric thrusters.

[0044] To facilitate understanding of this embodiment, a detailed description of a Python-based automated diagnostic method for space electric propulsion disclosed in this embodiment is provided first. This method is mainly used to study the working performance of a specified type of electric thruster under different operating conditions. The method is applied to the host computer in the diagnostic control system. The host computer stores Python functions corresponding to multiple modular sub-processes included in the diagnostic test procedure. See [link to documentation]. Figure 1 The diagram shows a flowchart of an automated diagnostic method for space electric propulsion based on Python. The method mainly includes the following steps S102 to S108:

[0045] Step S102, in response to the import operation of the Python function, to display the imported Python function in the GUI of the host computer.

[0046] Step S104: In response to the configuration operation of preset variables, a communication connection is established between the host computer and the hardware instruments and equipment based on the preset variables. The hardware instruments and equipment include at least the space electric propulsion system to be diagnosed and its diagnostic equipment. The space electric propulsion system generally refers only to the thruster and cannot establish a connection with the host computer. Devices that can establish a connection generally include: thruster power supply (belonging to the space electric propulsion system; the rest below belong to the diagnostic system), current and voltage acquisition devices (such as current and voltage acquisition modules, oscilloscopes, etc.), displacement mechanisms, etc.

[0047] Step S106: In response to the configuration operation of the diagnostic script, the target Python function in the imported Python function is added to the specified location in the GUI, and the GUI runs to generate the automated diagnostic script.

[0048] Step S108: In response to the operation of running the automated diagnostic script, the automated diagnostic script is run for the hardware instrumentation system to obtain the diagnostic experimental results of the space electric propulsion system.

[0049] The automated diagnostic method for electric propulsion based on Python provided in this invention uses Python to implement modular and scalable test process control. It flexibly assembles test functions through a graphical user interface (GUI), supports multi-level loops and preset variable settings, thereby achieving automated diagnostics for multi-condition electric propulsion tests. Compared to existing technologies that typically rely on fixed scripts or dedicated software, resulting in poor flexibility and low integration efficiency, this invention, through Python's rich library ecosystem and modular design, solves the problems of variable diagnostic requirements, large experimental volume, and cumbersome operation in electric propulsion testing, significantly simplifying the multi-condition performance diagnostic test process for electric thrusters.

[0050] In one implementation, a graphical user interface (GUI) is designed on the host computer. The GUI can import custom functions, preset variables, set multi-level loops, and add functions within the loops to conduct tests for multiple electric propulsion conditions. Modular electric propulsion diagnostic test operation scripts are written on the host computer. The automatic control scripts for diagnostic test items are packaged as functions and stored as files along with library and function import information. The host computer is connected to multiple controllable instruments and equipment (lower-level machines) that need to be controlled in the experiment, establishing communication via a bus. The necessary hardware instruments and equipment are connected, and during the test, the host computer automatically controls the lower-level machines according to the test flow set in the GUI to complete the test. The test control system includes: a software component, a GUI for setting the test flow and multiple pre-designed test sub-flow control scripts; and a hardware component, including the host computer, bus, lower-level machines, and other hardware required for the test (such as thrusters, wires, etc.). This invention provides a simple and intuitive operation for space electric propulsion tests, with a safe and reliable control process. It can significantly reduce the personnel required for space electric propulsion diagnostic tests and improve test efficiency.

[0051] To facilitate understanding, this embodiment of the invention provides a specific implementation of a Python-based automated diagnostic method for space electric propulsion.

[0052] (1) Select experimental hardware instruments and equipment according to experimental requirements. For instruments and equipment that need to be operated during the experiment, ensure that the instruments and equipment can be controlled via the bus; (2) Prepare the corresponding serial port adapter cable according to the bus required to control the instruments and equipment, and build a communication link from the host computer to the slave computer; (3) Divide the complete experimental process into multiple specific experimental items, including: first, divide out the main items in the experimental process, such as various probe diagnostics commonly used in space electric propulsion diagnostic experiments, including the specific operation steps of the power supply, motion mechanism, and measuring instruments and equipment required for a diagnosis; the operation of changing the power supply and flow meter status required for changing the working conditions of the electric propulsion system; record the power supply output current and voltage values, and show The signal read by the oscilloscope triggers the camera to take pictures and save photos, etc.; secondly, fill in some functional items required in the experiment, such as setting a waiting time between two functions, triggering a buzzer in a specific situation, writing the time and execution status into a log file, etc.; (4) For each experimental item, write an experimental script in the host computer according to the control instructions of the lower computer, that is, connect the serial port of the lower computer in the Python script according to the required operation process in the experimental item and send the corresponding instructions of the required operation in sequence; (5) Define each experimental item script as a Python function, and save each function to a specified file, including the library, function and function definition required in the function.

[0053] Further, see Figure 2 The diagram illustrates a graphical user interface (GUI) including multiple controls such as a function library, preset variables, function selection, and loop tree settings. The function library control is used to import files / directories and select files; the preset variable control is used to add / edit variables (such as ordinary values, serial port values, etc.) and delete variables; the function selection control is used to select functions from the function library and set function parameters; the loop tree settings control is used to set the loop structure (including loop tree nodes and parameters), add / remove / move functions to be executed, edit parameters and return values, etc. Specifically:

[0054] The "File" option includes "Save Global Settings", "Load Global Settings", and "Exit" options.

[0055] The "Function Library" section includes options for "Import Files", "Import Directory", and "Clear Selected Files".

[0056] The "Preset Variables" section includes options for "Add Variable", "Edit Variable", "Delete Variable", and "Save Variable".

[0057] Selecting "Add Variable" will bring up a pop-up tab, which includes a variable name input box, a variable type drop-down menu, a variable value input box, a serial port drop-down menu and a VISA (Virtual Instrument Software Architecture) instrument drop-down menu, baud rate and timeout input boxes, "Scan Serial Port" and "Scan VISA" buttons, and "Save" and "Cancel" buttons.

[0058] The “Selected Functions” section contains “Remove” and “Clear” options. In the “Function Library” section, clicking on a sub-function of an imported .py file will add it to the “Selected Functions” section.

[0059] Clicking on a function in the "Selected Functions" section will bring up the "Function Parameters" user interface (UI). In the UI, each input parameter variable name for that function corresponds to a drop-down menu, with options including "Manual Input" and the variable names of all preset variables and loop variables. The input box on the right is for manual input.

[0060] The "Loop Tree" section contains three sub-modules: the loop tree main structure setting section, the "node parameter setting" section, and the "function to be executed at each iteration of this node (located before / after the sub-loop)" section.

[0061] The main structure settings for the cyclic tree include options for "Add Root Cycle", "Add Child Cycle", and "Delete Node".

[0062] When any loop node is selected in the main structure settings of the loop tree, you can set the variable name, variable start value, variable end value and step size in the input box of the "Node Parameter Settings" section on the right, and there is an option to "Save Node Parameters";

[0063] The "Functions executed at each iteration of this node (before / After sub-loops)" section includes "Before sub-loop" and "After sub-loop" sections, each with five options: "Add", "Remove", "Move Up", "Move Down", and "Edit Parameters".

[0064] Above the "Execution Results" section, there are buttons for "Execute Selected Function", "Execute by Loop Tree", and "Stop Execution".

[0065] Based on the above embodiments, automated diagnostics of space electric propulsion are performed. Specifically:

[0066] (i) In response to the import operation of Python functions, the imported Python functions are displayed in the graphical user interface of the host computer. In practical applications, the GUI is opened, and a file or directory is imported from the "Function Library" section. The GUI automatically finds all Python functions defined in that file or directory.

[0067] (ii) In response to the configuration operation of preset variables, a communication connection between the host computer and the hardware instruments and equipment is established based on the preset variables. The hardware instruments and equipment include at least the space electric propulsion system to be diagnosed and its diagnostic equipment. In practical applications, the preset variables required for the experiment are set, including the communication serial port with the lower-level computer, and a connection between the host computer and the lower-level computer is established.

[0068] Optionally, after selecting "Add Variable", you can set the variable name and variable type in the pop-up tab. Variable types include normal value, serial port and VISA instrument. After selecting normal value, you need to manually enter the variable value. After selecting serial port or VISA instrument, you can select the serial port and VISA instrument detected on the current instrument device from the corresponding drop-down menu of the tab.

[0069] Optionally, after selecting an existing preset variable, you can click "Edit Variable" to edit the variable value, or click "Delete Variable" to delete the preset variable.

[0070] (iii) In response to configuration operations on the diagnostic script, the target Python function already imported into the Python function list is added to a specified location in the GUI, and the GUI runs to generate an automated diagnostic script, including:

[0071] (3.1) In response to the configuration operation of the loop tree setting control, the loop level and node distribution are determined to obtain a loop tree structure with multiple loop nodes. The configuration operation includes the loop level, node distribution, variable name of loop variable and loop range, etc.

[0072] Optionally, the main structure settings of the cycle tree include the options "Add Root Cycle", "Add Child Cycle" and "Delete Node". Clicking "Add Root Cycle" will add a bottom-level cycle, while clicking "Add Child Cycle" when any cycle node is selected will add a child cycle under the selected cycle node (multiple child cycles at the same level can be added), and clicking "Delete Node" will delete the selected node and all its child nodes.

[0073] Optionally, when any loop node is selected in the main structure settings section of the loop tree, you can set the variable name, variable start value, final value (range), and step size in the input box of the "Node Parameter Settings" section on the right. Clicking the "Save Node Parameters" button in this section will save the above parameters. The loop variable name set at this time can be found when setting the function input value.

[0074] (3.2) In response to configuration operations on imported Python functions, determine the target Python function and its corresponding input variables from the imported Python functions. In one implementation, set the input variables for each function, which can be manually entered ordinary values, preset variables, or loop variables, and then add the function or expression to a specified position in the loop structure.

[0075] (3.3) In response to the selection operation of the loop node in the loop tree structure, the target Python function is added to the target loop node to obtain the automated diagnostic script. Specifically: In response to the selection operation of the loop node in the loop tree structure, the target loop node is determined; In response to the loop setting operation of the target loop node, the target Python function is added at the function addition position of the target loop node to obtain the initial diagnostic script; wherein, the function addition position is divided into Before sub-loop or After sub-loop. The Before sub-loop is used to indicate that the target Python function is executed before the child loop contained in the target loop node, and the After sub-loop is used to indicate that the child loop contained in the target loop node is executed before the target Python function; In response to the parameter setting operation of the initial diagnostic script, the function return value of the target Python function is assigned to the specified variable to obtain the automated diagnostic script; wherein, the specified variable can be a preset variable or a loop variable.

[0076] Optionally, the "Functions to be executed in each iteration of this node (Before / After sub-loops)" section includes "Before sub-loops" and "After sub-loops," corresponding to the functions "added" in this section being executed before or after the next-level loop of the selected loop node. Each section has five buttons: "Add," "Remove," "Move Up," "Move Down," and "Edit Parameters." Clicking "Add" allows you to select a function from the "Selected Functions" section and add it to the execution box. At this time, the function's input will be saved as the function parameters set in "Selected Functions - Function Parameters" at that moment. After adding, you can select the function and click "Edit Parameters" to modify it at any time. In addition, you can set whether the function's return value is assigned to an existing preset variable or loop variable, and which existing variable it is assigned to, in "Edit Parameters." When any function is selected in the box, clicking "Remove" will delete the function, clicking "Move Up" will swap the position of the function with the function above it, and "Move Down" works similarly.

[0077] (iv) In response to the operation of the automated diagnostic script, the automated diagnostic script is run on the hardware instruments and equipment to obtain the diagnostic experimental results of the space electric propulsion system.

[0078] Clicking the "Execute Selected Functions" button will execute all functions in the "Selected Functions" list once in sequence.

[0079] The "Execute by Loop Tree" button will execute all functions within the set loop tree structure.

[0080] Clicking the "Stop Execution" button will stop the currently running process.

[0081] The "Execution Results" section displays partial output of the execution results (output can be presented in text format) and shows the loop progress and the function being executed. Note that if there is output that cannot be presented in text format, such as graphics, the corresponding process will be called according to the statements in the function to output it. If you need to manually enter it during process execution, you need to enter it in the command line interface of the GUI.

[0082] Optionally, the multiple pre-designed experimental sub-process control scripts include multiple experimental items broken down from the complete experimental process, and the script settings based on specific space electric propulsion experiments in the embodiments can be referred to.

[0083] Furthermore, in response to the configuration operation of the loop node in the loop tree structure, the node parameters corresponding to the loop node are determined. The node parameters include one or more of the following: loop variable name, variable start value, variable end value, and step size.

[0084] Furthermore, in response to the saving operation of the automated diagnostic script, the settings of the automated diagnostic script in the GUI can be saved as a file in a specified data exchange format. The GUI reads the file and automatically completes the script function import and preset variable settings, reproducing the saved settings used by the GUI to generate the automated diagnostic script. Based on this, the selection of the data exchange format file stored in the host computer determines the target historical diagnostic settings and configuration operations, and determines the target historical diagnostic script. In response to the running operation of the target historical diagnostic script, the target historical diagnostic script is run for the space electric propulsion system to obtain the diagnostic experimental results of the space electric propulsion system. In one implementation, the current GUI settings can be saved as a .json file using the "Save Global Settings" option. If there are similar previously set experimental procedures saved as .json files, the "Load Global Settings" option can be selected in the GUI to load the settings information from the saved .json file in the host computer, and then modified based on the existing global settings. Clicking "Exit" will exit the GUI.

[0085] Furthermore, in response to custom operations on the sub-process scripts corresponding to the modular sub-processes, sub-process scripts are generated and packaged into Python functions. In practical applications, the Python functions are defined after the complete experimental process is broken down into multiple modular sub-processes; the definition of each function is stored in a .py file. Multiple functions can be stored in the same file, but it is necessary to ensure that the libraries and other functions called by the function are all called within that file. Based on this, clicking "Import File" allows you to select a .py file from the host computer to import all custom functions within it; clicking "Import Directory" allows you to select a directory from the host computer to import custom functions from all .py files in that directory; and clicking "Clear Selected Files" clears the currently selected imported files and their subordinate functions from the list.

[0086] Furthermore, the graphical user interface of the host computer can display all or part of the results of the diagnostic experiment; and / or, the graphical user interface of the host computer can display the loop progress of the automated diagnostic script; and / or, the graphical user interface of the host computer can display the target Python function currently being executed by the automated diagnostic script.

[0087] Furthermore, GUIs can be implemented using Python libraries such as tkinter, including GUI windows, dialog boxes, buttons, input boxes, scrolling text, etc.; modules can be loaded from files and their functions can be reflected using libraries such as importlib.util, inspect, sys, and os; functions such as serialization of settings information and threaded execution can be implemented using libraries such as json, copy, threading, and uuid; serialization and threaded execution can be implemented using libraries such as serial and pyvisa; serial port or VISA-controlled instrument equipment numbers can be saved as "preset variables" and connections can be established; GUI structures such as tree-shaped loop nodes, storage of loop variable names, child nodes, and two function lists can be implemented through custom data structures; and the GUI, application state (imported functions, function parameter templates, preset variables, loop trees, etc.) and operation logic are encapsulated using the main application class.

[0088] This invention provides an application example of an automated control test for diagnosing the beam current characteristics of a Hall thruster under different anode voltages and excitation coil currents using a Faraday probe (FP).

[0089] Figure 3 This is a partial equipment connection diagram for a Hall electric propulsion diagnostic test provided in an embodiment of the present invention. The diagram shows that during the test, the host computer establishes connections with the anode power supply and the excitation coil power supply respectively to control the changes in operating conditions; and connects with the probe power supply (USB), the rotating motor (RS232), and the ammeter (RS485) to provide the bias voltage required for FP and to measure the entire plume range and read ion current data.

[0090] The entire experimental (single-condition) procedure is as follows: First, control the anode power supply to apply a high voltage for anode ignition. Then, adjust the anode voltage and excitation coil current to the specified operating condition and wait about 10 seconds for the thruster to stabilize. After the thruster stabilizes, turn on the FP bias voltage -30V and simultaneously control the rotating motor to rotate 180°. During this period, continuously read the ion current flowing through the FP collector circuit measured by the ammeter and save it to the specified location. After the measurement is completed, process the FP data to obtain parameters such as beam current and beam divergence half-angle, and plot them as images, saving them to the same directory as the original data. Turn off the anode voltage and coil current output to reduce the thermal load, and simultaneously control the rotating motor to rotate 180° in the opposite direction to return to the original position, starting the next diagnostic test.

[0091] Based on the above test procedure, the complete diagnostic test is divided into the following processes: anode ignition, anode voltage adjustment, excitation coil current adjustment, waiting for a certain period of time, FP diagnosis, FP data processing, and rotation motor control.

[0092] The following is a brief introduction to the scripts corresponding to each test item:

[0093] For the anode ignition section, the input values ​​include: minimum ignition voltage, maximum ignition voltage, boost step size, and anode power supply serial port variables. The function logic is as follows: First, reset the anode power supply, then set the anode voltage starting from the minimum ignition voltage. After each setting, it queries the anode power supply for the output current. If the output current is greater than a small current, it waits 5 seconds and queries again. If the current is still greater than the set value, ignition is considered successful, and the current ignition voltage is returned. If no current is detected, the voltage is increased by one step based on the existing ignition voltage, and the above steps are repeated until ignition is successful or the set maximum ignition voltage is reached. If ignition is still unsuccessful after reaching the maximum ignition voltage, the power supply is reset, and a request is made to re-enter the maximum ignition voltage. When using this function, the minimum ignition voltage can be set to the voltage at the time of the last successful ignition to reduce the ignition time.

[0094] The anode voltage adjustment section accepts input values ​​including the anode voltage (loop variable) and the anode power supply serial port variable. The function logic is as follows: First, reset the anode power supply. Then, set the anode power supply current limit to a sufficiently large value. Next, set the anode voltage to the currently specified anode voltage. Then, query the anode current. If it is greater than a small current, wait 3 seconds and query again. If the current is still greater than the set small current, ignition is considered successful, and the anode voltage and the obtained anode operating current are returned. If the current is less than the set value, the above steps are repeated three times. If the Hall thruster still fails to work properly, a message will be displayed indicating that the thruster is not working properly at this voltage. The power supply will be reset, and a manual check of each power supply and thruster will be prompted, requesting an anode voltage input. If an anode voltage input is received, the ignition and anode voltage adjustment procedures will be executed sequentially.

[0095] The excitation coil current adjustment section accepts input values ​​including the coil current (a loop variable) and the coil power supply serial port variable. The function logic is as follows: first, reset the coil power supply; then, set the power supply voltage limit to a sufficiently large value; finally, set the output current to the currently specified coil current.

[0096] In the waiting time section, enter the waiting time (s), and the program will wait for the corresponding time before continuing execution;

[0097] The FP diagnostic section accepts the following input values: motor address, rotation angle, rotation speed, rotation direction, motor serial port variable, probe power supply serial port variable, ammeter address and serial port variable, anode voltage, and coil current. The function logic is as follows: First, reset the probe power supply, setting its output value to the FP-specified bias voltage; then, assemble the commands to be output to the motor and ammeter based on the input values, outputting a rotation command to the motor, querying the ammeter reading at a high frequency during the calculated rotation duration, and saving the calculated rotation angle and current values ​​to a specified path with the filename "anode voltage - coil current".

[0098] The FP data processing section takes the following inputs: anode voltage, coil current, FP collector area, and FP rotation radius. The function logic is as follows: It reads the FP data from the specified path based on the anode voltage and coil current; identifies the approximate center of symmetry of the current curve based on the angle-current curve; considers the center of symmetry as points within a 90° range on both sides of the plume center (extrapolation is performed to complete the angle range if necessary); averages the points within the 90° range on both sides to obtain a completely symmetrical current distribution within a 90° range outward from the plume centerline; calculates the Hall thruster beam current and beam divergence half-angle; plots the data; and saves the image named "Anode Voltage - Coil Current" to the specified folder.

[0099] The motor control section accepts inputs including: motor address, rotation angle, rotation speed, rotation direction, and motor serial port variables. During runtime, the system assembles all information except the serial port variables into a custom command format for the motor, sends it to the motor via the serial port, and then waits for a period of time to ensure the motor completes its operation.

[0100] The above experimental procedures and function settings in the GUI are as follows:

[0101] (1) First, import the file / directory in the GUI function library section. Then, select the file / directory from the host computer. The GUI will read all the defined functions in the file / directory and display them in the tree view under "Function Library". Clicking on the function name under the file name will add the function to the list box under "Selected Functions".

[0102] (2) Add preset variables according to the test procedure, including the serial port connecting the lower-level machine and the device controlled by VISA, and other variables required during the test. For example, in this embodiment, some functions will write information to an independent log file, so the variable "LOG_FILE" is set to store the log file path string, etc.

[0103] (3) Set up a loop according to the test plan. The test in this embodiment aims to diagnose the operating conditions of the Hall thruster anode voltage in the range of 200V~400V (step size 25V) and the excitation coil current in the range of 0A~3A (step size 1A). Therefore, two loops are set up, with the loop variables being the anode voltage "Anode_Vol" and the coil current "Coil_Cur". Specifically:

[0104] Set up two nested for loops: the outer loop variable is the excitation coil current, and the inner loop variable is the anode voltage.

[0105] In the "Before" sub-loop of the outer loop, add the anode ignition function and the excitation coil current adjustment function sequentially. The inputs to the anode ignition function are the minimum ignition voltage (200V), the maximum ignition voltage (400V), the boost step size (10V), and the anode power supply serial port variable (preset variable). The inputs to the excitation coil current adjustment function are the coil current (loop variable) and the coil power supply serial port variable (preset variable).

[0106] In the "After" sub-loop of the outer loop, add the anode voltage adjustment function and the wait time function sequentially. The anode voltage adjustment function is input to the anode voltage (0V) and the anode power supply serial port variable. The wait time function is input as 90s. Cool the thruster after each test round to reduce the changes in thruster thermal conditions throughout the test.

[0107] In the "Before" sub-loop of the inner loop, add the following functions in sequence: anode voltage adjustment function, waiting time function, FP diagnostic function, rotating motor control function, and FP data processing function. The anode voltage adjustment function inputs the anode voltage (loop variable) and the anode power supply serial port variable. The waiting time function inputs 10s to wait for the thruster to stabilize. The FP diagnostic function inputs the rotating motor address (preset variable), rotation angle (180°), rotation speed (preset variable), rotation direction (0), rotating motor serial port variable (preset variable), probe power supply serial port variable (preset variable), ammeter address (preset variable), serial port variable (preset variable), anode voltage (loop variable), and coil current (loop variable). The rotating motor control function inputs the rotating motor address, rotation angle (180°), rotation speed, rotation direction (1), and rotating motor serial port variable. The FP data processing function inputs the anode voltage (loop variable), coil current (loop variable), FP collector area (preset variable), and FP rotation radius (preset variable).

[0108] (4) Click the list box under “Selected Functions” to bring up the parameter setting interface. At this time, you can select preset / loop variable or “manual input” in the drop-down menu corresponding to each parameter of the function. When selecting “manual input”, fill in the function input value in the input box on the right. After completion, select a loop node in the tree view below “Loop Tree”, and click the “Add” button below “Function to be executed in each iteration of this node” in the lower right corner to select the function from “Selected Functions” and add it to the loop structure.

[0109] (5) In order to pass the function return value to the main program, for example, to use the ignition result voltage returned by the ignition function as the new minimum ignition voltage, you can set the variable to which the return value should be assigned in the interface that pops up when you click the "Edit Parameters" button.

[0110] (6) Example of saving GUI global settings as a .json file: click the "File" option and then the "Save Global Settings" option, set the file name and select the save location, and then save.

[0111] Based on the foregoing embodiments, this invention provides a Python-based automated diagnostic control system for space electric propulsion, comprising:

[0112] The host computer stores Python functions corresponding to all test items in the complete test process, which are used to execute the Python-based automated diagnostic method for space electric propulsion provided in the aforementioned embodiment.

[0113] The hardware instruments and equipment physically connected to the host computer via serial port adapter cables include, at a minimum, the space electric propulsion system to be diagnosed and its diagnostic equipment. Various serial port adapter cables are used for the physical connection between the host computer and the slave computer; all hardware instruments and equipment required for the complete experimental process ensure that the controlled hardware instruments and equipment (slave computer) can establish communication with the host computer.

[0114] The system provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0115] This invention provides a host computer, specifically, the host computer includes a processor and a memory; the memory stores a computer program, and the computer program, when run by the processor, executes the method described in any of the above embodiments.

[0116] Figure 4 This is a schematic diagram of the structure of a host computer provided in an embodiment of the present invention. The host computer 100 includes: a processor 40, a memory 41, a bus 42 and a communication interface 43. The processor 40, the communication interface 43 and the memory 41 are connected through the bus 42. The processor 40 is used to execute executable modules, such as computer programs, stored in the memory 41.

[0117] The memory 41 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 43 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0118] Bus 42 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0119] The memory 41 is used to store programs. After receiving an execution instruction, the processor 40 executes the program. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 40 or implemented by the processor 40.

[0120] Processor 40 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 40 or by instructions in software form. Processor 40 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 41. The processor 40 reads the information in memory 41 and, in conjunction with its hardware, completes the steps of the above method.

[0121] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, please refer to the foregoing method embodiments, which will not be repeated here.

[0122] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0123] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A Python-based automated diagnostic method for space electric propulsion, characterized in that, The method is applied to a host computer in a diagnostic control system. The host computer stores Python functions corresponding to multiple modular sub-processes included in the diagnostic test procedure. The method includes: In response to the import operation of the Python function, the imported Python function is displayed in the GUI of the host computer; In response to the configuration operation of preset variables, a communication connection between the host computer and the hardware instrument equipment is established based on the preset variables. The hardware instrument equipment includes at least the space electric propulsion system to be diagnosed and its diagnostic equipment. In response to configuration operations on the diagnostic script, the target Python function in the imported Python function is added to a specified location in the GUI, and the GUI runs to generate an automated diagnostic script; In response to the operation of the automated diagnostic script, the automated diagnostic script is run on the hardware instruments and equipment to obtain the diagnostic experimental results of the space electric propulsion system; The host computer's GUI displays a loop tree setting control; in response to the configuration operation of the diagnostic script, the target Python function from the imported Python functions is added to a specified position in the GUI, and the GUI runs to generate an automated diagnostic script, including: in response to the configuration operation of the loop tree setting control, determining the loop level and node distribution to obtain a loop tree structure including multiple loop nodes; in response to the configuration operation of the imported Python functions, determining the target Python function and its corresponding input variables from the imported Python functions; in response to the selection operation of the loop node in the loop tree structure, adding the target Python function to the target loop node to obtain the automated diagnostic script; In response to a selection operation on a loop node in the loop tree structure, an automated diagnostic script is obtained by adding the target Python function to the target loop node. This includes: determining the target loop node in response to the selection operation on the loop node in the loop tree structure; adding the target Python function at the function addition position of the target loop node in response to a loop setting operation on the target loop node, thus obtaining an initial diagnostic script; wherein the function addition position is either a Before sub-loop or an After sub-loop, the Before sub-loop indicating that the target Python function executes before the child loops contained in the target loop node, and the After sub-loop indicating that the child loops contained in the target loop node execute before the target Python function; and assigning the function return value of the target Python function to a specified variable in response to a parameter setting operation on the initial diagnostic script, thus obtaining the automated diagnostic script. The method further includes: in response to the save operation of the automated diagnostic script, saving the settings of the automated diagnostic script in the GUI as a file in a specified data exchange format, and having the GUI read the file to automatically complete the operations of importing script functions and setting preset variables, thereby reproducing the saved settings used by the GUI to generate the automated diagnostic script.

2. The automated diagnostic method for space electric propulsion based on Python according to claim 1, characterized in that, The method further includes: In response to a configuration operation on a loop node in the loop tree structure, the node parameters corresponding to the loop node are determined, the node parameters including one or more of the following: loop variable name, variable start value, variable end value, and step size.

3. The automated diagnostic method for space electric propulsion based on Python according to claim 1, characterized in that, The method further includes: in response to the selection of a file of data exchange format stored in the host computer, determining the target historical diagnostic settings and configuration operations; in response to the execution operation of the target historical diagnostic script, running the target historical diagnostic script for the space electric propulsion system to obtain the diagnostic experimental results of the space electric propulsion system.

4. The automated diagnostic method for space electric propulsion based on Python according to claim 1, characterized in that, The method further includes: In response to the custom operation of the sub-process script corresponding to the modular sub-process, the sub-process script is generated and wrapped as a Python function.

5. The automated diagnostic method for space electric propulsion based on Python according to claim 1, characterized in that, The method further includes: The GUI of the host computer displays all or part of the diagnostic test results; And / or, the cyclic progress of the automated diagnostic script can be displayed through the GUI of the host computer; And / or, through the GUI of the host computer, display the target Python function currently being executed by the automated diagnostic script.

6. A space electric propulsion automated diagnostic control system based on Python, characterized in that, include: The host computer is used to execute the Python-based automated diagnostic method for space electric propulsion as described in claim 1; The hardware instruments and equipment physically connected to the host computer via a serial port adapter cable include at least the space electric propulsion system to be diagnosed and its diagnostic equipment.

7. A host computer, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method described in any one of claims 1 to 5.