Abstract
The modal of a structure is the natural vibration characteristic of the structure, which is very important for damage identification of the system. To accurately measure the structural modal, it is necessary to perform clock synchronization operations on the vibration sensors at each measuring point of the structure. This paper uses an improved TSPN algorithm for clock synchronization. It is assumed that the delay of the data in the transmission process obeys normal distribution. The fitting degree of a normal distribution is tested by fitting the delay distribution curve. Then, an interval estimation method is used to estimate the delay. The synchronization of multiple sensors and onsite structural modal testing verifies the correctness of the process after synchronization. The method in this paper is suitable for MCU-based vibration sensors to perform clock synchronization for structural modal measurements.
1. Introduction
A modal corresponds to the natural frequency of a structure [1], and the system will show different vibration characteristics under the excitation of an external force at different frequencies. Clock synchronization is a critical issue [2]. Structural modals are usually obtained through conventional experimental modal analysis and testing methods. Vibration measurement points are arranged at different structure positions to obtain vibration information [3]. To ensure that each measuring point collects data simultaneously, it is necessary to synchronize the clock of each measuring point sensor device [4]. If the clocks are not synchronized, the vibration data collected by the terminal will have clock errors. For structural modal measurements, millisecond-level clock errors will cause deviations in structure modal acquisition [5].
To date, satellite navigation timing technology is the primary time synchronization scheme used in the new generation of wireless node instrument systems [6]. Due to the influence of machine error and too few tracking satellites [7], it is challenging to guarantee short-term accuracy and stability. In 2002, J. Elson and K. Romer [8] first proposed the concept of time synchronization in wireless sensor networks. Then, Elson designed a reference broadcast synchronization (RBS) algorithm. It is a receiver-receiver time synchronization algorithm for exchanging local time information for synchronizing a group of wireless sensors within the transmission range of a reference sensor node. MengYuan Chen et al. [9] proposed an improved RBS algorithm. Based on the RBS algorithm, the algorithm adopts broadcast grouping and the least-squares linear regression method to realize the time synchronization of the whole network. Yong-Heng et al. [10] proposed an energy-efficient wireless sensor network reference broadcast time synchronization algorithm. Noh et al. [11] offered a receiver-only synchronization (ROS) algorithm, which presupposes a Gaussian distribution of random network delays to estimate clock skew. Gang Xiong et al. [12] studied the asymptotic expectation and mean square synchronization error of the SO-DCTS algorithm when a Gaussian delay occurs between network nodes. Panigrahi N et al. [13] improved network lifetime and reduced network latency by applying various techniques, especially node-balanced sets. Ganeriwal et al. [14] proposed a pairwise timing-sync protocol for sensor networks (TPSN). It is a simple method based on traditional send-receive time synchronization that synchronizes the entire network by exchanging timing messages along each branch (edge) of the hierarchical tree. Shi-Kyu Bae et al. [15] proposed a polling-based TPSN scheme that not only shortens the synchronization time of the whole network of TPSN but also reduces the conflicting traffic that leads to unnecessary power consumption. But it considers that the transmission delay is constant. Maroti et al. [16] proposed the flooding time synchronization protocol (FTSP), a sender-receiver time synchronization algorithm that cleverly eliminates network delays. Liang Qingjian et al. [17] proposed an improved FTSP time synchronization to eliminate the interference algorithm of outliers. Hai-ping Huang et al. [18] calculated the relative time drift and phase offset of nodes using a linear programming method based on the collection and selection principle of multitime data point tuples and finally achieved time synchronization in the process of building a data aggregation tree. Yun Peng Zhang et al. [19] improved the routing integrated time synchronization (RITS) protocol by averaging multiple sets of data received by the target node and constructing a best-fit straight line with numerous receiving pairs. Feng Mei Liang et al. [20] proposed an improved time synchronization algorithm for wireless sensor networks based on cross-layer optimization. The stability of crystal oscillation and the linearity of crystal deviation at the physical layer are considered. Maes et al. [21] quantified the error between the modal mode shape identified after the acquisition error and the actual situation by systematically collecting the MP value between the structural displacement (out of synchronization) and the structural strain modal shape. Du Yong-wen et al. [22] combined the one-way broadcast and two-way pairing mechanisms and proposed a hierarchical wireless sensor network time synchronization algorithm. Dragos et al. [23] achieved acquisition data synchronization by imposing an expected relationship between the phase angles of the Fourier spectra of the acceleration response dataset at peaks corresponding to vibration modes.
Based on the research above, this paper proposes an improved clock synchronization algorithm based on a TSPN, which is suitable for measuring the actual engineering structural modal using a sensor based on the MCU (microcontroller unit). This method assumes the random delay as Gaussian normal distribution. The fitting degree of the normal distribution of the delay is checked by combining the delay distribution curve, and then the local clock deviation between each sensor device and the terminal is estimated to perform time synchronization on the sensor devices at each measuring point. Finally, the method proposed in this paper is verified by onsite structural modal tests.
2. Wireless Sensor Clock Synchronization Algorithm
2.1. Wireless Sensor Time Synchronization Principle
In a structural modal measurement system, the terminal and vibration sensor devices are nodes, and each node is in the same network. Due to the different clock sources that each node obtains time information from, the starting timing point between nodes is different, and there is a time offset between the time the vibration sensor data of each node is sent and the time the terminal receives the data. This time offset consists of each node’s local clock skew (St) and the nonfixed transmission delay .
The local clock skew (St) is the deviation of the starting point of the travel time caused by the different starting timing of each node. St is an essential parameter of clock synchronization. Without considering the influence of the vibration error of the internal quartz crystal of the clock, each node has its own time after adding St to the local time. Therefore, each node will be at the same starting time point, which can achieve the purpose of primary clock synchronization.
The nonfixed transmission delay is the information transmission delay. When each node synchronizes the clock, it needs to obtain the timestamp information of other nodes. There will be a delay in the transmission of the timestamp between nodes. This delay is .
A wireless sensor network time synchronization scheme aims to provide a standard timestamp for the local clocks of the nodes in the network.
2.2. TSPN Clock Synchronization Algorithm
A sensor time synchronization protocol TPSN is a two-way time synchronization algorithm based on a sender and receiver, providing time synchronization between nodes in the whole network. A TSPN assumes that each sensor node in the network has a unique ID. The wireless communication link between nodes is bidirectional, which can realize the time synchronization of nodes via a bidirectional message exchange.
The algorithm has two stages: grading and synchronization. The root node is set in the grading stage, the corresponding level of the root node is level 0, and the corresponding level is set for each node by using the root node. In the synchronization phase, the i-level node is synchronized with the (i−1)-level node, the (i−1)-level node with the (i−2)-level node, and the (i−2)-level node with the (i−3)-level node. Nodes are synchronized from bottom to top, and finally, all nodes are synchronized with the root node to achieve the time synchronization of the entire network.
Figure 1 shows the time synchronization process between adjacent level nodes exchanging two messages. Assume that, within a short period for single message exchange, there is no deviation in the internal quartz crystal vibration of the two node clocks and the transmission delay is also constant in both directions. Node S belongs to the i-level node, and node R belongs to the (i−1)-level node. Node S sends a synchronization request to node R at time T1. The synchronization request includes the level of node S and timestamp T1. Node R receives the synchronization request at time T2 and then sends a response at time T3 to node S. The reply signal includes T2 and T3 time information. Node S receives the reply at time T4. Times T1 and T4 are recorded by node S with timestamps, and T2 and T3 are recorded by node R with timestamps.

