A method for realizing the conversion of balance certificate to program general code in wind tunnel test
By automatically generating balance load calculation code, the problem of low efficiency in manually inputting balance formula coefficients in wind tunnel tests is solved, realizing automated conversion and improving test efficiency and the reliability of calculation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LOW SPEED AERODYNAMIC INST OF CHINESE AERODYNAMIC RES & DEV CENT
- Filing Date
- 2023-07-13
- Publication Date
- 2026-05-12
AI Technical Summary
In wind tunnel tests, the coefficients of the balance formula need to be manually entered, which is inefficient and prone to errors, affecting the efficiency of the test and the reliability of the calculation results.
By automatically generating language code for balance load calculation, and using the Office system to read the balance certificate information from Word, the program automatically extracts and generates the load formula node code, thus achieving automatic conversion from balance certificate to program.
实现了天平公式系数的自动化输入,提高了试验效率,保证了计算结果的可靠性,避免了人工输入带来的错误。
Smart Images

Figure CN116775018B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of aerodynamic wind tunnel testing technology, specifically to a method for converting balance certificates into general program code during wind tunnel testing. Background Technology
[0002] The purpose of wind tunnel force measurement tests is to obtain the forces and moments borne by the test model in the wind tunnel flow field. Typically, the forces and moments borne by the test model are measured using a balance. A balance is a device used in wind tunnel force measurement tests to measure the load on the model; essentially, it is a multi-component sensor whose raw output is a voltage signal.
[0003] Before use, the balance needs to be calibrated to obtain the relationship between the applied standard load and the balance output signal and to issue a certificate. Due to the mutual coupling between multiple components, the relationship is often a nonlinear polynomial. According to the general convergence condition, when the coefficients of the quadratic term are taken, the result of the coefficients is a 6×27 matrix, which is generally retained to 7 significant digits after the decimal point. It is a relatively complex matrix.
[0004] During wind tunnel testing, under a specific test condition, the raw voltage signal output by the balance is first acquired. Then, iterative calculations are performed based on the calibrated formulas and coefficients to obtain the load result. Because there are numerous balances and they require regular calibration, different certificates are used for each test. Therefore, the balance formula coefficients must first be manually entered and then modified in the standard calculation module of the data processing program. This process presents two problems: first, most values are small, have many digits, and are not significantly different, making them difficult to distinguish and prone to misreading or input errors, affecting the calculation results; second, due to the large number of coefficients, each entry and repeated checks consume a significant amount of time, severely impacting test efficiency.
[0005] With the development of advanced aircraft development needs and wind tunnel testing technology, the requirements for testing efficiency are becoming increasingly stringent. Therefore, there is an urgent need to change traditional manual methods, develop automated means, and improve testing efficiency. Summary of the Invention
[0006] The purpose of this invention is to solve the problem of low efficiency and high error rate caused by the need to manually input a large number of balance formula coefficients in existing programs by automatically generating language code for balance load calculation, which can be directly used by data processing programs when calculating loads.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] A method for converting balance certificates to general program code in wind tunnel testing includes the following steps:
[0009] S1: The program calls the Word.Appication ActiveX class in the Office system to read all text information of the Word balance certificate.
[0010] S2: Locate the starting position based on the keywords, search for relevant information in the text and extract it.
[0011] A1: Locate the starting position based on the "balance coefficient table", extract the coefficient table information from the text information and generate an electronic coefficient table.
[0012] A2: Locate the starting position based on the "relationship between each component signal and each bridge output signal", and extract the component bridge information from the text information.
[0013] A3: Locate the starting position based on "certificate number", "calibration date", "validity date", etc., and extract relevant information from the text information.
[0014] S3: Generate load formula node code based on the electronic coefficient table.
[0015] This section divides the method for generating node codes for the load formula of the balance formula (Balance Formula 1 and Balance Formula 2). The method for Balance Formula 1 is as follows:
[0016] B1: Create all new coefficient variables. Since the actual coefficient table generally has fewer coefficients than the standard coefficient table, and the coefficient terms are not identical, it is necessary to match all coefficients in the standard coefficient table one by one. New coefficient variables are created using the coefficient name as the key, considering all possible variations of the same coefficient type. Specifically, they are divided into principal coefficients, quadratic coefficients, linear terms, quadratic terms, cross terms, etc., totaling 88 variables. All coefficients of the six components are extracted and processed column by column.
[0017] B2: Initialize coefficient variables, assigning an initial value of 0 to all coefficient variables.
[0018] B3: In each column, match row by row using the coefficient variable name as the keyword, assign values to the matched variables, and leave the values of unmatched variables as 0.
[0019] B4: Generate the formula code for the main term and the square term. For each coefficient, determine whether it is positive or negative. First, generate the formula strings for the main term and the square term separately. Then, combine these strings to form the formula code for the main term and the square term of that component.
[0020] B5: Generate formula codes for linear and quadratic terms. For each coefficient, if it is 0, no output is given; otherwise, positive and negative terms are distinguished. First, generate the formula string for each coefficient, then combine all the formula strings for linear and quadratic terms into the formula code for that component.
[0021] B6: Generate the formula code for the interference terms. Similarly, each coefficient is evaluated; if it's 0, no output is given; otherwise, positive and negative terms are distinguished. First, the formula string for each interference term coefficient is generated. Then, all the interference term formula strings are combined to form the interference term formula code for that component.
[0022] B7: Add fixed code for this component, combining the generated code above into the calculation code for this component.
[0023] B8: Combine the six component calculation codes into the main calculation code of the formula node.
[0024] B9: Add fixed code for the load formula node to generate the final load formula node code.
[0025] The method shown in Formula Two of the balance is as follows:
[0026] C1: Generate component formula code. Since the coefficient table used in Formula 2 is a standard coefficient table, the number and position of coefficients are fixed. Therefore, in each column, the coefficient variable strings in a fixed order are matched row by row with the standard coefficient table to first generate the formula string for each coefficient, and then all the formula strings are combined to form the component formula code.
[0027] C2: Add fixed code for this component, combining the generated code above into the calculation code for this component.
[0028] C3: Combines the six component calculation codes into the main calculation code of the formula node.
[0029] C4: Add fixed code for the load formula node to generate the final load formula node code.
[0030] S4: Generate the combination formula node code based on the bridge group information.
[0031] D1: Search for matching characters one by one in the bridge group information to find the largest number, so as to determine the number of bridge paths, i.e., signal channels.
[0032] D2: Generate channel definition code based on the number of channels.
[0033] D3: Match component bridge combination strings line by line using component names as keywords.
[0034] D4: The code for combining six components of a bridge circuit.
[0035] D5: Combine the channel definition code with the six-component bridge combination code, add fixed code, and generate the final combination formula node code.
[0036] S5: Copy the generated load formula node code and combination formula node code into the standard calculation module of the data processing program to complete the calculation.
[0037] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0038] This method allows the program to automatically read a Word balance certificate and search for information such as bridge combinations and coefficient tables within it. Based on the balance formula algorithm, it automatically generates C language code for calculating the balance load, which can then be directly used by the data processing program. This method achieves a one-click conversion from balance certificate to program call code, solving the problems of low efficiency and high error rates caused by manually inputting a large number of balance formula coefficients. This significantly improves experimental efficiency and ensures the reliability of calculation results. Attached Figure Description
[0039] The present invention will be described by way of example and with reference to the accompanying drawings, wherein: Figure 1 This is the overall test flowchart. Figure 2 This is a flowchart of the compute node code generation process. Detailed Implementation
[0040] All features disclosed in this specification, or all steps in all disclosed methods or processes, may be combined in any way, except for mutually exclusive features and / or steps.
[0041] Any feature disclosed in this specification (including any appended claims, abstract, and drawings) may be replaced by other equivalent or similar features, unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is merely one example of a series of equivalent or similar features.
[0042] The specific implementation process is as follows:
[0043] S1: Before the experiment, download and obtain the Word version of the balance certificate;
[0044] S2: After the test is prepared according to the force measurement test, conduct a test according to the test requirements to obtain the original data of the balance.
[0045] S3: The program calls the Word.Appication ActiveX class in the Office system to read all text information from the Word balance certificate.
[0046] S2: Locate the starting position based on the keywords, search for relevant information in the text and extract it.
[0047] A1: Based on the "Balance Coefficient Table," locate the starting position, extract the coefficient table information from the text information, and generate an electronic coefficient table. The data format is as follows (first 6 lines):
[0048] - <![CDATA[ K i1 + ]]> 1.5046E00 5.9347E-01 4.2140E-01 6.4063E-01 1.8116E-01 2.7859E-01 <![CDATA[ K i1 - ]]> 1.5007E00 5.9347E-01 4.2140E-01 6.4070E-01 1.8169E-01 2.7873E-01 _ _ 1.1671E-02 8.5242E-03 _ _ _ _ 1.1671E-02 9.2937E-03 _ _ 3.3161E-02 -3.3786E-02 _ 1.0800E-03 -2.4185E-02 5.6371E-03 3.4051E-02 -3.7979E-02 _ 2.2945E-03 -2.4185E-02 5.6371E-03
[0049] A2: Locate the starting position based on the "relationship between each component signal and each bridge output signal", and extract the component group bridge information from the text information;
[0050] Y = +B1 - B2
[0051] X=+B7
[0052] Mz=+B1+B2
[0053] Z = +B4 - B3
[0054] My=+B3+B4
[0055] Mx = +B5 + B6.
[0056] A3: Locate the starting position based on "certificate number", "calibration date", "validity date", etc., and extract relevant information from the text information.
[0057] S3: Generate load formula node code based on the electronic coefficient table.
[0058] This section divides the method for generating node codes for the load formula of the balance formula (Balance Formula 1 and Balance Formula 2). The method for Balance Formula 1 is as follows:
[0059] B1: Create all new coefficient variables. Since the actual coefficient table generally has fewer coefficients than the standard coefficient table, and the coefficient terms are not identical, it is necessary to match all coefficients in the standard coefficient table one by one. New coefficient variables are created using the coefficient name as the key, considering all possible variations of the same coefficient type. Specifically, they are divided into principal coefficients, quadratic coefficients, linear terms, quadratic terms, cross terms, etc., totaling 88 variables. All coefficients of the six components are extracted and processed column by column.
[0060] Principal coefficients: Ki1+, Ki1-, Ki2+, Ki2-;
[0061] Linear terms: KFyi1+, KFyi1-, KFxi1+, KFxi1-...
[0062] Quadratic terms: KFyi²+, KFyi²-, KFxi²+, KFxi²-...
[0063] Cross terms: KFyFxi+, KFyFxi-, KFxFyi+, KFyFxi-...
[0064] B2: Initialize coefficient variables, assigning an initial value of 0 to all coefficient variables.
[0065] B3: In each column, match row by row using the coefficient variable name as the keyword. Assign values to the matched variables, and leave the values of unmatched variables as 0. The matching results for the first column are as follows:
[0066] Ki1+ = 1.5046E00
[0067] Ki1- = 1.5007E00
[0068] KFyi1+ =0
[0069] KFyi1- =0
[0070] KMzi1+ =3.3161E-02
[0071] KMzi1- =3.4051E-02
[0072] ...
[0073] B4: Generate the formula code for the main term and the square term. For each coefficient, distinguish between positive and negative terms, and first generate the formula strings for the main term and the square term separately. Then, combine the strings to form the formula code for the main term and the square term of that component.
[0074] tmpout[1]=(ny>0?1.5046E+0:1.5007E+0)*Ni1+(ny>0?0.0000E+0:0.0000E+0)*Ni1*Ni1;
[0075] B5: Generate formula codes for linear and quadratic terms. For each coefficient, if it is 0, no output is given; otherwise, positive and negative terms are distinguished. First, generate the formula string for each coefficient, then combine all the formula strings for linear and quadratic terms into the formula code for that component.
[0076] Kji1= x*(x>0? 2.1623E-3:2.1623E-3) + mz*(mz>0? 3.3161E-2:3.4051E-2) +z*(z>0? -6.6056E-3:-6.6056E-3) + my*(my>0? 3.8636E-3:3.8636E-3) + mx*(mx>0?1.7010E-2:1.8319E-2);
[0077] B6: Generate the formula code for the interference terms. Similarly, each coefficient is evaluated; if it's 0, no output is given; otherwise, positive and negative terms are distinguished. First, the formula string for each interference term coefficient is generated. Then, all the interference term formula strings are combined to form the interference term formula code for that component.
[0078] Kmn1= mz*y*(mz*y>0? 9.7455E-7:9.7455E-7);
[0079] B7: Add fixed code for this component, combining the generated code above into the calculation code for this component.
[0080] Kji1=……
[0081] Kmn1=……
[0082] Ni1 = ny - Kji1 - Kmn1
[0083] tmpout[1] = ...
[0084] B8: Combine the six component calculation codes into the main calculation code of the formula node.
[0085] Kji1=……
[0086] Kmn1=……
[0087] Ni1 = ny - Kji1 - Kmn1
[0088] tmpout[1] = ...
[0089] Kji2=……
[0090] Kmn2=……
[0091] Ni2 = ny– Kji2- Kmn2
[0092] tmpout[2] = ...
[0093] ...
[0094] B9: Add fixed code for the load formula node to generate the final load formula node code.
[0095] float y, x, mz, z, my, mx;
[0096] ...
[0097] for(i=0;i<8;i++)
[0098] {
[0099] Kji1=……
[0100] Kmn1=……
[0101] Ni1 = ny - Kji1 - Kmn1
[0102] tmpout[1] = ...
[0103] ...
[0104] }
[0105] ...
[0106] The method shown in Formula Two of the balance is as follows:
[0107] C1: Generate component formula code. Since the coefficient table used in Formula 2 is a standard coefficient table, the number and position of coefficients are fixed. Therefore, in each column, the coefficient variable strings in a fixed order are matched row by row with the standard coefficient table to first generate the formula string for each coefficient, and then all the formula strings are combined to form the component formula code.
[0108] Kji1=(2.5985761E-10)*y*y+(2.8341437E-09)*x*x+(3.3352162E-09)*mz*mz+(5.2838879E-09)*z*z+(1.3402797E-08)*my*my+(-1 .2645292E-08)*mx*mx+(7.7178518E-10)*y*x+(-1.6433173E-09)*y*mz+(0.0000000E+00)*y*z+(0.0000000E+00)*y*my+(0.0000000 E+00)*y*mx+(-1.2282740E-08)*x*mz+(0.0000000E+00)*x*z+(0.0000000E+00)*x*my+(0.0000000E+00)*x*mx+(0.0000000E+00)*mz *z+(0.0000000E+00)*mz*my+(0.0000000E+00)*mz*mx+(0.0000000E+00)*z*my+(-1.5881412E-08)*z*mx+(-9.1767860E-09)*my*mx;
[0109] tmpout[1]=(1.4627366E+01)*Ni1+(-7.3081652E-03)*Ni2+(-1.9465463E-01) *Ni3+(1.9266349E-02)*Ni4+(-8.4015665E-03)*Ni5+(-7.0284617E-02)*Ni6;
[0110] C2: Add fixed code for this component, combining the generated code above into the calculation code for this component.
[0111] Kji1=……
[0112] Ni1 = ny - Kji1;
[0113] tmpout[1]=……
[0114] C3: Combines the six component calculation codes into the main calculation code of the formula node.
[0115] Kji1=……
[0116] Kji2=……
[0117] ...
[0118] Ni1 = ny - Kji1;
[0119] Ni2 = nx – Kji2;
[0120] ...
[0121] tmpout[1]=……
[0122] tmpout[2]=……
[0123] ...
[0124] C4: Add fixed code for the load formula node to generate the final load formula node code.
[0125] int i;
[0126] float y, x, mz, z, my, mx, ny, nx, nmz, nz,nmy, nmx;
[0127] ...
[0128] for(i=0;i<8;i++)
[0129] {
[0130] Kji1=……
[0131] Kji2=……
[0132] ...
[0133] }
[0134] ...
[0135] S4: Generate the combination formula node code based on the bridge group information.
[0136] D1: Search the bridge information character by character for the largest number to determine the number of bridge paths, i.e., signal channels. In this example, the maximum number of channels is 7.
[0137] D2: Generate channel definition code based on the number of channels.
[0138] float B1, B2, B3, B4, B5, B6, B7=0;
[0139] B1=data[0]; B2=data[1]; B3=data[2]; B4=data[3]; B5=data[4]; B6=data[5]; B7=data[6];
[0140] D3: Match component bridge combination strings line by line using component names as keywords.
[0141] D4: The code for combining six components of a bridge circuit.
[0142] Y = +B1 - B2;
[0143] X = +B7;
[0144] Mz = +B1 + B2;
[0145] Z = +B4 - B3;
[0146] My = +B3 + B4;
[0147] Mx = +B5 + B6;
[0148] D5: Combine the channel definition code with the six-component bridge combination code, add fixed code, and generate the final combination formula node code.
[0149] float B1, B2, B3, B4, B5, B6, B7=0;
[0150] ...
[0151] S5: Create a display interface and copy the generated load formula node code and combination formula node code into the data processing program.
[0152] S6: Select the original data from the previous experiment, run the data processing program, and you will get the load calculation results for the model.
[0153] Fy=…;Fx=…;Mz=…;Fz=…;My=…;Mx=…
[0154] This invention is not limited to the specific embodiments described above. The invention extends to any new feature or combination disclosed in this specification, as well as any new method or process step or combination disclosed herein.
Claims
1. A method for converting balance certificates into general program code during wind tunnel testing, characterized in that... Includes the following steps: S1: Call the control to read the text information of the balance certificate; S2: Locate the starting position based on keywords, search for and extract information from the text. The extraction steps include: A1: Locate the starting position based on the "balance coefficient table", extract the coefficient table information from the text information and generate an electronic coefficient table; A2: Locate the starting position based on the "relationship between each component signal and each bridge output signal", and extract the component group bridge information from the text information; A3: Locate the starting position based on other parameters and extract parameter-related information from the text information; S3: Generate load formula node code based on the electronic coefficient table. The load formula node code object includes two balance formulas, balance formula one and balance formula two, which have different code generation methods. S4: Generate the combination formula node code based on the bridge group information; S5: Add the generated load formula node code and combination formula node code to the standard calculation module of data processing to complete the calculation.
2. The method for converting a balance certificate to general program code in a wind tunnel test according to claim 1, characterized in that... The method for generating the load formula node code for Formula 1 of the balance is as follows: B1: Create all new coefficient variables. The coefficient variables are matched one by one with the coefficient name as the key, matching all coefficients in the standard coefficient table. B2: Initialize the coefficient variables, assigning an initial value of 0 to all coefficient variables; B3: In each column, match row by row using the coefficient variable name as the keyword, assign values to the matched variables, and set the value of unmatched variables to 0; B4: Generate formula code for the main term and square term; B401: Analyze each coefficient to distinguish between positive and negative terms. B402: Generates the strings for the formulas of the main term and the square term respectively. B403: Then combine the strings to form the formula code for the main term and square term of the main term variable in this column; B5: Generate formula codes for linear and quadratic terms; B501: Analyze each coefficient; if it is 0, do not output anything; otherwise, distinguish between positive and negative terms. B502: Generates the formula string for each coefficient. B503: Then combine the formula strings of all linear and quadratic terms into the formula codes of the linear and quadratic terms of this component; B6: Generate formula code for interference terms; B601: Similarly, check each coefficient; if it is 0, do not output; otherwise, distinguish between positive and negative terms. B602: Generates the formula string for each interference term coefficient. B603: Combine the formula strings of all interference items into the interference item formula code for this component; B7: Add fixed code for the main variable of this column, and combine all the generated codes above into the calculation code for this component; B8: Combines the six component calculation codes into the main calculation code of the formula node; B9: Add fixed code for the load formula node to generate the final load formula node code.
3. The method for converting a balance certificate to general program code in a wind tunnel test according to claim 1, characterized in that... The method for generating the nodal code for the load formula in Formula 2 of the balance is as follows: C1: Generate component formula code. In each column, the coefficient variable strings in a fixed order are matched row by row with the standard coefficient table to generate the formula string for each coefficient. All formula strings are combined to form the component formula code. C2: Add fixed code for this component, and combine the generated code above into the calculation code for this component; C3: Combines the six-component calculation codes into the main calculation code of the formula node; C4: Add fixed code for the load formula node to generate the final load formula node code.
4. The method for converting a balance certificate to general program code in a wind tunnel test according to claim 1, characterized in that... The generation of bridge information includes the following steps: D1: Search for matching characters one by one in the bridge group information to find the largest number, so as to determine the number of bridge routes, i.e., signal channels; D2: Generate channel definition code based on the number of channels; D3: Match component bridge combination strings line by line using component names as keywords; D4: Bridge combination code that combines the six components; D5: Combine the channel definition code with the six-component bridge combination code, add fixed code, and generate the final combination formula node code.
5. A method for converting a balance certificate to general program code in a wind tunnel test according to any one of claims 1-4, characterized in that: Data retrieval is based on the Word.ApplicationActiveX class in the Office environment, and the balance certificate is in Word format.
6. The method for converting a balance certificate to general program code in a wind tunnel test according to claim 5, characterized in that... The node code for generating balance load technology is based on C language code.