Model predictive control method for active obstacle avoidance of bionic snake-like robot

By establishing a mathematical model and a model predictive controller for the snake-shaped robot, the joint angle changes of the snake-shaped robot during obstacle avoidance are optimized, which solves the problems of low steering efficiency and high energy consumption of the snake-shaped robot, and achieves collision-free and low-energy consumption. Obstacle avoidance effect.

CN116061191BActive Publication Date: 2024-10-01UNIV OF SHANGHAI FOR SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310258128.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-16
Publication Date
2024-10-01
Estimated Expiration
2043-03-16

AI Technical Summary

Technical Problem

The steering efficiency of existing snake-shaped robots is low during obstacle avoidance, resulting in reduced tracking path accuracy and increased energy consumption. The steering angle effect is inconsistent during periodic gaits, which affects obstacle avoidance accuracy and energy usage efficiency.

Method used

Using the model predictive control method of the bionic snake-shaped robot to actively avoid obstacles, the mathematical model and model predictive controller of the snake-shaped robot are established. By minimizing the tracking error and ensuring that the whole body does not collide with obstacles, the joint angle change speed is optimized and the snake body is adjusted in real time. The amplitude and offset are updated to achieve the optimal input amount to avoid obstacles.

Benefits of technology

Effectively coordinate the distance between the snake body and obstacles, avoid full-body collision, reduce energy loss, reduce steering space, ensure rapid return to the desired path, and avoid discontinuous gait and unstable performance after sudden increase in steering angle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116061191B_ABST
    Figure CN116061191B_ABST
Patent Text Reader

Abstract

The present invention relates to a model predictive control method for active obstacle avoidance of a bionic snake-like robot. Under the assumption that the joint angle changes slowly in the process of deriving a simplified average system of a real robot, the objective function is established to minimize the tracking error and ensure that the whole body does not collide with obstacles. A set of optimal solutions are obtained for control according to the speed and direction errors and the distance between each connecting rod of the snake body and the obstacle. The actual distance between all connecting rods of the snake body and the obstacle is considered to avoid collision between all joints and obstacles and effectively coordinate the behavioral conflicts between stability and obstacle avoidance. The amplitude of the snake-like robot is adjusted in real time. When facing obstacles, the required steering angle is reduced by reducing the amplitude in the gait, thereby reducing unnecessary energy loss. Obstacles are avoided at small angles, the steering space is reduced, and the desired path is quickly returned after the obstacle avoidance task is completed. Problems such as discontinuous turning gait and unstable performance after sudden increase of the steering angle are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an automatic obstacle avoidance technology, and in particular to a model predictive control method for active obstacle avoidance of a bionic snake-like robot. Background Art

[0002] Bionic snake robots are a type of mobile robots with slender, limbless bodies. This type of robot interacts with the environment through changes in the drive mechanisms composed of its own joints to generate efficient mobility. Due to its flexibility, multiple degrees of freedom, and multiple forms of movement, snake robots are widely used in various fields. For example: in rugged and complex terrain, snake robots can flexibly switch between different forms of movement gaits to meet mobility needs and help people work in inaccessible environments; for narrow working spaces such as pipelines and caves, snake robots can rely on their own slender structural advantages to complete exploration and reconnaissance tasks instead of humans; for places with dense obstacles, snake robots can flexibly avoid obstacles or use obstacles to generate moving thrust by changing their own shape.

[0003] In many application scenarios of robots, how robots can achieve collision-free autonomous obstacle avoidance has always been a concern. Snake robots need to adapt to various complex environments during movement. In order to avoid collisions, the motion controller needs to consider how to avoid obstacles in the forward direction. For two reasons, snake robots face huge challenges in achieving collision-free obstacle avoidance in the desired path: First, compared with traditional robots, snake robots do not have a fixed physical collision volume. The entire body of the robot constitutes a driver, which realizes forward and turning movements by fitting different curves. Therefore, all joint positions need to be considered in the obstacle avoidance process, which will increase the difficulty of controller design. Secondly, due to its special body structure, the steering efficiency of snake robots is low. Compared with traditional robots, the steering of snake robots requires a larger steering space. Therefore, when facing obstacles, the robot needs to reserve a larger space in advance to meet the collision-free requirements. The design of the reserved space and when to return to the desired path after avoiding is a difficult point.

