## 3 The Proposed Learning-Based MPC Energy Management Strategy
### Learning-Based MPC Energy Management Strategy
#### 3.2.1 Conventional Multi-Objective Optimization Problem  
Legged robots are sensitive to environmental conditions, making the power demand dramatic and complex. Improper power allocation operation can lead to the violent fluctuation of the battery current, resulting in battery self-heating and fast battery capacity degradation. Thus, the battery capacity loss and power fluctuation terms are introduced in the optimization problem to smooth the battery current. Various factors, such as battery current, temperature, and depth of discharge, influence the battery capacity loss. Numerous studies have been conducted to investigate battery capacity loss. An experimental validated semi-empirical battery capacity loss model [38] is applied in this study:  
\[ \begin{gathered} Q_{\text{loss}}=B\exp((-E_{\text{a}}+\alpha \left|I_{b}\right|)/RT)(A_{\text{h}})^{2},\\ B=130,E_{\text{a}}=18461\,\text{J}/\text{mol},\\ R=8.314\,\text{J}/(\text{mol}\cdot\text{K}),\alpha=32,\\ T=298\,\text{K},z=0.4,\end{gathered}  \tag{18}\]  
where \(Q_{\text{loss}}\) is the capacity loss ratio (%), \(\alpha\) is the aging coefficient caused by the battery current \(I_{b}\), \(A_{\text{h}}\) denotes the ampere hour, \(E_{\text{a}}\) is the activation energy, \(B\) represents the pre-index factor, \(R\) is the ideal gas constants, \(T\) is the battery absolute temperature (K), and \(z\) is the power law factor. The satisfaction of the power demand is related to the maximum discharge power of the hybrid energy storage system. Specifically, the maximum discharge power of the SCs is dependent on its maximum discharge current and SoC. Thus, to ensure that the legged robot can deliver sufficient power in response to power demands across different operation conditions, maintaining a certain level of SoC becomes crucial, particularly during high power demand scenarios. Consequently, this paper constructs an MPC optimization problem to reduce the capacity loss and maintain the SC SoC. Thus, the conventional MPC optimization objective function \(J(U_{k})\) is designed as the following equation:  
\[J(U_{k})=\sum_{N}\left[\frac{Q_{loss}(k,i)}{Q_{loss}(k)_{max}}+\left(\frac{ \Delta P_{b}(k+i-1)}{\Delta P_{max}}\right)^{2}\right]+\left(\frac{SoC_{SC}(k+ N)-SoC_{SC,inf}}{SoC_{SC,max}-SoC_{SC,min}}\right)^{2}, \tag{19}\]  
where \(N\) is the prediction horizon, and \(SoC_{SC,ref}\) is set as 0.8. All three terms in Equation (19) are normalized. The first term is battery capacity loss, which is related to the battery current and temperature and is taken as a penalty term for high-power battery output. The second term is a penalty term for battery power fluctuations and is used to suppress frequent fluctuations in the battery current. The third term is a constraint term for the SC SoC and is used to maintain the SC SoC level to have enough energy to replenish the high power demand on the one hand and to absorb the return energy on the other. For the normalization process, it can be seen that all three terms with different physical scales have a maximum value as the denominator and are normalized into the [0, 1] range, which is beneficial for balanced performance. Without the normalization, it is difficult to adjustthe weighting factors afterward, i.e., in the proposed learning-based MPC with adaptive weighting factor tuning. The MPC-based energy management strategy should keep a set of constraints, which are given as follows:  
\[\left\{ \begin{array}{l}I_{SC,min}\leq I_{SC}\leq I_{SC,max}\\ I_{b,min}\leq I_{b}\leq I_{b,max}\\ SoC_{SC,min}\leq SoC_{SC}\leq SoC_{SC,max}\\ SoC_{b,min}\leq SoC_{b}\leq SoC_{b,max}\\ \left|P_{d}(k)-P_{b}(k)-P_{SC}(k)\right|<\varepsilon\end{array} \right. \tag{20}\]  
where \(max\) and \(min\) represent the maximum and minimum values of each physical quantity, \(\varepsilon\) is a small positive number, and \(P_{d}(k)\), \(P_{b}(k)\), and \(P_{SC}(k)\) are the load power, battery power, and SC power, respectively.