Control Method, Device, Medium, Program and Robot of Two-Wheel Robot

By calculating the optimal feedback gain and matrix, a control torque is generated to solve the balance problem of two-wheeled robots at rest, improving stability and safety, and suitable for precise operation scenarios that require chassis stability.

CN116991156BActive Publication Date: 2025-07-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211208634.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2025-07-18
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

The prior art cannot effectively deal with operating conditions and state estimation errors when maintaining balance in a two-wheeled robot at rest, resulting in the destruction of the balance effect.

Method used

By calculating the optimal feedback gain, optimal variable matrix and uncertainty, combining the angle deviation matrix and the noise deviation matrix, a control torque is generated to control the two-wheeled robot to ensure that it remains balanced in a stationary state.

Benefits of technology

Improves the stability and safety of the two-wheeled robot, allowing it to remain stationary or move within a small range, suitable for precise operating scenarios where the chassis is stable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116991156B_ABST
    Figure CN116991156B_ABST
Patent Text Reader

Abstract

The present application discloses a control method, device, medium, program and robot for a two-wheeled robot, relating to the field of artificial intelligence. The method includes: calculating an optimal feedback gain, an optimal variable matrix and an uncertainty according to a first state variable and a first feedback gain of the two-wheeled robot, where the optimal variable matrix is used to represent the gain degree of the state of the two-wheeled robot on the control mode of the two-wheeled robot; calculating an angle deviation matrix and a noise deviation matrix according to the optimal feedback gain, the optimal variable matrix, the uncertainty and a second state variable of the two-wheeled robot; obtaining a control torque of the two-wheeled robot according to the second state variable, the optimal feedback gain, the angle deviation matrix and the noise deviation matrix; and controlling the two-wheeled robot according to the control torque. The present application can normally display controls on screens with different resolutions. The method can achieve the stillness of the two-wheeled robot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and particularly to a control method, device, medium, program, and robot for a two-wheeled robot. Background Art

[0002] Two-wheeled robots include segways, two-wheeled legged robots, two-wheeled robots with other forms (humanoid) on the upper body, etc. How to keep a two-wheeled robot balanced in a stationary state is a research topic worthy of study.

[0003] In related technologies, to ensure that a two-wheeled robot can also maintain balance when stationary, the form of the two-wheeled robot is collected by sensors, and the center of mass of the two-wheeled robot is estimated through the form of the two-wheeled robot. Then, the pitch angle and linear velocity of the two-wheeled robot are adjusted by the motor torque on the wheels, so that the line connecting the center of mass of the two-wheeled robot and the center of the wheel is perpendicular to the ground, thereby ensuring the balance of the two-wheeled robot in a stationary state.

[0004] However, due to changes in working conditions (changes in its own structure, changes in the external environment, changes in load, etc.) and errors in state estimation (errors in center of gravity estimation, errors in sensor installation, etc.), during operation, the balance controller cannot maintain its initially designed optimality, resulting in the balance effect being damaged. Summary of the Invention

[0005] Embodiments of the present application provide a control method, device, medium, program, and robot for a two-wheeled robot. This method can achieve the stationary state of a two-wheeled robot in a balanced state. The technical solution is as follows:

[0006] According to one aspect of the present application, a control method for a two-wheeled robot is provided, and the method includes:

[0007] Calculate an optimal feedback gain, an optimal variable matrix, and an uncertainty according to the first state variable and the first feedback gain of the two-wheeled robot, where the optimal variable matrix is used to represent the gain degree of the state of the two-wheeled robot on the control mode of the two-wheeled robot;

[0008] Calculate an angle deviation matrix and a noise deviation matrix according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the second state variable of the two-wheeled robot;

[0009] Obtain the control torque of the two-wheeled robot according to the second state variable, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix;

[0010] Control the two-wheeled robot according to the control torque.

[0011] According to one aspect of the present application, there is provided a control device for a two-wheeled robot, the device including:

[0012] A calculation module, configured to calculate an optimal feedback gain, an optimal variable matrix, and an uncertainty according to a first state variable and a first feedback gain of the two-wheeled robot, where the optimal variable matrix is used to represent the gain degree of the state of the two-wheeled robot to the control mode of the two-wheeled robot;

[0013] The calculation module is further configured to calculate an angle deviation matrix and a noise deviation matrix according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and a second state variable of the two-wheeled robot;

[0014] The calculation module is further configured to obtain a control torque of the two-wheeled robot according to the second state variable, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix;

[0015] A control module, configured to control the two-wheeled robot according to the control torque.

[0016] According to another aspect of the present application, there is provided a robot, the robot including a processor, and the processor is configured to load and execute to implement the control method of the two-wheeled robot as described in the above aspect.

[0017] According to another aspect of the present application, there is provided a computer storage medium, where at least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to implement the control method of the two-wheeled robot as described in the above aspect.

[0018] According to another aspect of the present application, there is provided a computer program product or a computer program, the computer program product or the computer program including computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the control method of the two-wheeled robot as described in the above aspect.

[0019] The beneficial effects brought by the technical solutions provided in the embodiments of the present application at least include:

[0020] Based on the first state variables and the first feedback gains of the two-wheeled robot, the optimal feedback gains, the optimal variable matrix, and the uncertainty are obtained. Then, according to the optimal feedback gains, the optimal variable matrix, the uncertainty, and the second state variables of the two-wheeled robot, the angle deviation matrix and the noise deviation matrix are calculated. Subsequently, using the second state variables, the optimal feedback gains, the angle deviation matrix, and the noise deviation matrix, the control torque of the two-wheeled robot is obtained. Finally, the two-wheeled robot is controlled by the control torque. This method enables the two-wheeled robot to stay stationary or move within a small range, enhancing the stability and safety of the two-wheeled robot. Description of the Drawings

[0021] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0022] Figure 1 Shows a schematic diagram of a two-wheeled robot provided by an embodiment of the present application;

[0023] Figure 2 Shows a schematic diagram of a control system of a two-wheeled robot provided by an embodiment of the present application;

[0024] Figure 3 Shows a schematic flowchart of a control method of a two-wheeled robot provided by an embodiment of the present application;

[0025] Figure 4 Shows a schematic diagram of the sagittal plane of a two-wheeled robot provided by an embodiment of the present application;

