摘 要: 针对现代工业生产中运动控制卡高速化、高精化的技术要求,设计了一种基于小型嵌入式网络协议栈LwIP的多轴运动控制卡网络通信系统。系统以STM32H7微控制器为主控芯片,以低功耗芯片LAN8720A作为外部以太网PHY层芯片,采用TCP/IP网络协议栈中的UDP协议作为上下位机间通信协议。通信系统的下位机程序采用基于LwIP协议栈的RAW API方式编写,上位机程序基于SOCKET套接字接口编写。测试结果表明:系统能达到既定要求的通信响应速度,可实现单台工控上位机与多块运动控制卡之间“一对多”的主从式高速通信,具有较高的工业实用价值。 |
关键词: 嵌入式;LwIP;UDP;网络通信;多轴运动控制卡 |
中图分类号: TP23
文献标识码: A
|
基金项目: 浙江省自然科学基金资助项目(LY18E050016);国家重点研发计划资助项目(2017YFB1304000);教育部人文社科规划基金项目(20YJA72040002). |
|
Design of Communication System for Multi-axis Motion Control Card based on Embedded Network Protocol Stack |
YANG Liangliang1,2,HUANG Kun1,ZHANG Limin3,SHI Weimin1
|
( 1.Faculty of Mechanical Engineering & Automation, Zhejiang Sci-Tech University, Hangzhou 310018, China; 2.Mstar Technologies, Inc., Hangzhou 311121, China ; 3.Zhongnan University of Economics and Law, Wuhan 430073, China)
yangliangliang@zstu.edu.cn; 2522823811@qq.com; zhanglimin1979@163.com; swm@zstu.edu.cn
|
Abstract: This paper proposes to design a multi-axis motion control card network communication system based on the small-scale embedded network protocol stack LwIP (Light Weight Internet Protocol), in order to meet the high speed and high-precision technical requirements of motion control cards in modern industrial production. The system uses STM32H7 microcontroller as main control chip, low-power chip LAN8720A as external Ethernet PHY (Physical Layer) chip, and UDP (User Datagram Protocol) in TCP (Transmission Control Protocol)/IP (Internet Protocol) network protocol stack as communication protocol between upper and lower computers. Lower computer program of the communication system is written in RAW API method based on the LwIP protocol stack, and upper computer program is written based on the SOCKET interface. Test results show that the proposed system can reach the required communication response speed. It also realizes the one-to-many master-slave high-speed communication between a single industrial control host computer and multiple motion control cards. The proposed system has high industrial practical value. |
Keywords: embedded; LwIP; UDP; network communication; multi-axis motion control card |