Motion Control of Humanoid Robot

Humanoid robot research, though merely four decades old since its inception in the late 1960s, has witnessed extremely rapid development. A humanoid robot represents a rare class of high-order, nonlinear, multi-degree-of-freedom, and inherently unstable system, making it an ideal platform for the study and practice of control theory. The motion control of humanoid robots has attracted numerous scholars worldwide and has become a major research direction in the robotics field. This paper focuses on the motion control of humanoid robots. In terms of algorithm research, a robot simulation platform is constructed, dynamic and kinematic analyses are performed, and control algorithms are developed on this platform. Regarding the control system, a humanoid robot control system is assembled using motion controllers, a CAN card, motor drivers, and motors, enabling speed control, position control, and torque control of the motors. The specific contents cover the following aspects.

The humanoid robot is a multidisciplinary field involving mechanism design, sensor technology, motion control, computer technology, and artificial intelligence. It encompasses linear, nonlinear, open-loop, closed-loop, and real-time control techniques, as well as system simulation modeling, kinematics, and dynamics. Among all robot research, the humanoid robot is the most complex due to its high-order, nonlinear, and unstable characteristics, providing an ideal platform for control theory research. The earliest humanoid robots appeared in science fiction novels and films, featuring human-like appearances and bipedal walking capabilities, with varying degrees of artificial intelligence. Since the modern human environment is specifically designed for humans, a humanoid robot operating in this environment gains significant advantages. It can use human tools and integrate more naturally into human society.

1. Humanoid Robot Simulation Platform

Since the humanoid robot is an unstable system with high manufacturing costs, algorithms developed directly on the physical robot could result in damage from falls. By establishing a simulation platform for humanoid robots, not only can damage be reduced, but research efficiency can also be significantly improved. Various simulation platforms exist, such as Havok, AGEIA PhysX, Bullet, and Karma. In this research, the humanoid robot uses National Instruments’ Single-BoardRIO motion controller as the control center; therefore, the LabVIEW Robotics software from NI is chosen for simulation. LabVIEW Robotics is based on the Open Dynamics Engine (ODE) physical engine and, thanks to the graphical LabVIEW language, provides seamless connectivity with NI products, making data transmission very convenient. Algorithms developed in the simulation environment can be directly implemented in the real control system. Through the study of LabVIEW Robotics, which is based on the ODE physics engine, a humanoid robot simulation platform is constructed.

The simulation development platform, LabVIEW Robotics, is a simulation platform developed by National Instruments based on the LabVIEW graphical language. Compared to other simulation software, it provides a standard hardware development platform for designing robot control systems. The NI LabVIEW graphical programming language offers a high level of abstraction, allowing for easy creation of complex robot application programs. The ability to import code from other languages, combined with built-in drivers and multi-sensor communication capabilities, greatly shortens development time while allowing researchers to focus on algorithm and intelligence development.

The Open Dynamics Engine (ODE) is a free physics engine for rigid body dynamics simulation. It can validate the movement of ground vehicles, linkage systems, and other structures in VR environments. ODE is fast, flexible, and powerful, with a built-in collision detection system. Table 1 summarizes the key features of ODE.

Feature Description
Suitability Suitable for simulating hinged rigid body structures where various shapes are interconnected by joints
Design goal Real-time or interactive simulation, especially dynamic environments with moving objects
Stability Highly stable integration system that does not lose control due to simulation errors
Contact model Hard contact with non-penetration constraints for colliding objects
Collision primitives Sphere, box, capsule, plane, line, triangular mesh, and convex shapes
Collision spaces Quadtree, hash space, and simple space
Simulation method Lagrange multiplier velocity based on Trinkle/Stewart and Anitescu/Potra formulations
Integration First-order integration; fast but not sufficiently accurate for quantitative engineering
Interfaces Native C interface and C++ interface built on top

The fundamental components of an ODE simulation include the world, geometry classes, and rigid body functions. The world is a container for rigid bodies and joints; objects in different worlds cannot interact with each other. The dWorldID is created using dWorldCreate(), gravity is set with dWorldSetGravity(), and integration parameters such as ERP (Error Reduction Parameter) and CFM (Constraint Force Mixing) are configured using dWorldSetERP() and dWorldSetCFM() respectively. The world step function dWorldStep() uses a large matrix approach with computational complexity proportional to m³, where m is the number of constraints. Alternatively, dWorldQuickStep() uses an iterative method with complexity proportional to m*N, offering faster computation at slightly lower accuracy.