[0026] Figure 5 Shows a schematic flowchart of a control method of a two-wheeled robot provided by an embodiment of the present application;

[0027] Figure 6 Shows a curve graph of training data provided by an embodiment of the present application;

[0028] Figure 7 Shows a curve graph of training data provided by an embodiment of the present application;

[0029] Figure 8 Shows a curve graph of training data provided by an embodiment of the present application;

[0030] Figure 9 Shows a curve graph of training data provided by an embodiment of the present application;

[0031] Figure 10Shows a curve graph of training data provided by an embodiment of the present application;

[0032] Figure 11 Shows a curve graph of training data provided by an embodiment of the present application;

[0033] Figure 12 Shows a curve graph of training data provided by an embodiment of the present application;

[0034] Figure 13 Shows a schematic diagram of a control device for a two-wheeled robot provided by an embodiment of the present application;

[0035] Figure 14 Shows a schematic structural diagram of a controller provided by an embodiment of the present application. Detailed implementation manners

[0036] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.

[0037] It should be noted that, before collecting relevant data of the user and during the process of collecting relevant data of the user, a prompt interface, a pop-up window, or voice prompt information can be displayed. The prompt interface, pop-up window, or voice prompt information is used to prompt the user that their relevant data is currently being collected, so that the present application only starts to execute the relevant steps of obtaining the user's relevant data after obtaining the confirmation operation of the user on the prompt interface or the pop-up window. Otherwise (that is, when the confirmation operation of the user on the prompt interface or the pop-up window is not obtained), the relevant steps of obtaining the user's relevant data are ended, that is, the relevant data of the user is not obtained. In other words, all user data collected by the present application is collected with the consent and authorization of the user, and the collection, use, and processing of relevant user data need to comply with relevant laws, regulations, and standards of relevant countries and regions.

[0038] In the embodiment of the present application, a wheel-leg type two-wheeled robot is taken as an example for illustration. Figure 1 Shows a schematic diagram of a two-wheeled robot provided by an embodiment of the present application. The two-wheeled robot 100 includes a base 11, a leg 12, a leg 13, and a tail rod 14.

[0039] The base 11 is provided with a controller of the two-wheeled robot. As Figure 1 shown, the base 11 is provided with a total of 4 motors, namely a motor 111, a motor 112, a motor 113, and a motor 114. Among them, the motor 111 and the motor 112 drive the leg 12, and the motor 113 and the motor 114 drive the leg 13. In some embodiments, the attitude of the base 11 can be adjusted by changing the heights of the leg 12 and the leg 13, that is, the distance between the wheel center and the leg plane.

[0040] The outrigger 12 is provided with a motor 121, and the motor 121 is used to drive the wheel 122. Optionally, the outrigger 12 adopts a five-bar linkage mechanism, so that the outrigger 12 is driven by the motors 111 and 112 on the base 11, and there is no driver on the knee of the outrigger 12.

[0041] The outrigger 13 is provided with a motor 131, and the motor 131 is used to drive the wheel 132. Optionally, the outrigger 13 adopts a five-bar linkage mechanism, so that the outrigger 13 is driven by the motors 113 and 114 on the base 11, and there is no driver on the knee of the outrigger 13.

[0042] The tail rod 14 is provided with a motor 141 and a motor 142. In some embodiments, the motor 141 is used to drive the wheel 143. In some embodiments, the motor 142 is used to adjust the form of the tail rod 14. For example, the tail rod 14 includes a retracted state and a lowered state. When the tail rod 14 is in the retracted state, the wheel 143 is in a suspended state and does not contact the ground. When the tail rod 14 is in the lowered state, the wheel 143 contacts the ground. In some embodiments, by adjusting the state of the wheel 143, the two-wheeled robot 100 can also flexibly switch between the two-wheeled and three-wheeled modes. In some embodiments, the wheel-legged two-wheeled robot can achieve obstacle crossing, jumping and flipping. Optionally, the height of the wheel-legged two-wheeled robot is between 0.33 meters and 0.7 meters.

[0043] It should be noted that Figure 1 Only one optional form of the two-wheeled robot is shown. The two-wheeled robot involved in the embodiments of the present application may also be other robots with two parallel wheels. The embodiments of the present application do not specifically limit the upper body form of the two-wheeled robot.

[0044] Figure 2 The figure shows a schematic diagram of a control system of a two-wheeled robot provided by an embodiment of the present application. The control system 200 is composed of an adaptive adjustment subsystem 203 and an external instruction control subsystem 206.

[0045] The two-wheeled robot 201 obtains sensor data and generates a state estimate 202 according to the sensor data. Optionally, the state estimate 202 includes at least one of linear velocity, pitch angular velocity, base height, and ground slope. The adaptive adjustment subsystem 203 generates a balance control strategy through the state estimate 202, and the balance control strategy is used to control the two-wheeled robot 201 to maintain balance.

[0046] The control system 200 obtains a motion instruction 205. Optionally, the motion instruction 205 includes at least one of forward, backward, stationary, jumping, adjusting the base height, and flipping. The external instruction control subsystem 206 generates a motion control strategy according to the motion instruction 205.

[0047] The control system 200 generates a whole-body control strategy 204 according to a balance control strategy and a motion control strategy. The whole-body control strategy 204 is used to control the two-wheeled robot 201 to move while maintaining a balanced state. In some embodiments, the whole-body control strategy includes at least one of a balance control strategy, other control strategies, and constraint conditions. The other control strategies are used to represent control methods other than controlling the two-wheeled robot 201 to maintain balance, and the constraint conditions are used to represent the limiting conditions of the two-wheeled robot 201. The control system 200 sends the whole-body control strategy 204 to the two-wheeled robot 201, and the two-wheeled robot 201 executes the whole-body control strategy 204.

[0048] Figure 3 The flowchart shows a control method for a two-wheeled robot provided by an embodiment of the present application. This method can be executed by Figure 1 the two-wheeled robot shown, and this method includes:

[0049] Step 302: Calculate an optimal feedback gain, an optimal variable matrix, and an uncertainty according to the first state variable and the first feedback gain of the two-wheeled robot. The optimal variable matrix is used to represent the gain degree of the state of the two-wheeled robot on the control method of the two-wheeled robot.

[0050] In the embodiment of the present application, the variable matrix refers to a Lyapunov matrix.

