  In this article, we present a new control theoretic distributed time
synchronization algorithm, named PISync, in order to synchronize sensor nodes
in Wireless Sensor Networks (WSNs). PISync algorithm is based on a
Proportional-Integral (PI) controller. It applies a proportional feedback (P)
and an integral feedback (I) on the local measured synchronization errors to
compensate the differences between the clock offsets and clock speeds. We
present practical flooding-based and fully distributed protocol implementations
of the PISync algorithm, and we provide theoretical analysis to highlight the
benefits of this approach in terms of improved steady state error and
scalability as compared to existing synchronization algorithms. We show through
real-world experiments and simulations that PISync protocols have several
advantages over existing protocols in the WSN literature, namely no need for
memory allocation, minimal CPU overhead and code size independent of network
size and topology, and graceful performance degradation in terms of network
size.
