主站以队列模式发送数据帧一个一个的通过每个从站,每个从站接收到数据帧的时间都不相同,最后的从站会最迟接收到数据,但发出是最新锁存的返回数据。
DC同步的意义是即使每个站点接收和返回数据的时间点都不相同,但我们可以让数据生效的时间进行相等。对于output数据,我们先等所有从站都接收完数据后,都在一个共同约定好的时间点进行数据的实际输出,对于input数据,所有从站在数据帧到来进行数据提取前,约定好一个固定时间点进行返回数据锁存。通过延时达到数据生效时间的同步,但有个前提就是所有站点的时钟是一致的。
DC模块的作用是把所有站点的系统时钟都进行同步,一般以第一个从站作为时钟同步参考对象,被参考的时钟叫参考时钟。
常用的同步配置参数 0x1C32 and 0x1C33
Sync Mode:用来配置同步模式
- Synchronization Type 0x1C32:01
- Synchronization Type 0x1C33:01
Shift Time:偏置时间
- Output Shift Time 0x1C32:03
- Input Shift Time 0x1C33:03
Calculation and Copy Time:数据复制时间
- Calculation and Copy Time 0x1C32:06
- Calculation and Copy Time 0x1C33:06
Delay Time:延时
- Delay Time (0x1C32:09)
- Delay Time (0x1C33:09)
一些常见的术语说明:
Outputs数据的读取准备时间:MUC读取ESC接收到的Outputs数据需要的准备和读取时间
Copy and Prepare Outputs = Calc and Copy Time (0x1C32:06)+Delay Time (0x1C32:09)
Inputs 数据的准备时间:MUC写入ESC用来发送到的Inputs数据需要的准备和写入时间
Get and Copy Inputs = Calc and Copy Time (0x1C33:06)+Delay Time (0x1C32:09)
Outputs Valid :输出数据生效时间点。
Input Latch:输入数据锁存时间点,此时MCU的输入数据开始写入ESC的PD RAM。
如果没有指定该时间点(shift时间=0),The input values are available in the input data area of SyncManger 3 after the min. cycle time (0x1C32:05).
User Shift Time:用于考虑主站发送数据帧的抖动。
3种同步模式
(1)FREE RUN(不同步) - 偏差1个通信周期以内
(2)SM同步(同步数据帧) -偏差us级别以上
(3)DC同步(时钟同步)- 偏差100ns以内
FREERUN模式
FreeRun时序图
FreeRun模式下0X1C32配置要求
Subindex | Description | Flag | Use | Description/default value |
---|---|---|---|---|
1 | Synchronization Type | r or rw | required | 0x00: Free Run |
2 | Cycle Time | r or rw | optional | Local cycle time from application controller |
3 | Shift Time | -- | -- | |
4 | Synchronization Types supported | r | required | Bit 0: Free Run supported |
5 | Minimum Cycle Time | r | conditional | required if 0x1C32:02 variable |
6 | Calc and Copy Time | -- | -- | |
7 | -- | -- | -- | |
8 | Get Cycle Time | -- | -- | |
9 | Delay Time | -- | -- | |
10 | SYNC0 Cycle Time | -- | -- | |
11 | Cycle Time Too Small | -- | -- | |
12 | SM-Event missed | -- | -- | |
13 | Shift Time Too Short | -- | -- | |
14 | RxPDO Toggle Failed | -- | -- | |
31:15 | -- | -- | -- | |
32 | Sync Error | -- | -- |
FreeRun模式下0X1C33的配置要求
Subindex | Description | Flag | Use | Description/default value |
---|---|---|---|---|
1 | Synchronization Type | r or rw | required | 0x00: Free Run |
2 | Cycle Time | r or rw | optional | same value as 0x1C32:02 |
3 | Shift Time | -- | -- | |
4 | Synchronization Types supported | r | required | same value as 0x1C32:04 |
5 | Minimum Cycle Time | r | conditional | same value as 0x1C32:05 |
6 | Calc and Copy Time | -- | -- | |
7 | -- | -- | -- | |
8 | Get Cycle Time | -- | -- | |
9 | Delay Time | -- | -- | |
10 | SYNC0 Cycle Time | -- | -- | |
11 | Cycle Time Too Small | -- | -- | |
12 | SM-Event missed | -- | -- | |
13 | Shift Time Too Short | -- | -- | |
14 | RxPDO Toggle Failed | -- | -- | |
31:15 | -- | -- | -- | |
32 | Sync Error | -- | -- |