A quadruped robot motion control method based on spiking neural network in complex environments
By constructing a single-leg model of a quadruped robot and a hybrid neural network, combined with inverse kinematics algorithms and image recognition technology, accurate gait and trajectory planning of the quadruped robot on complex terrain is achieved, solving the motion control difficulties of traditional robots on complex terrain and improving stability and adaptability.
Patent Information
- Application Number
- CN202211238798.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-11
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-10-11
AI Technical Summary
Traditional wheeled or tracked mobile robots have difficulty moving on complex terrain. The motion control of quadruped robots in complex terrain is greatly affected by the external environment. Existing technologies make it difficult to achieve accurate gait planning and motion control, which may lead to problems such as robots falling.
A single-leg model of a quadruped robot is constructed based on the DH parameter method. Combining the inverse kinematics algorithm with a CNN and SNN hybrid neural network, gait and foot trajectory planning are performed through image recognition of terrain features, achieving real-time motion control adjustment.
It improves the adaptability and stability of the quadruped robot on complex terrain, reduces hardware power consumption, and achieves accurate perception and effective motion control of different terrains.
Smart Images

Figure CN115546547B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quadruped robot control, and in particular relates to a quadruped robot motion control method based on a pulse neural network in a complex environment. Background Art
[0002] The Earth's land surface is complex and varied, with over 50% of its surface area consisting of rugged terrain, including hills, steps, and gullies. Traditional wheeled or tracked mobile robots are unable to maneuver properly in this terrain, making it difficult for them to perform tasks such as engineering exploration, military reconnaissance, and terrain surveys in such areas. While quadruped robots are slower than wheeled robots, they utilize isolated ground support rather than the continuous, flat surface required by wheeled robots, making them less demanding on the surface they travel on. They can avoid or traverse obstacles contactlessly, and can even perform complex tasks such as crossing streams and climbing stairs. These characteristics are unmatched by any current wheeled mobile robot, making the motion control of quadruped robots a hot topic in robotics research both domestically and internationally.
[0003] A quadruped robot is a multi-body, nonlinear, rigid-flexible system with complex interactions with its environment. Its motion performance is significantly influenced by the characteristics of the external environment. For the robot to make accurate and effective gait planning, foot trajectory planning, and motion control decisions, it must be able to perceive and classify the terrain of its environment. Failure to accurately perceive the terrain characteristics of the robot can lead to incorrect gait planning and motion control, preventing it from achieving its target motion and even causing it to fall. Therefore, to improve the robot's terrain adaptability and prevent instability and slipping during movement, the robot must be able to accurately modify its motion control mode in real time based on the different terrain characteristics it recognizes.
[0004] Currently, the more mature robot terrain classification methods mainly include those based on sensor data and those based on vision. The former only captures signals and classifies the terrain currently being traversed by the robot, but cannot predict the terrain ahead. The latter effectively addresses this problem and is closest to human environmental perception, providing richer environmental perception information. Therefore, if visual information can be used to accurately identify the robot's environment and, based on this recognition result, modify the robot's motion control strategy in real time, its adaptability to complex terrain will be significantly improved. Summary of the Invention
[0005] In response to the above problems, the purpose of the present invention is to provide a quadruped robot motion control method based on a pulse neural network in a complex environment, which can enable the quadruped robot to accurately perceive external environmental information while moving on complex terrain, and make correct and effective gait planning and motion control decisions based on this, thereby achieving its stable movement in complex terrain.
[0006] The specific technical solutions for achieving the purpose of the present invention are as follows:
[0007] A quadruped robot motion control method based on a spiking neural network in a complex environment comprises the following steps:
[0008] Step 1: Construct a single-leg model of a quadruped robot based on the DH parameter method;
[0009] Step 2: Construct a transformation model of the quadruped robot's leg joint angle states and foot position coordinates based on the inverse kinematics algorithm;
[0010] Step 3: Build a CNN and SNN hybrid neural network model;
[0011] Step 4: Train the hybrid neural network model constructed in step 3 based on the gradient descent method;
[0012] Step 5: Collect images and input the collected environmental images into the trained hybrid neural network model to extract and classify the environmental features;
[0013] Step 6: Perform gait planning and foot trajectory planning based on the terrain classification results;
[0014] Step 7: Complete the quadruped robot motion control. The present invention will be described in further detail below with reference to the accompanying drawings.
[0015] Compared with the prior art, the present invention has the following beneficial effects:
[0016] (1) The technical solution of the present invention is based on a CNN and SNN hybrid neural network model to extract and classify environmental features, integrating the respective advantages of deep convolutional neural networks and spiking neural networks, leveraging the powerful feature extraction capabilities of deep convolutional neural networks and the judgment capabilities of spiking neural networks that are more in line with biological neural mechanisms, while also having lower power consumption and reduced requirements for hardware platforms;
[0017] (2) The technical solution of the present invention uses the terrain classification results based on the pulse neural network to make real-time adjustments to the motion control processes of the quadruped robot, such as gait planning and foot trajectory planning, so that the quadruped robot has stronger adaptability and passability to complex terrains with different characteristics. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1It is a flow chart of the steps of the present invention.
[0019] Figure 2 Schematic diagram of a simulation of a quadruped robot in an embodiment of the present invention.
[0020] Figure 3 Schematic diagram of the single-leg kinematic model of a quadruped robot in an embodiment of the present invention.
[0021] Figure 4 Schematic diagram of the hybrid neural network model architecture of the present invention.
[0022] Figure 5 Schematic diagram of a spiking neural network neuron of the present invention.
[0023] Figure 6 The diagram shows the changes in membrane potential and pulse emission of the LIF neurons of the present invention under constant injection current stimulation.
[0024] Figure 7 Schematic diagram of the Walk gait timing of the quadruped robot of the present invention.
[0025] Figure 8 Schematic diagram of the Trot gait timing of the quadruped robot of the present invention.
[0026] Figure 9 Schematic diagram of foot end trajectories at different trajectory heights in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] A quadruped robot motion control method based on a spiking neural network in a complex environment comprises the following steps:
[0028] Step 1: Construct a single-leg model of a quadruped robot based on the DH parameter method, specifically:
[0029] The DH method is used to establish the kinematic model of a single leg (left front leg) of a quadruped robot. The coordinate systems of the rods on the four legs are established in the same way. The DH parameters are listed in Table 1: (i in the table represents the code of the coordinate system)
[0030] Table 1 DH parameters of leg mechanism
[0031]
[0032] in:
[0033] α i-1 :by Look at the direction, and The angle between them.
[0034] a i-1 :Along direction, and The distance between i >0).
[0035] θ i :by Look at the direction, and The angle between them.
[0036] d i :Along direction, and The distance between.
[0037] Coordinate systems 1-4 are the side swing joint coordinate system, hip joint coordinate system, knee joint coordinate system, and foot end coordinate system respectively.
[0038] The transformation matrix between adjacent coordinates is:
[0039]
[0040] Substitute the DH parameters into the above formula to obtain the transformation matrix of each adjacent coordinate, and multiply them in sequence to obtain the transformation matrix of the foot end coordinate system relative to the lateral swing joint fixed coordinate system:
[0041]
[0042] Where R is the rotation matrix of the foot end coordinate system relative to the side swing joint fixed coordinate system, and P is the position coordinate of the foot end in the side swing joint coordinate system. Calculation results:
[0043] The transformation matrix from the foot-end coordinate system to the side-swing coordinate system:
[0044]
[0045] Therefore:
[0046]
[0047] Among them, P represents the coordinate of the foot end relative to the side-swing joint coordinate system, that is, the forward kinematics solution of the single leg of the quadruped robot, and θ1, θ2, and θ3 are the rotation angles of the side-swing joint, hip joint, and knee joint, respectively.
[0048] Step 2: Construct a transformation model of the quadruped robot's leg joint angle state and foot end position coordinates based on the inverse kinematics algorithm, specifically:
[0049] Inverse kinematics is the process of calculating the parameters of the joints that need to be set based on the target pose. Given the known position and posture of the foot, it is usually possible to express the function of each joint variable as it changes with the foot's coordinates:
[0050] The inverse kinematics solution of a single leg of a quadruped robot is as follows:
[0051]
[0052]
[0053] Among them, L1 is the distance from the side-swing joint coordinate system to the hip joint coordinate system along the x-axis, L2 is the distance from the hip joint coordinate system to the knee joint coordinate system along the x-axis, and L3 is the distance from the knee joint coordinate system to the foot coordinate system along the x-axis; x, y, and z are the coordinates of the foot relative to the side-swing coordinate system, and θ1, θ2, and θ3 are the rotation angles of the side-swing joint, hip joint, and knee joint, respectively.
[0054] Step 3: Build a CNN and SNN hybrid neural network model, specifically:
[0055] The hybrid neural network model adopts a feedforward network structure, including a convolutional neural network and a pulse neural network, wherein the output of the convolutional neural network is converted into a pulse sequence and input into the pulse neural network.
[0056] The convolutional neural network adopts a feedforward network structure, uses a combination of cubic convolution and pooling, and then adds a fully connected layer to complete the feature extraction function of the terrain image;
[0057] Furthermore, the spiking neural network is a single-layer structure, and the network nodes are composed of spiking neurons, which complete the classification function of the terrain image;
[0058] Furthermore, each node in the spiking neural network is called a spiking neuron. The spiking neuron adopts the LIF neuron model. The membrane potential change equation of the LIF neuron membrane potential is:
[0059]
[0060] Among them, τ m =RC is the membrane time constant, u rest represents the resting potential of the neuron, RI(t) represents the voltage across the equivalent membrane resistance of the spiking neuron, and u(t) represents the voltage across the equivalent membrane capacitance of the spiking neuron;
[0061] The neuron's spikes pass the threshold control:
[0062]
[0063] Among them, when u(t f ) increases to When the neuron fires a pulse, the voltage is reset to u reset , t frepresents the pulse firing time of the neuron, u(t f ) represents the voltage of the membrane capacitance of the spiking neuron, is the set threshold;
[0064] According to the LIF neuron membrane potential differential equation, the subthreshold neural dynamics differential equation used in the program is:
[0065]
[0066] Since the input of the spiking neural network is in the form of pulses, the numerical results output by the convolutional neural network need to be pulsed. The output data of the convolutional neural network is converted into a pulse sequence using Poisson coding and input into the spiking neural network. The Poisson coding process is:
[0067]
[0068] Among them, P T (n) represents the probability of a single neuron emitting n pulse trains within a set time period T, n represents the number of neurons, and r represents the output data of the convolutional neural network to be encoded.
[0069] The hybrid network model adopts a feedforward network structure. Information in the model network propagates only forward in the neural network, first through the input nodes, then through the hidden layers, and finally through the output nodes. The first part of the network uses a combination of cubic convolution and pooling, followed by a fully connected layer. The final layer uses a spiking neural network to complete the transition to the output layer.
[0070] Step 4: Train the hybrid neural network model constructed in step 3 based on the gradient descent method, specifically:
[0071] The convolutional neural network model can be trained directly using the gradient descent method. The main improvement is in the spiking neural network model. Since the step function y = H (x) is used in the spiking neural network, the gradient cannot be calculated. Therefore, the gradient calculation is used in the back propagation. rather than Here, h(t) is a surrogate function that is similar in shape to H(x) but smooth and continuous. This improvement allows the entire network to be trained using gradient descent and the Adam optimizer to update weight parameters.
[0072] The alternative function used during backpropagation is the sigmoid function.
[0073]
[0074] The back propagation gradient calculation formula is:
[0075] g′(x)=α*(1-sigmoid(αx))sigmoid(αx)
[0076] α is a parameter that controls the smoothness of the gradient during backpropagation.
[0077] Step 5: Collect images and input the collected environmental images into the trained hybrid neural network model to extract and classify the environmental features. Specifically:
[0078] Initialize the internal and external parameters of the camera, use the camera to capture images, and then perform a series of preprocessing to scale the RGB three-channel image data to 32*32 and input it into the hybrid neural network model;
[0079] The hybrid neural network model will output the probability of the corresponding terrain, and the terrain with the maximum probability will be taken as the final recognition result.
[0080] Step 6: Perform gait planning and foot trajectory planning based on the terrain classification results, specifically:
[0081] Step 6-1: Perform gait planning based on the terrain classification results of the environment:
[0082] According to the balance mode, the gait of quadruped robots can be divided into three types: static gait, dynamic gait and quasi-static gait.
[0083] A static gait is one that maintains static stability throughout the robot's motion. This involves controlling the quadruped robot to maintain a maximum of one leg raised at any given time, and keeping the projection of the robot's center of gravity within the support polygon. A typical static gait is the Walk gait. Because the robot maintains static stability at all times, and especially because it does not require additional posture control, the static gait control method is relatively stable and suitable for navigating rough terrain. However, this method results in slower walking speeds and lower energy efficiency.
[0084] A dynamic gait is one that maintains dynamic stability throughout the robot's motion. This means that at most two legs are in the stance phase at any given time. A typical example of a dynamic gait is the Trot gait. Because this gait eliminates static stability considerations and maintains balance during dynamic movement, it is suitable for rapid movement and offers high efficiency. However, it struggles to maintain stability when navigating rough terrain.
[0085] The quasi-static gait is a gait form between static and dynamic.
[0086] The difference between gaits can be expressed in terms of stance phase duty factor ρ and phase difference The stance phase duty factor refers to the ratio of the stance phase time of each leg to the entire gait cycle, and the phase difference refers to the ratio of the time difference between the movements of different legs to the entire gait cycle (one leg can be arbitrarily selected as the reference leg, ).
[0087] (1) When the quadruped robot is in a rough terrain environment, such as gravel roads or grass, it should choose the Walk gait and moderately reduce the step frequency. The common rotation order of the Walk gait is left front → right back → right front → left back → left front in an inverted "8" shape. At any time, at least three legs are in the support phase.
[0088] The support phase duty factor of the quadruped robot is ρ = 0.75, and the phase difference between the four legs is Therefore, the phase difference between each leg is:
[0089]
[0090] and The phase differences are left front, left rear, right rear and right front legs, respectively;
[0091] The gait change period T increases with the increase of road roughness;
[0092] (2) When the quadruped robot is in a flat terrain environment, such as asphalt or tile, it selects the Trot gait and moderately speeds up the step frequency. The two diagonal legs move in pairs, that is, the left front leg and the right hind leg move in unison, and the left hind leg and the right front leg move in unison. At any time, at least two legs are in the support phase. The support phase duty factor of the quadruped robot is ρ = 0.5, and the phase difference between the four legs is ρ. Therefore, the phase difference between each leg is:
[0093]
[0094] The gait variation period T decreases as the flatness of the road increases.
[0095] When the gait of a quadruped robot needs to be switched, it should be completed at the moment when all four legs are in the support phase to ensure movement stability.
[0096] When the robot is on rough terrain, it switches to a Walk gait and reduces its cadence. When the robot is on flat terrain, it switches to a Trot gait and increases its cadence. This gait control strategy allows the robot to maintain both speed and stability.
[0097] Step 6-2: Perform foot trajectory planning based on the terrain classification results of the environment:
[0098] Among the interactions between a robot and the ground, slippage has the most significant impact on its performance. During motion, slippage can cause the robot to become unstable or even fall. Therefore, slippage must be considered and addressed during robot movement.
[0099] When interacting with different road surfaces, quadruped robots can effectively prevent slipping by controlling the ground entry angle of their trajectory. A higher trajectory height often results in a greater ground entry angle, making it less likely to slip. Furthermore, a higher trajectory height also allows the robot to better navigate obstacles. Therefore, when moving on surfaces with a high coefficient of friction or smooth surfaces, quadruped robots use a lower-height foot trajectory planning curve; when moving on surfaces with a low coefficient of friction or uneven surfaces, quadruped robots use a higher-height foot trajectory planning curve.
[0100] According to the requirements of the foot end motion position of the quadruped robot, the displacement constraint equations of the foot end trajectory in the forward direction and the vertical direction are obtained as follows:
[0101] The way forward:
[0102]
[0103] Vertical direction:
[0104]
[0105] To reduce the impact force between the foot and the ground and the inertial force at the foot when the quadruped robot switches between the swing phase and the support phase, based on the zero-impact principle, it is hoped that under ideal conditions, the velocity and acceleration of the foot when it contacts the ground are zero. In other words, the velocity and acceleration of the foot trajectory in the forward and vertical directions must meet the following constraints:
[0106] The way forward:
[0107]
[0108] vertical direction
[0109]
[0110] According to the above constraints, the cycloid trajectory planning equation of the quadruped robot's foot end is:
[0111] (1) Swing phase trajectory:
[0112] The way forward:
[0113]
[0114] Vertical ascent stage:
[0115]
[0116] Vertical descent phase:
[0117]
[0118] (2) Support phase trajectory:
[0119] The way forward:
[0120]
[0121] Vertical direction:
[0122] z=-h,βT≤t≤T
[0123] Where s is the foot end trajectory step length, h is the trajectory height, T is the gait period, β is the swing phase duty cycle, x is the robot forward direction coordinate, and z is the vertical direction coordinate;
[0124] By controlling the trajectory height h, the ground entry angle of the quadruped robot's foot end is controlled, thereby controlling the foot end trajectory of the quadruped robot.
[0125] Step 7: Complete the quadruped robot motion control, namely:
[0126] The gait planning and foot trajectory planning of the quadruped robot are completed based on the environmental information extracted by the hybrid neural network model;
[0127] According to the target position coordinates of the foot end of the quadruped robot, the rotation angles of each leg joint of the quadruped robot are determined according to the single-leg model and transformation model determined in steps 1 and 2, and transmitted to the joint servo motor driver to drive it to rotate to the target angle, thereby completing the motion control of the quadruped robot.
[0128] A quadruped robot motion control system based on pulse neural network includes the following modules:
[0129] Single-leg model construction module: used to build a single-leg model of a quadruped robot;
[0130] Conversion model construction module: used to construct the conversion model of the quadruped robot's leg joint angle state and foot end position coordinates based on the inverse kinematics algorithm;
[0131] Hybrid neural network model module: used to build and train a CNN and SNN hybrid neural network model;
[0132] Environmental feature extraction module: used to collect environmental images and input the collected environmental images into the trained hybrid neural network model to extract and classify environmental features;
[0133] Quadruped robot motion planning module: used for gait planning and foot trajectory planning based on terrain classification results;
[0134] Motion control module: used to complete the motion control of the quadruped robot based on motion planning information and kinematic models.
[0135] The present invention will be further described below with reference to the embodiments.
[0136] Example
[0137] Combine Figure 1 A motion control method for a quadruped robot based on a spiking neural network in a complex environment comprises the following steps:
[0138] Step 1: Construct a single-leg model of a quadruped robot based on the DH parameter method, specifically:
[0139] The simulation diagram of the quadruped robot in this embodiment is as follows Figure 2 As shown, the A1 quadruped robot of Yushu Technology is used, and the control part of the quadruped robot adopts the joint simulation technology of MATLAB and Coppeliasim Edu to simulate the motion control of the quadruped robot.
[0140] The DH method is used to establish the kinematic model of a quadruped robot single leg (left front leg). The model diagram is shown in the figure below. Figure 3 As shown, the coordinate system of the rods on the four legs is established in the same way. The DH parameters are listed in Table 1: (i in the table represents the code of the coordinate system)
[0141] Table 1 DH parameters of leg mechanism
[0142]
[0143] in:
[0144] α i-1 :by Look at the direction, and The angle between them.
[0145] a i-1 :Along direction, and The distance between i >0).
[0146] θ i :by Look at the direction, and The angle between them.
[0147] d i :Along direction, and The distance between.
[0148] Coordinate systems 1-4 are the side swing joint coordinate system, hip joint coordinate system, knee joint coordinate system, and foot end coordinate system respectively.
[0149] The transformation matrix between adjacent coordinates is:
[0150]
[0151] Substitute the DH parameters into the above formula to obtain the transformation matrix of each adjacent coordinate, and multiply them in sequence to obtain the transformation matrix of the foot end coordinate system relative to the lateral swing joint fixed coordinate system:
[0152]
[0153] Where R is the rotation matrix of the foot end coordinate system relative to the side swing joint fixed coordinate system, and P is the position coordinate of the foot end in the side swing joint coordinate system. Calculation results:
[0154] The transformation matrix from the foot-end coordinate system to the side-swing coordinate system:
[0155]
[0156] Therefore:
[0157]
[0158] If you want to get the transformation matrix from the side-swing coordinate system to the body coordinate system B, you only need to Left multiplication Then:
[0159]
[0160] Among them, Δx, Δy, and Δz are the position coordinates of each leg from the side swing coordinate system to the body coordinate system B.
[0161] Among them, P represents the coordinate of the foot end relative to the side-swing joint coordinate system, that is, the forward kinematics solution of the single leg of the quadruped robot, and θ1, θ2, and θ3 are the rotation angles of the side-swing joint, hip joint, and knee joint, respectively.
[0162] Step 2: Construct a transformation model of the quadruped robot's leg joint angle state and foot end position coordinates based on the inverse kinematics algorithm, specifically:
[0163] Inverse kinematics is the process of calculating the parameters of the joints that need to be set based on the target pose. Given the known position and posture of the foot, it is usually possible to express the function of each joint variable as it changes with the foot's coordinates:
[0164] The inverse kinematics solution of a single leg of a quadruped robot is as follows:
[0165]
[0166]
[0167] Among them, L1 is the distance from the side-swing joint coordinate system to the hip joint coordinate system along the x-axis, L2 is the distance from the hip joint coordinate system to the knee joint coordinate system along the x-axis, and L3 is the distance from the knee joint coordinate system to the foot coordinate system along the x-axis; x, y, and z are the coordinates of the foot relative to the side-swing coordinate system, and θ1, θ2, and θ3 are the rotation angles of the side-swing joint, hip joint, and knee joint, respectively.
[0168] Step 3: Build a CNN and SNN hybrid neural network model, specifically:
[0169] Combine Figure 4 The hybrid neural network model adopts a feedforward network structure, including a convolutional neural network and a pulse neural network, wherein the output of the convolutional neural network is converted into a pulse sequence and input into the pulse neural network.
[0170] The convolutional neural network adopts a feedforward network structure, uses a combination of cubic convolution and pooling, and then adds a fully connected layer to complete the feature extraction function of the terrain image;
[0171] Further, combined Figure 5 and Figure 6 ,The spiking neural network is a single-layer structure, and the network nodes are composed of spiking neurons, which complete the classification function of the terrain image;
[0172] Furthermore, each node in the spiking neural network is called a spiking neuron. The spiking neuron adopts the LIF neuron model. The dynamic equation of the LIF neuron membrane potential is:
[0173]
[0174]
[0175] Among them, τ m =RC is the membrane time constant, u reset represents the resting potential of the neuron, RI(t) represents the voltage across the equivalent membrane resistance of the spiking neuron, and u(t) represents the voltage across the equivalent membrane capacitance of the spiking neuron.
[0176] The neuron's spikes pass the threshold To control, the expression is:
[0177]
[0178] When u(tf ) increases to When the neuron fires a pulse, the voltage is reset to u reset , t f represents the pulse firing time of the neuron, u(t f ) represents the voltage of the membrane capacitance of the spiking neuron, is the set threshold.
[0179] According to the LIF neuron membrane potential differential equation, the membrane potential differential equation used in the program is:
[0180]
[0181] Since the input of the spiking neural network is in the form of pulses, the numerical results output by the convolutional neural network need to be pulsed. The output data of the convolutional neural network is converted into a pulse sequence using Poisson coding and input into the spiking neural network. The Poisson coding process is:
[0182]
[0183] Among them, P T (n) represents the probability of a single neuron firing a sequence of n pulses within a set time period T, and r represents the output data of the convolutional neural network to be encoded.
[0184] The hybrid network model adopts a feedforward network structure. Information in the model network propagates only forward in the neural network, first through the input nodes, then through the hidden layers, and finally through the output nodes. The first part of the network uses a combination of cubic convolution and pooling, followed by a fully connected layer. The final layer uses a spiking neural network to complete the transition to the output layer.
[0185] Step 4: Train the hybrid neural network model constructed in step 3 based on the gradient descent method, specifically:
[0186] The convolutional neural network model can be trained directly using the gradient descent method. The main improvement is in the spiking neural network model. Since the step function y = H (x) is used in the spiking neural network, the gradient cannot be calculated. Therefore, the gradient calculation is used in the back propagation. rather than Here, h(t) is a surrogate function that is similar in shape to H(x) but smooth and continuous. This improvement allows the entire network to be trained using gradient descent and the Adam optimizer to update weight parameters.
[0187] The alternative function used during backpropagation is the sigmoid function.
[0188]
[0189] The back propagation gradient calculation formula is:
[0190] g′(x)=α*(1-sigmoid(αx))sigmoid(αx)
[0191] α is a parameter that controls the smoothness of the gradient during backpropagation.
[0192] The visual recognition neural network in this embodiment is based on the SpikingJelly pulse neural network deep learning framework and is trained on a platform with an i7-10750 CPU and an RTX 1650 GPU. The accuracy can converge to more than 90% in one hour.
[0193] The training dataset is obtained by taking photos in advance, and then the images are randomly cropped and rotated to expand the dataset. During training, 64 images are input in a batch, and the Adam optimizer is used with a learning rate set to 1e-3.
[0194] Step 5: Collect images and input the collected environmental images into the trained hybrid neural network model to extract and classify the environmental features. Specifically:
[0195] Initialize the internal and external parameters of the camera, use the camera to capture images, and then perform a series of preprocessing to scale the RGB three-channel image data to 32*32 and input it into the hybrid neural network model;
[0196] The hybrid neural network model will output the probability of the corresponding terrain, and the terrain with the maximum probability will be taken as the final recognition result.
[0197] Step 6: Perform gait planning and foot trajectory planning based on the terrain classification results, specifically:
[0198] Step 6-1: Perform gait planning based on the terrain classification results of the environment:
[0199] According to the balance mode, the gait of quadruped robots can be divided into three types: static gait, dynamic gait and quasi-static gait.
[0200] A static gait is one that maintains static stability throughout the robot's motion. This involves controlling the quadruped robot to maintain a maximum of one leg raised at any given time, and keeping the projection of the robot's center of gravity within the support polygon. A typical static gait is the Walk gait. Because the robot maintains static stability at all times, and especially because it does not require additional posture control, the static gait control method is relatively stable and suitable for navigating rough terrain. However, this method results in slower walking speeds and lower energy efficiency.
[0201] A dynamic gait is one that maintains dynamic stability throughout the robot's motion. This means that at most two legs are in the stance phase at any given time. A typical example of a dynamic gait is the Trot gait. Because this gait eliminates static stability considerations and maintains balance during dynamic movement, it is suitable for rapid movement and offers high efficiency. However, it struggles to maintain stability when navigating rough terrain.
[0202] The quasi-static gait is a gait form between static and dynamic.
[0203] The difference between gaits can be expressed in terms of stance phase duty factor ρ and phase difference The stance phase duty factor refers to the ratio of the stance phase time of each leg to the entire gait cycle, and the phase difference refers to the ratio of the time difference between the movements of different legs to the entire gait cycle (one leg can be arbitrarily selected as the reference leg, ).
[0204] (1) When the quadruped robot is in a rough terrain environment, such as gravel roads or grass, it should choose the Walk gait and moderately reduce the step frequency. The common rotation order of the Walk gait is left front → right back → right front → left back → left front in an inverted "8" shape. At any time, at least three legs are in the support phase.
[0205] Combine Figure 7 In this embodiment, the support phase duty factor of the quadruped robot is ρ = 0.75, and the phase difference between the four legs is Therefore, the phase difference between each leg is:
[0206]
[0207] and The phase differences are left front, left rear, right rear and right front legs, respectively;
[0208] The gait change period T increases with the increase of road roughness;
[0209] (2) When the quadruped robot is in a flat terrain environment, such as asphalt or tile, it selects the Trot gait and moderately increases the step frequency. The two diagonal legs move in pairs, that is, the left front leg and the right hind leg move in unison, and the left hind leg and the right front leg move in unison. At any time, at least two legs are in the support phase.
[0210] Combine Figure 8 In this embodiment, the support phase duty factor of the quadruped robot is ρ = 0.5, and the phase difference between the four legs is Therefore, the phase difference between each leg is:
[0211]
[0212] The gait variation period T decreases as the flatness of the road increases.
[0213] When the gait of a quadruped robot needs to be switched, it should be completed at the moment when all four legs are in the support phase to ensure movement stability.
[0214] When the robot is on rough terrain, it switches to a Walk gait and reduces its cadence. When the robot is on flat terrain, it switches to a Trot gait and increases its cadence. This gait control strategy allows the robot to maintain both speed and stability.
[0215] Step 6-2: Perform foot trajectory planning based on the terrain classification results of the environment:
[0216] Among the interactions between a robot and the ground, slippage has the most significant impact on its performance. During motion, slippage can cause the robot to become unstable or even fall. Therefore, slippage must be considered and addressed during robot movement.
[0217] When interacting with different road surfaces, quadruped robots can effectively prevent slipping by controlling the ground entry angle of their trajectory. A higher trajectory height often results in a greater ground entry angle, making it less likely to slip. Furthermore, a higher trajectory height also allows the robot to better navigate obstacles. Therefore, when moving on surfaces with a high coefficient of friction or smooth surfaces, quadruped robots use a lower-height foot trajectory planning curve; when moving on surfaces with a low coefficient of friction or uneven surfaces, quadruped robots use a higher-height foot trajectory planning curve.
[0218] According to the requirements of the foot end motion position of the quadruped robot, the displacement constraint equations of the foot end trajectory in the forward direction and the vertical direction are obtained as follows:
[0219] The way forward:
[0220]
[0221] Vertical direction:
[0222]
[0223] To reduce the impact force between the foot and the ground and the inertial force at the foot when the quadruped robot switches between the swing phase and the support phase, based on the zero-impact principle, it is hoped that under ideal conditions, the velocity and acceleration of the foot when it contacts the ground are zero. In other words, the velocity and acceleration of the foot trajectory in the forward and vertical directions must meet the following constraints:
[0224] The way forward:
[0225]
[0226] vertical direction
[0227]
[0228] According to the above constraints, the cycloid trajectory planning equation of the quadruped robot's foot end is:
[0229] (1) Swing phase trajectory:
[0230] The way forward:
[0231]
[0232] Vertical ascent stage:
[0233]
[0234] Vertical descent phase:
[0235]
[0236] (2) Support phase trajectory:
[0237] The way forward:
[0238]
[0239] Vertical direction:
[0240] z=-h,βT≤t≤T
[0241] Where s is the foot end trajectory step length, h is the trajectory height, T is the gait period, β is the swing phase duty cycle, x is the robot forward direction coordinate, and z is the vertical direction coordinate;
[0242] By controlling the trajectory height h, the ground entry angle of the quadruped robot's foot end is controlled, thereby controlling the foot end trajectory of the quadruped robot.
[0243] Step 7: Complete the quadruped robot motion control, namely:
[0244] The gait planning and foot trajectory planning of the quadruped robot are completed based on the environmental information extracted by the hybrid neural network model;
[0245] According to the target position coordinates of the foot end of the quadruped robot, the rotation angles of each leg joint of the quadruped robot are determined according to the single-leg model and transformation model determined in steps 1 and 2, and transmitted to the joint servo motor driver to drive it to rotate to the target angle, thereby completing the motion control of the quadruped robot.
[0246] This embodiment takes the motion control of the robot on a gravel road as an example:
[0247] The gravel road has a rugged terrain, and it is difficult to control the stability of the quadruped robot during movement. Therefore, the relatively more stable Walk gait is selected, and the gait period is increased to T = 0.8s.
[0248] During the foot end trajectory planning process, when the trajectory height h is taken as h = 0.12m, 0.1m, and 0.08m respectively, the foot end trajectory schematic diagram is as follows Figure 9 As shown in the figure, the difference in track height can significantly change the angle at which the foot end track enters the ground to adapt to the friction of different ground surfaces.
[0249] There are obstacles of different sizes and shapes on the gravel road. In order to reduce the collision between the robot and ground obstacles, the foot end track height h of the quadruped robot should be increased to 0.12m.
[0250] After determining the quadruped robot's gait and foot trajectory, the position coordinates of the quadruped robot's foot at any given moment can be obtained. These foot position coordinates are input into the quadruped robot's motion control module. Using an inverse kinematics algorithm, the rotation angles of each leg joint are calculated. These angles are then transmitted to the joint servo motor drivers, which drive the motors to rotate to the target angles, completing the quadruped robot's motion control.
[0251] The above embodiments illustrate and describe the basic principles and main features of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention, and such changes and modifications fall within the scope of the invention as claimed.
Claims
1. A quadruped robot motion control method based on pulse neural network in complex environment, characterized by: The following steps are involved: Step 1: Construct a single-leg model of a quadruped robot based on the DH parameter method; Step 2: Construct a transformation model of the quadruped robot's leg joint angle states and foot position coordinates based on the inverse kinematics algorithm; Step 3: Build a CNN and SNN hybrid neural network model; Step 4: Train the hybrid neural network model constructed in step 3 based on the gradient descent method; Step 5: Collect images and input the collected environmental images into the trained hybrid neural network model to extract and classify the environmental features; Step 6: Perform gait planning and foot trajectory planning based on the terrain classification results: Step 6-1: Perform gait planning based on the terrain classification results of the environment: (1) When the quadruped robot is in a rough terrain environment, the Walk gait is selected, and the support phase occupancy factor of the quadruped robot is , the phase difference between the four legs ; The gait change period T increases with the increase of road roughness; (2) When the quadruped robot is in a flat terrain environment, the Trot gait is selected, and the support phase occupancy factor of the quadruped robot is , the phase difference between the four legs ; The gait change period T decreases as the flatness of the road increases; Step 6-2: Perform foot trajectory planning based on the terrain classification results of the environment; Step 7: Complete the motion control of the quadruped robot.
2. The quadruped robot motion control method based on pulse neural network in complex environment according to claim 1 is characterized in that: The construction of a single-leg model of a quadruped robot in step 1 is specifically as follows: ; Among them, P represents the coordinate of the foot end relative to the side swing joint coordinate system, that is, the forward kinematics solution of the single leg of the quadruped robot, They are the rotation angles of the side swing joint, hip joint, and knee joint respectively.
3. The quadruped robot motion control method based on pulse neural network in complex environment according to claim 1 is characterized in that: The construction of the conversion model in step 2 is specifically as follows: The inverse kinematics solution of a single leg of a quadruped robot is as follows: ; ; in, is the distance from the side-swing joint coordinate system to the hip joint coordinate system along the x-axis, is the distance from the hip joint coordinate system to the knee joint coordinate system along the x-axis, is the distance from the knee joint coordinate system to the foot end coordinate system along the x-axis; x, y, z are the coordinates of the foot end relative to the side swing coordinate system, They are the rotation angles of the side swing joint, hip joint, and knee joint respectively.
4. The quadruped robot motion control method based on pulse neural network in complex environment according to claim 1 is characterized in that: The construction of the CNN and SNN hybrid neural network model in step 3 is specifically as follows: The hybrid neural network model adopts a feedforward network structure, including a convolutional neural network and a pulse neural network, wherein the output of the convolutional neural network is converted into a pulse sequence and input into the pulse neural network.
5. The quadruped robot motion control method based on pulse neural network in complex environment according to claim 4 is characterized in that: The spiking neural network is a single-layer structure, and the network nodes are composed of spiking neurons; The spiking neuron adopts the LIF neuron model, and its membrane potential change equation is: ; in, is the membrane time constant, represents the resting potential of the neuron, represents the voltage across the equivalent membrane resistance of the spiking neuron, represents the voltage on the equivalent membrane capacitance of the spiking neuron; The neuron's spike firing is controlled by a threshold ϑ: ; Among them, when Increase to When the neuron fires a pulse, the voltage is reset to , represents the pulse firing time of the neuron, represents the voltage across the membrane capacitance of the spiking neuron, is the set threshold; The output data of the convolutional neural network is converted into a pulse sequence using Poisson coding and input into the pulse neural network. The Poisson coding process is as follows: ; in, Indicates that a single neuron is generated within a set time period T The probability of a pulse sequence, represents the number of neurons, Represents the convolutional neural network output data to be encoded.
6. The quadruped robot motion control method based on pulse neural network in complex environment according to claim 1 is characterized in that: The foot trajectory planning in step 6-2 is specifically as follows: The foot end of the quadruped robot conforms to the cycloid trajectory planning equation: (1) Swing phase trajectory: The way forward: ; Vertical ascent stage: ; Vertical descent phase: ; (2) Support phase trajectory: The way forward: ; Vertical direction: ; in is the foot end trajectory step length, is the trajectory height, is the gait cycle, is the swing phase duty cycle, is the robot's forward direction coordinate, is the vertical coordinate; By controlling the trajectory height The ground entry angle of the quadruped robot's foot end is controlled, thereby controlling the foot end trajectory of the quadruped robot.
7. The quadruped robot motion control method based on pulse neural network in complex environment according to claim 1 is characterized in that: The completion of the quadruped robot motion control in step 7 is specifically as follows: The gait planning and foot trajectory planning of the quadruped robot are completed based on the environmental information extracted by the hybrid neural network model; According to the target position coordinates of the foot end of the quadruped robot, the rotation angles of the leg joints of the quadruped robot are determined according to the single-leg model and the transformation model determined in steps 1 and 2, thereby completing the motion control of the quadruped robot.
8. A quadruped robot motion control system based on a pulse neural network in a complex environment, used to execute the method described in claim 1, characterized in that: Includes the following modules: Single-leg model construction module: used to build a single-leg model of a quadruped robot; Conversion model construction module: used to construct the conversion model of the quadruped robot's leg joint angle state and foot end position coordinates based on the inverse kinematics algorithm; Hybrid neural network model module: used to build and train a CNN and SNN hybrid neural network model; Environmental feature extraction module: used to collect environmental images and input the collected environmental images into the trained hybrid neural network model to extract and classify environmental features; Quadruped robot motion planning module: used for gait planning and foot trajectory planning based on terrain classification results; Motion control module: used to complete the motion control of the quadruped robot based on motion planning information and kinematic models.
Citation Information
Patent Citations
Quadruped robot gait control method based on reinforcement learning and CPG controller
CN111208822A
Robot inverse dynamics feedforward control method and system based on fusion model
CN115042172A