In the field of advanced robot technology, quadruped robots have demonstrated exceptional adaptability and stability in complex terrains, making them ideal for applications such as search and rescue, exploration, and military reconnaissance. However, navigating uphill slopes presents significant challenges, including the risk of tipping or slipping, which necessitates precise foot-end attitude control. This study focuses on developing a robust control method that leverages inertial measurement units (IMUs) and Long Short-Term Memory (LSTM) networks to enhance the stability and efficiency of quadruped robots during uphill locomotion. By integrating real-time sensor data with predictive algorithms, we aim to achieve dynamic adjustment of foot-end positions and orientations, ensuring smooth transitions from slope bases to surfaces and tops without instability. The proposed approach combines inertial measurement for attitude estimation, LSTM for motion prediction, and model predictive control (MPC) for real-time adjustments, all contributing to the advancement of robot technology in unstructured environments.
To begin, we employ IMUs equipped with accelerometers and gyroscopes to collect acceleration and angular velocity data from the robot’s legs during uphill motion. Each IMU node is connected to a microcontroller for data acquisition, and the information is transmitted wirelessly to a PC for processing. The attitude of the robot, including pitch, roll, and yaw angles, is derived using quaternion methods to avoid singularities and reduce computational complexity. The transformation matrix based on quaternions is expressed as:
$$ C_n^b = \begin{bmatrix} q_0^2 + q_1^2 – q_2^2 – q_3^2 & 2(q_1q_2 – q_0q_3) & 2(q_1q_3 + q_0q_2) \\ 2(q_1q_2 + q_0q_3) & q_0^2 – q_1^2 + q_2^2 – q_3^2 & 2(q_2q_3 + q_0q_1) \\ 2(q_1q_3 – q_0q_2) & 2(q_2q_3 + q_0q_1) & q_0^2 – q_1^2 + q_2^2 + q_3^2 \end{bmatrix} $$
The differential equation for quaternion update is given by:
$$ \begin{bmatrix} \dot{q}_0 \\ \dot{q}_1 \\ \dot{q}_2 \\ \dot{q}_3 \end{bmatrix} = \frac{1}{2} \begin{bmatrix} 0 & -\omega_x & -\omega_y & -\omega_z \\ \omega_x & 0 & \omega_z & -\omega_y \\ \omega_y & -\omega_z & 0 & \omega_x \\ \omega_z & \omega_y & -\omega_x & 0 \end{bmatrix} \begin{bmatrix} q_0 \\ q_1 \\ q_2 \\ q_3 \end{bmatrix} $$
where $\omega_x$, $\omega_y$, and $\omega_z$ represent the angular velocities from the gyroscope in the body frame. The attitude angles are then computed as:
$$ \begin{bmatrix} \gamma \\ \theta \\ \varphi \end{bmatrix} = \begin{bmatrix} \arctan\left( \frac{2(q_2q_3 + q_0q_1)}{q_0^2 – q_1^2 – q_2^2 + q_3^2} \right) \\ \arcsin(2(q_0q_2 – q_1q_3)) \\ \arctan\left( \frac{2(q_1q_2 + q_0q_3)}{q_0^2 + q_1^2 – q_2^2 – q_3^2} \right) \end{bmatrix} $$
Additionally, velocity data is obtained by integrating acceleration measurements, providing a comprehensive set of attitude and motion parameters for further processing. This inertial measurement approach forms the foundation for real-time feedback in robot technology applications.
Next, we utilize an LSTM network to predict the desired foot-end positions and velocities based on the time-series attitude data. The LSTM model, with its ability to capture long-term dependencies in sequential data, is trained to map input姿态 sequences to output motion parameters. The structure of an LSTM neuron includes forget gates, input gates, and output gates, which regulate information flow. The forget gate $f_t$ is computed as:
$$ f_t = \sigma(W_f \cdot [h_{t-1}, x_t] + b_f) $$
where $\sigma$ is the sigmoid function, $W_f$ and $b_f$ are weights and biases, $h_{t-1}$ is the previous hidden state, and $x_t$ is the current input. The cell state update is given by:
$$ \tilde{C}_t = \tanh(W_c \cdot [h_{t-1}, x_t] + b_c) $$
$$ C_t = f_t \cdot C_{t-1} + i_t \cdot \tilde{C}_t $$
where $i_t$ is the input gate. The output gate $o_t$ controls the hidden state update. To ensure prediction accuracy, we employ backpropagation through time (BPTT) to minimize the error function $E = h_t – y_t$, where $y_t$ is the true foot-end contact sequence. The gradients for weight updates are derived as:
$$ \delta_{W_f} = \delta_{f_t} \cdot f_t \cdot (1 – f_t) \cdot [h_{t-1}, x_t]^T $$
$$ \delta_{W_i} = \delta_{i_t} \cdot i_t \cdot (1 – i_t) \cdot [h_{t-1}, x_t]^T $$
$$ \delta_{W_o} = \delta_{o_t} \cdot o_t \cdot (1 – o_t) \cdot [h_{t-1}, x_t]^T $$
$$ \delta_{W_c} = \delta_{\tilde{C}_t} \cdot (1 – \tilde{C}_t^2) \cdot [h_{t-1}, x_t]^T $$
This LSTM-based prediction enables the robot to anticipate foot-end interactions with the slope, facilitating proactive adjustments in robot technology systems.
For foot-end attitude control, we implement a model predictive control (MPC) framework that integrates the predicted desired positions $p_{ref}$ and velocities $v_{ref}$ from the LSTM with real-time IMU data. The MPC optimizer calculates optimal foot-end forces based on the robot’s discrete dynamics model. The joint torques for the support legs are determined by:
$$ \Psi_i = J R_i^T f_i $$
where $J$ is the Jacobian matrix, $R_i^T$ is the coordinate transformation matrix, and $f_i$ is the foot-end force. For the swinging legs, the joint torques are computed as:
$$ \Pi_i = J_i^T [K_P (p_{ref} – p_i) + K_D (v_{ref} – v_i)] + \tau_{i,f} $$
where $K_P$ and $K_D$ are proportional and derivative gains, $p_i$ and $v_i$ are the actual position and velocity, and $\tau_{i,f}$ is a feedforward torque. The foot-end position in the robot coordinate system is derived from the coordinate transformations between the world, robot, and slope frames. The relationship is expressed as:
$$ p_{a,h}^t = p_{c,h}^t + R_x(-\gamma) R_y(-\theta) p_m^c $$
where $p_m^c = [0, 0, -H]^T$ represents the constant offset in the slope frame, and $H$ is the robot’s centroid height. This formulation allows continuous updates of the foot-end position during uphill locomotion, ensuring stable attitude control in robot technology.
To validate our method, we conducted experiments using a custom-built quadruped robot platform. The robot features highly flexible leg structures and an advanced control system, enabling real-time adjustment of foot-end attitudes. Key parameters of the robot are summarized in the table below:
| Parameter | Value | Unit |
|---|---|---|
| Body Mass | 95 | kg |
| Leg Mass | 2.45 | kg |
| Hip Joint Distance | 1.2 | m |
| Battery Capacity | 50 | Ah |
| Max Speed | 2 | m/s |
| Max Slope Angle | 30 | ° |
The IMU specifications include a 3-axis accelerometer with a range of ±8g and a gyroscope with a range of ±1250°/s. The experimental setup involved a designed slope with transitions from base to surface and surface to top. The control system centered on an Upboard control panel and STM32F446 motor drivers, facilitating real-time communication and torque control.

