# Fuzzy Model Predictive Control for Unmanned Helicopter
## 3 Control Methodology
### Model Predictive Control Principles  
Model Predictive Control is an advanced method of designing automatic control systems. The formulation of the MPC method is based on solving the general optimization problem [33], which is stated below (1). \[\mathbf{u}=\arg\min_{\mathbf{u}}J(\mathbf{x}(t_{0}),\mathbf{u}) \tag{1}\]  
The cost function in the MPC framework is a sum over a finite prediction horizon, which represents the deviation of the system's predicted trajectory while penalizing control effort (2). It depends on the initial state vector \(x(t_{0})\) and the future control vector \(u\). \[J(\mathbf{x}(t_{0}),\mathbf{u})=\sum_{i=1}^{N}||\mathbf{r}_{p}(i)-\mathbf{x}(i)||_{Q}^{2}+\sum _{i=0}^{N_{u}-1}||\mathbf{u}(i)||_{R}^{2} \tag{2}\]  
Figure 2: Automatic Flight Control System scheme (Source: Authors’ own work). In the equation above,  
* \(\mathbf{x}(i)\in\mathbb{R}^{m}\) refers to the state vector of the controlled system at time \(i\);
* \(\mathbf{r}_{p}(i)\in\mathbb{R}^{m}\) describes the reference trajectory vector in the state space at time \(i\);
* \(\mathbf{u}(i)\in\mathbb{R}^{n}\) describes the future control vector determined at time \(i\);
* \(\mathbf{Q}\in\mathbb{R}^{m\times m}\) and \(\mathbf{R}\in\mathbb{R}^{n\times n}\) are positive semi-definite weighting matrices that differentiate the impact of individual components of the cost function on its scalar value;
* \(N\) is the prediction horizon, which describes the number of prediction steps based on the measured state;
* \(N_{u}\) is the control horizon, which denotes the number of different future control value increments determined by the algorithm. The intuition behind the cost function given in Equation (2) is that the control signal computed by the proposed algorithm aims to minimize the sum of the integral of the squared error (ISE) of the state vector over the finite prediction horizon \(N\) and the integral of the squared control signals over the control horizon \(N_{u}\). Minimizing the ISE of the state vector ensures sufficient control action to achieve satisfactory tracking performance, while minimizing the control effort constrains the control signals and helps to obtain control actions with relatively low effort. In contrast, classical PID controllers generate control signals based on the current, integral, and derivative of the error signal at the present time, without explicitly considering future system behavior or even the calculated control signal. While PID control is simple, computationally inexpensive, and effective for many linear time-invariant systems, it may struggle with systems exhibiting nonlinearities, constraints, or time-varying dynamics. MPC's advantage lies in its ability to predict future states and optimize control actions over a horizon, explicitly incorporating constraints on states and inputs. This predictive and optimization-based framework allows MPC to handle complex Multiple Input-Multiple Output (MIMO) systems more effectively than PID, especially when precise tracking and constraint satisfaction are required. For the purpose of derivation of the linear MPC regulator, we assume that our plant can be described as a linear-time-invariant (LTI) system, where full-state feedback is assumed. Therefore, system dynamics can be represented in the standard form (3). \[\dot{\mathbf{x}}=\mathbf{A}\mathbf{x}+\mathbf{B}\mathbf{u} \tag{3}\]  
In the formula above, \(\mathbf{A}\in\mathbb{R}^{m\times m}\) and \(\mathbf{B}\in\mathbb{R}^{m\times n}\). In the presented approach, the mathematical model of the plant used in a state prediction is a discretized form of a linear dynamical system with a full state measurement (4), where discrete state and control matrices (5) are derived from the Cauchy-Bellman equation.