# Structural Design, Simulation and Experiment of Quadruped Robot
## 6 Physical Design and Experimental Validation
### Diagonal Trot Gait Experiment  
To investigate the fluctuation of the body during the movement, the gyroscope module inside the body was used to obtain the attitude angle data and plot the pitch and roll angles, respectively. The pitch and roll curves are shown in Figures 17 and 18. The angles fluctuate regularly within a specific range, where the fluctuation range of the pitch angle is around \(7^{\circ}\) and the roll angle around \(10^{\circ}\), with a large disturbance at the moment of start and stop of the robot's trot motion.  
Figure 16: Roll angle curve. The value of the roll angle also varies during a gait cycle, remaining largely within \(6^{\circ}\).  
Figure 17: Pitch angle curve during trot gait. The pitch angle of the quadruped robot fluctuates in the range of \(3^{\circ}\) to \(12^{\circ}\) on uneven sections of uphill and downhill. It follows the desired trajectory steadily by incorporating a control algorithm for the foot-end trajectory.  
As the quadruped robot performs the trot gait, it has to maintain self-balance. Figure 19 shows the block diagram of the self-balancing controller of the quadruped robot. When the ground underneath is uneven or tilts, it causes the quadruped robot to tilt. The roll and pitch angles (\(\varphi\), \(\gamma\)) are measured by the gyroscope and accelerometer modules on the IMU sensor board, which are further processed by using the complementary filter. The filtered roll and pitch angles are then compared with the reference/desired roll and pitch, both of which are 0 for the self-balancing purpose. Here, an elementary yet effective PD controller is used to process error signals from the roll and pitch. The inverse kinematics solver further converts the results to joint angle rudder servos (SPT 5425), which subsequently adjusts the length of each leg of the quadruped robot. The feedback control loop is fighting to bring both the quadruped robot's roll and pitch angles to zero whenever the body of the quadruped robot tilts in real time, so that the quadruped robot maintains self-balance.  
To verify the self-balancing capability of the robot, it was placed on a freely rotating disc (Figure 20) and the Euler angular variation output from the gyroscope was extracted as the disc angle was continuously changed, as shown in Figures 21 and 22. It can be seen that the robot can adjust its attitude by adjusting the support height of the four legs as the body tilts due to the tilting of the support surface of the disc, with the pitch angle fluctuating between \(+7^{\circ}\) and \(5^{\circ}\) and the roll angle fluctuating between \(+3^{\circ}\) and \(-1.2^{\circ}\). Due to the hardware limitations of the gyroscope and the speed of the servo, the response time of the quadruped robot to external disturbances is not very fast and the robot's attitude angles can sometimes be over-adjusted.  
Figure 19: Block diagram of the self-balancing controller of the quadruped robot.  
Figure 18: Roll angle curve during trot gait. The quadruped robot roll angle fluctuates in the range of \(-6^{\circ}\) to \(6^{\circ}\) on uneven sections of uphill and downhill slopes. The roll angle has a certain offset caused by friction.  
Figure 21: Pitch angle curve in IMU self-stabilizing experiment. The pitch angle of the quadruped robot varies periodically, gradually decreasing in amplitude due to controller control, and eventually remaining stable.  
Figure 22: Roll angle curve in IMU self-stabilizing experiment. The roll angle of the quadruped robot varies between \(-1.5^{\circ}\) and \(3.5^{\circ}\) and is ultimately stable under the control of the controller.  
Figure 20: Screenshot of IMU self-stabilizing experiment.