Method for automatic synchronization of frequency of test instruments in power tests
Patent Information
- Application Number
- CN202211556942.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-23
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-03-23
AI Technical Summary
[0005]通信一致性测试过程中,频率同步是前提条件,实际应用中,信号源与通信设备间的互操作测试包括线缆连接及OTA(Over The Ai r)连接测试两种方案,其中电缆连接方案,可以由通信设备提供参考时钟,而后通过线缆把参考时钟连接到信号源,信号源把本地晶振锁定到参考时钟的频率,进而实现信号源与通信设备间的频率同步,从而保证后续互操作测试的有效开展;然而,对于OTA测试,由于信号源与通信设备处于不同方位,存在距离远、布线不方便等原因,导致OTA测试时,很多时候难以通过线缆实现信号源与通信设备间的频率同步,导致OTA互操作测试前,需要事先手动对信号源设备做频率校准,保证同步后才能开展测试
[0031]本申请通过检测外部参考时钟的频率更新特征,以此诊断外部参考时钟是否与标准时钟源同步,如果是,则认定外部参考时钟源频率准确可靠,并把信号源本地晶振初始配置同步到外部参考时钟,从而完成频率自适应校准,提升设备自动校准的覆盖率及准确性。
Smart Images

Figure CN115877302B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention application for an automatic calibration device for power experimental instruments. The original application number is 202210293667.X, and the application date is March 23, 2022. Technical Field
[0002] This application relates to the field of communication calibration technology, and in particular to a method for automatic frequency synchronization of test instruments in power testing. Background Technology
[0003] The statements in this section are merely background information related to this application and do not necessarily constitute prior art.
[0004] In the development of mobile communication technology, in order to meet the needs of interoperability testing, auxiliary equipment such as signal sources have been developed to support the testing of communication equipment protocol consistency.
[0005] Frequency synchronization is a prerequisite for communication conformance testing. In practical applications, interoperability testing between signal sources and communication devices includes two schemes: cable connection and OTA (Over-The-Air) connection testing. In the cable connection scheme, the communication device provides a reference clock, which is then connected to the signal source via cable. The signal source locks its local crystal oscillator to the reference clock frequency, thus achieving frequency synchronization between the signal source and the communication device, ensuring the effective conduct of subsequent interoperability testing. However, for OTA testing, due to the distance between the signal source and the communication device, and the inconvenience of cabling, frequency synchronization between the signal source and the communication device is often difficult to achieve via cable. This necessitates manual frequency calibration of the signal source device before OTA interoperability testing to ensure synchronization. This obviously increases the workload of laboratory management. For larger laboratories with numerous and varied instruments, this directly leads to increased management costs. Therefore, proposing an automatic frequency synchronization method to improve the coverage and accuracy of automatic equipment calibration is a problem that existing technologies need to address. Summary of the Invention
[0006] To address the aforementioned issues, this application proposes an automatic frequency synchronization method for test instruments in power testing. By detecting the frequency update characteristics of an external reference clock, it diagnoses whether the external reference clock is synchronized with a standard clock source.
[0007] This application provides a method for automatic frequency synchronization of test instruments in power testing, including the following steps:
[0008] S100: Periodically calculate the crystal oscillator adjustment bias value Ap corresponding to the frequency of the external reference clock according to period A, and dynamically generate the no-configuration indicator signal tNoConfig;
[0009] During the period when tNoConfig is 0, the crystal oscillator is configured by superposition based on the period A and the bias value Ap, and each time point and the bias value Ap are recorded in the PartA sub-table of list k;
[0010] During the period when tNoConfig is 1, the crystal oscillator adjustment bias value Bp corresponding to the synchronization with the external reference clock frequency is calculated periodically according to period B, and each time point and the bias value Bp are recorded in the PartB sub-table of list k; after the test is detected to be over, the clock frequency error requirement F and the end time point information T are written into PartC of list k, and the information is stopped from being updated to list k. List k is a frequency difference recording component preset in the database.
[0011] S200: Determine whether the frequency difference record component in the database is empty;
[0012] If empty, read the initial crystal oscillator configuration value from the database and configure the crystal oscillator;
[0013] If not empty, the optimal reference queue for initial calibration of the signal source frequency is selected from the data of each group of PartB in the record list of the frequency difference recording component in the database. The superimposed configuration value corresponding to the Nth deviation value of PartB in the optimal reference queue whose root mean square value of the most recent N consecutive deviation values is less than the threshold Am is determined as the initial configuration value of the crystal oscillator and written into the database. Then, all information of the frequency difference recording component in the database is deleted, and the crystal oscillator is configured according to the initial configuration value. Then, the signal source outputs the corresponding signal according to the configuration information for service.
[0014] Preferably, in step S100, the specific method for dynamically forming the no-configuration period tNoConfig_i is as follows:
[0015] S101. An external reference clock is used to construct a reference pulse A with a period of A and a reference pulse B with a period of B. The duration of period A is G times the duration of period B, and the boundary of every G periods of B is aligned with the boundary of period A.
[0016] S102. Periodically synchronize with the reference pulse A and adjust the local crystal oscillator of the signal source until the average value of the most recent M consecutive deviation values DeltaA_i between the local crystal oscillator of the signal source and the external reference clock frequency is less than K×Step. Then set tNoConfig to 1 and jump to step S103. Otherwise, repeat the operation of step S102.
[0017] S103. Calculate the frequency error DeltaA_i between the local crystal oscillator of signal source A and the external reference clock in the current period. If DeltaA_i is less than the frequency error (FK×Step), then do not configure the local crystal oscillator of the signal source, do not update the tNoConfig state, and repeat step S103. Otherwise, configure the local crystal oscillator of the signal source according to DeltaA_i, set tNoConfig to 0, and then jump to step S102.
[0018] The Step is the maximum frequency step value corresponding to an adjustment granularity of the local crystal oscillator of the signal source.
[0019] Preferably, the value of K is greater than or equal to 2.
[0020] Preferably, in step S103, during the period when tNoConfig is 1, the frequency deviation DeltaB_j_p between the local crystal oscillator of the signal source and the external reference clock is calculated according to the period B, and the statistical results of each period when tNoConfig is 1 are written into the p-th group of the PartB sub-table in the database list k, where p represents the number of times tNoConfig jumps from 0 to 1, and j is the number of the period B during the period when tNoConfig is 1 after the p-th jump from 0 to 1, starting from 0.
[0021] Preferably, in step S200, the optimal reference queue for initial calibration of the signal source frequency is selected from each group of data in Part B of each record list of the frequency difference recording component in the database. The specific method is as follows:
[0022] S201. Obtain the data for each group of Part B under each list, and then perform the following operation on each group of data under each list to determine the frequency characteristic value Q_p_k of the data group. The specific calculation method is as follows: with period B as the step and PeriodSel as the duration, calculate the frequency characteristic value Q_w_p_k within each PeriodSel duration of the data group. The specific calculation method is to calculate the average value AvgB_w_p_k of DeltaB_j_p_k within each sliding window duration PeriodSel, and calculate the sliding window duration PeriodSel. SetB_up_w_p_k, which contains start and end time information for consecutive time periods greater than AvgB_w_p_k within dSel, and SetB_down_w_p_k, which contains start and end time information for consecutive time periods less than AvgB_w_p_k. Then, subtract the minimum duration Min_w_p_k from the maximum duration Max_w_p_k in SetB_up_w_p_k and SetB_down_w_p_k to obtain the weight Q_w_p_k of the w-th sliding window in the p-th group of the PartB sub-table in list k.
[0023] S202. Determine the smallest value among Q_w_p_k corresponding to each p and w value in list k as the frequency characteristic value Q_k of list k;
[0024] S203. Based on the frequency error requirement F of Part C in each list k in the database, count the number of frequency error requirement types Type_Num, and then divide the list k into different type subsets SetType_h according to the frequency error requirement, where h takes the value 0, ..., Type_Num-1;
[0025] S204. Calculate the mean value AvgInType_h of the frequency feature values Q_k of each list within a single type in SetType_h, and then determine the frequency feature value corresponding to the list with the largest end time point information T among the elements in this type whose Q_k is less than AvgInType_h as the frequency feature value Q_Type_h of this type.
[0026] S205. Remove types whose Q_Type_h is greater than the threshold Bm. Then, sort the different types of Q_Type_h in the remaining types from largest to smallest based on the time point. Calculate the time difference between the time point of each type and the maximum time point. Based on the mapping relationship between duration and frequency difference, obtain the frequency error degradation value of each type. Then, add the frequency error degradation value of each type to the frequency error requirement value of each type to obtain the final frequency error value of each type. Finally, select the queue with the smallest final frequency error value as the best reference queue for frequency calibration.
[0027] DeltaB_j_p_k is the DeltaB_j_p value in list k.
[0028] Preferably, in step S100, the method for superimposing and configuring the crystal oscillator based on the period A and the bias value Ap is as follows:
[0029] The crystal oscillator is initialized at time T0 with a configuration value of V0. After L cycles A, the crystal oscillator configuration value Vl = V0 + ,l = 1, 2...L, and Apl is the deviation value calculated for each cycle A.
[0030] Compared with the prior art, the beneficial effects of this application are as follows:
[0031] This application detects the frequency update characteristics of an external reference clock to diagnose whether the external reference clock is synchronized with a standard clock source. If so, the external reference clock source frequency is considered accurate and reliable, and the initial configuration of the local crystal oscillator of the signal source is synchronized to the external reference clock, thereby completing frequency adaptive calibration and improving the coverage and accuracy of automatic calibration of the equipment. Attached Figure Description
[0032] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.
[0033] Figure 1 This is a flowchart of a method according to one embodiment of this application.
[0034] Figure 2 This is a system composition diagram of one embodiment of this application. Detailed implementation method:
[0035] The present application will be further described below with reference to the accompanying drawings and embodiments.
[0036] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0037] In this disclosure, terms such as "upper," "lower," "left," "right," "front," "back," "vertical," "horizontal," "side," and "bottom" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are merely relational terms determined for the convenience of describing the structural relationship of the various components or elements in this disclosure, and do not specifically refer to any component or element in this disclosure, nor should they be construed as limiting this disclosure.
[0038] like Figures 1 to 2 As shown, this application provides an automatic frequency synchronization device for power testing instruments, including: a test configuration module, an auxiliary module, a frequency synchronization module, and an autonomous operation module. The functions of each module are as follows:
[0039] Test configuration module: This module is responsible for receiving signal source configuration information, creating a new record list in the frequency difference recording component in the database, and controlling the test process based on whether the external reference clock is enabled or not.
[0040] Auxiliary module: This module queries the database for the clock frequency error requirement F of the corresponding communication standard based on the configuration information, and then reads the initial configuration value of the crystal oscillator from the database and configures the crystal oscillator.
[0041] Frequency Synchronization Module: This module periodically calculates the crystal oscillator adjustment bias value Ap corresponding to the synchronization with the external reference clock frequency according to period A, and dynamically generates a no-configuration indicator signal tNoConfig. During the period when tNoConfig is 0, the crystal oscillator is configured based on period A and the bias value Ap, and the time points and bias values Ap are recorded in PartA sub-table of list k. During the period when tNoConfig is 1, the crystal oscillator adjustment bias value Bp corresponding to the synchronization with the external reference clock frequency is periodically calculated according to period B, and the time points and bias values Bp are recorded in PartB sub-table of list k. After the test is completed, the clock frequency error requirement F is written into PartC of list k, and the update of information to list k is stopped.
[0042] Autonomous Operation Module: This module is responsible for determining whether the frequency deviation recording component in the database is empty. If it is empty, it reads the initial configuration value of the crystal oscillator from the database and configures the crystal oscillator. If it is not empty, it calculates the frequency validity of each group of data in Part C of each record list of the frequency deviation recording component in the database, determines the superimposed configuration value corresponding to the Nth deviation value of the most recent N consecutive deviation values in Part B of the record list with the highest validity that is less than the threshold Am, and writes it into the database. Then, it deletes all information of the frequency deviation recording component in the database, configures the crystal oscillator according to the initial configuration value, and then the signal source outputs the corresponding signal according to the configuration information for service.
[0043] The steps for instrument calibration by coordinating the various modules are as follows:
[0044] Step 1: The test configuration module receives the signal source configuration information. If the configuration information enables the external reference clock, a new record list k is created in the frequency difference recording component in the database, and the process jumps to step 2; otherwise, the process jumps to step 4.
[0045] Step 2: The auxiliary module queries the database for the clock frequency error requirement F of the corresponding communication standard based on the configuration information, and then reads the initial configuration value of the crystal oscillator from the database and configures the crystal oscillator.
[0046] Step 3: The frequency synchronization module periodically calculates the crystal oscillator adjustment bias value Ap corresponding to the frequency synchronization with the external reference clock according to period A, and dynamically generates the no-configuration indicator signal tNoConfig;
[0047] During the period when tNoConfig is 0, the crystal oscillator is configured by superposition based on the period A and the bias value Ap, and each time point and the bias value Ap are recorded in the PartA sub-table of list k;
[0048] During the period when tNoConfig is 1, the crystal oscillator adjustment bias value Bp corresponding to the synchronization with the external reference clock frequency is calculated periodically according to period B, and each time point and the bias value Bp are recorded in the PartB sub-table of list k; after the test is detected to be over, the clock frequency error requirement F and the end time point information T are written into PartC of list k, and the information is stopped from being updated to list k.
[0049] Step 4: The autonomous operation module determines whether the frequency difference record component in the database is empty;
[0050] If empty, read the initial crystal oscillator configuration value from the database and configure the crystal oscillator;
[0051] If not empty, the optimal reference queue for initial calibration of the signal source frequency is selected from the data of each group of PartB in the record list of the frequency difference recording component in the database. The superimposed configuration value corresponding to the Nth deviation value of PartB in the optimal reference queue whose root mean square value of the most recent N consecutive deviation values is less than the threshold Am is determined as the initial configuration value of the crystal oscillator and written into the database. Then, all information of the frequency difference recording component in the database is deleted, and the crystal oscillator is configured according to the initial configuration value. Then, the signal source outputs the corresponding signal according to the configuration information for service.
[0052] This application also provides an automatic calibration method for experimental instruments, the specific steps of which are the same as steps 1 to 4.
[0053] In step 1, enabling the external reference clock in the configuration information means that the external reference clock is enabled in the configuration information, which is an industry standard term.
[0054] In step 3, the method for superimposing and configuring the crystal oscillator based on the period A and the bias value Ap is as follows:
[0055] At time T0, the crystal oscillator is initialized with a configuration value of V0. After L cycles A, at time T1, the crystal oscillator configuration value Vl = V0 + ∑APl, where l = 1, 2, ..., L. Apl is the deviation value calculated for each cycle A. For example, after cycle A, at time T1, the deviation value is calculated as Ap1, so the crystal oscillator configuration value at time T1 is V0 + A1. After another cycle A, at time T2, the deviation value is calculated as Ap2, so the crystal oscillator configuration value at time T2 is V0 + Ap1 + Ap2, and so on. Ap1 and Ap2 can take values of positive, zero, or negative numbers.
[0056] The frequency synchronization module includes a reference source construction submodule, an initial synchronization submodule, a dynamic management module, and a same-source identification module. In step 3, the specific method for dynamically forming the unconfigured time period tNoConfig_i is as follows:
[0057] Step 3.1: The reference source construction submodule uses an external reference clock to construct a reference pulse A with a period of A and a reference pulse B with a period of B. The duration of period A is G times the duration of period B, and the boundary of B every G periods is aligned with the boundary of period A.
[0058] Step 3.2: The initial synchronization submodule periodically synchronizes with the reference pulse A and adjusts the local crystal oscillator of the signal source until the average value of the most recent M consecutive deviation values DeltaA_i between the local crystal oscillator of the signal source and the external reference clock frequency is less than K×Step. Then, set tNoConfig to 1 and jump to step 3.3. Otherwise, repeat the operation of step 3.2.
[0059] Step 3.3: The dynamic management module calculates the frequency error DeltaA_i between the local crystal oscillator of signal source A and the external reference clock in the current cycle. If DeltaA_i is less than the frequency error (FK×Step), the local crystal oscillator of the signal source is not configured, the tNoConfig state is not updated, and the operation of step 3.3 is repeated; otherwise, the local crystal oscillator of the signal source is configured according to DeltaA_i, tNoConfig is set to 0, and then the process jumps to step 3.2.
[0060] In step 3.2, Step is the maximum frequency step value corresponding to an adjustment granularity of the local crystal oscillator of the signal source. Preferably, the value of K is greater than or equal to 2.
[0061] In step 3.3, during the period when tNoConfig is 1, the same source identification module calculates the frequency deviation DeltaB_j_p between the local crystal oscillator of the signal source and the external reference clock according to the period B, and writes the statistical results of each period when tNoConfig is 1 into the p-th group of the PartB sub-table in list k in the database. Here, p represents the number of times tNoConfig jumps from 0 to 1, and j is the number of the period B during the period when tNoConfig is 1 after the p-th jump from 0 to 1, starting from 0.
[0062] In step 4, the optimal reference queue for initial calibration of the signal source frequency is selected from the data in each group of PartB in the record list of the frequency difference recording component in the database. The specific method is as follows:
[0063] Step 4.1: The sliding window calculation module obtains the data of each group in Part B under each list, and then performs the following operation on each group of data under each list to determine the frequency characteristic value Q_p_k of the data group. The specific calculation method is as follows: Taking the period B as the step and PeriodSel as the duration, calculate the frequency characteristic value Q_w_p_k within each PeriodSel duration in the data group. The specific calculation method is to calculate the average value AvgB_w_p_k of DeltaB_j_p_k within each sliding window duration PeriodSel, and calculate the sliding window duration Pe. Within riodSel, the set of start and end time information corresponding to continuous time periods greater than AvgB_w_p_k is set as SetB_up_w_p_k, and the set of start and end time information corresponding to continuous time periods less than AvgB_w_p_k is set as SetB_down_w_p_k. Then, the maximum duration Max_w_p_k in SetB_up_w_p_k and the minimum duration Min_w_p_k are subtracted to obtain the weight Q_w_p_k of the w-th sliding window in the p-th group of the PartB sub-table in list k.
[0064] Step 4.2: The list feature value determination module determines the smallest value among Q_w_p_k corresponding to each p and w value in list k as the frequency feature value Q_k of list k;
[0065] Step 4.3: The type management module counts the number of frequency error requirement types Type_Num based on the frequency error requirement F of PartC in each list k in the database, and then divides the list k into different type subsets SetType_h according to the frequency error requirement, where h takes the value 0, ..., Type_Num-1;
[0066] Step 4.4: The frequency feature value selection module within a type calculates the mean value AvgInType_h of the frequency feature values Q_k of each list within a single type in SetType_h. Then, among the elements in that type where Q_k is less than AvgInType_h, the frequency feature value corresponding to the list with the largest end time point information T is determined as the frequency feature value Q_Type_h of this type.
[0067] Step 4.5: In the frequency characteristic value selection module, types with Q_Type_h greater than the threshold Bm are eliminated. Then, the Q_Type_h of different types in the remaining types are sorted from largest to smallest based on the time point. The time difference between the time point of each type and the maximum time point is calculated. Based on the mapping relationship between duration and frequency difference, the frequency error degradation value of each type is obtained. Then, the frequency error degradation value of each type is superimposed with the frequency error requirement value of each type to obtain the final frequency error value of each type. Finally, the queue with the smallest final frequency error value is selected as the best reference queue for frequency calibration.
[0068] The following specific examples describe a detailed implementation of an automatic frequency synchronization method for testing instruments in power testing:
[0069] In this embodiment, six tests are included: TEST0, TEST1, TEST2, TEST3, TEST4, and TEST5. The first five tests enable an external reference clock, and the sixth test disables the reference clock. TEST0 and TEST1 belong to communication standard 0, and their clock frequency error requirement is F0_1. TEST2 and TEST3 belong to communication standard 1, and their clock frequency error requirement is F2_3. TEST4 belongs to... For the test of signal system 2, the clock frequency error requirement is F4. The test data of TEST0 is detailed in Table 1. In this embodiment, M is 3, K is 5, Step is 10Hz, so K×Step is 50Hz, F0_1 is 150Hz, as shown in Table 1. PeriodSel is 8 cycles B, period A is 4 time units, period B is 2 time units, G is 2, threshold A is K×Step, and threshold B is 20% of the duration of period B.
[0070] First, execute step 1: The test configuration module receives the signal source configuration information TEST0, detects that the configuration information enables the external reference clock, then creates a new record list k in the frequency difference recording component in the database (at this time, k takes the value of 0), and jumps to step 2.
[0071] k is the list number, starting from 0, i.e., list 0, list 1, ..., numbered sequentially. In this example, we start with list 0, which corresponds to TEST0. For each test, the list number is incremented by 1.
[0072] Next, step 2 is executed: the auxiliary module queries the database for the clock frequency error requirement F (corresponding to F0_1, i.e. 150Hz) of the corresponding communication standard according to the configuration information, and then reads the initial configuration value of the crystal oscillator from the database and configures the crystal oscillator.
[0073] Next, step 3 is executed: The frequency synchronization module periodically calculates the crystal oscillator adjustment bias value Ap corresponding to the synchronization with the external reference clock frequency according to period A, and dynamically generates a no-configuration indicator signal tNoConfig. During the period when tNoConfig is 0, the crystal oscillator is configured based on period A and the bias value Ap, and each time point and the bias value Ap are recorded in the PartA sub-table of list k; during the period when tNoConfig is 1, the crystal oscillator adjustment bias value Bp corresponding to the synchronization with the external reference clock frequency is periodically calculated according to period B, and each time point and the bias value Bp are recorded in the PartB sub-table of list k; after the test is detected to be over, the clock frequency error requirement F and the end time point information T are written into PartC of list k, and the information updates to list k are stopped.
[0074] In step 3, the specific method for dynamically generating the no-configuration period tNoConfig_i is as follows:
[0075] First, step 3.1 is executed. The reference source construction submodule uses an external reference clock to construct a reference pulse A with a period of A (4 time units in this embodiment, as shown in Table 1, 10-13 is one period, and 14-17 is the next period) and a reference pulse B with a period of B (2 time units in this embodiment, as shown in Table 1, 10-11 is one period, and 12-13 is the next period). The duration of period A is G times (i.e., 2 times) the duration of period B, and the boundary of B every G periods is aligned with the boundary of period A.
[0076] Next, step 3.2 is executed. The initial synchronization submodule periodically synchronizes with the reference pulse A and adjusts the local crystal oscillator of the signal source until the average value of the most recent M consecutive deviation values DeltaA_i between the local crystal oscillator of the signal source and the external reference clock frequency is less than K×Step. Then, tNoConfig is set to 1 and the process jumps to step 3.3. Otherwise, the operation of step 3.2 is repeated. Step is the maximum frequency step value corresponding to an adjustment granularity of the local crystal oscillator of the signal source. K is preferably not less than 2. As shown in Table 1, at the time point T equals 13, it is determined that the average value of the M consecutive deviation values DeltaA_i is less than K×Step (i.e., less than 50Hz). Therefore, at the next time point (i.e., when time point T equals 14), tNoConfig is set to 1 and the process jumps to step 3.3.
[0077] Next, step 3.3 is executed. The dynamic management module calculates the frequency error DeltaA_i between the local crystal oscillator of signal source A and the external reference clock in the current cycle. If DeltaA_i is less than the frequency error (FK×Step), the local crystal oscillator of the signal source is not configured, the tNoConfig state is not updated, and step 3.3 is repeated; otherwise, the local crystal oscillator of the signal source is configured according to DeltaA_i, tNoConfig is set to 0, and then the process jumps to step 3.2. In this embodiment, (FK×Step) = (F0_1-K×Step)=(150Hz-5*10Hz)=100Hz. Referring to Table 1, after T equals 100013, since DeltaA_i equals 110+10=120Hz, which is greater than (FK×Step), i.e. greater than 100Hz, tNoConfig is set to 0, and the process jumps to step 3.2 to adjust the local crystal oscillator. During the period from T=14 to T=100013, since tNoConfig is 1, the local crystal oscillator is not adjusted.
[0078] Next, the tests TEST1, TEST2, TEST3, and TEST4 are executed, generating corresponding data information and forming List 1, List 2, List 3, and List 4. The data generation process is the same as the above principle, and the data formats of List 1, List 2, List 3, and List 4 are similar to those of List 1 (not listed).
[0079] Next, the TEST5 test is executed. Since the external reference clock is not enabled in the TEST5 configuration, the process jumps directly to step 4.
[0080] Next, in step 4, the autonomous operation module determines that the frequency difference record component in the database is not empty. Then, it selects the best reference queue for the initial calibration of the signal source frequency from the data of each group of Part B in the record list of the frequency difference record component in the database. The superimposed configuration value corresponding to the Nth deviation value of the most recent N consecutive deviation values in the best reference queue whose root mean square value is less than the threshold Am is determined as the initial configuration value of the crystal oscillator and written into the database. Then, all information of the frequency difference record component in the database is deleted, and the crystal oscillator is configured according to the initial configuration value. Then, the signal source outputs the corresponding signal according to the configuration information for service.
[0081] In step 4, the specific procedure for selecting the optimal reference queue for initial calibration of the signal source frequency from each group of data in Part B of each record list of the frequency difference recording component in the database is as follows:
[0082] Step 4.1: The sliding window calculation module obtains the data of each group in Part B under each list, and then performs the following operation on each group of data under each list to determine the frequency characteristic value Q_p_k of the data group. Taking the data of TEST0 as an example, the specific calculation method is explained as follows: First, there is only one group of data in TEST0, which corresponds to T equal to 14 to 100013 in Table 1. Then, the sliding window calculation module calculates each Period within the data group with period B as the step and PeriodSel as the duration. The frequency characteristic value Q_w_p_k within the Sel time period is referenced in Table 1. Then, the average value AvgB_w_p_k of the 49993 sliding windows (T = 14 to 29, T = 16 to 31, ..., T = 99998 to 100013) is calculated sequentially, where w is the sliding window number corresponding to 0 to 49993. Then, the information for each sliding window is statistically analyzed. Taking sliding window 0 as an example, the calculation process is as follows: Calculate the average value AvgB_0_p_k within the 8 time granularities (T = 14 to 29).
[0083] AvgB_0_p_k=
[0084] (DeltaB_0_p_k+DeltaB_1_p_k+DeltaB_2_p_k+DeltaB_3_p_k+DeltaB_4_p_k+DeltaB_5_p_k+DeltaB_6_p_k+DeltaB_7_p_k) / 8
[0085] = ((52+10)+(52+9)+(51-8)+(51-9)+(50+11)+(50+11)+(52-9)+(52-11)) / 8
[0086] =51.75
[0087] Then, within the sliding window duration PeriodSel (corresponding to T equal to 14 to 29), the set of start and end time information corresponding to the continuous time periods greater than AvgB_0_p_k is SetB_up_w_p_k = {[14,17], [22,25]}, and the set of start and end time information corresponding to the continuous time periods less than AvgB_0_p_k is SetB_up_w_p_k = {[18,21], [26,29]}. Then, the maximum duration Max_0_p_k is subtracted from the minimum duration Min_0_p_k to obtain the weight Q_w_p_k of the w-th sliding window in the p-th group of the PartB subtable in list k.
[0088] Next, step 4.2 is executed. The list feature value determination module determines the smallest value among Q_w_p_k corresponding to each p and w value in list k as the frequency feature value Q_k of list k (if multiple Q_w_p_k values are the same, the one with the largest value at the time point is taken).
[0089] Next, step 4.3 is executed. The type management module counts the number of frequency error requirement types, Type_Num, based on the frequency error requirement F of Part C in each list k in the database. Then, the list k is divided into different type subsets, SetType_h, according to the frequency error requirement, where h takes values of 0, ..., Type_Num-1. In this embodiment, there are three types, and Type_Num equals 3. TEST0 and TEST1 are assigned to SetType_0, TEST2 and TEST3 are assigned to SetType_1, and TEST4 is assigned to SetType_2.
[0090] Next, step 4.4 is executed. The frequency feature value selection module within a type calculates the mean value AvgInType_h of the frequency feature values Q_k of each list within a single type in SetType_h. Then, among the elements in that type where Q_k is less than AvgInType_h, the frequency feature value corresponding to the list with the largest end time point information T is determined as the frequency feature value Q_Type_h of this type. In this embodiment, if TEST0 is selected as the frequency feature value of type SetType_0, TEST2 as the frequency feature value of type SetType_1, and TEST4 as the frequency feature value of type SetType_2, and if the frequency error requirements for each type in this embodiment are as follows:
[0091] SetType_0: The occurrence time T is equal to 100013, and the frequency error requirement is 150Hz;
[0092] SetType_1: The occurrence time T is equal to 105013, and the frequency error requirement is 300Hz;
[0093] SetType_2: The occurrence time T equals 109013, and the frequency error requirement is 1000Hz.
[0094] Next, step 4.5 is executed. Assuming that all Q_Type_h are less than threshold B, the frequency characteristic value selection module does not eliminate any type. Then, the Q_Type_h of different types is sorted from largest to smallest based on the time point, resulting in SetType_2 > SetType_1 > SetType_0. The time difference between SetType_1 and SetType_2 is calculated to be 5000 time granularities, and the time difference between SetType_0 and SetType_2 is 9000 time granularities. Based on the mapping relationship between duration and frequency difference:
[0095] Assuming that the frequency changes by 10Hz for every 1000 time granularities in this embodiment, and considering the deteriorating effect of time on the frequency error, at the maximum time point, i.e., the time point of SetType_2, corresponding to time T equal to 109013, the final frequency error values for each type are as follows:
[0096] The maximum final frequency error of SetType_0 is (150 + (109013 - 100013) / 1000 * 10) = 240 Hz;
[0097] The maximum final frequency error of SetType_1 is (300+(109013-105013) / 1000*10)=340Hz;
[0098] The maximum final frequency error of SetType_2 is (1000+(109013-109013) / 1000*10)=1000Hz;
[0099] Therefore, SetType_0 with the smallest value is selected as the queue with the smallest error. The initial configuration value of the crystal oscillator is determined by the superimposed configuration value corresponding to the Nth deviation value of PartB of the queue whose root mean square of the deviation value is less than the threshold A. The configuration value is then written into the database. After that, all information of the frequency difference record component is deleted from the database. The crystal oscillator is configured according to the initial configuration value. Then, the signal source outputs the corresponding signal according to the configuration information for service.
[0100] Table 1: Database record information for TEST0 test process (corresponding to "Frequency Deviation Recording Component" list 0)
[0101]
[0102]
[0103]
[0104] As can be seen from the above embodiments, by using the method of the present invention, the frequency update characteristics of the external reference clock are detected to diagnose whether the external reference clock is synchronized with the standard clock source. If so, the frequency of the external reference clock source is considered to be accurate and reliable, and the initial configuration of the local crystal oscillator of the signal source is synchronized to the external reference clock, thereby completing the frequency adaptive calibration and improving the coverage and accuracy of the automatic calibration of the device.
[0105] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0106] While the specific embodiments of this application have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this application. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this application are still within the scope of protection of this application.
Claims
1. A method for automatic frequency synchronization of testing instruments in power testing, characterized in that, Includes the following steps: S100: Periodically calculate the crystal oscillator adjustment bias value Ap corresponding to the frequency of the external reference clock according to period A, and dynamically generate the no-configuration indicator signal tNoConfig; During the period when tNoConfig is 0, the crystal oscillator is configured by superposition based on the period A and the bias value Ap, and each time point and the bias value Ap are recorded in the PartA sub-table of list k; During the period when tNoConfig is 1, the crystal oscillator adjustment bias value Bp corresponding to the synchronization with the external reference clock frequency is calculated periodically according to period B, and each time point and the bias value Bp are recorded in the PartB sub-table of list k; after the test is detected to be over, the clock frequency error requirement F and the end time point information T are written into PartC of list k, and the information is stopped from being updated to list k. List k is a frequency difference recording component preset in the database. S2 00: Determine if the frequency difference record component in the database is empty; If empty, read the initial crystal oscillator configuration value from the database and configure the crystal oscillator; If not empty, the best reference queue for initial calibration of the signal source frequency is selected from the data of each group of PartB in the record list of each frequency difference recording component in the database. The superimposed configuration value corresponding to the Nth deviation value of the most recent N consecutive deviation values of PartB in the best reference queue that is less than the threshold Am is determined as the initial configuration value of the crystal oscillator and written into the database. Then, all information of the frequency difference recording component in the database is deleted, and the crystal oscillator is configured according to the initial configuration value. Then, the signal source outputs the corresponding signal according to the configuration information for service. In step S100, the specific method for dynamically generating the unconfigured time period tNoConfig_i is as follows: S101. An external reference clock is used to construct a reference pulse A with a period of A and a reference pulse B with a period of B. The duration of period A is G times the duration of period B, and the boundary of every G periods of B is aligned with the boundary of period A. S102. Periodically synchronize with the reference pulse A and adjust the local crystal oscillator of the signal source until the average value of the most recent M consecutive deviation values DeltaA_i between the local crystal oscillator of the signal source and the external reference clock frequency is less than K×Step. Then set tNoConfig to 1 and jump to step S103. Otherwise, repeat the operation of step S102. S103. Calculate the frequency error DeltaA_i between the local crystal oscillator of the signal source A in the current period and the external reference clock. If DeltaA_i is less than the frequency error (FK×Step), then do not configure the local crystal oscillator of the signal source, do not update the tNoConfig state, and repeat step S103. Otherwise, configure the local crystal oscillator of the signal source according to DeltaA_i, set tNoConfig to 0, and then jump to step S102; The Step is the maximum frequency step value corresponding to an adjustment granularity of the local crystal oscillator of the signal source. In step S200, the optimal reference queue for initial calibration of the signal source frequency is selected from each group of data in PartB of each record list of the frequency difference recording component in the database. The specific method is as follows: S201. Obtain the data for each group of Part B under each list, and then perform the following operation on each group of data under each list to determine the frequency characteristic value Q_p_k of the data group. The specific calculation method is as follows: with period B as the step and PeriodSel as the duration, calculate the frequency characteristic value Q_w_p_k within each PeriodSel duration of the data group. The specific calculation method is to calculate the average value AvgB_w_p_k of DeltaB_j_p_k within each sliding window duration PeriodSel, and calculate the sliding window duration PeriodSel. SetB_up_w_p_k, which contains start and end time information for consecutive time periods greater than AvgB_w_p_k within dSel, and SetB_down_w_p_k, which contains start and end time information for consecutive time periods less than AvgB_w_p_k. Then, subtract the minimum duration Min_w_p_k from the maximum duration Max_w_p_k in SetB_up_w_p_k and SetB_down_w_p_k to obtain the weight Q_w_p_k of the w-th sliding window in the p-th group of the PartB sub-table in list k. S202. Determine the smallest value among Q_w_p_k corresponding to each p and w value in list k as the frequency characteristic value Q_k of list k; S203. Based on the frequency error requirement F of Part C in each list k in the database, count the number of frequency error requirement types Type_Num, and then divide the list k into different type subsets SetType_h according to the frequency error requirement, where h takes the value 0, ..., Type_Num-1; S204. Calculate the mean value AvgInType_h of the frequency feature values Q_k of each list within a single type in SetType_h, and then determine the frequency feature value corresponding to the list with the largest end time point information T among the elements in this type whose Q_k is less than AvgInType_h as the frequency feature value Q_Type_h of this type. S205. Remove types whose Q_Type_h is greater than the threshold Bm. Then, sort the different types of Q_Type_h in the remaining types from largest to smallest based on the time point. Calculate the time difference between the time point of each type and the maximum time point. Based on the mapping relationship between duration and frequency difference, obtain the frequency error degradation value of each type. Then, add the frequency error degradation value of each type to the frequency error requirement value of each type to obtain the final frequency error value of each type. Finally, select the queue with the smallest final frequency error value as the best reference queue for frequency calibration. DeltaB_j_p_k is the DeltaB_j_p value in list k.
2. The method for automatic frequency synchronization of testing instruments in power testing according to claim 1, characterized in that: The value of K is greater than or equal to 2.
3. The method for automatic frequency synchronization of testing instruments in power testing according to claim 1, characterized in that: In step S103, during the period when tNoConfig is 1, the frequency deviation DeltaB_j_p between the local crystal oscillator of the signal source and the external reference clock is calculated according to the period B, and the statistical results of each period when tNoConfig is 1 are written into the p-th group of the PartB sub-table in the database list k. Here, p represents the number of times tNoConfig jumps from 0 to 1, and j is the number of the period B during the period when tNoConfig is 1 after the p-th jump from 0 to 1, starting from 0.
4. The method for automatic frequency synchronization of testing instruments in power testing according to claim 1, characterized in that: In step S100, the method for superimposing and configuring the crystal oscillator based on the period A and the bias value Ap is as follows: The crystal oscillator is initialized at time T0 with a configuration value of V0. After L cycles A, at time T1, the crystal oscillator configuration value Vl = V0 + ,l=1,2…L,Apl is the deviation value calculated for each period A.
Citation Information
Patent Citations
Automatic calibration device for electric power experimental instrument
CN114660521A