基于单片机的一级倒立摆控制器设计

课程设计报告

课程名称: 专业课程设计 专业班级:

学生姓名: 指导教师: 完成时间:

报告成绩:

评阅意见: 评阅教师 日期

基于单片机的一级倒立摆控制器设计 摘 要

直线一级倒立摆,是由沿直线导轨运动的小车以及一端固定于小车的匀质长杆组成的非线性的、不稳定的系统。系统以C8051F020单片机为主控芯片,包括电源模块、高精度电位器检测模块、L298N电机驱动模块、直流减速电机以及倒立摆本体构成。由高精度电位器检测模块测得小车的位置和摆杆相对垂直方向的角度,作为系统的两个输出量被反馈至单片机。单片机根据PID控制算法,计算出控制量,并转化为相应的电压信号提供给驱动电路,以驱动直流减速电机的运动,从而通过牵引机构带动小车的移动来控制摆杆和保持平衡。借助倒立摆的数学模型加入PID调节来控制它,从而使其成为稳定的系统,通过Matlab对仿真效果的分析,基本上达到了预期的效果。

关键词 一级倒立摆;微处理器;增量式PID;伺服电机;Matlab

I

基于单片机的一级倒立摆控制器设计 Abstract

Linear inverted pendulum system, is the movement of the carriage along the linear guide rail is fixed on the trolley and the uniformity of long rod composed of nonlinear, unstable.The system is mainly controlled by the microcontroller C8051F020, which comprises a power supply module, high precision potentio meter detection module, L298N motor drive module, DC motor and theinverted pendulum. A high precision potentiometer detection module measuredtrolley position and pendulum relative vertical angles, as the two output system isfeedback to the microcontroller. SCM based on PID control algorithm, calculates the volume control, and to provide a corresponding voltage signal to the drive circuit to drive DC motor, motor, and through the traction mechanism to drive thecar to control the movement and balance. With the help of a mathematical model of inverted pendulum with PID regulation to control it, so that it becomes a stable system, through the analysis of the simulation results of the Matlab, basically achieved the expected results.

Keywords: an inverted pendulum; microprocessor; incremental PID; servo motor; Matlab

II

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4