§ 瀏覽學位論文書目資料
  
系統識別號 U0002-2707202117071600
DOI 10.6846/TKU.2021.00751
論文名稱(中文) 以Matlab/Simulink搭配Pixhawk平台實現PID控制器控制無人飛行載具
論文名稱(英文) Implementation of PID Controller on UAV Control in the Pixhawk Collaborated with Matlab/Simulink
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 航空太空工程學系碩士班
系所名稱(英文) Department of Aerospace Engineering
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 109
學期 2
出版年 110
研究生(中文) 張嘉
研究生(英文) Chia Chang
學號 608430228
學位類別 碩士
語言別 繁體中文
第二語言別
口試日期 2021-06-22
論文頁數 77頁
口試委員 指導教授 - 蕭富元
委員 - 馬德明
委員 - 呂文祺
關鍵字(中) 無人飛行載具
PID Controller
Ziegler–Nichols Method
Matlab/Simulink
Datcom
關鍵字(英) Unmanned Aerial Vehicle
PID Controller
Ziegler–Nichols Method
Matlab/Simulink
Datcom
第三語言關鍵字
學科別分類
中文摘要
本論文主要探討以 Matlab/Simulink 所設計的控制律,直接燒錄到 Pixhawk 後,其控制效能為何,目的在於降低實務化複雜控制律的門檻。一般來說,控制器的設計,經過理論分析、挑選參數之後,會進行數值模擬。若數值模擬效果良好,則會進入硬體實現階段。對於非電機背景的研究人員而言,將設計的控制器在硬體上實現,是個很大的門檻。而 Matlab/Simulink 可將設計好的控制模組,直接燒錄至 Pixhawk 中,對於較複雜的控制律實現,有莫大助益。
具體來說,本研究採用 PID 控制器來控制無人飛行載具,並透過 Matlab/Simulink 燒錄至 Pixhawk 的功能來實現並驗證本論文的設計成果。本研究首先針對市售的 Skysurfer 無人機進行建模,再使用 Datcom+ 軟體與相關理論,求出其動力學導係數。之後根據所求出的動力學模型與參數,應用 Ziegler Nichols 經驗法則挑選 PID 控制所需的參數值,並完成數值模擬,及搭配 X-plane 軟體進行軟體在環測試。本研究接著將設計好的 Simulink 模塊組直接燒錄至 Pixhawk,安裝至 Skysurfer 實機試飛。試飛結果顯示所設計的控制器完全能夠發揮作用。因此,本研究成果,對於較複雜的控制律實現,有效降低所需的技術門檻。
英文摘要
This thesis studies the effectiveness of control laws implemented in Pixhwak collaborated with Matlab/Simulink. The objective and potential contribution are to lower down the threshold of implementing a sophisticated control law. When developing a controller, one usually follow the procedure of controller design, parameters selection, and numerical simulations. Given good performance validated by numerical simulations, the design will be implemented in a hardware. For a researcher with non-electronic engineering background, implementation is quite challenging. The function of burning a Simulink model into Pixhawk did help a lot.
In specific, in this research a PID controller is designed to control an unmanned aerial vehicle (UAV), and implemented and validated by directly burning the controller built in Matlab/Simulink into Pixhawk. We first establish the dynamics model of the Skysurfer, a commercial UAV, and identify all the parameters by theories or datcom+ software. Then derivatives for dynamic model are derived. Given dynamic model and parameters, PID controllers with associated parameters for attitude control are designed by applying the Ziegler-Nichols rule. Numerical simulations and software-in-the-loop in the X-plane simulator are conducted as well. The  controller, designed and simulated in Matlab/Simulink, is then burned to Pixhawk directly, which later on was installed in the Skysurfer for flight tests. The flight tests have validated the effectiveness of our control law. As a result, our work presented in this thesis potentially contributes to lower down the threshold of implementing sophisticated control laws in the future.
第三語言摘要
論文目次
1 緒論 1
1.1 背景與研究動機 1
1.2 文獻回顧 2
1.3 研究方法 3
1.4 論文架構 4
2 建構飛行載具動態模型 5
2.1 飛行載具基本參數定義 5
2.2 分析氣動力導係數 7
2.2.1 飛行載具外型參數 7
2.2.2 Datcom+ 建模 7
2.2.3 計算狀態矩陣 11
2.3 計算特徵方程式 15
2.4 穩定性分析 17
2.4.1 縱向穩定性 17
2.4.2 橫向穩定性 18
3 控制器設計 20
3.1 俯仰(Pitch) 控制器增益 23
3.2 滾轉(Roll) 控制器增益 28
3.3 導引律設計 31
4 電腦模擬飛行32
4.1 Simulink 數據模擬 34
4.2 軟體在環(Software in the Loop, SIL)  38
4.3 硬體在環(Hardware in the Loop, HIL)  43
4.4 實機測試 49
4.4.1 接收器校正 49
4.4.2 實機測試步驟 51
5 實際飛行測試 53
5.1 第一次實際飛行測試 53
5.1.1 第一次飛行數據分析 55
5.2 第二次實際飛行測試 59
5.2.1 第二次飛行數據分析 60
6 結論與未來工作 65
6.1 結論 65
6.2 未來工作 65
附錄 67
參考文獻 77

