《電子技術(shù)應(yīng)用》
您所在的位置:首頁(yè) > 其他 > 設(shè)計(jì)應(yīng)用 > 基于ZYNQ的PTP授時(shí)精度測(cè)量方法與實(shí)現(xiàn)
基于ZYNQ的PTP授時(shí)精度測(cè)量方法與實(shí)現(xiàn)
2021年電子技術(shù)應(yīng)用第6期
宋 艷1,應(yīng)斌杰1,,楊成鋼1,,郝自飛1,,毛立振2
1.國(guó)網(wǎng)浙江省電力有限公司 麗水供電公司,浙江 麗水316021,;2.杭州量泓科技有限公司,,浙江 杭州310019
摘要: 針對(duì)PTP授時(shí)精度測(cè)量存在的困難,提出在ZYNQ SOC上用μCOS操作系統(tǒng)和LWIP協(xié)議棧,,來(lái)實(shí)現(xiàn)PTP授時(shí)精度測(cè)量,。該方法通過(guò)接收衛(wèi)星導(dǎo)航系統(tǒng)信號(hào),得到準(zhǔn)確的系統(tǒng)時(shí)間和時(shí)鐘源差,,利用硬件將系統(tǒng)時(shí)間同步至ZYNQ的納秒計(jì)數(shù)器,。利用ZYNQ EMAC接口獲取PTP收發(fā)幀的觀測(cè)時(shí)間,并利用源差值實(shí)現(xiàn)對(duì)測(cè)量時(shí)間的補(bǔ)償,,最終得到準(zhǔn)確的時(shí)間戳,,進(jìn)而實(shí)現(xiàn)對(duì)待測(cè)PTP主時(shí)鐘授時(shí)精度測(cè)量,。經(jīng)實(shí)際測(cè)試,利用該方法對(duì)PTP時(shí)鐘進(jìn)行測(cè)量,,能夠獲得優(yōu)于10 ns的測(cè)量精度,。
中圖分類號(hào): TN927
文獻(xiàn)標(biāo)識(shí)碼: A
DOI:10.16157/j.issn.0258-7998.201167
中文引用格式: 宋艷,應(yīng)斌杰,,楊成鋼,,等. 基于ZYNQ的PTP授時(shí)精度測(cè)量方法與實(shí)現(xiàn)[J].電子技術(shù)應(yīng)用,2021,,47(6):115-118,,130.
英文引用格式: Song Yan,Ying Binjie,,Yang Chenggang,et al. A method and implementation of PTP timing accuracy measurement based on ZYNQ[J]. Application of Electronic Technique,,2021,,47(6):115-118,130.
A method and implementation of PTP timing accuracy measurement based on ZYNQ
Song Yan1,,Ying Binjie1,,Yang Chenggang1,Hao Zifei1,,Mao Lizhen2
1.Lishui Power Supply Company,,State Grid Zhejiang Electric Power Co.,Ltd,,Lishui 316021,,China; 2.Hangzhou Quantum Sensing Technology Co.,,Ltd.,,Hangzhou 310019,China
Abstract: Aiming at the difficulties of PTP timing accuracy measurement, this paper puts forward using μCOS operating system and LWIP protocol stack on ZYNQ SOC to realize PTP timing accuracy measurement. Accurate system time and clock source difference are obtained by receiving GNSS signals, and the system time is synchronized to the nanosecond counter of ZYNQ by hardware. The ZYNQ EMAC interface is used to acquire the observation time of PTP frames, and the source difference is used to compensate the measurement time. Finally, an accurate time stamps are obtained, which can be used to measure the timing accuracy of the PTP master clock. The test results show that using this method to measure PTP clock, the measurement accuracy is better than 10 ns.
Key words : PTP,;timing,;GNSS;time stamp

0 引言

    精確時(shí)間協(xié)議(Precision Time Protocol,,PTP)是一種高精度網(wǎng)絡(luò)時(shí)間同步協(xié)議[1-2],,具體內(nèi)容由IEEE 1588協(xié)議定義。IEEE1588協(xié)議目前有V1和V2兩個(gè)版本,。其支持多種形式的傳輸,,比如UDP/IPv4、UDP/IPv6以及IEEE 802.3等,。PTP與網(wǎng)絡(luò)授時(shí)協(xié)議(Network Timing Protocol,,NTP)的主要區(qū)別是,,PTP是在物理層實(shí)現(xiàn)而NTP是在應(yīng)用層實(shí)現(xiàn)。因此,,PTP比NTP具有更高的同步精度,。PTP可以達(dá)到亞微秒級(jí)授時(shí)精度,在網(wǎng)絡(luò)的節(jié)點(diǎn)(交換機(jī))支持PTP協(xié)議的情況下,,能夠?qū)崿F(xiàn)納秒量級(jí)的授時(shí)精度[3-4],。

    PTP授時(shí)具有成本低、精度高,、網(wǎng)絡(luò)開(kāi)銷小等優(yōu)點(diǎn),,因此在通信、電力,、軌道交通等領(lǐng)域得到了較為廣泛的應(yīng)用[5-8],。但也正因?yàn)槠涫跁r(shí)精度高,使得對(duì)PTP授時(shí)設(shè)備授時(shí)精度的測(cè)量就顯得更為困難,。PTP授時(shí)精度從理論上來(lái)說(shuō)主要受兩方面的影響,,一方面是打時(shí)間戳的位置,另外是軟件同步的算法,。打時(shí)間戳目前可以在物理層,、數(shù)據(jù)鏈路層和應(yīng)用層上進(jìn)行,對(duì)應(yīng)的授時(shí)精度會(huì)依次降低[9-10],。目前主流的PTP授時(shí)設(shè)備均是基于Linux系統(tǒng)的,,而Linux系統(tǒng)為非實(shí)時(shí)操作系統(tǒng),中斷響應(yīng)時(shí)間在微秒級(jí)以上,,其無(wú)法獲得精確的時(shí)間戳,,即便是使用了其他算法,測(cè)量精度也在100 μs以上[11],,無(wú)法對(duì)PTP測(cè)量[12-14],。相對(duì)Linux系統(tǒng)而言,μCOS為實(shí)時(shí)操作系統(tǒng),,能夠獲得更準(zhǔn)確的時(shí)間,,可以用μCOS系統(tǒng)加LWIP協(xié)議棧來(lái)實(shí)現(xiàn)PTP精度測(cè)量。




本文詳細(xì)內(nèi)容請(qǐng)下載:http://forexkbc.com/resource/share/2000003586,。



作者信息:

宋  艷1,,應(yīng)斌杰1,楊成鋼1,,郝自飛1,,毛立振2

(1.國(guó)網(wǎng)浙江省電力有限公司 麗水供電公司,浙江 麗水316021,;2.杭州量泓科技有限公司,,浙江 杭州310019)




wd.jpg


此內(nèi)容為AET網(wǎng)站原創(chuàng),,未經(jīng)授權(quán)禁止轉(zhuǎn)載。