模型預測控制

維基百科,自由的百科全書

模型預測控制(Model predictive control、MPC)是過程控制中,在滿足特定限制條件時,控制過程的進階控制方式,自1980年代起已用在化學工廠煉油廠的工業過程中。近年來也用在電力系統的平衡模型[1]以及電力電子學[2]。模型預測控制是以過程的動態模型為基礎,多半是透過系統識別得到的線性經驗模型。模型預測控制的特點是每一次針對目前的時間區塊內作最佳化,然後下一個時間再針對時間區塊內作最佳化,這和LQR控制器不同。模型預測控制可以預測未來事件並且進行對應的處理。PID控制器沒有這樣的預測功能。模型預測控制幾乎都是用數位控制來實現,不過也有研究指出若使用特殊設計的類比電路,其反應時間可以更快[3]

廣義預測控制(Generalized predictive control,簡稱GPC)以及動態矩陣控制(dynamic matrix control,簡稱DMC)都是典型模型預測控制的例子[4]

簡介[編輯]

會用到模型預測控制的模型一般都是用來呈現複雜動力系統的特性。若是針對簡單系統的精準控制,多半不需要用到複雜的模型預測控制演算法,可能用泛用的PID控制器即可處理,若是系統有很長的時間延遲或是高階系統,其控制特性才會複雜到超過PID控制器可控制的程度。

模型預測控制會預測建模的系統在自變量變化時,對應的因變量變化。在化學製程中,控制器可以調整的自變量可能是PID控制器的目標值(壓力、流量、溫度等),或是最終控制單元(閥、加濕器等)的輸出。若是不能被控制器調整的自變量,會視為干擾來處理。製程中的因變量一般是對於控制目標的量測,或是一些製程限制條件的量測。

模型預測控制會用目前受控體的量測數值、目前製程的動態狀態、模型預測控制的模型,以及製程變數目標以及限制來計算因變量未來的變化。計算變化的目的是讓因變量儘量接近目標,並且讓因變量及自變量都在限制條件範圍內。模型預測控制一般會針對自變量先送出一個控制需要的變化,重複計算,一直到需要下一個變化時再送出下一個指令。

許多實際的製程不是線性的,不過在小的操作範圍內可以視為是線性的。大部份的應用可以使用線性模型預測控制,模型預測控制的回授機制會補償因為模型及實際製程之間的結構不一定所產生的估測誤差。假如預測控制器中的模型都是線性模型,根據線性代數中的疊加原理可以讓幾個獨立變數變化的效果加成,並且可以預測到應變量的變加。因此可以將控制問題簡化成一連串直接的矩陣代數計數,速度快,而且有強健性。

假如線性模型已經無法描述實際系統的非線性特性,有許多不同的作法。有些情形下,製程變數可以在模型預測控制器前後進行轉換,以減少其非線性的特性。也可以直接用非線性的模型預測控制來控制,直接用非線性的模型來符合實際的應用。非線性模型可以是由實際資料所合成(例如用人工智慧的類神經網路),或是以質量平衡及能量平衡為基礎的高保真動態模型。非線性模型可以線性化以得到卡爾曼濾波,或是其他可以用在線性模型預測控制的模型。

El-Gherwi、Budman及El Kamel的演算法研究指出,利用雙模式的方法,可以讓即時計算量顯著下降,而其性能和調整前相當。此演算法會以各控制器之間交換資訊為基礎,平行求解N個凸優化問題[5]

模型預測控制背後的理論[編輯]

離散的模型預測控制

模型預測控制是以針對受控體模型的迭代式、有限時域滾動(finite-horizon)最佳化為基礎。在時間時針對受控體的狀態取樣,並且針對未來一段很短的滾動時域,計算使費用最小化的控制策略(數值最小化演算化)。特別會使用在線或是on the fly的計算來探索由目前狀態演進的狀態軌跡,並且(透過歐拉-拉格朗日方程)計算在時間之前的費用最小化策略。控制策略只會實現其中的第一步,之後會再取樣系統的狀態,再由新的狀態去計算新的控制策略,並且預測新的狀態路徑。預測的時間域會漸漸前進,因此模型預測控制也稱為滾動域控制(receding horizon control)。雖然此方法不一定是最佳化的,但在實務上有不錯的效果。有計多的學術研究致力於找到歐拉-拉格朗日形式方程的快速求解方式、找到MPC局部最佳解的全域穩定性,以提昇模型預測控制的效果。[6]

模型預測控制的原則[編輯]