[0051] The first state variable is used to represent the measured state of the two-wheeled robot in the first time period. Optionally, the first state variable includes at least one of the pitch angle, pitch angular velocity, and linear velocity of the two-wheeled robot.

[0052] The first feedback gain is used to represent the relationship between the state of the two-wheeled robot and the control matrix in the balance system. Exemplarily, in the balance system, the control matrix τ of the two-wheeled robot is τ = -K0ζ + β, where K0 refers to the first feedback gain, ζ refers to the state variable, and β is used to represent the change amount of the two-wheeled robot during movement. β can be expressed as a time-related variable β(t), t ∈ [t0, t s , t0 < t s . The first state variable is any state variable within the time period [t0, t s .

[0053] The optimal feedback gain is used to represent the relationship between the state of the stationary two-wheeled robot and the control matrix in the balance system.

[0054] The uncertainty is used to compensate for the error of the two-wheeled robot during movement.

[0055] Step 304: Calculate an angle deviation matrix and a noise deviation matrix according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the second state variable of the two-wheeled robot.

[0056] The second state variable is used to represent the state of the two-wheeled robot in the second time period. Optionally, the second state variable includes at least one of the pitch angle, pitch angular velocity, and linear velocity of the two-wheeled robot.

[0057] The angle deviation matrix is used to represent the difference between the actual pitch angle and the measured pitch angle of the two-wheeled robot.

[0058] The noise deviation matrix is used to represent the environmental noise of the two-wheeled robot.

[0059] Optionally, when the first state variable is any state variable within the time period [t0, t s , the second state variable refers to any state variable within (t s , +∞). In a specific example, if the first state variable refers to the state variable within [1, 8], then the second state variable refers to the state variable within (8, +∞). Therefore, in the embodiments of the present application, the state variable in the first time period is used as a priori experience, and the control torque of the two-wheeled robot is determined according to the state variable in the second time period.

[0060] Step 306: Obtain the control torque of the two-wheeled robot according to the second state variable, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix.

[0061] Optionally, obtain a system compensation value according to the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix; obtain the control torque of the two-wheeled robot according to the optimal feedback gain, the second state variable, and the system compensation value.

[0062] Exemplarily, the system compensation value L = K * Z + T, where K * refers to the optimal feedback gain, Z refers to the angle deviation matrix, and T refers to the noise deviation matrix. Then the control torque of the two-wheeled robot is τ = -K * ζ + L, where ζ refers to the second state variable.

[0063] Step 308: Control the two-wheeled robot according to the control torque.

[0064] In some embodiments, as Figure 1 shown, control the torques of motors 111, 112, 113, 114, 121, and 131 according to the control torque, so that the two-wheeled robot remains stationary in the balanced state.

[0065] In summary, in the embodiments of the present application, the optimal feedback gain, the optimal variable matrix, and the uncertainty are obtained according to the first state variable and the first feedback gain of the two-wheeled robot. Then, according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the second state variable of the two-wheeled robot, the angle deviation matrix and the noise deviation matrix are calculated. Then, the control torque of the two-wheeled robot is obtained by using the second state variable, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix. Finally, the two-wheeled robot is controlled by the control torque. This method enables the two-wheeled robot to remain stationary or move within a small range, improving the stability and safety of the two-wheeled robot.

[0066] In the following embodiments, it is difficult for the two-wheeled robot to maintain a completely stationary standing state under different working conditions. To keep the two-wheeled robot stationary, the center of mass (COM) and the middle of the wheels should be vertical. Therefore, accurately estimating the position of the center of mass is crucial for the controller of the two-wheeled robot. However, due to the non-uniform mass distribution and assembly errors, it is inevitable that the position of the center of mass deviates from the expected position in practice. This is manifested in Figure 4 the sagittal plane, where theoretically the center of mass of the base coincides with the geometric center, but in practice the center of mass 402 of the base is different from the geometric center 401.

[0067] To solve the above problems, in the task of balancing the two-wheeled robot, it is necessary to adjust the motor torque τ on the control wheel so that the pitch angle of the two-wheeled robot remains unchanged, and the pitch angular velocity and the linear velocity are adjusted to 0. Then, the system composed of the two-wheeled robot can be expressed by the following formula:

[0068]

[0069] where A ∈ R n×n , B ∈ R n×m (n = 3, m = 1). It should be noted that due to the uncertain factors of the robot system, it is difficult to model the exact expressions of A and B. Therefore, the exact expressions of A and B are not used in the embodiments of the present application.

[0070] Considering the deviation of the center of mass, the actual pitch angle is the difference between the measured pitch angle θ and the pitch angle offset Δθ, that is For the pitch angular velocity and the linear velocity, there is no deviation. The actual pitch angular velocity is equal to the measured pitch angular velocity, and the actual linear velocity is equal to the measured linear velocity, that is Therefore, the following formula is obtained:

[0071]

[0072] where Since Δθ is unknown, D is also unknown. In addition, in order to keep the two-wheeled robot stationary at a fixed position, select as the output to be adjusted to 0, the error of

[0073]

[0074] where C = [0 0 1].

[0075] In the embodiment of the present application, the control torque of the two-wheeled robot can be expressed in the following form:

[0076] τ = -Kζ + L, (4)

[0077] where L = KZ + T, Z = [Δθ 0 0] T , K is a stable feedback gain, K ∈ R n×1 . In the above expression, the first term is used to adjust the state ζ of the two-wheeled robot, and the second term is used to compensate for uncertainties. When the two-wheeled robot is gradually stationary (satisfying ), Z and T can be solved by the following adjustment equation set:

[0078] 0 = AZ + BT + D, (5)

[0079] 0 = CZ, (6)

[0080] Due to the underactuated dynamics unique to the two-wheeled robot, the above adjustment equation has a unique solution. This is because for the two-wheeled robot in a stationary state, the state of the two-wheeled robot satisfies ζ = [Δθ 0 0], and at this time the control torque of the two-wheeled robot is fixed.

[0081] In the present application, the optimal solution of the above adjustment equation is represented by solving the following constrained optimization problem of state feedback control:

[0082]

[0083] where Q ∈ R n×n is positive definite, R ∈ R. The optimal solution is represented by the optimal feedback as:

[0084] K * = -R -1 B T P * , (8)

[0085] where P is the variable matrix mentioned above.

[0086] Based on the above argumentation process, Figure 5The flowchart of a control method for a two-wheeled robot provided by an embodiment of the present application is shown. This method can be executed by the two-wheeled robot 100 shown in the figure, and the method includes:

[0087] Step 501: Invoke the first equation, and obtain the j-th variable matrix through the first state variable and the (j + 1)-th feedback gain.

[0088] The first state variable is used to represent the measurement state of the two-wheeled robot during the first period. Optionally, the first state variable includes at least one of the pitch angle, pitch angular velocity, and linear velocity of the two-wheeled robot.

[0089] Optionally, this step includes the following sub-steps:

[0090] 1. Determine the first intermediate matrix, the second intermediate matrix, and the third intermediate matrix according to the first state variable;

[0091] Exemplarily, denote the first intermediate matrix as ∧ ζ,ζ , denote the second intermediate matrix as ∑ ζ,ζ , denote the third intermediate matrix as ∑ ζ,τ Then there are:

[0092]

[0093]

[0094]

[0095] where ζ represents the first state variable of the two-wheeled robot, t represents time, and τ represents the control torque of the two-wheeled robot.

[0096] 2. Obtain the first polynomial of the first equation according to the (j + 1)-th feedback gain, the first intermediate matrix, the second intermediate matrix, and the third intermediate matrix;

[0097] Exemplarily, denote the first polynomial as

[0098] where R is a constant matrix, is used to represent the tensor product.

[0099] 3. Obtain the second polynomial of the first equation according to the (j + 1)-th feedback gain and the first intermediate matrix;

[0100] Exemplarily, denote the second polynomial as Ф, where Q is a constant matrix.

[0101] 4. When the first polynomial and the second polynomial are equal, solve the first equation to obtain the j-th variable matrix.

[0102] Exemplarily, solve the first equation to obtain the j-th variable matrix, i.e., P in the equation j .

[0103] It should be noted that to ensure that the first equation has a solution, a fourth intermediate matrix is determined according to the first state variable; in the case where the second intermediate matrix, the third intermediate matrix, and the fourth intermediate matrix reach full rank, the steps are executed.

[0104] Denote the fourth intermediate matrix as ∑ ζ , then there is When the second intermediate matrix, the third intermediate matrix, and the fourth intermediate matrix reach full rank, the following equation is satisfied:

[0105]

[0106] wherein, the first intermediate matrix includes the difference between the tensor product of the first state variable at the first moment and the first state variable and the tensor product of the first state variable at the second moment and the first state variable;

[0107] The second intermediate matrix includes the integral of the first state variable and the first state variable from the first moment to the second moment;

[0108] The third intermediate matrix includes the integral of the first state variable and the torque of the two-wheel robot from the first moment to the second moment;

[0109] The fourth intermediate matrix includes the integral of the first state variable from the first moment to the second moment.

[0110] The first moment and the second moment are two different sampling values within the first time period.

[0111] Step 502: Determine the (j + 2)-th feedback gain according to the (j + 1)-th feedback gain.

[0112] Exemplarily, according to the first equation and the (j + 1)-th feedback gain, the (j + 2)-th feedback gain is obtained.

[0113] Step 503: Update j to j + 1 and repeat the above two steps.

[0114] Exemplarily, repeat the above steps 501 to 502 until the convergence condition is satisfied.

[0115] Step 504: In the case where the j-th variable matrix converges, determine the j-th variable matrix as the optimal variable matrix; determine the (j + 1)-th feedback gain as the optimal feedback gain.

[0116] Exemplarily, when ‖P j+1 - P j‖ When ∈ is any positive real number, it is determined that the j-th variable matrix converges.

[0117] Exemplarily, the optimal variable matrix P * = P j , the optimal feedback gain K * = K j+1 .

[0118] Step 505: Invoke the first equation, and determine the uncertainty according to the optimal variable matrix, the optimal feedback gain, and the first state variable.

[0119] Exemplarily, when determining the optimal variable matrix P * , the optimal feedback gain K * and the first state variable ζ, determine the uncertainty D according to the above first equation.

[0120] Step 506: Determine the actual state variable according to the first state variable.

[0121] The actual state variable is used to represent the actual state of the two-wheeled robot during the first time period. The first state variable is while the actual state variable is Also, since and

[0122] Step 507: Invoke the second equation, and obtain the error linear function according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the actual state variable.

[0123] Optionally, this step includes the following sub-steps:

[0124] 1. Determine the fourth intermediate matrix, the fifth intermediate matrix, and the sixth intermediate matrix according to the actual state variable;

[0125] Exemplarily, denote the fourth intermediate matrix as Denote the fifth intermediate matrix as Denote the sixth intermediate matrix as Then there is:

[0126]

[0127]

[0128]

[0129] Among them, represents the second state variable of the two-wheeled robot, t represents time, and τ represents the control torque of the two-wheeled robot.

[0130] 2. Obtain the third polynomial of the second equation based on the optimal feedback gain, the optimal variable matrix, the uncertainty, the fourth intermediate matrix, the fifth intermediate matrix, and the sixth intermediate matrix;

[0131] Exemplarily, denote the third polynomial as

[0132] where, R is a constant matrix, used to represent the tensor product.

[0133] 3. Obtain the fourth polynomial of the second equation based on the second state variable and the fourth intermediate matrix;

[0134] Exemplarily, denote the fourth polynomial as where, Q is a constant matrix.

[0135] 4. Solve the second equation when the third polynomial and the fourth polynomial are equal to obtain the error linear function.

[0136] Exemplarily, solve the second equation to obtain the error linear function, that is, in the equation

[0137] It should be noted that to ensure that the second equation has a solution, determine the eighth intermediate matrix according to the second state variable; when the sixth intermediate matrix, the seventh intermediate matrix, and the eighth intermediate matrix reach full rank, execute the steps.

[0138] Exemplarily, denote the eighth intermediate matrix as then there is When the sixth intermediate matrix, the seventh intermediate matrix, and the eighth intermediate matrix reach full rank, the following equation is satisfied:

[0139]

[0140] where, the fifth intermediate matrix includes the difference between the tensor product of the actual state variables at the third moment and the actual state variables and the tensor product of the actual state variables at the fourth moment and the actual state variables;

[0141] The sixth intermediate matrix includes the integral of the actual state variables from the third moment to the fourth moment;

[0142] The seventh intermediate matrix includes the integral of the actual state variables from the third moment to the fourth moment and the torque of the two-wheel robot;

[0143] The eighth intermediate matrix includes the integral of the actual state variables from the third moment to the fourth moment.

[0144] The third moment and the fourth moment are two different sampling values within the first time period. Optionally, the first moment and the third moment are the same. Optionally, the second moment and the fourth moment are the same.

[0145] Step 508: Obtain an angle deviation matrix and a noise deviation matrix based on the optimal feedback gain, the optimal variable matrix, the uncertainty, and the error linear function.

[0146] Exemplarily, the optimal feedback gain K * , the optimal variable matrix P * , the uncertainty D, and the error linear function satisfy the following equation:

[0147]

[0148] where α is a scalar, and α satisfies and the above equation (6), is a basis of Z. Then, the angle deviation matrix Z and the noise deviation matrix T are determined through the above equation.

[0149] Step 509: Obtain a system compensation value based on the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix.

[0150] Exemplarily, based on the optimal feedback gain K * , the angle deviation matrix Z, and the noise deviation matrix T, the system compensation value L = K * Z + T is obtained.

[0151] Step 510: Obtain the control torque of the two-wheeled robot based on the optimal feedback gain, the second state variable, and the system compensation value.

[0152] Exemplarily, based on the optimal feedback gain K * , the second state variable ζ, and the system compensation value L, the control torque τ = -K * ζ + L of the two-wheeled robot is obtained.

[0153] Step 511: Control the two-wheeled robot according to the control torque.

[0154] In some embodiments, as Figure 1 shown, control the torques of motors 111, 112, 113, 114, 121, and 131 according to the control torque, so that the two-wheeled robot remains stationary in the balanced state.

[0155] In summary, in the embodiments of the present application, based on the first state variables and the first feedback gains of the two-wheeled robot, the optimal feedback gains, the optimal variable matrices, and the uncertainties are obtained. Then, according to the optimal feedback gains, the optimal variable matrices, the uncertainties, and the second state variables of the two-wheeled robot, the angular deviation matrix and the noise deviation matrix are calculated. Subsequently, using the second state variables, the optimal feedback gains, the angular deviation matrix, and the noise deviation matrix, the control torques of the two-wheeled robot are obtained. Finally, the two-wheeled robot is controlled through the control torques. This method enables the two-wheeled robot to remain stationary or move within a small range, improving the stability and safety of the two-wheeled robot.

[0156] Moreover, the balance controller of the above-mentioned type of robot can be automatically updated online, enabling the above-mentioned robot to achieve optimal control and remain stationary or move within a small range. The above effects improve the stability and safety of the two-wheeled robot and enable the two-wheeled robot to be applied in scenarios that require precise operations with a stable chassis.

[0157] In the embodiments of the present application, it is necessary to determine the optimal solutions (K * , P * ) and (Z, T). First, the method for determining the optimal feedback gain K * is to iteratively solve the optimization problem through the collected ζ(t) and τ(t). In the embodiments of the present application, the dependence on A is removed through the Lyapunov equation:

[0158]

[0159] where j is the iteration index. At the same time, the dependence on B is removed through the following gain iteration:

[0160] K j+1 = R -1 B T P j .

[0161] In each iteration process, D is set as the variable determined in each iteration. When K and P converge, the convergence values are the optimal solutions K * and P * .

[0162] To determine the parameters Z and T, a basis of Z is defined as such that there exists a scalar α satisfying and equation (6). Define a Sylvester mapping S: R n → R n , such that S(Z) = -AZ, then there is:

[0163]

[0164] Among them, B uses K * and P * to represent that D can be solved through the previous steps.

[0165] In the case where it is provided, (Z, T) can be solved through the following equations:

[0166]

[0167] By setting L = K * Z + T and τ = -K * ζ + L, the control torque τ is obtained.

[0168] In summary, this embodiment provides a proof process for calculating the control torque τ. Through the above proof process, the complete process for calculating the control torque can be obtained, providing a theoretical basis for the calculation of the control torque.

[0169] In the following embodiments, a control method for a two-wheeled robot provided by an embodiment of the present application will be introduced in the form of pseudocode as follows:

[0170] 1. Apply initial stable control, τ = -K0ζ + β, where the detection noise β(t) collects data on [t0, t s .

[0171] 2. Calculate equations (9), (10), (11), (12) and equations (13), (14), (15) and (16).

[0172] 3. Determine that the full rank condition holds:

[0173]

[0174]

[0175] 4. Set j = 0.

[0176] 5. Set a loop, with ‖P j+1 - P j ‖ < ∈ as the loop end condition, where ∈ is any positive real number.

[0177] 6. Solve for P j , K j+1 and D through the following formula:

[0178]

[0179] Among them,

[0180] 7. End the loop.

[0181] 8. Let K * = K j+1 , P * = P j .

[0182] 9. Solve for

[0183]

[0184] where

[0185]

[0186] 10. Solve for Z and T through Equation (17).

[0187] 11. Let L = K * Z + T, then the control torque output by the two-wheeled robot is τ = -K * ζ + L.

[0188] In summary, in the embodiments of the present application, the optimal feedback gain, the optimal variable matrix, and the uncertainty are obtained according to the first state variable and the first feedback gain of the two-wheeled robot. Then, according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the second state variable of the two-wheeled robot, the angle deviation matrix and the noise deviation matrix are calculated. Then, using the second state variable, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix, the control torque of the two-wheeled robot is obtained. Finally, the two-wheeled robot is controlled through the control torque. This method can make the two-wheeled robot stay stationary or move within a small range, improving the stability and safety of the two-wheeled robot.

[0189] In the embodiments of the present application, a data-driven optimal output regulation controller is trained for the two-wheeled robot in four scenarios to handle the uncertainties in the model and the disturbance. In the related art, the two-wheeled robot can maintain balance but cannot be stationary, which is a limitation of the related art. Therefore, in the first scenario and the second scenario, the stability problems when the height of the robot is 0.33 m and 0.5 m are addressed. In addition, the present application also sets two more challenging scenarios. In the third scenario, the present application installs a 3.5-kg eccentric load at the front of the base in f. Since the weight of the floating base is about 11 kg, the heavy load will significantly change the balance point of the two-wheeled robot. In the fourth scenario, the present application trains the two-wheeled robot on a slope. Obviously, the two-wheeled robot requires additional torque to compensate for the factor of the direct slope, which also means that the balance point of the two-wheeled robot has changed. It should be noted that the information of the load (such as mass, shape, position) and the slope (such as gradient) is not used during the training process, and they are regarded as unknown disturbances.

[0190] During training, the initial gain K0 = [-74 -26 -10] is used. When the controller is in a stable state, the two-wheeled robot can move forward and / or backward repeatedly according to the controller, and the exploration noise β(t) = 1.6sin(8πt) + 0.8cos(12πt) is used to obtain more information data. Sufficient training data is collected for each experiment, which easily satisfies the full-rank condition of this application. In addition, the robustness of the method provided in the embodiments of this application ensures convergence to a small neighborhood of the optimal solution when using noisy data. Figure 6 and Figure 7 respectively show the training data when the robot height is 0.33 m and the robot height is 0.5 m. The oscillation of the curve means that there is exploration noise.

[0191] Finally, by setting Q = diag(900, 400, 150), R = 1 and ∈ = 10 -4 In the method provided in this application, the control parameters of the above 4 scenarios converge as follows:

[0192] L a = -4.21;

[0193] L b = -1.78;

[0194] L c = -5.97;

[0195] L d = 1.30;

[0196] The above convergence values are achieved in 19, 18, 16, and 21 iterations respectively. Please refer to Figure 8 , and the characteristic of fast convergence enables the algorithm of this application to be implemented online.

[0197] Due to the excessive adjustment of the pitch angle of the two-wheeled robot, the motor input of the two-wheeled robot is oscillating. The embodiments of this application correspondingly reduce the first diagonal term of Q. In addition, through manual testing, the convergence of the algorithm is most sensitive to the third diagonal term of Q, and its feasible range is 90 to 280. In addition, the second diagonal of Q should be greater than 180, and the first diagonal can be any positive value. These results demonstrate the robustness of the algorithm provided in the embodiments of this application to the convergence of parameters Q and R.

[0198] Through the algorithm of this application, the trained controller can update the state of the two-wheeled robot online twice after data collection. Here, we directly compare the related technology (the related technology uses the initial feedback gain K0 to control the two-wheeled robot) with the method provided by the embodiment of this application (also known as AOOR, Adaptive Optimal Output Regulation) to avoid the influence of motion and exploration noise on vision during the training process. In the first scenario, the height of the two-wheeled robot is 0.33 m. First, use the related technology and use the remote control to force the two-wheeled robot to stand still. Then, after releasing the remote control, the robot moves forward continuously within the first 2 seconds, which can be obtained from the curve shown in Figure 9 (c). Then, by enabling the method provided by the embodiment of this application at t = 2 seconds, the robot decelerates sharply and remains stationary within the next 6 seconds, as shown by the curve shown in Figure 9 (c). To achieve rapid adjustment, the motor input oscillates a bit, but the influence on the pitch angle (please refer to Figure 9 (a)) and the linear velocity (please refer to Figure 9 (c)) is acceptable. According to the test data, the average speed when using AOOR is much slower than the initial situation with a smaller displacement over a longer period of time. The small displacement generated during the use of the method provided by the embodiment of this application is caused by the initial speed converging to zero, which is inevitable. The test process of the robot at a height of 0.5 m and with a load is similar. According to the test data ( Figure 10 、 Figure 11 ), after enabling the method provided by the embodiment of this application, the robot decelerates and stops. For the ramp test, the method is similar. The difference is that the method provided by the embodiment of this application is used at the beginning and then the related technology is used for comparison. The reason is that if the related technology is used at the beginning, the robot may quickly leave the ramp before enabling the method provided by the embodiment of this application. The data ( Figure 12 ) shows that the method provided by the embodiment of this application has excellent adjustment performance. Table 1 summarizes the experimental results of this application and the related technology. The smaller displacement of the method provided by this application over a longer period of time indicates that the method provided by this application has strong adjustment ability.

[0199] Table 1 Experimental Results of this Application and the Related Technology

[0200]

[0201] The following is the device embodiment of this application. For the details not described in detail in the device embodiment, reference can be made to the corresponding records in the above method embodiment, which will not be elaborated herein.

[0202] Figure 13The figure shows a schematic structural diagram of a control device for a two-wheeled robot provided by an exemplary embodiment of the present application. This device can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device 1300 includes:

[0203] A calculation module 1301, configured to calculate an optimal feedback gain, an optimal variable matrix, and an uncertainty according to a first state variable and a first feedback gain of the two-wheeled robot, where the optimal variable matrix is used to represent the gain degree of the state of the two-wheeled robot on the control mode of the two-wheeled robot;

[0204] The calculation module 1301 is further configured to calculate an angle deviation matrix and a noise deviation matrix according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and a second state variable of the two-wheeled robot;

[0205] The calculation module 1301 is further configured to obtain a control torque of the two-wheeled robot according to the second state variable, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix;

[0206] A control module 1302, configured to control the two-wheeled robot according to the control torque.

[0207] In an alternative design, the calculation module 1301 is further configured to call a first equation, and obtain a j-th variable matrix through the first state variable and the (j + 1)-th feedback gain, where the first feedback gain is the first feedback gain, j is an integer, and the initial value of j is 0; determine the (j + 2)-th feedback gain according to the (j + 1)-th feedback gain; update j to j + 1, and repeat the above two steps; when the j-th variable matrix converges, determine the j-th variable matrix as the optimal variable matrix; determine the (j + 1)-th feedback gain as the optimal feedback gain; call the first equation, and determine the uncertainty according to the optimal variable matrix, the optimal feedback gain, and the first state variable.

[0208] In an alternative design, the calculation module 1301 is further configured to determine a first intermediate matrix, a second intermediate matrix, and a third intermediate matrix according to the first state variable; obtain a first polynomial of the first equation according to the (j + 1)-th feedback gain, the first intermediate matrix, the second intermediate matrix, and the third intermediate matrix; obtain a second polynomial of the first equation according to the (j + 1)-th feedback gain and the first intermediate matrix; when the first polynomial and the second polynomial are equal, solve the first equation to obtain the j-th variable matrix.

[0209] In an alternative design, the computing module 1301 is further configured to determine a fourth intermediate matrix according to the first state variable; and when the second intermediate matrix, the third intermediate matrix, and the fourth intermediate matrix reach full rank, execute the step of calling the first equation to obtain the j-th variable matrix through the first state variable and the (j + 1)-th feedback gain.

[0210] In an alternative design, the first intermediate matrix includes the difference between the tensor product of the first state variable at the first moment and the first state variable and the tensor product of the first state variable at the second moment and the first state variable; the second intermediate matrix includes the integral of the first state variable from the first moment to the second moment; the third intermediate matrix includes the integral of the first state variable and the torque of the two-wheeled robot from the first moment to the second moment; the fourth intermediate matrix includes the integral of the first state variable from the first moment to the second moment.

[0211] In an alternative design, the computing module 1301 is further configured to determine an actual state variable according to the first state variable; call a second equation, and obtain an error linear function according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the actual state variable; and obtain the angle deviation matrix and the noise deviation matrix according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the error linear function.

[0212] In an alternative design, the computing module 1301 is further configured to determine a fourth intermediate matrix, a fifth intermediate matrix, and a sixth intermediate matrix according to the actual state variable; obtain a third polynomial of the second equation according to the optimal feedback gain, the optimal variable matrix, the uncertainty, the fourth intermediate matrix, the fifth intermediate matrix, and the sixth intermediate matrix; obtain a fourth polynomial of the second equation according to the actual state variable and the fourth intermediate matrix; and solve the second equation to obtain the error linear function when the third polynomial and the fourth polynomial are equal.

[0213] In an alternative design, the computing module 1301 is further configured to determine an eighth intermediate matrix according to the actual state variable; and when the sixth intermediate matrix, the seventh intermediate matrix, and the eighth intermediate matrix reach full rank, execute the step of calling the second equation to obtain an error linear function according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the second state variable.

[0214] In an alternative design, the fifth intermediate matrix includes the difference between the tensor product of the second state variable of the third sub-time and the second state variable and the tensor product of the second state variable of the fourth moment and the second state variable; the sixth intermediate matrix includes the integral of the second state variable and the second state variable between the third moment and the fourth moment; the seventh intermediate matrix includes the integral of the second state variable and the torque of the two-wheeled robot between the third moment and the fourth moment; the eighth intermediate matrix includes the integral of the second state variable between the third moment and the fourth moment.

[0215] In an alternative design, the calculation module 1301 is further configured to obtain a system compensation value according to the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix; and obtain the control torque of the two-wheeled robot according to the optimal feedback gain, the second state variable, and the system compensation value.

[0216] In summary, in the embodiment of the present application, the optimal feedback gain, the optimal variable matrix, and the uncertainty are obtained according to the first state variable and the first feedback gain of the two-wheeled robot. Then, the angle deviation matrix and the noise deviation matrix are calculated according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the second state variable of the two-wheeled robot. Then, the control torque of the two-wheeled robot is obtained by using the second state variable, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix. Finally, the two-wheeled robot is controlled by the control torque. This method can keep the two-wheeled robot stationary or move within a small range, improving the stability and safety of the two-wheeled robot.

[0217] Figure 14 It is a schematic structural diagram of a controller shown according to an exemplary embodiment. The computer device 1400 includes a central processing unit (CPU) 1401, a system memory 1404 including a random access memory (RAM) 1402 and a read-only memory (ROM) 1403, and a system bus 1405 connecting the system memory 1404 and the central processing unit 1401. The computer device 1400 further includes a basic input / output system (Input / Output, I / O system) 1406 for facilitating the transmission of information between various components within the computer device, and a mass storage device 1407 for storing an operating system 1413, application programs 1414, and other program modules 1415.

[0218] The basic input / output system 1406 includes a display 1408 for displaying information and input devices 1409 such as a mouse, keyboard, etc. for user input of information. Both the display 1408 and the input devices 1409 are connected to the central processing unit 1401 through an input / output controller 1410 connected to the system bus 1405. The basic input / output system 1406 may also include an input / output controller 1410 for receiving and processing inputs from a plurality of other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1410 also provides outputs to a display screen, printer, or other types of output devices.

[0219] The mass storage device 1407 is connected to the central processing unit 1401 through a mass storage controller (not shown) connected to the system bus 1405. The mass storage device 1407 and its associated computer-readable media provide non-volatile storage for the computer device 1400. That is, the mass storage device 1407 may include computer-readable media (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.

[0220] Without loss of generality, the computer-readable media may include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), CD-ROM, digital video disc (DVD), or other optical storage, magnetic tape cartridges, tapes, magnetic disk storage, or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage media is not limited to the above several. The above system memory 1404 and mass storage device 1407 may be collectively referred to as memory.

[0221] In accordance with various embodiments of the present disclosure, the computer device 1400 may also operate by connecting to a remote computer device on a network such as the Internet. That is, the computer device 1400 may be connected to the network 1411 through the network interface unit 1412 connected to the system bus 1405, or in other words, the network interface unit 1412 may also be used to connect to other types of networks or remote computer device systems (not shown).

[0222] The memory further includes one or more programs, and the one or more programs are stored in the memory. The central processing unit 1401 implements all or part of the steps of the control method of the two-wheeled robot by executing the one or more programs.

[0223] In an exemplary embodiment, there is also provided a computer-readable storage medium storing at least one instruction, at least one segment of program, a code set, or an instruction set, and the at least one instruction, the at least one segment of program, the code set, or the instruction set is loaded and executed by a processor to implement the control method of the two-wheeled robot provided in each of the above method embodiments.

[0224] The present application also provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the control method of the two-wheeled robot provided in the above aspects and embodiments.

[0225] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments.

[0226] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, and the storage medium mentioned above can be a read-only memory, a magnetic disk, an optical disk, or the like.

[0227] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A control method for a two-wheeled robot, characterized in that, The method includes: Calculating an optimal feedback gain, an optimal variable matrix, and an uncertainty according to a first state variable and a first feedback gain of the two-wheeled robot, where the optimal feedback gain is used to represent the gain degree of the state of the two-wheeled robot on the control mode of the two-wheeled robot; Determine the actual state variable according to the first state variable, where the first state variable is any state variable within a time period; Invoking a second equation to obtain an error linear function according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the actual state variable; the second equation is an equation for solving the error linear function based on the optimal feedback gain, the optimal variable matrix, the uncertainty, and the actual state variable; Obtaining an angle deviation matrix and a noise deviation matrix according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the error linear function; Obtain the control torque of the two-wheeled robot according to the second state variable of the two-wheeled robot, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix; the second state variable refers to any state variable within ; Controlling the two-wheeled robot according to the control torque; Wherein, the arbitrary state variable includes at least one of a pitch angle, a pitch angular velocity, and a linear velocity of the two-wheeled robot.

2. The method according to claim 1, characterized in that, The calculating an optimal feedback gain, an optimal variable matrix, and an uncertainty according to a first state variable and a first feedback gain of the two-wheeled robot includes: Invoking a first equation to obtain a j-th variable matrix through the first state variable and the (j + 1)-th feedback gain, where the first feedback gain is the first feedback gain, j is an integer, and the initial value of j is 0; the first equation is an equation for solving the j-th variable matrix based on the first state variable and the (j + 1)-th feedback gain; Determining the (j + 2)-th feedback gain according to the (j + 1)-th feedback gain; Updating j to j + 1 and repeating the above two steps; When the j-th variable matrix converges, determining the j-th variable matrix as the optimal variable matrix; determining the (j + 1)-th feedback gain as the optimal feedback gain; Invoking the first equation to determine the uncertainty according to the optimal variable matrix, the optimal feedback gain, and the first state variable.

3. The method according to claim 2, wherein The invoking the first equation to obtain a j-th variable matrix through the first state variable and the (j + 1)-th feedback gain includes: Determining a first intermediate matrix, a second intermediate matrix, and a third intermediate matrix according to the first state variable; Obtaining a first polynomial of the first equation according to the (j + 1)-th feedback gain, the first intermediate matrix, the second intermediate matrix, and the third intermediate matrix; Obtaining a second polynomial of the first equation according to the (j + 1)-th feedback gain and the first intermediate matrix; When the first polynomial and the second polynomial are equal, solving the first equation to obtain the j-th variable matrix.

4. The method according to claim 3, wherein The method further includes: Determining a fourth intermediate matrix according to the first state variable; When the second intermediate matrix, the third intermediate matrix, and the fourth intermediate matrix are full rank, performing the step of invoking the first equation to obtain a j-th variable matrix through the first state variable and the (j + 1)-th feedback gain.

5. The method according to claim 4, wherein The first intermediate matrix includes the first state variable at the first moment and the difference between the tensor product of the first state variable and the tensor product of the first state variable at the second moment; The second intermediate matrix includes the integral of the first state variable and the first state variable between the first moment and the second moment; The third intermediate matrix includes the integral of the first state variable and the torque of the two-wheeled robot between the first moment and the second moment; The fourth intermediate matrix includes the integral of the first state variable between the first moment and the second moment.

6. The method according to any one of claims 1 to 5, characterized in that The step of invoking the second equation and obtaining the error linear function according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the actual state variable includes: Determining a fourth intermediate matrix, a fifth intermediate matrix, and a sixth intermediate matrix according to the actual state variable; Obtaining a third polynomial of the second equation according to the optimal feedback gain, the optimal variable matrix, the uncertainty, the fourth intermediate matrix, the fifth intermediate matrix, and the sixth intermediate matrix; Obtaining a fourth polynomial of the second equation according to the actual state variable and the fourth intermediate matrix; When the third polynomial and the fourth polynomial are equal, solving the second equation to obtain the error linear function.

7. The method according to claim 6, wherein The method further includes: Determining an eighth intermediate matrix according to the actual state variable; When the sixth intermediate matrix, the seventh intermediate matrix, and the eighth intermediate matrix reach full rank, performing the step of invoking the second equation and obtaining the error linear function according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the actual state variable.

8. The method according to claim 7, wherein The fifth intermediate matrix includes the difference between the tensor product of the actual state variable at the third moment and the tensor product of the actual state variable and the tensor product of the actual state variable at the fourth moment; The sixth intermediate matrix includes the integral of the actual state variable and the actual state variable between the third moment and the fourth moment; The seventh intermediate matrix includes the integral of the actual state variable and the torque of the two-wheeled robot between the third moment and the fourth moment; The eighth intermediate matrix includes the integral of the actual state variable between the third moment and the fourth moment.

9. The method according to any one of claims 1 to 4, characterized in that, The step of obtaining the control torque of the two-wheeled robot according to the second state variable, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix includes: Obtaining a system compensation value according to the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix; Obtaining the control torque of the two-wheeled robot according to the optimal feedback gain, the second state variable, and the system compensation value.

10. A control device for a two-wheeled robot, characterized in that, The device includes: A calculation module, configured to calculate an optimal feedback gain, an optimal variable matrix, and an uncertainty according to a first state variable and a first feedback gain of the two-wheeled robot, where the optimal variable matrix is used to represent the gain degree of the state of the two-wheeled robot with respect to the control manner of the two-wheeled robot; The calculation module is further configured to determine an actual state variable according to the first state variable, where the first state variable is any state variable within a time period; call a second equation, and obtain an error linear function according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the actual state variable; obtain an angle deviation matrix and a noise deviation matrix according to the optimal feedback gain, the optimal variable matrix, the uncertainty, and the error linear function; the second equation is an equation for solving the error linear function based on the optimal feedback gain, the optimal variable matrix, the uncertainty, and the actual state variable; The calculation module is further configured to obtain the control torque of the two-wheeled robot according to the second state variable of the two-wheeled robot, the optimal feedback gain, the angle deviation matrix, and the noise deviation matrix; the second state variable refers to any state variable within ; A control module, configured to control the two-wheeled robot according to the control torque; Wherein, the any state variable includes at least one of a pitch angle, a pitch angular velocity, and a linear velocity of the two-wheeled robot.

11. A robot, characterized in that, The robot includes a processor, and the processor is configured to load and execute to implement the control method of the two-wheeled robot according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, At least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by the processor to implement the control method of the two-wheeled robot according to any one of claims 1 to 9.

13. A chip product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by the processor, the control method of the two-wheeled robot according to any one of claims 1 to 9 is implemented.

14. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by the processor, the control method of the two-wheeled robot according to any one of claims 1 to 9 is implemented.