I am trying to execute very long trajectories on a FER robot via a motion generator (position commands). The trajectories are sampled in an external control loop using a constant timestep of 1ms. However, as the clock frequencies of the local machine and the control box are slightly different, a time drift between the external machine's clock and the control box's clock will accumulate over time. This fact causes a time dilation or contraction of the effectively executed trajectory, which will be longer or shorter than the desired one based on the clock frequency difference between the two machines.
I am working on a solution to solve this problem which is based on the estimation of the internal control loop frequency with respect to my machine, however the only source of information for the internal time I have access to is the Duration in the RobotState object which, being essentially an interation counter of the internal control loop, has a resolution of only 1ms.
In order to calculate a better estimation of the internal control loop frequency, I would need to access the control box's clock. Is it possible to run an NTP server on the control box to retrieve this information? If not, can you suggest me any alternative solution?