基于单摆的平衡系统设计 下载本文

内容发布更新时间 : 2024/7/8 8:02:29星期一 下面是文章的全部内容请认真阅读。

摘 要

本设计采用单片机AT89S52作为控制核心,辅以步进电机、键盘、LCD显示、LED显示、角度传感器数据采集等电路组成,实现自由摆平板平衡控制、角度控制等功能。摆杆角度的采集我们创新地采用了MMA745微加速度计,针对单摆这一特殊物理过程来实现加速度与角度的转换。平板控制电机直流电机,电机控制使用了模糊控制的控制算法,简化程序,减少超调量和静态误差。系统能源采用容量大、无污染、价格可以承受的镍氢充电电池。整个系统从控制到传感低功耗、高性能,能源环境友好,角度显示界面用户友好,在较好的完成要求功能同时突出了以人为本,低碳生活的时代主题。

关键词:单片机AT89S52,平板控制,微加速度计,自由摆,低功耗

Abstract

This design uses a microcontroller AT89S52 as the control core, supplemented by the stepper motor, keyboard, LCD display, LED display, the angle sensor data acquisition circuit, to achieve freedom settle the balance board control, angle control. Pendulum angle of collection of our innovative use of the MMA745 micro-accelerometer, physical process for the pendulum to achieve this particular acceleration and angle of the conversion. Plate using direct motor control .Motor control using fuzzy control algorithm to simplify procedures, reduce the overshoot and the static error. System energy use of large capacity, non-polluting, affordable nickel-metal hydride rechargeable batteries. The entire system from the control to the sensor low-power, high performance, energy and environment-friendly, user-friendly display interface point of view, the better to complete the requested function in the same time highlights the people-oriented, low-carbon life the theme of the times.

Key word: microcontroller AT89S52, flat control, micro-accelerometers, free swing, low power consumption

1

目 录

1. 系统方案????????????????????????????????3 1.1系统结构????????????????????????????????3 1.2方案比较与选择?????????????????????????????3 2 理论分析与计算??????????????????????????????6 2.1 平板状态测量方法????????????????????????????6 2.2建模与控制方法?????????????????????????????6 3 电路与程序的设计?????????????????????????????7 3.1电路设计????????????????????????????????7 3.2 程序结构与设计?????????????????????????????10 4 测试方案与测试结果????????????????????????????12 4.1 测试仪器????????????????????????????????12 4.2指标测试????????????????????????????????12 4.3 结论??????????????????????????????????13 5 总结???????????????????????????????????13 参考文献??????????????????????????????????13

2

1系统方案

1.1系统结构

根据题目要求,系统可以划分为控制系统和信号检测系统。其中信号检测系统包括:倾角测量模块,激光探测模块,无线收发模块。控制部分包括:电机驱动模块,LCD显示模块,控制器模块,功能选择模块,状态标志模块,模块框图如图1.1.1和1.1.2所示。为实现各模块的功能,分别作了几种不同的设计方案并进行了论证。

信号检测系统

图1.1.1 控制系统模块方框图

电机驱动 控制器 LCD显示 状态标志 功能选择 倾角测量模块

激光探测模块 无线发射模块 控制系统

图1.1.2 信号检测系统模块方框图

1.2方案比较与选择

(1)平板控制方式

方案一: 采用步进电机控制平板

步进电机是一种将电脉冲转化为角位移的执行机构。当步进驱动器接收到一个脉冲信号,它就驱动步进电机按设定的方向转动一个固定的角度。可以通过控制脉冲个数来控制角位移量,从而达到准确定位的目的;同时可以通过控制脉冲频率来控制电机转动的速度和加速度,从而达到调速的目的。 方案二:采用直流电机控制平板

3