Geometry classes in ODE include spheres, boxes, planes, and cylinders. A sphere of given radius is created with dCreateSphere(); a box with specified side lengths is created with dCreateBox(); a plane defined by the equation ax+by+cz=d is created with dCreatePlane(); and a cylinder is created with dCreateCylinder(). These geometric objects can be combined to create complex shapes representing the links of a humanoid robot.

Key rigid body functions in ODE include body creation with dBodyCreate(), setting position and orientation with dBodySetPosition() and dBodySetRotation(), applying forces and torques with dBodyAddForce() and dBodyAddTorque(), and managing mass properties with dBodySetMass(). Kinematic states are controlled via dBodySetKinematic() and dBodySetDynamic(). Joints are created with functions such as dJointCreateBall(), dJointCreateHinge(), dJointCreateUniversal(), dJointCreateFixed(), and others. Table 2 lists the available joint types in ODE.

Joint Type Description
Ball and socket Allows rotation about three mutually perpendicular axes
Hinge Allows rotation about a single axis
Slider Allows translation along a single axis
Contact Represents contact between two bodies
Universal Allows rotation about two mutually perpendicular intersecting axes
Hinge-2 Equivalent to two hinges in series with perpendicular axes
Fixed Locks the relative position and orientation of two bodies
Angular Motor Acts as a motor producing relative rotation between two bodies
Linear Motor Acts as a motor producing relative translation between two bodies
Plane-2D Constrains two bodies to move in a plane
Prismatic-Rotoid Combines prismatic and rotational motion

The humanoid robot under study possesses a total of 32 degrees of freedom. For gait planning, the focus is primarily on controlling the lower body, with each leg having six degrees of freedom, totaling twelve. In order to simulate this humanoid robot in ODE, the robot is divided into 22 separate parts. These parts are connected using universal joints, hinge joints, or fixed joints. Universal joints provide two degrees of freedom, while hinge joints provide one degree of freedom. At positions requiring more than two degrees of freedom, such as the hip joint, combinations of universal and hinge joints are used. Additionally, the joint angle ranges are constrained using lowstop and highstop parameters to prevent the simulated joint from rotating beyond the physical limits of the actual robot. Table 3 presents the joint angle ranges for both the standard human and the humanoid robot under study.

Joint Standard Human SJTU Humanoid Robot
Hip X -20° to 45° -35° to 45°
Hip Y -15° to 125° -45° to 45°
Hip Z -45° to 45° -40° to 40°
Ankle Y -130° to 0° -90° to 0°
Foot X -30° to 20° -35° to 35°
Foot Y -45° to 20° -40° to 60°

The modeling process involves both a visual model and a physical model. The visual model is exported from SolidWorks as .skp files, imported into SketchUp, divided into the 22 parts in SketchUp, exported as .dae files, and finally converted to .ive format that LabVIEW can load. For the physical model, the robot is divided into the same 22 parts, and the mass and dimensions of each part are measured and imported into the initialization program. The initialization program also defines the ID, position, rotation orientation, and material properties of each part, and associates the .ive visual model with the corresponding physical model.

To connect the robot parts into an integrated system, joints are created. Ball-and-socket joints were initially tried but showed poor stability in this complex system. Hinge-2 joints cannot limit the range of joint motion. Ultimately, universal joints, hinge joints, and fixed joints were chosen. For a hinge joint, the joint ID, connected bodies, anchor point, axis, and parameters Fmax, FudgeFactor, LoStop, and HiStop need to be specified. Fmax represents the maximum torque the motor can provide when reaching the desired velocity. FudgeFactor adjusts the excessive force applied when a joint starts from rest to avoid jumping. LoStop and HiStop constrain the range of joint angle motion, consistent with the actual humanoid robot’s joint limitations.

After completing the humanoid robot model, an XML file is created to save simulation environment parameters, ground material properties, and the robot’s initial position for later retrieval by the simulation program. In LabVIEW, a 3D Picture is used to create the simulation display interface, the previously generated XML file is loaded, and the simulation time step is configured. Joint trajectories are planned and assigned in a while loop to achieve motion control of the robot.

