Bayesian inference based robot collision detection method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU INNOVATION RES INST OF BEIJING UNIV OF AERONAUTICS & ASTRONAUTICS
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-09
AI Technical Summary
Existing collision detection methods for robotic arms suffer from insufficient sensitivity and high false alarm rates, especially in the absence of sensors, making it difficult to accurately identify external contact and collision events.
Based on Bayesian inference, a generalized momentum model is constructed and an integrated Bayesian neural network is used to perform probabilistic inference of unknown dynamic terms, generating the predicted mean and predicted variance. An adaptive momentum observer is then constructed and collision detection is performed in conjunction with sparse Bayesian inference.
It improves the accuracy of external torque estimation and collision detection sensitivity, reduces the false alarm rate, and achieves high-precision detection and safe response to external contact disturbances.
Smart Images

Figure CN122165490A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of robot safety perception and human-computer interaction, and more specifically, to a collision detection method and system for robotic arms based on Bayesian inference. Background Technology
[0002] Collaborative robotic arms are increasingly used in industrial production and service sectors due to their high safety and compliant interaction capabilities. In these applications, robotic arms often need to share workspaces with operators or perform various tasks in complex environments, thus requiring real-time perception and accurate identification of external contact and collision events. However, since industrial robotic arms are typically not equipped with joint torque sensors, direct measurement of external forces is difficult. Therefore, developing accurate and reliable sensorless methods for estimating external torques and detecting collisions has become a key requirement for achieving safe interaction in collaborative robotic arms.
[0003] Traditional sensorless methods for estimating external torque typically design momentum observers based on rigid body dynamics models. However, in practical applications, complex physical phenomena such as friction in robotic arms are difficult to model accurately, significantly affecting the accuracy of torque estimation. Some improved methods attempt to introduce data models to compensate for unknown dynamic characteristics; however, due to the inevitable noise in actual training data and the difficulty in achieving complete coverage of the input space, learning errors objectively exist. Existing data-driven momentum observers still have significant shortcomings in suppressing learning error interference. Furthermore, the gain design of current momentum observers is difficult to balance estimation sensitivity and noise robustness in engineering practice: higher observation gain tends to amplify measurement noise, while lower observation gain weakens the sensitivity to changes in external torque. In addition, collision events in robotic arms occur infrequently in real industrial scenarios, exhibiting obvious sparsity characteristics. Existing methods often rely on empirical thresholds for judgment, failing to fully utilize this characteristic and easily leading to problems such as insufficient collision detection sensitivity or high false alarm rates. Summary of the Invention
[0004] The purpose of this invention is to provide a collision detection method and system for robotic arms based on Bayesian inference, so as to alleviate the technical problems of insufficient collision detection sensitivity and high false alarm rate in the prior art.
[0005] In a first aspect, embodiments of the present invention provide a collision detection method for a robotic arm based on Bayesian inference. The method includes: constructing a generalized momentum model containing unknown dynamic terms and external joint torques based on a joint space dynamics model of the robotic arm; performing probabilistic inference on the unknown dynamic terms using an integrated Bayesian neural network, and outputting the predicted mean and predicted variance of the unknown dynamic terms; constructing a data-driven adaptive momentum observer based on the predicted mean and predicted variance; using the adaptive momentum observer to generate an estimated signal of the external joint torques; and performing collision detection based on sparse Bayesian inference on the estimated signal of the external joint torques based on the sparsity characteristics of the external collision perturbation, generating a collision determination signal.
[0006] In some optional implementations, before constructing the generalized momentum model, the method further includes: constructing an n-degree-of-freedom manipulator dynamic model based on the Euler-Lagrange equations; constructing a generalized momentum model based on the aforementioned manipulator dynamic model and a predefined generalized momentum; the expression for the aforementioned manipulator dynamic model is: ; Where q represents the joint position in generalized coordinates. Indicates joint velocity. M(q) represents joint acceleration; M(q) represents the inertia matrix. Let g(q) denote the Coriolis matrix, and g(q) denote the gravity vector. This represents the unknown dynamic terms in the dynamics of the robotic arm; This indicates the driving torque of the joint motor. This represents the external joint torque; the predefined generalized momentum is: The expression for the above generalized momentum model is: .
[0007] In some optional implementations, the step of using an integrated Bayesian neural network to perform probabilistic inference on the aforementioned unknown dynamics term includes: constructing a training dataset based on joint positions and joint velocities collected during the operation of the robotic arm as input data and the dynamic residuals at corresponding times as labels; inputting the training dataset into multiple Bayesian neural networks that have been randomly initialized and trained independently, with each of the aforementioned Bayesian neural networks employing a loss function based on maximum a posteriori estimation to obtain local minimum solutions for the neural network parameters; based on the aforementioned local minimum solutions, inferring the prediction distribution through Monte Carlo sampling to generate the predicted mean and predicted variance of the aforementioned unknown dynamics term; wherein the aforementioned predicted mean is used to characterize the optimal estimation result of the unknown dynamics term, and the aforementioned predicted variance is used to quantify the uncertainty of the aforementioned estimation result.
[0008] In some optional implementations, the predicted mean is used to compensate for the unknown dynamics term; the predicted variance is used to dynamically adjust the observation gain matrix of the adaptive momentum observer; the method further includes: the adaptive momentum observer generates the estimated signal of the external joint torque based on the generalized momentum model, the predicted mean, and the dynamically adjusted observation gain matrix.
[0009] In some optional implementations, the observation gain matrix is a non-negative and non-increasing diagonal matrix with respect to the prediction variance. Each diagonal element of the diagonal matrix is obtained by mapping the prediction variance of the corresponding joint through a nonlinear function. The nonlinear function satisfies the monotonically decreasing property and has preset upper and lower limits.
[0010] In some optional implementations, collision detection based on sparse Bayesian inference is performed on the estimated signal of the external joint torque based on the sparsity characteristics of the external collision perturbation. This includes: constructing a probabilistic model of the collision marker variable based on the sparsity distribution characteristics of the collision event in the time and joint dimensions; calculating the posterior probability of the collision marker variable using the Bayesian formula based on the probabilistic model and the estimated signal of the external joint torque; and determining the collision state inference result based on the maximum a posteriori estimate.
[0011] In some optional implementations, generating the collision determination signal includes: calculating the log-posterior ratio based on the posterior probability and comparing the log-posterior ratio with a preset threshold; outputting the collision determination signal when the log-posterior ratio is greater than the preset threshold; and outputting a no-collision determination signal when the log-posterior ratio is not greater than the preset threshold.
[0012] Secondly, embodiments of the present invention provide a collision detection system for a robotic arm based on Bayesian inference. The system includes: a model construction module for constructing a generalized momentum model containing unknown dynamic terms and external joint torques based on a robotic arm joint spatial dynamics model; a probabilistic inference module for performing probabilistic inference on the unknown dynamic terms using an integrated Bayesian neural network, outputting the predicted mean and predicted variance of the unknown dynamic terms; a momentum observer construction module for constructing a data-driven adaptive momentum observer based on the predicted mean and predicted variance; the adaptive momentum observer is used to generate an estimated signal of the external joint torques; and a collision detection module for performing collision detection based on sparse Bayesian inference on the estimated signal of the external joint torques based on the sparsity characteristics of external collision perturbations, generating a collision determination signal.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the steps of the method described in any of the first aspects above.
[0014] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to perform the method described in any of the first aspects above.
[0015] This invention provides a collision detection method and system for robotic arms based on Bayesian inference. The method includes: constructing a generalized momentum model containing unknown dynamic terms and external joint torques based on a joint space dynamics model of the robotic arm; performing probabilistic inference on the unknown dynamic terms using an integrated Bayesian neural network, outputting the predicted mean and variance of the unknown dynamic terms; constructing a data-driven adaptive momentum observer based on the predicted mean and variance to generate an estimated signal of the external joint torques; and performing collision detection based on sparse Bayesian inference on the estimated signal based on the sparsity characteristics of external collision perturbations to generate a collision determination signal. This method solves the technical problems of insufficient sensitivity and high false alarm rate in existing collision detection technologies, achieving improved accuracy in external torque estimation and collision detection sensitivity. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a collision detection method for a robotic arm based on Bayesian inference, provided for an embodiment of the present invention; Figure 2 A flowchart illustrating another collision detection method for a robotic arm based on Bayesian inference provided in an embodiment of the present invention; Figure 3 A schematic diagram of a collision detection principle for a robotic arm based on Bayesian inference is provided for an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Effective sensorless collision detection in human-computer interaction or unstructured environments is of significant practical importance for modern robotic arm manipulation tasks, but it still faces technical challenges. Therefore, this invention provides a robotic arm collision detection method and system based on Bayesian inference. By utilizing the uncertainty quantification capability of Bayesian inference, a data-driven adaptive momentum observer is constructed to estimate external torque. Furthermore, collision event determination is performed based on the estimated external torque results using sparse prior Bayesian inference.
[0020] To facilitate understanding of this embodiment, a Bayesian inference-based collision detection method for robotic arms disclosed in this invention will first be described in detail. This method can be applied to a corresponding Bayesian inference-based robotic arm collision detection system, which may include multiple modules configured to execute the above-described collision detection method, such as: a model building module, a probability inference module, a momentum observer building module, and a collision detection module (the functions of each module will be described in detail in subsequent system embodiments, and will not be repeated here).
[0021] See Figure 1 The diagram shows a flowchart of a collision detection method for a robotic arm based on Bayesian inference. This method can be executed by an electronic device and mainly includes the following steps S102 to S108: Step S102: Based on the joint space dynamics model of the robotic arm, construct a generalized momentum model that includes unknown dynamic terms and external joint torques.
[0022] In one embodiment, before the step of constructing the generalized momentum model in step S102 above, the method may further include: firstly constructing an n-degree-of-freedom manipulator dynamic model based on the Euler-Lagrange equations; and then constructing a generalized momentum model based on the manipulator dynamic model and a predefined generalized momentum.
[0023] Preferably, the expression for the above-mentioned robotic arm dynamics model is: ; Where q represents the joint position in generalized coordinates. Indicates joint velocity. M(q) represents joint acceleration; M(q) represents the inertia matrix. Let g(q) denote the Coriolis matrix, and g(q) denote the gravity vector. This represents the unknown dynamic terms in the dynamics of the robotic arm; This indicates the driving torque of the joint motor. This indicates the external joint torque (or unknown external joint torque).
[0024] Specifically, The unknown dynamics term is used to characterize physical effects in the dynamics of the robotic arm that are difficult to model accurately, including but not limited to: joint friction, viscous drag, Coulomb friction, residual dynamics caused by flexibility, system nonlinearity, and unmodeled dynamic effects related to the configuration of the robotic arm.
[0025] The preferred, predefined generalized momentum is: The generalized momentum model containing complex physical properties (i.e., unknown dynamic terms) and unknown joint external torques (i.e., external joint torques) is expressed as follows: ; The parameters in the formula have the same meaning as the corresponding parameters in the expression of the above robotic arm dynamics model, and will not be repeated here.
[0026] Step S104: Use an integrated Bayesian neural network to perform probabilistic inference on the unknown dynamics term and output the predicted mean and predicted variance of the unknown dynamics term.
[0027] In one embodiment, the step of using an integrated Bayesian neural network to perform probabilistic inference of unknown dynamic terms in step S104 above may include: First, a training dataset is constructed based on the joint positions and joint velocities collected during the operation of the robotic arm as input data and the dynamic residuals at the corresponding time points as labels. Then, the training dataset is input into multiple Bayesian neural networks that have been randomly initialized and trained independently. Each Bayesian neural network uses a loss function based on maximum a posteriori estimation to obtain local minimum solutions for the neural network parameters. Based on the local minimum solution, the predicted distribution is inferred through Monte Carlo sampling to generate the predicted mean and predicted variance of the unknown dynamic term. The predicted mean can be used to characterize the optimal estimation result of the unknown dynamic term, and the predicted variance can be used to quantify the uncertainty of the estimation result.
[0028] Preferably, the loss function described above can be a weighted sum of a weighted squared error term and a Gaussian prior term for the network parameters. The weight matrix of the weighted squared error term can be the inverse of the variance matrix of the training data output noise, and the prior variance of the Gaussian prior term can be a preset constant. The predicted mean can be determined by the arithmetic mean of the outputs of multiple Bayesian neural networks, and the predicted variance can be determined by the sum of the variances of the mean variances of the outputs of each network and the variances of the output mean. The predicted variance is a diagonal matrix, where each diagonal element represents the degree of uncertainty in the estimation of the unknown dynamics term at the corresponding joint degree of freedom.
[0029] Specifically, the unknown dynamics term can be expressed as a function of joint position and velocity, i.e.: .
[0030] Furthermore, a training dataset can be constructed by collecting observational data related to unknown dynamics during the operation of the robotic arm: And x(i) is used as the input data of the network. As output data of the network.
[0031] in, This represents independent and identically distributed Gaussian noise with a mean of 0 and a variance denoted as: ,diag(·,·,·) represents a diagonal matrix with ·,·,· as diagonal elements.
[0032] Within the Bayesian inference framework, the neural network parameter θ is treated as a random variable, and a zero-mean Gaussian prior distribution is introduced to it. ,in Several existing strategies exist for selecting the prior variance, which will not be elaborated here. Given a training dataset... Under the given conditions, the posterior distribution of the network parameters is expressed as: .
[0033] Since the aforementioned posterior distribution is difficult to solve analytically, it can be approximated using a method based on maximum a posteriori estimation. Specifically, the local maximum a posteriori solution of the parameters is obtained by minimizing the following loss function: ; in, The output noise variance matrix of the aforementioned training dataset, Let θ be the prior variance of the aforementioned neural network parameter, and let the weighted square norm be denoted as θ. A is the corresponding weight matrix.
[0034] By minimizing the loss function based on maximum a posteriori estimation under different random initialization conditions using the stochastic gradient descent algorithm, and independently training multiple neural network models, a set of parameter estimation results can be obtained. ,Right now: ; Multiple local minima are obtained by training the loss function based on the maximum a posteriori estimation. It can be viewed as the posterior distribution of network parameters. The different modal implementations can therefore serve as approximate samples of the posterior distribution of network parameters.
[0035] Furthermore, the predicted distribution of interest can be written as: ; Therefore, it can be utilized The Monte Carlo integral is used as a sample to approximate the predicted distribution. Since we are interested in the predicted mean and predicted variance, we have the predicted mean:
[0036] And prediction variance:
[0037] The prediction variance is a diagonal matrix, and each diagonal element is given by the following formula: .
[0038] By following the steps above, the predicted mean of the unknown dynamic term can be obtained. and prediction variance The predicted mean is used to compensate for the unknown dynamics term, and the predicted variance is used to quantify the uncertainty and provide a basis for the subsequent design of a data-driven adaptive momentum observer.
[0039] Unlike most neural networks that output only deterministic estimates, this invention uses Bayesian modeling to probabilistically infer unknown dynamic terms. It quantifies the uncertainty of the estimate while providing the predicted mean (optimal estimate), thus characterizing the reliability of the prediction in a probabilistic sense. This uncertainty information, besides being instructive during model training by evaluating learning performance, is also explicitly introduced into the subsequent momentum observer design process. This allows the observer to adaptively adjust its gain under different uncertainty conditions, balancing the sensitivity and robustness of the external torque estimation.
[0040] Furthermore, traditional Bayesian neural networks are mainly based on Markov chain Monte Carlo or variational inference Bayesian methods. Markov chain Monte Carlo requires significant computational and storage overhead, while variational inference, by using a simple distribution as an approximation, often severely underestimates the uncertainties in actual neural networks. In contrast, the integrated Bayesian neural network used in this invention is simple to implement and has low computational complexity, making it more suitable for real-time momentum observation and collision detection applications in high-degree-of-freedom robotic arm systems.
[0041] Step S106: Based on the predicted mean and predicted variance, construct a data-driven adaptive momentum observer; the adaptive momentum observer is used to generate an estimated signal of the external joint torque.
[0042] Among them, the predicted mean can be used to compensate for unknown dynamic terms; the predicted variance can be used to dynamically adjust the observation gain matrix of the adaptive momentum observer, so that the gain decreases as the prediction uncertainty increases, thereby taking into account both the sensitivity and noise robustness of the external torque estimation under different modeling accuracies.
[0043] As a concrete example, the prediction variance can be used as input to construct a non-negative, non-increasing observation gain matrix in the form of a diagonal matrix with upper and lower bounds. This allows the gain to be reduced when the prediction uncertainty is high and increased when the prediction uncertainty is low, thereby balancing noise robustness and response sensitivity in the external moment estimation process.
[0044] In one embodiment, the above method may further include: an adaptive momentum observer generating an estimated signal of external joint torque based on a generalized momentum model, a predicted mean, and a dynamically adjusted observation gain matrix.
[0045] Preferably, the observation gain matrix is a non-negative and non-increasing diagonal matrix with respect to the prediction variance. Each diagonal element of the diagonal matrix is obtained by mapping the prediction variance of the corresponding joint through a nonlinear function. The nonlinear function satisfies the monotonically decreasing property and has preset upper and lower limits.
[0046] In this embodiment, a data-driven adaptive momentum observer is constructed based on the predicted mean and predicted variance of the unknown dynamics term obtained in step S104, thereby realizing online estimation of external joint torque.
[0047]
[0048] in, For generalized momentum The estimated value, r The observer output serves as an estimate of the external joint torques. K O For momentum observer gain, and These are the predicted mean and predicted variance of the unknown dynamics term obtained from Bayesian inference in step S2, respectively.
[0049] In the aforementioned momentum observer, the predicted mean can be used. The unknown dynamics term is compensated to reduce its impact on the estimation of external joint torques; simultaneously, based on the prediction variance... Constructing an observation gain matrix that adapts to uncertainty .
[0050] In particular, unlike existing methods, the above observation gain matrix Let be a non-negative, non-increasing diagonal matrix with respect to the prediction variance, and with predefined upper and lower bounds, satisfying the following form:
[0051] in, and These represent the lower and upper bounds of the observation gain, respectively.
[0052] In one specific embodiment, the above-mentioned observation gain matrix can be selected as a diagonal matrix, that is:
[0053] The observation gain corresponding to each joint It can be derived from the predicted variance Determine, for example:
[0054] in This is an adjustable parameter used to adjust the rate at which the observation gain changes with prediction uncertainty.
[0055] Typically, practical robotic arm systems do not explicitly provide a Coriolis force matrix. Instead, it provides Coriolis / centrifugal force terms. The time derivative of the inertia matrix is obtained numerically. Based on this, and and As a result, by integrating the above data-driven adaptive momentum observer, we can obtain the following more easily implemented integral expression:
[0056] This makes it easier to implement in actual robotic arm control systems.
[0057] The data-driven adaptive momentum observer structure described above can adaptively adjust the observation gain under different levels of unknown dynamic uncertainty, thereby enabling online estimation of external joint torques.
[0058] Furthermore, the aforementioned data-driven adaptive momentum observer has theoretical guarantees regarding the convergence of external torque estimation errors. Its theoretical properties are analyzed and explained below.
[0059] Based on the universal approximation property of neural networks, the prediction error of the unknown dynamic term obtained by integrating the Bayesian neural network in step S2 (i.e., the deviation between the predicted mean and the true value) is bounded within the bounded compact set of the joint states, meaning there exists a constant. , so that:
[0060] in Let be a bounded set of joint positions and velocities. This property reflects that, under conditions of limited training data and limited network capacity, the approximation error of a data-driven model for unknown dynamic terms has an upper bound.
[0061] The estimation error of the external joint torque is defined as:
[0062] Based on the generalized momentum model established in step S102 and the data-driven adaptive momentum observer expression described in step S106, a simple derivation yields the following:
[0063] Take a quadratic Lyapunov function:
[0064] Its time derivative and its upper bound can be determined by the following formula:
[0065] Further definition:
[0066] but W With Lyapunov functions V and estimation error e The following relationship exists between them:
[0067] therefore, W The upper bound of the time derivative is determined by the following formula:
[0068] By comparing the lemma, we can obtain the upper bound of the 2-norm of the tracking error:
[0069] The aforementioned tracking error 2-norm can be the Euclidean norm (i.e., L² norm) of the deviation vector between the estimated external joint torque r and the actual external joint torque.
[0070] Further definition This yields the standard definition of a final bounded exponent:
[0071] This indicates that the 2-norm exponent of the tracking error converges to a value... The convergence of the error sphere with radius denoted as is thus proven, i.e., the convergence of the data-driven adaptive momentum observer's estimation error of external torque.
[0072] Step S108: Based on the sparsity characteristics of external collision disturbances, collision detection based on sparse Bayesian inference is performed on the estimated signal of external joint torque to generate a collision determination signal.
[0073] In one embodiment, the collision detection based on sparse Bayesian inference of the estimated signal of external joint torque based on the sparsity characteristics of external collision disturbance in step S108 above may include: constructing a probabilistic model of collision marker variables based on the sparsity distribution characteristics of collision events in the time and joint dimensions; calculating the posterior probability of collision marker variables by Bayesian formula according to the probabilistic model and the estimated signal of external joint torque, and determining the collision state inference result based on the maximum a posteriori estimate.
[0074] The estimated signal of the external joint torque is the superposition of the actual collision external torque and independent, identically distributed Gaussian noise. Preferably, the collision marker variable follows a Bernoulli distribution to characterize the prior probability of a collision, and the non-zero external torque component corresponding to the collision follows a Laplace distribution to induce sparsity.
[0075] In one embodiment, the method of generating the collision determination signal in step S108 above may include: calculating the log-posterior ratio based on the posterior probability and comparing the log-posterior ratio with a preset threshold; when the log-posterior ratio is greater than the preset threshold, outputting the collision determination signal; when the log-posterior ratio is not greater than the preset threshold, outputting the no-collision determination signal.
[0076] In a specific example, the aforementioned preset threshold can be determined by the Bernoulli prior probability, the Laplace distribution scaling parameter, and the Gaussian noise variance.
[0077] The collision detection method based on sparse Bayesian inference in this embodiment is based on the following two objective facts: First, due to the unavoidable measurement noise in actual systems, the external torque estimation signal output by the data-driven adaptive momentum observer in step S106 is... r Essentially, it is the actual external joint torque. First, the noise level is high; second, collisions during actual operation of the robotic arm are low-probability events, exhibiting significant sparsity. Specifically, collision events do not occur continuously over time, exhibiting temporal sparsity; and even when collisions occur, they typically only affect some joints, exhibiting sparsity over the joint dimension.
[0078] Based on this, a noisy sparse probability model of collision variables is established. First, a binary collision flag variable is defined. ,in:
[0079] Note that in the absence of a collision s When = 0, we have In the event of a collision s When = 1, we have ,Right now Heng was established.
[0080] Based on this, the noisy sparse probability model of the collision variables is established as follows:
[0081] in, The noise term represents the random observation error contained in the external joint torque estimation signal r(t). The noise components satisfy independent and identically distributed Gaussian distributions. .
[0082] This invention models the prior of collision sparsity as a Bernoulli-Laplace distribution. Considering that collision events are low-probability events during actual operation of the robotic arm, the collision variable... s Assigning a priori conditions to the sparsity-induced Bernoulli distribution:
[0083] in, This represents the prior probability of a collision occurring, used to characterize the sparsity of collisions over time. In the case of historical data, π It can be estimated from the statistical frequency of historical collision events; in the absence of historical information, π It can also be set to a preset low probability value to reflect the low probability and sparse occurrence characteristics of collision events.
[0084] Furthermore, regarding the external moment of collision Apply a prior of independent and identically distributed Laplace distribution to each element:
[0085]
[0086] in, This is the Dirac Delta function.
[0087] Under the aforementioned noisy sparse probability model, the estimation signal is based on the observed external joint torque. r (t), for the collision flag variable s Perform Bayesian inference. Based on Bayes' theorem, the collision variables... s The posterior probability can be expressed as:
[0088] The purpose of collision detection is to estimate the external torque. r (t) for binary collision variables s The maximum a posteriori estimate is given as follows:
[0089] Define the log-posterior ratio:
[0090] Its expression can be determined by Bayes' theorem:
[0091] The log-posterior ratio can then be solved using numerical optimization or equivalent analytical threshold calculation methods. .
[0092] Based on log-posterior ratio The definitions are: if and only if hour, (The maximum a posteriori estimate of the collision) is greater than (Maximum a posteriori estimate of when a collision did not occur) is used to conclude that a collision has occurred. Therefore, the decision signal is generated by the following equation:
[0093] The above-described Bayesian inference-based robotic arm collision detection method provided in this invention addresses complex physical phenomena in robotic arm dynamics that are difficult to model accurately, such as friction, viscous drag, and configuration-related residual dynamics. It utilizes an integrated Bayesian neural network to perform probabilistic inference on unmodeled dynamics, outputting a predicted mean and a predicted variance. Based on the probabilistic inference results, an adaptive momentum observer is constructed. The predicted mean is used to compensate for unmodeled dynamics in the observer, and the predicted variance is used to characterize learning uncertainty and adaptively adjust the observer gain. Furthermore, leveraging the sparse distribution of external collision perturbations in the time and joint dimensions, a sparsity prior constraint is introduced to construct a probabilistic model for collision determination. Bayesian inference is then performed on the collision state corresponding to the external joint torque estimation signal to generate a collision determination signal.
[0094] In summary, this invention can achieve high-precision external torque estimation and high-sensitivity collision detection even in the presence of significant unmodeled dynamics and measurement noise. It has good detection capability for external contact disturbances with small amplitude and low energy, and is suitable for application scenarios such as robotic arm collision detection, human-machine collaboration, and safe interaction.
[0095] Based on the same inventive concept, this invention also provides a collision detection system for a robotic arm based on Bayesian inference, which mainly includes the following parts: The model building module is used to construct a generalized momentum model that includes unknown dynamic terms and external joint torques based on the spatial dynamics model of the robotic arm joints. The probability inference module is used to perform probabilistic inference on unknown dynamic terms using an integrated Bayesian neural network, and outputs the predicted mean and predicted variance of the unknown dynamic terms. The momentum observer building module is used to build a data-driven adaptive momentum observer based on the predicted mean and predicted variance; the adaptive momentum observer is used to generate an estimated signal of external joint torque. The collision detection module is used to perform collision detection based on sparse Bayesian inference on the estimated signal of external joint torque based on the sparsity characteristics of external collision perturbation, and generate a collision determination signal.
[0096] The Bayesian inference-based robotic arm collision detection system provided in this invention embodiment can be specific hardware on a device or software or firmware installed on the device. The system provided in this invention embodiment has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment section can be referred to the corresponding content in the aforementioned method embodiment. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.
[0097] For ease of understanding, this invention also provides an application example of a collision detection method for robotic arms based on Bayesian inference, see [link to relevant documentation]. Figure 2 The diagram shows another Bayesian inference-based robotic arm collision detection method. This method can be applied to a corresponding Bayesian inference-based robotic arm collision detection system. The collision detection system may include multiple modules configured to execute the above-described collision detection method. For example, as a specific example, the collision detection system may include: The unknown dynamics probability inference module is used to perform probability inference on unknown dynamics terms in the dynamics of the robotic arm using an integrated Bayesian neural network, and outputs the predicted mean and predicted variance. The data-driven adaptive momentum observer module is used to construct a data-driven adaptive momentum observer based on the generalized momentum model of the robotic arm and the Bayesian probability inference results. It also realizes the online estimation of external joint torque based on the predicted mean and predicted variance, and provides theoretical guarantee for the convergence of its external torque estimation error. The sparse collision detection module is used to perform sparse modeling and sparse Bayesian regression processing on the estimated signals of external joint torques, and to give a high-probability collision judgment inference under noisy estimation signals, generating a collision judgment signal.
[0098] Based on this, such as Figure 2 The collision detection method for robotic arms based on Bayesian inference shown mainly includes: First, the robotic arm in operation outputs joint position and velocity signals reflecting its own motion state, which serve as input data for the collision detection process. Then, a probabilistic inference module based on an integrated Bayesian neural network receives these joint position and velocity signals, performs probabilistic modeling and inference of the robotic arm's dynamic characteristics and motion state, and outputs the predicted mean and variance. Next, a data-driven adaptive momentum observer module receives the predicted mean and variance output from the probabilistic inference step, and, based on a data-driven adaptive momentum observation algorithm and the probabilistic inference results, estimates the external joint torques of the robotic arm, outputting the estimated values. Finally, a collision determination module based on sparse Bayesian inference receives the estimated external joint torques output from the torque estimation step, uses a sparse Bayesian inference algorithm to determine whether a collision has occurred, and outputs a collision determination signal.
[0099] After the collision determination signal is transmitted to the robotic arm, it can further trigger its own safety response mechanism (such as emergency braking, trajectory correction, etc.) to achieve active avoidance of collision risks and safety protection of the robotic arm.
[0100] To verify the effectiveness of the Bayesian inference-based robotic arm collision detection method in a real robotic arm operating system, this embodiment of the invention conducted experimental verification on a real robot platform. Specifically, this embodiment selected the Franka Emika Panda seven-DOF collaborative robotic arm as the experimental object. This robotic arm was not equipped with additional joint torque or end effector sensors, and achieved sensorless collision detection entirely based on joint position, joint velocity, and motor drive torque signals.
[0101] During the experiment, the robotic arm executes a preset end-effector trajectory on a horizontal worktable, with the end-effector performing uniform circular motion within a plane to simulate normal operating conditions. The experimental procedure is as follows: Figure 3 As shown, it specifically includes the following stages: Initial state (see Figure 3(1) The robotic arm is in its initial position and displays an external collision object (balloon) for subsequent simulation of a flexible external contact environment.
[0102] Normal operation phase (see) Figure 3 (2) Part: The robotic arm performs the task according to the predetermined trajectory, and the end effector moves smoothly without external contact. During this stage, the probability inference module based on the integrated Bayesian neural network and the data-driven adaptive momentum observer run in real time, but no collision determination signal is generated.
[0103] Collision phase (see Figure 3 (3) When the robotic arm collides with an external balloon during its movement, the external force introduces additional joint torque disturbance. The adaptive momentum observer estimates the external joint torque signal in real time, and then the collision determination module based on sparse Bayes inference performs probabilistic inference on the estimated signal to generate a collision determination signal.
[0104] Security response phase (see) Figure 3 (4) After the collision determination signal is generated, the robotic arm control system immediately triggers the preset safety response strategy to terminate the current movement of the robotic arm, thereby effectively avoiding further contact or potential danger.
[0105] Experimental results show that the Bayesian inference-based robotic arm collision detection method proposed in this invention can achieve rapid and reliable detection of external collision events without additional force sensors, and effectively trigger safety responses during actual robotic arm operation, verifying the feasibility and effectiveness of the method in real robot systems.
[0106] Based on the same inventive concept, embodiments of the present invention also provide an electronic device, specifically, the electronic device includes a processor and a storage device; the storage device stores a computer program, and the computer program, when run by the processor, executes the method described in any of the above embodiments.
[0107] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 400 includes: a processor 410, a memory 420, a communication interface 430, and a bus 440. The memory 420 stores machine-readable instructions that can be executed by the processor 410. When the electronic device is running, the processor 410 communicates with the memory 420 through the bus 440. The processor 410 executes the machine-readable instructions to perform the steps of the method described above.
[0108] Specifically, the memory 420 and processor 410 can be general-purpose memory and processor, without any specific limitations. When the processor 410 runs the computer program stored in the memory 420, it can execute the above method.
[0109] Processor 410 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 410 or by instructions in software form. The processor 410 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 420, and processor 410 reads the information from memory 420 and, in conjunction with its hardware, completes the steps of the above method.
[0110] Corresponding to the above method, this embodiment of the invention also provides a computer-readable storage medium storing machine-executable instructions. When the computer-executable instructions are called and run by a processor, the computer-executable instructions cause the processor to perform the steps of the above method.
[0111] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0112] Furthermore, 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.
[0113] Furthermore, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0114] It should be noted that if the functionality is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0115] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.
[0116] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A collision detection method for a robotic arm based on Bayesian inference, characterized in that, The method includes: Based on the joint space dynamics model of the robotic arm, a generalized momentum model containing unknown dynamic terms and external joint torques is constructed. An integrated Bayesian neural network is used to perform probabilistic inference on the unknown dynamic term, and the predicted mean and predicted variance of the unknown dynamic term are output. Based on the predicted mean and the predicted variance, a data-driven adaptive momentum observer is constructed; the adaptive momentum observer is used to generate an estimated signal of the external joint torque. Based on the sparsity characteristics of external collision perturbations, collision detection based on sparse Bayesian inference is performed on the estimated signal of the external joint torque to generate a collision determination signal.
2. The method according to claim 1, characterized in that, Prior to the step of constructing the generalized momentum model, the method further includes: A dynamic model of an n-degree-of-freedom robotic arm is constructed based on the Euler-Lagrange equations; Based on the aforementioned robotic arm dynamics model and the predefined generalized momentum, a generalized momentum model is constructed; The expression for the dynamic model of the robotic arm is: ; Where q represents the joint position in generalized coordinates. Indicates joint velocity. M(q) represents joint acceleration; M(q) represents the inertia matrix. Let g(q) denote the Coriolis matrix, and g(q) denote the gravity vector. This represents the unknown dynamic terms in the dynamics of the robotic arm; This indicates the driving torque of the joint motor. Indicates external joint torque; The predefined generalized momentum is: ; The expression for the generalized momentum model is: 。 3. The method according to claim 1, characterized in that, The steps of using an integrated Bayesian neural network to perform probabilistic inference on the unknown dynamics term include: A training dataset is constructed using the joint positions and velocities collected during the operation of the robotic arm as input data and the dynamic residuals at corresponding moments as labels. The training dataset is input into multiple Bayesian neural networks that have been randomly initialized and trained independently. Each Bayesian neural network uses a loss function based on maximum a posteriori estimation to obtain local minimum solutions for the neural network parameters. Based on the local minimum solution, the predicted distribution is inferred through Monte Carlo sampling to generate the predicted mean and predicted variance of the unknown dynamic term; wherein, the predicted mean is used to characterize the optimal estimation result of the unknown dynamic term, and the predicted variance is used to quantify the uncertainty of the estimation result.
4. The method according to claim 1, characterized in that, The predicted mean is used to compensate for the unknown dynamics term; the predicted variance is used to dynamically adjust the observation gain matrix of the adaptive momentum observer; the method further includes: The adaptive momentum observer generates an estimated signal of the external joint torque based on the generalized momentum model, the predicted mean, and the dynamically adjusted observation gain matrix.
5. The method according to claim 4, characterized in that, The observation gain matrix is a non-negative and non-increasing diagonal matrix with respect to the prediction variance. Each diagonal element of the diagonal matrix is obtained by mapping the prediction variance of the corresponding joint through a nonlinear function. The nonlinear function satisfies the monotonically decreasing property and has preset upper and lower limits.
6. The method according to claim 1, characterized in that, Based on the sparsity characteristics of external collision perturbations, collision detection based on sparse Bayesian inference is performed on the estimated signal of the external joint torque, including: Based on the sparse distribution characteristics of collision events in the time and joint dimensions, a probabilistic model of collision marker variables is constructed. Based on the probability model and the estimated signal of the external joint torque, the posterior probability of the collision marker variable is calculated using Bayes' formula, and the collision state inference result is determined based on the maximum a posteriori estimate.
7. The method according to claim 6, characterized in that, The generation of the collision determination signal includes: The log-posterior ratio is calculated based on the posterior probability, and then compared with a preset threshold. When the log-posterior ratio is greater than the preset threshold, a collision determination signal is output; when the log-posterior ratio is not greater than the preset threshold, a no-collision determination signal is output.
8. A collision detection system for a robotic arm based on Bayesian inference, characterized in that, The system includes: The model building module is used to construct a generalized momentum model that includes unknown dynamic terms and external joint torques based on the spatial dynamics model of the robotic arm joints. The probability inference module is used to perform probability inference on the unknown dynamic term using an integrated Bayesian neural network, and output the predicted mean and predicted variance of the unknown dynamic term. A momentum observer construction module is used to construct a data-driven adaptive momentum observer based on the predicted mean and the predicted variance; the adaptive momentum observer is used to generate an estimated signal of the external joint torque. The collision detection module is used to perform collision detection based on sparse Bayesian inference on the estimated signal of the external joint torque based on the sparsity characteristics of the external collision disturbance, and generate a collision determination signal.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 7.