Robot control method, device, storage medium and robot for riding a balance car
Patent Information
- Application Number
- CN202311785846.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-12-22
AI Technical Summary
[0003]有鉴于此,本申请实施例提供了一种骑平衡车的机器人控制方法、装置、计算机可读存储介质及机器人,以解决现有技术存在的当机器人动态发生变化时稳定性较差的问题
[0049]本申请实施例与现有技术相比存在的有益效果是:本申请实施例基于初始的控制器对目标系统进行控制,并获取所述目标系统在控制过程中的在线状态变量和在线控制力矩;其中,所述目标系统包括机器人和所述机器人所骑的平衡车;根据所述在线状态变量和所述在线控制力矩对与所述初始的控制器对应的第一基函数集合权重和第二基函数集合权重进行迭代优化,得到优化后的第一基函数集合权重和优化后的第二基函数集合权重;根据所述优化后的第一基函数集合权重和所述优化后的第二基函数集合权重确定优化后的控制器,并基于所述优化后的控制器对所述目标系统进行控制。通过本申请实施例,可以通过获取在线数据对控制器的参数不断进行迭代优化,即使系统动态发生变化,也可以迭代出与之适配的优化后的控制器进行控制,有效提高了系统的稳定性。
Smart Images

Figure CN117872862B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of robotics technology, and in particular relates to a control method, device, computer-readable storage medium, and robot for a self-balancing scooter. Background Technology
[0002] Currently, there is no effective control strategy for the application scenario of robots riding self-balancing scooters. Generally speaking, linear controllers are often the most commonly used control method for a controlled system. These include model-based linear controllers, such as traditional linear quadratic regulators (LQRs) and model predictive control (MPC), as well as model-free controllers, such as traditional proportional-integrative-derivative (PID) controllers. However, in the application scenario of robots riding self-balancing scooters, when the system dynamically changes, these existing controllers cannot achieve their optimal performance and exhibit poor stability. Summary of the Invention
[0003] In view of this, embodiments of this application provide a robot control method, device, computer-readable storage medium, and robot for riding a self-balancing scooter, in order to solve the problem of poor stability in the prior art when the robot's dynamics change.
[0004] The first aspect of this application provides a robot control method for riding a self-balancing scooter, which may include:
[0005] The target system is controlled based on the initial controller, and the online state variables and online control torque of the target system are obtained during the control process; wherein, the target system includes a robot and a self-balancing scooter ridden by the robot;
[0006] Based on the online state variables and the online control torque, the weights of the first basis function set and the weights of the second basis function set corresponding to the initial controller are iteratively optimized to obtain the optimized weights of the first basis function set and the optimized weights of the second basis function set.
[0007] The optimized controller is determined based on the optimized weights of the first basis function set and the optimized weights of the second basis function set, and the target system is controlled based on the optimized controller.
[0008] In one specific implementation of the first aspect, the iterative optimization of the weights of the first basis function set and the weights of the second basis function set corresponding to the initial controller based on the online state variables and the online control torque, to obtain the optimized weights of the first basis function set and the optimized weights of the second basis function set, may include:
[0009] Substitute the online state variables and the online control torque into the preset iterative solution equation to obtain the updated first basis function set weights and the updated second basis function set weights;
[0010] Determine whether the preset iteration stopping condition is met based on the updated weights of the first basis function set and the current weights of the first basis function set;
[0011] If the iteration stopping condition is not met, the next round of iteration optimization will continue.
[0012] If the iteration stopping condition is met, the iteration optimization is stopped, and the updated first basis function set weights are determined as the optimized first basis function set weights, and the updated second basis function set weights are determined as the optimized second basis function set weights.
[0013] In one specific implementation of the first aspect, the step of determining whether a preset iteration stopping condition is met based on the updated first basis function set weights and the current first basis function set weights may include:
[0014] The weight difference is obtained by subtracting the updated weights of the first basis function set from the current weights of the first basis function set.
[0015] Calculate the sum of squares of the weighted differences;
[0016] The iteration stopping condition is determined based on the sum of the squares of the weight differences.
[0017] In one specific implementation of the first aspect, determining whether the iteration stopping condition is met based on the sum of squares of the weight differences may include:
[0018] If the sum of squares of the weight differences is less than or equal to the preset iteration stopping threshold, then the iteration stopping condition is determined to be met.
[0019] If the sum of the squares of the weight differences is greater than the iteration stopping threshold, then the iteration stopping condition is not met.
[0020] In one specific implementation of the first aspect, controlling the target system based on the optimized controller may include:
[0021] Obtain the current state variables of the target system;
[0022] The optimized controller is used to process the current state variables to obtain the desired control torque of the target system;
[0023] The target system is controlled according to the desired control torque.
[0024] In one specific implementation of the first aspect, the desired control torque may include a first control torque and a second control torque;
[0025] Wherein, the first control torque is the torque used to control the self-balancing vehicle, and the second control torque is the torque used to control the robot.
[0026] In one specific implementation of the first aspect, controlling the target system based on the optimized controller may include:
[0027] Under the preset friction cone constraint conditions, the target system is controlled based on the optimized controller;
[0028] The friction cone constraint condition is the constraint relationship between the target horizontal force, the target vertical force, and the target friction coefficient. The target horizontal force is the horizontal force exerted by the surface of the balancing vehicle on the bottom of the robot's feet. The target vertical force is the vertical force exerted by the surface of the balancing vehicle on the bottom of the robot's feet. The target friction coefficient is the friction coefficient between the surface of the balancing vehicle and the bottom of the robot's feet.
[0029] A second aspect of this application provides a robot control device for riding a self-balancing scooter, which may include:
[0030] An online data acquisition module is used to control the target system based on an initial controller and acquire the online state variables and online control torque of the target system during the control process; wherein, the target system includes a robot and a self-balancing scooter ridden by the robot;
[0031] The iterative optimization module is used to iteratively optimize the weights of the first basis function set and the second basis function set corresponding to the initial controller based on the online state variables and the online control torque, so as to obtain the optimized weights of the first basis function set and the optimized weights of the second basis function set.
[0032] The system control module is used to determine an optimized controller based on the optimized weights of the first basis function set and the optimized weights of the second basis function set, and to control the target system based on the optimized controller.
[0033] In one specific implementation of the second aspect, the iterative optimization module may include:
[0034] The equation solving submodule is used to substitute the online state variables and the online control torque into the preset iterative solution equation to obtain the updated first basis function set weights and the updated second basis function set weights;
[0035] The iteration stopping condition judgment submodule is used to determine whether the preset iteration stopping condition is met based on the updated first basis function set weights and the current first basis function set weights;
[0036] The iteration stop condition judgment and post-processing module is used to continue the next round of iteration optimization if the iteration stop condition is not met; if the iteration stop condition is met, the iteration optimization is stopped, and the updated first basis function set weights are determined as the optimized first basis function set weights, and the updated second basis function set weights are determined as the optimized second basis function set weights.
[0037] In one specific implementation of the second aspect, the iteration stop condition judgment submodule may include:
[0038] The weight difference calculation unit is used to subtract the updated weights of the first basis function set from the current weights of the first basis function set to obtain the weight difference.
[0039] A sum-of-squares calculation unit is used to calculate the sum of squares of the weight differences;
[0040] The iteration stopping condition determination unit is used to determine whether the iteration stopping condition is met based on the sum of squares of the weight differences.
[0041] In one specific implementation of the second aspect, the iteration stopping condition judgment unit can be specifically used to: determine that the iteration stopping condition is met if the sum of squares of the weight differences is less than or equal to a preset iteration stopping threshold; and determine that the iteration stopping condition is not met if the sum of squares of the weight differences is greater than the iteration stopping threshold.
[0042] In one specific implementation of the second aspect, the iterative optimization module may be specifically used to: obtain the current state variable of the target system; process the current state variable using the optimized controller to obtain the desired control torque of the target system; and control the target system according to the desired control torque.
[0043] In one specific implementation of the second aspect, the desired control torque may include a first control torque and a second control torque; wherein the first control torque is the torque for controlling the self-balancing vehicle, and the second control torque is the torque for controlling the robot.
[0044] In one specific implementation of the second aspect, the system control module can be specifically used to: control the target system based on the optimized controller under preset friction cone constraint conditions;
[0045] The friction cone constraint condition is the constraint relationship between the target horizontal force, the target vertical force, and the target friction coefficient. The target horizontal force is the horizontal force exerted by the surface of the balancing vehicle on the sole of the robot's foot. The target vertical force is the vertical force exerted by the surface of the balancing vehicle on the sole of the robot's foot. The target friction coefficient is the friction coefficient between the surface of the balancing vehicle and the sole of the robot's foot.
[0046] A third aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described robot control methods for riding a self-balancing scooter.
[0047] A fourth aspect of this application provides a robot including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described robot control methods for riding a self-balancing scooter.
[0048] The fifth aspect of this application provides a computer program product that, when run on a robot, causes the robot to perform the steps of any of the above-described robot control methods for riding a self-balancing scooter.
[0049] The beneficial effects of this application embodiment compared with the prior art are as follows: This application embodiment controls the target system based on an initial controller and obtains the online state variables and online control torque of the target system during the control process; wherein, the target system includes a robot and a balance vehicle ridden by the robot; the weights of the first basis function set and the weights of the second basis function set corresponding to the initial controller are iteratively optimized according to the online state variables and the online control torque to obtain optimized weights of the first basis function set and the second basis function set; an optimized controller is determined according to the optimized weights of the first basis function set and the optimized weights of the second basis function set, and the target system is controlled based on the optimized controller. Through this application embodiment, the parameters of the controller can be continuously iteratively optimized by acquiring online data. Even if the system dynamically changes, an optimized controller adapted to iterative changes can be generated for control, effectively improving the stability of the system. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a schematic diagram of the target system for the embodiments of this application;
[0052] Figure 2 A simplified system model diagram of a robot riding a self-balancing scooter;
[0053] Figure 3 This is a flowchart of one embodiment of a robot control method for riding a self-balancing scooter according to the present application.
[0054] Figure 4 This is a schematic diagram of the control framework of the target system;
[0055] Figure 5 This is a structural diagram of one embodiment of a robot control device for riding a self-balancing scooter, as described in this application.
[0056] Figure 6 This is a schematic block diagram of a robot according to an embodiment of this application. Detailed Implementation
[0057] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0058] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0059] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0060] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0061] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0062] Furthermore, in the description of this application, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0063] Humanoid robots represent a cutting-edge and hot research area in robotics. They possess immense value in both appearance and function. In terms of appearance, their resemblance to humans makes them more acceptable to humans, facilitating their integration into human society. Functionally, like humans, humanoid robots have upper limbs capable of manipulation and lower limbs capable of movement. Specifically, their leg structure allows them to traverse complex terrain like humans, but this also presents a significant disadvantage: they cannot move as smoothly and quickly as wheeled machines. Therefore, improving the speed of humanoid robots has been a long-standing research topic. To enhance their speed, compared to developing complex movement patterns like running and jumping, a simple and direct approach is to enable them to use human transportation, similar to humans. This improves both their speed and human-like appearance, contributing to the development of humanoid robots in both function and human cognition.
[0064] In existing technologies, researchers have proposed a feedback control strategy for bipedal robots to stand and walk based on virtual constraints and gait libraries, and used this strategy to enable the robot to ride a self-balancing scooter. However, this strategy is not specifically designed for the application scenario of bipedal robots riding self-balancing scooters. Therefore, in the self-balancing scooter experiments, only the need to adjust the robot's center of gravity was mentioned, but no relevant control method was provided. For this reason, the stability of the robot riding the self-balancing scooter is not its primary focus. This method is difficult to meet the control requirements of different road conditions and robot postures. When the self-balancing scooter is traveling too fast or encounters uneven road surfaces, the robot will fall off the scooter.
[0065] Currently, there is no effective control strategy for the application scenario of robots riding self-balancing scooters. Generally speaking, linear controllers are often the most commonly used control method for a controlled system. These include model-based linear controllers, such as traditional linear quadratic regulators (LQRs) and model predictive control (MPC), as well as model-free controllers, such as traditional proportional-integrative-derivative (PID) controllers. However, in the application scenario of robots riding self-balancing scooters, when the system dynamically changes, these existing controllers cannot achieve their optimal performance and exhibit poor stability.
[0066] Taking model-based linear control methods as an example, the controlled system can be expressed as the following form of the continuous-time system space state equation:
[0067]
[0068] Where x is the system's state variable, and u is the system's input (e.g., the total torque of the motor). If the above model is known and accurate, optimal control can be achieved using LQR, and the method can be summarized as follows:
[0069] The cost function is defined as shown in equation (2).
[0070]
[0071] Where Q is a positive semi-definite matrix, and It is observable; R is a positive definite matrix. Equation (2) can be solved by solving the following Algebraic Riccati Equation (ARE):
[0072]
[0073] However, solving equation (3) requires an accurate dynamic model from equation (1). Due to the complex mechanical structure of bipedal humanoid robots, it is difficult to establish an accurate model for the overall system balance problem of a robot driving a self-balancing vehicle. Therefore, the accurate values of A and B in equation (1) are difficult to obtain. Consequently, the LQR controller cannot be obtained by solving equation (3). Even if an accurate model can be established for a certain state and a balance controller can be obtained using the LQR algorithm, the robot's dynamics will change accordingly when the robot's body posture changes (such as when the robot squats) or the load changes (such as when the robot is holding a heavy object). If the traditional LQR method is used, the original controller cannot achieve the optimal control effect after the model changes, resulting in poor stability.
[0074] Furthermore, the target system itself is a nonlinear system, and the above method is an optimal controller designed by approximating the system as a linear system when the robot's tilt angle is small. Since the modeling process of linearizing a nonlinear system leads to the loss of some dynamic characteristics, using a linear controller for a nonlinear system may also result in a reduction of the system's stability region.
[0075] For nonlinear systems, this application provides a model-free, data-driven, policy iteration-based adaptive dynamic programming (PI-ADP) technique. This technique does not rely on a precise dynamic model of the robot system. Given an existing initial stable controller, the parameters of the controller can be iteratively optimized by acquiring online data. Even if the system dynamics change, an optimized controller that adapts to the changes can be iterated to achieve control, effectively improving the stability of the system.
[0076] Figure 1 The diagram shown is a schematic diagram of the target system for which this application embodiment is applied. The target system includes a robot and a self-balancing scooter ridden by the robot.
[0077] The robot in this embodiment can be any bipedal robot, with its leg joints being drive joints, and its upper body does not necessarily have to be humanoid in design. The self-balancing scooter in this embodiment can be any two-wheeled system platform with an open interface for both wheel speed and torque (capable of reading wheel speed and inputting wheel torque). Since the self-balancing scooter in this embodiment, compared to commercially available self-balancing scooter products, does not have a built-in balancing algorithm and is merely a two-wheeled system platform that can control its two wheels, it cannot strictly be called a self-balancing scooter. However, due to common perception, this embodiment refers to this two-wheeled system platform as a self-balancing scooter.
[0078] Figure 2 The diagram shows a simplified system model of a robot riding a self-balancing scooter. The first link above the wheels represents the robot's legs, and the second link represents its upper body. Except for the motors on the self-balancing wheels and the motors at the pitch joints of the humanoid robot's thighs, all other motors are fixed at a certain angle using position modes. In this embodiment, to achieve system balance, the motor torque τ1 of the self-balancing wheels and the motor torque τ2 of the pitch joints at the humanoid robot's thighs can be selected as control variables. The system's state variables can be defined as the equivalent tilt angle θ1 of the robot's legs and the corresponding angular velocity. The equivalent tilt angle θ2 of the robot's upper body and the corresponding And the linear velocity of the self-balancing scooter
[0079] The control objective of this application embodiment is to converge the tilt angles θ1 and θ2 to an equilibrium state (when the system is in this state, θ1 and θ2 are equal). i =0, i = 1, 2), and simultaneously increase the speed of the self-balancing scooter Keep up with the expected speed Therefore, for the linear model (1), its state variable x can be written as:
[0080]
[0081] The input quantity (i.e., control torque) u can be written as:
[0082]
[0083] It is emphasized again here that formula (1) is the linearized model of the system, while the method in the embodiments of this application does not require linearization of the system, nor does it require a model of the system.
[0084] In the nonlinear PI-ADP algorithm provided in this application embodiment, the nonlinear model of the target system can be defined as follows:
[0085]
[0086] Where, f: and g: Both sets of mappings satisfy the Lipschitz continuity condition and are in equilibrium at f(0) = 0. This nonlinear model is a unified representation of nonlinear affine systems and is not a specific expression for the target system. Furthermore, f(x) and g(x) in this model are unknown. For the target system, only the forms of the state variables x and the input u are known, therefore n = 5, m = 2.
[0087] The task of the control strategy designed in this embodiment is to design a control input u such that the loss function shown in equation (5) is minimized. The loss function is defined as:
[0088]
[0089] x(0)=x0 (5)where, r(x,u)=q(x)+u T R(x)u and q(x) are positive definite functions, and R(x) is a positive definite matrix.
[0090] Assuming the feedback control strategy u0 exists, inputting the system model (4), the new system can be asymptotically stable and the loss function (5) can satisfy its bounded requirements.
[0091] The Hamilton-Jacobian-Bellman (HJB) equation is given: there exists a V * ∈P, such that equation (6) holds.
[0092]
[0093] in,
[0094]
[0095]
[0096] In formula (7), V is a Lyapunov equation defined with respect to x, which represents the trajectory loss function result after taking arbitrary control strategy u as input from the current initial state x. * (x) expresses the optimal control strategy u * The result of the optimal loss function for the current initial state.
[0097] The solution V of the above equation * Its optimal control strategy at this time u * The correspondence is:
[0098]
[0099] V * The definition can be expressed as:
[0100]
[0101] The HJB equation under linear conditions is the Algebraic Riccati Equation (ARE) used in the LQR problem. The main difference between the two lies in whether the system has time-varying or nonlinear characteristics. The Algebraic Riccati Equation can be considered a special case of the generalization of the HJB equation.
[0102] Applying the input u0 of the stabilizing controller and the noise signal β to the original system formula (4), we can obtain:
[0103]
[0104] Rewrite variable v i =u0-u i +β, we get:
[0105]
[0106] Differentiating V and substituting it into formula (12), we get...
[0107]
[0108] By simultaneously integrating over time [t, t+T] on both sides and eliminating the model parameters, we obtain:
[0109]
[0110] It can be seen that the existing u i As input, V can already be obtained. i and u i+1 .
[0111] However, the above expressions are all strongly nonlinear functions related to the original system functions f and g, and cannot be calculated using linear relationships under linear methods. Therefore, it is necessary to use a combination of linearly independent basis functions that converge to zero to express them. The domain of the mapping is given below. Define the evaluation function V and the set of basis functions as Φ. j : The set of basis functions for the other input policy function u is Ψ. j : The two functions are expressed as:
[0112]
[0113]
[0114] Where N1>0 and N2>0 are two sufficiently large integers. Let represent the constant weights of each term in the two basis functions. Solving the actual expression of the function is the process of solving for the basis functions, which is actually solving for the values of the corresponding weights of the basis functions. Substituting the basis function expressions of formulas (14) and (15) into formula (13) yields the new iterative solution equation (16):
[0115]
[0116] in, and This represents a time series, with an upper bound of infinity, where the total number of samples is represented. This leads to a contradictory system of equations, e i,k This represents the deviation between the measured value and the actual value. The goal is to minimize the sum of the squares of this deviation. At this point, the problem becomes a quadratic linear regression problem, which can be solved directly by left division.
[0117] Based on the above, one embodiment of the robot control method for riding a self-balancing scooter in this application may include, as follows: Figure 3 The process shown:
[0118] Step S301: Control the target system based on the initial controller, and obtain the online state variables and online control torque of the target system during the control process.
[0119] In the embodiments of this application, the feasible region can be determined. An initial controller u0 is selected based on the actual situation. Then, a control input u(t) = u0(t) + β(t) with noise β(t) signal can be applied, and the actual state variables and control torque are collected and recorded as online state variables and online control torque, respectively.
[0120] Step S302: Iteratively optimize the weights of the first basis function set and the second basis function set corresponding to the initial controller based on the online state variables and online control torque, to obtain the optimized weights of the first basis function set and the optimized weights of the second basis function set.
[0121] In this embodiment, the online state variables and online control torque can be substituted into a preset iterative solution equation (i.e., equation (16)) to obtain the updated first basis function set weights. and updated weights of the second basis function set Then, based on the updated first basis function set weights and the current first basis function set weights Determine whether the preset iteration stopping condition is met. Specifically, the updated weights of the first basis function set and the current weights of the first basis function set can be subtracted to obtain the weight difference. Then, the sum of squares of the weight differences is calculated, and the iteration stopping condition is determined based on the sum of squares of the weight differences. If the sum of squares of the weight differences is less than or equal to the preset iteration stopping threshold (denoted as ∈1), i.e. If the sum of the squares of the weight differences is greater than the iteration stopping threshold, then the iteration stopping condition is not met.
[0122] If the iteration stopping condition is not met, the next round of iteration optimization continues; if the iteration stopping condition is met, the iteration optimization stops, and the updated first basis function set weights are determined as the optimized first basis function set weights, and the updated second basis function set weights are determined as the optimized second basis function set weights.
[0123] Step S303: Determine the optimized controller based on the optimized weights of the first basis function set and the optimized weights of the second basis function set, and control the target system based on the optimized controller.
[0124] In this embodiment, when the iteration stopping condition is met, the noise in the original exploration process can be terminated, and the optimized controller is determined based on the optimized weights of the first basis function set and the optimized weights of the second basis function set.
[0125] When controlling the target system based on the optimized controller, the current state variables of the target system can be obtained. Then, the optimized controller is used to process the current state variables to obtain the desired control torque of the target system, and the target system is controlled according to the desired control torque. The desired control torque includes a first control torque and a second control torque. The first control torque is the torque τ1 used to control the self-balancing vehicle, and the second control torque is the torque τ2 used to control the robot.
[0126] exist Figure 2 In the simplified system model shown, it is assumed that the robot's feet are rigidly connected to the surface of the self-balancing scooter and that no relative motion occurs. However, in reality, the robot is merely standing on the surface of the self-balancing scooter and is not rigidly connected to it. Therefore, in order to ensure that the robot does not slip off the self-balancing scooter, that is, to ensure that there is no relative motion between the robot's feet and the surface of the self-balancing scooter, the force exerted by the surface of the self-balancing scooter on the robot's feet needs to satisfy a preset friction cone constraint condition.
[0127] The friction cone constraint condition is the target horizontal force F. TTarget vertical force F N The constraint relationship between the target friction coefficient μ and the target horizontal force (the horizontal force exerted by the surface of the balancing vehicle on the robot's feet), the target vertical force (the vertical force exerted by the surface of the balancing vehicle on the robot's feet), and the target friction coefficient (the coefficient of friction between the surface of the balancing vehicle and the robot's feet) should satisfy the following relationship:
[0128]
[0129] Taking a robot with an overall mass of 70 kg, whose feet are made of rubber and the balance bike frame is made of plastic, as an example, the static friction coefficient between the two can reach 0.6 to 1.0, which can satisfy the friction cone constraint of the contact surface in most cases. When the robot moves to a state that does not satisfy the friction cone constraint, the state variable is changed by adjusting the motor torque τ2 of the pitch joint at the robot's thigh in the input quantity, so that the robot returns to the posture that satisfies the friction cone constraint.
[0130] Figure 4 The diagram shows the control framework of the target system. As shown, the equivalent tilt angle θ1 and corresponding angular velocity of the robot's leg can be determined through state estimation. The equivalent tilt angle θ2 of the robot's upper body and the corresponding And the linear velocity (actual speed) of the self-balancing scooter. The system's state variables can be used to calculate the desired velocity. and The difference between the states, under the friction cone constraint, is used to obtain the motor torque τ1 of the balancing wheel and the motor torque τ2 of the pitch joint at the humanoid robot's thigh, based on these state variables and the optimized controller determined by the nonlinear PI-ADP algorithm. The robot's motion is then controlled according to these control torques.
[0131] In summary, this application embodiment controls the target system based on an initial controller and acquires the online state variables and online control torque of the target system during the control process. The target system includes a robot and a self-balancing scooter ridden by the robot. The weights of the first and second basis function sets corresponding to the initial controller are iteratively optimized based on the online state variables and online control torque to obtain optimized weights for the first and second basis function sets. An optimized controller is determined based on these optimized weights, and the target system is controlled based on the optimized controller. Through this application embodiment, the controller parameters can be continuously iteratively optimized by acquiring online data. Even if the system dynamically changes, an optimized controller adapted to iterative changes can be generated for control, effectively improving system stability.
[0132] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0133] Corresponding to the robot control method for riding a self-balancing scooter described in the above embodiments, Figure 5 This illustration shows a structural diagram of one embodiment of a robot control device for riding a self-balancing scooter provided in this application.
[0134] In this embodiment, a robot control device for riding a self-balancing scooter may include:
[0135] The online data acquisition module 501 is used to control the target system based on the initial controller and acquire the online state variables and online control torque of the target system during the control process; wherein, the target system includes a robot and a self-balancing scooter ridden by the robot;
[0136] The iterative optimization module 502 is used to iteratively optimize the weights of the first basis function set and the weights of the second basis function set corresponding to the initial controller based on the online state variables and the online control torque, so as to obtain the optimized weights of the first basis function set and the optimized weights of the second basis function set.
[0137] The system control module 503 is used to determine an optimized controller based on the optimized first basis function set weights and the optimized second basis function set weights, and to control the target system based on the optimized controller.
[0138] In one specific implementation of this application embodiment, the iterative optimization module may include:
[0139] The equation solving submodule is used to substitute the online state variables and the online control torque into the preset iterative solution equation to obtain the updated first basis function set weights and the updated second basis function set weights;
[0140] The iteration stopping condition judgment submodule is used to determine whether the preset iteration stopping condition is met based on the updated first basis function set weights and the current first basis function set weights;
[0141] The iteration stop condition judgment and post-processing module is used to continue the next round of iteration optimization if the iteration stop condition is not met; if the iteration stop condition is met, the iteration optimization is stopped, and the updated first basis function set weights are determined as the optimized first basis function set weights, and the updated second basis function set weights are determined as the optimized second basis function set weights.
[0142] In one specific implementation of this application embodiment, the iteration stop condition determination submodule may include:
[0143] The weight difference calculation unit is used to subtract the updated weights of the first basis function set from the current weights of the first basis function set to obtain the weight difference.
[0144] A sum-of-squares calculation unit is used to calculate the sum of squares of the weight differences;
[0145] The iteration stopping condition determination unit is used to determine whether the iteration stopping condition is met based on the sum of squares of the weight differences.
[0146] In one specific implementation of this application, the iteration stop condition determination unit can be specifically used to: determine that the iteration stop condition is met if the sum of squares of the weight differences is less than or equal to a preset iteration stop threshold; and determine that the iteration stop condition is not met if the sum of squares of the weight differences is greater than the iteration stop threshold.
[0147] In one specific implementation of this application, the iterative optimization module may be used to: obtain the current state variable of the target system; process the current state variable using the optimized controller to obtain the desired control torque of the target system; and control the target system according to the desired control torque.
[0148] In one specific implementation of this application, the desired control torque may include a first control torque and a second control torque; wherein, the first control torque is the torque for controlling the self-balancing vehicle, and the second control torque is the torque for controlling the robot.
[0149] In one specific implementation of this application embodiment, the system control module can be specifically used to: control the target system based on the optimized controller under preset friction cone constraint conditions;
[0150] The friction cone constraint condition is the constraint relationship between the target horizontal force, the target vertical force, and the target friction coefficient. The target horizontal force is the horizontal force exerted by the surface of the balancing vehicle on the sole of the robot's foot. The target vertical force is the vertical force exerted by the surface of the balancing vehicle on the sole of the robot's foot. The target friction coefficient is the friction coefficient between the surface of the balancing vehicle and the sole of the robot's foot.
[0151] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0152] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0153] Figure 6 A schematic block diagram of a robot provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0154] like Figure 6 As shown, the robot 6 in this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60. When the processor 60 executes the computer program 62, it implements the steps in the various embodiments of the robot control method for riding a self-balancing scooter described above, for example... Figure 1 Steps S301 to S303 are shown. Alternatively, when the processor 60 executes the computer program 62, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 5 The functions of modules 501 to 503 are shown.
[0155] For example, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 62 in the robot 6.
[0156] Those skilled in the art will understand that Figure 6 This is merely an example of robot 6 and does not constitute a limitation on robot 6. It may include more or fewer parts than shown, or combine certain parts, or different parts. For example, robot 6 may also include input / output devices, network access devices, buses, etc.
[0157] The processor 60 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0158] The memory 61 can be an internal storage unit of the robot 6, such as a hard drive or memory. The memory 61 can also be an external storage device of the robot 6, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 61 can include both internal and external storage units of the robot 6. The memory 61 is used to store the computer program and other programs and data required by the robot 6. The memory 61 can also be used to temporarily store data that has been output or will be output.
[0159] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0160] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0161] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0162] In the embodiments provided in this application, it should be understood that the disclosed devices / robots and methods can be implemented in other ways. For example, the device / robot embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0163] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0164] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0165] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.
[0166] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A control method for a robot riding a self-balancing scooter, characterized in that, include: The target system is controlled based on the initial controller, and the online state variables and online control torque of the target system are obtained during the control process; wherein, the target system includes a robot and a self-balancing scooter ridden by the robot, the robot is a bipedal robot, the self-balancing scooter has open interfaces for dual wheel speed and torque, and the robot stands on the self-balancing scooter; Based on the online state variables and the online control torque, the weights of the first basis function set and the weights of the second basis function set corresponding to the initial controller are iteratively optimized to obtain the optimized weights of the first basis function set and the optimized weights of the second basis function set; wherein, the first basis function set is the basis function set of the controller's evaluation function, the second basis function set is the basis function set of the controller's input policy function, the weights of the first basis function set are the weights of each item in the first basis function set, and the weights of the second basis function set are the weights of each item in the second basis function set; An optimized controller is determined based on the optimized weights of the first and second basis function sets, and the target system is controlled based on the optimized controller under preset friction cone constraints. The friction cone constraints are the constraint relationships between the target horizontal force, the target vertical force, and the target friction coefficient. The target horizontal force is the horizontal force exerted by the surface of the balancing vehicle on the soles of the robot's feet; the target vertical force is the vertical force exerted by the surface of the balancing vehicle on the soles of the robot's feet; and the target friction coefficient is the friction coefficient between the surface of the balancing vehicle and the soles of the robot's feet.
2. The robot control method for riding a self-balancing scooter according to claim 1, characterized in that, The step of iteratively optimizing the weights of the first and second basis function sets corresponding to the initial controller based on the online state variables and the online control torque to obtain optimized weights of the first and second basis function sets includes: Substitute the online state variables and the online control torque into the preset iterative solution equation to obtain the updated first basis function set weights and the updated second basis function set weights; Determine whether the preset iteration stopping condition is met based on the updated weights of the first basis function set and the current weights of the first basis function set; If the iteration stopping condition is not met, the next round of iteration optimization will continue. If the iteration stopping condition is met, the iteration optimization is stopped, and the updated first basis function set weights are determined as the optimized first basis function set weights, and the updated second basis function set weights are determined as the optimized second basis function set weights.
3. The robot control method for riding a self-balancing scooter according to claim 2, characterized in that, The step of determining whether the preset iteration stopping condition is met based on the updated first basis function set weights and the current first basis function set weights includes: The weight difference is obtained by subtracting the updated weights of the first basis function set from the current weights of the first basis function set. Calculate the sum of squares of the weighted differences; The iteration stopping condition is determined based on the sum of the squares of the weight differences.
4. The robot control method for riding a self-balancing scooter according to claim 3, characterized in that, The step of determining whether the iteration stopping condition is met based on the sum of squares of the weight differences includes: If the sum of squares of the weight differences is less than or equal to the preset iteration stopping threshold, then the iteration stopping condition is determined to be met. If the sum of the squares of the weight differences is greater than the iteration stopping threshold, then the iteration stopping condition is not met.
5. The robot control method for riding a self-balancing scooter according to claim 1, characterized in that, The control of the target system based on the optimized controller includes: Obtain the current state variables of the target system; The optimized controller is used to process the current state variables to obtain the desired control torque of the target system; The target system is controlled according to the desired control torque.
6. The robot control method for riding a self-balancing scooter according to claim 5, characterized in that, The desired control torque includes a first control torque and a second control torque; Wherein, the first control torque is the torque used to control the self-balancing vehicle, and the second control torque is the torque used to control the robot.
7. A robot control device for riding a self-balancing scooter, characterized in that, include: An online data acquisition module is used to control the target system based on an initial controller and acquire the online state variables and online control torque of the target system during the control process; wherein, the target system includes a robot and a self-balancing scooter ridden by the robot, the robot is a bipedal robot, the self-balancing scooter has open interfaces for dual wheel speed and torque, and the robot stands on the self-balancing scooter; The iterative optimization module is used to iteratively optimize the weights of the first basis function set and the second basis function set corresponding to the initial controller based on the online state variables and the online control torque, to obtain the optimized weights of the first basis function set and the optimized weights of the second basis function set; wherein, the first basis function set is the basis function set of the controller's evaluation function, the second basis function set is the basis function set of the controller's input policy function, the weights of the first basis function set are the weights of each item in the first basis function set, and the weights of the second basis function set are the weights of each item in the second basis function set; The system control module is used to determine an optimized controller based on the optimized first basis function set weights and the optimized second basis function set weights, and to control the target system based on the optimized controller under preset friction cone constraints; wherein, the friction cone constraints are the constraint relationship between the target horizontal force, the target vertical force and the target friction coefficient, the target horizontal force is the horizontal force exerted by the surface of the balancing vehicle on the sole of the robot's foot, the target vertical force is the vertical force exerted by the surface of the balancing vehicle on the sole of the robot's foot, and the target friction coefficient is the friction coefficient between the surface of the balancing vehicle and the sole of the robot's foot.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the robot control method for riding a self-balancing scooter as described in any one of claims 1 to 6.
9. A robot comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the robot control method for riding a self-balancing scooter as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Wheel type biped robot attitude control method
CN113485398A