模型預測控制(MPC)是多變數的控制演算法,利用:

  • 程序的內在動態模型
  • 過去的控制訊號
  • 針對滾動預測域的最佳化費用函數J

來計算最佳化的控制訊號

以下是一個最佳化非線性費用函數的例子:

沒有限制條件(上下限),而一些變數定義如下

:第個受控變數(例如量測溫度)
:第個參考變數(例如目標溫度)
:第個輸出控制變數(例如控制閥)
:反映相對重要性的加權係數
: 懲罰相對大幅變化的加權係數

非線性模型預測控制[編輯]

非線性模型預測控制(NMPC)是模型預測控制的一種變形,在預測時使用非線性的系統模型。非線性模型預測控制也需要在一個有限的預測時間區間內反覆計算最佳解。這些問題可能在線性模型預測控制中有convex的性質,而在非線性模型預測控制中就沒有convex性質。因此在非線性模型預測控制的穩定性理論以及數值解上都具有挑戰性[7]

非線性模型預測控制的數值解一般是用直接式的最佳控制方式,利用牛頓式的最佳化架構,多半是利用以下方式的變體:打靶法直接多重打靶法英語direct multiple shooting method或是選點法英語Collocation method[8]。非線性模型預測控制演算法一般會用連續最佳控制的解會彼此相似的特性,因為可以用牛頓式的方式有效的求解,作法是用以下計算過的最佳解經適當調整,作為猜測值,因此可以節省許多的運算時間。這類問題的相似性更進一步的被路徑跟蹤算法(或是實時迭代法)所使用,路徑跟蹤算法中,不會針對某一個最佳化問題計算到收斂,而是在開始新的一步之前,針對最新的非線性模型預測問題進行幾次的迭代[9]