Through the block-based decomposition of the real robot and importing its dimensions, mass, and appearance into the simulation platform, a model of the humanoid robot is created. This simulation model possesses the various physical characteristics of the real robot. By assigning velocity, position, or torque values to the robot’s joints, the humanoid robot in the simulation environment can perform various actions identical to those of the real robot.

2. Mathematical Model of Humanoid Robot

The humanoid robot can be structurally divided into lower body and upper body mechanisms. The lower body is primarily responsible for walking, while the upper body handles manipulation tasks. Motion of the upper body can affect walking to some extent, but its main function is not balance maintenance. Therefore, stable walking is mainly achieved through the lower body. To account for the upper body’s influence on walking, an upper body link is commonly used as a simplification. In this study, the upper body is simplified as a single link to focus on walking control.

The humanoid robot is a multi-link mechanism characterized by multi-variable, strong coupling, nonlinearity, structural complexity, and instability. During walking, single support and double support phases alternate, causing the dynamic model to change due to varying support leg configurations. To conduct gait planning research, both kinematic and dynamic models are essential.

Kinematics describes the relationship between body parts and joint angles, serving as the foundation for robot gait planning. Dynamics builds upon kinematics to study the relationship between link motion and joint driving torques during walking. The dynamic model can be used to verify whether joint torques exceed the maximum motor capacity and to optimize trajectories for reduced output torque.

2.1 Kinematic Model

Spatial position is represented using a 3×1 vector in a given coordinate frame. To transform coordinates from one frame to another, a rotation matrix composed of direction cosines is used. For a coordinate frame {B} relative to {A}, the position and orientation are expressed using the position vector and rotation matrix. The homogeneous transformation matrix is defined as:

$$ T_{BA} = \begin{bmatrix} R_{BA} & p_{BA} \\ 0 & 1 \end{bmatrix} $$

Forward kinematics determines the pose of links based on joint angles, commonly used for center of gravity calculation, graphical description, and collision detection. The Denavit-Hartenberg (D-H) method is widely adopted to uniquely describe the structure of a kinematic chain. Four parameters, a_{i-1} , \alpha_{i-1} , d_i , and \theta_i , define each link. For a revolute joint, \theta_i is the joint variable, while for a prismatic joint, d_i is the joint variable. The transformation matrix between consecutive coordinate frames is expressed as:

$$ T_i^{i-1} = \begin{bmatrix} \cos\theta_i & -\sin\theta_i & 0 & a_{i-1} \\ \sin\theta_i \cos\alpha_{i-1} & \cos\theta_i \cos\alpha_{i-1} & -\sin\alpha_{i-1} & -d_i \sin\alpha_{i-1} \\ \sin\theta_i \sin\alpha_{i-1} & \cos\theta_i \sin\alpha_{i-1} & \cos\alpha_{i-1} & d_i \cos\alpha_{i-1} \\ 0 & 0 & 0 & 1 \end{bmatrix} $$

Inverse kinematics computes joint angles from known link poses. For the humanoid robot, the problem focuses on determining joint angles from the positions of the trunk and feet. This is particularly important when motion posture requirements exist, such as when the robot must control foot height and landing position when climbing stairs. For the lower body, given the hip joint position C with coordinates (x_C, y_C, z_C) and ankle joint position A with coordinates (x_A, y_A, z_A) , the distance b between ankle and hip can be calculated. Using the cosine law, the knee angle B can be derived:

$$ B = \arccos\left(\frac{a^2 + c^2 – b^2}{2ac}\right) $$

where a is the thigh length and c is the shank length. Using the sine law, angles A and C can be determined, and thus the complete joint configuration. The inverse kinematics solution provides the joint angles necessary for the legs to reach desired positions, which is fundamental for foot trajectory planning.

2.2 Dynamic Model

Robot dynamics is a challenging research area, especially for unstable multi-link systems like humanoid robots. Two primary approaches exist for dynamic modeling: the Newton-Euler method and the Lagrangian method. The Newton-Euler method is based on Newton’s equations of motion and Euler’s equations, analyzing both constraint forces and torques between links. The Lagrangian method adopts an energy-based perspective, which is particularly relevant given the energy control importance in humanoid robot locomotion. For this research, the Lagrangian method is used.

The Lagrangian function is defined as the difference between kinetic energy and potential energy:

$$ L(q, \dot{q}) = K(q, \dot{q}) – P(q) $$