[0004] At present, there are two types of obstacle avoidance tasks for robots: the first is that the robot needs to reach the specified position and plan a suitable obstacle avoidance route in advance according to the position of the obstacle to complete the obstacle avoidance; the second is that the robot encounters an obstacle while tracking the specified path, then turns according to the position of the obstacle, and returns to the specified path after avoiding the obstacle. There are many studies on the movement of snake-like robots on the desired path and completing obstacle avoidance tasks. For example, in order to solve the trajectory tracking problem between the joints of the snake-like robot in the flow field, a trajectory tracking control law for the obstacle avoidance of the snake-like robot in the flow field based on the improved serpentine curve is studied, and the potential function is added to the fluid-solid coupling model to enable it to avoid obstacles (Trajectory Tracking Control Law for Obstacle Avoidance of Snake-like Robot in Flow Field Based on Improved Serpentine Curve-Li Dongfang-2019).

[0005] Existing snake robot obstacle avoidance strategies based on phase adjustment method and amplitude adjustment method have been proposed. The snake robot can turn by adjusting the phase to avoid obstacles in the path (Research on obstacle avoidance of snake robots based on amplitude adjustment method - Lu Zhenli - 2016; Research on obstacle avoidance function of snake robots based on phase adjustment method - Lu Zhenli - 2015).

[0006] A method for obstacle avoidance using a snake-like robot has been proposed. This method uses a head joint reference angle phase adjustment method combined with passive winding, and adjusts the head joint output torque through the energy state to achieve the purpose of controlling the robot to avoid obstacles (Research on Passive Winding Obstacle Avoidance Motion of Snake-like Robot - Zhang Danfeng - 2011).

[0007] 1. In existing solutions, controllers are generally designed based on the position of the head. However, the robot's body does not always follow the path followed by the robot's head. During the obstacle avoidance process, joints other than the head may collide with obstacles.

[0008] 2. When facing obstacles, existing solutions generally only adjust the phase deviation of each joint in the gait to achieve the purpose of turning. However, the steering efficiency of snake robots is low. When the turning angle is large, the turning space also becomes larger, which will sacrifice the accuracy of tracking the desired path and generate unnecessary energy consumption.

[0009] 3. Existing solutions generally calculate the steering angle based on the position of the snake head when facing obstacles. However, the effect of applying the same steering angle at different times in the robot's periodic gait is very different. Therefore, in order to improve the accuracy of obstacle avoidance, large-angle steering is usually selected, which will reduce the robot's energy efficiency. Summary of the invention

[0010] Aiming at the obstacle avoidance problem of bionic snake-like robot in the process of path tracking, a model predictive control method for active obstacle avoidance of bionic snake-like robot was proposed.

[0011] The technical solution of the present invention is: a model predictive control method for active obstacle avoidance of a bionic snake-like robot, a mathematical model of a snake-like machine is established, and a model predictive controller is established on the basis of the mathematical model of the snake-like machine, and an objective function is established for the purpose of minimizing tracking errors and ensuring that the whole body does not collide with obstacles under the assumption that the joint angle changes slowly in the process of deriving a simplified average system of the snake-like robot to meet the physical constraints of the real robot and the assumption that the joint angle changes slowly in the process of deriving the simplified average system of the snake-like robot; when the snake-like robot is performing a task of tracking a path with obstacles, after a fixed sampling time, the model predictive controller predicts the state of the robot within a time period based on the state quantity at the current moment, using the prediction model in the model predictive controller to predict the state of the robot within the time period, and according to the speed and direction errors and the distance between each connecting rod of the snake body and the obstacle, a set of optimal solutions is obtained, that is, the optimal input quantity at each moment within the prediction time period; the model predictive controller only updates the optimal input quantity required at the current moment, and keeps it until the arrival of the next sampling moment, repeats the above optimization operation, and completes the path tracking and obstacle avoidance operation.

[0012] Further, the snake-like machine mathematical model establishment method:

[0013] 1) The snake robot consists of n pieces with a length of 2l, a mass of m, and a moment of inertia of J = ml 2 / 3 connecting rods; the center of mass coordinates of the i-th connecting rod in the inertial coordinate system is The rotation angle is That is, the angle between the connecting rod and the x-axis. The angle vectors of the n connecting rods are The rotation angle of the i-th joint is φ i , which is defined as φ i =θ i -θ i+1 , the joint angle vector is Coordinates of the robot's center of mass in the inertial coordinate system is defined as the mean of all link coordinates, i.e. The robot's forward direction It is defined as the average value of the connecting rod angle, that is,

[0014] 2) The first law establishes the dynamic model of the snake-like robot as follows:

[0015]

[0016]

[0017] Where f R is the friction force acting on the connecting rod, u is the driving force as input, M θ is the inertia matrix, W θ and G is the coefficient matrix,

