登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 理工学类 > 电气工程及其自动化 > 正文

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

 2021-04-14 10:04  

摘 要

这次毕业设计主要是正对电瓶供电的直流电机进行控制设计,要达到控制电机正传、反转、停止、加速、减速的目的。本次毕业设计的核心思路是通过对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

目录

摘要 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

第1章 绪论

1.1设计的目标和意义

(1)设计的目标

本次毕业设计主要是通过编写程序控制51单片机(AT89C52芯片)产生需要的PWM波形,并将产生的PWM波形输入电机驱动芯片(L298N)中,通过L298芯片驱动直流电机,利用其中的H桥控制直流电机的工作方式,通过数码管将电机的速度等级显示出来,并且通过霍尔元件设计相应的保护电路,以组成一个完整的电机控制电路。本次毕业设计主要是正对以24V电瓶为电源(12V到36V范围内可通用)的直流电机的控制。实现通过4个按键控制电机的正传、反转、停止、加速和减速。

本文主要通过两个方面讲述电机的控制方式:硬件部分和软件部分。硬件部分采用单片机AT89C52芯片进行控制,软件部分使用的适C语言的环境。程序主要分为几块:1按键扫描程序,2数码管LED显示程序,3电机控制程序,过流保护模块。硬件部分则是分为以下几块:1数码管显示电路,2按键扫描电路,3电机驱动电路,4保护电路。选择使用数码管直观的显示出电机速度等级,以方便能控制,按键方面主要分为4个按键,分别控制电机的加速、减速、正反装切换,以及停止。用来控制电机的工作状态。

(2)课程设计的意义

您需要先支付 80元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图