圖目錄
圖1.1 研究流程圖 3
圖2.1 體固座標示意圖[1]  5
圖2.2 體固座標與慣性座標之關係[1]  6
圖2.3 Datcom+ Input file 9
圖2.4 Skysurfer 外型模型 10
圖2.5 Datcom+ Output file 10
圖2.6 縱向極點位置 18
圖2.7 橫向極點位置 19
圖3.1 PID 控制器閉迴路架構圖 20
圖3.2 俯仰控制器回授圖 21
圖3.3 滾轉控制器回授圖 21
圖3.4 設計控制器流程圖 23
圖3.5 俯仰未加控制器之內迴圈根軌跡 24
圖3.6 俯仰控制器內迴圈Step Response  24
圖3.7 俯仰未加控制器之外迴圈根軌跡 25
圖3.8 俯仰控制器外迴圈Step Response  26
圖3.9 滾轉未加控制器之內迴圈根軌跡 28
圖3.10 滾轉控制器外迴圈Step Response 28
圖3.11 滾轉未加控制器之外迴圈根軌跡 29
圖3.12 滾轉控制器外迴圈Step Response 30
圖3.13 不同象限之情況 31
圖3.14 同象限之情況 31
圖4.1 電腦模擬流程圖 32
圖4.2 縱向俯仰(Pitch)Simulink 模擬迴路 34
圖4.3 升降舵面反應 35
圖4.4 縱向俯仰Simulink 響應 35
圖4.5 橫向滾轉(Roll)Simulink 模擬迴路 36
圖4.6 副翼舵面反應 36
圖4.7 橫向滾轉Simulink 響應 37
圖4.8 UDP Receive Block 38
圖4.9 UDP Sender Block 38
圖4.10 軟體在環(SIL) 架構 39
圖4.11 軟體在環(SIL) 之控制器子方塊 39
圖4.12 軟體在環(SIL) 之升降舵面反應 40
圖4.13 軟體在環(SIL) 之副翼反應 40
圖4.14 軟體在環(SIL) 之q error  41
圖4.15 軟體在環(SIL) 之p error 41
圖4.16 軟體在環(SIL) 之θ error  42
圖4.17 軟體在環(SIL) 之ϕ error  42
圖4.18 915MHZ Radio Telemetry  43
圖4.19 UBLOX NEO-M8N GPS MODULE 44
圖4.20 Pixhawk 飛控電腦 44
圖4.21 T14SG 遙控器 45
圖4.22 R7008SB 接收器 45
圖4.23 硬體在環(HIL) 架構 46
圖4.24 硬體在環(HIL) 傳輸介面 47
圖4.25 CP2102  48
圖4.26 Roll 之PWM 訊號數值 49
圖4.27 Pitch 之PWM 訊號數值 50
圖4.28 Thrust 之PWM 訊號數值 50
圖4.29 Yaw 之PWM 訊號數值 51
圖4.30 地面站 52
圖5.1 Skysurfer  54
圖5.2 第一次飛行路徑 55
圖5.3 第一次試飛之手控與自控分辨 55
圖5.4 第一次試飛之副翼與滾轉姿態角關係 56
圖5.5 第一次試飛之滾轉角速度變化 56
圖5.6 第一次試飛之升降舵與俯仰姿態角關係 57
圖5.7 第一次試飛之俯仰角速度變化 57
圖5.8 第二次飛行路徑 60
圖5.9 第二次試飛之手控與自控分辨 60
圖5.10 第二次試飛之副翼與滾轉姿態角關係 61
圖5.11 第二次試飛之滾轉角速度變化 62
圖5.12 第二次試飛之升降舵與俯仰姿態角關係 63
圖5.13 第二次試飛之俯仰角速度變化 63

