V\big{(}\phi(t,j)\big{)}=-\sum_{i=1}^{n\scalebox{0.75}[1.0]{$-$}1}\sigma_{i}\varepsilon_{i}^{\top}(t^{i},j^{i})\varepsilon_{i}(t^{i},j^{i})\hskip
14.22636pt\forall(t,j)\in\\{\mbox{dom }\phi:t+j\geq T^{*}\\}$

where $(t^{i},j^{i})\in\\{\mbox{dom
}\phi:\phi(t,j)\in\widetilde{D}_{\varepsilon_{6}}^{i},i\in\mathcal{V}\\}$
denotes the time at which the corrections $K_{\tilde{o}}(p,\mathcalow{m})$,
$K_{a}(\mathcalow{m},\tau_{k})$ are applied to $\varepsilon_{i}$. Then, taking
the limit of $V\big{(}\phi(t,j)\big{)}$ we have that

$\displaystyle\lim_{t+j\to\infty}V\big{(}\phi(t,j)\big{)}=0$

allowing us to conclude attractivity to the set
$\widetilde{{\cal{A}}}_{\varepsilon}$ for
$\widetilde{\mathcal{H}}_{\varepsilon}$ and complete the proof. ∎

##  7 Numerical Results

###  7.1 Two-agent system

####  7.1.1 Nominal Setting

In this first example, we present a numerical simulation of the two-agent
system for the nominal setting that validates our theoretical results, namely
we show that with the conditions in (38) satisfied, the trajectories of the
simulation converge to the desired set.

######  Example 7.1.

Consider Nodes $i$ and $k$ with dynamics as in (1) with data $a_{i}=1$,
$a_{k}=1.8$ and $c=0.1$, $d=0.2$ to the system $\mathcal{H}$. Setting
$\mu=0.833$, condition (38) is satisfied with
$P=\begin{bmatrix}6.2594&-0.5219\\\ -0.5219&11.4302\end{bmatrix}$. Simulating
the system, Figure 5 shows the trajectories of the error in the clocks and
error in the clock rates of Nodes $i$ and $k$ for a solution $\phi$ to the
system such that $\phi(0,0)\in(C\cup D)\cap\mathcal{M}$. Figure 5 also shows
the plot of $V$ evaluated along the solution. Notice, that $V$ converges to
zero asymptotically following several periodic executions of the algorithm.
Observe that the behavior of clock error is more stable than the conventional
sender-receiver algorithm simulated in Figure 3. 666Code at
github.com/HybridSystemsLab/HybridSenRecClockSync

(a) (b)

Figure 5:  Figure 5(a) gives the evolution of the error in the clocks and
clock rates of Nodes $i$ and $k$. Figure 5(b) gives $V$ evaluated along the
solution.

####  7.1.2 Variable propagation delay due to communication noise

In the next example, we simulate the case of noise in the communication
channel that contributes to a variable propagation delay $d$. Noise in the
communication channel makes the propagation delay between nodes $i$ and $k$ no
longer symmetric.

######  Example 7.2.

Consider the same clock dynamics from the previous example, i.e., $a_{i}=1.1$,
$a_{k}=0.75$, with $\mu=0.3571$ and condition (38) satisfied for $c=0.2$,
$d=0.5$, and $P=\begin{bmatrix}5.435&1.041\\\ 1.041&16.0982\end{bmatrix}$.
Now, with $[d_{1},d_{2}]$ defining the allowed values of $d$ with $d_{1}=0.49$
and $d_{2}=0.51$, we generate variable propagation delay by replacing the
dynamics of $\tau$ in (13) by

$\displaystyle\dot{\tau}=-1$ $\displaystyle\tau\in[0,d_{2}]$
$\displaystyle\tau^{+}\in\cup_{d\in[d_{1},d_{2}]}(1-q)d+qc$
$\displaystyle\tau=0$

Figure 8 shows a simulation of the trajectories of the error in the clocks and
error in the clock rates of Nodes $i$ and $k$. Observe that absolute error in
the clocks converges to zero even in the presence of the perturbation after
several periodic executions of the algorithm. The error in clock rates is also
able to converge sufficiently close to zero but suffers from some observed
variability due to the noise. 777Code at
github.com/HybridSystemsLab/HybridSenRecClockSync

(a) (b)

Figure 6:  Figure 5(a) gives the evolution of the error in the clocks and
clock rates of Nodes $i$ and $k$ subject to noise on the communication
channel. Figure 5(b) gives $V$ evaluated along the solution.

####  7.1.3 Time-varying clock rates

