# Research on the Posture Control Method of Hexapod Robot for Rugged Terrain
## 3 Posture Maintenance Strategy for Mildly Rugged Terrain
### Hexapod Robot Foot Force Distribution Model  
The motion form of the hexapod robot is crawling. It can be analyzed as a quasi-static motion due to its low speed and stable motion. Analyzing the mechanical model of the robot aims to determine the relationship of the force between the supporting feet when the robot has a larger stability margin and use this foot force as feedback to control the position and attitude.  
The mechanical model is shown in Figure 9. Global coordinate system is \(\sum_{O}\), and center of gravity is \(G=\left[G_{x},G_{y},G_{z}\right]\). The projection of the center of gravity on the torso coordinate system is located in the torso coordinate on the X axis, and it is close to origin O of the torso coordinate system because the robot configuration is symmetrically distributed with the geometric center in an elliptical shape in the initial pose. Taking the contact point between foot end \(P_{i}=\left[x_{i},y_{i},z_{i}\right]\) of the i-th leg and the ground, external force received is \(F=\left[F_{x},F_{y},F_{z}\right]\), external moment is \(M=\left[M_{x},M_{y},M_{z}\right]\), and ground reaction force at the foot end of leg i is \(f_{i}=\left[f_{ix},f_{iy},f_{iz}\right]\).  
The fluctuation of the robot in the vertical direction and the rotation along the pitch and roll directions are the main factors affecting its posture. These factors are related to vertical component \(f_{iz}\) of supporting leg foot end force \(f_{i}\). Therefore, the vertical component in \(F=\left[F_{x},F_{y},F_{z}\right]\). For straight component \(F_{z}\), pitch torque \(M_{p}\), and rollover torque \(M_{R}\) in \(M=\left[M_{x},M_{y},M_{z}\right]\), the static balance model is obtained as follows:  
\[\left\{\begin{array}{l}\sum\limits_{i=1}^{n}f_{iz}=F_{z}+mg\\ \sum\limits_{i=1}^{n}\left(x_{i}-x_{G}\right)f_{iz}=M_{p}\\ \sum\limits_{i=1}^{n}\left(y_{i}-y_{G}\right)f_{iz}=M_{R}\end{array}\right. \tag{1}\]  
Figure 9: Force equilibrium model of the hexapod robot.  
Formula (1) is expressed in matrix form as follows:  
\[A\times F_{iz}=M^{\prime} \tag{2}\]  
\[A=\left(\begin{array}{cccc}1&1&\cdots&1\\ y_{1}-y_{G}&y_{2}-y_{G}&\cdots&y_{3}-y_{G}\\ x_{1}-x_{G}&x_{2}-x_{G}&\cdots&x_{3}-x_{G}\end{array}\right) \tag{3}\]  
\[F_{iz}=\left[\begin{array}{cccc}f_{1z}&f_{2z}&\cdots&f_{nz}\end{array}\right] ^{T} \tag{4}\]  
\[M^{\prime}=\left[\begin{array}{cccc}mg+F_{z}&M_{p}&M_{R}\end{array}\right] ^{T} \tag{5}\]  
The available full end force formula is as follows:  
\[F_{iz}=A^{-}\cdot M^{\prime} \tag{6}\]  
\(A^{-}\) is pseudoinverse. When the robot is supported on three legs, no matter where the end of the foot is in any position corresponding to a certain state of the robot, the only solution for the size of the full force can be obtained by Formula (6). Under rugged terrain, the robot walks in a wave gait with more than three-leg support. At this time, if the foot force is solved according to this model, the system is indeterminate. Therefore, constraints must be added to make the system have a unique solution. When the supporting legs even bear the gravity of the robot, the robot has a large stability margin, a large carrying capacity, and a low energy consumption. Therefore, the minimum mean square error of the foot force is set as the objective function:  
\[D(f_{iz})=(1/n)\cdot\sum_{i}^{n}{(f_{iz}-\mu)^{2}}\rightarrow\min \tag{7}\]  
Among them, \(\mu=(1/n)\sum\limits_{i}^{n}{f_{iz}}=(F_{z}+mg)/n\), where \(n\) is the number of robot supporting legs. This can determine the foot end force \(f_{0i}=[f_{0 ix},f_{0 iy},f_{0 iz}]\) in the initial posture.