机械臂本科生毕业设计(论文)范文 下载本文

基于STM32的机械臂驱动系统设计

摘 要

由于机械臂在各行各业中得到了愈来愈广泛的应用,机械臂控制的多样化、复杂化的需要也随之日趋增多。作为当今科技领域研究的一个热点,提高机械臂的控制精度、稳定性、操作灵活性对于提高其应用水平有着十分重要的意义。

本课题主要对四自由度机械臂控制系统进行了研究与设计。作为运动控制系统的一种,该控制系统主要面向底层,力争开发出一套稳定性高,可靠性强并且定位准确的工业机械臂系统。

首先根据机械臂系统的控制要求,整体上设计出单 CPU 的系统控制方案,即通过控制主控制器输出的 PWM 波的占空比实现对舵机转动的控制,进而实现各个关节的位置控制。在硬件方面,主要论述了如何以 ARM 微处理器STM32F103ZET6、MG995舵机、MG945舵机、超声波传感器和电源模块为主要器件,通过搭建硬件平台和设计软件控制程序构建关节运动控制系统。然后按照结构化设计的思想,依次对以上各部分的原理和设计方法进行了分析和探讨,给出了实际的原理图和电路图。在软件设计方面,按照模块化的设计思想将控制程序分为初始化模块和运行模块,并分别对各个模块的程序进行设计。

实验表明,该机械臂控制系统不仅具有很好的控制精度,还具有很好的稳定性、准确性,而且在很大程度上改善了定位精度。

关键词:四自由度机械臂,STM32,Cortex-M3,脉冲宽度调制

the Design of Manipulator Drive System Based on STM32

Author:XXX

Tutor:XXX

Abstract

In recent years, robot arm is widely used in industry control, special robot, medical device and home service robots. Research of robot arm control system is a focus in robot area. It is meaningful to increase the performance in accuracy, stability and feasibility.

This paper is the research and design about a control system based on a four degrees freedom’s design. And, we strive to develop a high stability, reliability and accurate control system.

Firstly, according to the control requirements of the robotic system, the overall design of the system control program is based on a single CPU. Turn the steering control to achieve the control of the duty cycle of the PWM wave output by the main controller, so as to realize the position control of each joint. In terms of hardware, the paper mainly discusses how to use the ARM microprocessor STM32F103ZET6, MG995 Servo, MG945 servos, ultrasonic sensors and power supply module as the main components, build a joint motion control system by building hardware platforms and software control program. Then follow the structured design ideas, principles and design methods sequentially over each part is analyzed and discussed, and then give the actual schematic or circuit diagram. In software design, the control program is divided into the run modules and the initialization module and design program of each module separately.

Control system experiments show that the system can significantly improve the precision of control, and improve system stability, accuracy, so that the positioning accuracy of the robot arm has been greatly improved and enhanced.

Key Words: Four Degrees Freedom Robot, STM32, Cortex-M3, Pulse Width Modulation

东北大学秦皇岛分校毕业设计(论文) 第 XI 页

目 录

1绪论 ........................................................................................................................................ 1 1.1机械臂概述 .................................................................................................................... 1 1.1.1机械臂研究的意义 ................................................................................................ 1 1.1.2国内外机械臂的研究现状及发展趋势 ................................................................ 1 1.1.3机械臂的分类 ........................................................................................................ 2 1.2机械臂控制的研究内容 ................................................................................................ 4 1.2.1机械臂的驱动方式 ................................................................................................ 4 1.2.2机械臂的机械结构 ................................................................................................ 4 1.2.3机械臂的控制器 .................................................................................................... 4 1.2.4机械臂的控制算法 ................................................................................................ 5 1.3嵌入式系统简介 ............................................................................................................ 5 1.4本文的主要工作 ............................................................................................................ 6 2机械臂控制系统的总体方案设计 ........................................................................................ 7 2.1机械臂的机械结构设计 ................................................................................................. 7

2.1.1臂部结构设计原则 ................................................................................................ 7 2.1.2机械臂自由度的确定 ............................................................................................ 7 2.2工作对象简介 ................................................................................................................. 7 2.3机械臂关节控制的总体方案 ......................................................................................... 8

2.3.1机械臂控制器类型的确定 .................................................................................... 8 2.3.2机械臂控制系统结构 ............................................................................................ 9 2.3.3关节控制系统的控制策略 .................................................................................... 9 2.4本章小结 ......................................................................................................................... 9 3机械臂控制系统硬件设计 .................................................................................................. 11 3.1机械臂控制系统概述 ................................................................................................... 11 3.2微处理器选型 ............................................................................................................... 11 3.3主控制模块设计 ........................................................................................................... 13

3.3.1电源电路 .............................................................................................................. 13 3.3.2复位电路 .............................................................................................................. 14 3.3.3时钟电路 .............................................................................................................. 15 3.3.4 JTAG调试电路 ................................................................................................... 15 3.4驱动模块设计 ............................................................................................................... 16 3.5电源模块设计 ............................................................................................................... 17 3.6传感器模块设计 ........................................................................................................... 19

东北大学秦皇岛分校毕业设计(论文) 第 XII 页

3.7本章小结 ....................................................................................................................... 19 4机械臂控制系统软件设计 .................................................................................................. 20 4.1初始化模块设计 ........................................................................................................... 20

4.1.1系统时钟控制 ...................................................................................................... 20 4.1.2 SysTick定时器 .................................................................................................... 22 4.1.3 TIM定时器 .......................................................................................................... 23 4.1.4通用输入输出接口GPIO .................................................................................... 24 4.1.5超声波传感器模块 .............................................................................................. 24 4.2运行模块设计 ............................................................................................................... 25 4.3本章小结 ....................................................................................................................... 26 5 系统的整机调试 ................................................................................................................. 27 5.1硬件调试 ....................................................................................................................... 27 5.2软件调试 ....................................................................................................................... 28 5.3故障原因及解决方法 ................................................................................................... 31 5.4本章小结 ....................................................................................................................... 32 结 论 ................................................................................................................................. 33 致 谢 ................................................................................................................................. 34 参考文献 ................................................................................................................................. 35 附 录 ................................................................................................................................. 37 附录A ................................................................................................................................ 37 附录B ................................................................................................................................ 46 附录C ................................................................................................................................ 47