
The Implementation of PC-Based Real-Time Control Systems Using Quadratic Optimal Control PC-Based 二次式最佳控制之即時控制系統 The Implementation of PC-Based Real-Time Control Systems Using Quadratic Optimal Control 柯德祥 張曉維 Dershyang Ker Hsiao-Wei Chang 中華技術學院電機工程系副教授及講師 摘要 本文以 VisSim 為系統發展環境,以數學方塊圖模式設計開發現代控制演 算法,以 PC 為主控制器配合資料擷取介面卡整合伺服控制系統,實現現代控制 演算法於 PC-Based 即時控制系統。首先以一簡單控制系統為例,推導二次式最 佳控制理論並符合性能指標之最小化,求得最佳控制器理論值;另外以 VisSim 為系統發展環境,無需理論推導,即可得到二次式最佳控制器模擬值,並與理 論值作比對,驗證其正確性。 然後將此法應用於實際 FB-33 伺服控制系統,建 立數學模式於 VisSim,即可輕鬆得到二次式最佳控制器。最後,再配合商用資 料擷取介面卡與動態連結函數庫整合 FB-33 控制系統,完成 PC-Based 即時控制 系統,實現二次式最佳控制演算法於伺服控制系統。 關鍵詞:PC-Based 即時控制系統、二次式最佳控制、資料擷取介面卡。 ABSTRACT The goal of this paper is to implement the quadratic optimal control algorithm in PC-Based real time control systems by using mathematic model blocks in VisSim software package environment. We use PC as a controller to apply quadratic optimal control algorithm in PC-Based real time control systems using plug-in PCI data acquisition interface card. First, a design example based on the quadratic optimal control algorithm is given. The theoretical state feedback controller can be obtained. An alternative approach using VisSim’s OptimizePro to automatically calculate optimal state feedback controller has been verified to be a very powerful method to avoid tedious theoretical design. Second, the model of the real control system, FB-33 control system, can be set up in VisSim. The quadratic optimal controller can be - 439 - The Implementation of PC-Based Real-Time Control Systems Using Quadratic Optimal Control easily obtained without the theoretical design. Finally, the PC controller uses the quadratic optimal controller and data acquisition system to control the FB-33 servo control system. The satisfied results are shown in this paper. Keywords:PC-Based Real Time Control System, Quadratic Optimal Control, Data Acquisition Interface Card. 1. Introduction Depending on the popularity and development of PC-Based controller, the demand of market is rapidly growing [1]. The IPC, I/O interface card, motion control card and the related peripheral hardware in Taiwan that have the competitive ability of the market [2]. We also find the data acquisition system of popularity use that is lack of the effective modern control method and mathematical calculation functions, so that it is only used as virtual instruments [3][4]. This makes modern & constant progress control algorithms to be unable to really apply in industrial control. The related fields of domestic and abroad, implementing modern control algorithms in PC-Based real time control systems, still have many problems to be needed to overcome. This paper uses VisSim as a system developing environment to design and develop advance modern control algorithms by mathematic model blocks. VisSim is a Windows-based program for the modeling, design and simulation of complex control systems without writing a line of code [5]. It combines an intuitive drag-and-drop block diagram interface with a powerful mathematical engine. The visual block diagram interface offers a simple method for constructing, modifying and maintaining complex control system models. Furthermore, VisSim offers unprecedented ease-of-use and consequently a shorter learning curve than competitive systems. In designing optimal control systems, we are often interested in selecting a control vector such that a given performance index is minimized [6][7]. It can be proved that a quadratic performance index will yield linear control law. Setting up a simulation in VisSim is simple. Connect the controller to the mathematical model and to a plot block. VisSim/Optimize can determine optimal values for design variables subject to the given performance indexes starting from initial guess values [8]. VisSim/Optimize can automatically calculate optimal control vector that give minimal performance indexes. It allows user-specified cost functions that can - 440 - The Implementation of PC-Based Real-Time Control Systems Using Quadratic Optimal Control consider controller behavior, such as steady-state error, overshoot and rise and settling times. Finally, We use the optimal control vector built up in PC to work with the FB-33 control system [9] when coupled with VisSim’s Real-Time through data acquisition interface card [10][11]. 2. Quadratic Optimal Control The control system is shown in Figure 1. We consider the optimal control problem based on quadratic performance indexes that, given the system equations • x = Ax + Bu (1) In designing control systems, we are interested in determining the optimal feedback gain matrix K of the optimal control vector u(t) = −Kx(t) (2) so as to minimize the performance index ∞ ∞ ∞ J = ∫ L(x,u)dt =∫ (xT Qx + u T Ru)dt = ∫ xT (Q + K T RK)xdt (3) 0 0 0 where Q is a positive-definite Hermitian or real symmetric matrix and R is a positive-definite Hermitian or real symmetric matrix. From Figure 2, we find that the state equation for the plant is ⎡0 1⎤ ⎡0⎤ ⎡1 0⎤ A = ⎢ ⎥ B = ⎢ ⎥ Q = ⎢ ⎥ (4) ⎣0 0⎦ ⎣1⎦ ⎣0 µ⎦ Figure 1 Optimal control system - 441 - The Implementation of PC-Based Real-Time Control Systems Using Quadratic Optimal Control Let us assumed that d xT (Q + K T RK)x = − (xT Px) (5) dt where P is a positive-definite Hermitian or symmetric matrix. Therefore xT (Q + K T RK)x = −xT [(A − BK)T P + P(A − BK)]x (6) Comparing both sides of this last equation, we obtain (Q + K T RK) = −[(A − BK)T P + P(A − BK)] (7) Using the second method of Liapunov, if A-BK is a stable matrix, there exists P that satisfies Equation (7). Hence we can evaluate the performance index J as ∞ ∞ J = xT (Q + K T RK)xdt = −xT Px = −xT (∞)Px(∞) + xT (0)Px(0) (8) ∫0 0 It can be obtained that X (∞) tends to zero because all eigenvalues of A-BK have negative real parts. Then, the value of J can be given by J = xT (0+)Px(0+) (9) Since R has been assumed to be a positive-definite Hermitian or real symmetric matrix, we can write R = T T T . The Equation (7) will become (AT − K T BT )P + P(A − BK) = −(Q + K T T T TK) (10) which can be rewritten as AT P + PA + [TK − (T T ) −1 BT P]T [TK − (T T ) −1 BT P] − PBR −1BT P + Q = 0 (11) To minimize J with respect to K. This yields K = T −1 (T T ) −1 BT P = R −1BT P (12) Equation (12) gives the optimal matrix K. The P matrix in Equation (12) must satisfy the reduced matrix Ricatti equation as AT P + PA − PBR −1BT P + Q = 0 (13) Noting that the matrix A is real and matrix Q is real symmetric, matrix P is real symmetric matrix in Equation (4). Solving Equation (13) for the pij , we obtain ⎡ p11 p12 ⎤ ⎡ µ + 2 1 ⎤ P = ⎢ ⎥ = ⎢ ⎥ (14) ⎣ p21 p22 ⎦ ⎣⎢ 1 µ + 2⎦⎥ Substituting Equation (14) to Equation (12), the optimal feedback gain matrix K can be written as - 442 - The Implementation of PC-Based Real-Time Control Systems Using Quadratic Optimal Control −1 T ⎡ p11 p12 ⎤ K = R B P = [1][[]0 1 ⎢ ⎥ ⎣ p21 p22 ⎦ = [1 µ +1] (15) Then, the optimal control signal is u(t) = −Kx(t) = −x1 − µ + 2x2 (16) Therefore, the block diagram of this optimal control system is shown in Figure 3. Figure 3 Optimal control of the plant shown in Figure 2 3. Verifying Quadratic Optimal Control with VisSim/Optimize To verify the quadratic optimal control law described above, it can be easily done using VisSim/OptimizePro. It is convenient to use VisSim/OptimizePro for optimization problems on VisSim simulations and models because VisSim/Optimize was designed and implemented to take advantage of the VisSim environment. We can use all of the features of VisSim to create the cost function. VisSim dialog box make it easy to set upper and lower bounds on design variables. The Optimization Properties dialog box is used to select an optimization run. The control system shown in Figure 2 has a feedback gain matrix with two parameters. Following the quadratic optimal control law, this feedback gain matrix K can be also optimized using VisSim/OptimizePro shown in Figure4. The state feedback controller has two variables k1 and k2 . The cost function shown in Figure 5 is computed by integrating the quadratic function L(x,u) in Equation (3). The plant is produced with two integrator blocks. Once the initial conditions of the plant and initial values of k1 and k2 are set, a simulation run produces the results in Figure 4. The final value of the cost function is - 443 - The Implementation of PC-Based Real-Time Control Systems Using Quadratic Optimal Control 1.73212. The final values of k1 and k2 are 0.999955 and 1.73203, respectively. It can be seen that the errors between the simulation results and the theoretical values in Equation (15) are less than 0.0001%. x2 x1 Tuned Plant Controller 2.0 u 1/S 1/S Measured output Plant 1.5 1.0 objectiveFunction cost .5 173.212 0 0 2 4 6 8 10 1 parameterUnknown k2 1.73203 Time (sec) 1 parameterUnknown k1 .999955 $runCount 70 Starting values Optimized state feedback controller gains Feedback k2 * x2p x2 k1 - * u x1 x1p - Figure 4 The optimal state feedback controller tuning diagram with VisSim/Optimize x2 pow + x1 pow + 1/S 100 Error u pow + Figure 5 The block diagram of the cost function in Equation (3) 4. Quadratic Optimal Control in Real Systems Implementing Quadratic Optimal Control algorithm to the mathematical model of FB-33 system using VisSim/OptimizePro The FB-33 Feedback control system, the apparatus of automatic control laboratory, is a typical second-order system [6]. The objective of this system is to control the position of the mechanical load in accordance with the reference position.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages9 Page
-
File Size-