Pico Auto Diagnostic Cases] 2012 Focus Scirocco Engine Occasionally Doesn't Start Failure Case

Honghong Diagnostics | 2012 Volkswagen Scirocco Engine Occasionally Fails to Start Failure Case Honghong Diagnostics | 2012 Volkswagen Scirocco Engine Occasionally Fails to Start Failure Phenomenon A 2012 Volkswagen Sc...

Continue ReadingPico Auto Diagnostic Cases] 2012 Focus Scirocco Engine Occasionally Doesn't Start Failure Case

Honghong Case|MSR165 Shock and Vibration Recorder for Art Transportation Safety

I. Introduction With the increasing scale of global artwork circulation across regions, how to ensure the safety of these high-value works in the transportation process has become the most concerned issue among museums, auction houses and professional logistics operators. However, fragile works such as oil paintings are not always safe during transportation, loading and unloading, truck driving on bumpy roads or airport cargo handling...

Continue ReadingHonghong Case|MSR165 Shock and Vibration Recorder for Art Transportation Safety
Read more about the article 宏虹分享|Lepide 即時審計:強化 Active Directory 密碼安全,防止弱密碼風險
Glowing Digital Padlock Icon with Neon Blue Lights on Futuristic Dark Background with Streaming Data Flows Cybersecurity Encryption and Privacy Concept

Honghong Shares|Lepide Real-Time Audit: Enhance Active Directory Password Security to Prevent Weak Password Risks

前言 Active Directory (AD)密碼策略是企業資安管理之中,維護帳號安全與身分驗證的關鍵基礎。當組織面臨憑證填充、暴力破解,以及日益嚴格的資安合規要求時,更需要採取高效率的密碼管理與持…

Continue ReadingHonghong Shares|Lepide Real-Time Audit: Enhance Active Directory Password Security to Prevent Weak Password Risks

Honghong Shares 丨 Car Ethernet gPTP Time Synchronization Complete Guide: From Protocol Principle to Practical Application

preamble

車載乙太網 gPTP 時間同步是自駕車與智慧汽車中不可或缺的基礎技術,你知道為什麼自駕車需要精確到 ±50ns 的時間同步嗎?在傳統 CAN 匯流排中,毫秒等級的同步精度足以支援一般控制訊號,但在自動駕駛的場景下卻遠遠不足。舉例來說,當車輛以 120 km/h 行駛時,僅 1 ms 的時間偏差,就可能造成 3.3 公分的空間誤差,直接影響感測器融合線控底盤協同的可靠性。

為了解決這一問題,車載以太網 gPTP(Generalized Precision Time Protocol) 應運而生。它能提供 ±50ns 的同步精度,為雷射雷達、攝影機、毫米波雷達 等多感測器建立統一的「時間錨點」,確保資料融合與車輛決策的安全性。

gPTP 協定優化特點

相較於工業場景常見的PTP(IEEE 1588),gPTP 針對車用環境做了三項關鍵最佳化

1.簡化 BMCA(最佳主時鐘演算法)

降低主從切換頻率,避免車載網路因拓撲頻繁變化而產生不穩定。

2.固定的訊息間隔

Sync 預設 125ms、Pdelay_Req 預設 1s,在確保精度的同時,減少對頻寬的佔用。

3.增強的時間戳機制

透過網卡硬體直接產生時間戳,降低電磁干擾對軟體時間戳的影響,提升精準度。

Linux PTP 工具鏈

