Modele dayalı öngörülü kontrol çözüm paketlerinin karşılaştırılması
Comparison of model predictive control toolkits
Yazar: MEHMET CÜNEYT HASPOLAT
Danışman: YRD. DOÇ. DR. YAPRAK YALÇIN
İstanbul Teknik Üniversitesi / Fen Bilimleri Enstitüsü / Kontrol ve Otomasyon Mühendisliği Ana Bilim Dalı / Kontrol ve Otomasyon Mühendisliği Bilim Dalı
Derece: Yüksek Lisans, 2017
Konu: Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrol = Computer Engineering and Computer Science and Control
Dizin: Model kontrolü = Model control ; Optimal kontrol = Optimal control

Özet:
Ölü zaman klasik kontrol yöntemleri için büyük bir sorun oluşturmaktadır. Diğer bir taraftan sistem gerekliliğinden ve fiziksel olarak oluşabilecek sorunlardan dolayı oluşturulması istenen kısıtlamalar mevcuttur. Ölü zaman giderme probleminin ortadan kaldırılmasına ve kısıtlamalara imkan veren modele dayalı öngörülü kontrol, bahsedilen özelliklerinden dolayı endüstriyel kullanımı oldukça yaygındır. Endüstriyel kullanımı olarak petrol damıtılması, su nötralizasyonu, pH dengesi, batarya şarj ve deşarjı gibi alanlarda kullanılmakta olup diğer kontrol sistemleri ile beraber kullanımını görmekte mümkündür.
Modele dayalı öngörülü kontrolde durum uzayı, transfer fonksiyonu gibi model tipleri, lineer veya nonlineer model yapısı, lineer veya nonlineer kısıtlamalar ve kontrolörün lineer veya nonlineer yapıda olmasına bağlı olarak birden fazla varyasyon bulunmaktadır. Modele dayalı öngörülü kontrolde kullanılan temel bileşenler maliyet fonksiyonu, kısıtlamalar, kontrol ve öngörü ufku ve referans yörüngesidir. Modele dayalı öngörülü kontrolde optimal kontrol problemi çözümü yapılıp kontrol kuralı ve istenen çıkış bilgisine ulaşılmaktadır. Kısıt içeren ve nonlineer model öngörülü kontrol problemlerinin analitik çözümü bulunmamakta, çözüm için yavaş sonuç veren numerik optimizasyon yöntemleri kullanılmaktadır. Bu sebeple çok hızlı sistemlerde tercih edilmemektedir.
Bu tez çalışmasında modele dayalı öngörülü kontrolün literatür taraması ve endüstriyel kullanımı üzerine araştırmalar yapılmış, MPC hazır çözüm paketleri incelenerek karşılaştırılmaları gerçekleştirilmiştir. Modele dayalı öngörülü kontrol temel prensipleri ve temel bileşenleri lineer ve nonlineer modeller üzerine matematiksel olarak anlatılmış olup, bir örnek sistem için modele dayalı öngörülü kontrol için yazılmış hazır algoritmik çözüm paketlerinin kullanımına uygun problem formalizasyonları gerçekleştirilip, çözümler oluşturulup, sonuçlar karşılaştırılmıştır. İncelenen algoritmik çözüm paketlerinden ilki "Nonlinear Model Predictive Control" kitabının yazarları Lars Grüne ve Jürgen Pannek tarafından hazırlananmıştır. Bunun yanı sıra  "Imperial College" tarafından hazırlanan Imperial College algoritmik çözüm pakedi ve Mathworks tarafından hazırlanan bir algoritmik çözüm pakedi incelenmiştir. Yazılmış olan algoritmik çözüm paketlerinin vermiş olduğu çözümlerin referans takipleri integral karesel hata ve integral mutlak hata ile belirlenip  çalışma süreleri de göz önünde bulundurularak karşılaştırmalar gerçekleştirilmiştir. 
Modele dayalı öngörülü kontrol algoritmik çözüm paketleri karşılaştırılmasında araba ve ters sarkaç sistemi ele alınmıştır. Kontrol edilmek istenen değişkenler aracın konumu ve sarkacın açısıdır. Belirli başlangıç açı değeriyle deneyler yapılmış olup 0.2 rad açı değeri için sonuçlar oluşturulmuştur. Modele dayalı öngörülü kontrol algoritmik çözüm paketlerinin karşılaştırılmasında MATLAB ve Simulink programları kullanılmıştır.

Anahtar Kelimeler: Modele dayalı öngörülü kontrol, model, lineer, nonlineer kısıtlama, araba ve ters sarkaç, Imperial College algoritmik çözüm paketi, NMPC algoritmik çözüm paketi, Mathworks algoritmik çözüm paketi

