




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、 第1頁 Control of an Inverted Pendulum Johnny Lam Abstract: The balancing of an inverted pendulum by moving a cart along a horizontal track is a classic problem in the area of control. This paper will describe two methods to swing a pendulum attached to a cart from an initial downwards position to an
2、upright position and maintain that state. A nonlinear heuristic controller and an energy controller have been implemented in order to swing the pendulum to an upright position. After the pendulum is swung up, a linear quadratic regulator state feedback optimal controller has been implemented to main
3、tain the balanced state. The heuristic controller outputs a repetitive signal at the appropriate moment and is finely tuned for the specific experimental setup. The energy controller adds an appropriate amount of energy into the pendulum system in order to achieve a desired energy state. The optimal
4、 state feedback controller is a stabilizing controller based on a model linearized around the upright position and is effective when the cart-pendulum system is near the balanced state. The pendulum has been swung from the downwards position to the upright position using both methods and the experim
5、ental results are reported. 1. INTRODUCTION The inverted pendulum system is a standard problem in the area of control systems. They are often useful to demonstrate concepts in linear control such as the stabilization of unstable systems. Since the system is inherently nonlinear, it has also been use
6、ful in illustrating some of the ideas in nonlinear control. In this system, an inverted pendulum is attached to a cart equipped with a motor that drives it along a horizontal track. The user is able to dictate the position and velocity of the cart through the motor and the track restricts the cart t
7、o movement in the horizontal direction. Sensors are attached to the cart and the pivot in order to measure the cart position and pendulum joint angle, respectively. Measurements are taken with a quadrature encoder connected to a MultiQ-3 general purpose data acquisition and control board. Matlab/Sim
8、ulink is used to implement the controller and analyze data. The inverted pendulum system inherently has two equilibria, one of which is stable while the other is unstable. The stable equilibrium corresponds to a state in which the pendulum is pointing downwards. In the absence of any control force,
9、the system will naturally return to this state. The stable equilibrium requires no control input to be achieved and, thus, is uninteresting from a control perspective. The unstable equilibrium corresponds to a state in which the pendulum points strictly upwards and, thus, requires a control force to
10、 maintain this position. The basic control objective of the inverted pendulum problem is to maintain the unstable equilibrium position when the pendulum initially starts in an upright position. The control objective for this project will focus on starting from the stable equilibrium position (pendul
11、um pointing down), swinging it up to the unstable equilibrium position (pendulum upright), and maintaining this state. 第2頁 2. MODELLING A schematic of the inverted pendulum is shown in Figure 1. Figure 1. Inverted Pendulum Setup A cart equipped with a motor provides horizontal motion of the cart whi
12、le cart position, p, and joint angle, , measurements are taken via a quadrature encoder. By applying the law of dynamics on the inverted pendulum system, the equations of motion are where mc is the cart mass, mp is the pendulum mass, I is the rotational inertia, l is the half-length of the pendulum,
13、 R is the motor armature resistance, r is the motor pinion radius, Km is the motor torque constant, and Kg is the gearbox ratio. Also, for simplicity, and note that the relationship between force, F, and voltage, V, for the motor is: 第3頁 Let the state vector be defined as: Finally, we linearize the
14、system about the unstable equilibrium(0 0 0 0)T.Note that = 0 corresponds to the pendulum being in the upright position. The linearization of the cart-pendulum system around the upright position is: Where Finally, by substituting the parameter values that correspond to the experimental setup: 第4頁 3.
15、 STABILIZING CONTROLLER DESIGN The controller design approach for this project is broken up into two components. The first part involves the design of an optimal state feedback controller for the linearized model that will stabilize the pendulum around the upright position. The second part involves
16、the design of a controller that swings the pendulum up to the unstable equilibrium. When the pendulum approaches the linearized point, the control will switch to the stabilizing controller which will balance the pendulum around the upright position. The state feedback controller responsible for bala
17、ncing the pendulum in the upright position is based on a Linear Quadratic Regulator (LQR) design using the linearized system. In a LQR design, the gain matrix K for a linear state feedback control law u = -Kx is found by minimizing a quadratic cost function of the form where Q and R are weighting pa
18、rameters that penalize certain states or control inputs. The weighting parameters chosen in the design of the optimal state feedback controller are: Based on this design, the controller gain matrix for the linearized system is: By using this K and the control law u = -Kx, the system is stabilized ar
19、ound the linearized point 第5頁 (pendulum upright). Since this control law is based on the linearized system, the state feedback optimal controller is only effective when the pendulum is near the upright position. 4. STATE ESTIMATION For the inverted pendulum experimental setup, not all the state vari
20、ables are available for measurement. In fact, only the cart position, p, and the pendulum angle, , are directly measured. This means that the cart velocity and the pendulum angular velocity are not immediately available for use in any control schemes beyond just stabilization. Thus, an observer is r
21、elied upon to supply accurate estimations of the states at all cart-pendulum positions. A linear full state observer can be implemented based on the linearized system derived earlier. This observer is simple in design and provides accurate estimation of all the states around the linearized point. Th
22、e observer is implemented by using a duplicate of the linearized system dynamics and adding in a correction term that is simply a gain on the error in the estimates. The observer gain matrix is determined by an LQR design similar to that used to determine the gain of the optimal state feedback stabi
23、lizing controller. In this case, the weighting parameters are chosen to be: Based on this design, the observer gain matrix is: Since the linear full state observer is based on the linearized system, it is only effective in estimating the state variables when the cart-pendulum system is near the upri
24、ght position. Thus, a low-pass filtered derivative is used to estimate the two unmeasured states, cart velocity and pendulum angular velocity, when the system is not close to the unstable equilibrium. This method approximates the cart velocity and pendulum angular velocity by using a finite differen
25、ce and then passing it through a low-pass filter. The following filter is chosen for this estimation method: 第6頁 The problems with such a method are that it introduces some delay and has a gain that is slightly less than one. The state estimates obtained from the filtered derivative, however, are re
26、asonably accurate for the swing-up controllers implemented in this paper. 5. SWING-UP CONTROLLER DESIGN Two different control schemes were implemented to swing the pendulum from the downwards position to the upright position. The first is a heuristic controller that provides a constant voltage in th
27、e appropriate direction and, thus, drives the cart back and forth along the track repeatedly. It will repeat this action until the pendulum is close enough to the upright position such that the stabilizing controller can be triggered to maintain this balanced state. The second scheme is an energy co
28、ntroller that regulates the amount of energy in the pendulum. This controller inputs energy into the cart-pendulum system until it attains the energy state that corresponds to the pendulum in the upright position. Similar to the heuristic control method, the energy control method will also switch to
29、 the stabilizing controller when the pendulum is close to the upright position. The switch that triggers the stabilizing controller in both cases is activated when the pendulum is within 5 of the upright position and the angular velocity is slower than 2.5 radians per second. Heuristic Controller Th
30、e heuristic controller is a logic-based control design that determines the direction and the moment in time the cart should move depending on the state of the system. A specific voltage gain is applied to the cart motor based on results from repeated experimentation. This controller will make the ca
31、rt drive forward or back whenever the pendulum crosses the downwards position and depending on the direction that the pendulum is swinging when it reaches the downwards position. The logic-based control design is completely dependent on the pendulum angle, one of the available measured state variabl
32、es. The control scheme will change the direction of the cart movement whenever the pendulum angle crosses the downwards position. Since this control design is based solely on the pendulum angle, the downwards position is the optimal moment in time to add energy to the pendulum by moving the cart in
33、the appropriate direction. The direction the cart moves is the opposite sign of the pendulum angle immediately after it crosses the downwards position. When the direction of the cart movement is determined, a constant voltage gain is applied to the cart motor in that same direction until the pendulu
34、m returns to the downwards position. This control scheme will effectively move the cart back and forth along the track repeatedly until the pendulum swings close enough to the upright position. It is important to note that the nature of this control scheme is that the same cart movement is applied r
35、egardless of whether the pendulum is above or below the horizontal axis (since the sign of the pendulum angle remains the same). The nature of the cart-pendulum system, however, is that the same cart movement that once added energy to the pendulum while it was below the horizontal axis now 第7頁 actua
36、lly takes away energy from the pendulum. Eventually, the pendulum will reach a point where it can add no more energy to the pendulum system but it has yet to build enough energy to reach the upright position. To avoid this phenomenon, a switch has been implemented that changes the voltage input to t
37、he cart motor to 0 when the pendulum is 135 from the downwards position. As a result, the cart will not move to take energy away from the pendulum system when the pendulum is higher than 135. This will allow the pendulum to simply return to the downwards position without losing anymore energy. When
38、the pendulum crosses the downwards position again, the logic-based controller will be able to add more energy to the pendulum until it eventually approaches the upright position. The voltage gain of this control scheme is determined by repeated experimentation. There is a direct correlation between
39、the time it takes to swing the pendulum to its upright position and the magnitude of the voltage gain. A gain that is too high, though, may make the pendulum approach the upright position with too high a velocity and, thus, the stabilizing controller will be unable to balance the pendulum. On the ot
40、her hand, a gain too low may not provide enough energy to the pendulum so that it can reach the upright position. Also, the reliability of the controller in performing the task varies depending on the gain selected. Thus, repeated experimentation is required to finely tune the gain so that the pendu
41、lum approaches the upright position with just the right amount of velocity and in a reasonable amount of time with a high success rate. Energy Controller The swinging up of a pendulum from the downwards position can also be accomplished by controlling the amount of energy in the system. The energy i
42、n the pendulum system can be driven to a desired value through the use of feedback control. By adding in enough energy such that its value corresponds to the upright position, the pendulum can be swung up to its unstable equilibrium. When the pendulum is close to the upright position, the stabilizin
43、g controller designed earlier can be triggered to catch the pendulum and balance it around the unstable equilibrium. The system is defined such that the energy, E, is zero in the upright position. The energy of the pendulum can be written as Where 第8頁 and mp is the mass of the pendulum, l is the hal
44、f-length of the pendulum, g is the acceleration of gravity, and I is the rotational inertia. Thus, the energy in the pendulum is a function of the pendulum angle and the pendulum angular velocity. Note also that the energy corresponding to the pendulum in the downwards position is -2mpgl. The goal o
45、f the control scheme is to add energy into the system until the value corresponds to the pendulum in the upright position. The control law implemented to achieve the desired energy is where k is a design parameter and E0 is the desired energy level. The control output, a, is the acceleration of the
46、pivot which can be translated to a voltage input to the cart motor by using equation (4) and the fact that: for the system. In this control scheme, the satV function is defined as the value for which the voltage supplied to the cart saturates. This controller essentially uses pendulum angle and pend
47、ulum angular velocity to determine the direction the cart should move at any point in time. A proportional controller that scales with the amount of energy still required to achieve the desired energy state dictates the amount of voltage applied to the cart motor. The value of the parameter V in sat
48、V dictates the maximum amount of control signal available and thus the maximum amount of energy increase to the pendulum system. The value of k determines how much the control favors using the maximum control input to achieve the desired energy state. This control is effective in increasing the ener
49、gy of the pendulum to a desired value. When used as a swing-up control method, the desired value corresponds to the energy of the pendulum in its upright position. This will allow the switch to be triggered so that the stabilizing controller can be used to catch the pendulum and balance it around th
50、e unstable equilibrium point. 6. EXPERIMENTAL RESULTS Results were gathered from the implementation of both swing-up control methods. Data were collected from experimental runs where each control scheme swings up the pendulum from an initially downwards position to an upright position and balances t
51、he pendulum around the unstable equilibrium point. The heuristic controller was finely tuned to swing the pendulum by applying a constant voltage of 3.26 V. Repeated experimentation with this voltage gain showed that this controller was successful in swinging the pendulum to an upright position for
52、the stabilizing controller to maintain the balanced state about 75% of the time. A plot of the controller output during an experimental run for the heuristic 第9頁 controller is shown in Figure 2. Figure 2. Plot of Control Output for the Heuristic Controller It is important to note that the swing-up c
53、ontroller takes approximately 12.5 seconds to reach the upright position. The point at which the stabilizing controller catches the pendulum in the upright position is clearly displayed in the plot. Also, the control output to the cart motor alternates between 3.26 V and -3.26 V as determined by pen
54、dulum angle. At a little under 7 seconds, the control output also begins to output 0 V at small stretches of time since the pendulum angle is beyond 135 from the downwards position. Thus, it takes about another 5.5 seconds for the pendulum to get from beyond 135 from the downwards position to within
55、 5 of the upright position. The corresponding plot of the pendulum angle is shown in Figure 3. Each swing increases the pendulum angle slightly until the pendulum is close to its unstable equilibrium. The controller takes about 13 swings before the pendulum is close enough to the upright position fo
56、r the stabilizing controller to catch it. The point in which the stabilizing controller is activated is discernible from the plot. Also, once activated, the pendulum angle remains fairly constant around the balanced position. Figure 3. Plot of the Pendulum Angle for the Heuristic Controller The ener
57、gy controller is implemented with the design parameter, k, chosen to be 6.5. Also, as a result of the friction in the cart-pendulum system and the approximation made in equation (18), the desired energy was offset to a value slightly higher than 0. The appropriate offset can be determined 第10頁 throu
58、gh experimentation. In these experiments, the offset is raised to E0 = 0.70. Repeated experimentation on the energy controller showed that this controller was reliable at least 90% of the time. A plot of the controller output during an experimental run using the energy controller is shown in Figure 4. Figure 4. Plot of the Control Output for the Energy Controller It is important to note that the energy control takes approximately 10 seconds to reach the upright position. The control output initially alternates between 5.5 V and -5.5 V since it attempts to increase the e
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度診所執(zhí)業(yè)醫(yī)師醫(yī)療風(fēng)險(xiǎn)防控聘用合同
- 二零二五年度手車轉(zhuǎn)讓與綠色出行推廣合同
- 二零二五年度投資分紅股收益分配協(xié)議
- 二零二五年度汽車展覽會(huì)參展商展位電力合同
- 2025年度道路破碎修復(fù)與再生利用合同
- 2025年度青貯收割作業(yè)與農(nóng)業(yè)物聯(lián)網(wǎng)平臺(tái)合作協(xié)議
- 二零二五年度口腔診所醫(yī)生培訓(xùn)與薪酬管理合同
- 二零二五年度商業(yè)秘密保護(hù)與員工保密義務(wù)合同
- 二零二五年度多功能辦公場(chǎng)所租賃服務(wù)協(xié)議
- 2025年度蔬菜大棚承包與品牌授權(quán)合作協(xié)議
- 《高性能樹脂》課件
- 中央2024年中央宣傳部直屬單位招聘106人筆試歷年典型考題及考點(diǎn)附答案解析
- 《教育向美而生-》讀書分享課件
- 拒絕校園欺凌從我做起完整版課件
- 幼兒園《認(rèn)識(shí)醫(yī)生和護(hù)士》課件
- 技術(shù)進(jìn)口合同登記證
- DZ∕T 0372-2021 固體礦產(chǎn)選冶試驗(yàn)樣品配制規(guī)范(正式版)
- 細(xì)菌的分離培養(yǎng)與培養(yǎng)特性觀察課件講解
- 國家電網(wǎng)公司輸變電工程工藝標(biāo)準(zhǔn)庫變電工程部分
- 海上風(fēng)電場(chǎng)工程結(jié)構(gòu)安全監(jiān)測(cè)建設(shè)規(guī)范
- 壓力管道焊接2020年壓力管道檢驗(yàn)師培訓(xùn)課件
評(píng)論
0/150
提交評(píng)論