# Hierarchical Model Predictive Control for Hydraulic Hybrid Powertrain of a Construction Vehicle
## 3 MPC-Based Hierarchical Control Scheme
### MPC-Based Lower-Layer Engine Speed Tracking Controller Design  
Considering the nonlinear system characteristics of the engine, an MPC controller is designed to obtain better performance of setpoint tracking of engine torque. The speed regulation characteristic model of the diesel engine, i.e., the quadratic function \(T_{e}\) on \((n_{e},\alpha_{e})\) is shown in Figure 7.  
Using the surface fitting in Matlab toolbox function, the following expression can be obtained:  
\[ \begin{split} T_{e}=f_{e}(n_{e},\alpha_{e})=5.996n_{e}^{3}-15.04n_ {e}^{2}-9.35n_{e}^{2}\alpha_{e}-7.59n_{e}\alpha_{e}-22.29n_{e}+50.44\alpha_{e}+ 349.5\\ =\sum\limits_{l=0}^{3}c_{l}n_{e}^{l}+\sum\limits_{m=0}^{2}c_{m}n_{ e}^{m}\alpha_{e}\end{split}  \tag{16}\]  
Combining (1), (2), and (16), and Euler discretization, the dynamic of engine is described as:  
\[\left\{ \begin{array}{c}n_{e}(k+1)=a_{1}n_{e}(k)+a_{2}\sum\limits_{l=0}^{3}c_ {l}n_{e}^{l}(k)+a_{2}\sum\limits_{m=0}^{2}c_{m}n_{e}^{m}(k)u(k)+d\\ y(k)=n_{e}(k)\end{array} \right. \tag{17}\]  
where \(a_{1}=1+T_{L}u\alpha_{2}/\eta_{p}\), \(a_{2}=T_{L}30/\left(j_{e}\pi\eta_{p}\right)\), and \(d=T_{L}a_{2}\left(T_{pm}+T_{p}\right)/\eta_{p}\), \(u=\alpha_{e}\). At the step \(k\), the one-step prediction of the system (17) is:  
\[ \begin{split}\hat{n}_{e}(k+1\mid k)=a_{1}n_{e}(k|k)+a_{2}\sum \limits_{l=0}^{3}c_{l}n_{e}^{l}(k|k)+a_{2}\sum\limits_{m=0}^{2}c_{m}n_{e}^{m}( k|k)(u(k-1)+\Delta u(k))+\hat{d}\\ =G_{0}(n_{e}(k|k),u(k|k))+\hat{d}\end{split}  \tag{18}\]  
where the control input \(u(k|k)=u(k-1)+\Delta u(k)\) at step \(k\), \(u(k-1)\) is the known last step input and \(\hat{d}\) is the observation of \(d\), which is introduced later. Similarly, at time \(k\) the N-step prediction could be obtained by step-ahead iterative method. \[ \begin{split}\hat{n}_{e}(k+2|k)=G_{0}(k+1\big{|}k,u(k+1|k))+\hat {d}\\ =G_{1}(n_{e}(k|k),u(k|k),u(k+1|k))+\hat{d},\\ \vdots\\ \hat{n}_{e}(k+j\big{|}k)=G_{j-1}\left(n_{e}(k|k),u(k|k),\cdots,u(k +j-1\big{|}k)\right)+\hat{d}.\end{split}  \tag{19}\]  
Figure 7: Speed regulation characteristic model of the engine. one-step Markov model and (11), respectively, the predicted time domain is 1 s and the corresponding root mean square error of acceleration is 0.3267. In addition, the predicted time domain length is 3 s, 5 s, and 10 s, respectively. The speed and torque demand are also predicted by the one-step Markov model. By contrast, as the prediction zone increases, the root mean square error becomes larger and larger, indicating that the prediction accuracy is less. On the one hand, the Markov process is random, and the prediction of each step only roughly reflects the change of speed, so there is an error in the prediction result. On the other hand, in the process of using the Markov model for prediction, the predicted speed at the previous moment is used as the initial acceleration predicted at the next moment, thereby superimposing the error on the next stage. Therefore, the longer the prediction zone, the more times the error is superimposed, and the less accurate the predicted power demand. The third and fourth graphs of Figure 8 are the mileage and the height of the road during driving, which calculate fuel consumption and slope. Simulation verification for the upper-layer EMS is first performed according to the first driving condition. Setting the initial value of state input \(SOC_{0}=0.6\), \(SOC_{ref}=0.6\), \(n_{e0}=900\) r/min, and \(T_{e0}=0\) Nm, the optimization tree is built with nodes \(n_{\max}=50\). To completely verifying the effectiveness and advantage of the proposed EMS, the comparisons among four EMSs are presented, which include the SMPC proposed in this study, a prescient MPC (PMPC) that knows the future torque request along the entire prediction horizon, a rule-based (RB) method proposed in [4], and a SDP algorithm designed in [26]. Therefore, the four EMSs are applied in the upper-layer EMS to carry out the distribution of the power demand, respectively.