[0018] Mθ =JI n +ml 2 S θ VS θ +ml 2 C θ VC θ ,W θ =ml 2 S θ VC θ -ml 2 C θ VS θ ,G=[lS θ K-lC θ K], coefficient matrix: V = A T (DD T ) -1 A,K=A T (DD T ) -1 D,

[0019]

[0020] S θ =diag(sinθ1,...,sinθ n ),C θ =diag(cosθ1,...,cosθ n ), I n is the n×n identity matrix, J is the moment of inertia;

[0021] 3) Assume that the friction force acting on connecting rod i [f R,xi ,f R,yi ] T is viscous and is described as

[0022]

[0023] Where c t and c n Respectively represent the tangential friction coefficient and normal friction coefficient of the connecting rod, R(θ i ) is the transformation matrix of the global coordinates to the local coordinates of the link i, and the friction force acting on all links is expressed as

[0024]

[0025] In the formula

[0026]

[0027] 4) Rewrite the mathematical model of the snake-like robot using the average angular momentum model:

[0028] The following relationship can be obtained from the definition of the joint angle and connecting rod angle of the snake robot:

[0029] φ=Dθ (5)

[0030] Substituting into formula (1) we can get:

[0031]

[0032] This means that the input u is fully driven for the joint angle φ, so for the snake robot position p and direction When controlling the joint angle φ, the input u is no longer used, but the joint angle φ is adjusted;

[0033] According to the definition of the joint angle and center of mass coordinates of the snake-like robot, the connecting rod position z can be obtained and the time differential can be obtained to obtain the linear velocity of the connecting rod:

[0034]

[0035] In order to derive the simplified model required for controller design from the dynamic models (1) and (2), a new variable is introduced to rewrite the dynamic model:

[0036]

[0037] The rewritten model is called the mean angular momentum model. Differentiating the mean angular momentum model (8) and substituting it into equation (1) yields the following relationship:

[0038]

[0039] According to equation (4), equation (5), and equation (7), we can rewrite equation (2) and equation (9) to obtain

[0040]

[0041]

[0042] Equations (7), (10) and (11) constitute the rewritten mathematical model of the snake-like robot.

[0043] Furthermore, the model predictive controller is established on the basis of the mathematical model of the snake-like machine, that is, the simple model required for designing the model predictive controller is derived from the mathematical model of the snake-like machine by using the averaging method. The simplified method is as follows:

[0044] A: Due to the physical constraints of the real snake robot, the model predictive controller adds joint angle change restrictions. The amplitude α(t) and offset φ0(t) of the robot's joint angle can be considered to have a small change range. According to the sinusoidal zigzag gait of the snake robot, the joint angle i of the snake robot satisfies the following relationship

[0045] φ i =αsin{ωt+(i-1)δ}+φ0 (13)

[0046] To get direction The model requires the following two relationships:

[0047] (1) According to equations (5) and (8), the relationship between the joint angular velocity and the connecting rod angular velocity can be obtained:

[0048]

[0049] In the formula

[0050] (2) According to formula (5) and the definition of direction angle, we can get

[0051]

[0052] Where Γ=D T (DD T ) -1 , and for and The following definitions are given:

[0053]

[0054]

[0055]

[0056] B: Before using the averaging method to simplify the model, use the small angle approximation method to linearize part of the model: Assume that the joint angle is very small, so for the i-th joint, there is and For the i-th joint and the j-th joint, there is an approximate relationship between The approximate relationship of

[0057] According to the small angle approximation method, a new definition can be obtained:

[0058]

[0059] According to formula (14), the direction angle The new definition obtained by the small angle approximation is

[0060]

[0061] At the same time, differentiating equation (16) and substituting it into equation (10) yields

[0062]

[0063] Define the forward velocity v in the snake robot velocity v t To follow the current direction The center of mass velocity component, lateral velocity v n is perpendicular to the current direction The center of mass velocity The weight of

[0064]

[0065] Substituting equation (15) and equation (18) into equation (7), equation (11) and equation (17), we can obtain

[0066]

[0067]

[0068]

[0069] By using the small angle approximation method to simplify equations (19)-(21), we obtain the following three equations:

[0070]

[0071]

[0072]

[0073] C: Using the averaging method, we can derive the simple model required for model predictive controller design from equations (22), (23) and (24). For the following system:

[0074]

[0075] Here, the period of the function f with respect to t is T, ε is a small positive parameter, and the average system of the system is

[0076]

