This dissertation presents a comprehensive study on the design of a control system and the development of gait compensation algorithms for a miniature humanoid robot. The work addresses the fundamental challenges of achieving stable dynamic walking in a small-scale bipedal platform. The research encompasses the overall control architecture, the real-time detection and compensation of Zero Moment Point (ZMP) errors, the hardware and software implementation of a hierarchical distributed control system, and experimental validation of the proposed methods. The results demonstrate that the integration of off-line gait planning with on-line ZMP error compensation using key joints significantly enhances the walking stability and adaptability of the miniature humanoid robot.
1. Introduction
Humanoid robotics represents one of the most challenging and promising frontiers in modern robotics research. The ability of a bipedal robot to walk stably is a fundamental requirement for its practical application in human environments. Compared to wheeled or tracked mobile robots, a humanoid robot offers superior terrain adaptability, the capability to climb stairs, and a natural interaction interface with human-designed spaces. However, achieving stable bipedal locomotion is an extremely complex control problem due to the high-dimensional, nonlinear, and strongly coupled dynamics of the multi-body system.
The miniaturization of humanoid robots has become a significant trend, driven by the need for affordable research platforms, educational tools, and entertainment applications. Unlike large-scale humanoid robots that typically use high-power DC motors with sophisticated torque control, miniature humanoid robots commonly employ micro servo motors as actuators. These motors are compact, lightweight, and easy to control, but they also impose limitations on control bandwidth and feedback capabilities. Most existing miniature humanoid robots rely on centralized control architectures and purely off-line gait planning, which severely limits their adaptability to unknown environments and external disturbances.
This research aims to overcome these limitations by developing a hierarchical distributed control system for a miniature humanoid robot, integrating off-line gait planning with real-time ZMP error compensation. The core idea is to use force sensors at the feet to measure the actual ZMP position and compare it with the desired ZMP trajectory computed off-line. Discrepancies are then compensated by adjusting the most influential joints, referred to as “key joints,” thereby improving walking stability and robustness.
The following sections detail the research work. Section 2 provides an overview of the control system architecture. Section 3 discusses the ZMP-based stability criterion and the derivation of the key joint compensation algorithm. Section 4 describes the hardware and software implementations. Section 5 presents the experimental setup and results. Finally, conclusions and future outlooks are summarized.
2. Overall Control System Design
2.1 Characteristics of the Research Platform
The humanoid robot used in this research is a custom-built miniature platform developed in our laboratory. The robot has a total of 17 degrees of freedom (DOF): 10 DOF in the lower limbs (5 per leg), 6 DOF in the two arms (3 per arm), and 1 DOF for the head. Each joint is actuated by a TowerPro MG995 micro servo motor with metal gears. The key mechanical parameters are listed in Table 1.
| Parameter | Value |
|---|---|
| Total height | 410 mm |
| Total weight | 2.2 kg |
| Control system weight | 0.3 kg |
| Average joint range | 60° |
| DOF in legs | 10 |
| DOF in arms | 6 |
| DOF in head | 1 |
The actuators are digital servo motors that receive a period of 20 ms pulse-width modulation (PWM) signal, with pulse width varying from 0.5 ms to 2.5 ms corresponding to angular positions from 0° to 180°. Since the angular speed of these motors is not directly controllable, a software-based interpolation method is employed to achieve smooth velocity transitions between gait phases.
2.2 Control Architecture
To meet the demanding requirements of real-time control, high integration, and fault tolerance, a hierarchical fieldbus-based distributed control architecture was adopted. This structure is inspired by the human nervous system, where high-level decision-making occurs in the brain, while lower-level reflexive actions are handled by local neural circuits. The proposed control system consists of two main layers:
Organizational layer: This layer acts as the “brain” of the humanoid robot. It is responsible for off-line gait planning, real-time ZMP computation, error analysis, and generation of compensation commands. It also manages the communication with the lower layer via CAN bus.
Executive layer: This layer consists of four separate controller boards, each responsible for a specific group of joints: left leg (5 DOF), right leg (5 DOF), left arm (3 DOF), and right arm plus head (4 DOF). Each executive board receives joint position commands from the organizational layer, generates the corresponding PWM signals, and directly drives the servo motors.
The communication between the two layers is implemented using the CAN bus protocol, which offers high data rates, robust error handling, and multi-master capability. The overall control structure is illustrated in the following hierarchy diagram (conceptual representation, no figures reproduced).

