2. Network Topology
When carrying out load and dynamic tests on a bridge, stress cross-sections are used according to the stress characteristics of the bridge structure and selected measuring points. Wireless sensor nodes are used to measure the vibration, strain, temperature and other signals of the bridge (
Figure 1). According to the placement characteristics of wireless sensors in the bridge detection system depicted in
Figure 1, it is necessary to organize the wireless sensor nodes near each section as a detection unit. Each detection unit is managed and organized by a control node, and the sensor nodes are responsible for collecting various signals. A central node is connected to the monitoring center to manage the entire network. The network topology of the bridge wireless detection system formed is shown in
Figure 1.
The center node is connected to the central server through a serial port or USB interface. It is responsible for collecting network topology information and measurement data from the wireless sensor network and transmitting them to the computer for data processing. It also receives control instructions and transmits them wirelessly to the nodes in the sensor network [
2]. The control node (cluster head) is responsible for organizing and managing a detection unit, providing synchronization signals for the wireless sensor node, allocating communication time slots, collecting the measurement data of the sensor nodes in the unit and transmitting the measurement data to the central node through the multi-hop chain network [
3].
The wireless sensor node is integrated with the detection unit consisting of a control node according to the synchronization signal received from the control node. It operates in time division multiple access (TDMA) mode. First, the sensor node synchronizes with the selected unit control node and then sends a registration application to the control node. The control node allocates communication time slots. It sends data in its time slots to avoid conflicts with other nodes. In addition, it conducts timing sampling according to the test requirement and turns off the radio frequency (RF) unit when it does not receive and send data to save energy [
4].
To avoid the damage of a control node in a multi-hop network, a backup cluster head is placed next to each control node. The standby control node periodically detects the working state of the main control node. When the main control node is not working, the standby control node replaces the main control node and enters the working mode of the main control node [
5]. In a multi-hop wireless network, the routing protocol mainly includes three core functions: path generation, path selection and path maintenance. According to the different ways of routing, the protocol is divided into proactive routing, on-demand routing and hybrid routing protocols. The proactive routing protocol is also known as the table-driven routing protocol. In this routing protocol, regardless of whether the node has communication needs, each node uses periodic routing packet broadcasting to exchange routing information and maintain a routing table containing the route to other nodes. When the network topology changes, the node sends an update message in the network, and the node receiving the update message updates its routing table. Once the source node sends a packet, it immediately obtains the route to the destination node. The destination-sequenced distance vector (DSDV) and optimized link state routing (OLSR) belong to the proactive routing protocols. In a network with rapidly changing topology, the effective time of routing becomes shorter, and it is unnecessary for nodes to maintain the routing information of other nodes in the network. Therefore, the routing protocol is no longer applicable, and the on-demand routing protocol is replaced. Under the on-demand routing protocol, the route discovery process is activated, and the corresponding route discovery mechanism starts to search the path when the source node needs to obtain the route of the destination node whether the route is in the routing table or not. This enables a certain delay, which is not conducive to the transmission of real-time services. Ad hoc on-demand distance vector (AODV) and dynamic source routing (DSR) are typical on-demand routing protocols [
6].
The developed wireless detection system in this study has a stable network topology in which each sensor node transmits data as a common destination node. The position of the control node of each detection unit in the chain structure remains unchanged, and the wireless sensor node does not change after selecting to join a detection unit, indicating the stability of the network topology. This feature greatly simplifies the design of the network routing protocol. The control node only needs to record the data from the next hop control node and send the data or control information to the central node. The sensor node sends the measurement data to the control node of the unit, and then the control node transmits the data to the central node. This is fixed routing based on clustering [
7].
The control node identifies its position in the chain network according to its identification (ID) and receives the message from the central node from the previous hop control node. After a sensor node joins a control node unit, it transmits data to the control node of the unit in each transmission time slot. The central and control nodes installed at different positions on the bridge form a multi-hop chain topology and the data remote transmission network [
8].
3. Wireless Detection Network of Bridge
The developed wireless detection network is controlled by the monitoring center. There are three working modes, namely, the sampling preparation mode, quasi real-time transmission mode and steady-state transmission mode. Before the monitoring center issues the sampling control command, the network operates in the sampling preparation mode. At this time, the control node dynamically joins the detection network in order, and the wireless sensor node joins the corresponding detection unit. In this mode, the central node obtains the information of all nodes in the network to determine the existing network size, form the network topology table and transmit the information to the monitoring center. The monitoring center determines whether the network initialization process is completed according to the obtained network parameter information. If it is completed, the monitoring center issues sampling control instructions to the network through the central node. The main contents of the sampling control commands include parameters such as sampling start time, sampling frequency and sampling time. After receiving the sampling control instructions, the central node spreads the message through the chain network composed of control nodes. In this process, all nodes in the network receive the message for synchronous sampling. After the sampling time arrives, the network enters the quasi real-time transmission mode and then the steady-state transmission mode after the sampling process. In the quasi real-time transmission mode, the network transmits the measurement data of the sensors back to the monitoring center in a quasi-real-time manner so that testers can monitor the response of the bridge during the test process in a timely manner. In the steady-state transmission mode, the network reliably transmits the measurement data of all wireless sensor nodes back to the monitoring center. The working principle and implementation method of sampling preparation mode are introduced as follows.
3.1. Sampling Preparation Mode
In the sampling preparation mode, the time is divided into superframes, as shown in
Figure 2. Each frame is divided into two large time slots: a global time slot and local time slot. The global time slot is used to control the communication between nodes, while the local time slot is used for the communication between the control node and the wireless sensor nodes in the unit. The local time slot is subdivided into a noncompetitive TDMA time slot and a competitive time slot. The sensor node registered with the control node transmits data to the control node in the TDMA time slot, and the node not registered randomly selects the communication time slot in the competitive time slot to send the registration message to the control node.
In this mechanism, if the network contains n control nodes, n superframes are required to enable each detection unit to obtain a communication opportunity. The length of the global time slot is a variable, which is related to the size of the network. While the network is waiting for the sampling control command, the central node automatically adjusts the length of the global time slot according to the number of control nodes and sensor nodes in each detection unit, and on this basis allocates an additional period of time to the global time slot for new control nodes to dynamically join the network. For example, if there are 10 detection units with five vibration sensor nodes in each unit, the length of the global time slot is 1 s. The local time slot is 400 ms in this study, allowing enough of a TDMA time slot and invitation time slot for sensor nodes to upload data and register. The 400 ms local time slot is long enough to accommodate 10 vibration sensor nodes and 30 other sensor nodes in each detection unit.
In the sampling preparation mode, the central node identifies the hops of the chain topology, that is, the number of control and wireless sensor nodes and their ID numbers in the detection unit. Each control node determines the length of the global time slot. Angular velocity sensors are assigned to wireless sensor nodes with IDs less than 10, while those with IDs greater than 100 are designated to be sensor nodes. In this way, the central node estimates the traffic size of the network according to the ID number of the sensor node. The network structure by the central node is identified in the global time slot. The central node sends the initialization message to the first hop control node, and the first hop control node then forwards the message to the second hop control node. This process continues until the last hop control node, and the control node returns the group controller key (GCK) message to the previous hop control node and all the way back to the central node. The control node with the local slot control right continues to return the information of the wireless sensor node in the unit after returning the GCK packet in the global slot in the next superframe. The central node determines the number of control nodes in the chain network according to the GCK frame and the information of the sensor node in the corresponding detection unit according to the unit information frame. Since the local time slot in each superframe is only used by one detection unit, for a network with n detection units, the central node goes through at least n + 1 superframes to obtain the information of the whole network. The control node conducts clock synchronization with the central node, provides synchronization signals for the wireless sensor nodes in the unit and allocates communication time slots. This ensures that all nodes in the network can accurately know the start time of the next superframe and enter the global time slot and local time slot at the same time. Wireless sensor nodes in different positions of the structure, according to the received messages from the control node, choose to join the detection unit managed by a control node so as to send their collected data to the control node.
The sampling preparation mode performs clock synchronization between all wireless nodes and the central node. When the control node receives the initialization message from the central node or the initialization message forwarded by other control nodes, it obtains the timing time from it and synchronizes with the central node by modifying its timer count value. The sensor node receives the initialization message forwarded by the unit control node and synchronizes with the unit control node. Since the control node synchronizes with the central node, the sensor node also synchronizes with the central node.
3.2. Self-Organizing Function of Network in Sampling Preparation Mode
The working environment of the wireless detection system is complex, the number of wireless sensor nodes is large and the distribution range is wide. New sensor measurement points are temporarily added to meet the needs of the system test accuracy or to replace the faulty nodes. Therefore, the bridge detection network has a self-organizing ability to ensure that new control nodes or sensor nodes can dynamically join the network.
First, at the beginning of the global time slot, the central node sends an initialization message. After receiving the initialization message, the one-hop control node obtains useful information and modifies the time to start the global time slot timing. Then, it modifies the information of the start time of the next superframe in the initialization message and forwards the modified initialization message. After that, the one-hop control node monitors the channel regularly for a period of time to determine whether there are subsequent nodes. If a subsequent node forwards initialization messages within this period of time, it is determined that it is not the last hop control node and enters the state of ready to receive the returned information. Subsequent nodes repeat the process until the initialization message is forwarded by the last hop control node and cannot be heard forwarded by other control nodes. At this time, the control node completes the identification of the chain network topology. If there is a dynamically added control node, it waits to receive the initialization message forwarded by the last hop control node of the existing network, synchronizes according to the process described above and forwards the modified initialization message. At this time, after listening to this message, the original last hop control node determines that it is not the last hop control node. If so, it enters the state of waiting to receive the returned information. The dynamically added control node becomes the last hop node in the chain topology.
If a sensor node needs to join a detection unit, it waits for the initialization message forwarded by the control node of the detection unit in the global time slot and obtains the start time of the local time slot of the unit. After the local time slot of this unit arrives, the beacon message is obtained from the control node to determine the number of successfully registered sensor nodes and calculate the delay time required to start the invitation period and the number of competitive time slots in the invitation period. Then, a competitive time slot is randomly selected as the time slot to send the registration message to the control node of this unit. When the selected contention slot arrives, it sends its own ID information to the corresponding control node. If the control node successfully receives the registration message, it allocates the communication time slot to the sensor node and writes the allocation result into the beacon message. If it does not receive the registration message successfully, it does not process. The sensor node receives the beacon message in the next local time slot of the unit and checks whether the control node allocates a communication time slot. If the control node allocates a communication time slot, it uses the time slot to send its ID number to the control node. Otherwise, the sensor node continues to register in the next local time slot until it joins the network.
When the wireless sensor node sends the registration message to the corresponding control node, there may be a conflict that causes the control node not to receive the registration message correctly, so it cannot allocate the communication time slot for the transmitter node. The reason for the conflict is that multiple wireless sensor nodes choose the same competitive time slot to send the registration message. Because each sensor node independently selects the competitive time slot number, the conflict is inevitable. Therefore, certain measures must be obtained to reduce the probability of conflict so that the sensor nodes can complete the registration work in the shortest possible time. The following is a quantitative description of the relationship between the average collision probability of each competitive time slot and the number of sensor nodes and the total number of competitive time slots in the cell.
Assuming that the number of wireless sensor nodes in the cell is
K and the number of contention slots is
n, each sensor node independently selects a slot in the
N contention slots to send its own registration message with a probability of 1/
N, and then any slot in the
N contention slots is one of three states: success (only one node selects the slot), idle (no node selects the slot), or conflict (more than two nodes select the slot). The probability of the three states is calculated as follows:
Figure 3 shows the change curve of contention slot collision probability when the total number of contention slots is 100 and the detection unit has a different number of sensor nodes. In the figure, the results of the theoretical analysis and Monte Carlo simulation are compared. The two are completely consistent. When the number of sensor nodes in the detection unit is smaller than that of competitive time slots, the probability of collision between nodes becomes low, and the registration process is completed quickly.
According to Equation (1), the average number of successfully registered nodes after a competition process is the average number of failed nodes. This node is re-registered in the next invitation period containing competitive time slots. At this time, the conflict probability is greatly reduced. For example, when the average number of failed nodes after the first round of competition is 13, and the number of available time slots during the second round of competition is 73, at this time, the probability of slot conflict is reduced when the average number of failed nodes is 2. These two nodes continue to register the control nodes through competition in the subsequent invitation period. At this time, 62 time slots are available for use. The collision probability is ignored. After three rounds of competition, the 40 sensor nodes obtain the communication time slot through registration (Equation (4)).
3.3. Energy Saving Design of Wireless Sensor Node in Sampling Preparation Mode
In the developed wireless detection system, there is no requirement for the power consumption of the control node. The control and sensor nodes are powered by the battery, which needs to consider its energy saving problem. In the operation of wireless sensor nodes, the largest energy consumption is the RF unit. Only when the sensor node sends and receives data is the RF unit turned on, which is to reduce energy consumption and save energy. In the sampling preparation mode, the wireless sensor node of each detection unit operates in TDMA mode and only initiates the RF unit to receive synchronization signals, control instructions and send its messages in a specific time slot.
Figure 4 describes the working process of its RF unit in the sampling preparation mode of the sensor node.
According to the serial number information of the detection unit, each wireless sensor node determines the time when the control node of the unit forwards the initialization message. At that time, the RF unit is turned on to receive the initialization message and the global and local slot lengths from the received information. The local slot in the superframe belongs to its detection unit and turns off the RF unit after sampling. If there is a sampling instruction, the signal acquisition process is delayed to the sampling start time. In the absence of sampling instructions, if the local time slot belongs to its detection unit, the sensor node wakes up at the beginning of the local time slot, receives the beacon message from the unit control node, sends data in the corresponding time slot allocated by the control node, and then enters sleep after receiving the acknowledgment (ACK) message from the control node. It does not wake up until the next superframe is ready to receive the initialization message from the unit control node. If the time is not the local time slot of the unit, the sensor node sleeps until the end of this superframe and wakes up when the next superframe is ready to receive the initialization message from the unit control node. The sensor node turns off the RF unit most of the time to achieve a good energy saving effect.
3.4. Network Clock Synchronization in Sampling Preparation Mode
The developed wireless detection system is a large-scale distributed network with wireless sensor nodes with limited energy, which requires energy saving. The data transmission scheme based on the TDMA control protocol is adopted to ensure that the sensor node can save energy. In the TDMA protocol, the most critical technology is network clock synchronization. If wireless nodes do not synchronize with the clock, the communication time slots overlap, causing communication conflicts between sensor nodes and wasting channel capacity. On the other hand, when wireless sensor nodes in the network do not synchronize when sampling signals, the accuracy of signal processing reduces. In the developed wireless detection system, different wireless nodes have their local clocks. Due to the deviation in the crystal oscillator frequency of different nodes and the change in ambient temperature or electromagnetic interference, even if all nodes reach time synchronization at a certain time, their times gradually deviate. Clock synchronization is a simple technology for single-hop wireless networks, as long as one node broadcasts synchronization messages regularly and the other nodes modify their timers for synchronization with the sending node. Therefore, the whole network synchronizes with the timer. The developed wireless detection system is a typical hierarchical multi-hop wireless network, and the synchronization accuracy is required to be in the order of 10 μs. The synchronization of the whole network requires the cooperation between wireless nodes and accurate clock compensation, which is a key supporting technology.
It is impossible and unnecessary for the network composed of wireless nodes with a simple hardware structure to synchronize with the absolute clock. The commonly used method is relative clock synchronization. Relative clock synchronization is setting a time reference point first, and then all wireless nodes adjust their timers to make everyone’s timers reach the time reference point at the same time. In wireless communication, there are time-consuming links in the sending and receiving of synchronous messages. The accuracy of these time-consuming links has a serious impact on the synchronization accuracy of the system. By carefully compensating these time-consuming links, US-level synchronization accuracy can be obtained. Therefore, these time-consuming links are analyzed in detail below.
Figure 5 is a time delay decomposition diagram of transmitting and receiving data between two nodes in general.
In the wireless node, a task is performed with a message. A packet is created in the application layer and sent to the lower layer. The write time is defined as the time that the sender uses to organize data and send a request to the medium access control (MAC) layer. Various times are defined as follows:
Access time: Data packets wait for the access channel after reaching the MAC layer. This delay is from waiting for the access channel to the beginning of transmission. For the competitive media access control protocol, the access time is the most uncertain delay time in the message transmission process, which ranges from a few milliseconds to a few seconds. It is mainly determined by the current network load.
Transmission time: This refers to the time when the data packet is sent bit by bit through the antenna in the physical layer. This delay is determined by the packet length and the transmission bit rate of the RF unit.
Propagation time: This is the time from when the data packet leaves the sender’s antenna to when it is transmitted to the receiver’s antenna. In wireless networks, it is only determined by the transmission distance between two nodes. This time is less than 1 μs (when the distance between nodes is less than 300 m), which is negligible.
Receiving time: This is the time when the receiver receives data bits from the antenna and transmits them to the MAC layer. It is consistent with the transmission time, but there is an overlap between the reception time and the transmission time. As shown in
Figure 5, the length of the overlap is related to the packet length, the transceiver bit rate of the RF unit and the distance between the transceiver nodes. The shorter the data packet, the higher the transmit/receive bit rate, and the farther the distance between nodes, the shorter the overlap time.
Read-out time: This is the time when data bits are packed and transferred to the application layer. It is the same as the write time.
In the protocol, a “time offset” is used to compensate and eliminate these time-consuming links for the relative synchronization of the clock within the network.
When the bridge wireless detection network works in the sampling preparation mode, all control nodes and wireless sensor nodes must be synchronized with the central node. The central node sends the initialization message at the start time of the superframe, which is also the start time of the global time slot, and publishes the length information of the global time slot. When the first hop control node closest to the central node in the linked network receives the initialization message, the start time of the next superframe is determined according to the obtained global time slot length and the known local time slot length. However, the “time offset” between the messages sent from the central node to its application layer must be known as the accuracy of the "time offset" that directly affects the synchronization accuracy. After the first hop control node completes synchronization, it immediately modifies the global slot length in the initialization message and forwards it. The second hop control node and the wireless sensor node in the first detection unit receive the initialization message forwarded by the first hop control node and use the same message to complete the synchronization. The second hop control node continues to forward the modified initialization message until the last hop control node. The whole network synchronizes the start time of the local time slot and enters the next superframe accurately. This synchronization method needs a high accuracy of “time offset” at a μs level; otherwise, the accumulated error in the process of multi-hop network clock synchronization causes too low synchronization accuracy of the whole network to meet the application needs. Therefore, according to the hardware conditions of the actual system, the time delays must be accurately analyzed and compensated.
In the developed wireless detection system, an AVR Series microprocessor unit (MCU) mega128 and an RF chip nRF2401A were used to control the nodes. The time breakdown of sending a complete packet from node to node is shown in
Figure 6.
Before sending data, a node needs to switch to the sending state. Because the normal state of nRF2401A is the receiving state, it needs 20 μs to add a state switching time
T. Megal128 was used to transmit the data to nRF2401A through a serial peripheral interface (SPI). The time spent in this process is related to SPI bus speed and data volume. After receiving the data, nRF2401A transmits the data bit by bit through the antenna at a bit rate of 1 Mbps. Since the maximum distance between nodes for direct communication in the network is about 100 m, the propagation delay of the electromagnetic wave is ignored. In this way, the receiving process of the physical layer of node B and the sending process of the physical layer of node A ends at the same time. At this time, the application layer of node B does not obtain the received data, and the application layer needs to read the data from nRF2401A through SPI bus. After the time-consuming steps of the packet delay are cleared, the delay is calculated according to the selected protocol parameters. The write time TWR and read time TRD are calculated using the measured timer count value as follows:
where
c represents the counter count value,
s represents the frequency division number of the counter to the master clock and the length of the system crystal oscillator is 16 m. The measurement results show that TWR = 568 μs and TRD = 209 μs, which are not equal. To obtain the same value, the sending node must write the destination address and other information in addition to writing the data to be sent to nRF2401A.
In the TDMA mode, only two nodes are communicating at any time to avoid interference between nodes. Then, when the transmission time slot is sent to a node, the node accesses the channel immediately if it has a packet to send. Therefore, the channel access time is ignored. The maximum packet that nRF2401A sends each time is 32 bytes, including 3 bytes of destination node address information and 2 bytes of CRC redundancy check code. Therefore, the valid data sent each time is 27 bytes. In the burst mode of nRF2401A, the data rate is 1 Mbps, so the time to send 32 bytes tx = 32 × 8/1 m=256 μs. Since each transmission of nRF2401A requires a delay of 200 μs, the total transmission time ttx = 456 μs.
The time spent sending and receiving a complete packet is calculated as follows.
TTX Rx is the time offset required for synchronization. In synchronization, each node needs to modify its timer according to this value. The synchronization protocol in the sampling preparation mode groups initialization messages into synchronization packets for network-wide synchronization while sending useful information, which greatly improves network efficiency. The flag is also used to compensate, but in its algorithm, the synchronization between two nodes requires a handshake, a synchronization message packet is sent and then a reply signal is sent back [
8]. If the number of nodes in the network is large, it takes a lot of time to synchronize the whole network.
As long as the time offset is calculated accurately, the cumulative error in the process of multi-hop network synchronization is controlled within the allowable range. The time can be accurately measured, and the synchronization error between the two nodes is within 20 μs. According to this synchronization algorithm, all nodes in the network are synchronized with the central node in a superframe. In addition, the central node sends an initialization message at the beginning of each superframe to resynchronize the network once so as not to lose synchronization due to clock drift.