[0077] The averaging method uses the solution of the average system of system (25) to approximate the solution of this system, and the smaller the positive parameter ε is, the smaller the error between the two systems is;

[0078] Since the joint angle variation constraints are added when designing the model predictive controller and the physical constraints of the real robot are taken into account, the link velocity Robot acceleration and direction angle angular acceleration can be considered small, and the solutions of systems (22), (23) and (24) can be approximated by the solutions of the following average system

[0079]

[0080]

[0081] Where T = 2π / ω,

[0082]

[0083]

[0084]

[0085]

[0086]

[0087]

[0088]

[0089]

[0090] Furthermore, the model predictive controller is established and the prediction method is:

[0091] First, the following state space equations are obtained from the average system (27)-(29):

[0092]

[0093] The state quantity of the state equation X=[x1,...x n ] T ,Y=[y1,...y n ] T , input β = [β1, β2] T =[α,φ o ] T , each line of the state equation is expressed as:

[0094] Discretizing the state space equation (30), we obtain the prediction model for the model predictive controller at time t:

[0095] Where σ represents the time step, N h is the prediction time domain, at time t, for the future N hThe state at each moment is predicted, and the specific prediction time length is σN h ; Initial state is the state η(t) at the current time t;

[0096] The forecast status within the forecast range obtained according to the forecast model and input The following quadratic cost function can be obtained:

[0097]

[0098]

[0099]

[0100] In the formula It's the price of distance. is the cost of error, and is a weight matrix, where k represents the number of obstacles, d ij represents the distance from the i-th link to the j-th obstacle, v ref represents the reference speed, Reference angle;

[0101] The reference speed of the snake robot is given by the expected index, and the robot obtains the reference angle through the current position and the expected path. Therefore, when the obstacle position is known, the robot's active obstacle avoidance problem during path tracking will be transformed into solving the following optimization problem at time t:

[0102]

[0103] st(31) (35)

[0104] in In order to satisfy the physical constraints of the real robot and the assumption that the joint angles change slowly in the process of deriving the simplified average system of the snake robot, the following constraints are added when solving the optimization problem (35):

[0105]

[0106]

[0107] where j = 0, 1, ..., N h -1, is a given constant vector, indicating that the absolute value of the joint angle amplitude and offset solution obtained by the optimization problem (35) must satisfy the condition in β max range, and its degree of change must also satisfy the constraint condition (37).

[0108] The beneficial effects of the present invention are as follows: the model predictive control method for active obstacle avoidance of a bionic snake-like robot of the present invention, the motion controller takes into account the actual distance between all the connecting rods of the snake body and the obstacle, avoids the collision of all the joints with the obstacle and effectively coordinates the behavioral conflict between stability and obstacle avoidance; the amplitude of the snake-like robot is adjusted in real time, and when facing an obstacle, the required turning angle is reduced by reducing the amplitude in the gait, thereby reducing unnecessary energy loss; small-angle obstacle avoidance reduces the turning space and can quickly return to the expected path after completing the obstacle avoidance task; online optimization strategy makes the obstacle avoidance process smoother, avoiding problems such as discontinuous turning gait and unstable performance after a sudden increase in the steering angle. BRIEF DESCRIPTION OF THE DRAWINGS

[0109] Figure 1 This is a kinematic model diagram of the planar multi-link snake-like robot of the present invention;

[0110] Figure 2 This is the principle diagram of the model prediction controller of the present invention;

[0111] Figure 3 This is a diagram showing the center of mass position of the snake-like robot of the present invention;

[0112] Figure 4 This is a partial enlarged view of the obstacle point of the present invention;

[0113] Figure 5 It is the amplitude and offset of the snake-like robot joint and the deviation diagram of the relative path of the center of mass. DETAILED DESCRIPTION

[0114] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0115] The present invention aims at the task requirement that the robot has obstacles in the specified path, then turns according to the position of the obstacle, and returns to the specified path after avoiding the obstacle, and completes the design. Based on the model predictive control strategy, the snake robot can autonomously avoid obstacles in a given path without collision. A mathematical model of the snake machine is established, and a model predictive controller is established on this basis. Under the assumption that the physical constraints of the real robot and the slow change speed of the joint angle in the process of deriving the simplified average system of the snake robot are met, the objective function is established with the purpose of minimizing the tracking error and ensuring that the whole body has no collision with obstacles; when the snake robot performs the task of tracking a path with obstacles, after a fixed sampling time, the model predictive controller uses the prediction model in the model predictive controller to predict the state of the robot in the time period according to the state quantity at the current moment, and obtains a set of optimal solutions according to the speed and direction errors and the distance between each connecting rod of the snake body and the obstacle, that is, the optimal input quantity at each moment in the prediction time period; the model predictive controller only updates the optimal input quantity required at the current moment, and keeps it until the arrival of the next sampling moment, repeats the above optimization operation, and completes the path tracking and obstacle avoidance operation.