where K(q, \dot{q}) is the total kinetic energy and P(q) is the total potential energy of the system. The dynamic equations of motion are obtained using the Euler-Lagrange equation:

$$ \frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}_i}\right) – \frac{\partial L}{\partial q_i} = \tau_i $$

where q_i are generalized coordinates and \tau_i are generalized forces (torques).

The humanoid robot structure is simplified as a multi-link system with links m_1 through m_8 representing various body segments. The positions of each link’s center of mass are expressed in terms of joint angles. For link i, the kinetic energy T_i and potential energy U_i are:

$$ T_i = \frac{1}{2} m_i v_i^2 $$

$$ U_i = m_i g h_i $$

where v_i is the velocity of the link’s center of mass, g is gravitational acceleration, and h_i is the height of the center of mass. The velocities v_i are obtained by differentiating the position equations with respect to time.

For each joint angle \theta_i , the Lagrangian equations are expanded. For example, for \theta_1 :

$$ \frac{d}{dt}\left(\frac{\partial L}{\partial \dot{\theta}_1}\right) – \frac{\partial L}{\partial \theta_1} = \tau_1 $$

This procedure is repeated for all joint angles, resulting in a complete dynamic model that relates joint torques to joint angles, angular velocities, and angular accelerations. By providing the planned trajectories (joint angles as functions of time), the required joint torques can be calculated. This is essential for verifying actuator capabilities and optimizing the trajectories. The torque calculation was implemented in LabVIEW using formula nodes, where the necessary inputs are imported to compute joint torques for both single support and double support phases.

3. Gait Planning for Humanoid Robot

Gait planning is a central research area in humanoid robotics. It determines not only walking speed and step length but also significantly affects energy consumption and stability. The quality of gait planning largely determines the success of a humanoid robot research. Over four decades of development, various gait planning methods have been proposed, including inverted pendulum models, Zero Moment Point (ZMP) theory, passive walking, and spline interpolation methods.

3.1 Basic Concepts in Gait Planning

Several fundamental terms are defined: A single step is the process from one foot contacting the ground to the other foot lifting and then landing, comprising a single support phase and a double support phase. A double step (stride) is the process from one foot contacting the ground to that same foot contacting again, comprising two single support phases and two double support phases. Step length is the longitudinal distance between two foot landing points during walking. Stride length is the longitudinal distance between two consecutive landing positions of the same foot. Step height is the maximum distance the swinging leg lifts off the ground during a step. Walking cycle is the time required to complete one stride. Walking speed is the distance traveled per unit time. Single support phase refers to the stage where only one foot supports, while the other foot is off the ground. Double support phase is when both feet are in contact with the ground. Static walking maintains static equilibrium throughout; dynamic walking maintains dynamic equilibrium.

3.2 Inverted Pendulum Model

The humanoid robot’s legs, similar to humans, have hip, knee, and ankle joints. To study the motion characteristics, the robot can be approximated as an inverted pendulum model under the following conditions: (1) ignore leg masses and treat foot-ground contact as a pivot point, (2) concentrate all mass at the center of gravity (COG), (3) ignore lateral motion and consider only vertical and forward motion. The dynamic equations of the inverted pendulum are:

$$ M r^2 \ddot{\theta} = M g r \sin\theta + \tau $$

$$ F_r = M g \cos\theta – M r \dot{\theta}^2 $$

where M is the total mass, r is the pendulum length, \theta is the angle from vertical, and \tau is the torque at the pivot. During walking, the foot-ground contact area is small, so the torque \tau is limited. To maintain balance, either the center of gravity must be exactly over the pivot or the leg must extend/retract to control the vertical center of mass motion. The latter approach leads to the 2D inverted pendulum with a constant center of mass height, which is more applicable to humanoid walking. The equations become:

$$ \ddot{x} = \frac{g}{z} x $$

where x represents the horizontal position and z is the constant height of the center of mass. The analytical solution is:

$$ x(t) = x_0 \cosh\left(\frac{t}{\sqrt{z/g}}\right) + \frac{\dot{x}_0}{\sqrt{g/z}} \sinh\left(\frac{t}{\sqrt{z/g}}\right) $$

$$ \dot{x}(t) = \dot{x}_0 \cosh\left(\frac{t}{\sqrt{z/g}}\right) + x_0\sqrt{g/z} \sinh\left(\frac{t}{\sqrt{z/g}}\right) $$

