A measurement and modeling integrated automatic testing system and testing method
By designing an integrated automatic test system for actual measurement and modeling, Python automation control software is used to realize the automation of hardware in-loop testing, parameter identification and electromechanical transient modeling, solving the problem of low manual testing efficiency in the actual measurement and modeling of new energy controllers, improving testing efficiency and saving resources.
Patent Information
- Application Number
- CN202211446047.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-11-18
AI Technical Summary
The actual test modeling and modeling of new energy controllers in the existing technology requires a lot of manual testing, which leads to inefficient testing, and the parameter identification and electromechanical transient modeling process require a lot of human and material resources.
Design an integrated automatic testing system for actual measurement and modeling, including testing modules, identification modules and analysis modules. Through Python automation control software, it realizes the automation of hardware in-loop testing, parameter identification and electromechanical transient modeling, and automatically saves and analyzes the result data.
The integrated testing and modeling of new energy controllers has been realized, and automation has replaced traditional manual testing, which has improved testing efficiency, simplified the process of parameter identification and electromechanical transient modeling, saving human and material resources.
Smart Images

Figure CN115729211B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automated software testing, and in particular relates to an automatic testing system and a testing method integrating measurement and modeling. Background Art
[0002] With the continuous increase in the penetration rate of high-proportion renewable energy generating units, their access to the power system has a significant impact on the safe and stable operation of the power grid. The models currently used in power grid simulation research differ greatly from the actual situation on site. Therefore, it is particularly important to establish an accurate electromechanical transient simulation model based on measured data identification to study the transient stability characteristics of the renewable energy units themselves and the renewable energy grid-connected system.
[0003] With the rapid development of computer technology, hardware-in-the-loop (HIL) simulation has become a new approach for power system simulation research. Combining the advantages of both fully digital and physical simulation, HIL simulation can more realistically simulate the real-time operating state of the controlled object, making it a commonly used simulation method. For the field-measured modeling of new energy controllers, extensive testing based on HIL simulation is required.
[0004] In the hardware-in-the-loop simulation test work, each test requires manual model compilation, downloading and running. The test process is extremely cumbersome. At the end of the test, the data format needs to be manually saved and converted, resulting in low test efficiency. In the parameter identification work, each time the model is manually run, the run results need to be recorded and the parameter values modified according to the run results to obtain the identified parameter values. If the identification results obtained from each run are manually filled into the model and the model is manually run, the identification efficiency will be low. In the electromechanical transient model simulation test work, different working conditions need to be set for simulation to verify the accuracy of the identification results. If the entire electromechanical transient test process is manually operated, it will take up a lot of manpower and material resources.
[0005] In view of this, the present invention proposes an integrated automatic testing system for measurement and modeling to solve the current problem of a large amount of manual testing work required for measurement and modeling research, freeing testers from the manual testing state, realizing one-click measurement and modeling of new energy controllers, and improving testing efficiency. Summary of the Invention
[0006] In view of the technical problems existing in the background technology, the present invention provides an integrated automatic testing system and testing method for actual measurement and modeling, which can replace traditional manual testing work, automatically perform hardware-in-the-loop testing, parameter identification and electromechanical transient modeling testing, and automatically save the result data, which can effectively improve testing efficiency.
[0007] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0008] An automatic test system integrating measurement and modeling, comprising a test module, the test module being electrically connected to an identification module, and the identification module being electrically connected to an analysis module;
[0009] The test module is used for hardware-in-the-loop simulation testing of the new energy controller, provides measured data support for the identification module, and can implement automated testing based on the data requirements of the identification working conditions;
[0010] The identification module is used to identify the parameters of the electromechanical model of the new energy controller. The parameter identification is based on the hardware-in-the-loop measured data. By writing an identification algorithm, each parameter to be identified in the identification model is automatically modified until the identification accuracy requirements are met and the optimal identification parameters are automatically output;
[0011] The analysis module is used for new energy electromechanical transient modeling and testing, verifies the correctness of the parameter identification results in the identification module, automatically performs electromechanical transient simulation by setting different test conditions, and automatically performs error analysis on each simulation result and hardware-in-the-loop test result.
[0012] In the preferred solution, the test module includes working condition setting, model compilation, model downloading, model running and report output functional modules. The working condition is set to set the test working condition of the new energy controller, which is used for high and low voltage crossing working conditions under different voltage drop or rise levels; the model compilation is to compile the simulation model into a code that can be recognized by the simulation machine; the model download is to download the simulation model to the simulation machine; the model running is to control the model running in the simulation machine; the report output is to output the hardware-in-the-loop simulation results in the form of a report, and the report output format can be modified according to data requirements.
[0013] In a preferred solution, the identification module includes data calling, parameter modification, model operation, result comparison and parameter output functional modules; the data calling is to call the hardware-in-the-loop simulation result data in the test module; the parameter modification is to modify the parameters to be identified in the identification model; the model operation is to control the operation of the identification model; the result comparison is the difference comparison between the hardware-in-the-loop simulation results and the identification model simulation results; the parameter output is to output the optimal identification parameters obtained by identification.
[0014] In a preferred solution, the analysis module includes parameter import, data call, working condition switching, model operation and error analysis function modules, wherein the parameter import is to import the optimal identification parameters output by the identification module into the electromechanical transient model; the data call is to call the hardware-in-the-loop simulation result data in the test module; the working condition switching is to switch the electromechanical transient model test condition to the same test condition as the hardware-in-the-loop simulation model in the test module; the model operation is to control the simulation operation of the electromechanical transient model; and the error analysis is to perform error analysis on the error calculation between the hardware-in-the-loop simulation results and the electromechanical transient model simulation results.
[0015] In a preferred embodiment, the test method of the integrated measurement and modeling automatic test system is characterized by:
[0016] S1: Perform hardware-in-the-loop simulation test:
[0017] S1.1: Use Python to automatically open the hardware-in-the-loop test software RT-LAB and locate the positions of each test button in the RT-LAB software;
[0018] S1.2: Set the test condition switch button to change the test condition according to the identification requirements;
[0019] S1.3: Use the pyautogui module in Python to control the mouse to automatically run. Click the buttons in RT-LAB software in sequence to automatically compile, download, and run the hardware-in-the-loop simulation model and automatically save the test results.
[0020] S2: Perform parameter identification:
[0021] S2.1: Build an identification model in the PSASP software and determine the parameters to be identified as the reactive current component Iq during the ride-through period set_LV , reactive current coefficient K 1_Iq_LV With K 2_Iq_LV , active current component Ip during ride-through set_LV and active current coefficient K 1_Ip_LV With K 2_Ip_LV ;
[0022] S2.2: Use the pymysql module in Python software to access the parameters to be identified in the PSASP software database, automatically modify the parameters to be identified in the identification model by writing an identification algorithm, and use the pyautogui module in Python software to control the automatic operation of the identification model in PSASP;
[0023] S2.3: Compare the hardware-in-the-loop test results with the simulation results of the model in PSASP until the identification accuracy requirements are met and the optimal identification parameters are automatically output;
[0024] S3: Conduct new energy electromechanical transient modeling test:
[0025] S3.1: The parameters obtained in the identification module are accessed from the database using the pymysql module and the identified parameters are automatically transferred to the electromechanical transient model through Python;
[0026] S3.2: Set the test condition switch button through Python, and use the pyautogui module to control the electromechanical transient model in PSASP to perform automatic simulation calculations;
[0027] S3.3: Automatically perform curve comparison and error analysis on the electromechanical transient simulation calculation results and hardware-in-the-loop simulation results.
[0028] This patent can achieve the following beneficial effects:
[0029] The present invention can implement integrated testing for the actual measurement modeling work of new energy controllers, which can effectively replace traditional manual testing work, automatically perform hardware-in-the-loop testing, parameter identification and electromechanical transient modeling testing, and can output test results in different file formats according to needs, greatly improving test efficiency and being concise and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The present invention will be further described below with reference to the accompanying drawings and examples:
[0031] Figure 1 This is a structural diagram of an automatic testing system integrating measurement and modeling according to the present invention.
[0032] Figure 2 This is a diagram of the internal module structure of the test module, identification module and analysis module of the present invention.
[0033] Figure 3 This is a flowchart of the hardware-in-the-loop test, parameter identification, and electromechanical transient modeling test of the present invention.
[0034] Figure 4 The figure shows a curve comparison and error analysis of the electromechanical transient simulation calculation results and hardware-in-the-loop simulation results under low voltage ride-through conditions in an embodiment of the present invention.
[0035] Figure 5 The figure shows a curve comparison and error analysis of the electromechanical transient simulation calculation results and hardware-in-the-loop simulation results under low voltage ride-through conditions in an embodiment of the present invention.
[0036] Figure 6 The figure shows a curve comparison and error analysis of the electromechanical transient simulation calculation results and hardware-in-the-loop simulation results under high voltage ride-through conditions in an embodiment of the present invention. DETAILED DESCRIPTION
[0037] Example 1:
[0038] The preferred solution is Figures 1 to 3 As shown, an integrated automatic test system for measurement and modeling includes a test module 10, an identification module 20, and an analysis module 30, specifically as follows:
[0039] The test module 10 is used for hardware-in-the-loop simulation testing of the new energy controller, provides measured data support for the identification module 20, and can implement automated testing based on the data requirements of the identification working conditions;
[0040] The identification module 20 is used to identify the parameters of the electromechanical model of the new energy controller. The parameter identification is based on the hardware-in-the-loop measured data provided by the test module 10. By programming an identification algorithm, each parameter to be identified in the identification model is automatically modified until the identification accuracy requirements are met and the optimal identification parameters are automatically output;
[0041] The analysis module 30 is used for new energy electromechanical transient modeling and testing, verifies the correctness of the parameter identification results in the identification module 20, automatically performs electromechanical transient simulation by setting different test conditions, and automatically performs error analysis on each simulation result and hardware-in-the-loop test result.
[0042] In an embodiment of the present invention, an automatic test system integrating measurement and modeling is disclosed. The test module 10 includes working condition setting 101, model compilation 102, model downloading 103, model operation 104 and report output 105 functional modules. The working condition setting 101 is used to set the test working condition of the new energy controller, mainly high and low voltage crossing working conditions under different voltage drop or rise levels. The model compilation 102 is used to compile the simulation model into a code that can be recognized by the simulation machine. The model downloading 103 is used to download the simulation model to the simulation machine. The model operation 104 is used to control the model operation in the simulation machine. The report output 105 is used to output the hardware-in-the-loop simulation results in the form of a report, and the report output format can be modified according to data requirements.
[0043] In an embodiment of the present invention, an integrated automatic testing system for measurement and modeling is provided, wherein the identification module 20 includes functional modules of data calling 201, parameter modification 202, model operation 203, result comparison 204 and parameter output 205. The data calling 201 is to call the hardware-in-the-loop simulation result data in the test module 10, the parameter modification 202 is to modify the parameters to be identified in the identification model, the model operation 203 is to control the operation of the identification model, the result comparison 204 is to compare the differences between the hardware-in-the-loop simulation results and the identification model simulation results, and the parameter output 205 is to output the optimal identification parameters obtained by identification.
[0044] In an embodiment of the present invention, an automatic testing system integrating measurement and modeling is provided, wherein the analysis module 30 includes function modules of parameter import 301, data call 302, working condition switching 303, model operation 304 and error analysis 305. The parameter import 301 is to import the optimal identification parameters output by the identification module 20 into the electromechanical transient model, the data call 302 is to call the hardware-in-the-loop simulation result data in the test module 10, the working condition switching 303 is to switch the electromechanical transient model test condition to the same test condition as the hardware-in-the-loop simulation model in the test module, the model operation 304 is to control the simulation operation of the electromechanical transient model, and the error analysis 305 is to perform error analysis on the error calculation between the hardware-in-the-loop simulation results and the electromechanical transient model simulation results.
[0045] In an embodiment of the present invention, a test method for an integrated measurement and modeling automatic test system is provided, wherein the hardware-in-the-loop simulation test steps are as follows: Figure 3 As shown, the specific ones are:
[0046] Step S1.1: Automatically open the hardware-in-the-loop test software RT-LAB through Python and locate the positions of each test button in the RT-LAB software;
[0047] Step S1.2, setting the test condition switch button to change the test condition according to the identification requirements;
[0048] Step S1.3: Use the pyautogui module in the Python software to control the mouse to run automatically, click each button in the RT-LAB software in sequence, automatically compile, download, and run the hardware-in-the-loop simulation model, and automatically save the test results.
[0049] In an embodiment of the present invention, a test method for an integrated measurement and modeling automatic test system is provided, wherein the parameter identification step is as follows: Figure 3 As shown, the specific ones are:
[0050] Step S2.1: Build an identification model in the PSASP software and determine the parameters to be identified as the reactive current component Iq during the ride-through period. set_LV , reactive current coefficient K 1_Iq_LV With K 2_Iq_LV , active current component Ip during ride-through set_LV and active current coefficient K 1_Ip_LV With K 2_Ip_LV ;
[0051] Step S2.2: Use the pymysql module in Python software to access the parameters to be identified in the PSASP software database, automatically modify the parameters to be identified in the identification model by writing an identification algorithm, and use the pyautogui module in Python software to control the automatic operation of the identification model in PSASP;
[0052] Step S2.3: Compare the hardware-in-the-loop test results with each simulation result of the model in PSASP until the identification accuracy requirements are met and the optimal identification parameters are automatically output.
[0053] In an embodiment of the present invention, a test method of an integrated automatic test system of measurement and modeling is provided, wherein the new energy electromechanical transient modeling test is as follows: Figure 3 As shown, the specific ones are:
[0054] Step S3.1, using the pymysql module to access the parameters in the database obtained in the identification module and automatically transferring the identified parameters to the electromechanical transient model through Python;
[0055] Step S3.2 sets the test condition switch button through Python, and uses the pyautogui module to control the electromechanical transient model in PSASP to perform automatic simulation calculations;
[0056] Step S3.3: Automatically perform curve comparison and error analysis on the electromechanical transient simulation calculation results and the hardware-in-the-loop simulation results.
[0057] Figure 4 The graphs are a comparison of the electromechanical transient simulation results and the hardware-in-the-loop simulation results under the voltage drop of 0.6 pu in an embodiment of the present invention, as well as an error analysis graph. Figure 5 The graphs are a comparison of the electromechanical transient simulation results and the hardware-in-the-loop simulation results under the voltage drop of 0.4 pu in an embodiment of the present invention, as well as an error analysis graph. Figure 6 The graph is a comparison of the electromechanical transient simulation results and the hardware-in-the-loop simulation results curves and an error analysis graph under the voltage rise of 1.2 pu in an embodiment of the present invention. In the graph, the solid line Realvalue represents the hardware-in-the-loop simulation curve, and the dotted line Identivalue represents the electromechanical transient simulation curve. The test method of the integrated automatic test system for actual measurement and modeling proposed by the present invention can realize the integrated test of the entire actual measurement and modeling process of the new energy controller, from hardware-in-the-loop testing of the new energy controller to parameter identification of the new energy controller and then to electromechanical transient modeling. The identification results of each parameter can be obtained intuitively and accurately. By running PSASP to perform electromechanical transient simulation, error analysis can be automatically performed, and the reactive current component Iq during the parameter crossing period can be calculated. set_LV , reactive current coefficient K 1_Iq_LV With K 2_Iq_LV, active current component Ip during ride-through set_LV and active current coefficient K 1_Ip_LV With K 2_Ip_LV The identification results and error analysis are intuitively displayed in the automatic test system of the present invention.
[0058] The above embodiments are merely preferred technical solutions of the present invention and should not be construed as limiting the present invention. The scope of protection of the present invention shall be the technical solutions set forth in the claims, including equivalent alternatives to the technical features of the technical solutions set forth in the claims. In other words, equivalent alternatives and improvements within this scope are also within the scope of protection of the present invention.
Claims
1. A testing method for an integrated measurement and modeling automatic testing system, characterized by: The system includes a test module, which is electrically connected to an identification module, and the identification module is electrically connected to an analysis module. The test module is used for hardware-in-the-loop simulation testing of the new energy controller, provides measured data support for the identification module, and can implement automated testing based on the data requirements of the identification working conditions. The identification module is used for parameter identification of the electromechanical model of the new energy controller. The parameter identification is based on the hardware-in-the-loop measured data, and automatically modifies each parameter to be identified in the identification model by writing an identification algorithm until the identification accuracy requirements are met and the optimal identification parameters are automatically output. The analysis module is used for new energy electromechanical transient modeling and testing, verifies the correctness of the parameter identification results in the identification module, automatically performs electromechanical transient simulation by setting different test conditions, and automatically performs error analysis on each simulation result and hardware-in-the-loop test result; The testing method of the system includes the following steps: S1: Perform hardware-in-the-loop simulation test: S1.1: Use Python to automatically open the hardware-in-the-loop test software RT-LAB and locate the positions of each test button in the RT-LAB software; S1.2: Set the test condition switch button to change the test condition according to the identification requirements; S1.3: Use the pyautogui module in Python to control the mouse to automatically run. Click the buttons in RT-LAB software in sequence to automatically compile, download, and run the hardware-in-the-loop simulation model and automatically save the test results. S2: Perform parameter identification: S2.1: Build an identification model in the PSASP software and determine the parameters to be identified as the reactive current component Iq during the ride-through period set_LV , reactive current coefficient K 1_Iq_LV With K 2_Iq_LV , active current component Ip during ride-through set_LV and active current coefficient K 1_Ip_LV With K 2_Ip_LV ; S2.2: Use the pymysql module in Python software to access the parameters to be identified in the PSASP software database, automatically modify the parameters to be identified in the identification model by writing an identification algorithm, and use the pyautogui module in Python software to control the automatic operation of the identification model in PSASP; S2.3: Compare the hardware-in-the-loop test results with the simulation results of the model in PSASP until the identification accuracy requirements are met and the optimal identification parameters are automatically output; S3: Conduct new energy electromechanical transient modeling test: S3.1: The parameters obtained in the identification module are accessed from the database using the pymysql module and the identified parameters are automatically transferred to the electromechanical transient model through Python; S3.2: Set the test condition switch button through Python, and use the pyautogui module to control the electromechanical transient model in PSASP to perform automatic simulation calculations; S3.3: Automatically perform curve comparison and error analysis on the electromechanical transient simulation calculation results and hardware-in-the-loop simulation results.
Citation Information
Patent Citations
SVG controller parameter identification method based on RTDS test data
CN111273632A
Processing method of three-electrode electrochemical analysis experimental data
CN114894864A
Doubly-fed fan control parameter identification method based on improved multi-target particle swarm optimization
CN114977939A