任楨 林都 李靜
關(guān)鍵詞: 旋轉(zhuǎn)倒立擺; 剛體建模; 虛擬仿真; SimMechanics; 系統(tǒng)辨識(shí); 試驗(yàn)驗(yàn)證
中圖分類(lèi)號(hào): TN915.5?34; N945.12; TP391.9 ? ? ? ? 文獻(xiàn)標(biāo)識(shí)碼: A ? ? ? ? ? 文章編號(hào): 1004?373X(2019)06?0060?05
Abstract: A modeling method based on the combination of the Matlab virtual simulation and test data is proposed, and the validity of model establishment is verified using physical objects, so as to solve the problem of deviation between theoretical modeling and engineering application of the rotary inverted pendulum. The rigid body model of the inverted pendulum is obtained by connecting Solidworks with Matlab, and the electromechanical part is added in the SimMechanics, so as to obtain the ideal model of the system at the unstable equilibrium point by means of linearization. The system parameters are identified on the basis of physical object test, so as to obtain the simulation model. The pendulum swinging and stabilization algorithms are studied for the inverted pendulum on the basis of the model. The test results show that the virtual simulation model can visually display and record the changes of the system variables, and there exists only a small gap in overall response when compared with the physical structure of the actual inverted pendulum.
Keywords: rotary inverted pendulum; rigid body modeling; virtual simulation; SimMechanics; system identification; test verification
倒立擺是一種經(jīng)典實(shí)驗(yàn)裝置,對(duì)該系統(tǒng)的穩(wěn)定控制研究可以推廣到四軸飛行器、雙足機(jī)器人及柔性機(jī)械臂等欠驅(qū)動(dòng)控制領(lǐng)域。當(dāng)前國(guó)內(nèi)對(duì)倒立擺實(shí)物控制的研究多基于商業(yè)設(shè)備的先進(jìn)算法驗(yàn)證,數(shù)學(xué)建模過(guò)程簡(jiǎn)化[1?4]。目前國(guó)內(nèi)外關(guān)于廣義系統(tǒng)的建模方法有三種:通過(guò)分析運(yùn)行過(guò)程的機(jī)理建模,基于實(shí)驗(yàn)數(shù)據(jù)的數(shù)據(jù)建模與二者交叉使用的混合建模。其中機(jī)理建模方法由于存在預(yù)先設(shè)定的假設(shè)理想條件,得到的模型與實(shí)際過(guò)程存在較大偏差。而數(shù)據(jù)建模方法不考慮機(jī)理過(guò)程,通過(guò)分析已有過(guò)程的輸入輸出數(shù)據(jù),得出模型結(jié)構(gòu)。該方法簡(jiǎn)化了建模流程,但對(duì)存在非線(xiàn)性特征的系統(tǒng),數(shù)據(jù)擬合代價(jià)過(guò)大,精度上也存在誤差?;旌辖>C合了二者優(yōu)點(diǎn),在理想化的機(jī)理模型基礎(chǔ)上,配合系統(tǒng)辨識(shí)與參數(shù)估計(jì),得到較為精確的數(shù)學(xué)模型。該過(guò)程在工程上應(yīng)用廣泛[5?6]。使用混合建模方法,本文提出一種基于計(jì)算機(jī)輔助設(shè)計(jì)軟件的旋轉(zhuǎn)倒立擺建模過(guò)程,在數(shù)學(xué)模型基礎(chǔ)上設(shè)計(jì)了控制器,將獲得的控制增益部署到嵌入式硬件驗(yàn)證了模型與控制器的有效性。
本文以中北大學(xué)電氣與控制工程學(xué)院現(xiàn)代控制工程研究室自行設(shè)計(jì)的單級(jí)旋轉(zhuǎn)倒立擺實(shí)驗(yàn)平臺(tái)作為研究對(duì)象,機(jī)械結(jié)構(gòu)使用Solidworks完成,如圖1所示。系統(tǒng)機(jī)理建模是在與實(shí)物一致的機(jī)械結(jié)構(gòu)基礎(chǔ)上, 通過(guò)動(dòng)力學(xué)方程,在不穩(wěn)定平衡點(diǎn)附近等效近似并線(xiàn)性化得到。使用文獻(xiàn)中的動(dòng)力學(xué)方程近似上有很大誤差,采用Solidworks導(dǎo)出剛體模型可以在最大程度上減少近似帶來(lái)的誤差。物體運(yùn)動(dòng)主要由質(zhì)量定義,在Solidworks中修改參數(shù)得到與實(shí)際一致的機(jī)械結(jié)構(gòu)。
在SimMechanics中,零件需要相對(duì)于地面在三維空間設(shè)置約束關(guān)系。該約束對(duì)應(yīng)于Solidworks裝配體的配合(Mate)屬性。對(duì)于單級(jí)旋轉(zhuǎn)倒立擺,其活動(dòng)部分為繞電機(jī)軸和繞擺桿軸轉(zhuǎn)動(dòng)的零件集合,該集合對(duì)應(yīng)于兩個(gè)繞軸線(xiàn)活動(dòng)的旋轉(zhuǎn)關(guān)節(jié)。為得到與實(shí)物一致的虛擬仿真模型,需要在Solidworks裝配體結(jié)構(gòu)中定義配合屬性。零件屬性如表1所示。
對(duì)具有相同轉(zhuǎn)軸的相鄰零件采用同心方式配合,轉(zhuǎn)軸位置如圖2中Revolute,Revolute1所示。兩關(guān)節(jié)均繞對(duì)應(yīng)坐標(biāo)系的Z軸旋轉(zhuǎn),其中CS坐標(biāo)系對(duì)應(yīng)懸臂(電機(jī)軸)轉(zhuǎn)角,以θ表示;CS1坐標(biāo)系對(duì)應(yīng)擺桿軸轉(zhuǎn)角,以α表示。兩坐標(biāo)系使用順時(shí)針為旋轉(zhuǎn)正方向。
通過(guò)在Matlab R2014內(nèi)安裝Simscape Multibody Link插件程序,可以實(shí)現(xiàn)由Solidworks導(dǎo)出可供仿真的多體模型[7]。
多體模型是描述零件間剛性約束關(guān)系的框架結(jié)構(gòu),結(jié)構(gòu)的驅(qū)動(dòng)需要電機(jī)提供動(dòng)力,對(duì)應(yīng)于對(duì)底部與懸臂間的旋轉(zhuǎn)關(guān)節(jié)Revolute施加激勵(lì)。關(guān)節(jié)激勵(lì)有轉(zhuǎn)矩或旋轉(zhuǎn)角度輸入型兩種,由于電機(jī)實(shí)質(zhì)是一種輸入電壓,輸出轉(zhuǎn)矩的能量轉(zhuǎn)換媒介,故關(guān)節(jié)激勵(lì)使用轉(zhuǎn)矩的形式施加。施加激勵(lì)信號(hào)的多體模型在Simulink內(nèi)計(jì)算得到旋轉(zhuǎn)動(dòng)作,動(dòng)作包含關(guān)節(jié)的轉(zhuǎn)角與轉(zhuǎn)速信息,在關(guān)節(jié)感知欄中選中對(duì)應(yīng)選項(xiàng),整理得到系統(tǒng)剛體結(jié)構(gòu)的仿真模塊。仿真模型如圖3所示。
倒立擺使用一臺(tái)小型直流電機(jī)驅(qū)動(dòng),直流電機(jī)與負(fù)載電路如圖4所示。
圖中Vm為控制電壓,直流電機(jī)輸出軸與旋轉(zhuǎn)負(fù)載相連,負(fù)載包含減速器、固定安裝的懸臂及活動(dòng)的擺桿部件,等效轉(zhuǎn)動(dòng)慣量為JL。
電機(jī)反電動(dòng)勢(shì)Ve由轉(zhuǎn)速ω決定,它的方向與電流方向相反,公式如下:
本文介紹并實(shí)現(xiàn)了一種基于Matlab虛擬仿真的單級(jí)旋轉(zhuǎn)倒立擺建模過(guò)程。首先配置導(dǎo)出的裝配體結(jié)構(gòu),得到系統(tǒng)機(jī)理模型。然后通過(guò)非線(xiàn)性環(huán)節(jié)補(bǔ)償與數(shù)據(jù)擬合得到較為精確的數(shù)學(xué)模型。最后在仿真環(huán)境與實(shí)物上驗(yàn)證了模型的準(zhǔn)確性,確保建模方法的科學(xué)性。
參考文獻(xiàn)
[1] 劉薇,郝彬,王躍靈.基于ESO的旋轉(zhuǎn)倒立擺全局終端滑??刂芠J].控制工程,2018,25(1):106?111.
LIU Wei, HAO Bin, WANG Yueling. Global terminal sliding mode control based on extended state observer for rotary inverted pendulum systems [J]. Control engineering of China, 2018, 25(1): 106?111.
[2] 劉慧博,蔡蕊.直線(xiàn)二級(jí)倒立擺基于線(xiàn)性矩陣不等式算法的滑模魯棒H∞控制[J].科學(xué)技術(shù)與工程,2014,14(5):270?275.
LIU Huibo, CAI Rui. Sliding mode and robust h∞ control based on LMI algorithm for linear double inverted pendulum [J]. Science technology and engineering, 2014, 14(5): 270?275.
[3] 王瑤為,邢科新,馬劍,等.直線(xiàn)一級(jí)倒立擺的自抗擾控制方法及實(shí)現(xiàn)[J].控制工程,2017,24(4):711?715.
WANG Yaowei, XING Kexin, MA Jian, et al. Implementation and design of active disturbance rejection control for the linear inverted pendulum [J]. Control engineering of China, 2017, 24(4): 711?715.
[4] 聶卓赟,劉瑞娟.復(fù)雜條件下倒立擺擺角控制設(shè)計(jì)與實(shí)驗(yàn)研究[J].信息與控制,2016,45(4):506?512.
NIE Zhuoyun, LIU Ruijuan. Inverted pendulum angle control design and experimental studies under complex conditions [J]. Information and control, 2016, 45(4): 506?512.
[5] 郭盛,梁藝瀚,王志群,等.基于虛擬仿真的并聯(lián)構(gòu)型手控器動(dòng)力學(xué)建模與力反饋控制[J].機(jī)器人,2015,37(2):224?230.
GUO Sheng, LIANG Yihan, WANG Zhiqun, et al. Dynamic modeling and force?feedback control of haptic device with parallel structure based on virtual simulation [J]. Robot, 2015, 37(2): 224?230.
[6] 王英波,黃其濤,鄭書(shū)濤,等.Simulink和SimMechanics環(huán)境下并聯(lián)機(jī)器人動(dòng)力學(xué)建模與分析[J].哈爾濱工程大學(xué)學(xué)報(bào),2012,33(1):100?105.
WANG Yingbo, HUANG Qitao, ZHENG Shutao, et al. Dynamic modeling and analysis of a parallel manipulator using Simulink and SimMechanics [J]. Journal of Harbin Engineering University, 2012, 33(1): 100?105.
[7] 姚太克.一類(lèi)三自由度并聯(lián)機(jī)構(gòu)的特性研究與優(yōu)化設(shè)計(jì)[D].合肥:中國(guó)科學(xué)技術(shù)大學(xué),2013.
YAO Taike. Performance analysis and optimal design of a class of parallel mechanisms with 3 degrees of freedom [D]. Hefei: University of Science and Technology of China, 2013.
[8] 丁鋒.輔助模型辨識(shí)方法(5):最小二乘辨識(shí)[J].南京信息工程大學(xué)學(xué)報(bào)(自然科學(xué)版),2016,8(5):385?403.
DING Feng. Auxiliary model based identification methods?Part E: Least squares identification [J]. Journal of Nanjing University of Information Science & Technology (Natural science edition), 2016, 8(5): 385?403.
[9] OLEJNIK P, AWREJCEWICZ J, FECKAN M. Modeling, analysis and control of dynamical systems with friction and impacts [M]. Geneva: World Scientific Publishing Company, 2017.
[10] MATHEW N J, RAO K K, SIVAKUMARAN N. Swing up and stabilization control of a rotary inverted pendulum [C]// Proceedings of the 10th IFAC International Symposium on Dynamics and Control of Process Systems. Mumbai: IFAC, 2013: 654?659.