[0116] The specific steps of the invention are as follows:

[0117] 1. Establish a mathematical model of the snake robot

[0118] The snake robot consists of n pieces with a length of 2l, a mass of m, and a moment of inertia of J = ml. 2 / 3 connecting rods. The center of mass coordinates of the i-th connecting rod in the inertial coordinate system are The rotation angle is (the angle between the connecting rod and the x-axis), the n connecting rod angle vectors are The rotation angle of the i-th joint is φ i (the angular difference between the i-th link and the i+1-th link), which is defined as φ i =θ i -θ i+1 , the joint angle vector is Coordinates of the robot's center of mass in the inertial coordinate system is defined as the mean of all link coordinates, i.e. The robot's forward direction It is defined as the average value of the connecting rod angle, that is, like Figure 1 shown.

[0119] The dynamic model of the snake robot is established using the first law as follows

[0120]

[0121]

[0122] Where f R is the friction force acting on the connecting rod, u is the driving force, M θ is the inertia matrix, W θ and G is the coefficient matrix,

[0123] M θ =JI n +ml 2 S θ VS θ +ml 2 C θ VC θ ,W θ =ml 2 S θ VC θ -ml 2 C θ VS θ ,G=[lS θ K-lC θ K],

[0124] Coefficient matrix: V = A T (DD T ) -1 A,K=A T (DD T ) -1 D,

[0125]

[0126] S θ =diag(sinθ1,...,sinθ n ),C θ =diag(cosθ1,...,cosθ n ), I n is the n×n identity matrix, and J is the moment of inertia.

[0127] Assume that the friction force acting on connecting rod i [f R,xi ,f R,yi ] T is viscous and is described as

[0128] Where c t and c n Respectively represent the tangential friction coefficient and normal friction coefficient of the connecting rod, R(θ i ) is the transformation matrix from the global coordinates to the local coordinates of link i. Therefore, the friction force acting on all links can be expressed as

[0129]

[0130] In the formula

[0131] z=[x1,...x n ,y1,...,y n ] T .

[0132] 2. Rewrite the mathematical model of the snake-like robot using the average angular momentum model:

[0133] The following relationship can be obtained from the definition of the joint angle and connecting rod angle of the snake robot:

[0134] φ=Dθ (5)

[0135] Substituting into formula (1) we can get:

[0136]

[0137] This means that the input u is fully driven for the joint angle φ. Therefore, for the snake robot position p and direction When controlling the joint, the input u is no longer used, but the joint angle φ is adjusted.

[0138] According to the definition of the joint angle and center of mass coordinates of the snake-like robot, the connecting rod position z can be obtained and the time differential can be obtained to obtain the linear velocity of the connecting rod:

[0139]

[0140] In order to derive the simplified model required for controller design from the dynamic models (1) and (2), a new variable is introduced to rewrite the dynamic model:

[0141]

[0142] It can be called the average angular momentum model. Differentiating the average angular momentum model (8) and substituting it into equation (1) yields the following relationship:

[0143]

[0144] According to equation (4), equation (5), and equation (7), we can rewrite equation (2) and equation (9) to obtain

[0145]

[0146]

[0147] The simplified model designed for the snake robot controller will be derived from Equations (7), (10) and (11).

[0148] 3. Use the averaging method to obtain a simplified model:

[0149] Since the model predictive control method has a large amount of calculation when solving the optimization problem, it is necessary to simplify the model equations (7), (10) and (11) to avoid the influence of too long solution time on the controller effect.

[0150] According to the sinusoidal gait of the snake-like robot, the joint angle i of the snake-like robot satisfies the following relationship

[0151] φ i =αsin{ωt+(i-1)δ}+φ0 (12)

[0152] Where α(t) and ω represent the amplitude and angular frequency of the sinusoidal motion of joint angle i, respectively, and δ represents the phase difference between joint angle i and the adjacent joint angles. φ0(t) represents the offset of the joint angle, which is used to control the movement direction of the robot. Due to the physical constraints of the real snake-like robot, joint angle change restrictions are added to the model predictive controller. The amplitude α(t) and offset φ0(t) of the robot joint angle can be considered to have a small change range, so Equation (12) can be rewritten as