表目錄
表2.1 各物理量對體固座標系之定義符號 6
表2.2 Skysurfer 外型參數 7
表2.3 Datcom+ 指令與所代表意義 8
表2.4 有因次縱向偏導數 11
表2.5 有因次橫向偏導數 12
表2.6 縱向特性 17
表2.7 橫向特性 18
表3.1 PID 控制器參數調整 20
表3.2 Ziegler–Nichols 經驗法則 22
表3.3 控制器設計目標 22
表3.4 俯仰控制器內迴圈反應數據 25
表3.5 俯仰控制器外迴圈反應數據 26
表3.6 俯仰控制器微調前後增益值 27
表3.7 滾轉控制器內迴圈反應數據 29
表3.8 滾轉控制器外迴圈反應數據 30
表3.9 滾轉控制器微調前後增益值 30
表5.1 第一次實際飛行測試天氣狀況 53
表5.2 第一次實際飛行之控制器增益值 54
表5.3 第一次實際飛行測試天氣狀況 59
表5.4 第二次實際飛行之控制器增益值 59
參考文獻
[1] R. C. Nelson et al., Flight stability and automatic control, vol. 2. WCB/McGraw Hill New York,1998.
[2] 郭軒煒, “Autonomous flight of drones using pixhawk collaborated with matlab/simulink.,” 淡江大學航空太空工程學系碩士班學位論文, 2019.
[3] 楊憲東, 自動飛行控制-原理與實務. 全華圖書股份有限公司, 2019.
[4] M.-L. Roy and S. M. Sliwa, “A computer program for obtaining airplane configuration plots from digital datcom input data,” 1983.
[5] B. Galbraith, Datcom+ Pro User's Manual. Holy Cows, Inc., Lake Drawdy Drive, 3 ed.
[6] S. Bagheri, “Modeling, simulation and control system design for civil unmanned aerial vehicle (uav),” 2014.
[7] J. H. Blakelock, Automatic control of aircraft and missiles. John Wiley & Sons, 1991.
[8] S. Yang, K. Li, and J. Shi, “Design and simulation of the longitudinal autopilot of uav based on self-adaptive fuzzy pid control,” in 2009 international conference on computational intelligence and security, vol. 1, pp. 634–638, IEEE, 2009.
[9] M. A. A. Osman, H. E. A. Abdalla, and M. O. Nawari, “Lateral and longitudinal controllers design for a fixed wing uav,” in 2019 International Conference on Computer, Control, Electrical,and Electronics Engineering (ICCCEEE), pp. 1–6, IEEE, 2019.
[10] S. D. Jenie and A. Budiyono, “Automatic flight control system,” Lecture notes for Malaysian Institute of Aviation Technology, 2006.
[11] P. Poksawat, L. Wang, and A. Mohamed, “Gain scheduled attitude control of fixed-wing uav with automatic controller tuning,” IEEE Transactions on Control Systems Technology, vol. 26, no. 4, pp. 1192–1203, 2017.
[12] 鄭學懋, 任務型無人飛行載具自主飛行與驗證. PhD thesis, 2013.
[13] 林安德, “Simulation of a tailless unmanned aerial vehicle,” 淡江大學航空太空工程學系碩士班學位論文, 2020.
論文全文使用權限
校內
校內紙本論文立即公開
同意電子論文全文授權校園內公開
校內電子論文立即公開
校外
同意授權
校外電子論文立即公開

如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信