电动助力车电机驱动系统设计 下载本文

内容发布更新时间 : 2024/5/5 2:44:05星期一 下面是文章的全部内容请认真阅读。

第 I 页

摘 要

电动助力车在当前石油资源短缺和环境污染的加剧的情况下,作为一种理想的“绿色”代步工具,其发展收到了人们的重视。电动助力车因其廉价、无污染、噪音低、操作简单等特点,俨然成为人们出行的优选。目前的电动助力车大多采用直流电机作为动力,其操作性和可靠性的优劣与电机驱动系统密切相关。

本课题详细介绍了电动助力车的电机驱动原理和霍尔传感器,以及STC公司的STC12C5A60S2单片机的性能和特点,并设计以STC12C5A60S2单片机控制模块为核心,由单片机控制电机驱动和操纵系统。该系统电机设计功能齐备、使用方便、经济实用、工作可靠、检测速度快、容易做到实时控制转速,并显示转速。本课题的研究内容主要有一下几个方面:

(1) 介绍了电动助力车电机驱动的相关技术,分析利用单片机对直流电机进行控制

的基本原理,分析利用传感器技术进行转速测量的方法;阐述电动助力车电机驱动系统的设计方案。

(2) 完成系统的硬件电路的设计,包括电机驱动电路与转速采集电路以及调速电路

的设计,单片机控制模块的设计与显示电路的设计。

(3) 编写系统软件程序并对各个模块进行调试。制作硬件样机,并进行系统性能的

分析。

关键词:单片机;电机驱动;PWM调速;LCD显示;转速测量

第 II 页

Abstract

In the case of oil resource shortages and environmental pollution, electric bicycle as a \low noise, easy operation and so on, electric bicycle seems to have become the preferred.At present mostly used DC motor for electric bicycle as the driving force, the quality of motor drive system operation and reliability are closely related.

This subject introduces the electric bicycle motor-driven principles and infrared and hall sensors, and the performance and characteristics of Atmel STC12C5A60S2 microcontroller, designed with STC12C5A60S2 microcontroller control module as the core, controlled by single-chip microcomputer drive and control system for motor.Motor function of the system is complete, easy to use, economical and practical, reliable, fast, easy real-time control speed, and speed is displayed.The contents of this subject are mainly the following aspects:

(1) Described motor drive for electric bicycle-related technology; described on control of DC motor by using single-chip microcomputer principle; described on electric bicycle motor driven system design.

(2) Described hardware design, including motor drive circuit and speed data acquisition circuits and speed control circuit design, and design of single-chip computer control module circuit design

(3) Writing system software program and debug each module, produced a hardware prototype, and analysis performance for the system.

KeyWords: MCU; Motor drive; PWM speed control; LCD display; speed measurement

目录

目录

摘要............................................................................................................................................ I Abstract ................................................................................................................................... II

1绪论 ........................................................................................................................................ 1 1.1课题背景,目的和意义 .................................................................................................... 1 1.2直流电机驱动系统的现状 ................................................................................................ 2 1.3直流电机驱动技术的发展方向 ........................................................................................ 2 1.4本章小结 ............................................................................................................................ 3 2 直流电机驱动系统......................................................................................................... 4 2.1 直流电动机 ....................................................................................................................... 4 2.2 PWM控制技术 ................................................................................................................. 4 2.2.1PWM脉宽调制技术 ..................................................................................................... 4 2.2.2PWM脉宽调制原理 ..................................................................................................... 5 2.3 直流电机PWM调速的基本原理 ................................................................................. 5 2.3.1直流电机基本工作原理 ............................................................................................... 5 2.3.2PWM电机调速原理 ..................................................................................................... 6 2.3.3采用PWM控制的电机调速方法 ............................................................................... 7 2.4 直流电机调速的PID算法 ............................................................................................ 7 2.5 总体方案设计 ................................................................................................................... 7 2.6 本章小结 ........................................................................................................................... 8 3 硬件系统设计 .................................................................................................................. 9 3.1 单片机最小系统 ............................................................................................................... 9 3.1.1单片机系统概述 ........................................................................................................... 9 3.1.2单片机STC12C5A60S2 ............................................................................................... 9 3.1.3复位电路和时钟电路 ................................................................................................. 11 3.2 供电电路 ......................................................................................................................... 12 3.3 显示电路 ......................................................................................................................... 13 3.4 电机驱动电路 ................................................................................................................. 14 3.4.1L298电机驱动模块 .................................................................................................... 15 3.4.2光电隔离保护电路 ..................................................................................................... 17 3.5 转速测量模块 ................................................................................................................. 18 3.6 按键控制电路 ................................................................................................................. 20 3.7 本章小结 ......................................................................................................................... 20 4 系统软件设计 ................................................................................................................ 21 4.1 主程序设计 ..................................................................................................................... 21 4.2 PID算法子程序 .............................................................................................................. 22