非線性模型預測控制以往主要應用在化工等取様速度較慢的產業,不過隨著控制器硬體以及計算演算法的進步(例如預處理英語preconditioning[10],非線性模型預測控制也用在一些高取樣速度的應用中,例如車輛產生,或是狀態是分散在空間中不同位置的系統(分佈式參數系統[11]。在航天產業上,非線性模型預測控制也已用在最佳地形跟蹤/迴避軌跡的實時跟蹤[12]

顯式模型預測控制[編輯]

顯式模型預測控制(eMPC)允許對某些系統快速的評估其控制律,這一點和在線MPC有明顯的不同。顯式模型預測控制是以參數規劃英語parametric programming技術為基礎,其中MPC控制問題的解(最佳化問題的目標)已在離線時先行計算[13]。離線計算的解(控制律)會以分段線性函數英語Piecewise linear function(PWA)的形式表示,因此eMPC控制器會儲存在狀態空間中每一個子集(控制區間)內PWA的係數,並令在同一子集內的係數為定值,而所有的區間中的係數可以用某種參數化的方式來表示。若是線性模型預測控制。每個控制區間在幾何上會變成凸多胞形,一般會用其各個面的係數來參數化,因此需要量化精度分析[14]。因此求得最佳控制解的作法會簡化為先決定包括目前狀態的區間,再來是用所有區間內的PWA係數來計算PWA。若區間數量不多,eMPC的實現(相較於線上MPC)不會需要很大的計算量,也特別適合有快速動態特性的控制系統[15]。不過eMPC有一個嚴重的缺點,其運算量會隨區間總數以及控制系統的一些重要參數(例如狀態數量)呈指數增長,此時需要的記憶體會大幅增加,也讓PWA評估的第一部份(尋找目前的控制區間)需要很大的計算量。

強健模型預測控制[編輯]

模型預測控制(MPC)的強健版本可以在存在有界擾動的情形下,仍確保符合狀態的限制條件。有三種主要的強健模型預測控制作法:

  • Min-max模型預測控制。在此作法下,會考慮擾動的所有可能演變來進行最佳化[16]。這是線性強健控制問題的最佳解,不過其計算成本很高。
  • 約束集緊縮模型預測控制(Constraint Tightening)。此處的狀態限制加大到一定範圍,以確保在任何擾動的演變下,都可以找到解的軌跡[17]
  • Tube模型預測控制。此作法會用一個獨立的系統主要模型,再利用回授控制器來確保實際狀態會收斂到主要狀態[18]。狀態限制需要區分的數量會由強健正不變(RPI)集來決定,是回授控制器的擾動帶來所有可能狀態偏差的集合。
  • 多階段模型預測控制。使用場景樹公式,用一組取樣數據來近似不確定空間,此作法是non-conservative的,因為在預測時,會考慮每一時間下可能有的量測資訊,每個階段的決策可能是不同的,可以作為抵制不確定性影響的手段。此作法的缺點是問題的大小會隨不確定性的數量以及預測範圍呈指數成長[19]


商品化的模型預測控制軟體[編輯]

目前已可購得商品化的模型預測控制軟體,一般也會包括模型識別及分析、控制器設計及調適的工具,也會有控制器性能評估的工具。

S.J. Qin and T.A. Badgwell在Control Engineering Practice期刊中(2003年,733–764)有針對商品化軟體的調查[20]

和LQR控制器的差異[編輯]

模型預測控制器和LQR控制器的主要差異是LQR控制器針對整個時間區間進行最佳化,而模型預測控制器針對不同的時間區間分別進行最佳化[4],因此在不同時間區間內,模型預測控制器可能會產生新的解,而LQR控制器會使用針對所有時間區間下的最佳解。因此模型預測控制器可以在存在硬約束的情形下進行實時的最佳化[4],不過多半是在較小的時間區域中求解最佳化問題,而不是在整個時間區域內求解,因此有時只能徥到次佳的解。

相關條目[編輯]

參考資料[編輯]

  1. ^ Michèle Arnold, Göran Andersson. "Model Predictive Control for energy storage including uncertain forecasts" 存档副本 (PDF). [2013年5月17日]. (原始內容 (PDF)存檔於2013年10月14日). 
  2. ^ Tobias Geyer: Model predictive control of high power converters and industrial drives, Wiley, London, ISBN 978-1-119-01090-6, Nov. 2016.
  3. ^ Vichik, Sergey; Borrelli, Francesco. Solving linear and quadratic programs with an analog circuit. Computers & Chemical Engineering. 2014, 70: 160–171. doi:10.1016/j.compchemeng.2014.01.011. 
  4. ^ 4.0 4.1 4.2 Wang, Liuping. Model Predictive Control System Design and Implementation Using MATLAB®. Springer Science & Business Media. 2009: xii. 
  5. ^ Al-Gherwi, Walid; Budman, Hector; Elkamel, Ali. A robust distributed model predictive control based on a dual-mode approach. Computers and Chemical Engineering. 3 July 2012, 50 (2013): 130–138. doi:10.1016/j.compchemeng.2012.11.002. 
  6. ^ Michael Nikolaou, Model predictive controllers: A critical synthesis of theory and industrial needs, Advances in Chemical Engineering, Academic Press, 2001, Volume 26, Pages 131-204
  7. ^ An excellent overview of the state of the art (in 2008) is given in the proceedings of the two large international workshops on NMPC, by Zheng and Allgower (2000) and by Findeisen, Allgöwer, and Biegler (2006).
  8. ^ J.D. Hedengren; R. Asgharzadeh Shishavan; K.M. Powell; T.F. Edgar. Nonlinear modeling, estimation and predictive control in APMonitor. Computers & Chemical Engineering. 2014, 70 (5): 133–148. doi:10.1016/j.compchemeng.2014.04.013. 
  9. ^ Ohtsuka, Toshiyuki. A continuation/GMRES method for fast computation of nonlinear receding horizon control. Automatica. 2004, 40 (4): 563–574 [2018-05-02]. doi:10.1016/j.automatica.2003.11.005. (原始內容存檔於2013-03-10). 
  10. ^ A. Knyazev; A. Malyshev. Sparse preconditioning for model predictive control. 2016 American Control Conference (ACC), Boston, MA. 2016: 4494–4499 [2018-05-02]. doi:10.1109/ACC.2016.7526060. (原始內容存檔於2020-08-13). 
  11. ^ M.R. García; C. Vilas; L.O. Santos; A.A. Alonso. A Robust Multi-Model Predictive Controller for Distributed Parameter Systems. Journal of Process Control. 2012, 22 (1): 60–71. doi:10.1016/j.jprocont.2011.10.008. 
  12. ^ R. Kamyar; E. Taheri. Aircraft Optimal Terrain/Threat-Based Trajectory Planning and Control. Journal of Guidance, Control, and Dynamics. 2014, 37 (2): 466–483. doi:10.2514/1.61339. 
  13. ^ Bemporad, Alberto; Morari, Manfred; Dua, Vivek; Pistikopoulos, Efstratios N. The explicit linear quadratic regulator for constrained systems. Automatica: 3–20. doi:10.1016/s0005-1098(01)00174-1. 
  14. ^ Knyazev, Andrew; Zhu, Peizhen; Di Cairano, Stefano. Explicit model predictive control accuracy analysis. 54th IEEE Conference on Decision and Control (CDC), Osaka, 2015: 2389–2394. [2018-05-02]. doi:10.1109/CDC.2015.7402565. (原始內容存檔於2021-01-18). 
  15. ^ Klaučo, Martin; Kalúz, Martin; Kvasnica, Michal. Real-time implementation of an explicit MPC-based reference governor for control of a magnetic levitation system. Control Engineering Practice: 99–105. doi:10.1016/j.conengprac.2017.01.001. 
  16. ^ Scokaert, P. O.; Mayne, D.Q. Min-max feedback model predictive control for constrained linear systems. IEEE Transactions on Automatic Control. 1998, 43 (8): 1136–1142. doi:10.1109/9.704989. 
  17. ^ Richards, A.; How, J. Robust stable model predictive control with constraint tightening. Proceedings of the American Control Conference. 2006. 
  18. ^ Langson, W.; I. Chryssochoos; S.V. Rakovic; D.Q. Mayne. Robust model predictive control using tubes. Automatica. 2004, 40 (1): 125–133. doi:10.1016/j.automatica.2003.08.009. 
  19. ^ Lucia, Sergio; Finkler, Tiago; Engell, Sebastian. Multi-stage nonlinear model predictive control applied to a semi-batch polymerization reactor under uncertainty. Journal of Process Control. 2013, 23 (9): 1306–1319. doi:10.1016/j.jprocont.2013.08.008. 
  20. ^ A survey of industrial model predictive control technology. [2018-05-02]. (原始內容存檔於2016-03-05). 

延伸閱讀[編輯]

  • Kwon, W. H.; Bruckstein, Kailath. Stabilizing state feedback design via the moving horizon method. International Journal of Control. 1983, 37 (3): 631–643. doi:10.1080/00207178308932998. 
  • Garcia, C; Prett, Morari. Model predictive control: theory and practice. Automatica. 1989, 25 (3): 335–348. doi:10.1016/0005-1098(89)90002-2. 
  • Findeisen, Rolf; Allgower, Frank. An introduction to nonlinear model predictive control. Summerschool on "The Impact of Optimization in Control", Dutch Institute of Systems and Control. C.W. Scherer and J.M. Schumacher, editors. 2001: 3.1–3.45. 
  • Mayne, D.Q.; Michalska. Receding horizon control of nonlinear systems. IEEE Transactions on Automatic Control. 1990, 35 (7): 814–824. doi:10.1109/9.57020. 
  • Mayne, D; Rawlings; Rao; Scokaert. Constrained model predictive control: stability and optimality. Automatica. 2000, 36 (6): 789–814. doi:10.1016/S0005-1098(99)00214-9. 
  • Allgöwer; Zheng. Nonlinear model predictive control. Progress in Systems Theory 26. Birkhauser. 2000. 
  • Camacho; Bordons. Model predictive control. Springer Verlag. 2004. 
  • Findeisen; Allgöwer, Biegler. Assessment and Future Directions of Nonlinear Model Predictive Control. Lecture Notes in Control and Information Sciences 26. Springer. 2006. 
  • Diehl, M; Bock; Schlöder; Findeisen; Nagy; Allgöwer. Real-time optimization and Nonlinear Model Predictive Control of Processes governed by differential-algebraic equations. Journal of Process Control. 2002, 12 (4): 577–585. doi:10.1016/S0959-1524(01)00023-3. 
  • James B. Rawlings, David Q. Mayne and Moritz M. Diehl: 」Model Predictive Control: Theory, Computation, and Design」(2nd Ed.), Nob Hill Publishing, LLC, ISBN 978-0975937730 (Oct. 2017).
  • Tobias Geyer: Model predictive control of high power converters and industrial drives, Wiley, London, ISBN 978-1-119-01090-6, Nov. 2016

外部連結[編輯]

  • Case Study. Lancaster Waste Water Treatment Works, optimisation by means of Model Predictive Control from Perceptive Engineering
  • ACADO Toolkit頁面存檔備份,存於網際網路檔案館) - Open Source Toolkit for Automatic Control and Dynamic Optimization providing linear and non-linear MPC tools. (C++, MATLAB interface available)
  • μAO-MPC頁面存檔備份,存於網際網路檔案館) - Open Source Software package that generates tailored code for model predictive controllers on embedded systems in highly portable C code.