## 3 The Proposed Learning-Based MPC Energy Management Strategy
### Learning-Based MPC Energy Management Strategy
#### 3.2.1 Conventional Multi-Objective Optimization Problem
2.2 The Proposed Multi-Objective Optimization Problem with Learning-Based Weighting Factor Adjustment  
When faced with different operation conditions, such as general power demand, high power demand, and high feedback power demand, the requirements for the hybrid energy storage system are different. It is difficult for a single energy management strategy to meet the demands of all operation conditions. Therefore, the three different terms should be adjustable under different operation conditions, i.e., the optimization problem can be revised as follows:  
\[J(U_{k})=\sum_{N}\biggl{[}w_{1}\cdot\frac{Q_{loss}(k,i)}{Q_{loss}(k)_{max}}+w_ {2}\cdot\left(\frac{\Delta P_{b}(k+i-1)}{\Delta P_{b,max}}\right)^{2}\biggr{]} +w_{3}\cdot\left(\frac{SoC_{SC}(k+N)-SoC_{SC,allpref}}{SoC_{SC,max}-SoC_{SC, min}}\right)^{2}, \tag{21}\]  
\[SoC_{SC,dappref}= \begin{cases}c_{1},\;\;\text{high power demand}\\ c_{2},\;\;\text{high feedback power demand}\\ c_{3},\;\;\text{others}\end{cases}  \tag{22}\]  
where \(w_{1}\), \(w_{2}\), and \(w_{3}\) are the weighting factors for dynamic adjustment. \(SoC_{SC,dappref}\) is changeable for three typical operation conditions. \(c_{1}\), \(c_{2}\), and \(c_{3}\) are constants with values of 0.9, 0.6, and 0.7, respectively. Under high power demand, SC SoC should be maintained at a higher value for future power output. Under high feedback power demand, the SC SoC should be maintained at a lower value for future power feedback. Moreover, using a fixed objective function can result in an inadequate power supply that does not meet the power requirements and fails to fully leverage the advantages of the hybrid energy storage system. Therefore, assigning weights to the three objectives and dynamically adjusting based on the real-time power conditions allows for flexible optimization goals. This ensures that the energy supply system can adapt to and meet the changing power demands effectively. This paper introduces a deep neural network to adjust the weighting factors (\(w_{1}\), \(w_{2}\), and \(w_{3}\)) according to the operation conditions. The structure of the deep neural network (DNN) can be divided into three layers as shown in Figure 4: the input layer, the hidden layer, and the output layer. The input layer comprises four features extracted from the power demand and the conditions information the robot identifies. The features include peak power, valley power, average power, and frequency. The hidden layer uses two fully connected layers of 32 nodes. The output layer outputs the three weighting factors of the MPC. Labeled data are required to train the DNN. In this study, the sum of the three weighting factors is set to 1 so that the learning-based MPC converges in line with the conventional MPC. Under different operation conditions, the optimal weighting factors are obtained through extensive fine-tuning and testing under the Matlab/Simulink (2023b)environment. For example, a large \(w_{1}\) can reduce the battery capacity loss and the final SC SoC quickly. However, a low SC SoC value means the SC cannot supply enough power when a high load power is coming, which can result in a higher battery capacity loss for a long time. Finally, three weighting factor sets are selected for training: (0.1, 0.1, 0.8), (0.3, 0.4, 0.3), and (0.5, 0.4, 0.1). The Adam optimizer is used for the training process with a learning rate of 0.002. The training loss of the DNN can converge after 1 h of training. The DNN algorithm endows MPC with the learning capacity under different scenarios. Because of the generalization performance of deep learning, the proposed method has the robustness ability to resist the noise effect. Further, the deep learning algorithm can be extended to assist the parameter identification under noise conditions. The weighting factors of the objective in MPC reflect the operation condition variations in practical environments. The operation condition variation is much slower than the decision frequency of the legged robot.