摘 要
本文介绍了以单片机STC89C52RC为核心的基于CAN总线的步进电机控制系统设计的运作原理,其中结合了自动化专业的相关知识,控制系统包括硬件结构和软件控制。
本文首先阐述了CAN总线的发展背景及当前的发展概况,接着比较详细的描述了基于CAN总线的步进电机控制系统的组成及其各部分的工作原理。整体系统由电机本体、驱动控制电路、CAN通讯电路和单片机STC89C52RC组成,实现了开环控制。
本文也详细讲解了步进电机的概念,主要用途和发展方向,并且讲解了步进电机常用参数的意义和计算步进角的方法和驱动步进电机的常用脉冲方式。另外,本文详细讲解了CAN总线与主控单片机的接口设计,着重讲解了对SJA1000芯片的外围电路设计和驱动程序设计。通过本方案,实现了计算机通过CAN总线对步进电机进行开环控制,省去复杂的总线结构,节省了成本,降低了系统的复杂性,而且提高了稳定性,因此,基于CAN总线的步进电机控制系统具有很高的应用价值。
关键词:CAN总线;步进电机;半双工通讯;速度调节;开环控制
Abstract
This paper describes the principle of operation of a microcontroller core based STC89C52RC CAN bus stepper motor control system design, which combines the professional knowledge of automation control system including hardware and software control.
This paper describes the development background of CAN bus and the current development situation, followed by a more detailed description of the composition and working principle of each part of the stepping motor control system based on the CAN bus. Overall system consists of motor body, a drive control circuit, CAN communication circuits, and microcontrollers STC89C52RC composition to achieve the open-loop control.
This article also explained in detail the concept of a stepping motor, the main purpose and direction, and explained the common sense stepper motor pulse common parameters and calculation methods and step angle stepper motor drive. In addition, this paper explains the CAN bus interface to a host microcontroller design that focused on a pair SJA1000 chip peripheral circuit design and driver design. Through this program, to achieve a computer via CAN bus to the open-loop stepper motor control, eliminating the need for complex bus structures, cost savings and reduces the complexity of the system, but also improve the stability, therefore, based on the CAN bus steps stepping motor control system has a very high value.
Keywords: CAN bus; stepper motor; half-duplex communication; speed adjustment; open-loop control
目 录
摘 要 1
Abstract 2
1 绪论 1
1.1 CAN总线的发展背景及发展概况 1
1.1.1 CAN总线的发展背景 1
1.1.2 CAN总线的发展概况 2
1.2基于CAN总线的步进电机控制系统设计的研究意义 3
1.3 本文研究的主要内容 3
2基于CAN总线的步进电机控制系统整体方案设计及原理 5
2.1 基于CAN总线的步进电机控制系统的构成 5
2.2 步进电机的工作原理 6
2.3 步进电机的步进角的计算 8
3 基于CAN总线的步进电机控制系统的硬件设计 10
3.1电路整体设计 10
3.2单片机系统设计 11
3.3 CAN总线节点接口电路设计 13
3.4 步进电机驱动电路设计 17
3.5 步进电机 19
3.6步进电机转速指示器 22
4 基于CAN总线的步进电机控制系统软件设计 24
4.1软件总体设计 24
4.2 系统功能模块详细设计 24
4.3 单片机初始化 25
4.4 CAN初始化模块 25
4.5 CAN总线发送模块 26
4,6 CAN总线接收模块 27
4.7步进电机调速模块 29
5 试验及其结果分析 30
5.1硬件测试及其结果分析 30
5.2软件测试及其结果分析 30
总结与展望 32
参考文献 33
致 谢 35
附录 A 36
附录 B 37