Flight simulation rotary table-oriented simulation machine instruction update cycle automatic identification method and system
By automatically identifying the instruction update cycle of the flight simulation turntable in the host computer and using multi-dimensional judgment conditions, the problem of cycle matching between the host computer and the slave computer is solved, ensuring the accuracy and stability of the simulation test and reducing costs and safety hazards.
Patent Information
- Application Number
- CN202511362807.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2026-01-16
AI Technical Summary
In existing flight simulation turntables, the command cycle matching between the host computer and the slave computer suffers from the problem that preset errors cannot be avoided by manual calibration, resulting in deviation and distortion of simulation test data. Furthermore, adjustments based on slave computer data are lagging and have errors, posing safety hazards.
By automatically identifying the instruction update cycle in the host computer, and using multi-dimensional judgment conditions, including the standardization of host computer instruction transmission, the stability of single axis data of the turntable, and the consistency of multi-axis results, the host computer cycle is verified step by step to ensure matching and accuracy.
This technology enables proactive identification of periodic deviations before simulation testing, avoiding attitude inaccuracies, improving the accuracy and stability of the simulation system, reducing maintenance costs, and extending the turntable's service life.
Smart Images

Figure CN121348797A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer control technology, specifically to a method and system for automatically identifying the simulator instruction update cycle for flight simulation turntables. Background Technology
[0002] In flight simulation experiments in the aerospace field, to accurately reproduce various flight attitudes and motion states of aircraft in the air under laboratory conditions, a closed-loop process of "sending commands - executing feedback - deviation correction" is typically required, which involves the coordinated operation of a flight simulation turntable and its host computer. The flight simulation turntable is essentially a multi-degree-of-freedom, high-precision electromechanical closed-loop control system. Its core function is to receive commands from the user's host computer or simulator at fixed intervals, while simultaneously collecting real-time actual attitude information of the turntable through sensors such as encoders. Based on the control algorithm, it calculates the deviation between the commands and the actual attitude, generates control commands to drive the motors to adjust the turntable's motion attitude to closely match the command requirements. At the same time, the flight simulation turntable also transmits the actual attitude data collected by the host computer back in real time, providing a basis for the host computer to monitor and correct commands. The core function of the user's host computer is to generate target commands for continuous flight attitude changes based on preset flight scenarios or test requirements, then send command signals to the turntable control computer at fixed intervals, while simultaneously receiving actual attitude data feedback from the turntable. It intervenes promptly when deviations exceed limits to ensure the experiment does not deviate from the preset target, thus guaranteeing the accuracy of the simulation experiment.
[0003] In this collaborative process, the simulation cycle of the host computer, that is, the time interval between the host computer sending command signals to the turntable, directly determines the density and transmission timing of the command sequence. This ensures the continuity of attitude simulation and maintains a closed-loop collaborative rhythm with the turntable. The flight simulation turntable itself has a fixed execution cycle, requiring it to receive commands and adjust its attitude according to the cycle. Therefore, the simulation cycle of the host computer and the execution cycle of the turntable need to be an integer multiple match. However, when a mismatch occurs due to inconsistent cycle standards between the host and slave computers, or incorrect parameter settings during adjustment, the commands received by the turntable may be missing or jump. If not addressed promptly, this will cause the test data to deviate and become distorted, failing to achieve the expected test results, and even causing oscillations, affecting the simulation effect, accelerating the aging of motors and shafts, shortening the turntable's lifespan, and potentially damaging the tested product, creating potential safety hazards. Common solutions to this problem include: 1. Manually calibrating the preset cycles of the host and slave computers to integer multiples before the test. 2. The host computer collecting execution cycle data from the slave computer to adjust its own cycle to maintain a match. Manual calibration before the test cannot effectively avoid mismatch caused by the preset error of the cycle itself. Calibration based only on integer multiples is not comprehensive enough. The latter is based on the data returned by the lower computer, which has lag and indirectness and is prone to introducing unnecessary errors. Summary of the Invention
[0004] This invention overcomes the problem in existing technologies where manual calibration before the test cannot effectively avoid mismatches caused by preset errors in the cycle when automatically identifying the cycle of the command sent by the host computer to the flight simulation turntable during the simulation process. Furthermore, calibration based only on integer multiples is not comprehensive enough. The host computer collects the execution cycle data of the slave computer to adjust its own cycle to maintain matching, which is based on the data returned by the slave computer. This method is lagging and indirect, and is prone to introducing unnecessary errors and various hidden dangers and problems caused by frequent errors in manual settings.
[0005] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: Option 1: This invention proposes an automatic identification method for simulator instruction update cycles on flight simulation turntables, the method comprising the following steps: Step 1: Send the corresponding position command signal to each axis of the flight simulation turntable through the host computer. Use index i as the unique identifier of different axis systems. Iterate through each axis system of the flight simulation turntable in turn, read the current position command CurrentCmdPos[i] of each axis system, and perform the corresponding initialization operation on the axis system running for the first time by judging the status of the flag bit isFirstRun[i]. Step 2: Based on the initialization operation of the axis system in Step 1, calculate the received position change PosDiff and determine whether the axis system has moved by comparing the position changes; at the same time, count the number of position changes ChangeInWindow[i], the number of positions that did not change between two position changes SameValueCount[i], and the total number of positions that did not change TotalSameCount[i] by accumulating the number of frames that have been run in the window FrameInWindow[i]. When the expected number of position changes, Min_Change_Count, is reached within the specified time window, it is considered that the host computer cycle has been correctly detected, and the data within this window is used for cycle identification. Step 3: Based on the number of position changes in the window that has been correctly verified and detected in Step 2 (ChangeInWindow[i]), the total number of times the position has not changed (TotalSameCount[i]), and the known sampling period (Sample_Interval) of the turntable lower-level machine, calculate a command to be sent by the upper-level machine (WindowAvgPeriod). Step 4: Determine the accuracy of the identified host computer cycle through three dimensions. First, verify whether the calculated host computer instruction sending WindowAvgPeriod is an integer multiple of the turntable lower computer sampling cycle Sample_Interval. If it meets the integer multiple requirement, collect the instruction sending of the number of correctly detected windows Window_History_Count for each axis, and count the most frequent occurrence MaxCount and the corresponding cycle identification result DetectedPeriod[i]. If the occurrence exceeds the expected number, confirm that the result DetectedPeriod[i] is the cycle of that axis. After the cycle of each moving axis system is determined, call the CheckMajorityActiveAxes function to judge and compare the cycle DetectedPeriod[i] determined by each axis based on the principle that more than half of the axis systems have the same cycle, so as to obtain the final identified host computer instruction sending FinalConfirmedPeriod.
[0006] Furthermore, a preferred embodiment is provided, wherein the method for performing the corresponding initialization operation on the shaft system for the first operation in step 1 is as follows: Assign the current instruction CurrentCmdPos[i] to the previous instruction LastCmdPos[i] as the initial reference value for subsequent calculations, and initialize the count SameValueCount[i] of the number of times the position did not change between the two position changes to 1, recording the initial occurrence of the current instruction, and providing a counting starting point for the subsequent counting of the number of times the position did not change.
[0007] Furthermore, a preferred embodiment is provided, wherein the method for calculating the received position change PosDiff in step 2 is as follows: .
[0008] Furthermore, a preferred embodiment is provided, wherein the method for determining whether the shaft system has moved by comparing position changes in step 2 is as follows: A threshold detection machine is introduced to determine whether a change in the position of the shaft system has occurred effectively. The determination condition is:
[0009] The discrimination threshold EPSILON is set to 0.0001, a single-precision floating-point number.
[0010] Furthermore, a preferred embodiment is provided: in step 2, when the expected number of position changes (Min_Change_Count) is reached within a specified time window, it is considered that the host computer cycle has been correctly detected. The method for using the data within this window for cycle identification is as follows: First, the time window conversion should satisfy:
[0011] Wherein, Window_Frame_Count is the total number of frames within the specified time window; Secondly, the number of frames already running within the window, FrameInWindow[i], should satisfy the following: ; Finally, the conditions for window validity should be met:
[0012] Where ChangeInWindow[i] is the number of position changes within the specified time window; Min_Change_Count This represents the expected number of positional changes.
[0013] Furthermore, a preferred embodiment is provided, wherein the method for calculating and sending a host computer instruction to WindowAvgPeriod in step 3 is as follows: .
[0014] Furthermore, a preferred embodiment is provided, wherein the method for determining and identifying the host computer cycle through three dimensions in step 4 is as follows: Dimension 1: The standardization of host computer instruction transmission ensures the physical rationality of the cycle from the underlying timing logic, making the steps... The period WindowAvgPeriod calculated in step three should satisfy:
[0015] Here, remainder is equivalent to the remainder between the calculated host computer cycle and the sampling cycle of the turntable control system. If the remainder is close to 0 or close to the sampling cycle of the turntable control system, it is determined to be an integer multiple and passes the verification of the one-dimensional cycle norm. Dimension 2, stability of single axis data of turntable: First, only the host computer cycle WindowAvgPeriod that has been verified by Dimension 1 will be further verified from the perspective of Dimension 2; the host computer cycle WindowAvgPeriod that meets the conditions of Dimension 1 will be stored in the historical cycle array WindowPeriod[i] using a circular overwrite mechanism, and the number of storage will be recorded by the counter WindowIndex[i].
[0016] Dimension 3, Consistency of Multi-Axe Results: The CheckMajorityActiveAxes function first filters out the axis period identification results DetectedPeriod[i] that have passed the stability verification in Dimension 2, stores them in a temporary array ActivePeriods, and counts the number of valid axes. If there is only one valid axis, its period is considered reliable and directly used as a candidate global period. If there are multiple valid axes, a double loop is used to count the number of times each period appears in the array OutActiveCount, and the highest frequency MaxOccurrences and its corresponding period are recorded. The highest frequency MaxOccurrences should satisfy:
[0017] Only when more than half of the axis periods are consistent can the period be confirmed as the final global period (FinalConfirmedPeriod), thus completing the global consistency check of the multi-axis periods.
[0018] Option 2: An automatic identification system for simulator instruction update cycles for flight simulation turntables, the system comprising: The initialization module is used to send corresponding position command signals to each axis of the flight simulation turntable through the host computer. It uses index i as the unique identifier of different axis systems, traverses each axis system of the flight simulation turntable in turn, reads the current position command CurrentCmdPos[i] of each axis system, and performs corresponding initialization operations on the axis system running for the first time by judging the status of the flag bit isFirstRun[i]. The judgment module is used to perform corresponding initialization operations on the axis system for the first run in the initialization module, calculate the received position change amount PosDiff, and determine whether the axis system has moved by comparing the position changes; at the same time, it counts the number of position changes ChangeInWindow[i], the count of no position change between two position changes SameValueCount[i], and the total number of no position change TotalSameCount[i] by accumulating the number of frames that have been run in the window FrameInWindow[i]. When the expected number of position changes, Min_Change_Count, is reached within the specified time window, it is considered that the host computer cycle has been correctly detected, and the data within this window is used for cycle identification. The detection module is used to calculate a host computer instruction sending windowAvgPeriod based on the number of position changes in the window that has been correctly verified and detected in the judgment module, ChangeInWindow[i], the total number of times the position has not changed, TotalSameCount[i], and the known sampling period Sample_Interval of the turntable lower computer itself. The identification module is used to determine the accuracy of the identified host computer cycle through three dimensions. First, it verifies whether the calculated host computer instruction sending WindowAvgPeriod is an integer multiple of the turntable lower computer sampling cycle Sample_Interval. If it meets the integer multiple requirement, it collects the instruction sending of the number of correctly detected windows Window_History_Count for each axis, and counts the most frequent occurrence MaxCount and the corresponding cycle identification result DetectedPeriod[i]. If the occurrence exceeds the expected number, the result DetectedPeriod[i] is confirmed as the cycle of that axis. After the cycle of each moving axis is determined, the CheckMajorityActiveAxes function is called to judge and compare the cycle DetectedPeriod[i] determined by each axis based on the principle that more than half of the axis systems have the same cycle, so as to obtain the final identified host computer instruction sending FinalConfirmedPeriod.
[0019] Option 3: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in Option 1.
[0020] Option 4: A computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the method described in Option 1.
[0021] The advantages of this invention are: The present invention provides an automatic identification method for simulator instruction update cycles for flight simulation turntables. This method directly sets multiple judgment conditions for the host computer instructions themselves to identify and analyze the cycles. It transforms the passive mode of adjusting after deviations occur into an active intervention to identify and prevent deviations before they cause the turntable attitude to become inaccurate. Without increasing costs, this method avoids the adverse effects of this problem and ensures the accuracy and stability of the entire simulation system.
[0022] The verification logic in the automatic identification method for simulator command update cycles for flight simulation turntables described in this invention closely aligns with the actual engineering conditions of the turntable. From local data statistics to global collaborative verification, it balances engineering practicality with theoretical rigor, avoiding reliance on single-dimensional judgments and progressively tightening verification conditions. This avoids errors from one-sided judgments and provides clear quantitative standards for the identified host computer command transmission results. During the simulation collaboration between the host computer and the flight simulation turntable, if their cycles are mismatched, the host computer command transmissions calculated by the algorithm of this invention can provide accurate basis for simulation parameter optimization. Using this for correction can effectively avoid problems such as simulation command lag, position deviation, or axis control jitter, saving debugging costs and time, reducing the maintenance frequency and repair costs of the turntable, extending the turntable's service life, and improving the reliability of simulation experiments.
[0023] This invention is also applicable to the fields of flight simulation turntable control systems, aircraft hardware-in-the-loop simulation systems, and computer control of multi-aircraft communication electromechanical systems. Attached Figure Description
[0024] Figure 1 This is a flowchart of an automatic identification method for simulator instruction update cycles for flight simulation turntables, as described in Implementation Method 1.
[0025] Figure 2 This is a schematic diagram of the sinusoidal command signal curve sent by the host computer to the turntable axis system 1 as described in Embodiment 1.
[0026] Figure 3 This is a schematic diagram of the stationary command signal curve sent by the host computer to the turntable axis system 2 as described in Embodiment 1.
[0027] Figure 4 This is a schematic diagram of a delayed cosine command signal curve sent by the host computer to the turntable axis system 3 as described in Embodiment 1.
[0028] Figure 5 This is a schematic diagram of the random small jitter command signal curve sent by the host computer to the turntable axis 4 to simulate noise, as described in Embodiment 1.
[0029] Figure 6 The diagram shows the curve of the position command received by the turntable, where the host computer sends the command in 10ms as described in Implementation Method 1.
[0030] Figure 7 The diagram shows the curve of the position command received by the turntable after the host computer sends the command in 10ms as described in Implementation Method 1, which is then identified and corrected by the algorithm.
[0031] Figure 8 The diagram shows the curve of the position command received by the turntable, where the host computer sends the command in 5ms as described in Implementation Method 1.
[0032] Figure 9 The diagram shows the curve of the position command received by the turntable after the host computer sends the command in 5ms as described in Implementation Method 1, which is then identified and corrected by the algorithm.
[0033] Figure 10 The diagram shows the curve of the position command received by the turntable, where the host computer sends the command in 2ms as described in Implementation Method 1.
[0034] Figure 11 The diagram shows the curve of the position command received by the turntable after the instruction transmission of the host computer in Implementation Method 1 is 2ms and is corrected by the algorithm.
[0035] Figure 12 This is a schematic diagram of the position command received by the turntable when the host computer sends the command for 1ms as described in Implementation Method 1.
[0036] Figure 13 The diagram shows the curve of the position command received by the turntable after the host computer sends the command in 1ms as described in Implementation Method 1, which is then identified and corrected by the algorithm. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.
[0038] Implementation Method 1, see [link] Figures 1 to 13This embodiment describes an automatic identification method for simulator command update cycles on a flight simulation turntable. First, the turntable reads position command information output from the host computer in real time, simultaneously monitoring the changes in position commands within a preset time window and filtering the data for validity to avoid invalid data interfering with cycle calculation. Second, based on the obtained valid command sequence, the host computer command transmission is accurately calculated.
[0039] Meanwhile, three judgment conditions are introduced from three dimensions: the standardization of the host computer command transmission, the stability of the single axis data of the turntable, and the consistency of the results of multiple axes. These conditions further eliminate random errors and effectively reduce the missed judgment rate and the false judgment rate, so as to ensure the accuracy of the command transmission calculation results.
[0040] Once the host computer sends and confirms the instruction, it can be used directly for subsequent host computer instructions and lower computer execution cycle co-optimization processing, or it can be used as an early warning to avoid simulation accuracy degradation or system instability caused by cycle mismatch.
[0041] 1. A method for accurately detecting and identifying the host computer commands sent by a flight simulation turntable through multi-dimensional judgment. The specific process of this method is as follows: Step 1: Send the corresponding position command signal to each axis of the flight simulation turntable through the host computer. Use index i as the unique identifier of different axis systems, traverse each axis system of the turntable in turn, read the current position command CurrentCmdPos[i] of each axis, and perform the corresponding initialization operation on the axis system running for the first time by judging the status of the flag bit isFirstRun[i].
[0042] Step 2: The program performs relevant calculations on each axis of the turntable, calculating the received position change PosDiff, and determining whether the axis has moved by comparing the position changes. Simultaneously, it accumulates the number of position changes within a specified time window (FrameInWindow[i]), the number of times the position did not change between two position changes (SameValueCount[i]), and the total number of times the position did not change (TotalSameCount[i]). When the expected number of position changes (Min_Change_Count) is reached within the specified time window, the cycle detection for the host computer is considered correct, and the data within this window can be used for cycle identification.
[0043] Step 3: Based on the number of position changes within the window that has been correctly verified and detected in Step 2 (ChangeInWindow[i]), the total number of times the position has not changed (TotalSameCount[i]), and the known sampling period (Sample_Interval) of the turntable lower-level machine, the program calculates a command to be sent from the upper-level machine (WindowAvgPeriod).
[0044] Step 4: The program determines the accuracy of the identified host computer cycle through three dimensions. First, it verifies whether the calculated host computer instruction sending WindowAvgPeriod is an integer multiple of the turntable slave computer sampling cycle Sample_Interval. If it meets the integer multiple requirement, it collects the instruction sending of the number of correctly detected windows Window_History_Count for each axis, and counts the most frequent occurrence MaxCount and the corresponding cycle identification result DetectedPeriod[i]. If the occurrence exceeds the expected number, the result DetectedPeriod[i] is confirmed as the cycle of that axis. After the cycle of each moving axis is determined, the CheckMajorityActiveAxes function is called to compare the identified cycle DetectedPeriod[i] of each axis based on the principle that more than half of the axis systems have the same cycle, thus obtaining the final identified host computer instruction sending FinalConfirmedPeriod.
[0045] Step 1 specifically includes: For the axis system marked as running for the first time, initialization is performed. First, the current instruction CurrentCmdPos[i] is assigned to the previous instruction LastCmdPos[i] as the initial reference value for subsequent calculations. This addresses the issue of no historical data in the first cycle and provides reliable starting data for the detection cycle. If no initial reference is set, LastCmdPos[i] will be empty when calculating the instruction difference for the first time, which will cause the position change judgment in step 2 to fail, leading to misjudgment in cycle detection. Next, the flag isFirstRun[i] is reset to mark that the axis system has completed initialization and avoid repeated execution. At the same time, the count SameValueCount[i] of positions that did not change between two position changes is initialized to 1, recording the initial occurrence of the current instruction and providing a counting starting point for subsequent statistics on the number of times the position did not change.
[0046] Step 2 specifically includes: (1) First, the position change PosDiff is calculated based on the difference quantization theory. The specific calculation formula is as follows:
[0047] This formula eliminates directional interference through absolute value calculation, retaining only the change amplitude information. It is a standard method for measuring change amplitude in signal processing and provides a quantitative basis for the subsequent state detection host computer cycle.
[0048] Simultaneously, a threshold detection machine is introduced to determine whether a change in the position of the shaft system has occurred effectively. Its judgment conditions should meet the following:
[0049] The discrimination threshold EPSILON is set to a single-precision floating-point number of 0.0001. The noise suppression threshold principle is used to filter out the tiny jumps caused by hardware sampling such as sensors and invalid fluctuations caused by floating-point calculation precision deviations. This ensures that only real position changes exceeding the set threshold are effectively detected, thus avoiding noise interference with data statistics from the source and improving the reliability of the judgment conditions.
[0050] (2) In terms of time window design, this invention has made targeted optimizations based on the sampling characteristics of the turntable system and the engineering constraints of the host computer command transmission. Since the sampling period Sample_Interval of the turntable control system tested in this invention is 0.5ms, and the maximum command transmission of the host computer is generally 10ms under the combined effects of real-time requirements and dynamic accuracy constraints, 100ms is selected as the specified time window. This duration can provide sufficient event samples for period calculation, effectively avoid the implicit period drift that may be introduced by a long window, and simultaneously satisfy the sufficiency of data and the timeliness of data. The time window conversion should meet the following requirements:
[0051] Window_Frame_Count is the total number of frames within the specified time window.
[0052] Therefore, to achieve precise control over the specified time window, timing is implemented through cumulative counting. The number of frames already executed within the window, FrameInWindow[i], should satisfy the following:
[0053] To filter out interference from non-periodic position changes, better select effective detection time windows, and achieve self-consistency in the period calculation logic in step 3, the conditions for window validity should be met:
[0054] Where ChangeInWindow[i] is the number of position changes within the specified time window; Min_Change_Count is the expected number of position changes.
[0055] The expected number of position changes, Min_Change_Count, is set to 9. Firstly, this number covers the scenario where the maximum cycle of the host computer is 10ms. Secondly, the complete interval of the turntable axis position command change is from the start of one cycle to the start of the next. Considering that the change in the tail frame exceeds the edge cycle of the 100ms window, 9 changes avoid the problem of edge frame interference, providing more accurate data for the cycle identification calculation in step 3.
[0056] (3) Based on the differentiated statistical logic, the number of position changes in the statistical window ChangeInWindow[i], the count of no position change between two position changes SameValueCount[i], and the total number of no position changes TotalSameCount[i] are flexible. They can ensure that the motion axis has enough data for period calculation, and can accurately distinguish whether the axis is truly stationary or just briefly stops within the period. This provides a basis for eliminating interference from stationary axis systems, enabling the present invention to adapt to different motion characteristics of different axis systems and enhancing the robustness of the system.
[0057] Step 3 specifically includes: Based on the definition that "period = time interval between two adjacent changes", when there are n changes, the total time is the sum of the periods (T1 + T2 + ... + Tn), and the average period is:
[0058] TotalSameCount[i] is essentially the sum of time counts for all cycles, corresponding to the sum of the counts for each cycle (T1+T2+…+Tn). ChangeInWindow[i] corresponds to the number of cycles n. Therefore, the formula for calculating WindowAvgPeriod (unit: ms) sent by the host computer is as follows:
[0059] Therefore, under the premise that the number of changes is sufficient and the statistical data within the window is valid in step 2, the statistical discrete counts are converted into a period with physical meaning, ensuring the stability and reliability of the results, and providing a precise quantitative basis for multi-dimensional verification of the calculated period in step 4.
[0060] Step 4 specifically includes: (1) Dimension 1: Standardization of host computer instruction transmission: In order to filter out non-standard cycles caused by calculation errors or abnormal data, the physical rationality of the cycle is guaranteed from the underlying timing logic, so that the cycle WindowAvgPeriod calculated in step 3 should satisfy:
[0061] Here, remainder is equivalent to the remainder between the calculated host computer cycle and the turntable control system sampling cycle. If the remainder is close to 0 or close to the turntable control system sampling cycle, it is determined to be an integer multiple, and thus passes the verification of the cycle normalization in dimension 1.
[0062] (2) Dimension Two: Stability of Single Axis Data on the Turntable: First, only the host computer cycle WindowAvgPeriod that has passed the verification of Dimension 1 will be further verified from the perspective of Dimension 2. The host computer cycle WindowAvgPeriod that meets the conditions of Dimension 1 is stored in the historical cycle array WindowPeriod[i] using a circular overwrite mechanism, and the number of stored cycles is recorded by the counter WindowIndex[i]. In this invention, the number of windows that have been correctly detected calculated for each axis is Window_History_Count, which is 20, that is, the most recent 20 valid cycles are retained. When the valid cycles are full, the history array is traversed by a double loop to find the most frequent occurrence MaxCount. If the most frequent occurrence MaxCount exceeds 15 times, the cycle identification result DetectedPeriod[i] corresponding to the most frequent occurrence is confirmed as a valid cycle that has passed the verification of Dimension 2. Meanwhile, the reason for setting the threshold for the number of valid cycles to 15 is that, under actual working conditions, even if the cycles of each axis system are relatively stable, a few abnormal cycles may occur due to hardware communication jitter, floating-point calculation deviations, etc. Reserving a certain fault tolerance space can not only effectively avoid excessively stringent judgment conditions, but also eliminate interference from unstable cycles, ensuring that the confirmed cycle has long-term stability and reliability.
[0063] (3) Dimension 3: Consistency of Multi-Axe Results: The CheckMajorityActiveAxes function first filters out the axis period identification results DetectedPeriod[i] that have passed the stability verification of Dimension 2, stores them in the temporary array ActivePeriods, and counts the number of valid axes. If there is only 1 valid axis, its period is assumed to be reliable and directly used as a candidate global period; if there are multiple valid axes, the occurrence count of each period in the array is counted through a double loop OutActiveCount, and the highest frequency MaxOccurrences and its corresponding period are recorded. The highest frequency MaxOccurrences should satisfy:
[0064] A period is only confirmed as the final global period (FinalConfirmedPeriod) when more than half of the shaft systems have consistent periods. This majority rule not only effectively filters out abnormal results caused by shaft system failures or detection errors, but also avoids abnormal interference from a few shaft systems, thus completing the global consistency verification of multiple shaft system periods.
[0065] In summary, the verification logic of this invention closely aligns with the actual operating conditions of the turntable in engineering. From local data statistics to global collaborative verification, it balances engineering practicality with theoretical rigor. It avoids relying on a single-dimensional judgment, gradually tightening the verification conditions to prevent errors from one-sided judgments and to provide clear quantitative standards for the identified host computer command transmission results. During the collaborative simulation process between the host computer and the flight simulation turntable, if their cycles are mismatched, the host computer command transmission calculated by the algorithm of this invention can provide accurate basis for simulation parameter optimization. Using this for correction can effectively avoid problems such as simulation command lag, positional deviation, or axis control jitter, saving debugging costs and time, reducing the turntable's maintenance frequency and repair costs, extending the turntable's service life, and improving the reliability of simulation experiments.
[0066] To verify the effectiveness of this invention, a multi-dimensional and differentiated instruction signal was generated by a host computer to simulate a period mismatch with the ET418B turntable, and the program was used to solve the period mismatch problem. The differentiated instructions generated by the host computer were as follows: axis 1 outputs a standard sine wave signal with an amplitude of 1.5V and a frequency of 10Hz, such as... Figure 2 As shown; Shaft 2 remains stationary, as indicated by the command. Figure 3 As shown; after the delayed start of shaft system 3, it outputs a cosine signal with an amplitude of 1.5V and a frequency of 5Hz, as follows. Figure 4 As shown; shaft 4 is a random small jitter command, simulating noise signals, such as... Figure 5 As shown. The sampling period of the ET418B turntable is 0.5ms, while the command transmission time from the host computer is 10ms. Under the simulated real turntable operating conditions with mismatched periods, taking turntable axis 1 as an example, the received commands from the host computer are as follows. Figure 6 As shown, a plateau phenomenon occurred where the position remained unchanged for multiple shots. The verification and identification algorithm described in this invention accurately detects and identifies the host computer command transmissions, and then effectively corrects them. The specific steps are as follows: (1) First, the turntable reads the position commands of the four axes sent by the host computer in real time and determines whether the program is running for the first time. If it is running for the first time, the core variables need to be initialized to prepare and unify the data for the next calculation.
[0067] (2) Calculate the position change of each axis system, determine whether the detection conditions are met, and distinguish between valid changes and noise fluctuations. At the same time, the turntable uses a sampling period of 0.5ms, so a window is formed when the total number of frames in the window reaches 200 frames (i.e., 100ms). At the same time, the number of position changes and the total number of changes within the window are counted. The working conditions of the four axes of the turntable are analyzed in detail below. For axis system 2, since it is always stationary, the number of changes within the window is 0, and it is directly judged as invalid data and excluded from the subsequent process. Although the noise jitter of axis system 4 changes, the number of valid changes within most windows is less than 9, so it is also filtered out. The sine command of axis system 1 and the cosine command after the delay start of axis system 3 both meet the condition of ≥9 changes within the 100ms window, and are confirmed as valid windows, proceeding to the next step.
[0068] (3) The effective axis systems 1 and 3 successfully detected in step 2 are combined with the number of position changes within 100ms (ChangeInWindow[i]), the count of positions that did not change between two position changes (SameValueCount[i]), and the total number of positions that did not change (TotalSameCount[i]) to calculate the initial command transmission. Here, the corresponding counts for axis systems 1 and 3 are: ChangeInWindow[i] = 9, SameValueCount[i] = 20, and TotalSameCount[i] = 180. Therefore, the calculated initial host computer command transmission time is 10ms.
[0069] (4) The initial period of 10ms calculated in step 3 was verified in three dimensions. First, the integer multiple verification was performed to determine whether the calculated period met the physical constraint that it was an integer multiple of the lower-level machine sampling period. The upper-level machine command transmissions calculated by axis system 1 and axis system 3 both passed the verification. Second, the period calculation results of axis system 1 and axis system 3 for 20 valid windows were accumulated, and the frequency of occurrence of the period was counted. The frequency of occurrence of the period was greater than or equal to 15 times, and both axes passed the verification of single-axis data consistency. Finally, two axis systems that passed the single-axis verification were collected, and the calculated periods of the two were completely consistent, satisfying the consensus of more than half. Finally, it was confirmed that 10ms was the upper-level machine command transmission. The whole process went through layers of screening and verification, successfully eliminating interference such as static and noise, and accurately identifying the correct period. After correction based on the accurate upper-level machine command transmission detected and identified, the received upper-level machine command situation is as follows. Figure 7 As shown, the curve is smooth, the phenomenon of unchanged position in multiple shots disappears, ensuring the control accuracy of the turntable and successfully achieving timing synchronization between the upper and lower computers.
[0070] In addition, the turntable was tested under various conditions where its own sampling period remained constant, but the host computer command transmission times were 5ms, 2ms, and 1ms, indicating a mismatch between the host computer and host computer periods. The comparison results of the received signals before and after identification and correction are as follows: Figure 8 , Figure 9 , Figure 10 , Figure 11 , Figure 12 , Figure 13 As shown above, the test results fully demonstrate that the present invention can accurately detect and identify the host computer command transmission, comprehensively verify the stability and reliability of the present invention, and fully demonstrate the excellent performance of the present invention, such as low false positive rate, low false positive rate, and strong repair effect.
[0071] Those skilled in the art will understand that the above description is merely a preferred embodiment of the present invention, and the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. This is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0072] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.
Claims
1. A simulation machine instruction update period automatic identification method for a flight simulation turntable, characterized in that, The method comprises the following steps: Step 1, sending corresponding position instruction signals to each axis of the flight simulation turntable through the upper computer, taking index i as the unique identifier of different shaft systems, sequentially traversing each shaft system of the flight simulation turntable, reading the current position instruction CurrentCmdPos[i] of each shaft system, and performing corresponding initialization operation on the shaft system running for the first time through the state of the flag bit isFirstRun[i]; Step 2, based on the corresponding initialization operation on the shaft system running for the first time in step 1, calculating the received position change amount PosDiff, judging whether the shaft system is moving through position change comparison; at the same time, in the form of cumulative counting of the number of frames FrameInWindow[i] running in the window, counting the number of position changes ChangeInWindow[i] in the specified time window, the count SameValueCount[i] of position not changing between two position changes, and the total number of times TotalSameCount[i] of position not changing; When the expected number of position changes Min_Change_Count is reached in the specified time window, it is considered that the upper computer cycle has been correctly detected, and the data in this window is used for cycle recognition; Step 3, according to the number of position changes ChangeInWindow[i] counted in the window verified and detected correctly in step 2, the total number of times TotalSameCount[i] of position not changing, and the sampling period Sample_Interval known by the turntable lower computer, the instruction sending WindowAvgPeriod of the upper computer is calculated; Step 4, judging the accuracy of the recognized upper computer cycle through three dimensions, first verifying whether the calculated upper computer instruction sending WindowAvgPeriod is an integer multiple of the sampling period Sample_Interval of the turntable lower computer; if it meets the integer multiple requirement, then collect the instruction sending of the number of windows Window_History_Count calculated by each axis respectively, and count the number MaxCount appearing most frequently and the period recognition result DetectedPeriod[i] corresponding to the number appearing most frequently, if the number of appearances exceeds the expected number, then confirm that the result DetectedPeriod[i] is the period of the axis; when the periods of the moving shaft systems are determined, call the CheckMajorityActiveAxes function to compare the periods DetectedPeriod[i] recognized and determined by each axis according to the principle that more than half of the shaft systems have the same period, so as to obtain the final recognized upper computer instruction sending FinalConfirmedPeriod.
2. The method of claim 1, wherein the simulation machine command update period auto-identification method for flight simulation turntable is characterized in that, The method for performing corresponding initialization operation on the shaft system running for the first time in step 1 is: The current instruction CurrentCmdPos[i] is assigned to the last instruction LastCmdPos[i] as the initial reference value for subsequent calculation, and the count SameValueCount[i] of the position unchanged between the two position changes is initialized to 1, recording the initial occurrence number of the current instruction, providing a counting starting point for subsequent statistics of the number of position changes.
3. The method of claim 1, wherein the simulation machine command update period auto-identification method for flight simulation turntable is characterized in that, The method for calculating the received position change amount PosDiff in step 2 is: 。 4. The method of claim 1, wherein the simulation machine command update period auto-identification method for flight simulation turntable is characterized by, The method for comparing the position change to determine whether the shaft system is moving in step 2 is: The threshold detection machine is introduced to determine whether the position change of the shaft system is effective, and the judgment condition is satisfied: Wherein, the discrimination threshold EPSILON is set to single-precision floating point 0.0001.
5. The method of claim 1, wherein the simulation machine command update period auto-identification method for flight simulation turntable is characterized by, In step 2, when the expected number of position changes Min_Change_Count is reached within the specified time window, it is considered that the upper computer cycle has been correctly detected, and the data in the window is used to identify the cycle. The method is: First, the time window conversion should satisfy: Wherein, Window_Frame_Count is the total number of frames in the specified time window; Second, the number of frames FrameInWindow[i] running in the window should satisfy: ; Finally, the condition for the validity of the window should satisfy: Wherein, ChangeInWindow[i] is the number of position changes in the specified time window; Min_Change_Count is the expected number of position changes. The method for calculating the instruction sending WindowAvgPeriod of an upper computer in step 3 is:
6. The method of claim 1, wherein the simulation machine command update period auto-identification method for flight simulation turntable is characterized by, The method for identifying the cycle of the upper computer in step 4 is: 。 7. The method of claim 1, wherein the simulation machine command update period auto-identification method for flight simulation turntable is characterized by, Dimension one, the specification of the upper computer instruction sending, from the bottom timing logic to ensure the physical rationality of the cycle, so that the cycle calculated in step three WindowAvgPeriod should satisfy: Wherein, remainder is equivalent to the remainder of the calculated upper computer cycle and the sampling period of the turntable control system, if the remainder is close to 0 or close to the sampling period of the turntable control system, it is determined to be an integer multiple, then it is verified by dimension one cycle specification; Dimension two, the stability of the single shaft system data of the turntable: first, only the upper computer cycle WindowAvgPeriod that has passed the verification of dimension one will be further verified from the perspective of dimension two; the upper computer cycle WindowAvgPeriod that satisfies the condition of dimension one is stored in the historical cycle array WindowPeriod[i] using the loop covering mechanism, and the storage number is recorded by the counter WindowIndex[i]. Dimension three, multi-axis system result consistency: CheckMajorityActiveAxes function will first filter out the axis system period identification result DetectedPeriod[i] that has passed the dimension 2 stability verification, store it in the temporary array ActivePeriods, and count the number of valid axes; if there is only one valid axis, the period is considered reliable by default and is directly used as the candidate global period; if there are multiple valid axes, the highest frequency MaxOccurrences and its corresponding period are recorded by double loop statistics of the number of occurrences OutActiveCount of each period in the array. The highest frequency MaxOccurrences should meet the following conditions: Only when more than half of the axis system periods are consistent, the period is confirmed as the final global period FinalConfirmedPeriod, thereby completing the global consistency verification of the multi-axis system period.
8. A simulation machine instruction update period automatic identification system for a flight simulation turntable, characterized by, The system comprises: An initialization module configured to send corresponding position instruction signals to each axis of the flight simulation turntable through an upper computer, take an index i as a unique identifier of different axis systems, sequentially traverse each axis system of the flight simulation turntable, read a current position instruction CurrentCmdPos[i] of each axis system, and perform corresponding initialization operation on the axis system running for the first time by judging a state of a flag bit isFirstRun[i]; A judgment module configured to calculate a received position change amount PosDiff based on the corresponding initialization operation on the axis system running for the first time in the initialization module, judge whether the axis system moves through position change comparison, and simultaneously count a position change number ChangeInWindow[i] in a specified time window, a count of unchanged positions SameValueCount[i] between two position changes, and a total number of unchanged positions TotalSameCount[i] in a cumulative counting manner based on a number of frames FrameInWindow[i] that have run in the window; When the expected position change number Min_Change_Count is reached in the specified time window, it is considered that the cycle of the upper computer has been correctly detected, and the data in the window is used for cycle identification; A detection module configured to calculate a command sending window average period WindowAvgPeriod of the upper computer according to the number of position changes ChangeInWindow[i] and the total number of unchanged positions TotalSameCount[i] counted in the window that has passed correct verification and detection in the judgment module, and a sampling period Sample_Interval known by the turntable lower computer. The recognition module is used to judge the accuracy of the recognized host computer period through three dimensions. First, it is verified whether the calculated host computer instruction sending window average period is an integer multiple of the turntable slave computer sampling period Sample_Interval. If it meets the integer multiple requirement, the instruction sending of the window history count calculated by each axis is collected, the most frequent MaxCount and the corresponding period recognition result DetectedPeriod[i] with the most frequent number of occurrences are counted, and if the number of occurrences exceeds the expected number, the result DetectedPeriod[i] is confirmed as the period of the axis. When the periods of the moving shaft systems are determined, the CheckMajorityActiveAxes function is called to compare the periods DetectedPeriod[i] recognized and determined by each axis according to the principle that more than half of the shaft systems have the same period, so as to obtain the final recognized host computer instruction sending FinalConfirmedPeriod.
9. A computer storage medium having stored thereon a computer program, characterized in that The computer program is executed by a processor to implement the method of any one of claims 1-7.
10. A computer device, comprising: Comprise: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the method of any one of claims 1-7.