As the optimal carrier of artificial intelligence, humanoid robots are expected to become a disruptive product following computers, smartphones, and new energy vehicles. The high-performance rotational joint with integrated motor, reducer, and encoder is the core functional component of a humanoid robot. An appropriate controller can significantly improve the stability and response speed of the whole rotational joint system. Therefore, research on the design and optimization of passive controllers for humanoid robot rotational joints is of great significance.
Conventional signal-based control methods are heavily affected by parameter disturbances and are not suitable for applications requiring high stability, such as human-robot interaction. Passivity-based energy control is a method that can guarantee system stability and exhibits strong robustness against parameter variations. In this work, based on passivity theory, we carry out mathematical modeling, controller design, and parameter optimization for a humanoid robot rotational joint, and validate the results experimentally.
This paper focuses on a humanoid robot rotational joint product that integrates a permanent magnet synchronous motor (PMSM), a new precision cycloidal reducer, and encoders. The main contributions are summarized as follows.
1. Overall Mathematical Modeling of the Humanoid Robot Rotational Joint
We adopt the Port-Hamiltonian (PH) system theory as the unified modeling framework. The PH representation of a nonlinear system is given by:
$$
\begin{aligned}
\dot{x} &= \left[ J(x) – R(x) \right] \nabla H(x) + O(x) u, \\
y &= O^T(x) \nabla H(x),
\end{aligned}
\tag{1}
$$
where \(J(x)\) is the skew-symmetric interconnection matrix, \(R(x)\) is the symmetric positive semidefinite damping matrix, \(O(x)\) is the port matrix, and \(H(x)\) is the Hamiltonian energy function.
We first establish the PH models of the PMSM and the new precision cycloidal reducer. For the PMSM, using the \(dq\)-axis coordinate system, the energy function is:
$$
H_{\mathrm{m}}(x) = \frac{1}{2} \left( \frac{x_1^2}{L_d} + \frac{x_2^2}{L_q} + \frac{x_3^2}{J} \right),
\tag{2}
$$
with state variables \(x = (L_d i_d, L_q i_q, J \omega_m)^T\). The PH model of the PMSM is expressed as:
$$
\begin{aligned}
\dot{x} &= \begin{bmatrix}
-R_s & -p_n \omega_m L_q & 0 \\
p_n \omega_m L_d & -R_s & -p_n \psi_f \\
0 & p_n \psi_f & 0
\end{bmatrix} \nabla H_{\mathrm{m}}(x) + \begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix} \begin{bmatrix} u_d \\ u_q \\ -T_{\mathrm{Load}} \end{bmatrix}.
\end{aligned}
\tag{3}
$$
For the new precision cycloidal reducer, the kinematics under ideal conditions are:
$$
\begin{aligned}
\omega_{\mathrm{cs}} &= \omega_{\mathrm{in}}, \\
\omega_{\mathrm{cg}} &= \frac{C_z – C_c}{C_c} \omega_{\mathrm{in}}, \\
\omega_z &= -\frac{C_z – C_c}{C_c} \omega_{\mathrm{in}},
\end{aligned}
\tag{4}
$$
where \(C_z\) is the number of pins, \(C_c\) the number of cycloidal lobes, and \(\omega_{\mathrm{in}}\) the input speed. The PH form of the reducer is obtained with the Hamiltonian function:
$$
H_{\mathrm{r}}(x) = \frac{1}{2} \left( \theta_{\mathrm{cs}}^2 + \theta_{\mathrm{cg}}^2 + \theta_z^2 \right),
\tag{5}
$$
and the port matrix is:
$$
B(x) = \begin{bmatrix}
0 \\ 1 \\ -(C_z-C_c)/C_c
\end{bmatrix},
\quad C = \begin{bmatrix} 0 & 0 & 1 \end{bmatrix}.
\tag{6}
$$
Because PH systems have the cascade property, the overall humanoid robot rotational joint can be modeled as a higher-order PH system. The complete state vector is chosen as:
$$
x_{\mathrm{all}} = \left( L_d i_d, L_q i_q, J \omega_m, \theta_{\mathrm{cs}}, \theta_{\mathrm{cg}}, \theta_z \right)^T,
\tag{7}
$$
and the overall PH model is:
$$
\begin{aligned}
\dot{x}_{\mathrm{all}} &= \left[ J_{\mathrm{all}} – R_{\mathrm{all}} \right] \nabla H_{\mathrm{all}}(x_{\mathrm{all}}) + O_{\mathrm{all}} u_{\mathrm{all}}, \\
y_{\mathrm{all}} &= O_{\mathrm{all}}^T \nabla H_{\mathrm{all}}(x_{\mathrm{all}}),
\end{aligned}
\tag{8}
$$
where the matrices \(J_{\mathrm{all}}\), \(R_{\mathrm{all}}\), \(O_{\mathrm{all}}\) are assembled according to the cascade rule. Moreover, we construct the PH difference model, which is essential for shifting the equilibrium point to a desired value. The PH difference model is given by:
$$
\begin{aligned}
\dot{\tilde{x}} &= \left[ J(x) – R(x) \right] \nabla \tilde{H}(x) – \left[ J(\hat{x}) – R(\hat{x}) \right] \nabla H(\hat{x}) + O u, \\
\tilde{y} &= O^T \nabla \tilde{H}(x),
\end{aligned}
\tag{9}
$$
with \(\tilde{H}(x) = H(x) – \hat{x}^T \nabla H(\hat{x}) – H(\hat{x})\), which is positive definite near \(\hat{x}\). This model enables direct application of controllers designed for the origin to the shifted equilibrium.
2. Passive Controller Design for Humanoid Robot Rotational Joints
2.1 Minimum-Loss IDA-PBC Controller
The interconnection and damping assignment passivity-based control (IDA-PBC) is a classic energy-shaping method. The control law is designed to make the closed-loop system take the desired Hamiltonian form:
$$
\dot{x} = \left[ J_{\mathrm{dir}}(x) – R_{\mathrm{dir}}(x) \right] \nabla H_{\mathrm{dir}}(x),
\tag{10}
$$
where \(H_{\mathrm{dir}}\) has a strict minimum at the desired equilibrium \(x_0\). By selecting the minimum-loss strategy, the equilibrium currents are:
$$
i_d^* = 0, \quad i_q^* = \frac{T_e^*}{p_n \psi_f}, \quad \omega_m^* = \omega_0.
\tag{11}
$$
The resulting IDA-PBC control inputs are:
$$
\begin{aligned}
u_d &= -r_1 i_d – J_{12} L_q (i_q – i_q^*) + \omega_m L_q i_q – L_d \frac{di_d^*}{dt}, \\
u_q &= -r_2 (i_q – i_q^*) – J_{12} L_d (i_d – i_d^*) + \omega_m (L_d i_d + \psi_f) – L_q \frac{di_q^*}{dt}.
\end{aligned}
\tag{12}
$$
The IDA-PBC controller guarantees asymptotic stability via the Lyapunov function \(H_{\mathrm{dir}}\). However, it requires tuning many interconnection and damping parameters, and the response speed is not always satisfactory.
2.2 Minimum-Loss PID-PBC Controller
To improve the transient response and simplify the parameter design, we combine the PID control idea with the passivity-based approach. The PID-PBC controller is designed for the PH difference model:
$$
\begin{aligned}
\dot{\rho} &= -K_I \tilde{y} – K_D \dot{\tilde{y}}, \\
u &= -K_P \tilde{y} + \rho,
\end{aligned}
\tag{13}
$$
where \(K_P\), \(K_I\), \(K_D\) are symmetric positive definite matrices satisfying \(K_P + O^T K_D O \ge 0\). The closed-loop energy function is:
$$
H_d(x,\rho) = \tilde{H}(x) + \frac{1}{2} \rho^T K_I^{-1} \rho,
\tag{14}
$$
which is non-increasing, and by LaSalle’s invariance principle, the system converges asymptotically to the desired equilibrium.
For the humanoid robot rotational joint, the PID-PBC controller is implemented with three states corresponding to \(i_d, i_q, \omega_m\). The diagonal gain matrices are:
$$
K_P = \begin{bmatrix} k_p & 0 & 0 \\ 0 & k_p & 0 \\ 0 & 0 & k_p \end{bmatrix}, \quad
K_I = \begin{bmatrix} k_i & 0 & 0 \\ 0 & k_i & 0 \\ 0 & 0 & k_i \end{bmatrix}, \quad
K_D = \begin{bmatrix} k_d & 0 & 0 \\ 0 & k_d & 0 \\ 0 & 0 & k_d \end{bmatrix}.
\tag{15}
$$
Using the minimum-loss equilibrium, the control law is explicitly derived as:
$$
\begin{aligned}
u_d &= u_d^* – k_p (i_d – i_d^*) – k_d \frac{d}{dt}(i_d – i_d^*) + \rho_d, \\
u_q &= u_q^* – k_p (i_q – i_q^*) – k_d \frac{d}{dt}(i_q – i_q^*) + \rho_q, \\
\rho_d &= -k_i \int (i_d – i_d^*) dt, \quad \rho_q = -k_i \int (i_q – i_q^*) dt.
\end{aligned}
\tag{16}
$$
2.3 Novel Feedback Load Observer
Because the load torque is needed in the equilibrium computation, we design a novel feedback load observer based on the classical Luenberger structure. The mechanical equation is:
$$
J \frac{d\omega_m}{dt} = T_e – T_{\mathrm{Load}} – B \omega_m.
\tag{17}
$$
Assuming the load varies slowly, the observer is:
$$
\begin{aligned}
\dot{\hat{\omega}}_m &= \frac{1}{J}(T_e – \hat{T}_{\mathrm{Load}} – B \hat{\omega}_m) + k_{11}(\omega_m – \hat{\omega}_m) + k_{12}(\dot{\omega}_m – \dot{\hat{\omega}}_m) + k_{13}\int(\omega_m – \hat{\omega}_m)dt, \\
\dot{\hat{T}}_{\mathrm{Load}} &= k_{21}(\omega_m – \hat{\omega}_m) + k_{22}(\dot{\omega}_m – \dot{\hat{\omega}}_m) + k_{23}\int(\omega_m – \hat{\omega}_m)dt.
\end{aligned}
\tag{18}
$$
By choosing appropriate gains, the observer error dynamics become Hurwitz, and the observer converges much faster than the classical Luenberger observer.
2.4 Simulation Results
The PID-PBC controller is tested in Matlab/Simulink. The joint parameters used in the simulation are listed in the following table.
| Parameter | Symbol | Value |
|---|---|---|
| Stator resistance | \(R_s\) | 2.875 \(\Omega\) |
| d-axis inductance | \(L_d\) | 8.5 mH |
| q-axis inductance | \(L_q\) | 8.5 mH |
| Number of pole pairs | \(p_n\) | 4 |
| Magnet flux linkage | \(\psi_f\) | 0.175 Wb |
| Damping coefficient | \(B\) | 0.008 N·m·s |
| Rotor inertia | \(J\) | 0.003 kg·m² |
| Number of pins | \(C_z\) | 40 |
| Number of cycloidal lobes | \(C_c\) | 39 |
First, the novel feedback load observer is compared with the classical Luenberger observer. The results are summarized below.
| Observer Type | Convergence Time for Step Load | Speed Drop under Load Change | Recovery Time |
|---|---|---|---|
| Luenberger observer | 0.008 s | −4 rpm | 0.035 s |
| Novel feedback observer | 0.001 s | −2 rpm | 0.025 s |
The novel observer reduces the convergence time by about 80% and improves the disturbance rejection capability significantly.
Figure 1 shows a typical comparison of the dynamic responses of the three controllers for the same speed reference.

From the simulations, the PID-PBC controller achieves a response time approximately 10% faster than IDA-PBC and exhibits no overshoot, unlike the PID controller which shows about 4% overshoot. The PID-PBC controller maintains the strong stability of passivity-based methods while improving the speed of convergence.
3. Optimization of the Passive Controller
3.1 Multi-Objective Equilibrium Optimization
The equilibrium point of the PID-PBC controller is crucial for achieving different control objectives. To combine the advantages of several classical strategies, we formulate a multi-objective optimization problem. Six objectives are considered: maximum torque-to-current ratio (MTPA), maximum torque-per-watt (MTPW), maximum power factor (MPF), minimum loss (ML), maximum efficiency (ME), and maximum output power (MOP). The objective function vector is:
$$
\max F(i_d, i_q) = \left[ f_1, f_2, f_3, f_4, f_5, f_6 \right]^T,
\tag{19}
$$
where
$$
\begin{aligned}
f_1 &= \frac{T}{I}, \quad f_2 = \frac{T}{P_{\mathrm{Cu}}}, \quad f_3 = \frac{P}{VI}, \\
f_4 &= -\left(P_{\mathrm{Cu}} + P_{\mathrm{Fe}}\right), \quad f_5 = \frac{P_{\mathrm{out}}}{P_{\mathrm{in}}}, \quad f_6 = P_{\mathrm{out}}.
\end{aligned}
\tag{20}
$$
The constraints include voltage, current, and power limits:
$$
\begin{aligned}
U_{\max} &\ge \sqrt{(R_s i_d – \omega L_q i_q)^2 + (R_s i_q + \omega L_d i_d + \omega \psi_f)^2}, \\
I_{\max} &\ge \sqrt{i_d^2 + i_q^2}, \quad P_{\max} \ge \frac{3}{2} R_s(i_d^2 + i_q^2) + \frac{3}{2} \omega \psi_f i_q, \\
T &= \frac{3}{2} p_n \psi_f i_q, \quad -20 \le i_d, i_q \le 20.
\end{aligned}
\tag{21}
$$
To solve this problem efficiently, we propose an improved multi-objective walrus optimization algorithm (IMOWaOA). Three key improvements are made:
- Pareto archive: We introduce an external archive to store non-dominated solutions, thereby extending the single-objective walrus algorithm to multi-objective optimization.
- Niederreiter sequence initialization: Instead of random initialization, the population is initialized using a low-discrepancy Niederreiter sequence, which provides better coverage of the search space and accelerates convergence.
- Refraction-based opposition learning: After each iteration, a refraction-based opposition learning step is applied to jump out of local optima and diversify the population.
The effectiveness of IMOWaOA is tested on a simplified version of the equilibrium optimization problem. The convergence curves are compared with the original walrus algorithm (WaOA), particle swarm optimization (PSO), and chimp optimization algorithm (ChOA). The improved algorithm converges much faster and achieves a better optimum. The optimal solution for the simplified problem is \(i_d = -0.036\) A, \(i_q = 3.627\) A, with an optimal value of \(-26.6743\).
For the standard multi-objective problem, the improved algorithm produces a Pareto archive containing 50 non-dominated solutions. A subset of these solutions is shown in the following table.
| Solution | \(i_d\) (A) | \(i_q\) (A) | \(f_1\) (N·m/A) | \(f_2\) (N·m/W) | \(f_3\) (p.u.) | \(f_4\) (W) | \(f_5\) (p.u.) | \(f_6\) (W) |
|---|---|---|---|---|---|---|---|---|
| 1 | -0.376 | 3.699 | -0.15574 | -0.01664 | -0.81513 | 6.34372 | -0.30276 | -31.67 |
| 2 | -0.113 | 3.642 | -0.15650 | -0.01680 | -0.80886 | 6.28197 | -0.30438 | -31.67 |
| 3 | -0.174 | 3.655 | -0.15640 | -0.01678 | -0.81067 | 6.29033 | -0.30416 | -31.67 |
| 4 | -0.079 | 3.636 | -0.15654 | -0.01681 | -0.80778 | 6.27891 | -0.30446 | -31.67 |
| 5 | -0.002 | 3.619 | -0.15658 | -0.01682 | -0.80500 | 6.27589 | -0.30454 | -31.67 |
These solutions provide a trade-off among the six objectives, enabling the designer to select the most suitable equilibrium according to the actual application scenario.
3.2 Fuzzy Optimization of PID-PBC Parameters
Based on the sensitivity analysis of the PID-PBC controller parameters, we design a fuzzy optimization method to adjust \(k_p\), \(k_i\), and \(k_d\) in real time. The inputs of the fuzzy optimizer are the speed error \(e\) and the change of speed error \(\mathrm{d}e/\mathrm{d}t\). The outputs are the adjusting gains \(\Delta k_p\), \(\Delta k_i\), and \(\Delta k_d\). The structure is shown in the following diagram (described verbally).
The fuzzy sets are defined with nine linguistic terms: \(\{BF, MF, SF, S, Z, B, SZ, MZ, BZ\}\). The membership functions for the speed error use Gaussian functions, while those for the error change and outputs use triangular and Gaussian forms, respectively.
The fuzzy rules are designed based on the parameter influence rules obtained in Section 2. For instance, when the speed error is large, \(k_i\) should be increased to accelerate the response; when the error is small, \(k_p\) and \(k_d\) should be reduced to avoid overshoot. The resulting fuzzy rule tables for \(\Delta k_p\), \(\Delta k_i\), and \(\Delta k_d\) are constructed as 9×9 matrices. A portion of the \(\Delta k_i\) rule table is shown below.
| \(\mathrm{d}e/\mathrm{d}t\) \ \(e\) | BF | MF | SF | S | Z | B | SZ | MZ | BZ |
|---|---|---|---|---|---|---|---|---|---|
| BF | BZ | BZ | MZ | MZ | SZ | SZ | SZ | B | Z |
| MF | BZ | BZ | MZ | MZ | SZ | B | B | Z | S |
| SF | BZ | MZ | MZ | B | B | Z | Z | S | S |
| S | MZ | MZ | SZ | B | B | Z | S | S | S |
| Z | MZ | SZ | B | Z | Z | S | S | SF | SF |
| B | MZ | SZ | Z | Z | S | S | S | SF | SF |
| SZ | SZ | B | Z | S | S | SF | SF | MF | MF |
| MZ | B | Z | S | S | SF | SF | MF | MF | BF |
| BZ | Z | S | S | SF | SF | MF | MF | BF | BF |
The defuzzification is carried out using the centroid method:
$$
u^* = \frac{\sum_{i=1}^{n} x_i \sigma(x_i)}{\sum_{i=1}^{n} \sigma(x_i)},
\tag{22}
$$
where \(\sigma(x_i)\) is the membership degree.
The fuzzy optimization is implemented in the simulation. The response curves for the “most stable” parameters, the “fastest” parameters, and the fuzzy-optimized parameters are compared. The fuzzy-optimized curve combines the advantages of both: it reaches the set speed about 20% faster than the fastest fixed-parameter curve and about 35% faster than the most stable fixed-parameter curve, while completely eliminating the 4% overshoot observed in the fastest curve. Under load disturbances, the fuzzy-optimized controller exhibits a smaller speed drop than the most stable controller and recovers without overshoot.
The variations of the three controller parameters during the fuzzy optimization are shown in the following curves (described in text). The \(k_p\) parameter decreases to the lower bound during the acceleration phase to maximize speed rise, then increases when a load disturbance occurs to suppress the speed drop. The \(k_i\) parameter starts high to accelerate convergence, then decreases to prevent overshoot, and produces a spike when the load suddenly changes. The \(k_d\) parameter follows a similar pattern, increasing during transients and stabilizing in steady state.
4. Hardware Design and Experimental Verification
4.1 Driver Design
To experimentally verify the proposed controller, a dedicated driver for the humanoid robot rotational joint is designed and manufactured. The motor parameters used in the driver design are given in the table below.
| Parameter | Value |
|---|---|
| Number of pole pairs | 20 |
| Voltage | 24 V |
| Rated speed | 1500 rpm |
| Rated power | 236 W |
| Rated current | 14 A |
| Line resistance | 0.26 \(\Omega\) |
| Line inductance | 0.18 mH |
| Back-EMF constant | 0.19 V/rpm |
| Torque constant | 0.07 N·m/A |
The driver includes a power supply module, a main control module based on STM32F405RGT6, and a driver circuit using the DRV8301 gate driver IC. The PCB is designed as a four-layer board. The driver provides the necessary PWM signals, current sensing, encoder interface, and brake control.
4.2 Test Bench
A test bench for the humanoid robot rotational joint is built. It consists of a DC power supply, the designed driver, the humanoid robot joint under test, a torque/speed sensor (HBM T40B), and a magnetic powder brake for applying variable loads. The joint output speed and torque are acquired and sent to a host computer.
4.3 Experimental Results
The fuzzy optimization method is first verified. The reference speed is set to 10 rpm at the joint output (about 1150 rpm motor speed). The speed curves before and after optimization are compared in Figure 2 (described). The optimized curve reaches the set speed in about 0.05 s, whereas the unoptimized curve takes about 0.1 s and shows noticeable fluctuations.
Then, the PID-PBC controller is compared with a conventional PID controller. The joint reference speed is 15 rpm, and the motor reference speed is −1700 rpm. The motor speed curves and joint output speed curves are shown in Figure 3 (described). The PID-PBC controller and the PID controller have similar rise times, but the PID-PBC controller exhibits no overshoot and better steady-state performance. The experimental results confirm that the proposed passive controller and optimization methods are effective in practice.
5. Conclusion
In this work, we have presented a comprehensive study on the design and optimization of passive controllers for humanoid robot rotational joints. The main conclusions are:
- A unified Port-Hamiltonian model of the humanoid robot rotational joint is established, including both the PMSM and the new precision cycloidal reducer. The cascade property of PH systems enables the construction of a six-state overall model and a PH difference model, which facilitates the controller design.
- A minimum-loss PID-PBC controller is developed. It inherits the strong stability of passivity-based control and exhibits faster response than the classical IDA-PBC. A novel feedback load observer improves the disturbance rejection capability by about 80% in convergence speed compared with the Luenberger observer.
- The equilibrium point of the PID-PBC controller is optimized using a multi-objective formulation that combines six classical control strategies. An improved multi-objective walrus optimization algorithm with Niederreiter initialization, Pareto archive, and refraction-based opposition learning is proposed and verified to be faster and more accurate than several existing algorithms.
- A fuzzy optimization method for the PID-PBC controller parameters is designed based on the parameter sensitivity analysis. The fuzzy-optimized controller achieves faster response and no overshoot compared with fixed-parameter controllers, and it effectively handles load disturbances.
- A driver for the humanoid robot rotational joint is designed and manufactured. Experimental tests on a dedicated test bench confirm the effectiveness of the proposed controller and the optimization methods.
Future work will extend the proposed controller to position control and torque control, and incorporate more detailed dynamic models of the reducer to further improve the control performance of humanoid robot rotational joints.
