APP下载

基于CAN总线的轮询通信系统设计

2019-08-13王高高王伟伟

计算技术与自动化 2019年4期

王高高 王伟伟

摘   要:针对传统CAN总线通信系统基于仲裁发送机制所存在的通信通道易堵塞、实时性、可靠性差问题,设计了CAN总线节点轮询通信系统。系统CAN总线通信机制为采用主从控制下的节点轮询方式。最后,通过实验完成了CAN轮询通信测试,结果表明,CAN通信实时性高,整机运行稳定、可靠。

关键词:CAN总线;节点轮询;STM32

中图分类号:TP393.1                                    文献标识码:A

Design of Polling Communication System Based on CAN Bus

WANG Gao-gao1 WANG wei-wei2

(1. Fengtai County Power Supply Co.,State Grid Anhui Electric Power Co.,Ltd.,Huainan,Anhui 232100,China;

2. The First Construction Co.,Ltd. of China Construction First Group,Hefei,Anhui 230031,China)

Abstract:Aiming at the problems of communication channel blockage,poor real-time and low reliability for traditional communication system of CAN bus based on arbitration transmission mechanism,a CAN bus node-polling communication system is designed. The communication mechanism of the system adopts node-polling of CAN bus under master-slave control. Finally,the CAN polling communication test is completed through the experiment. The results show that the CAN communication has a high real-time performance and the whole machine runs stably and reliably.

Key words:CAN bus;node polling;STM32

隨着社会经济发展,人们对多机通信的实时性、可靠性提出了更高的要求。相应的,总线通信技术也紧跟应用需求,得到了前所未有的发展[1,2]。

当前在多机通信领域,常用的控制方式为并行集中式和串行分布式两种架构,其中传统并行集中式通信系统为对主控制器引出多条并行式信号线,实现单个主控制器对多台从机运行的控制,这种控制模式通常存在信号线走线占体积大、整机同步性能差、易受干扰、扩展维护困难等一系列问题[3,4]。基于串行总线的多机通信系统,如CAN总线的应用,系统整体性能相对于并行集中式有很大的提升,通信线路少、整机结构简约、扩展能力强。然而,现行基于串行总线的多机同步通信、控制仍存在实时性、可靠性差等问题[5~7]。系统整机通信机制所存在的缺陷,严重阻碍了多机控制系统的发展与应用。针对上述多机通信技术层面与实际应用所存在的问题,本文给出了基于CAN总线的多机轮询控制系统,系统采用CAN总线实时通信算法,实现对多机运行的实时、同步控制。

1   系统架构

登录APP查看全文