2.3 Gait Generation Strategy
Three primary approaches exist for generating joint trajectories in humanoid robots: (1) pure off-line planning, where all joint trajectories are precomputed and executed sequentially; (2) off-line planning with on-line adjustment, where a nominal trajectory is generated off-line but modified in real time based on sensor feedback; and (3) fully on-line planning, where trajectories are computed in real time. The third approach is computationally intensive and has not yet been successfully implemented in full-scale humanoid robots due to the complexity of solving the inverse dynamics in real time.
This research adopts the second strategy: off-line planning combined with on-line ZMP error compensation. The workflow is as follows:
- An off-line gait is planned using a simplified model of the robot. The desired ZMP trajectory is designed such that it remains well inside the stability region during the entire walking cycle.
- During execution, the actual ZMP is measured in real time using force sensors mounted at the feet.
- The actual ZMP is compared with the desired ZMP. Any significant deviation triggers a compensation algorithm that adjusts the key joints to minimize the error.
This hybrid approach provides a good balance between computational simplicity and adaptability. The ZMP stability criterion, originally proposed by Vukobratović, is used as the primary metric for guaranteeing dynamic balance.
3. Key Joint Compensation Based on ZMP Error
3.1 ZMP and Stability Region
The Zero Moment Point (ZMP) is defined as the point on the ground where the resultant moment of the ground reaction forces has zero horizontal components. Mathematically, the ZMP coordinates can be computed from the dynamic model of the robot:
$$X_{\text{ZMP}} = \frac{\sum_{i=1}^{n} m_i (\ddot{z}_i + g) x_i – \sum_{i=1}^{n} m_i \ddot{x}_i z_i}{\sum_{i=1}^{n} m_i (\ddot{z}_i + g)}$$
$$Y_{\text{ZMP}} = \frac{\sum_{i=1}^{n} m_i (\ddot{z}_i + g) y_i – \sum_{i=1}^{n} m_i \ddot{y}_i z_i}{\sum_{i=1}^{n} m_i (\ddot{z}_i + g)}$$
where \(m_i\) is the mass of link \(i\), \((x_i, y_i, z_i)\) is the position of its center of mass, and \(g\) is the gravitational acceleration. For a statically balanced gait, the ZMP must lie inside the convex hull of all contact points between the feet and the ground. This region is called the support polygon. When the ZMP approaches the boundary of this polygon, the robot risks tipping over. Therefore, maintaining the ZMP near the center of the support polygon is the primary control objective.
3.2 Sources of ZMP Error
In practice, the actual ZMP trajectory deviates from the desired one for several reasons, including:
- Manufacturing and assembly tolerances that make the real robot different from the nominal model.
- Variable friction in the joints and hysteresis in the servo motors.
- Structural deflections and elastic deformations of the links.
- Ground irregularities and external disturbances.
- Measurement noise and sensor inaccuracies.
These errors, if left uncompensated, can accumulate and cause the robot to lose balance. Hence, a robust on-line compensation mechanism is necessary.
3.3 Influence of Joints on ZMP
To determine which joints should be used for compensating ZMP errors, a dynamic analysis was performed. The robot is modeled as a system of rigid links, as shown in the simplified stick model. For the sagittal plane, the robot is reduced to a seven-link mechanism comprising two lower legs, two thighs, a torso, and two arms. The planar model has six actuated joints: two hip joints, two knee joints, and two ankle joints. Similarly, for the lateral plane, a five-link model with two side hip joints and two side ankle joints is used.
Using the Lagrange formalism and the ZMP equations, the partial derivatives of the ZMP coordinates with respect to each joint angle are derived. The generalized formula for the sensitivity of \(X_{\text{ZMP}}\) with respect to the \(k\)-th joint angle \(q_k\) is:
$$\frac{\partial X_{\text{ZMP}}}{\partial q_k} = \frac{\frac{\partial A}{\partial q_k} B – A \frac{\partial B}{\partial q_k}}{B^2}$$
where \(A\) and \(B\) represent the numerator and denominator of the ZMP expression, respectively. Analytical and numerical evaluations of these sensitivities reveal that the ankle joints have the most significant influence on the ZMP position, followed by the knee and hip joints. In particular, the sagittal ankle joint predominantly affects the \(X\)-coordinate of the ZMP, while the lateral ankle joint predominantly affects the \(Y\)-coordinate.
To validate the theoretical analysis, an experiment was conducted with the robot stationary and both feet on the ground. Each joint was individually rotated by a fixed small angle, and the resulting ZMP displacement was measured using the force sensors. The results, summarized in Table 2, confirm the dominance of the ankle joints.
| Joint | Influence on \(X_{\text{ZMP}}\) | Influence on \(Y_{\text{ZMP}}\) |
|---|---|---|
| Sagittal ankle | 0.52 | 0.03 |
| Knee | 0.31 | 0.01 |
| Sagittal hip | 0.17 | 0.02 |
| Lateral ankle | 0.02 | 0.58 |
| Lateral hip | 0.01 | 0.39 |
Based on the above, the sagittal ankle and the lateral ankle are selected as the key joints for compensating the \(X\)- and \(Y\)-direction ZMP errors, respectively. The compensation strategy is:
At each sampling instant, compute the actual ZMP position \((X_{\text{ZMP,real}}, Y_{\text{ZMP,real}})\) from the force sensor readings and compare with the desired \((X_{\text{ZMP,des}}, Y_{\text{ZMP,des}})\). The errors are:
$$\Delta X = X_{\text{ZMP,des}} – X_{\text{ZMP,real}}$$
$$\Delta Y = Y_{\text{ZMP,des}} – Y_{\text{ZMP,real}}$$
The required adjustment of the sagittal ankle angle \(\Delta \theta_{\text{ankle,sag}}\) and the lateral ankle angle \(\Delta \theta_{\text{ankle,lat}}\) are calculated by inverting the sensitivity relationships:
$$\Delta \theta_{\text{ankle,sag}} = K_X \Delta X$$
$$\Delta \theta_{\text{ankle,lat}} = K_Y \Delta Y$$
where \(K_X\) and \(K_Y\) are the calibrated gains obtained from the stationary experiments. These gains are further fine-tuned during dynamic walking experiments to account for inertial effects.
3.4 Real-Time ZMP Detection
To measure the actual ZMP, eight miniature force sensors are mounted on the bottom of each foot. Each foot has four sensors arranged symmetrically at the corners. Figure 3 shows the sensor layout (not reproduced). The force sensors used are strain-gauge based load cells with a rated capacity of 10 kg, sensitivity of 1 mV/V, nonlinearity of 0.5%, and a temperature range of -30 to +70 °C. Each sensor is individually calibrated by applying known weights and fitting a linear relationship between the applied force and the output voltage. The calibration results show excellent linearity.
For each foot, the ground reaction force \(F\) and the moments \(M_x\), \(M_y\) about the foot coordinate system origin are computed as:
$$F = f_1 + f_2 + f_3 + f_4$$
$$M_x = 60(f_3 + f_4 – f_1 – f_2) \ \text{mm}$$
$$M_y = 40(f_1 + f_3 – f_2 – f_4) \ \text{mm}$$
where \(f_1 \dots f_4\) are the forces measured by the sensors. The ZMP position relative to the foot center is then:
$$r = \sqrt{M_x^2 + M_y^2} / F$$
$$\theta = \arctan(M_y / M_x)$$
During single support, the ZMP is directly determined from the sensors of the supporting foot. During double support, the ZMP is calculated by combining the contributions of both feet, with the left foot as the reference coordinate system.
4. Hardware and Software Implementation
4.1 Hardware Design
The complete control hardware is partitioned into several functional modules. The organizational layer is built around a TMS320LF2407 DSP from Texas Instruments. This DSP integrates an A/D converter, CAN controller, and event managers for PWM generation. The executive layer also uses the same DSP family, ensuring uniform programming and debugging.
The hardware modules include:
- Power supply: A 5 V regulated supply is used for digital circuits, with a TPS7333 low-dropout regulator providing the 3.3 V core voltage. Sensors are powered with a separate 12 V supply, and opto-isolation is employed between the power stage and logic circuits.
- Clock and reset: A 12 MHz crystal is used with the internal PLL to achieve a 24 MHz system clock. A manual reset circuit with a push-button and a watchdog timer ensures reliable operation.
- A/D conversion: The internal 10-bit ADC with 16 channels is used. Eight channels (ADCIN00–ADCIN07) are dedicated to the force sensor signals. The conversion is triggered by a timer to provide periodic sampling at 50 Hz.
- CAN communication: The DSP’s built-in CAN controller is interfaced with a PCA82C250 transceiver via isolation. The bus is terminated with 120 Ω resistors. The data rate is set to 500 kbps.
- Serial communication: A MAX232 transceiver provides RS-232 level conversion for host computer communication. This is used mainly for debugging and data logging.
- PWM motor control: The event managers generate PWM signals for the servo motors. Each executive board can control up to six motors using the PWM1, PWM3, PWM5, PWM7, PWM9, and PWM11 outputs. Optocouplers are used to isolate the DSP from the motor circuits.
- External SRAM: An IS61LV6416 64K×16 bit SRAM is added for storing off-line gait data and sensor logs during experiments.
- Signal conditioning: The force sensor outputs are amplified using AD620 instrumentation amplifiers and filtered with a second-order low-pass filter with a cutoff frequency of about 25 Hz. This removes high-frequency noise and 50 Hz power line interference.
The complete hardware platform is compact: the organizational layer board measures 9.0×8.6×1.0 cm, each executive board is 7.6×5.0×1.0 cm, and each signal conditioning board is 2.4×2.4×1.0 cm. The overall control system weight is only 0.3 kg, which is acceptable for the 2.2 kg robot.
4.2 Software Design
The software architecture is modular, implemented in C, and runs on the DSP using TI’s Code Composer Studio. The main software components are:
- Initialization module: Configures the ADC, PWM timers, CAN controller, watchdog, and I/O ports.
- ADC and data processing module: Samples the eight force sensor channels, converts the raw digital values into force readings using the calibrated linear equations, and computes the actual ZMP coordinates.
- PWM motor control module: Generates the appropriate PWM signals for each servo based on the desired joint angles. A smooth interpolation algorithm is used to transition between gait phases, as described in Section 2.3.
- CAN communication module: Handles the transmission of joint commands from the organizational layer to the executive layers, and the return of status information. The protocol uses 8-byte data frames. A remote frame is broadcast at the start of each control cycle (20 ms) to synchronize all executive nodes.
- Gait compensation module: Implements the ZMP error calculation and the key joint compensation algorithm. This module runs in the organizational layer and outputs modified joint angles for the key joints.
The flow of the main control loop is as follows:
- Initialize system.
- Load off-line gait data from memory.
- At each control tick, send the current joint angles to the executive controllers.
- Wait for the executive to acknowledge.
- Acquire force sensor data.
- Compute actual ZMP.
- Compare with desired ZMP.
- If error exceeds a threshold, compute compensation for the ankle joints.
- Update the joint commands accordingly.
- Repeat from step 3.
The software supports both purely off-line operation (no feedback) and on-line compensation mode, which is selected via a serial command.
5. Experiments and Results
5.1 Experimental Setup
A test platform was built to evaluate the control system and the gaits. The robot was equipped with all 17 servo motors, the four executive boards, the organizational board, and the force sensing system. The robot was powered by an external DC supply (7.4 V for the motors and 5 V for the logic). During the experiments, the robot walked on a flat, rigid floor. A motion capture system (not detailed here) was used to verify joint trajectories.
5.2 Sensor Signal Conditioning
One of the initial challenges was the high level of noise in the pressure sensor outputs, caused by electromagnetic interference from the servo motors. Without filtering, the ZMP calculation was erratic. The second-order low-pass filter designed with a cutoff frequency of 25 Hz significantly improved the signal quality, as shown in Table 3. The peak-to-peak noise level was reduced by approximately 89%.
| Condition | Peak-to-peak noise (mV) | Signal-to-noise ratio |
|---|---|---|
| Unfiltered | 120 | 18 dB |
| Filtered | 13 | 35 dB |
5.3 Off-Line Gait Planning Experiment
The first set of experiments was conducted with purely off-line planned trajectories. The joint angles were computed using inverse kinematics of a simplified model, with the ZMP constrained to lie near the center of the support polygon. The robot was commanded to walk forward at a cadence of 2 seconds per step and a step length of half a foot length. The robot successfully performed several consecutive steps, but the actual ZMP trajectory showed notable deviations from the desired one. The maximum error in the anterior-posterior direction was about 15 mm, and in the mediolateral direction about 21 mm. These errors resulted in noticeable body oscillations and intermittent instability, especially at the transitions between single and double support.
5.4 On-Line ZMP Error Compensation Experiment
Next, the on-line compensation algorithm was enabled. The actual ZMP was measured in real time, and the sagittal and lateral ankle joints were adjusted according to the control law described in Section 3.3. The gains \(K_X\) and \(K_Y\) were initially set from the static calibration and then tuned during repeated walking trials. The final values were \(K_X = 0.09\ \text{rad/mm}\) and \(K_Y = 0.12\ \text{rad/mm}\).
With compensation, the ZMP errors were drastically reduced. Table 4 summarizes the maximum absolute errors in both directions before and after compensation.
| Direction | Max error without comp. (mm) | Max error with comp. (mm) | Reduction (%) |
|---|---|---|---|
| X (forward) | 15.2 | 3.4 | 77.6 |
| Y (lateral) | 21.5 | 4.8 | 77.7 |
The robot walked continuously for more than 20 steps without falling, and the body posture remained much more upright. The compensation algorithm effectively suppressed the oscillatory behavior and improved the overall walking quality. The snapshots of the walking motion, captured from the front and side views, confirmed a smooth, human-like gait.
These experiments validate the effectiveness of the proposed key-joint-based ZMP compensation method for a miniature humanoid robot. The approach is computationally lightweight, requires only two additional control inputs, and is robust enough to handle moderate ground disturbances.
Conclusion
This dissertation presented a complete design of a control system and gait compensation algorithm for a miniature humanoid robot. The main contributions are:
- Designed and implemented a hierarchical distributed control system based on CAN bus, consisting of an organizational layer for planning and supervision and four executive layers for low-level servo control. The modular hardware is compact and lightweight, suitable for a 410 mm, 2.2 kg robot.
- Developed an off-line gait planning method using the ZMP criterion, and implemented a real-time ZMP feedback loop using foot-mounted force sensors.
- Derived and experimentally validated the concept of key joints. The sagittal ankle and lateral ankle were identified as the most influential joints for ZMP control. A simple proportional compensation law using these two joints was shown to reduce ZMP errors by nearly 78%.
- Provided a complete software framework, including sensor signal conditioning, PWM generation, CAN communication, and the gait compensation module.
The experimental results demonstrate that the proposed control system greatly enhances the walking stability and adaptability of the miniature humanoid robot. Although the work focuses on a small-scale platform, the control architecture and compensation principles are scalable and applicable to larger humanoid robots as well.
Future Work
The current implementation uses only two key joints for compensation. Future work could incorporate additional joints, such as the hips and trunk, to handle larger disturbances and faster walking speeds. Moreover, the CAN bus allows easy integration of additional sensors, such as inertial measurement units and vision systems, to further improve the robot’s perception and autonomous decision-making. Advanced control algorithms, including model predictive control or reinforcement learning, could be explored to replace the fixed-gain compensation law. Finally, the gait planner could be extended to handle varying terrains, stairs, and slopes by integrating on-line terrain mapping.
In summary, the work presented in this dissertation lays a solid foundation for the continued development of stable, adaptive, and intelligent miniature humanoid robots.
