摘 要
随着越来越多的高科技产品逐渐融入了日常生活中,舵机的控制系统发生了巨大的变化。单片机、C语言等前沿学科的技术的日趋成熟与实用化,使得舵机的控制系统有了新的的研究方向与意义。本文描述了一个由STM32微处理器、舵机、LCD显示器、键盘等模块构成的,提供基于STM32的PWM信号舵机的控制系统。该系统采用STM32微处理器为核心,在MDK的环境下进行编程,根据键盘的输入,使STM32产生周期性PWM信号,用此信号对舵机的速度及转角进行控制,并且通过LCD显示出数据。结果表明该系统具有结构简单、工作可靠、精度高等特点. 关键词:STM32微处理器;舵机系统;LCD显示;PWM信号
I
Abstract
As well as the high-tech products gradually integrated into the daily life, servo control system has undergone tremendous changes. SCM and C language of the frontier disciplines such mature technology and practical,Make steering control system is a new research direction and meaning. This paper describes a STM32 microprocessors, steering, LCD display and keyboard, etc. Based on the STM32 servo control system of PWM signal,This system uses STM32 microprocessor as the core, MDK in the environment, according to the keyboard input programming, STM32 produce periodic PWM signal, with this signal to the velocity and Angle of steering gear control, and through the LCD display data. The features of the simple hardware, stable operation and high precision are incarnated in the proposed system.
Keywords: STM32 microprocessors; Steering system; LCD display;pulse width modulation signal
II
目 录
第1章 绪 论 ..................................................................................................................... 1 1.1 课题背景 .................................................................................................................... 1 1.2 课题的研究展望 ........................................................................................................ 2 课题任务及要求 ............................................................................................................... 2 1.3 课题内容及安排 ........................................................................................................ 3 第2章 硬件设计 ................................................................................................................. 4 2.1 STM32微处理单元 .................................................................................................... 4 2.2 舵机............................................................................................................................. 8 2.3 LCD显示器 ................................................................................................................ 9 2.4 时钟电路的制作 ...................................................................................................... 10 第3章 软件设计 ............................................................................................................... 12 3.1 STM32固件库简介 .................................................................................................. 12 3.2 软件的总体设计 ...................................................................................................... 13 3.3 时钟初始化子程序 .................................................................................................. 14 3.4 I/O口初始化子程序 ................................................................................................. 16 3.5 PWM信号子程序 ..................................................................................................... 17 3.6 A/D转换初始化子程序 ............................................................................................ 18 3.7 LCD显示子程序 ...................................................................................................... 19 第4章 系统调试 ............................................................................................................... 21 4.1 调试方案 .................................................................................................................. 21 4.1.1 硬件调试方案 .................................................................................................... 21 4.1.2 软件调试方案 .................................................................................................... 21 4.2 故障调试及解决方法 .............................................................................................. 22 4.3 联调结果 .................................................................................................................. 22 结 论 ................................................................................................................................. 26 社会经济效益分析 ............................................................................................................. 27 参考文献 ............................................................................................................................. 28
III
致 谢 ................................................................................................................................. 29 附录I 电路原理图........................................................................................................... 30 附录Ⅱ 程序清单 ............................................................................................................... 35
IV
相关推荐: