Efficient and flexible time synchronization for wireless devices
The method synchronizes slave devices with master devices using wireless messages and processing delays, ensuring accurate power quality parameter determination with minimal circuit changes, suitable for energy-harvesting devices.
Patent Information
- Application Number
- PCT/CN2024/086139
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-04
- Publication Date
- 2025-10-09
AI Technical Summary
Existing power quality assessment systems in microgrids face challenges in synchronizing current and voltage measurements from different devices, necessitating a low-cost solution that minimizes line modifications.
A method for resetting the clock of a slave device to the local time of a master device using wireless messages, where the slave device calculates its local time based on timestamps and processing delays to achieve synchronization.
Enables accurate time synchronization between slave and master devices, allowing for precise power quality parameter calculations with minimal circuit modifications, suitable for sleepy devices powered by energy harvesting.
Smart Images

Figure CN2024086139_09102025_PF_FP_ABST
Abstract
Description
EFFICIENT AND FLEXIBLE TIME SYNCHRONIZATION FOR WIRELESS DEVICESTECHNICAL FIELD
[0001] This application relates to a method for resetting the clock of a slave device to the local time of a master device, a slave device, and a system comprising a slave device and a master device.BACKGROUND
[0002] Microgrid systems contain various impulsive and nonlinear devices, and the number is increasing day by day. These nonlinear loads cause power quality problems such as current waveform distortion, voltage fluctuations, and flicker in the power system. How to detect the power quality parameters of microgrids in a low-cost manner while minimizing line modifications has become an urgent problem to be solved and optimized.
[0003] A main staple of monitoring power grids such as microgrid system is the measurement of relevant performance parameters. The enhancement of standard device with novel functionality allows to extend monitoring coverage. An example is provided by the publication DE 10 2018 213 522 A1 where a standard fuse is equipped with wireless transmission technology to provide current measurement data for further analysis. The fuse has a modular design that allows for retrofitting of existing installations with conventional fuses. The current measurement data (e.g., RMS values of an alternating current and temperature values) provided by the enhanced fuse (smart fuse) can be sent to a central gateway such as the data collector put forth in the publication DE 20 2021 000 293 U1. A more comprehensive grid monitoring requires the measurement of voltage values for determining performance parameters such as effective power, apparent power, and reactive power and for calculating parameters such as power factor cos and load flow directions (the evaluation of the above parameters is also often referred to as power quality assessment) .
[0004] Power quality assessment requires to obtain current and voltage values synchronously, i.e., the measurement times need to match for the determination of the above parameters to be correct. The above smart fuse does provide current values, but voltage values would be taken from a different measurement device. Current values provided by the smart fuse to a central gateway include indications of measurement times (timestamps) so that they can be matched with voltage values provided by different measurement equipment. It is imperative that smart fuse timestamps can be properly correlated with local time information at the gateway, i.e., synchrony of relevant clocks need to be assured.SUMMARY OF THE INVENTION
[0005] The objective of the present invention is to provide for synchrony between clocks of different devices.
[0006] In accordance with the present invention a method is proposed for resetting the clock of a slave device to the local time of a master device. The term “master” and “slave” is to indicate that the synchronization is governed by a local clock of the master device, i.e., a local clock of the slave device is to be adjusted in line with the master device.
[0007] According to the method, a first wireless message from the master device is received by the slave device. This first message may include a timestamp corresponding to the start of the transmission of the first message in the local time of the master device. Here, “local time” refers to the time provided by a local clock of the master device. Typically, the master device comprises but one local clock, i.e., the timestamp regularly corresponds to the start of the transmission of the first message in “the” local time of the master device.
[0008] The slave device measures the time or duration for receiving the first message (i.e., processing time of the received first message) and uses the time corresponding to the end of the reception of the first message (e.g., via generating a timestamp or starting a timer) . In order to calculate the local time corresponding the timestamp included in the first message the slave device needs to know the processing time at the master device. Hence, a second wireless message from the master device includes the duration for sending the first message. This second message may include a timestamp corresponding to the start of the transmission of the first message.
[0009] With this information, the slave device can calculate the local time at the master device and reset the clock of the slave device to the local time of the master device. The method relies on the observation that wireless transmission between master device and slave device is so fast that the incurred delay can be ignored. An approximation for the duration ΔT of transmitting and receiving the first message is provided by the processing time at the master device prior to radio transmission plus processing time at the slave device after receiving the first message. To put it more formally, ΔT (first message) = T (end) -T (start) = ΔT (processing master) + ΔT (wireless transmission) + ΔT (processing slave) ≈ ΔT (processing master) + ΔT (processing slave) .
[0010] T (start) and ΔT (processing master) can be recorded at the master device and sent to the slave device. T (end) and ΔT (processing slave) can be recorded at the slave device. T (start) and ΔT (processing master) are sent to the slave device. Since the duration ΔT (processing master) measures processing time for the first message it cannot be included in the first message. In contrast, a timestamp corresponding to T (start) can be sent in the first message. It is also conceivable that both values, T (start) and ΔT (processing master) , are only included in the second message or in a second and third message (the latter solution being inferior, because the synchronization is delayed) .
[0011] With the above relationship T (end) -T (start) ≈ ΔT (processing master) + ΔT (processing slave)
[0012] the value of T (end) according to the local time of the master device is available at the slave device.
[0013] Principally, there are two ways to reset the local clock of the slave device to a value corresponding the local clock of the master device.
[0014] One way is to calculate the time at the master device and set the clock to the slave device to that value. This can be done by counting the time ΔT (timer) that elapses after T (end) at the slave device until ΔT (processing master) and T (start) are both available at the slave device. The local time of the slave device can be set to the local time of the slave device by T = T (end) _master + ΔT (timer) = T (start) + ΔT (processing master) + ΔT (processing slave) + ΔT (timer) .
[0015] The second way is to calculate a time offset between the slave and the master device and to subtract the time offset from the local time of the slave device. This can be done by the slave device generating a timestamp for the time T (end) when the transmission of the first message is finished. Following relationship holds for the time offset ΔT (offset) : ΔT (offset) = T (slave) -T (master) = T (end) -T (end) _master = T (end) -T (start) - ΔT (processing master) -ΔT (processing slave) .
[0016] By subtracting ΔT (offset) from the local time of the slave device the resetting is effected. Please note that above T (start) refers to the local time of the master while T (end) refers to the local time of the slave.
[0017] Hence, in resetting the slave clock, the timestamp corresponding to the start of the transmission of the first message in the local time of the master device, the duration of receiving the first message at the slave device, the duration for sending the first message, and the time corresponding to the end of the reception of the first message are used, and it is assumed that the time elapsed between the start of the transmission of the first message and the end of reception of the first message corresponds to sum of the duration of receiving the first message at the slave device and the duration for sending the first message received from the master device.
[0018] According to an embodiment, the slave device comprises a MCU module (microcontroller unit) and a wireless communication module (radio module) , with the MCU module adapted to process the first message at the application layer of a communication protocol stack and the wireless communication module adapted to process the first message at sub-application-layer layers of the communication protocol stack. Mostly, the MCU module and the wireless communication module are separate physical entities. However, some MCU manufacturers offer MCUs with integrated wireless communication module. The embodiment provides for measuring the delay for receiving the first message at the slave device comprising measuring the processing time at the MCU module and measuring the processing time at the wireless communication module. The time delay from the start of the transmission process at the MCU until the wireless transmission essentially consists of the processing durations at the MCU and at the wireless communication module, which typically need to be determined in different ways. While measuring time at the MCU is pretty straightforward, wireless communication modules typically do not dispose of direct time measurement functionality. Instead, its activity can be monitored, and the duration of the activity measured, e.g., by mapping a signal indicating the activity of the wireless communication module on a timer periphery of the MCU by use of a PRS channel (PRS: Peripheral Reflex System) .
[0019] Similarly, the duration of transmitting the first message at the master device can be measured. The master device may comprise a MCU module and a wireless communication module (RF module) , with the MCU module adapted to process the first message at the application layer of a communication protocol stack and the wireless communication module adapted to process the first message at sub-application-layer layers of the communication protocol stack. Measuring the duration of transmitting the first message at the master device may comprise measuring the processing time at the MCU module and measuring the processing time at the wireless communication module. Measuring the processing time at the wireless communication module may comprise monitoring the activity of the wireless communication module, e.g., by mapping a signal indicating the activity of the wireless communication module on a timer periphery of the MCU by use of a PRS channel.
[0020] The method according to the invention can be used for simultaneous resetting the clock of a plurality of slave devices (e.g., slave devices for measuring current values of different phases of a three-phase circuit) to the local time of the same master device. In this scenario, the first message may be sent as a multicast message to the plurality of slave devices.
[0021] The invention also comprises a slave device configured for carrying out a method according to the invention. It may be configured to measure current. An embodiment of such a slave device for measuring current comprises a Rogowski coil, a rectify unit, a current sensor, a mode switch unit, a power converter unit, a signal conditioning unit, a microcontroller unit, and a wireless transmitter unit. It may be designed to be connected to a fuse module.
[0022] The invention also comprises a system built with a slave device as mentioned above and a master device configured for carrying out a method according to an embodiment of the invention. The slave device may be a Zigbee end device and the master device a Zigbee coordinator.
[0023] The invention allows for effective and versatile synchronization. In particular, it is also adapted to be used for synchronizing sleepy devices, i.e., devices which are not always powered on such as current measurement devices drawing power from a monitored circuit.BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Further benefits and advantages of the present invention will become apparent after a careful reading of the detailed description with appropriate reference to the accompanying drawings.
[0025] In the drawings:
[0026] Fig. 1 shows three current measurement devices that provide measurement data to a central data collector,
[0027] Fig. 2 shows the structure of the current measurement devices of Fig. 1,
[0028] Fig. 3 shows a synchronization method according to the invention, and
[0029] Fig. 4 shows data from a study that indicates the accuracy of the synchronization of Fig. 3.
[0030] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0031] Fig. 1 shows three phase lines L1 -L3 of a three-phase network. Each of the lines L1-L3 is provided with a modular smart fuse consisting of a fuse module and a current monitor and transmission module (below also referred to as “current sensor” ) . The latter module is shown in Fig. 2. The current sensor uses a Rogowski coil to obtain external energy and obtains the current value in the circuit through sampling and signal processing circuits, with minimal impact on the circuit modification. It also comprises a rectify unit, a current sensor unit, a mode switch unit, a power converter unit, a signal conditioning unit, a microcontroller unit, and a wireless transmitter unit.
[0032] The smart fuses of Fig. 1 communicate with a gateway EGS (EGS: enhanced grid sensor) to which measurement data are transmitted. Zigbee is used as communication protocol. The smart fuses assume the role of Zigbee end devices and the gateway EGS corresponds to a Zigbee coordinator. As there are multiple smart fuses sending timestamped data to the gateway EGS, the local clock of the individual fuses is best set to the time of the gateway EGS to provide for time synchronization. That is, the gateway EGS is the host or master used for voltage sampling and maintaining time synchronization, while the current sensors are slaves used for current sampling and Zigbee wireless time synchronization with the gateway ESG.
[0033] As shown in Fig. 2, the slave device (current sensor) comprises an MCU (Uinit6) and a wireless transmitter (Unit7) . Typically, both operate on different levels of the communication protocol stack. The MCU handles communication activities on the application layer level, while the wireless transmitter operates on lower levels such as the MAC-layer (MAC: Media Access Control) and assumes tasks such as packaging, addressing and transmission.
[0034] The master device employs a comparable communication architecture, i.e., comprises an MCU and a wireless transmitter.
[0035] Synchronization according to the present invention relies on the observation that the wireless transmission itself is fast enough to be considered instantaneous, i.e., transmission and reception occur practically at the time. In order to use this property for synchronization, the time when a message leaves the master and is received by the slave needs is determined or measured by both, the master and the slave device, albeit indirectly. As will be set out in detail below, the master device records a start time T1 for message transmission and measures a processing delay Jitter_delay (master) until wireless transmission. The slave device measures a processing delay Jitter-delay (slave) of message reception and records its end time T5. This information allows for determining the start of the wireless transmission at the master T3 = T1 + Jitter_delay (master)
[0036] and the determination of the start of reception of the wireless message at the slave T3′= T5 -Jitter-delay (slave) .
[0037] The method resides on the assumption T3 ≈ T3′. The assumption allows to base synchronization on information that allows for determining T3 and T3′, i.e., T1, Jitter_delay (master) , Jitter-delay (slave) , and T5.
[0038] Typically, the MCU can record times and set timestamps. In contrast, the wireless transmitter is not enabled to proceed accordingly. Sending of a message involves handling by the MCU, submitting the data to be sent to the wireless transmitter, handling by the wireless transmitter, and wireless transmission. The MCU can record the time when the transmission is started and measure the delay (jitter) until the data are submitted to the wireless transmitter. The handling delay of the wireless transmitter cannot be measured by itself. It is assumed that the MCU can track when the wireless transmitter is active and determine the duration. Typically, wireless transmitters would feature output pins that allow to determine whether they are active or not. By monitoring such output information, the duration of the handling by the wireless transmitter can be determined. For instance, Silicon Labs 32-bit MCUs comprise a Peripheral Reflex System (PRS) that may be used for this end. The PRS allows configurable, fast, and autonomous communication between peripherals on the MCU. A wireless transmitter output that indicates its transmission handling activity can be PRS routed on a timer periphery of the MCU. The timer measures the duration of wireless transmitter message handling. The MCU can use this duration to calculate the total handling duration (handling by the MCU plus handling by the wireless transmitter) .
[0039] Time synchronization is imperative for matching current values provided by the current sensors of Fig. 1 with voltage values from a different measurement device to calculate power quality parameters.
[0040] By analyzing the wireless communication hardware characteristics between the current sensor and host EGS, as well as the level flip signal characteristics obtained from a PRS (Peripheral Reflex System) signal, a timing diagram of transmission and reception is obtained as shown in Fig. 3.
[0041] Fig. 3 shows in more detail an example of a synchronization process as proposed by this application. The first line (Peer_CPU Timestamp) is a lime line where relevant times are marked. In the second line (Signal of AppLayer) the activity of the MCU at the master is shown. The third line (Peer_Device_TX) indicates transmission activity and the fourth line (Peer_Device_RX) reception activity of the master′s wireless transmitter. The fifth line (CurrentSensor_RX) indicates reception activity and the sixth line (CurrentSensor_TX) transmission activity of the master′swireless transmitter. In the seventh line (Signal of AppLayer Received) the activity of the MCU at the slave is shown.
[0042] The implementation process of wireless synchronization is as follows:
[0043] At time T1, EGS obtains its own CPU timestamp T1 and begins sending T1 timestamp information to the Current sensor.
[0044] The sending process is divided into two stages, the first stage being the PeerAppLayer_delay processing which takes from T1 to T2 and consists of message handling in the application layer, and the second stage is PeerMcLayer_delay taking from T2 to T3; during this time period gateway EGS is sending wireless signals outward through RF circuits at the Mac and PHY layers. Here, the sum of the delays PeerAppLayer_delay and PeerMcLayer_delay is called Jitter_Delay (see Fig. 3) . Jitter_delay is the delay information that needs to be transmitted during the second communication.
[0045] At time T3, the current sensor begins to receive wireless signals from host EGS until time T4, when data reception from the Mac layer is completed. The time period from T4 to T5 is the application layer's data reception and processing time, which means that it is not until time T5 that the current sensor receives the T1 time sent by gateway EGS from the application layer. At the same time, the current sensor also recorded the delays MacLayer_delay from T3 to T4 and AppLayer_delay from T4 to T5, but the value of the delay Jitter_Delay is still unkown, so currently the entire delay cannot be calculated after the message was processed. There is the need to send the value of Jitter_Delay from the gateway EGS to the slave current sensor via a further message.
[0046] At time T7, the master EGS starts sending a message with Jitter_delay to the current sensor slave. The delay value is not received by the current sensor at the application layer until time T9. Prior to receiving Jitter-Delay, the locally determined delays MacLayer_delay from T3 to T4 and AppLayer_delay from T4 to T5 were added to the value of the timestamp T1 received from the gateway EGS, i.e., T = T1 +MacLayer_delay + AppLayer_delay. By adding Jitter_delay, the time T5 according to the clock of gateway EGS is obtained, T5 = T + Jitter_delay = T1 + MacLayer_delay + AppLayer_delay + Jitter_delay. The time between T5 and T9 can be measured. (Alternatively, the local time at T5 can be combined with the calculated EGS master time at T5 to get the time offset between the EGS master and the current sensor slave. ) The relevant information to complete the time synchronization operation is now available at the current sensor slave. The slave device calculates the value of timestamp T9 according to the local time at the master and sets its clock to this value: T9 (master) = T1 (master) + Jitter_delay (master) + MacLayer_delay (slave) + AppLayer_delay (slave) + (T9 (slave) -T5 (slave) ) with
[0047] T1 (master) : timestamp sent by master in first message
[0048] Jitter_delay (master) : aggregate of PeerMacLayer_delay (master) and PeerAppLayer_delay (master) , which are both measured at the master and sent to the slave in the second message.
[0049] MacLayer_delay (slave) : delay measured at slave
[0050] AppLayer_delay (slave) : delay measured at slave
[0051] (T9 (slave) -T5 (slave) ) : time interval measured at slave via generation of a timestamp at T5 or by starting a timer at T5.
[0052] MacLayer_delay: delay measured by mapping a PRS signal which indicates transmission or reception activity by the wireless communication module to a timer periphery of the MCU.
[0053] AppLayer_delay: delay that is directly measured by the MCU.
[0054] As shown in Fig. 4, the best time synchronization accuracy can reach 0μs, and the average time synchronization accuracy can reach 10μs, which is sufficient for calculating power quality parameters by combining current values from the current sensor with voltage values that are timestamped according to the master device′s clock.
[0055] After completing the synchronization operation between the current sensor and gateway EGS, simultaneous voltage and current sampling can be started with the voltage values obtained by gateway EGS or a separate voltage measurement device in time synchrony with gateway EGS. The sampled data can be stored at gateway EGS.
[0056] By calculating the phase difference between voltage and current, the direction of energy flow can be determined, and active and reactive power can be calculated.
[0057] The novel synchronization method allows for high synchrony among master and slave device, so that power quality calculation can be performed on the basis von current and voltage values obtained from different measurement devices (distributed system for power quality parameter determination) . In particular, current sensors such as shown in Fig. 1 and Fig. 2 can be used. The power supply of these devices can rely on energy harvesting from the monitored current, because any clock inaccuracies cause by downtimes can be corrected via the above synchronization. In other words, the current devices may be a (Zigbee) sleepy devices. Thus, this method has the advantage that current values can be provided with accurate time information by a low-cost current sensor that requires only minor modifications to the circuit and hence allows for efficient power quality parameter determination.
Claims
1.A method for resetting the clock of a slave device to the local time of a master device, comprising the steps of- receiving a first wireless message from the master device,- measuring a duration of receiving the first message at the slave device,- using the time corresponding to the end of the reception of the first message,- receiving a timestamp corresponding to the start of the transmission of the first message in a local time of the mas-ter device and a duration for sending the first message from the master device via wireless message,- resetting the clock of the slave device to the local time of the master device, wherein the timestamp corresponding to the start of the transmission of the first message in the local time of the master device, the duration of receiving the first message at the slave device, the duration for sending the first message, and the time corresponding to the end of the reception of the first message are used and it is assumed that the time elapsed between the start of the transmission of the first message and the end of reception of the first message corresponds to the sum of the duration of receiving the first message at the slave device and the duration for sending the first message received from the master device.2.The method of claim 1, whereinthe first wireless message from the master device includes the timestamp corresponding to the start of the transmission of the first message in a local time of the master device.3.The method of claim 1 or 2, whereina second wireless message is sent from the master device to the slave device after the first wireless message, the second wireless message including the duration for sending the first message and / or the timestamp corresponding to the start of the transmission of the first message in a local time of the master device.4.The method of one of the preceding claims, whereinresetting the clock of the slave device to the local time of the master device includes calculating the local time at the master device or calculating a time offset between the slave and the master device.5.The method of one of the preceding claims, wherein- the slave device comprises a MCU module and a wireless communication module, with the MCU module adapted to process the first message at the application layer of a communication protocol stack and the wireless communication module adapted to process the first message at sub-application-layer layers of the communication protocol stack, and- measuring the delay for receiving the first message at the slave device comprises measuring the processing time at the MCU module and measuring the processing time at the wireless communication module.6.The method of claim 5, whereinmeasuring the processing time at the wireless communication module comprises monitoring the activity of the wireless communication module.7.The method of claim 6, comprisingmapping a signal indicating the activity of the wireless communication module on a timer periphery of the MCU module by use of a PRS channel.8.The method of one of the previous claims, comprisingmeasuring the duration of transmitting the first message at the master device.9.The method of claim 8, wherein- the master device comprises a MCU module and a wireless communication (RF module) module, with the MCU module adapted to process the first message at the application layer of a communication protocol stack and the wireless communication module adapted to process the first message at sub-application-layer layers of the communication protocol stack, and- measuring the duration of transmitting the first message at the master device comprises measuring the processing time at the MCU module and measuring the processing time at the wireless communication module.10.The method of claim 9, whereinmeasuring the processing time at the wireless communication module comprises monitoring the activity of the wireless communication module.11.The method of claim 10, comprisingmapping a signal indicating the activity of the wireless communication module on a timer periphery of the MCU by use of a PRS channel.12.The method of one of the previous claims, whereinthe method is used for simultaneous resetting the clock of a plurality of slave devices to the local time of the same master device.13.The method of claim 12, whereinthe first message is sent as a multicast message to the plurality of slave devices.14.A slave device configured for carrying out a method according to one of the claims 1 to 7.15.The slave device according to claim 14, wherein the slave device is configured to measure current.16.The slave device according to claim 15, wherein the slave device comprises a Rogowski coil, a rectify unit, a current sensor, a mode switch unit, a power converter unit, a signal conditioning unit, a microcontroller unit, and a wireless transmitter unit.17.A system comprising a slave device according to one of the claims 14 to 16 and a master device configured for carrying out a method according to one of the claims 8 to 13.18.The system of claim 17, wherein the slave device is a Zigbee end device and the master device is a Zigbee coordinator.
Citation Information
Patent Citations
Fusible link, fuse body, system and procedure
DE102018213522A1
Data exchange device and arrangement
DE202021000293U1
Time synchronization in distributed network testing equipment
US9628209B2