CANopen系列文章【1】--SYNC【3】


前两篇文章写的已经涵盖了大部分内容,事实上仍有一部分没有说清楚。所以寄希望于DS301的部分内容能把这部分内容讲清楚。

9.3.1  Transmission of Synchronous PDO Messages 
Synchronous transmission of a message means that the transmission of the message is fixed in time 
with respect to the transmission of the SYNC message. The synchronous message is transmitted 
within a given time window with respect to the SYNC transmission, and at most once for every period 
of the SYNC. 
In general the fixing of the transmission time of synchronous PDO messages coupled with the 
periodicity of transmission of the SYNC message guarantees that devices may arrange to sample 
process variables from a process environment and apply their actuation in a co-ordinated fashion. 
A device consuming SYNC messages will provide synchronous PDO messages too. The reception of 
a SYNC message controls the moment when the application will interact with the process environment 
according to the contents of a synchronous PDO. The synchronous mechanism is intended for 
transferring commanded values and actual values on a fixed timely base. 
In general a synchronous PDO with a commanded value will be received before a SYNC. The SYNC 
consuming device will actuate based on this synchronous PDO at the next SYNC message. The 
reception of a SYNC will also prompt a device operating in the cyclic mode to sample its feedback 
data and transmit a synchronous PDO with an actual value as soon as possible afterwards. 
Depending upon its capabilities, a device may also be parameterised with the time period 
synchronous window length after the SYNC at which it is guaranteed that its commanded value has 
arrived. It may therefore perform any processing on the commanded value which is required in order 
to actuate at the next SYNC message. 


CANopen系列文章【1】--SYNC【3】_第1张图片

=======================================================================

CANopen系列文章【1】--SYNC【3】_第2张图片



9.3.2  Optional High Resolution Synchronisation Protocol 
The synchronisation message carries no data and is easy to generate. However, the jitter of this 
SYNC depends on the bit  rate of the bus as even the very high priority SYNC has to wait for the 
current message on the bus to be transmitted before it gains bus access. 
Some time critical applications especially in large networks with reduced transmission rates require 
more accurate synchronisation; it may be necessary to synchronise the local clocks with an accuracy 
in the order of microseconds. This is achieved by using the optional high resolution synchronisation 
protocol which employs a special form of time stamp message (see Figure 46) to adjust the inevitable 
drift of the local clocks. 
The SYNC producer time-stamps the interrupt generated at t1 by the successful transmission of the 
SYNC message (this takes until t2). After that (at t4) he sends a time-stamp message containing the 
corrected time-stamp (t1) for the SYNC transmission success indication. The SYNC consumer that 
have taken local time-stamps (t3) on the reception (t1) of the SYNC can now compare their corrected 
time-stamp (t1) with the one received in the time-stamp message from the SYNC producer. The 
difference between these values determines the amount of time to adjust the local clock. With this 
protocol only the local latencies (t2-t1 on the SYNC producer and t3-t1 on the SYNC consumer ) are 
time critical. These latencies depend on local parameters  (like interrupt processing times and 
hardware delays) on the nodes which have to be determined once. The accuracy of this determination 


is implementation specific, it forms the limiting factor of the synchronisation (or clock adjustment) 
accuracy. Note that each node only has to know its own latency time as the time-stamp message 
contains the corrected value t1 and not t2. 
The time-stamp is encoded as UNSIGNED32 with a resolution of 1 microsecond which means that the 
time counter restarts every 72 minutes. It is configured by mapping the high resolution time-stamp into 
a PDO. 
It is reasonable to repeat the clock adjustment only when the maximum drift of the local clock exceeds 
the synchronisation accuracy. For most implementations this means that it is sufficient to add this 
time-stamp message to the standard SYNC once every second. 
This principle enables the best accuracy that can be achieved with bus-based synchronisation, 
especially when implemented on CAN controllers that support time-stamping. Note that the accuracy 
is widely independent of the transmission rate. Further improvement requires separate hardware (e.g. 
wiring). 

CANopen系列文章【1】--SYNC【3】_第3张图片






你可能感兴趣的:(CANopen系列文章【1】--SYNC【3】)