# Time Management in Wireless Sensor Networks for Industrial Process Control
## 3 Results
### Division of Time  
The overall aim of the time management algorithm is to achieve a sub-millisecond time drift between any two nodes associated to the wireless network. Why is this needed? If we look at a classic control loop, sending a delayed command will cause instability in the controlled process, especially in fast ones. Furthermore, keeping this time drift is in line with the timeslot template defined by IEEE 802.15.4 when using the TSCH operating mode. Considering the COTS development boards used in this experiment and the \(\pm\)20-ppm frequency drift on-board crystals, we have fixed the slot frame at 6000 timeslots of 10 milliseconds each leading to a 1 min long slot frame. This will lead to a theoretical maximum time drift of less than 40-ppm \(\times\) 6000 slots = 2.4 milliseconds per slot frame, assuming one oscillator drifts forward and the other backward. To achieve a sub-millisecond drift between any two nodes, we have concluded to divide the slot frame into groups of 50 timeslots, as shown in Figure 3.  
The first timeslot in the group of 50, or timeslot 0 marked with A, is an advertisement timeslot. During this timeslot, the network coordinator (the clock source) sends a beacon frame over the wireless network to notify other wireless devices of the network's presence. The beacon frame also includes information about the exact time when the coordinator transmitted the frame. Odd timeslots are control timeslots, marked with C, used in control loops to transmit data frames containing commands and process output measurements. Even timeslots are management timeslots, marked with M, used by the coordinator to pass settings to wireless devices, as well as by wireless devices to pass data to the coordinator. Shared timeslots, marked with S, are used by all wireless nodes participating in the network to transmit frames when they do not yet have assigned timeslots. These timeslots are used in procedures such as associating a wireless device with the network, where the last step is to allocate dedicated timeslots. The 25 th timeslot in the group of 50 will always be the  
Figure 3: The group of timeslots used by the algorithm, detailing the sequence of timeslots used for sending a beacon frame (A), process control by control loops (C), configuration and management (M), and shared communication for devices not yet associated to the network (S).  
shared timeslot. In a slot frame, there are 120 advertisement timeslots, 2760 management timeslots, 3000 control timeslots, and 120 shared timeslots.  
We have chosen to send an enhanced beacon frame, as defined by IEEE 802.15.4, during the advertisement timeslot as it allows the insertion of the user payload. This 5-byte payload contains information related to the current network coordinator time: the UTC time in seconds and the time fraction--the timeslot group number, from 0 to 119. As the enhanced beacon frame is being sent during the advertisement timeslot at the moment specified in the timeslot template, a device joining or joined to the network knows the precise absolute time at which the enhanced beacon frame was sent.  
Any device sending frames over the wireless network will follow the TSCH CCA operating mode of IEEE 802.15.4-2020 combined with the proposed slotframe structure, as shown in Figure 4. An associated device will use its dedicated timeslots to communicate with the coordinator, while shared timeslots are used by non-associated devices during the association process.