In the next example, we consider the common scenario of time-varying clock
skews at both nodes $i$ and $k$. This noise is injected at the clock dynamics
$\dot{\tau}_{i}$ and $\dot{\tau}_{k}$. The system is then simulated with the
remaining dynamics left unchanged.

######  Example 7.3.

For $c=0.2$ and $d=0.5$, consider nodes $i$ and $k$ with clock dynamics

$\displaystyle\dot{\tau}_{i}$ $\displaystyle=a_{i}+m_{a}$
$\displaystyle\dot{\tau}_{k}$ $\displaystyle=a_{k}+m_{a}$

where $a_{i}=1.1$, $a_{k}=0.75$, and $m_{a}\in(-0.3,0.3)$ is a Gaussian
injected noise on the clock dynamics. Letting $\mu=0.3571$, condition (38) is
satisfied with $P=\begin{bmatrix}5.435&1.041\\\ 1.041&16.0982\end{bmatrix}$.
Simulating the system, Figure 7 shows the trajectories of the error in the
clocks and error in the clock rates of Nodes $i$ and $k$. Again, the system is
able to converge after a couple of executions of the algorithm. The error on
the clocks observes the most variability due to simulated noise.888Code at
github.com/HybridSystemsLab/HybridSenRecClockSync

(a) (b)

Figure 7:  Figure 5(a) gives the evolution of the error in the clocks and
clock rates of Nodes $i$ and $k$ subject to noise $m_{a}$ on the clock
dynamics. Figure 5(b) gives $V$ evaluated along the solution.

###  7.2 Multi-agent model

In this section we present numerical results for the multi-agent model to
validate our theoretical results and draw comparisons with other multi-agent
clock synchronization models from the literature.

######  Example 7.4.

Consider a network of three nodes $\\{R,1,2\\}$ where $R$ denotes the
reference or parent node while nodes $1$ and $2$ denote the synchronizing
child nodes. The data of this system is given by
$a_{R},a_{1},a_{2}\in[0.5,1.5]$ and $c=0.1$, $d=0.2$ with $\mu=0.833$.
Simulating the multi-agent system $\widetilde{\mathcal{H}}$, Figure 7(a) shows
the trajectories of the error in the clocks and error in the clock rates of
Nodes $1$ and $2$ with respect to Node $R$. Note that the errors with respect
to each clock converge after several executions of the algorithm on the
respective clocks at Nodes $1$ and $2$. 999Code at
github.com/HybridSystemsLab/HybridSenRecMultiClockSync

Figure 8:  The evolution of the error in the clocks and clock rates of Nodes
$1$ and $2$ with respect to Node $R$.

##  8 Conclusion

In this paper, we introduced a sender-receiver clock synchronization algorithm
with sufficient design conditions ensuring synchronization. Results were given
to show asymptotic attractivity of a set of interest reflecting the desired
synchronized setting. Numerical results validating the attractivity of the
system to the set of interest were also given. An additional model to capture
the multi-agent setting was presented with a numerical example to demonstrate
its feasibility. In future work we will study stability of the system and
robustness properties to specific perturbations.