By planning the center of mass trajectory according to the inverted pendulum model, inertia can be utilized to save energy and reduce required motor torque.

3.3 Dynamic Stability Criterion

During walking, the humanoid robot alternates between single support and double support phases, with the foot-ground contact position changing continuously. Two important stability measures are the center of gravity ground projection point (COG) and the Zero Moment Point (ZMP). COG applies to static stability, while ZMP applies to dynamic stability. ZMP can be considered as an extension of COG for dynamic systems.

The COG is calculated from known masses m_i and positions (x_i, y_i) of each robot part:

$$ x_{COG} = \frac{\sum m_i x_i}{\sum m_i} $$

$$ y_{COG} = \frac{\sum m_i y_i}{\sum m_i} $$

If the COG projection falls inside the support polygon, the robot satisfies the static stability condition. The support polygon in single support is the support foot area; in double support, it is the convex polygon formed by both feet.

ZMP is defined as the point on the ground where the resultant of gravity and inertia forces intersects the supporting surface. The ZMP can be computed as:

$$ x_{ZMP} = \frac{\sum m_i(\ddot{z}_i + g) x_i – \sum m_i \ddot{x}_i z_i}{\sum m_i(\ddot{z}_i + g)} $$

$$ y_{ZMP} = \frac{\sum m_i(\ddot{z}_i + g) y_i – \sum m_i \ddot{y}_i z_i}{\sum m_i(\ddot{z}_i + g)} $$

When the ZMP lies inside the support polygon, the humanoid robot is considered dynamically stable. This is a fundamental criterion for evaluating gait stability.

3.4 Trajectory Planning

The core of humanoid robot control lies in trajectory planning, which determines walking speed, step length, and stability. Trajectory planning focuses primarily on lower body joint trajectories, particularly the hip and ankle joint trajectories. In this study, the hip and ankle trajectories are generated using cubic spline interpolation, and knee joint trajectories are computed from the hip and ankle positions.

A cubic spline consists of N-1 cubic polynomials connecting N data points. For consecutive polynomial segments s_k(x) and s_{k+1}(x) , the function values, first derivatives, and second derivatives must be continuous at the intermediate points. For three adjacent nodes P_{k-1} , P_k , and P_{k+1} , the two cubic polynomials have 8 unknowns. The conditions of continuity provide 6 equations, requiring two additional boundary conditions, typically the first derivatives at the start and end points. Setting these to zero yields a complete system:

$$ s_k(x) = a_k x^3 + b_k x^2 + c_k x + d_k $$

$$ s_{k+1}(x) = a_{k+1} x^3 + b_{k+1} x^2 + c_{k+1} x + d_{k+1} $$

The trajectory planning divides humanoid robot walking into three phases: starting phase, walking phase, and stopping phase. The starting phase involves knee bending to lower the center of gravity, improving stability and enabling longer steps. The walking phase is a cyclic sequence of single support and double support phases. The stopping phase includes a deceleration step to bring the robot to rest smoothly.

The planned time for the starting phase is 1 second, during which the hip height is lowered from 0.5125 m to 0.47 m, and the center of gravity is shifted 0.06 m to the left to position it over the left foot. In the walking phase, based on the robot’s mechanical structure and repeated simulations, the single support time is set to 1.2 s, the double support time to 0.8 s, and the step length to 0.26 m. The single support phase is an unstable period analogous to an inverted pendulum. The swinging foot must land before the robot falls, while the center of gravity moves forward to maintain stability. The double support phase primarily moves the weight forward to prepare for the next step, reducing cumulative errors and increasing stability.

The trajectory planning uses cubic spline interpolation to generate smooth trajectories for the hip, knee, and ankle joints in both the X and Z axes during both the single and double support phases. The ZMP trajectory is planned to remain within the support polygon throughout the walking cycle, ensuring dynamic stability. The planned joint position trajectories are then converted into joint angle trajectories for motor control convenience.

3.5 Simulation Studies

Simulation experiments were conducted to realize a complete stable walking process of the humanoid robot, from starting to walking to stopping. A PD controller was added to ensure each joint follows the planned trajectory with minimal error. The joint angles observed during simulation are compared with the planned trajectories. The actual joint positions closely track the desired positions, confirming that the proposed gait planning method is feasible.