[0153] φ i =αsin{ωt+(i-1)δ}+φ0 (13)

[0154] To get direction The model requires the following two relationships:

[0155] (1) According to equations (5) and (8), the relationship between the joint angular velocity and the connecting rod angular velocity can be obtained:

[0156]

[0157] In the formula q=1 / (e T M θ e).

[0158] (2) According to formula (5) and the definition of direction angle, we can get

[0159]

[0160] Where Γ=D T (DD T ) -1 , and for and The following definitions are given:

[0161]

[0162]

[0163]

[0164] Before using the averaging method to simplify the model, we first use the small angle approximation method to linearize part of the model: Assume that the joint angle is very small, so for the i-th joint, we have and For the i-th joint and the j-th joint, there is an approximate relationship between approximate relationship.

[0165] According to the small angle approximation method, a new definition can be obtained:

[0166]

[0167] According to equation (14), the definition of the direction angle θ and the new definition obtained by the small angle approximation method, we can get

[0168]

[0169] At the same time, differentiating equation (16) and substituting it into equation (10) yields

[0170]

[0171] Define the forward velocity v in the snake robot velocity v t To follow the current direction The center of mass velocity component, lateral velocity v n is perpendicular to the current direction The center of mass velocity The weight of

[0172]

[0173] Substituting equation (15) and equation (18) into equation (7), equation (11) and equation (17), we can obtain

[0174]

[0175]

[0176]

[0177] By using the small angle approximation method to simplify equations (19)-(21), we obtain the following three equations:

[0178]

[0179]

[0180]

[0181] The simplified model required for controller design is derived from the obtained equations (22), (23) and (24) using the averaging method.

[0182]

[0183] Here, the period of the function f with respect to t is T, ε is a small positive parameter, and the average system of the system is

[0184]

[0185] The averaging method uses the solution of the average system of system (25) to approximate the solution of the system, and the smaller the positive parameter ε is, the smaller the error between the two systems is. Since the joint angle change constraint is added and the physical constraints of the real robot are taken into account when designing the model predictive controller, the link velocity Robot acceleration and direction angle angular acceleration can be considered small, and the solutions of systems (22), (23) and (24) can be approximated by the solutions of the following average system

[0186]

[0187]

[0188]

[0189] Where T = 2π / ω,

[0190]

[0191]

[0192]

[0193] Ψ1=lK T ,

[0194]

[0195]

[0196]

[0197]

[0198] 4. Design a model predictive controller

[0199] The model predictive controller of the snake robot is as follows Figure 2 As shown. First, the following state space equations are obtained from the average system (27)-(29):

[0200]

[0201] The state quantity of the state equation X=[x1,...x n ] T ,Y=[y1,...y n ] T , input β = [β1, β2] T =[α,φ o ] T , each line of the state equation is expressed as:

[0202] By discretizing the state space equation (30), we can obtain the prediction model for the model predictive controller at time t:

[0203]

[0204] Where σ represents the time step, N h is the prediction time domain (at time t, for the future N h The state at each moment is predicted, and the specific prediction time length is σN h ), initial state is the state η(t) at the current time t. The predicted state within the prediction range obtained by the prediction model and input The following quadratic cost function can be obtained:

[0205]

[0206]

[0207]

[0208] In the formula It's the price of distance. is the cost of error, and is a weight matrix, where k represents the number of obstacles, d ij represents the distance from the i-th link to the j-th obstacle, v ref represents the reference speed, Reference angle.

[0209] The reference speed of the snake robot is given by the expected index. At the same time, the robot can get the reference angle through the current position and the expected path. Therefore, when the obstacle position is known, the robot's active obstacle avoidance problem during path tracking will be transformed into solving the following optimization problem at time t:

[0210]

[0211] st(31) (35)

[0212] in

[0213] In order to satisfy the physical constraints of the real robot and the assumption that the joint angles change slowly in the process of deriving the simplified average system of the snake robot, the following constraints are added when solving the optimization problem (35):

[0214]

[0215]

[0216] where j = 0, 1, ..., N h -1, is a given constant vector, indicating that the absolute value of the joint angle amplitude and offset solution obtained by the optimization problem (35) must satisfy the condition in β max range, and its degree of change must also satisfy the constraint condition (37).

[0217] When the snake robot is performing the task of tracking a path with obstacles, after a fixed sampling time T s After that, the model predictive controller predicts t+σN based on the state quantity η(t) at the current time t using the prediction model (31) h The robot's state in time is calculated, and a set of optimal solutions is obtained based on the reference speed, direction and the position of the obstacle, that is, at t+σN h The optimal input quantity at each moment in time. The model predictive controller only updates the optimal input quantity required at the current moment and keeps it until the next sampling moment arrives, repeating the above optimization operation to complete the path tracking and obstacle avoidance operation.

