# Time Management in Wireless Sensor Networks for Industrial Process Control
## 4 Discussion  
Industrial control applications demand a blend of precision, low energy usage, and system simplicity. Ref. [23] emphasized that synchronization protocols must scale while remaining robust under real-world noise and traffic. Ref. [24] recently addressed these challenges through a mesh-star hybrid protocol that balances sync precision with a low traffic load. Meanwhile, ref. [25] showed that TDMA-based inter-cluster scheduling significantly reduces delay and jitter in large deployments. These insights support the rationale behind our design: a structured yet flexible timing model based on TSCH and beacon scheduling. This paper details a simple time management algorithm that can easily be implemented for managing the time in a wireless network used for process control. This approach can be used to manage time on wireless nodes based on COTS modules and components, allowing also for a decent time synchronization and drift between them. This was achieved by optimizing the code execution time on the microcontrollers by defining and using a HAL that directly accesses the microcontroller registers. This also allows for a good and consistent estimation of the code execution time used later in establishing the timeslot time. As we used different microcontroller families (i.e., STM32L1 and STM32L4) which have many similarities but also differences, the HAL allowed us to easily move the code between one microcontroller to another with only minor changes. The same approach can be used if we would ever need to move the code to, for example, high-performance microcontroller families like the STM32F7. Division of time has been performed considering the timeslot duration set to 10 milliseconds, which is enough time to send and receive two IEEE 802.15.4 frames with the maximum length of 127 bytes for O-QPSK modulation and a 250-kbps date rate. For future implementations using different modulations and/or faster data rates like, for example, UWB modulation that allows up to a 27 Mbps data rate, the timeslot duration can be decreased or increased as needed. Based on the 10-millisecond timeslot, we have defined a 6000-timeslot slot frame that repeats itself continuously. This was also chosen to limit the maximum time drift between any two wireless nodes using COTS components to below 1 millisecond. Using custom-made hardware with more precise oscillators will allow the decrease in the slot frame duration, resulting in faster node response times. Shorter slot frames also have a smaller footprint on the network coordinator internal memory. Custom hardware can have an impact on the number of timeslots in the timeslot groups, but also in the structure of these timeslot groups as beacon frames do not need to be sent so often. The proposed slot frame structure allows both the operation of control loops and sending of data like sensor data between wireless nodes. This slot frame structure can be adjusted according to the application needs. Time synchronization, critical in process control applications, has been implemented based on a customized algorithm defined by IEEE 802.15.4. This algorithm uses the timeslot  
Figure 10: The time drift in milliseconds between two wireless nodes without synchronization. template to send frames at specific times within the timeslot, the timeslot group number, and the code execution time within the microcontroller needed to process an incoming frame. This simple approach led to reasonable results in terms of the time drift between nodes considering the hardware it is implemented on. Custom hardware with more precise oscillators can lead to even lower time drifts between nodes, requiring less frequent needs for time synchronization. Security and robustness in synchronization have become increasingly relevant in industrial WSNs. [PERSON] et al. [26] proposed a Sybil-resistant protocol that uses node identification and timestamp correlation to filter malicious messages. Ref. [12] introduced trust-based synchronization that leverages skew uniqueness to verify message authenticity.