During tests, we analyzed the robot’s performance at the slope base and top, measuring the vertical displacement of the center of mass and the forward position of the left front foot-end. The results demonstrated that our method enabled smooth transitions without slipping, whereas comparative approaches exhibited instability. For instance, the vertical position $z$ of the center of mass over time $t$ can be modeled as:
$$ z(t) = z_0 + \int v_z(t) \, dt $$
where $v_z(t)$ is the vertical velocity derived from IMU data. A comparison of control effectiveness is shown in the following table, highlighting the reduction in slippage and improved stability:
| Control Method | Slippage at Base | Slippage at Top | Stability Index |
|---|---|---|---|
| Proposed Method | None | None | High |
| Comparative Method A | Moderate | Low | Medium |
| Comparative Method B | High | Moderate | Low |
These findings underscore the efficacy of integrating inertial measurement and LSTM algorithms in robot technology for robust uphill navigation. The predictive capabilities of the LSTM network, combined with the real-time feedback from IMUs, allow the MPC to preemptively adjust foot-end positions, minimizing disturbances and enhancing overall performance.
In conclusion, this study presents a novel approach to quadruped robot uphill foot-end attitude control, leveraging inertial measurement and LSTM-based prediction to achieve high stability and adaptability. The method effectively addresses challenges such as slippage and tipping during slope transitions, contributing to the advancement of robot technology in complex terrains. Future work could explore extensions to other robotic platforms or integration with additional sensors for further improvements in autonomous navigation.