第六章 模擬與驗證
6.4 離散回授線性化控制器控制成效之數值模擬
由第五章得知,為因應現今較實際之數位控制器設計需求 ,一針 對車輛轉向系統控制之較實際離散時間控制法則 設計有其必要及適切 性。依據所使用離散模型之不同,本論文提出兩種不同之離散時間控 制法則設計:一為時變型式(5.7),另一為非時變型式(5.12)。在本章節,
紅線:輸入-狀態回授線性化控制 藍線;LQR控制
我們將驗證此兩種離散時間控制法則之控制成效。為能驗證所提出離 散時間控制是否能有效控制一實際之 車輛轉向系統,在下面模擬中我 們採用零階保持器(zoh),將離散控制輸出轉換成一連續控制輸出 。為 能同時比較連續與離散時間控制器控制效能 ,我們同時描繪出兩者之 系統反應,其中藍色線為 LQR 之輸出,而紅色線為所提出離散時間控 制法則之輸出。
模擬狀況 5: 驗證時變離散回授線性化控制(5.7)能確保車輛轉向系統
(3.4)-(3.5)之穩定性。設定參數為低摩擦力路面 、高速
v40
m/s
、初 始狀態 0.03、 0.06、QI2、R1、輸入f 0.0067
rad 、取樣 時間Ts 0.5及Ts 0.05。模擬結果如圖 6.11~6.12 所示。模擬狀況 6: 驗證非時變離散回授線性化控制(5.12)能確保車輛轉向系
統(3.4)-(3.5)之穩定性。設定參數為低摩擦力路面、高速
v40
m/s
、 初始狀態 0.03、 0.06、QI2、R1、輸入f 0.0067
rad 、取 樣時間Ts 0.5及Ts 0.05。模擬結果如圖 6.13~6.14 所示。圖6.11中紅色曲線為時變離散回授線性化控制在取樣時間Ts 0.5
之輸出結果。雖然其效能與藍色曲線LQR之結果有很大差異,但其能 有效的確保車輛轉向系統(3.4)-(3.5)之穩定性。另由取樣理論可知,當 取樣時間變小時,離散控制將會產生較佳之控制效果。因此,接下來 我們將取樣時間縮小為Ts 0.05,模擬結果如圖6.12所示。從圖中我們
可清楚看出時變離散回授線性化控制與LQR產生幾乎一致之結果。從 此一模擬狀況結果顯示:本論文提出之時變離散回授線性化控制為一 有效離散控制架構,確保車輛轉向系統(3.4)-(3.5)之穩定性。如同在5.1 節中所言,時變離散回授線性化控制增益為一時變參數,在每一個取 樣時間上皆必須依據當時系統輸出值重新計算 。
為能降低計算複雜度,我們接著測試非時變離散回授線性化控制 之效果,其結果如圖6.13~6.14所示。從圖中我們發現其系統輸出幾乎 完全與圖6.11~6.12一致。我們更進一步測試兩者發現,在所考慮的模 擬情況下,兩者幾乎沒有差別(詳見表6.1)。因此,我們可以推得本論 文 提 出 之 非 時 變 離 散 回 授 線 性 化 控 制 不 僅 能 確 保 車 輛 轉 向 系 統
(3.4)-(3.5)之穩定性,同時亦具有簡單(固定增益)之離散控制架構。
表 6.1 時變與非時變離散回授線性化控制效能比較
Ts N JN J
1.00 10 0.0051 0.0040
0.50 20 0.0017 0.0013
0.10 100 0.0003 0.0003
0.05 200 0.0005 0.0005
0.01 1000 0.0021 0.0021
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.026
0.028 0.03 0.032
t (sec)
beta
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-0.06 -0.05 -0.04 -0.03
t (sec)
gamma
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0.01 0.02
t (sec)
control
圖 6.11 LQR 與時變離散回授線性化控制之控制效果比較(Ts 0.5)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.026 0.028 0.03 0.032
t (sec)
beta
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-0.06 -0.05 -0.04 -0.03
t (sec)
gamma
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0.01 0.02
t (sec)
control
圖 6.12 LQR 與時變離散回授線性化控制之控制效果比較(Ts 0.05
)
紅線:時變離散回授線性化控制 藍線;LQR控制
紅線:時變離散回授線性化控制 藍線;LQR控制
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.026
0.028 0.03 0.032
t (sec)
beta
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-0.06 -0.05 -0.04 -0.03
t (sec)
gamma
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0.01 0.02
t (sec)
control
圖 6.13 LQR 與非時變離散回授線性化控制之控制效果比較(Ts 0.5)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.026 0.028 0.03 0.032
t (sec)
beta
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-0.06 -0.05 -0.04 -0.03
t (sec)
gamma
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0.01 0.02
t (sec)
control
圖 6.14 LQR 與非時變離散回授線性化控制之控制效果比較(Ts 0.05
)
紅線:非時變離散回授線性化控制 藍線;LQR控制
紅線:非時變離散回授線性化控制 藍線;LQR控制
第七章
結論與未來研究方向
本論文針對車輛轉向系統之不穩定現象,提出一有效的連續時間 及離散時間控制器設計方法 ,以消除或延遲系統所存在之鞍節點分歧 現象。藉由分析非線性控制方法中之輸入-狀態回授線性化控制技巧,
本論文更進一步提出具運算優勢之一線性非時變控制模型,以降低回 授線性化控制所需之複雜計算度。利用 LQR 最佳化控制理論,我們可 以求得此一線性非時變控制之最佳固定增益值,同時利用文中所提出 一實驗數據關係,我們亦可推得一組較現有文獻結果佳之 輸入-狀態回 授線性化控制設計結果。另外,我們亦嘗試設計一針對車輛轉向系統 控制之離散時間控制方法 ,以因應現今較實際之數位控制器設計 需 求。依據所使用離散模型之不同,本論文提出兩種不同之離散時間控 制法則設計:一為時變離散回授線性化控制,另一為非時變離散回授 線性化控制。最後,我們利用一些數值模擬狀況,來驗證本論文所提 出之連續時間及離散時間控制器設計方法之有效性 。
另外,本論文延續論文[14]之研究成果,更針對論文中所建議之未 來改進及研究方向參考,提出下列幾點改進:
合理的取樣時間下能充分近似 連續時間模型所產生之結果
2. 本論文採用 RK4 做為數值模擬工具同時自行撰寫 MATLAB code
(詳見附錄 D),因此可利用 MATLAB 程式來解決同時存在連續與 離散時間控制器之模擬情況 ,使得離散控制器能直接透過連續模型 狀態取樣,並能控制較實際具連續時間特性之車輛轉向系統模型 , 而非近似之離散車輛轉向系統模型 。
3. 本論文提出一實驗數據關係,並據此進行回授線性化控制器的最佳
控制增益K值的選擇。本論文利用數據模擬,推得出一有效之實驗數據關係 (6.2)。據此 一關係及利用最佳化理論,我們成功的推導出比現有文獻 中提出結果 更佳之一組回授線性化控制器設計結果。然而,此一結果僅限於所討 論之分歧點 SNBP13。如何延伸此一成果,進一步推導出一更廣泛適用 任一分歧點之通用結果,將是本論文未來尚可繼續研究之方向。
參考文獻
[1] T.D. Gillespie, Fundamentals of vehicle dynamics. Society of Automotive Engineers, Inc., 1992.
[2] J.Y. Wong, Theory of Ground Vehicles. John Wiley & Sons, Inc., 2001.
[3] E. Ono, S. Hosoe, H.D. Tuan, and S. Doi, “Bifurcation in vehicle dynamics and robust front wheel steering control ,” IEEE Trans.
Control Systems Technology, Vol.6, N o. 3, pp. 412-420, 1998.
[4]
A.D. Rodic and M.K. Vukobratovic, “Contribution to the i ntegrated control synthesis of road vehicles,” IEEE Trans. Control Systemstechnology, Vol. 7, No. 1, pp. 64-78, Jan. 1999.
[5] H.E. Tseng, B. Ashrafi, D. Madau, T.A. Brown and D. Recker, “The
development of vehicle stability control at Ford,” IEEE/ASME T rans.Mechatronics, Vol. 4, No. 3, pp. 223-234, Sept. 1999.
[6] H. Lee and M. Tomizuka, “Adaptive vehicle traction force control for
intelligent vehicle highway systems (IVHSs),” IEEE Trans. IndustrialElectronics, Vol. 50, No. 1, pp. 37 -47, Feb. 2003.
[7] D.-C. Liaw, H.-H. Chiang, and T.-T. Lee, “Elucidating vehicle lateral dynamics using a bifurcation analysis ,” IEEE Trans. Intelligent Transportation Systems, Vol. 8, No. 2, pp. 195-207, June 2007.
[8] H.K. Khalil. Nonlinear Systems. Prentice -Hall Inc., 1996.
[9] I.-J. Ha, A.K. Tugcu and N.M. Boustany, “Feedback linearizing
control of vehicle longitudinal acceleration,”IEEE Trans.
Automatic Control, Vol. 34, No. 7, pp. 689 -698, July 1989.
[10] I.-J. Ha and S. Chong, “Design of a CLOS guidance law via feedback
28, No. 1, pp. 51-63, Jan. 1992.
[11] S.N. Singh and W. Yim, “Feedback linearization and solar pressure satellite attitude control,” IEEE Trans. on Aerospace and Electronic Systems, Vol. 32, No. 2, pp. 732-741, Apr. 1996.
[12] D.-C. Liaw, W.-C Chung, C.-C Song and C.-S Hsieh, “A Feedback
Linearization Design for the Control of Vehicle’s Lateral dynamics,”SICE-ICASE International Joint Conference 2006 , Oct. 18-21, Busan, Korea, pp. 4937-4942, 2006.
[13] 鐘文敬,“車輛系統之轉向分析與控制設計 ”國立交通大學電機
與控制工程學系博士論文,九十六年七月。[14] 許智偉,“車輛橫向動力學分析及其離散控制器設計 ”大華技術
學院機電研究所碩士論文,九十七年七月。[15] G. Chowdhary, “Online optimal control,” DLR Internal Report, Nov.
2005.
附錄 A 線性化模型微分值計算補充
附錄 B 低摩擦力路面之穩定平衡點與鞍點之詳細數據 表
表 B.1 低摩擦力路面之穩定平衡點與鞍點
V=10
V=15
ue Spiral or nodal sink Saddle point1 Saddle point2 0 0.0000 0.0000 Spiral sink. 0.0677 -0.2242 -0.0677 0.2242 -0.01 0.0004 -0.0356 Spiral sink. 0.0593 -0.2289 -0.0761 0.2196 -0.02 0.0009 -0.0714 Spiral sink. 0.0510 -0.2337 -0.0847 0.2153 -0.03 0.0015 -0.1075 Spiral sink. 0.0426 -0.2383 -0.0934 0.2114 -0.04 0.0026 -0.1446 Spiral sink. 0.0340 -0.2419 -0.1021 0.2077 -0.05 0.0049 -0.1846 Nodal sink. 0.0242 -0.2426 -0.1110 0.2044 -0.051 0.0053 -0.1890 Nodal sink. 0.0231 -0.2422 -0.1119 0.2041 -0.052 0.0057 -0.1936 Nodal sink. 0.0219 -0.2417 -0.1128 0.2037 -0.053 0.0063 -0.1984 Nodal sink. 0.0206 -0.2410 -0.1137 0.2034 -0.054 0.0069 -0.2036 Nodal sink. 0.0192 -0.2399 -0.1146 0.2031 -0.055 0.0078 -0.2092 Nodal sink. 0.0177 -0.2383 -0.1155 0.2028 -0.056 0.0090 -0.2160 Nodal sink. 0.0157 -0.2356 -0.1164 0.2025 -0.0561 0.0092 -0.2168 Nodal sink. 0.0155 -0.2352 -0.1165 0.2025 -0.0562 0.0094 -0.2176 Nodal sink. 0.0152 -0.2347 -0.1166 0.2024 -0.0563 0.0096 -0.2185 Nodal sink. 0.0149 -0.2342 -0.1167 0.2024 -0.0564 0.0098 -0.2195 Nodal sink. 0.0147 -0.2337 -0.1168 0.2024 -0.0565 0.0100 -0.2205 Nodal sink. 0.0143 -0.2331 -0.1169 0.2024 -0.0566 0.0103 -0.2217 Nodal sink. 0.0140 -0.2323 -0.1170 0.2023 -0.0567 0.0107 -0.2231 Nodal sink. 0.0135 -0.2313 -0.1170 0.2023 -0.0568 0.0112 -0.2249 Nodal sink. 0.0129 -0.2298 -0.1171 0.2023 -0.0569 0.012 -0.2275 Bifurcation-p
-0.057 -0.1173 0.2022
-0.058 -0.1182 0.2019
-0.059 -0.1191 0.2016
-0.06 -0.1200 0.2013
ue Spiral or nodal sink Saddle point1 Saddle point2 0 0.0000 0.0000 Spiral sink. 0.0572 -0.1597 -0.0572 0.1597
V=20
-0.01 0.0060 -0.0472 Spiral sink. 0.0481 -0.1618 -0.0658 0.1566 -0.02 0.0131 -0.0969 Spiral sink. 0.0375 -0.1604 -0.0744 0.1532 -0.021 0.0140 -0.1023 Spiral sink. 0.0362 -0.1597 -0.0752 0.1529 -0.022 0.0151 -0.1080 Spiral sink. 0.0347 -0.1588 -0.0761 0.1525 -0.023 0.0162 -0.1140 Nodal sink. 0.0332 -0.1575 -0.0769 0.1522 -0.024 0.0176 -0.1205 Nodal sink. 0.0314 -0.1557 -0.0778 0.1518 -0.025 0.0194 -0.1281 Nodal sink. 0.0292 -0.1528 -0.0786 0.1515 -0.0259 0.0225 -0.1384 Nodal sink. 0.0258 -0.1467 -0.0794 0.1512 -0.0260 0.0241 -0.1428 Bifurcation-p
-0.0261 -0.0796 0.1511
-0.027 -0.0803 0.1508
-0.03 -0.0829 0.1498
-0.04 -0.0916 0.1465
-0.05 -0.1004 0.1435
-0.06 -0.1092 0.1407
ue Spiral or nodal sink Saddle point1 Saddle point2 0 0.0000 0.0000 Spiral sink. 0.0525 -0.1215 -0.0525 0.1215 -0.001 0.0012 -0.0054 Spiral sink. 0.0515 -0.1215 -0.0535 0.1214 -0.002 0.0023 -0.0107 Spiral sink. 0.0505 -0.1215 -0.0544 0.1214 -0.003 0.0035 -0.0161 Spiral sink. 0.0495 -0.1215 -0.0554 0.1213 -0.004 0.0047 -0.0215 Spiral sink. 0.0484 -0.1214 -0.0563 0.1211 -0.005 0.0059 -0.0269 Spiral sink. 0.0473 -0.1212 -0.0572 0.1210 -0.006 0.0071 -0.0324 Spiral sink. 0.0462 -0.1210 -0.0581 0.1209 -0.007 0.0083 -0.0378 Spiral sink. 0.0451 -0.1208 -0.0591 0.1207 -0.008 0.0096 -0.0434 Spiral sink. 0.0439 -0.1204 -0.0600 0.1205 -0.009 0.0109 -0.0490 Spiral sink. 0.0427 -0.1200 -0.0609 0.1203 -0.01 0.0122 -0.0547 Spiral sink. 0.0414 -0.1194 -0.0618 0.1201 -0.011 0.0137 -0.0606 Spiral sink. 0.0399 -0.1186 -0.0626 0.1199 -0.012 0.0152 -0.0666 Spiral sink. 0.0384 -0.1176 -0.0635 0.1197 -0.013 0.0169 -0.0730 Spiral sink. 0.0367 -0.1162 -0.0644 0.1195 -0.014 0.0189 -0.0800 Spiral sink. 0.0347 -0.1143 -0.0653 0.1193 -0.015 0.0215 -0.0882 Nodal sink. 0.0321 -0.1110 -0.0662 0.1190 -0.0151 0.0218 -0.0892 Nodal sink. 0.0317 -0.1106 -0.0663 0.1190 -0.0152 0.0221 -0.0902 Nodal sink. 0.0314 -0.1101 -0.0663 0.1190 -0.0153 0.0225 -0.0913 Nodal sink. 0.0310 -0.1095 -0.0664 0.1190
V=25
ue Spiral or nodal sink Saddle point1 Saddle point2 0 0.0000 0.0000 Spiral sink. 0.0497 -0.0969 -0.0497 0.0969 -0.001 0.0017 -0.0057 Spiral sink. 0.0486 -0.0967 -0.0508 0.0970 -0.002 0.0034 -0.0113 Spiral sink. 0.0474 -0.0965 -0.0518 0.0971 -0.003 0.0052 -0.0170 Spiral sink. 0.0462 -0.0962 -0.0529 0.0972 -0.004 0.0069 -0.0228 Spiral sink. 0.0450 -0.0958 -0.0539 0.0972 -0.005 0.0087 -0.0285 Spiral sink. 0.0436 -0.0953 -0.0549 0.0972 -0.006 0.0105 -0.0344 Spiral sink. 0.0422 -0.0947 -0.0558 0.0972 -0.007 0.0124 -0.0404 Spiral sink. 0.0407 -0.0938 -0.0568 0.0971 -0.008 0.0145 -0.0467 Spiral sink. 0.0390 -0.0927 -0.0578 0.0970 -0.009 0.0167 -0.0533 Spiral sink. 0.0371 -0.0912 -0.0587 0.0970 -0.01 0.0194 -0.0607 Spiral sink. 0.0347 -0.0889 -0.0596 0.0969 -0.011 0.0240 -0.0716 Nodal sink. 0.0310 -0.0843 -0.0606 0.0967 -0.0111 0.0240 -0.0716 Nodal sink. 0.0305 -0.0835 -0.0607 0.0967 -0.0112 0.0247 -0.0731 Nodal sink. 0.0297 -0.0824 -0.0608 0.0967 -0.0113 0.0258 -0.0753 Nodal sink. 0.0287 -0.0807 -0.0608 0.0967 -0.0114 0.0272 -0.0781 Bifurcation-p
-0.0115 -0.0610 0.0967
-0.012 -0.0615 0.0966
-0.013 -0.0624 0.0965
-0.014 -0.0633 0.0963
-0.015 -0.0642 0.0962
-0.02 -0.0686 0.0953
-0.03 -0.0774 0.0933
-0.0154 0.0229 -0.0924 Nodal sink. 0.0306 -0.1088 -0.0665 0.1190 -0.0155 0.0234 -0.0937 Nodal sink. 0.0301 -0.1081 -0.0666 0.1189 -0.0156 0.0239 -0.0951 Nodal sink. 0.0296 -0.1072 -0.0667 0.1189 -0.0157 0.0246 -0.0968 Nodal sink. 0.0289 -0.1060 -0.0668 0.1189 -0.0158 0.0267 -0.1017 Bifurcation-p
-0.0159 -0.0670 0.1188
-0.02 -0.0705 0.1178
-0.03 -0.0792 0.1152
-0.04 -0.0878 0.1126
-0.05 -0.0966 0.1101
-0.06 -0.1054 0.1077
-0.04 -0.0860 0.0911
-0.05 -0.0948 0.0890
-0.06 -0.1036 0.0871
V=30
V=35
ue Spiral or nodal sink Saddle point1 Saddle point2 0 0.0000 0.0000 Spiral sink. 0.0465 -0.0682 -0.0465 0.0682 -0.001 0.0026 -0.0056 Spiral sink. 0.0452 -0.0678 -0.0478 0.0685 ue Spiral or nodal sink Saddle point1 Saddle point2 0 0.0000 0.0000 Spiral sink. 0.0478 -0.0802 -0.0478 0.0802 -0.001 0.0022 -0.0057 Spiral sink. 0.0466 -0.0799 -0.0490 0.0804 -0.002 0.0044 -0.0114 Spiral sink. 0.0453 -0.0795 -0.0502 0.0806 -0.003 0.0066 -0.0172 Spiral sink. 0.0439 -0.0789 -0.0513 0.0808 -0.004 0.0088 -0.0230 Spiral sink. 0.0424 -0.0783 -0.0524 0.0809 -0.005 0.0112 -0.0290 Spiral sink. 0.0408 -0.0774 -0.0534 0.0809 -0.006 0.0137 -0.0352 Spiral sink. 0.0390 -0.0763 -0.0544 0.0810 -0.007 0.0164 -0.0418 Spiral sink. 0.0368 -0.0747 -0.0555 0.0810 -0.008 0.0198 -0.0493 Spiral sink. 0.0340 -0.0720 -0.0564 0.0810 -0.0081 0.0202 -0.0501 Spiral sink. 0.0337 -0.0717 -0.0565 0.0810 -0.0082 0.0206 -0.0510 Spiral sink. 0.0333 -0.0713 -0.0566 0.0810 -0.0083 0.0211 -0.0519 Spiral sink. 0.0329 -0.0709 -0.0567 0.0810 -0.0084 0.0215 -0.0529 Spiral sink. 0.0325 -0.0704 -0.0568 0.0810 -0.0085 0.0220 -0.0539 Spiral sink. 0.0320 -0.0698 -0.0569 0.0810 -0.0086 0.0226 -0.0550 Spiral sink. 0.0315 -0.0692 -0.0570 0.0810 -0.0087 0.0232 -0.0562 Nodal sink 0.0309 -0.0685 -0.0571 0.0810 -0.0088 0.0240 -0.0576 Nodal sink 0.0303 -0.0676 -0.0572 0.0810 -0.0089 0.0249 -0.0593 Nodal sink 0.0294 -0.0664 -0.0573 0.0810 -0.0090 0.0272 -0.0631 Bifurcation-p
-0.0091 -0.0575 0.0810
-0.01 -0.0584 0.0809
-0.02 -0.0676 0.0799
-0.03 -0.0764 0.0782
-0.04 -0.0851 0.0764
-0.05 -0.0938 0.0747
-0.06 -0.1026 0.0730
-0.002 0.0052 -0.0112 Spiral sink. 0.0437 -0.0673 -0.0490 0.0688 -0.003 0.0078 -0.0169 Spiral sink. 0.0422 -0.0666 -0.0502 0.0690 -0.004 0.0105 -0.0227 Spiral sink. 0.0404 -0.0657 -0.0513 0.0691 -0.005 0.0134 -0.0288 Spiral sink. 0.0384 -0.0645 -0.0524 0.0693 -0.006 0.0167 -0.0353 Spiral sink. 0.0360 -0.0628 -0.0535 0.0693 -0.007 0.0208 -0.0431 Spiral sink. 0.0326 -0.0597 -0.0546 0.0694 -0.0071 0.0214 -0.0440 Spiral sink. 0.0322 -0.0592 -0.0547 0.0694 -0.0072 0.0220 -0.0450 Spiral sink. 0.0317 -0.0586 -0.0548 0.0694 -0.0073 0.0226 -0.0461 Spiral sink. 0.0311 -0.0580 -0.0549 0.0694 -0.0074 0.0234 -0.0474 Spiral sink. 0.0304 -0.0572 -0.0550 0.0694 -0.0075 0.0243 -0.0489 Nodal sink. 0.0295 -0.0561 -0.0551 0.0694 -0.00759 0.0256 -0.0509 Nodal sink. 0.0282 -0.0546 -0.0552 0.0694 -0.0076 0.0270 -0.0528 Bifurcation-p
-0.0077 -0.0553 0.0694
-0.01 -0.0576 0.0694
-0.02 -0.0669 0.0687
-0.03 -0.0758 0.0673
-0.04 -0.0845 0.0658
-0.05 -0.0932 0.0642
-0.06 -0.1020 0.0628
V=40
ue Spiral or nodal sink Saddle point1 Saddle point2 0 0.0000 0.0000 Spiral sink. 0.0456 -0.0593 -0.0456 0.0593 -0.001 0.0029 -0.0054 Spiral sink. 0.0441 -0.0588 -0.0469 0.0596 -0.002 0.0058 -0.0108 Spiral sink. 0.0426 -0.0582 -0.0482 0.0599 -0.003 0.0088 -0.0164 Spiral sink. 0.0408 -0.0574 -0.0494 0.0602 -0.004 0.0119 -0.0221 Spiral sink. 0.0388 -0.0564 -0.0506 0.0603 -0.005 0.0154 -0.0282 Spiral sink. 0.0364 -0.0548 -0.0518 0.0605 -0.006 0.0196 -0.0352 Spiral sink. 0.0332 -0.0522 -0.0529 0.0606 -0.0061 0.0202 -0.0361 Spiral sink. 0.0327 -0.0518 -0.0530 0.0606 -0.0062 0.0207 -0.0369 Spiral sink. 0.0323 -0.0514 -0.0531 0.0606 -0.0063 0.0213 -0.0379 Spiral sink. 0.0317 -0.0509 -0.0532 0.0606 -0.0064 0.0220 -0.0389 Spiral sink. 0.0312 -0.0503 -0.0533 0.0606 -0.0065 0.0228 -0.0400 Spiral sink. 0.0305 -0.0496 -0.0534 0.0606 -0.0066 0.0237 -0.0414 Spiral sink. 0.0296 -0.0487 -0.0535 0.0606 -0.00669 0.0249 -0.0430 Spiral sink. 0.0285 -0.0475 -0.0536 0.0606
-0.0067 0.0267 -0.0454 Bifurcation-p
-0.0068 -0.0537 0.0606
-0.01 -0.0570 0.0608
-0.02 -0.0665 0.0602
-0.03 -0.0754 0.0590
-0.04 -0.0841 0.0577
-0.05 -0.0928 0.0564
-0.06 -0.1017 0.0551
附錄 C 模擬驗證用 MATLAB 程式
C.1 程式設計流程圖
(1) 連續時間控制器控制效能評估
主程式開始
模擬參數設定
控制器參數設定
車輛參數設定
車輛狀態波形 計算 LQR gain
no
計算非時變回授線性化控制 gain 計算回授線性化控制 gain yes
lp=2 迴圈(lp)測試?
模擬模式設定 計算線性化模型
模式=1?
lp=1
no
模擬結束?
yes 計算車輛狀態值(RK4)
計算車輛模型 Jacobian 矩陣 計算車輛動力學模型 計算車輛模型 Jacobian 矩陣
(2) 離散時間控制器控制效能評估
主程式開始
模擬參數設定
車輛參數設定
計算 LQR 控制修正值
no
計算非時變離散控制修正值 計算時變離散控制修正值
yes
lp=3 迴圈(lp)測試?
模擬模式設定
模式(lp)=1?
lp=1 or 2
計算車輛狀態值(RK4)
車輛狀態波形 no
模擬結束?
yes
計算車輛模型即時輸入矩陣 計算線性化模型
計算車輛模型 Jacobian 矩陣
計算連續時間 LQR gain
計算非時變離散控制 gain
計算時變離散控制 gain
C.2 MATLAB 程式設計
(1) 連續時間控制器控制效能評估 主程式
% Continuous-time Controller Performance Evaluation Program
% mode=1: Compare the performances of LQR design and feedback linearization control
% mode=2: Compare the performances of time -invariant feedback linearization control and feedback linearization control
globalBf Cf Df Ef Br Cr Dr Er M v Lf Lr Iz;
clc;
no=10000;t=zeros(no+1,1);X=zeros(2,no+1,3);
h=0.001;% basic simulation time interval
K1=-10.0;K2=-5.0; % time-invariant feedback linearization control gain matrix k1=-10.0;k2=-2.5; % feedback linearization control gain matrix
Q=[1 0;0 1];R=1; % LQR design parameters
% Vehicle simulation data
Bf=11.275;Cf=1.56;Df=-2574.7;Ef=-1.999;
Br=18.631;Cr=1.56;Dr=-1749.7;Er=-1.7908;
M=1500;v=40;Lf=1.2;Lr=1.3;Iz=3000;
beta0=0.0267;gamma0=-0.0454;deltaf0=-0.0067; % equilibrium point
% calculate linearization model parameters: A11,A12,A21,A22,B1,B2 [Fyf1,Fyf2,Fyf3,Fyr1,Fyr2,Fyr3]=Jacobian(beta0,gamma0,deltaf0);
A11=1/M/v*(Fyf1+Fyr1);
A12=1/M/v*(Fyf2+Fyr2)-1;
A21=cos(beta0)/Iz*(Lf*Fyf1 -Lr*Fyr1);
A22=cos(beta0)/Iz*(Lf*Fyf2 -Lr*Fyr2);
B1=1/M/v*(Fyf3+Fyr3);
B2=cos(beta0)/Iz*(Lf*Fyf3 -Lr*Fyr3);
mode=1;% mode=1: LQR design
% mode=2: time -invariant feedback linearization control forlp=1:2
% lp=1: run LQR or time -invariant feedback linearization control % lp=2: run feedback linearization control
beta=0.03;gamma=-0.06;% initial value X(lp,1,1)=beta;X(lp,1,2)=gamma;X(lp,1,3)=0;
forj=1:no t(j+1,1)=j*h;
if(j == 1) % the gain only need to be calculated once if(mode == 1)% LQR control Design
A=[A11 A12;A21 A22];
B=[B1;B2];
[K,S,E]=LQR(A,B,Q,R);
else % time-invariant feedback linearization control T21=B1*A21-B2*A11;
T22=B1*A22 -B2*A12;
T=[ -B2 B1;T21 T22];
PHI=1/(B1*T21+B2*T22);
THETA= -[A11*T21+A21*T22 A12*T21+A22*T22];
K=-PHI*(THETA+[K1 K2]*T);
end;
end;
u=-K*[beta-beta0;gamma-gamma0];
else % calculate feedback linearization control gain [f1,f2,Fyf,Fyr]=VehicleDynamics(beta,gamma, deltaf0);
[Fyf1,Fyf2,Fyf3,Fyr1,Fyr2,Fyr3]=Jacobian(beta,gamma,deltaf0);
% g1,g2 gu=Fyf3;
g1=(1/M/v)*gu;
g2=(Lf*cos(beta)*gu)/Iz;
% T1,T2
T1=1/M/v*(gamma-gamma0)-Lf/Iz*(sin(beta)-sin(beta0));
T2=cos(beta)/Iz*(Lf*gamma -(Lf+Lr)/M/v*Fyr);
% dT2/dx
T21=-(sin(beta)/Iz)*(Lf*gamma -((Lf+Lr)/(M*v))*Fyr)-(cos(beta)*(Lf+Lr)/
(Iz*M*v))*Fyr1;
T22=cos(beta)/Iz*(Lf -(Lf+Lr)/M/v*Fyr2);
% uk
THETA=-(T21*f1+T22*f2);
PHI=1/(T21*g1+T22*g2);
u=PHI*(THETA+[k1 k2]*[T1;T2]);
end;
X(lp,j+1,3)=u;
deltaf=u+deltaf0; % vehicle input
[beta,gamma]=RK4(beta,gamma,deltaf,h); % calculate vehicle's current state X(lp,j+1,1)=beta;X(lp,j+1,2)= gamma;
end end
subplot(2,1,1);
plot(t,X(1,:,1),'-b',t,X(2,:,1),'-r'),xlabel('t (sec)'),ylabel('beta') subplot(2,1,2);
plot(t,X(1,:,2),'-b',t,X(2,:,2),'-r'),xlabel('t (sec)'),ylabel('gamma')
(2) 離散時間控制器控制效能評估 主程式
% Discrete-time Controller Performanc e Evaluation Program
% mode=1: Compare the performances of time -variant discrete-time control and LQR design
% mode=2: Compare the performances of time -invariant discrete-time control and LQR design
globalBf Cf Df Ef Br Cr Dr Er M v Lf Lr Iz;
clc;
h=0.001; % h:basic simulation time interval no=500;Ts=no*h; % Ts:sampling time
N=10; % the number of sampling period tno=N*no;t=zeros(tno+1,1);X=zeros(3,tno+1,3);
% Vehicle simulation data
Bf=11.275;Cf=1.56;Df=-2574.7;Ef=-1.999;
Br=18.631;Cr=1.56;Dr=-1749.7;Er=-1.7908;
M=1500;v=40;Lf=1.2;Lr=1.3;Iz=3000;
beta0=0.0267;gamma0=-0.0454;deltaf0=-0.0067;%equilibrium point [Fyf1,Fyf2,Fyf3,Fyr1,Fyr2,Fyr3]=Jacobian(beta0,gamma0,deltaf0);
% Linearization model parameters: A11,A12,A21,A22,B1,B2 A11=1/M/v*(Fyf1+Fyr1);
A12=1/M/v*(Fyf2+Fyr2)-1;
A21=cos(beta0)/Iz*(Lf*Fyf1 -Lr*Fyr1);
A22=cos(beta0)/Iz*(Lf*Fyf2 -Lr*Fyr2);
B1=1/M/v*(Fyf3+Fyr3);
B2=cos(beta0)/Iz*(Lf*Fyf3 -Lr*Fyr3);
% continuous-time LQR gain Design Q=[1 0;0 1];R=1;
A=[A11 A12;A21 A22];
B=[B1;B2];
[Kc,S,E]=LQR(A,B,Q,R);
sysA=ss(A,B,eye(2),0);
SYSD=c2d(sysA,Ts);
[As,Bs,Cs,Ds]=ssdata(SYSD);
[P,L,Kd,RR]=dare(As,Bs,Q,R);
mode=1;% mode=1: time-variant discrete-time control % mode=2: time -invariant discrete-time control forlp=1:3
% lp=1: run time-variant discrete-time control % lp=2: run time-invariant discrete-time control % lp=3: run continuous -time LQR control
ind=1;
beta=0.03;gamma=-0.06; % initial value X(lp,1,1)=beta;X(lp,1,2)=gamma;X(lp,1,3)=0;
forj=1:N fork=1:no ind=ind+1;
t(ind,1)=(ind -1)*h;
if(lp == 3) %continuous-time LQR control u=-Kc*[beta-beta0;gamma-gamma0];
else
if(k == 1)
if(lp == 1) %time-variant discrete-time control b1=beta;b2=gamma;
alphaf=b1+atan(Lf/v*b2*cos(b1)) -deltaf0;
tmp1=Cf*atan(Bf*(1 -Ef)*alphaf+Ef*atan(Bf*alphaf));
tmp 2=1+(Bf*(1-Ef)*alphaf+Ef*atan(Bf*alphaf))^2;
tmp3=(1 -Ef)+Ef/(1+(Bf*alphaf)^2);
gu= -(Cf*Bf*tmp3*Df*cos(tmp1)/tmp2);
g1=(1/M/v)*gu;
g2=(Lf*cos(b1)*gu)/Iz;
% time-variant discrete-time control gain Design sysA=ss(A,[g1;g2],eye(2),0);
SYSD=c2d(sysA,Ts);
[As,Bk,Cs,Ds]=ssdata(SYSD);
[P,L,Kt,RR]=dare(As,Bk,Q,R);
u=-Kt*[beta-beta0;gamma-gamma0];
else
%time-invariant discrete-time control
u=-Kd*[beta-beta0;gamma-gamma0];
end;
end;
end;
deltaf=u+deltaf0;
[beta,gamma]=RK4(beta,gamma,del taf,h);
X(lp,ind,1)=beta;X(lp,ind,2)=gamma;X(lp,ind,3)=u;
end;
end;
end;
subplot(3,1,1);
plot(t,X(mode,:,1),'-r',t,X(3,:,1),'-b'),xlabel('t (sec)'),ylabel('beta') subplot(3,1,2);
plot(t,X(mode,:,2),'-r',t,X(3,:,2),'-b'),xlabel('t (sec)'),ylabel('gamma') subplot(3,1,3);
plot(t,X(mode,:,3),'-r',t,X(3,:,3),'-b'),xlabel('t (sec)'),ylabel('control')
(3) 車輛動力學模型副程式(MATLAB 函式)
function[h1,h2,Fyf,Fyr]=VehicleDynamics(beta,gamma,deltaf) globalBf Cf Df Ef Br Cr Dr Er M v Lf Lr Iz;
%Cornering Forces
alphaf=beta+atan((Lf/v*gamma)*cos(beta)) -deltaf;
alphar=beta-atan((Lr/v*gamma)*cos(beta));
Fyf=Df*sin(Cf*atan(Bf*(1 -Ef)*alphaf+Ef*atan(Bf*alphaf)));
Fyr=Dr*sin(Cr*atan(Br*(1 -Er)*alphar+Er*atan(Br*alphar)));
%Vehicle Model
h1=(1/(M*v))*(Fyf+Fyr) -gamma;
h2=(1/(Iz))*(Lf*Fyf-Lr*Fyr)*cos(beta);
(4) 車輛動力學模型 Jacobian 矩陣計算副程式(MATLAB 函式)
function[Fyf1,Fyf2,Fyf3,Fyr1,Fyr2,Fyr3]=Jacobian(beta,gamma,deltaf) globalBf Cf Df Ef Br Cr Dr Er M v Lf Lr Iz;
%Derivatives of Cornering Forces
%d(alphaf)/dx,d(alphar)/dx
alphaf1=1-Lf/v*gamma*sin(beta)/(1+(Lf/v*gamma*cos(beta))^2);
alphaf2=Lf/v*cos(beta)/(1+(Lf/v*gamma*cos(beta))^2);
alphaf3=-1;
alphar2=-Lr/v*cos(beta)/(1+(Lr/v*gamma*cos(beta))^2);
alphar3=0;
%d(Fyf)/dx,d(Fyr)/dx
alphaf=beta+atan((Lf/v*gamma)*cos(beta)) -deltaf;
alphar=beta-atan((Lr/v*gamma)*cos(beta));
tmp1=Df*cos(Cf*atan(Bf*(1 -Ef)*alphaf+Ef*atan(Bf*alphaf)));
tmp2=Cf/(1+(Bf*(1-Ef)*alphaf+Ef*atan(Bf*alphaf))^2);
tmp3=Bf*((1-Ef)+Ef/(1+(Bf*alphaf)^2));
Fyf1=tmp1*tmp2*tmp3*alphaf1;
Fyf2=tmp1*tmp2*tmp3*alphaf2;
Fyf3=tmp1*tmp2*tmp3*alphaf3;
tmp1=Dr*cos(Cr*atan(Br*(1 -Er)*alphar+Er*atan(Br*alphar)));
tmp2=Cr/(1+(Br*(1-Er)*alphar+Er*atan(Br*alphar))^2);
tmp3=Br*((1-Er)+Er/(1+(Br*alphar)^2));
Fyr1=tmp1*tmp2*tmp3*alphar1;
Fyr2=tmp1*tmp2*tmp3*alphar2;
Fyr3=tmp1*tmp2*tmp3*alphar3;
(5) 四階 Runge-Kutta(RK4)副程式(MATLAB 函式)
function[beta,gamma]=RK4(beta,gamma,deltaf,h)
%f(0)
[k11,k12]=VehicleDynamics(beta,gamma,deltaf);
%f(1/2*h*k1)
beta1=beta+1/2*h*k11;
gamma1=gamma+1/2*h*k12;
[k21,k22]=VehicleDynamics(beta1,gamma1,deltaf);
%f(1/2*h*k2)
beta2=beta+1/2*h*k21;
gamma2=gamma+1/2*h*k22;
[k31,k32]=VehicleDynamics(beta2,gamma2,deltaf);
%f(h*k3)
beta3=beta+h*k31;
gamma3=gamma+h*k32;
[k41,k42]=VehicleDynamics(beta3,gam ma3,deltaf);
beta=beta+(k11+2*k21+2*k31+k41)*h*(1/6);
gamma=gamma+(k12+2*k22+2*k32+k42)*h*(1/6);