# Hierarchical Model Predictive Control for Hydraulic Hybrid Powertrain of a Construction Vehicle
## 3 MPC-Based Hierarchical Control Scheme
### SMPC-Based Upper-Layer Energy Management Strategy Design  
Similar to other normal driving vehicles, the spray-painting vehicle generates a series of acceleration and braking actions according to its driving intention and external environment, such as road type, slope, and road obstacles. These driving actions are uncertain random variables, which are random disturbances to the vehicle from outside. Therefore, the vehicle acceleration is regarded as a random variable, and the acceleration at the next moment is independent of the historical acceleration except for the current acceleration, and therefore the randomness satisfies the Markov characteristic. Accordingly,  
Figure 3: Sketch of the hierarchical control structure of HHV. the Markov model is built by estimating the transition probabilities that map the current acceleration to the next acceleration using the historical sample cycle data. Then, according to the relationship of the velocity, acceleration of the vehicle, and the torque demand, the prediction model of the torque demand is obtained, which is also a Markov-chain model in different velocities. The detail is stated as follows:  
1. Using the collected cycle data and the sampling interval 20 ms, the maximum speed of the working condition 5.5 km/h, the maximum acceleration 0.08 m/s\({}^{2}\), and the minimum acceleration \(-0.12\) m/s\({}^{2}\), the acceleration is discretized and pretreated to a positive integral value: \[a\in a^{1},a^{2},\cdots a^{M},\ (M=21),\ a_{inte}=(a+0.12)\times 100=0,1,\cdots 20\] (9)
2. According to the maximum likelihood estimation method, the transition probability from the current acceleration \(a_{inte,i}\) to the next moment acceleration \(a_{inte,j}\) is calculated as: \[P_{i,j}=P\Big{(}a_{inte}(k+1)=a_{inte,j}\big{|}a_{inte}(k)=a_{inte,i}\Big{)}= \frac{F_{i,j}}{F_{i}},\ F_{i}=\sum_{j=1}^{M}F_{i,j},\ i,j=1,2,\cdots,M\] (10) where \(F_{i,j}\) is the change number of the acceleration from \(a_{inte,i}\) to \(a_{inte,j}\) and \(F_{i}\) is the total transition number of \(a_{inte,i}\). The estimated transition probabilities are shown in Figure 4.
3. According to the established acceleration prediction model and the relationship of the velocity, acceleration of the vehicle and the torque demand are described as (1) and (2), i.e., \[\left\{ \begin{array}{c}v(k+1)=v(k)+T_{s}a(k)\\ T_{dem}(k+1)=T_{L}/\eta_{p}=\Big{(}\frac{c_{s}\mu_{p}(k+1)^{2}}{21.15}+f_{r}mg\ cos \theta+mg\ sin\theta+\delta ma(k+1)\Big{)}r_{w}/\eta_{p}\end{array} \right.\] (11) the prediction model of torque demand is obtained, as shown in Figure 5. It is also a Markov chain model in different velocities, which is used in the stochastic optimization of the following SMPC with finite receding horizon. Figure 4: Transition probabilities of acceleration. According to the Markov prediction model, the SMPC problem is formulated, i.e., the moving horizontal optimization problem is solved as follows:  
\[\text{min}J=\text{min}\sum_{k=1}^{N-1}\dot{m}_{f}(T_{e}(k),n_{e}(k)) \tag{12}\]  
subject to the dynamic equation with the stochastic disturbance \(w=[a,T_{dem}]^{T}\):  
\[\left\{ \begin{array}{c}SOC^{*}(k+1)=SOC^{*}(k)+2\pi T_{s}(T_{dem}(k)-T_{e}(k ))n_{e}\eta_{pm}^{sgn(-T_{pm}(k))}+\eta_{b}\frac{p_{pm}V_{b}}{2\pi T_{w}}p(k) \\ v(k+1)=v(k)+T_{s}a(k)\end{array} \right. \tag{13}\]  
and the physical constrains for the state variable \(x=[SOC^{*}\ v]^{T}\) and the control input \(u=[T_{e}\ n_{e}]^{T}\):  
\[\left\{ \begin{array}{c}SOC^{\text{min}}\leq SOC^{*}\leq SOC^{\text{max}}\\ n_{e}^{\text{min}}\leq n_{e}\leq n_{e}^{\text{max}}\\ T_{e}^{\text{min}}(n_{e})\leq T_{e}\leq T_{e}^{\text{max}}(n_{e})\end{array} \right. \tag{14}\]  
Recently, SMPC has been proposed and continues to evolve. The method utilizes statistical information of the disturbance to optimize the performance of a system as much as possible. This study used a scenario based on the SMPC method proposed in the literature [18].