St is the local clock skew of the two nodes; then,
You can obtain
After node S calculates the time local clock skew St, it can synchronize it to node R.
In the delay component of network information transmission, access time is often the most uncertain factor in the delay of wireless transmission of messages. To improve the event synchronization accuracy between two nodes, the TPSN protocol adds a label to the synchronization message when the MAC layer message starts to be sent to the wireless channel, which eliminates the time synchronization error caused by the access time.
2.3. Improved TSPN Clock Synchronization Algorithm
The improved TSPN algorithm is based on the TSPN synchronization phase synchronization method. It considers the transmission delay in the two directions of the TSPN algorithm to be variable and considers that the transmission delay obeys a Gaussian normal distribution. The method is suitable for MCU-based vibration MEMS (micro-electro-mechanical system) sensors for clock synchronization of structural modal measurements [24].
Figure 2 shows the timestamp information exchange between the vibration sensor and the terminal global clock device. The vibration sensor sends the value of timestamp T1 to the terminal. The terminal receives the data at time T2. At the same time, it obtains the data, sends an instruction to the vibration sensor at time T3, and records timestamp T3. Finally, the vibration sensor receives the instruction at time T4. It records the value of timestamp T4 (to record the value of timestamp T4, timestamp T4 needs to be sent to the terminal, as shown in Figure 2, and the vibration sensor sends timestamp T4 to the terminal at time T5 after receiving the terminal information). Such a model of exchanging timestamp information in one round is completed. At this time, four timestamps are recorded in one synchronization process between the vibration sensor and the terminal.