Abstract:
Since the model predictive control is an advanced control method that can be applied for industry, it has gained considerable importance in the 80's and especially in the 90's since the end of the 70's.
There are a lot of studies for model predictive control such as crude oil distillation, electricity distribution, pH balance of wastewater, flow control of fuel batteries, energy consumption, network control for direct current motor.
Model-predictive control represents a class of controllers that calculate the appropriate control sequence to estimate the future behavior of the system under consideration and to optimize this estimate.
In model predictive control, the relationships between the system variables must be analyzed to understand which model is being used. System responce depends on the accuracy of the model, for instance, model of system is a linear. Thus, system responce depends on the accuracy of linear model used.linear model used. For model predictive control, there are state space model, transfer function model, step response model and impulse response model. In this thesis, state space model is emphasized. 
Model predictive control consists of componenets to solve optimal control problem. Components of model predictive control are cost function, reference trajectory, constraints and control and prediction horizon.
Cost function is the one of the components which is also known as fitness function and objective function. It is used to obtain appropriate solution by using minimization or maximization methods. These cost functions may have variabilities from problems to problems but usually it is the purpose of the predicted output to follow the reference signal. The predicted output is intented to follow reference signal along the control horizon and to stay control signals in certain limits.
For reference trajectory, following can be said. Model based predictive controls one of the most important advantage is, if reference value known in advance, any change that may occur in the reference is to avoid delays that may occur at the system responce, adapting to this change before changing the system's output.
One of the components is constraint. Almost every system in the application area has constraints. Because of some reasons such as constructial reasons, security, enviromental factors and physical limitations,  real time systems have constraints. For instance, actuators have certain operating rate and actuators can't out of these operating limits. Model predictive control ensures that the optimal control solution remains within these limits by using the constraints.
The another component is control and prediction horizon. These components can be explained with one example. When considered to be on a road, it can be observed a certain distance along the road. Observing distance does not change, even if the travel distance increases. For example; For example; While traveling on a path with a certain distance of view, there is new information about the road for every travel distance. With this information, the values of variables such as speed are updated. These are the control actions for the system. The important question here is how large is the control horizon. Intuitively, the control horizon must be greater than the settling time. Otherwise, system dynamics may be neglected and performance may be affected worst way.
The performance index given in order to obtain control law should be minimized. Future control signals are calculated by the input's past value, past value of the output, and future control signals.
One of the key issues in nonlinear models predictive control is that the predictive control strategy based on a finite horizon which leads to closed loop uncertainty. As noted, the most important problem with a finite prediction and control horizon is that the predicted open loop and resulting closed loop behavior is generally different.
A nonlinear model predictive control strategy that achieves closed-loop stability, by using finite horizon, infinite horizon and pseudo infinite horizon.  
The model used for toolkit comparison is the cart and pendulum model. The cart and pendulum system used consists of a pendulum placed on a moving vehicle and examines movements in the pendulum by the action of the vehicle.
The system is the force applied to the car as an input and the two outputs are the position of the car and the angle of the pendulum. Pendulum has two balance points. When the pendulum is in the steady state, it returns to its former position with deterioration and other influences that affect its condition. The pendulum is aimed to be controlled and maintained at the equilibrium position while in the unstable equilibrium position.
About toolkits, "Nonlinear Model Predictive Control" is the algorithm prepared by the authors Lars Grüne and Jürgen Pannek. There is also a Imperial College toolkit by Imperial College and a toolkit by MathWorks.
The same steps are followed for the three toolkits and the prediction and control horizon, sampling time assignments are made and the states are measured on the model. The optimal control problem is solved by the measurements taken afterwards. 
During this solution, various constraints are placed on the control signal, control signal alteration and output. According to this constraints, it examines whether it is a feasible solution. If there is a solution, the control signal is applied for the next output. These steps are repeated with a receding horizon.
There are two error criteria in the comparison of the toolkits, which are determined for reference tracking. Integral square error and integral absolute error are these error criteria. The success of toolkits has been measured according to these error criteria. In addition, the other period of time as a performance criterion has been added to the account.
In briefly, model based predictive controls literature research and industrial use have been done. Model based predictive controls basic principals and basic components are described by mathematically with linear and non-linear models and modeled than controlled with written toolkit for predictive control. Written algorithms reference tracking are determined by the integral square error and integral absolute error and compared with algorithms running times.
In the comparison of model predictive control algorithms, the cart and pendulum system is considered and initial condition of pendulum angle is 0.2 rad. MATLAB and Simulink programs are used.

Keywords: Model predictive control, prediction and control horizon, constraint, optimization, nonlinear model predictive control, toolkit, optimal control problem, Imperial College toolkit, Mathworks toolkit, NMPC toolkit,