摘 要 本文介绍了自整角机伺服电路的设计。该系统是采用89C51单片机作为核心控制器对直流电动机进行脉冲调宽控制,以达到对自整角机调速,确保自整角机按要求的角度或角速度信号正确输出。 核心控制器的主要组成由89C51单片机、键盘/显示芯片8279、可编程计数器/定时器8253以及自整角机角度转换器ZSZ-02;直流电机驱动电路由4只三极管及4只可控硅组成,完成直流电机的调速及正反转。本系统的主要工作流程是:按下功能键或数字键,键盘/显示芯片8279将其转换为相应的键值传送给CPU89C51,CPU89C51判断输入值是角度还角速度,是角度值则CPU向8253送出固定分频值,8253输出较低频率脉冲控制可控硅导通或断开,使直流电动机带动自整角机工作在低速情况下,自整角机输出变化的角度信号被自整角机角度转换器ZSZ-02变换为十六进制的角度值,当输入值与转换值一致时CPU控制8253输出低电平,使电动机停止转动,完成固定角度功能;如是角速度值,则CPU通过计算向8253送出相应分频值,使直流电动机带动自整角机按相应的角速度工作。 本系统的硬件电路采用Protel软件进行电路原理图和PCB印制板绘制及制作,并对电路板进行焊接调试;软件设计采用汇编语言完成的。 关键字:单片机;自整角机;直流电机;角度 ABSTRACT This text introduced the BS servo system, the design of the hardware. This system is right exportation that work to base on direct current electrical engineering adjust to control soon and from BS principle, adopt 89C51 MPU conduct and actions core controllers proceed the control to the direct current motive, reach to adjust soon purpose, complete the angle signal. Pass the function that study the core controller MCS89C51 and application, constituted to be adjusted by a keyboard/ showing controller 8279, arithmometer/timer 8253 and from ZSZ-02 as mainly controlling the slice of electrical engineering soon system. The finished function that this system want is: When keyboard/manifestation controller 8279 receive the flat-out signal come in from the keystroke to deliver namely to the CPU89C51,89C51 descend to reach to convert the instruction toward the 8253, make the arithmetic figure signal change of this importation as imitate the signal exportation, pass the power supply electric voltage of the changes direct current motive to control its turn soon。 The adoption Protel99SE electric circuit design software of this system proceeds to give or get an electric shock the principle diagram draws to print the design of the system plank electric circuit with the PCB; The adoption edits collected materials the software design that language complete system. Key word: MPU; BS; Direct current electrical motor; Angle 目 录 第一章 绪论 …………………………………………………………… 1 第二章 系统主体设计思路 …………………………… 4 2.1 设计要求 ………………………………………… 4 2.1.1 课题 ………………………………………… 4 2.1.2 设计技术要求…………………………………4 2.1.3 设计任务………………………………………4 2.2 系统的硬件设计思路………………………………4 2.3 系统软件设计思路 ………………………………… 5 第三章 电路板绘制软件PROTEL99SE介绍 ……… 7 3.1 新文件或文件夹的创建…………………………… 7 3.2 原理图的绘制……………………………………… 7 3.2.1 元件库的添加及元件的选择、摆放 ………… 7 3.2.2 元件的查询………………………………… 7 3.2.3 创建一个新的库元件 ……………………… 9 3.2.4 器件标称的重新注释……………………… 12 3.2.5 电气规则检查(ERC) ……………………… 12 3.2.6 创建网络表………………………………… 12 3.3 PCB印制板电路 ………………………………… 12 3.3.1 创建PCB库元件……………………………… 13 3.3.2 布局………………………………………… 14 3.3.3 布线…………………………………………… 16 第四章 硬件设计 ……………………………………… 21 4.1 键盘、显示电路 ………………………………… 21 4.1.1 可编程键盘显示接口8279的引脚功能 …… 21 4.1.2 8279的编程命令……………………………… 23 4.1.3 8279与单片机的接口……………………… 26 4.2 可编程计数器/定时器8253 ………………… 27 4.2.1 8253的引脚与功能结构…………………… 27 4.2.2 8279的工作方式………………………………30 4.3 D/A转换接口…………………………………… 33 4.3.1 概述…………………………………………… 33 4.3.2 工作原理……………………………………… 33 4.3.3 数据传输……………………………………… 34 4.3.4 管脚说明……………………………………… 36 4.3.5 应用…………………………………………… 37 4.3.6 接口电路……………………………………… 37 4.4 直流调速系统………………………………… 38 4.4.1 直流电动机的调速性能和方法……………… 39 4.4.2 位置随动系统中的位置检测装置……………………………… 40 第五章 软件设计………………………………………… 47 5.1 初始化程序设计…………………………………… 47 5.1.1 8279键盘中断程序…………………………… 49 5.1.2 8279显示子程序……………………………… 51 第六章 软硬件调试 …………………………………… 53 6.1 键盘显示电路的调试…………………………… 53 结 论 ……………………………………………………………55 参考文献……………………………………………………56 致谢………………………………………………………………57 [1] [2] 下一页 |