# Semi-Analytical Planetary Landing Guidance with Constraint Equations Using Model Predictive Control
## 4 Model Predictive Control  
In this section, we embed our algorithm into the model predictive control framework and adopt several techniques to enhance the robustness. Model predictive control, also known as moving horizon control (MHC), receding horizon control (RHC), dynamic matrix control (DMC), and generalized predictive control (GPC), is a widely discussed feedback control strategy in recent years. According to the obtained current state information, MPC is a form of control in which a finite open-loop optimization problem is solved online at each sampling instant. The first element of the optimized control sequence is applied to the controlled object. The flow chart of the devised MPC algorithm is shown in Figure 8.  
At the beginning of the powered descent guidance, the reachability judgment and motion mode judgment are conducted. Taking into account possible dynamic faults and off-nominal situations in previous phases, the optimal landing point is redetermined according to the reachability and the fuel consumption. Then, the lander's state information is obtained at each sampling time, and the six variables \(t_{1},t_{\mathrm{f}},\mu_{\mathrm{x}},t_{\mathrm{x}},\mu_{\mathrm{y}},t_{ \mathrm{y}}\) are solved. In theory, the first element of the subsequent control sequence should be applied to the lander. However, this will lead to retarding ignition and a sudden change in thrust. To avoid this situation, we apply the average thrust between two sampling instants to the lander.  
Considering that the engines cannot switch frequently, \(t_{1}\) is set to \(0\) after ignition. To ensure that the number of constraint equations corresponds to the number of unknowns, we introduce a new variable \(\mu\), which can be understood as the thrust correction. Then, the thrust components in three directions are updated as \(\mu\cdot\mu_{\mathrm{x}}\), \(\mu\cdot\mu_{\mathrm{y}}\), and \(\mu\cdot\mu_{\mathrm{z}}\), respectively. The mass flow is also updated as \(-\mu\eta\).  
It is obvious that in a real-world application, the actual system operation will replace the simulation. To account for model uncertainties and external disturbances, the atmospheric effects and possible faults are considered, so that the perturbed state \(\mathbf{s}\) at the end of the control horizon is:  
\[\mathbf{s}(t+\Delta t) =\int_{t}^{t+\Delta t}(\mathbf{F}(\mathbf{s},\mathbf{u},t)-\mathbf{D}(t))dt+\mathbf{f} \tag{40}\]  
where \(\mathbf{F}\) is the dynamic Equations (1)-(3), \(\Delta t\) is the MPC command update interval, \(\mathbf{D}\) is the atmospheric drag, and \(\mathbf{f}\) represents the possible faults and external disturbances.  
Figure 8: MPC flow chart.  
For the design of an MPC controller, the recursive feasibility is crucial. Under nominal circumstances, the constraint equations can always be solved. However, when the external disturbances or possible faults make the system deviate from normal, satisfying all the constraints may be impossible. To further enhance the robustness, we reserve a small portion of the thrust to deal with various disturbances and faults. For example, only 95% of the thrust and corresponding mass flow is used for reachability judgment and motion mode judgment. After ignition, \(\mu\) is introduced, which can vary from 0 to 1.0526 (1/0.95) to deal with disturbances. Moreover, in the last few seconds of powered descent landing, an open-loop guidance is adopted.