[0218] The task priority can be adjusted by adjusting the weights of the distance cost and the error cost. At the same time, the distance cost function can satisfy the following conditions: when the obstacle is far away, the distance cost function value is small, and the task priority is much smaller than the error cost priority, thus ensuring the accuracy of the tracking path. When approaching an obstacle, the distance cost function value is large, and the task priority is greater than the error cost priority, thus avoiding collision between the robot and the obstacle and combining the two tasks reasonably.

[0219] 5. Simulation

[0220] The model predictive control strategy based on MATLAB is used to simulate and verify the snake robot's collision-free autonomous avoidance of obstacles in a given path. The center of mass position of the snake robot is shown in Figure 3 As shown in the figure, the local enlarged picture of the area where all the links of the snake robot pass through the obstacle is shown in Figure 4 As shown, the controller output of the snake robot and the deviation of the center of mass position relative to the path are shown in Figure 5 As shown. According to the simulation results, it can be shown that the snake robot autonomous obstacle avoidance algorithm based on model predictive control can effectively make all links avoid obstacles without collision, and at the same time will not destroy the accuracy of the tracking path. According to the output of the controller, when the robot faces an obstacle, it reduces the amplitude in the gait, thereby reducing the required joint offset angle φ0, reducing unnecessary energy loss, and using small angles in the obstacle avoidance process, that is, the required joint offset angle φ0 is small, thereby reducing the turning space and being able to quickly return to the desired path after completing the obstacle avoidance task.

