【正文】
本科畢業(yè)設(shè)計(jì)基于PID控制器的兩輪自平衡小車設(shè)計(jì)摘 要兩輪自平衡小車具有體積小、結(jié)構(gòu)簡(jiǎn)單、運(yùn)動(dòng)靈活的特點(diǎn),適用于狹小和危險(xiǎn)的工作空間,在安防和軍事上有廣泛的應(yīng)用前景。兩輪自平衡小車是一種兩輪左右平衡布置的,像傳統(tǒng)倒立擺一樣,本身是一種自然不穩(wěn)定體,其動(dòng)力學(xué)方程具有多變量、非線性、強(qiáng)耦合、時(shí)變、參數(shù)不確定性等特性,需要施加強(qiáng)有力的控制手段才能使其保持平衡。本文在總結(jié)和歸納國(guó)內(nèi)外對(duì)兩輪自平衡小車的研究現(xiàn)狀,提出了自己的兩輪自平衡小車軟硬件設(shè)計(jì)方案,小車硬件采用陀螺儀和加速度傳感器檢測(cè)車身的重力方向的傾斜角度和車身輪軸方向上的旋轉(zhuǎn)加速度,數(shù)據(jù)通過(guò)控制器處理后,控制電機(jī)調(diào)整小車狀態(tài),使小車保持平衡。由于陀螺儀存在溫漂和積分誤差,加速度傳感器動(dòng)態(tài)響應(yīng)較慢,不能有效可靠的反應(yīng)車身的狀態(tài),所以軟件使用互補(bǔ)濾波算法將陀螺儀和加速度傳感器數(shù)據(jù)融合,結(jié)合陀螺儀的快速的動(dòng)態(tài)響應(yīng)特性和加速度傳感器的長(zhǎng)時(shí)間穩(wěn)定特性,得到一個(gè)優(yōu)化的角度近似值。文中最后通過(guò)實(shí)驗(yàn)驗(yàn)證了自平衡小車軟硬件控制方案的可行性。關(guān)鍵詞:自平衡 互補(bǔ)濾波 數(shù)據(jù)融合 倒立擺Twowheeled Selfbalancing RobotMa Xuedong(College of Engineering, South China Agricultural University, Guangzhou 510642, China)Abstract:The twowheeled selfbalancing robot is small in mechanism, with simple structure and can make flexible motion, suitable for narrow and dangerous work space. So it has wide range of applications in security and military. The twowheeled selfbalancing robot is a natural unstable system. The device of this system is a parallel arrangement of two single wheels, like a traditional inverted pendulum. Its dynamics are multivariable, nonlinear, serious coupling and uncertain parameters etc. It must be exerted strong control to make it stable.In this paper, studies on twowheel selfbalancing vehicle at home and abroad are summarized. We designed the hardware and software of our twowheel selfbalancing vehicle. The car using rotational accelerometers, gyroscopes and acceleration sensors to detect body condition and the state in which the pitch change rate. The central processing unit calculate the appropriate data and instructions, and control the motor to achieve the body balancing. Because of gyro drift problems and Integral error with accelerometers and slow dynamic response of acceleration sensors. It can’t provide effective or reliable information to reflect the real state of its body. So we using plementary filter to fuse the data of two sensors, so that the inclination of its body can be approximated better.Finally, we verified the feasibility of the system’s hardware and software through experiment.Key Words: SelfBalancing plementary filter Data Fusion Inverted Pendui目 錄1 前言 1 研究意義 1 國(guó)內(nèi)外研究現(xiàn)狀 1 國(guó)外研究成果 1 國(guó)內(nèi)研究成果 1 本文的研究?jī)?nèi)容 22 兩輪平衡車的平衡原理 2 平衡車的機(jī)械結(jié)構(gòu) 2 兩輪車傾倒原因的受力分析 3 平衡的方法 33 系統(tǒng)方案分析與選擇論證 4 系統(tǒng)方案設(shè)計(jì) 4 主控芯片方案 4 姿態(tài)檢測(cè)傳感器方案 4 電機(jī)選擇方案 5 系統(tǒng)最終方案 54 主要芯片介紹和系統(tǒng)模塊硬件設(shè)計(jì) 6 加速度傳感器ADXL345 6 陀螺儀傳感器L3G4200D 8 主控電路 10 電機(jī)驅(qū)動(dòng)電路 11 供電電路 115 系統(tǒng)軟件設(shè)計(jì) 12 系統(tǒng)初始化 13 濾波器 14 低通濾波器 15 互補(bǔ)濾波器 15 PID控制器 17 PID概述 17 數(shù)字PID算法 17 PID控制器設(shè)計(jì) 186 硬件電路 19 硬件制作與調(diào)試 19 硬件調(diào)試結(jié)果 19 姿態(tài)感知系統(tǒng)測(cè)試結(jié)果 19 PID控制器測(cè)試結(jié)果 207 結(jié)論 21參考文獻(xiàn) 23附錄 24致謝 26華南農(nóng)業(yè)大學(xué)本科生畢業(yè)設(shè)計(jì)成績(jī)?cè)u(píng)定表I1 前言 研究意義應(yīng)用意義。自平衡車巧妙地利用地心引力使其自身保持平衡,并使得重力本身成為運(yùn)動(dòng)動(dòng)能的提供者,載重越大,行駛動(dòng)能也就越大,具有環(huán)保的特點(diǎn)(胡春亮等,2007)。駕駛者不必?fù)?dān)心掌握平衡,車體自身的平衡穩(wěn)定性,使得原本由于平衡能力障礙而無(wú)法騎自行車的人群也同樣可以駕馭。車身小巧,轉(zhuǎn)彎靈活,可以在狹窄、大轉(zhuǎn)角的工作場(chǎng)合作業(yè)。自平衡車的種種優(yōu)點(diǎn)使其可以作為一種快速、環(huán)保、安全、舒適、小巧靈活的綠色交通工具,是未來(lái)汽車和自行車的替代品,其市場(chǎng)的廣闊性與經(jīng)濟(jì)效益不言而喻。理論研究意義。自平衡車,在重力作用下車體姿態(tài)本征不穩(wěn)定,需要電機(jī)的控制來(lái)維持姿態(tài)的平衡,通過(guò)電機(jī)驅(qū)動(dòng)轉(zhuǎn)動(dòng)車輪,傳感器、軟件、微處理器及車體機(jī)械裝置整體協(xié)調(diào)控制電動(dòng)車平衡,是集環(huán)境感知、動(dòng)態(tài)決策與規(guī)劃、行為控制與執(zhí)行等多種功能于一體的綜合復(fù)雜非線性系統(tǒng),其控制難度大,控制算法復(fù)雜,給控制理論提出