Assuming that the transmission delay from the sensor to the terminal is and the transmission delay from the terminal to the sensor is , then
for a round trip can be obtained as
Delays and obey a Gaussian normal distribution because the primary source of random noise in the hardware circuit is thermal noise, which has Gaussian distribution characteristics, and the random jitter of crystal vibration is independent of each other at each time point, and according to the central limit law, many independent and uncorrelated noise sources are superimposed and approach a Gaussian distribution [25].
According to Gaussian normal distribution and statistical principles [26], when and obey a Gaussian normal distribution, and both obey a normal distribution. If and , then and .
On the premise of taking a sufficiently large sample of the transmission delay, after n rounds of timestamp information exchange, the transmission delay Δt between a vibration sensor and the terminal can be estimated by the sample mean :
The transmission delay sample variance S2 is
and are independent of each other, and another calculation method for the obtained sample variance is
is estimated, and the clock deviation St of the sensor and the device is further obtained by
In engineering structural modal measurement, when the acquisition frequency is 250 Hz and the real-time clock deviation of a vibration sensor does not exceed 2 ms, the data collected by the vibration sensor can be guaranteed at one point in time. When the vibration sensor and terminal exchange timestamp information, the terminal reads its own time and bounces an instruction to the vibration sensor while receiving the timestamp information of the vibration sensor. The time when the terminal readout corresponds to T2 in Figure 2 and when a command is bounced to the vibration sensor corresponds to T3 in Figure 2. It can be seen that the time difference between T3 and T2 is only the time required for terminal time operation. If the central frequency of a terminal CPU is 2.0 GHz, the oscillation period is 0.5 ns. It takes 12 oscillation periods to read an instruction in the memory, so the terminal reading time only takes tens of nanoseconds, which is the nanosecond level. Therefore, T3 can be equivalent to T2. Similarly, corresponding to the vibration sensor, the time difference between T5 and T4 is the time taken by the vibration sensor to read its clock. If the vibration frequency of the vibration sensor's CPU crystal oscillator is 32 MHz, the time required to read its clock is only a few microseconds, so T5 can be equated to T4.
After ignoring the time when the terminal and the vibration sensor execute their reading time, the n round-trip timestamp information interaction between the vibration sensor and the terminal is shown in Figure 3.

From Figure 3, the transmission time of one round trip can be obtained by only using the two adjacent time differences of the vibration sensor or the terminal. The transmission delay is
In (9), and represent the delay of the i-th timestamp interaction.
3. Clock Synchronization Experiment
3.1. Random Delay Distribution Fitting Verification
The author's self-developed vibration sensor is used in the clock synchronization experiment. The sensor MCU integrates a real-time clock, and its central clock vibration frequency is 32 MHz. The terminal is an HP EliteDesk 880 G5 TWR, and the internal PC processor is an Intel(R) Core(TM) i7-9700 CPU @ 3.00 GHz.
This experiment collects four sets of data, approximately 10,000 data transmissions for the first and second times and approximately 20,000 data transmissions for the third and fourth times to verify that the round-trip transmission delay distribution obeys a normal distribution and fits a normal distribution curve using MATLAB to fit the normal distribution curve. The results of the four sets of randomly selected data are shown in Figure 4 and 5.

(a)

(b)

(a)

(b)
Figures 4 and 5 show that the round-trip transmission delay distributions of the four sets of data are fitted by MATLAB and fit normal distribution very well.
Through formulas (5) and (6), the sample mean and sample standard deviation (S) of the transmission delay of the four sets of data are further obtained, as shown in Figures 6 and 7, respectively.