[0221] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A model predictive control method for active obstacle avoidance of a bionic snake-like robot, characterized in that: A mathematical model of a snake-like robot is established, and a model predictive controller is established on the basis of the mathematical model of the snake-like robot. Under the assumption that the joint angle changes slowly in the process of deriving a simplified average system of the snake-like robot, the objective function is established with the purpose of minimizing the tracking error and ensuring that the whole body does not collide with obstacles. When the snake-like robot is performing a task of tracking a path with obstacles, after a fixed sampling time, the model predictive controller predicts the state of the robot within the time period based on the state quantity at the current moment, using the prediction model in the model predictive controller, and obtains a set of optimal solutions based on the speed and direction errors and the distance between each link of the snake body and the obstacle, that is, the optimal input quantity at each moment within the prediction time period. The model predictive controller only updates the optimal input required at the current moment and keeps it until the next sampling moment arrives, repeating the above optimization operation to complete the path tracking and obstacle avoidance operation; The snake-like machine mathematical model establishment method: 1) The snake robot consists of n pieces with a length of 2l, a mass of m, and a moment of inertia of J = ml 2 / 3 connecting rods; the center of mass coordinates of the i-th connecting rod in the inertial coordinate system is The rotation angle is That is, the angle between the connecting rod and the x-axis. The angle vectors of the n connecting rods are The rotation angle of the i-th joint is φ i , which is defined as φ i =θ i -θ i+1 , the joint angle vector is Coordinates of the robot's center of mass in the inertial coordinate system is defined as the mean of all link coordinates, i.e. The robot's forward direction It is defined as the average value of the connecting rod angle, that is, 2) The first law establishes the dynamic model of the snake-like robot as follows: Where f R is the friction force acting on the connecting rod, u is the driving force as input, M θ is the inertia matrix, W θ and G is the coefficient matrix, M θ =JI n +ml 2 S θ VS θ +ml 2 C θ VC θ ,W θ =ml 2 S θ VC θ -ml 2 C θ VS θ ,G=[lS θ K -lC θ K], Coefficient matrix: V = A T (DD T ) -1 A,K=A T (DD T ) -1 D, I n is the n×n identity matrix, J is the moment of inertia; 3) Assume that the friction force acting on connecting rod i [f R,xi ,f R,yi ] T is viscous and is described as Where c t and c n Respectively represent the tangential friction coefficient and normal friction coefficient of the connecting rod, R(θ i ) is the transformation matrix of the global coordinates to the local coordinates of the link i, and the friction force acting on all links is expressed as In the formula 4) Rewrite the mathematical model of the snake-like robot using the average angular momentum model: The following relationship can be obtained from the definition of the joint angle and connecting rod angle of the snake robot: φ=Dθ (5) Substituting into formula (1) we can get: This means that the input u is fully driven for the joint angle φ, so for the snake robot position p and direction When controlling the joint angle φ, the input u is no longer used, but the joint angle φ is adjusted; According to the definition of the joint angle and center of mass coordinates of the snake-like robot, the connecting rod position z can be obtained and the time differential can be obtained to obtain the linear velocity of the connecting rod: In order to derive the simplified model required for controller design from the dynamic models (1) and (2), a new variable is introduced to rewrite the dynamic model: The rewritten model is called the mean angular momentum model. Differentiating the mean angular momentum model (8) and substituting it into equation (1) yields the following relationship: According to equation (4), equation (5), and equation (7), we can rewrite equation (2) and equation (9) to obtain Equations (7), (10) and (11) constitute the rewritten mathematical model of the snake-like robot; The model predictive controller is established on the basis of the mathematical model of the snake-like machine, that is, the simple model required for the design of the model predictive controller is derived from the mathematical model of the snake-like machine by using the averaging method. The simplified method is as follows: A: Due to the physical constraints of the real snake robot, the model predictive controller adds joint angle change restrictions. The amplitude α(t) and offset φ0(t) of the robot's joint angle can be considered to have a small change range. According to the sinusoidal zigzag gait of the snake robot, the joint angle i of the snake robot satisfies the following relationship f i =αsin{ωt+(i-1)δ}+φ0 (13) To get direction The model requires the following two relationships: (1) According to equations (5) and (8), the relationship between the joint angular velocity and the connecting rod angular velocity can be obtained: In the formula (2) According to formula (5) and the definition of direction angle, we can get Where Γ=D T (DD T ) -1 , and for and The following definitions are given: B: Before using the averaging method to simplify the model, use the small angle approximation method to linearize part of the model: Assume that the joint angle is very small, so for the i-th joint, there is and For the i-th joint and the j-th joint, we have The approximate relationship of According to the small angle approximation method, a new definition can be obtained: According to formula (14), the direction angle The new definition obtained by the small angle approximation is At the same time, differentiating equation (16) and substituting it into equation (10) yields Define the forward velocity v in the snake robot velocity v t To follow the current direction The center of mass velocity component, lateral velocity v n is perpendicular to the current direction The center of mass velocity The weight of Substituting equation (15) and equation (18) into equation (7), equation (11) and equation (17), we can obtain By using the small angle approximation method to simplify equations (19)-(21), we obtain the following three equations: C: Using the averaging method, we can derive the simple model required for model predictive controller design from equations (22), (23) and (24). For the following system: Here, the period of the function f with respect to t is T, ε is a small positive parameter, and the average system of the system is The averaging method uses the solution of the average system of system (25) to approximate the solution of this system, and the smaller the positive parameter ε is, the smaller the error between the two systems is; Since the joint angle variation constraints are added when designing the model predictive controller and the physical constraints of the real robot are taken into account, the link velocity Robot acceleration and direction angle angular acceleration can be considered small, and the solutions of systems (22), (23) and (24) can be approximated by the solutions of the following average system Where T = 2π / ω, The model predictive controller is established and predicted by the following method: First, the following state space equations are obtained from the average system (27)-(29): The state quantity of the state equation X=[x1,...x n ] T ,Y=[y1,...y n ] T , input β = [β1, β2] T =[α,φ o ] T , each line of the state equation is expressed as: Discretizing the state space equation (30), we obtain the prediction model for the model predictive controller at time t: Where σ represents the time step, N h is the prediction time domain, at time t, for the future N h The specific prediction time length is sN h ; Initial state is the state η(t) at the current time t; The forecast status within the forecast range obtained according to the forecast model and input The following quadratic cost function can be obtained: In the formula It's the price of distance. is the cost of error, and is a weight matrix, where k represents the number of obstacles, d ij represents the distance from the i-th link to the j-th obstacle, v ref represents the reference speed, Reference angle; The reference speed of the snake robot is given by the expected index, and the robot obtains the reference angle through the current position and the expected path. Therefore, when the obstacle position is known, the robot's active obstacle avoidance problem during path tracking will be transformed into solving the following optimization problem at time t: in In order to satisfy the physical constraints of the real robot and the assumption that the joint angles change slowly in the process of deriving the simplified average system of the snake robot, the following constraints are added when solving the optimization problem (35): where j = 0, 1, ..., N h -1, is a given constant vector, indicating that the absolute value of the joint angle amplitude and offset solution obtained by the optimization problem (35) must satisfy the condition in β max range, and its degree of change must also satisfy the constraint condition (37).