## References

  * [1] S. Samii, H. Zinner, Level 5 by layer 2: Time-sensitive networking for autonomous vehicles, IEEE Communications Standards Magazine 2 (2) (2018) 62–68.
  * [2] J. C. Eidson, Measurement, control, and communication using IEEE 1588, Springer Science & Business Media, 2006.
  * [3] S. Graham, P. R. Kumar, Time in general-purpose control systems: the control time protocol and an experimental evaluation, in: 2004 43rd IEEE Conference on Decision and Control (CDC) (IEEE Cat. No.04CH37601), Vol. 4, 2004, pp. 4004–4009 Vol.4.  doi:10.1109/CDC.2004.1429378.
  * [4] W. Zhang, M. S. Branicky, S. M. Phillips, Stability of networked control systems, IEEE Control Systems Magazine 21 (1) (2001) 84–99.  doi:10.1109/37.898794.
  * [5] J. Nilsson, Real-time control systems with delays, Ph.D. thesis, Lund University (1998).
  * [6] J. P. Hespanha, P. Naghshtabrizi, Y. Xu, A survey of recent results in networked control systems, Proceedings of the IEEE 95 (1) (2007) 138–162.
  * [7] Y.-C. Wu, Q. Chaudhari, E. Serpedin, Clock synchronization of wireless sensor networks, IEEE Signal Processing Magazine 28 (1) (2010) 124–138.
  * [8] B. Sundararaman, U. Buy, A. D. Kshemkalyani, Clock synchronization for wireless sensor networks: a survey, Ad hoc networks 3 (3) (2005) 281–323.
  * [9] O. Simeone, U. Spagnolini, Y. Bar-Ness, S. H. Strogatz, Distributed synchronization in wireless networks, IEEE Signal Processing Magazine 25 (5) (2008) 81–97.
  * [10] S. M. LaValle, M. B. Egerstedt, On time: Clocks, chronometers, and open-loop control, in: 2007 46th IEEE Conference on Decision and Control, IEEE, 2007, pp. 1916–1922.
  * [11] M. Guarro, F. Ferrante, R. Sanfelice, State estimation of linear systems over a network subject to sporadic measurements, delays, and clock mismatches, IFAC-PapersOnLine 51 (23) (2018) 313–318.
  * [12] Y. Nakamura, K. Hirata, K. Sugimoto, Synchronization of multiple plants over networks via switching observer with time-stamp information, in: 2008 SICE Annual Conference, IEEE, 2008, pp. 2859–2864.
  * [13] D. L. Mills, Internet time synchronization: the network time protocol, IEEE Transactions on communications 39 (10) (1991) 1482–1493.
  * [14] IEEE, IEEE standard for a precision clock synchronization protocol for networked measurement and control systems, IEEE Std 1588-2008 (Revision of IEEE Std 1588-2002) (2008) 1–300.
  * [15] S. Ganeriwal, R. Kumar, M. B. Srivastava, Timing-sync protocol for sensor networks, in: Proceedings of the 1st international conference on Embedded networked sensor systems, ACM, 2003, pp. 138–149.
  * [16] N. M. Freris, S. R. Graham, P. Kumar, Fundamental limits on synchronizing clocks over networks, IEEE Transactions on Automatic Control 56 (6) (2010) 1352–1364.
  * [17] L. Schenato, F. Fiorentin, Average timesynch: A consensus-based protocol for clock synchronization in wireless sensor networks, Automatica 47 (9) (2011) 1878–1886.
  * [18] R. Carli, S. Zampieri, Network clock synchronization based on the second-order linear consensus algorithm, IEEE Transactions on Automatic Control 59 (2) (2014) 409–422.  doi:10.1109/TAC.2013.2283742.
  * [19] S. Bolognani, R. Carli, E. Lovisari, S. Zampieri, A randomized linear algorithm for clock synchronization in multi-agent systems, IEEE Transactions on Automatic Control 61 (7) (2015) 1711–1726.
  * [20] E. Garone, A. Gasparri, F. Lamonaca, Clock synchronization protocol for wireless sensor networks with bounded communication delays, Automatica 59 (2015) 60–72.
  * [21] M. Guarro, R. G. Sanfelice, Hyntp: A distributed hybrid algorithm for time synchronization, arXiv preprint arXiv:2105.00165.
  * [22] R. Goebel, R. G. Sanfelice, A. R. Teel, Hybrid Dynamical Systems: Modeling, Stability, and Robustness, Princeton University Press, 2012.
  * [23] M. Guarro, R. Sanfelice, An adaptive hybrid control algorithm for sender-receiver clock synchronization, IFAC-PapersOnLine 53 (2) (2020) 1906–1911.
  * [24] N. M. Freris, V. S. Borkar, P. Kumar, A model-based approach to clock synchronization, in: Proceedings of the 48h IEEE Conference on Decision and Control (CDC) held jointly with 2009 28th Chinese Control Conference, IEEE, 2009, pp. 5744–5749.
  * [25] F. Ferrante, F. Gouaisbaut, R. G. Sanfelice, S. Tarbouriech, State estimation of linear systems in the presence of sporadic measurements, Automatica 73 (2016) 101 – 109.
  * [26] R. G. Sanfelice, R. Goebel, A. R. Teel, Invariance principles for hybrid systems with connections to detectability and asymptotic stability, IEEE Transactions on Automatic Control 52 (12) (2007) 2282–2297.  doi:10.1109/TAC.2007.910684.
  * [27] D. Macii, D. Fontanelli, D. Petri, A master-slave synchronization model for enhanced servo clock design, in: 2009 International Symposium on Precision Clock Synchronization for Measurement, Control and Communication, 2009, pp. 1–6.  doi:10.1109/ISPCS.2009.5340199.
  * [28] M. Guarro, R. G. Sanfelice, HyNTP: An adaptive hybrid network time protocol for clock synchronization in heterogeneous distributed systems, in: 2020 American Control Conference (ACC), 2020, pp. 1025–1030.  doi:10.23919/ACC45564.2020.9147245.