As seen from the above figures, the sample mean and standard deviation (S) are very stable, and the random delay data are highly stable and obey the same normal distribution.
The sample mean and standard deviation (S) of the delay distribution in the above four sets of experiments are shown in Table 1.
3.2. Random Delay Credibility Validation
It can be seen from the above normal fitting that the transmission delay conforms to a normal distribution, and when a sample is used to replace the population, that is, , the probability that the transmission delay is in a specific interval range can be calculated from four sets of experimental data as shown in Table 2.
When the above four sets of samples are used to replace the population, when , that is, the interval probability that the mean distance is ±1 ms which is approximately 0.98, the requirements of the actual engineering structural modal measurement of 500 Hz are met.
3.3. Random Delay Value
Section 3.2 verified that the random delay sample has a high degree of convergence near the sample mean, which meets the requirements of the clock synchronization error for modal measurement of an actual engineering structure.
According to the principle of a normal distribution, when the random variables are in , are the samples of population and and S2 are the sample mean and sample variance, respectively; then,
In formula (10), is the t distribution with degrees of freedom, and is a standard normal distribution when .
In the above transmission delay experiment, the sample value is large enough, and if is the population mean, the random delay value is
Furthermore, the confidence interval of the population mean is obtained using an interval estimation method. Interval estimation is a strict interval estimation theory created by statistician Neiman in 1934. According to the samples drawn and the requirements of certain correctness and precision, an appropriate interval is constructed as an estimate of the range of the actual value of the unknown parameter of a population distribution or a function of the parameter. For example, it is often said that a particular value is guaranteed to be within a specific range by a certain percentage, which is the most straightforward application of interval estimation.
Let be the distribution function of population , is the unknown parameter to be determined, and are the samples of the population . For a given parameter , if there is a statistic, ,
Therefore, , is called the two-sided confidence interval of of , is called the confidence degree, and and are the lower line and upper limit of the two-sided confidence interval of , respectively.
The confidence interval of each confidence level for the population mean μz of the four sets of data is as follows.
Table 3 shows that when the confidence levels of are guaranteed to be 0.95, 0.98, and 0.99 for each set of data, the value range of is within the scope of a gap of 0.6 ms, and the total capacity is 5.21∼5.27 ms.
is obtained when the highest confidence of 0.99 is used. The overlapping part of each sample (excluding the second set) ranges from 5.2330 ms to 5.2342 ms, and the mean value of 5.2336 ms is taken as the overall mean , that is, the delay between the vibration sensor and the terminal is measured at this time.
4. Clock Synchronization Experimental Verification
4.1. Clock Synchronization Verification
between the vibration sensor and the terminal is obtained using Gaussian normal distribution statistical theory to obtain St from formula (8), and this St is added to the local sensor clock to synchronize with the terminal global time.
To further verify the correctness of the method, the clock of another vibration sensor is synchronized with the terminal according to the above process, and its timestamp is sent to the terminal device every 10 ms after synchronization is completed to verify whether the real-time clocks of the two sensors are consistent.
Table 4 shows the real-time clock times of the two sensors after clock synchronization.
From Table 4, the transmission delay is approximately 5 ms. After the clock is synchronized, the real-time clocks of the two sensors are consistent, and clock synchronization has been completed accurately.
4.2. Onsite Modal Measurement Experiment
The onsite modal measurement structure is a 60 m aerial corridor in the Guangzhou Financial City. The corridor structure is a simply supported truss beam structure. The modal measurement points are arranged as shown in Figures 8 and 9.


Vibration sensors are arranged at each measuring point after clock synchronization is completed. Using the resonance method [27], the corridor is continuously excited using a fundamental frequency load, and the data of measurement point 2 (the right 1/4 span of the corridor), measurement point 3 (the middle side of the span), and measurement point 4 (the left 1/4 span of the corridor) are obtained. The displacements of the right 1/4 span at 50 ms, 100 ms, 150 ms, 200 ms, 250 ms, and 300 ms are as follows (Table 5).
The fitting diagram of the displacement of the measuring points at each time is shown in Figure 10).

In Figure 10, It can be seen from the displacement data of each measuring point that, in the case of fundamental frequency excitation, the first-order modal of the corridor structure conforms to a sine function, and no time synchronization occurs, indicating that the clock synchronization is successful.
5. Conclusions
The clock synchronization algorithm for structural modal measurement proposed in this paper improves the TSPN algorithm. It is assumed that the random delay of the data in the transmission process obeys Gaussian normal distribution, and the correctness of the random delay following a Gaussian normal distribution is verified experimentally.(1)Various hierarchical classifications of delay in the transmission process are simplified. The entire transmission delay is considered as a whole, and it is statistically verified that obeys normal distribution.(2)Based on the structural modal measurement, data receiving time T2 and data sending time T3 in the TSPN transmission process are reduced to one time, simplifying the delay calculation method.(3)When considering the error range of random delay , this method can be combined with statistical knowledge to probabilistically verify the degree of convergence of the random uncertainty to its mean.(4)When selecting the value of the random delay , the interval estimation of the random delay can be carried out according to the method in this paper to meet the confidence level of the modal measurement requirements. The most accurate statistical value of can be obtained.(5)In the modal measurement of an actual engineering structure, the method of this paper is combined with a vibration sensor based on MCU, the programming is simple and convenient, and it is suitable for user development.(6)To verify the correctness of the clock synchronization algorithm, the feasibility of modal measurement using the clock synchronization algorithm for an actual engineering structure is demonstrated through an example analysis.
Data Availability
The data used to support the findings of this study are included within the article.
Disclosure
Junliang Hu and Kai Li are co-first authors.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Authors’ Contributions
Junliang Hu conceptualized the study; Junliang Hu and Nannan Cui took part in methodology; Kai and Shiping Huang provided software; Xiaoyan Ding and Nannan Cui validated the study; Chaoxian Yan and Huawei Guo contributed to data curation; Kai Li wrote the original draft;Shiping Huang and Junliang Hu reviewed and edited the manuscript; Nannan Cui supervised the study. Junliang Hu and Kai Li contributed equally to this work.
Acknowledgments
This paper was supported by the Natural Science Foundation of China (NSFC) (Grant nos. 11672108 and 11202080) and Science and Technology Project of Shandong Transportation Department (2020B69). This work was also supported by “the Fundamental Research Funds for the Central Universities.”