{$cfg_webname}
主页 > 电子信息 > 单片机 >

基于单片机的PWM直流可逆调速系统设计

来源:wenku163.com  资料编号:WK16314205 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9AWK16314205
资料介绍

基于单片机的PWM直流可逆调速系统设计(任务书,开题报告,外文翻译,论文16000字)
摘要
这次毕业设计主要是正对电瓶供电的直流电机进行控制设计,要达到控制电机正传、反转、停止、加速、减速的目的。本次毕业设计的核心思路是通过对PWM的占空进行控制,以达到控制电机的转速,通过电机驱动芯片L298N中的H型电桥的电流方向来控制电机。通过将PWM输入电机的使能端来控制电机供电的通断达到控制电机的转速。通过向L298N中输入基极电流来控制L298N中三极管的导通顺序,从而达到控制芯片内的电流方向的目的,最终达到间接控制电机的转动方向作用。
本次课程设计中主电路部分为电机的控制电路,通过L298N控制电机,用4个二极管组成泄放回路,来控制电机的稳定性,并且协助保护电路达到限制电机过压的作用。本次课程设计的辅助电路主要分为以51单片机AT89C52为核心辅助电路,和以霍尔电流传感器ACS758为主的保护电路。辅助电路主要实现PWM波形的产生,以及显示电路,按键扫描控制电路。保护电路主要是对电机的电枢电流进行检测,将检测得到的型号通过A/D转换电路传回AT89C52进行处理,如果电机发生短路产生过高的的电流,一般为2.5倍,则将单片机产生的PWM输出占空比调为0,由此可以是L298N逻辑锁死,不输出功率,使电机停转,实现保护的目的。

关键词:STC89C52,L298N,PWM调速,霍尔电流传感器

ABSTRACT
This graduation design is mainly to control the design of the battery-powered DC motor, and to achieve the purpose of controlling the motor's forward, reverse, stop, acceleration, and deceleration. The core idea of this graduated design is to control the PWM duty cycle so as to control the rotation speed of the motor, and to control the motor through the motor drive chip L298N. By controlling the input end of the PWM input motor to control the on and off of the motor power supply, the speed of the motor is controlled. By controlling the turn-on sequence of the transistor in the L298N, the current direction in the chip is controlled, and finally the steering effect of the motor is controlled.
The main circuit part of this course is the control circuit of the motor. It controls the motor through L298N and uses 4 diodes to form a bleeder circuit to control the stability of the motor and assist the protection circuit to limit the motor over-voltage . The auxiliary circuits designed in this course are mainly divided into 51 single-chip AT89C52 as the core auxiliary circuit and the Hall current sensor ACS758 as the main protection circuit. The auxiliary circuit mainly realizes the generation of the PWM waveform, as well as the display circuit and the key scan control circuit. The protection circuit is mainly to detect the armature current of the motor, and the detected model is sent back to the AT89C52 through the A/D conversion circuit for processing. If the motor is over-current, the PWM output duty ratio of the single-chip microcomputer is adjusted to 0 to make the motor Stop. To achieve the protective effect.

Keywords:  STC89C52, L298N, PWM speed regulation, Hall current sensor

1.3 研究的内容和方法
本次毕业设计主要的内容是基于单片机设计出一个电瓶供电的直流单机的控制电力,要求达到通过4个按键控制电机的正传、反转、停止、加速和减速。
本次课程设计的主要实现方法是通过编写程序控制51单片机AT89C52芯片产生PWM波形,将才产生的PWM波形输入电机驱动芯片L298N中,通过L298芯片驱动电机,利用其中的H桥控制直流电机的工作方式,通过数码管将电机的速度等级显示出来,并且通过霍尔元件设计相应的保护电路,以组成一个完整的电机控制电路。
本次毕业设计主要通过两个方面讲述电机的控制方式:硬件部分和软件部分。硬件部分采用单片机AT89C52芯片进行控制,软件部分使用的适C语言的环境。程序主要分为4块:1按键扫描程序,2数码管LED显示程序,3电机控制程序,4过流保护模块。硬件部分则是分为以下几块:1数码管显示电路,2按键扫描电路、3电机驱动电路,4保护电路。用数码管直观的显示出电机速度等级,以方便能控制,按键方面主要分为4个按键,分别控制电机的加速、减速、正反装切换,以及停止。用来控制电机的工作状态。
第2章 系统总体设计方案
2.1 主控制芯片的选择
单片机芯片的种类有许多,现阶段我们有很多的选择。相对于52单片机来说,51单片机的设计比较简单,不用考虑太复杂的因素,所以我们选择51单片机作为本次课程十几的主控芯片。考虑到本次课程设计的程序不多,并且功能简单,所以我们选择比较便宜的AT89C52芯片进行控制。
采用AT89C52单片机作为为控制,AT89C52单片机兼容性比较高,我们可以用C语言作为程序设计的环境。同时51单片机是一个比较基础的单片机,非常适合我们新手使用。同时AT89C52芯片在现在有着非常广泛的运用,比较容易查询到相关的技术资料。51单片机的价格很低,设计出来的控制电路比较适合批量式的生产。
单片机有很多的封装形式,现在主要有5种:①DIP双列直插式封装、②PLCC带引线的塑料芯片封装、③QFP塑料方形扁平式封装、④PGA插针网格列阵封装、⑤BGA球删列阵封装。本次设计时为了组装方便,我选择DIP双列直插式封装方式的AT89C52芯片作为主控芯片。
 

基于单片机的PWM直流可逆调速系统设计
基于单片机的PWM直流可逆调速系统设计
基于单片机的PWM直流可逆调速系统设计
基于单片机的PWM直流可逆调速系统设计
基于单片机的PWM直流可逆调速系统设计


目录
摘要    I
ABSTRACT    II
目录    III
第1章 绪论    1
1.1设计的目标和意义    1
1.2研究的现状和背景    2
1.3 研究的内容和方法    4
第2章 系统总体设计方案    5
2.1 主控制芯片的选择    5
2.2 显示电路的比较与选择    5
2.3 电机调速控制模块    6
2.4 电源电路与电机驱动电路    7
2.5 保护电路    7
第3章 系统硬件方案设计    8
3.1 系统总电路框图设计    8
3.2 系统各模块电路的设计及原理    8
3.2.1单片机最小系统设计    8
3.2.2直流电机的调速方式设计    10
3.2.3 数码管显示电路设计    10
3.2.4 L298N驱动电路设计    12
3.2.5 按键电路电路设计    14
3.2.6 保护电路设计    15
第4章 系统的软件设计    18
4.1 系统的整体程序流程图    19
4.2 数码管LED显示程序设计    19
4.3 电机控制子程序    20
4.4 按键处理子程序    21
4.5 标志符处理子程序    22
4.6 电机保护子程序    22
第5章 系统调试和仿真    23
5.1 常见的故障分析    23
5.2 系统调试注意事项    23
5.3 系统仿真    23
结论    28
致谢    29
参考文献    30
附录一 硬件原理图    32
附录二 程序源代码    33

推荐资料