簡單來說,LinuxPTP 並不是單一工具,而是一套模組化的時間同步解決方案。它的核心組件主要包含ptp4l、phc2sys 與 pmc,各自扮演不同角色:

  • ptp4l:是 gPTP 協定的核心實作,負責主/從時鐘角色的協商、時間訊息的收發、延遲量測與時鐘校正。支援邊界時鐘(BC) 與 普通時鐘(OC)兩種模式,能夠適配車載乙太網的層級拓撲架構。

  • phc2sys:用來解決硬體時鐘(PHC, Physical Hardware Clock)與作業系統時鐘(OS Clock)不同步的問題。由於車載 ECU 常同時具備 PHC 與系統時鐘兩個計時來源,phc2sys 透過 PI 調節演算法,將兩者偏差穩定控制在 10ns 以內。

  • pmc:作為 PTP 管理客戶端,可用來查詢時鐘狀態(例如 GET TIME_STATUS_NP)、修改參數設定(如 SET PORT_PROPERTIES),相當於調試與監控過程中的「可視化窗口」。

以上這套工具鏈的一大優勢,是針對車載應用場景的適配性。它內建 automotive-master.cfg 與 automotive-slave.cfg 設定檔,預設已符合 IEEE 802.1AS-2011 標準 的關鍵參數(例如 transportSpecific=0x1、ptp_dst_mac=01:80:C2:00:00:0E),讓工程師無需從零開始調校,大幅降低時間同步部署的複雜度與成本

gPTP 工程實務

  • 時間同步硬體選型

在從協定走向實際應用的過程中,gPTP 首先需要確保硬體能滿足「時間敏感」特性,核心指標如下:

  • PHC 硬體時鐘:必須支援 IEEE 1588 硬體時間戳,才能確保時間基準的高精度。

  • 網卡驅動:需支援 SOF_TIMESTAMPING_TX_HARDWARESOF_TIMESTAMPING_RX_HARDWARE 兩項標誌,確保收發時間戳由硬體直接產生,而非透過軟體計算,以避免軟體堆疊延遲造成的誤差。工程師可透過 ethtool -T eth0 指令進行驗證。

主從時鐘配置要點

在車載乙太網架構中,時間同步採用「主從架構(Master-Slave)」。其核心是透過設定檔(Configuration File) 明確定義各節點角色與行為邊界。

如以下示意案例,以工業電腦(IPC) 搭建的車載網路,就能完成 gPTP 時間同步的基本配置:

主時鐘配置(automotive-master.cfg)

通常部署在域控制器或中央閘道器,需重點配置:

  • gmCapable=1:聲明具備「全局主時鐘(GM)」能力;

  • masterOnly=1:強制為主模式,避免 BMCA 演算法導致的角色切換;

  • logSyncInterval=-3:同步訊息間隔設為 125ms(2^-3 秒),平衡精度與頻寬;

  • delay_mechanism=P2P:採用點對點延遲機制,減少多節點級聯的誤差累積。

啟動命令需指定介面與設定檔:

sudo ptp4l -i eth0 -f automotive-master.cfg -m

-m 參數用於輸出詳細日誌,便於調試)

從時鐘設定(automotive-slave.cfg)

通常部署在感測器節點、致動器 ECU,關鍵設定包括:

  • slaveOnly=1:固定為從模式,避免搶占主時鐘角色;

  • step_threshold=1:允許時間跳變校準(初始同步階段);

  • servo_offset_threshold=30:當偏差超過 30ns 時啟動 PID 調整;

  • ignore_source_id=1:忽略主時鐘來源 ID 變化,提升容錯性。

啟動後需透過 pmc 指令 驗證同步狀態:

(more…)

Continue ReadingHonghong Shares 丨 Car Ethernet gPTP Time Synchronization Complete Guide: From Protocol Principle to Practical Application

Hong Hong Shares | CAN XL Standard Released! Kvaser Enables Third Generation CAN Buses for Efficient Communication Solutions

Introduction With the rapid development of automotive electronics and industrial automation, the CAN protocol has evolved. 2024 saw the publication of the ISO 11898-1/2:2024 standard, announcing CAN XL (Controller Area Network eX...

Continue ReadingHong Hong Shares | CAN XL Standard Released! Kvaser Enables Third Generation CAN Buses for Efficient Communication Solutions