The integration of inverted pendulum theory for energy optimization and ZMP theory for stability verification, combined with cubic spline interpolation, provides an effective approach for gait planning of humanoid robots. The walking simulation demonstrated stable forward progression, proving that the algorithm is capable of generating stable walking patterns for humanoid robots.

4. Control System of Humanoid Robot

The control system of the humanoid robot consists of several components: a PC, Single-BoardRIO, EPOS2 drivers, Maxon motors, and sensors. The PC writes programs into the FPGA of Single-BoardRIO via LAN. The Single-BoardRIO uses a cRIO-9853 CAN module to connect motor drivers EPOS2, which control Maxon motors via CAN bus. For the lower body, Maxon DC motors with 60 W power are selected due to high output torque requirements. For the upper body, Maxon DC motors with 40 W are used to reduce weight. Additionally, gyroscopes and force sensors are mounted to provide real-time feedback signals to the Single-BoardRIO for closed-loop control.

4.1 Single-BoardRIO Motion Controller

The NI sbRIO-9642/9642XT embedded control and acquisition device integrates a real-time processor, a reconfigurable FPGA, and I/O on a single printed circuit board. It features a 400 MHz industrial processor, a 2-million gate Xilinx Spartan FPGA, 110 lines of 3.3 V digital I/O, 32 single-ended/16 differential analog input channels with 16-bit resolution, 4 analog output channels with 16-bit resolution, and 32 industrial 24 V digital I/O lines. The device provides an operating temperature range of -20°C to 55°C for the standard version and -40°C to 85°C for the extended temperature version. It includes 128 MB DRAM and 256 MB non-volatile memory for embedded operation. An integrated 10/100 Mbps Ethernet port enables network communication with built-in Web (HTTP) and File (FTP) servers. The NI sbRIO-9642/9642XT is designed for easy embedding into high-volume applications, offering flexibility, reliability, and high performance.

4.2 cRIO-9853 CAN Module

The NI 9853 CAN module enables communication at rates up to 1 Mbps, representing 100% bus load. It supports 11-bit and 29-bit arbitrary IDs and J1939 networks. The module provides synchronization with CompactRIO I/O modules with 25 ns resolution. Using NI-CAN 2.3 or later driver software, vector database files can be incorporated into applications, facilitating seamless integration with the CAN network.

4.3 EPOS2 Motor Driver

The EPOS2 24/2 motor driver is specifically designed for communication and control in CANopen networks, with USB and RS232 as additional communication interfaces. It supports various operating modes including position, velocity, and current modes, making it flexible for automation engineering and mechatronic systems. Additional functions include Step/Direction mode for incremental motor control, Master Encoder mode for electronic gearing, and analog setpoint voltage command for replacing traditional servo amplifiers.

The EPOS2 24/2 controller offers excellent motion control functions including dual-loop position and velocity control. In Interpolated Position Mode (PVT), the position controller synchronously follows paths defined by waypoints with high dynamics and precision. The built-in Regulation Tuning function enables effective setting of current, speed, and position control during motor startup. Control commands can be sent via CAN Master, such as EPOS2 P, SPS, Soft SPS, or PLC, or via PC USB or RS232 interfaces. Multiple drivers can be connected to form a network, coordinated through standard CANopen interfaces. Integrated gateway functions allow simple access to the CAN network.

4.4 CAN Bus Communication

CAN bus (Controller Area Network) is a fieldbus technology and a new generation of open, broadcast-architecture network communication protocol. It was developed by Bosch in 1986 for the European automotive market. CAN bus is designed for reliable, real-time data exchange between control and test systems under strong electromagnetic interference. Its basic features include:

Feature Description
Addressing Replaces traditional station address coding with data block encoding
Arbitration Priority-based arbitration ensures higher-priority messages transmit without interruption
Frame structure Short frame format with up to 8 data bytes per frame in CAN 2.0A
Error checking CRC check ensures data transmission reliability
Error handling Nodes with severe errors can autonomously disconnect from the bus
Data modes Point-to-point, point-to-multipoint, and broadcast transmission
Speed Up to 1 Mbps at 40 m, up to 10 km at 5 Kbps

4.5 Motor Control Implementation

The EPOS2 motor driver supports dynamic link library calls under Windows for motor control. However, since the Single-BoardRIO operates under an embedded operating system, dynamic link library calls are not possible. Therefore, the CAN bus bottom-layer communication protocol is used directly. Through this protocol, speed, position, and torque control are implemented. Taking speed control as an example, the following procedure is executed in LabVIEW:

1. Initialize the CAN bus communication protocol.
2. Use NMT communication mode to put the CAN bus into pre-operational mode.
3. Use SDO communication mode to initialize the EPOS2 driver and assign an ID.
4. Use PDO communication mode to set the EPOS2 driver’s motion mode and operating parameters.
5. Use NMT communication mode to switch the CAN bus into operational mode.
6. Send synchronization commands to synchronize all devices on the CAN bus.
7. Use PDO communication mode to assign velocity values.
8. Use PDO communication mode to read the driver’s position, velocity, and status.
9. Use PDO communication mode to halt the motor.
10. Disable the EPOS2 controller.
11. Close the CAN bus.

Through the CAN bus communication approach, all three motor control modes are implemented: speed control, position control, and torque control. Each control mode follows a similar initialization sequence but applies different command data formats and control parameters. This framework establishes the foundation for controlling all joints of the humanoid robot in a coordinated manner.

5. Conclusion and Future Work

Based on the absorption and development of domestic and international humanoid robot research results, this paper has conducted in-depth research on simulation platform construction, mathematical modeling, walking stability, gait planning, and motor control for humanoid robots. The main work accomplished is summarized as follows:

1. The humanoid robot was decomposed into multiple parts, and a physical simulation model was established in LabVIEW. The simulation parameters including volume, position, material, and appearance were set according to the real humanoid robot. SolidWorks and SketchUp were used to decompose the robot model and convert it into .ive format for LabVIEW import, generating the visual model. Joints were added between the robot parts, and joint motion ranges and maximum torques were configured. Finally, the simulation environment was configured and an XML configuration file was generated.

2. A mathematical model of the humanoid robot was built. The forward kinematics model was established using the D-H method, and inverse kinematics was solved using trigonometric functions. Complete dynamic models were developed through Lagrangian analysis, enabling joint torque computation from planned trajectories.

3. Trajectory planning for the humanoid robot was conducted by integrating inverted pendulum theory for energy optimization and ZMP theory for stability determination. Cubic spline interpolation was applied to generate smooth trajectories, and the planned joint position trajectories were converted into joint angle trajectories for motor control. Simulation results verified that the humanoid robot can achieve stable walking on the simulation platform.

4. A control system was constructed using a motion controller, CAN card, motor drivers, and motors. Through the CAN bus communication protocol, speed, position, and torque control modes were implemented, providing the necessary control framework for the physical humanoid robot.

The primary innovations of this research compared to related domestic and international studies include: (1) the first system-level modeling and gait planning simulation of humanoid robots based on LabVIEW, combining physical and visual models to achieve stable walking; the built-in compatibility between LabVIEW simulation and NI motion controllers provides a seamless bridge for real robot experiments; (2) the combined use of inverted pendulum theory and ZMP theory for trajectory optimization, balancing energy efficiency with walking stability.

Since Honda’s P2 humanoid robot was developed in 1996, bipedal walking has become a research hotspot in robotics and has developed rapidly. Basic human walking functions have been preliminarily achieved. However, to enable humanoid robots to walk completely like humans in arbitrary environments and achieve practical applications, many issues require further research. These include the influence and effective use of arm swing and manipulation on walking stability, implementation of active foot rolling during walking to reduce energy consumption, and the intelligence and evolution of robots—how to learn from past experiences and evolve more skillful, instinctive action capabilities, similar to how a child learns to walk. In summary, humanoid robot research is still in its infancy. With continued development and deeper research, humanoid robots will continue to evolve, becoming closer to humans in their capabilities. This day is not far away.

In conclusion, the motion control of humanoid robots is an extremely challenging and interdisciplinary field that requires deep understanding of mechanism design, control theory, dynamics, and software development. Through the combination of simulation platforms, mathematical modeling, advanced gait planning algorithms, and robust motor control systems, the feasibility of stable bipedal walking for humanoid robots has been convincingly demonstrated. While significant challenges remain—such as real-time adaptive gait generation in unstructured environments, efficient energy utilization, and seamless human-robot interaction—the future of humanoid robot research is promising. With ongoing technological advancements in computation, sensing, actuation, and artificial intelligence, humanoid robots will continue to evolve and fulfill increasingly important roles in society, from industrial applications to personal assistance and beyond.

Scroll to Top