【正文】
l control curve is a little different from that in Figure 5b. Because of the physical characteristics, such as friction, force should be larger than a threshold value in order to move the cart. In addition, as a limitation of the output of a servo motor, force reaches its maximum value at a certain angle. The control curve for the actual inverted pendulum control system is illustrated in Figure 5c. We can create a fuzzy controller from a control curve. Figure 3 Control StrategyCONTROLLER DESIGN To create a fuzzy controller, let us start with analyzing control behaviors of the inverted pendulum system. For simplicity, we will use a single stage inverted pendulum shown in Figure 4. Basically, a controller should reflect the relation between two variables q and f. In other words, if we know the relation between q and f , we can use it to write control rules. We know if q is large, f should be large。the outer loop is for controlling the second stage. Without outer loop this bees a singlestage inverted pendulum system. In that case, our control target is q 1 = 0. However when we have two stages, the control target for the first stage is no longer q 1 = 0. Instead, we have to adjust the first stage to a suitable angle in accordance with the angle of the second stage(see Figure 3). In other words, in a two stage inverted pendulum system, the purpose of the outer loop is to produce an angle for the first stage to follow. Figure 2 Two Stage Inverted Pendulum Control System We may summarize the control strategy for a two stage inverted pendulum as follows: l According to the angle of the second stage q 2, determine an angle q for the first stage. We set q = q 2. l Adjust the first stage to achieve q 1= q . Because the target of the outer loop is q 2 = 0, the final target of the system is q 1 = q 2 = 0.So far, in the application note series, we have provided several examples showing how to create fuzzy controllers with FIDE. However, these examples do not provide topics on implementation of the designed system. In this application note, we use an example of an inverted pendulum to provide details on all aspects of fuzzy logic based system design.We will begin with system design。擺桿二39。擺桿一39。小車39。[Y,X]=lsim(Ac,B,C,D,U,T)。T=0::10。從圖上可以看出響應(yīng)時間過長,效果不很理想,因此需要對控制器參數(shù)進(jìn)行調(diào)整。其中, 代表小車位置的敏感程度,而和是擺桿1和擺桿2角度的敏感程度,輸入的敏感程度是1。最簡單的情況是假設(shè),為單位矩陣。用Matlab中的函數(shù),也可以得到最優(yōu)控制器對應(yīng)的。 設(shè)計的第一步是確定系統(tǒng)的特征值,用Matlab程序可以求出特征值為[,0,0],由此可以看出,開環(huán)系統(tǒng)不穩(wěn)定。圖中,R是施加在小車上的階躍輸入,狀態(tài)量, ,分別代表小車位移、擺桿1位置、擺桿2位置、小車速度、擺桿1角速度和擺桿2角速度,輸出。系統(tǒng)狀態(tài)方程為 這個問題可以使用完全狀態(tài)反饋來解決。167。擺桿二39。擺桿一39。小車39。figureplot(T,Y)axis([0,5,10,10])。U=*eye(size(T))。D=0。B=[0 0 0 1 ]。給小車施加一個階躍輸入信號,以求取系統(tǒng)的階躍響應(yīng)用下面的Matlab程序可以計算出系統(tǒng)狀態(tài)空間方程的A,B,C和D矩陣, m的階躍信號時系統(tǒng)的響應(yīng)曲線。而 ,其中, ,其中, 則 同樣可以求出 因此,可以得到系統(tǒng)動能系統(tǒng)的勢能為: 至此得到拉格朗日算子L:由于因為在廣義坐標(biāo)上均無外力作用,有以下等式成立: (41) (42)展開(41)、(42)式,分別得到(43)、(44)式 (43) (44)將(43)、(44)式對求解代數(shù)方程,得到以下兩式(45)(46)表示成以下形式: (47) (48)取平衡位置時各變量的初值為零,將(47)式在平衡位置進(jìn)行泰勒級數(shù)展開,并線性化,令帶入(45)式,得到線性化之后的公式 (49)將(48)式在平衡位置進(jìn)行泰勒級數(shù)展開,并線性化,令帶入(46)式,得到 (410)現(xiàn)在得到了兩個線性微分方程,由于我們采用加速度作為輸入,因此還需加上一個方程 (411)取狀態(tài)變量如下: 由(49),(410),(411)式得到狀態(tài)空間方程如下:將以下參數(shù)代入求出各個K值如下:得到狀態(tài)方程各個參數(shù)矩陣: 167。拉格朗日方程由廣義坐標(biāo)和表示為: 其中,為系統(tǒng)沿該廣義坐標(biāo)方向上的外力,在本系統(tǒng)中,設(shè)系統(tǒng)的三個廣義坐標(biāo)分別是。 數(shù)學(xué)模型建立在忽略了空氣流動,各種摩擦之后,可將倒立擺系統(tǒng)抽象成小車、勻質(zhì)桿和質(zhì)量塊組成的系統(tǒng)。4)閉環(huán)系統(tǒng)是漸進(jìn)穩(wěn)定的,即系統(tǒng)矩陣的特征值全為負(fù)實部,而不論原受控系統(tǒng)的特征值如何。但是,這里的是維的是對稱矩陣,是黎卡提矩陣代數(shù)方程的解。2)在性能泛函中,由于,而使終端泛函失去了意義,即。因為在無限時間狀態(tài)調(diào)節(jié)器中,控制區(qū)間擴大至無窮,倘若系統(tǒng)不能控,則無論哪一個控制矢量都將由于,而使性能泛函趨于無窮,從而無法比較其優(yōu)劣。隨著趨向無窮, 將趨于某常數(shù),可見最優(yōu)反饋的時變系統(tǒng)也隨之轉(zhuǎn)化為定常系統(tǒng) (325)能控,性能泛函為 (326)其中不受限制,是半正定的常數(shù)矩陣,為正定的常數(shù)矩陣。這就大大增加了系統(tǒng)結(jié)構(gòu)的復(fù)雜性。三.無限時間狀態(tài)調(diào)節(jié)器問題上面討論的狀態(tài)調(diào)節(jié)器,雖然最優(yōu)反饋是線性的,然而由于控制時間區(qū)間是有限的,因而這種系統(tǒng)是時變的。5) 計算性能泛函最優(yōu)值 (324)顯然,在任意時刻性能泛函為 當(dāng)時,即為式(39)中終端性能的最優(yōu)值。3) 由式(317)和式(316)求反饋增益矩陣及最優(yōu)控制。綜上所述,線性調(diào)節(jié)器的設(shè)計步驟如下:1)根據(jù)工藝要求和工程實踐經(jīng)驗,選定加權(quán)矩陣、。由于是一個對稱陣,所以實際只需解個微分方程組,便可確定的所有元素。 線性二次型最優(yōu)反饋系統(tǒng) 將式(315)代入正則方程,消去,得 (319) (320)將式(15)求導(dǎo)數(shù),得 (321)把式(320) 代入式(321)并注意到式(319)得整理得 (322)邊界條件 (323)式(322)為黎卡提矩陣微分方程。把式(315)帶入式(311)可得 (316) (317)式中維最優(yōu)反饋增益矩陣。從式(311)可知是的線性函數(shù)。根據(jù)極小值原理,引入維協(xié)態(tài)矢量構(gòu)造哈密爾頓函數(shù) 310)最優(yōu)控制應(yīng)試取極值,因不受限制,則成立由于正定、對稱,得 (311)又因正定,故由式(311)所確定的最優(yōu)控制,對于取極小值來說,既是必要的,又是充分的。性能泛函為 (39)式中 維半正定的狀態(tài)加權(quán)矩陣;維半正定的控制加權(quán)矩陣;維半正定的終端加權(quán)矩陣。于是調(diào)節(jié)器問題就變?yōu)閷で笞顑?yōu)控制規(guī)律,在有限時間區(qū)間內(nèi)[]內(nèi),將系統(tǒng)從初始狀態(tài)轉(zhuǎn)移到零點附近,并使給定的性能泛函取極值。二.有限時間狀態(tài)調(diào)節(jié)器問題狀態(tài)調(diào)節(jié)器的任務(wù)在于,當(dāng)系統(tǒng)狀態(tài)由于任何原因偏離了平衡狀態(tài)時,能在不消耗過多能量的情況下,保持系統(tǒng)狀態(tài)個分量仍接近平衡狀態(tài)。的加權(quán)意義與相仿。因此,是用來衡量控制功率大小的代價函數(shù)。因為正定,所以只要存在控制,總是正的。如果對誤差在變動過程中不同階段有不同的強調(diào)時,那么, 就相應(yīng)取成時變的。通常是對角線常陣,對角線上的元素分別表示對相應(yīng)誤差分量的重視程度。由此可見,是用以衡量誤差大小的代價函數(shù),越大,則支付的代價越大。因為半正定,所以只要出現(xiàn)誤差,總是非負(fù)的。下面對性能泛函中各項的物理意義作一解析。一. 二次型性能泛函二次型性能泛函的一般形勢如下: (37)式中 維半正定的狀態(tài)加權(quán)矩陣;維半正定的控制加權(quán)矩陣;維半正定的終端加權(quán)矩陣。簡稱線性二次型。 167。 把式(33)帶入式(1)整理可得狀態(tài)反饋閉環(huán)系統(tǒng)的狀態(tài)空間表達(dá)式 (34)若D=0,則 (35)簡記為 。狀態(tài)線性反饋控制u為u= (3