Volume 10,Issue 7
This paper proposes a dual-layer decoupled gimbal electronic control system for mobile robots. The hardware platform employs the STM32F407IGH6TR microcontroller with a BMI088 IMU and DaMiao J4310 / DJI GM6020 actuators. A three-layer software architecture running under a preemptive real-time kernel maintains a 1 ms attitude estimation loop and 2 ms motion control loops. A velocity coordinate rotation algorithm is derived to eliminate chassis–gimbal directional coupling inherent to the dual-layer Yaw structure. Angle–velocity cascaded PID controllers are implemented for both gimbal layers, incorporating derivative-on-measurement, conditional integration, and velocity feedforward compensation. Experimental results demonstrate that the inner gimbal Yaw step response rise time is approximately 50 ms with steady-state error below 0.3°; feedforward compensation reduces constant-velocity tracking RMS error by approximately 60% compared to pure PID; all control loops meet their timing requirements at a total CPU utilization of approximately 85%.