VIDEO SERIES
Precision time protocol (PTP) in the Processor SDK for Linux
Learn about PTP as included in the Processor SDK for Linux.
PTP in the Processor SDK for Linux: The Need for Time Synchronization
Presenter(s)
Resources
Hello. Welcome to the PTP in the Processor SDK for Linux training series. This is The Need for Time Synchronization module. This module is just one part of the overall series and you can see the other options here. If you're interested in those, I hope you'll check those out as well.
So why time synchronization? Why would we want to have two different systems like shown here with the [INAUDIBLE] blocks, and have them have the exact same time-base as indicated by the clocks. Well, one reason for this might be that these two different systems are recording events, maybe writing things to their file systems, and we want to be able to compare those events after the fact.
So we would go grab the file from one, go grab the file from the other, put the two together, use the time-base to put that in serial order, and try to figure out what's going on with it. So that might be one application of it. Another one might be control, where these two systems are going to do a coordinated function, maybe one right after the other, maybe exact same time. So obviously, in order to do that they would both need the same time-base.
And these kinds of systems are growing in importance and popularity. As we move to industry 4.0, we get a smarter grid, different applications and functions like this, where a larger autonomous system is really the representation of several smaller systems. And they all need to work and function together as one true system. So time is becoming very important.
And let's take a look at an example of that sensing application, where we do look at event logging and see how, if we don't have a good time-base, that might lead to some problems. So here's the example. We've got the actual time at the top. And then we've got one system that's two seconds behind actual time. And then another system that's two seconds ahead of actual time. And let's see what happens if these two systems were to log events and then we were to compare that log later on to see what had happened.
So here is event one. It comes in at actual time 30, but it's locked at 28 because of the two second time difference. And then obviously, if we have another event come in, we're going to have it show up at 34 local, which is 32 actually, because again, we're at two positive offset now. And we'll see that we'll write that down in the log as 34. Then if a third event comes in, it's going to be logged at local time 32, which is actual time 34. And you can see by the actual times everything looks OK-- 30, 32, 34-- obviously, the way it should have happened.
But if we looked at the log later of these events and compared them based on time, you would actually see that two and three had been swapped. And if you were making decisions based on this going that OK, when three happens before two this happens. That would be an incorrect assumption, because obviously, that wasn't the case. So if you're going to be comparing events after the fact or even in real time and you need to be able to make decisions based on those events so that you can control an overall function, you need to have a better time-base.
So let's get that better time-base. We'll tighten it up quite a bit, so that we're a lot closer than being on time, but it's still not perfect. All right? You see that there's still a little bit of difference and we'll see how that impacts this system. So we'll do the same thing, three events. Here comes the first one. It gets logged at actual time 30. That equates to local time 29.99, due to the small offset. We'll bring in a second event and see that it gets logged at 32 actual and very close to 32 for the system.
And then of course, the last one, and it gets logged. And you can see that when this happens, and our time-bases are a lot closer to each other, then we will get a correct log of the events, event one, two, and three happening after each other. And if we were to make decisions based on this after the fact, we would make the right decision based on this event log.
So that's an example of how if you tighten that time-base up you can make better decisions after the fact in a sensing application. Or a lot of times, you know, the control is a lot easier to understand if you need something that happened at the exact right time, obviously, you tighten that time-base up, you're going to be a lot closer to that happening at the right time.
So there are a couple of different applications that are pretty popular in industrial systems today, where time seek might be very important for the system. So in summary, we looked at an example where time synchronization is needed for sensing and control in modern systems. You can get errors if you don't have properly synchronized time and you're having to make decisions based upon that. And these errors can show up either in real time or in pre or post processing, depending on what the application calls for.
Here are some resources that you might find useful to help you learn more about the Processor SDK and PTP. Here are some references that were beneficial to this presentation and you might find them useful as well.